@macrulez/masonry-kit-nuxt 0.1.1 → 0.1.3
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.d.ts +0 -5
- package/dist/module.js +5 -17
- package/dist/module.js.map +1 -1
- package/dist/runtime/plugin.js.map +1 -1
- package/package.json +2 -2
package/dist/module.d.ts
CHANGED
|
@@ -2,23 +2,18 @@ import { NuxtModule } from '@nuxt/schema';
|
|
|
2
2
|
import { LaneSpec } from '@macrulez/masonry-kit-vue';
|
|
3
3
|
|
|
4
4
|
interface ModuleOptions {
|
|
5
|
-
/** Falls through to @macrulez/masonry-kit-core's own default ('vertical') when unset. */
|
|
6
5
|
direction?: 'vertical' | 'horizontal';
|
|
7
6
|
columns?: LaneSpec;
|
|
8
7
|
rows?: LaneSpec;
|
|
9
|
-
/** Falls through to @macrulez/masonry-kit-core's own default (240) when unset. */
|
|
10
8
|
minLaneSize?: number;
|
|
11
9
|
gap?: number | {
|
|
12
10
|
main?: number;
|
|
13
11
|
cross?: number;
|
|
14
12
|
};
|
|
15
13
|
placement?: 'balanced' | 'ordered';
|
|
16
|
-
/** Falls through to @macrulez/masonry-kit-core's own default (true) when unset. */
|
|
17
14
|
animate?: boolean;
|
|
18
|
-
/** Falls through to @macrulez/masonry-kit-core's own default (250) when unset. */
|
|
19
15
|
transitionDuration?: number;
|
|
20
16
|
transitionEasing?: string;
|
|
21
|
-
/** CSS-columns SSR fallback (§4.4). Falls through to `columns`/`rows` (if concrete), else a conservative default of 2, when unset. */
|
|
22
17
|
ssrColumns?: number;
|
|
23
18
|
}
|
|
24
19
|
declare const masonryKitModule: NuxtModule<ModuleOptions>;
|
package/dist/module.js
CHANGED
|
@@ -5,27 +5,15 @@ var masonryKitModule = defineNuxtModule({
|
|
|
5
5
|
name: "@macrulez/masonry-kit-nuxt",
|
|
6
6
|
configKey: "masonry"
|
|
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/masonry-kit-core's own defaults — hardcoding one here would
|
|
11
|
-
// silently shadow it, making a change to core's default look like it does
|
|
12
|
-
// nothing for a Nuxt consumer.
|
|
13
8
|
setup(options, nuxt) {
|
|
14
9
|
const resolver = createResolver(import.meta.url);
|
|
15
10
|
addComponent({ name: "MasonryGrid", export: "MasonryGrid", filePath: "@macrulez/masonry-kit-vue" });
|
|
16
11
|
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
|
-
};
|
|
12
|
+
const publicConfig = {};
|
|
13
|
+
for (const [key, value] of Object.entries(options)) {
|
|
14
|
+
if (value !== void 0) publicConfig[key] = value;
|
|
15
|
+
}
|
|
16
|
+
nuxt.options.runtimeConfig.public.masonry = publicConfig;
|
|
29
17
|
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
30
18
|
}
|
|
31
19
|
});
|
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
|
|
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 direction?: 'vertical' | 'horizontal'\n columns?: LaneSpec\n rows?: LaneSpec\n minLaneSize?: number\n gap?: number | { main?: number; cross?: number }\n placement?: 'balanced' | 'ordered'\n animate?: boolean\n transitionDuration?: number\n transitionEasing?: string\n ssrColumns?: number\n}\n\nconst masonryKitModule: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({\n meta: {\n name: '@macrulez/masonry-kit-nuxt',\n configKey: 'masonry',\n },\n \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 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 addPlugin(resolver.resolve('./runtime/plugin'))\n },\n})\n\nexport default masonryKitModule\n"],"mappings":";AAAA,SAAS,cAAc,YAAY,WAAW,gBAAgB,wBAAwB;AAiBtF,IAAM,mBAA8C,iBAAgC;AAAA,EAClF,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EAEA,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;AAEpE,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;AAE5C,cAAU,SAAS,QAAQ,kBAAkB,CAAC;AAAA,EAChD;AACF,CAAC;AAED,IAAO,iBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { setMasonryDefaults, type MasonryDefaults } from '@macrulez/masonry-kit-vue'\nimport { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { setMasonryDefaults, type MasonryDefaults } from '@macrulez/masonry-kit-vue'\nimport { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin(() => {\n const config = useRuntimeConfig().public.masonry as MasonryDefaults | undefined\n if (config) setMasonryDefaults(config)\n})\n"],"mappings":";AAAA,SAAS,0BAAgD;AACzD,SAAS,kBAAkB,wBAAwB;AAEnD,IAAO,iBAAQ,iBAAiB,MAAM;AACpC,QAAM,SAAS,iBAAiB,EAAE,OAAO;AACzC,MAAI,OAAQ,oBAAmB,MAAM;AACvC,CAAC;","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.3",
|
|
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.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@nuxt/schema": "^4.5.2",
|