@wyxos/vibe 1.2.10 → 1.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyxos/vibe",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "type": "module",
package/src/App.vue CHANGED
@@ -35,7 +35,7 @@ const getPage = async (page) => {
35
35
  <p>Loading: <span class="bg-blue-500 text-white p-2 rounded">{{ masonry.isLoading }}</span></p>
36
36
  </div>
37
37
  </header>
38
- <masonry v-model:items="items" :get-next-page="getPage" ref="masonry">
38
+ <masonry class="bg-blue-500 " v-model:items="items" :get-next-page="getPage" ref="masonry">
39
39
  <template #item="{item, onRemove}">
40
40
  <img :src="item.src" class="w-full"/>
41
41
  <button class="absolute bottom-0 right-0 bg-red-500 text-white p-2 rounded cursor-pointer" @click="onRemove(item)">
package/src/Masonry.vue CHANGED
@@ -258,13 +258,13 @@ onUnmounted(() => {
258
258
  </script>
259
259
 
260
260
  <template>
261
- <div class="overflow-auto bg-blue-500 w-full flex-1" ref="container">
261
+ <div class="overflow-auto w-full flex-1" ref="container">
262
262
  <div class="relative" :style="{height: `${containerHeight}px`}">
263
263
  <transition-group :css="false" @enter="onEnter" @before-enter="onBeforeEnter"
264
264
  @leave="onLeave"
265
265
  @before-leave="onBeforeLeave">
266
266
  <div v-for="item in masonry" :key="`${item.page}-${item.id}`"
267
- class="bg-slate-200 absolute transition-[top,left,opacity] duration-500 ease-in-out"
267
+ class="absolute transition-[top,left,opacity] duration-500 ease-in-out"
268
268
  v-bind="itemAttributes(item)">
269
269
  <slot name="item" v-bind="{item, onRemove}">
270
270
  <img :src="item.src" class="w-full"/>
@@ -56,12 +56,12 @@ export default function calculateLayout(items, container, columnCount, options =
56
56
 
57
57
  const col = index % columnCount;
58
58
  const originalWidth = item.width;
59
- const originalHeight = item.height;
59
+ const originalHeight = item.height + footer + header;
60
60
 
61
61
  newItem.columnWidth = columnWidth;
62
62
  newItem.left = col * (columnWidth + gutterX);
63
63
  newItem.columnHeight = Math.round((columnWidth * originalHeight) / originalWidth);
64
- newItem.top = columnHeights[col] + header + footer;
64
+ newItem.top = columnHeights[col];
65
65
 
66
66
  columnHeights[col] += newItem.columnHeight + gutterY;
67
67