@macrulez/masonry-kit-nuxt 0.1.1 → 0.1.2
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.js +6 -13
- package/dist/module.js.map +1 -1
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -6,7 +6,7 @@ var masonryKitModule = defineNuxtModule({
|
|
|
6
6
|
configKey: "masonry"
|
|
7
7
|
},
|
|
8
8
|
// No `defaults` here on purpose: an option the user didn't set in
|
|
9
|
-
// nuxt.config.ts must stay
|
|
9
|
+
// nuxt.config.ts must stay unset all the way through to
|
|
10
10
|
// @macrulez/masonry-kit-core's own defaults — hardcoding one here would
|
|
11
11
|
// silently shadow it, making a change to core's default look like it does
|
|
12
12
|
// nothing for a Nuxt consumer.
|
|
@@ -14,18 +14,11 @@ var masonryKitModule = defineNuxtModule({
|
|
|
14
14
|
const resolver = createResolver(import.meta.url);
|
|
15
15
|
addComponent({ name: "MasonryGrid", export: "MasonryGrid", filePath: "@macrulez/masonry-kit-vue" });
|
|
16
16
|
addImports({ name: "useMasonry", from: "@macrulez/masonry-kit-vue" });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
gap: options.gap,
|
|
23
|
-
placement: options.placement,
|
|
24
|
-
animate: options.animate,
|
|
25
|
-
transitionDuration: options.transitionDuration,
|
|
26
|
-
transitionEasing: options.transitionEasing,
|
|
27
|
-
ssrColumns: options.ssrColumns
|
|
28
|
-
};
|
|
17
|
+
const publicConfig = {};
|
|
18
|
+
for (const [key, value] of Object.entries(options)) {
|
|
19
|
+
if (value !== void 0) publicConfig[key] = value;
|
|
20
|
+
}
|
|
21
|
+
nuxt.options.runtimeConfig.public.masonry = publicConfig;
|
|
29
22
|
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
30
23
|
}
|
|
31
24
|
});
|
package/dist/module.js.map
CHANGED
|
@@ -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 { LaneSpec } from '@macrulez/masonry-kit-vue'\n\nexport interface ModuleOptions {\n /** Falls through to @macrulez/masonry-kit-core's own default ('vertical') when unset. */\n direction?: 'vertical' | 'horizontal'\n columns?: LaneSpec\n rows?: LaneSpec\n /** Falls through to @macrulez/masonry-kit-core's own default (240) when unset. */\n minLaneSize?: number\n gap?: number | { main?: number; cross?: number }\n placement?: 'balanced' | 'ordered'\n /** Falls through to @macrulez/masonry-kit-core's own default (true) when unset. */\n animate?: boolean\n /** Falls through to @macrulez/masonry-kit-core's own default (250) when unset. */\n transitionDuration?: number\n transitionEasing?: string\n /** CSS-columns SSR fallback (§4.4). Falls through to `columns`/`rows` (if concrete), else a conservative default of 2, when unset. */\n ssrColumns?: number\n}\n\nconst masonryKitModule: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@macrulez/masonry-kit-nuxt',\n configKey: 'masonry',\n },\n // No `defaults` here on purpose: an option the user didn't set in\n // nuxt.config.ts must stay
|
|
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 { LaneSpec } from '@macrulez/masonry-kit-vue'\n\nexport interface ModuleOptions {\n /** Falls through to @macrulez/masonry-kit-core's own default ('vertical') when unset. */\n direction?: 'vertical' | 'horizontal'\n columns?: LaneSpec\n rows?: LaneSpec\n /** Falls through to @macrulez/masonry-kit-core's own default (240) when unset. */\n minLaneSize?: number\n gap?: number | { main?: number; cross?: number }\n placement?: 'balanced' | 'ordered'\n /** Falls through to @macrulez/masonry-kit-core's own default (true) when unset. */\n animate?: boolean\n /** Falls through to @macrulez/masonry-kit-core's own default (250) when unset. */\n transitionDuration?: number\n transitionEasing?: string\n /** CSS-columns SSR fallback (§4.4). Falls through to `columns`/`rows` (if concrete), else a conservative default of 2, when unset. */\n ssrColumns?: number\n}\n\nconst masonryKitModule: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@macrulez/masonry-kit-nuxt',\n configKey: 'masonry',\n },\n // No `defaults` here on purpose: an option the user didn't set in\n // nuxt.config.ts must stay unset all the way through to\n // @macrulez/masonry-kit-core's own defaults — hardcoding one here would\n // silently shadow it, making a change to core's default look like it does\n // nothing for a Nuxt consumer.\n setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n addComponent({ name: 'MasonryGrid', export: 'MasonryGrid', filePath: '@macrulez/masonry-kit-vue' })\n addImports({ name: 'useMasonry', from: '@macrulez/masonry-kit-vue' })\n\n // Omitting a key entirely (rather than assigning it `undefined`) matters\n // here: Nuxt's runtime-config schema resolution coerces an `undefined`\n // value it can't infer a type for into `''`, and `''` isn't nullish, so\n // core's own `?? default` fallbacks never kick in downstream — an\n // unconfigured `direction`/`columns`/etc would silently become the\n // literal string `''` instead of falling through to core's default.\n const publicConfig: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(options)) {\n if (value !== undefined) publicConfig[key] = value\n }\n nuxt.options.runtimeConfig.public.masonry = publicConfig as ModuleOptions\n\n // Universal plugin (server + client) — most of these are only consulted\n // once the engine exists client-side (onMounted), but `ssrColumns`\n // (§4.4) is read directly by <MasonryGrid>'s render function, which also\n // runs during SSR, so the defaults need to be seeded there too.\n addPlugin(resolver.resolve('./runtime/plugin'))\n },\n})\n\nexport default masonryKitModule\n"],"mappings":";AAAA,SAAS,cAAc,YAAY,WAAW,gBAAgB,wBAAwB;AAsBtF,IAAM,mBAA8C,iBAAgC;AAAA,EAClF,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,eAAe,QAAQ,eAAe,UAAU,4BAA4B,CAAC;AAClG,eAAW,EAAE,MAAM,cAAc,MAAM,4BAA4B,CAAC;AAQpE,UAAM,eAAwC,CAAC;AAC/C,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG;AAClD,UAAI,UAAU,OAAW,cAAa,GAAG,IAAI;AAAA,IAC/C;AACA,SAAK,QAAQ,cAAc,OAAO,UAAU;AAM5C,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/masonry-kit-nuxt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Nuxt module wrapping @macrulez/masonry-kit-vue: auto-imported <MasonryGrid> and useMasonry, module options for default layout behavior",
|
|
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/masonry-kit-vue": "0.1.
|
|
28
|
+
"@macrulez/masonry-kit-vue": "0.1.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@nuxt/schema": "^4.5.2",
|