@thangdevalone/meeting-grid-layout-vue 1.5.6 → 1.5.8
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/index.cjs +75 -24
- package/dist/index.d.cts +44 -1
- package/dist/index.d.mts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.mjs +75 -24
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -163,6 +163,26 @@ const GridContainer = vue.defineComponent({
|
|
|
163
163
|
type: Boolean,
|
|
164
164
|
default: false
|
|
165
165
|
},
|
|
166
|
+
/**
|
|
167
|
+
* Disable the floating PiP in 2-person mode.
|
|
168
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
169
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
170
|
+
* @default false
|
|
171
|
+
*/
|
|
172
|
+
disableFloat: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: false
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
* Disable all animations globally.
|
|
178
|
+
* When true, all grid items and float items render without
|
|
179
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
disableAnimation: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: false
|
|
185
|
+
},
|
|
166
186
|
/** HTML tag to render */
|
|
167
187
|
tag: {
|
|
168
188
|
type: String,
|
|
@@ -189,13 +209,15 @@ const GridContainer = vue.defineComponent({
|
|
|
189
209
|
floatHeight: props.floatHeight,
|
|
190
210
|
floatBreakpoints: props.floatBreakpoints,
|
|
191
211
|
pipIndex: props.pipIndex,
|
|
192
|
-
pinOnly: props.pinOnly
|
|
212
|
+
pinOnly: props.pinOnly,
|
|
213
|
+
disableFloat: props.disableFloat
|
|
193
214
|
}));
|
|
194
215
|
const grid = useMeetGrid(gridOptions);
|
|
195
216
|
vue.provide(GridContextKey, {
|
|
196
217
|
grid,
|
|
197
218
|
springPreset: props.springPreset,
|
|
198
|
-
dimensions
|
|
219
|
+
dimensions,
|
|
220
|
+
disableAnimation: props.disableAnimation
|
|
199
221
|
});
|
|
200
222
|
return () => vue.h(
|
|
201
223
|
props.tag,
|
|
@@ -242,7 +264,8 @@ const GridItem = vue.defineComponent({
|
|
|
242
264
|
console.warn("GridItem must be used inside a GridContainer");
|
|
243
265
|
return () => null;
|
|
244
266
|
}
|
|
245
|
-
const { grid, springPreset, dimensions: containerDimensions } = context;
|
|
267
|
+
const { grid, springPreset, dimensions: containerDimensions, disableAnimation: containerDisableAnimation } = context;
|
|
268
|
+
const noAnimation = vue.computed(() => containerDisableAnimation || props.disableAnimation);
|
|
246
269
|
const position = vue.computed(() => grid.value.getPosition(props.index));
|
|
247
270
|
const dimensions = vue.computed(() => grid.value.getItemDimensions(props.index));
|
|
248
271
|
const contentDimensions = vue.computed(
|
|
@@ -320,9 +343,14 @@ const GridItem = vue.defineComponent({
|
|
|
320
343
|
([, w, h2]) => {
|
|
321
344
|
if (isFloat.value && floatInitialized.value && w > 0 && h2 > 0) {
|
|
322
345
|
const pos = getFloatCornerPos(floatAnchor.value);
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
346
|
+
if (noAnimation.value) {
|
|
347
|
+
x.set(pos.x);
|
|
348
|
+
y.set(pos.y);
|
|
349
|
+
} else {
|
|
350
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
351
|
+
motionV.animate(x, pos.x, springCfg);
|
|
352
|
+
motionV.animate(y, pos.y, springCfg);
|
|
353
|
+
}
|
|
326
354
|
}
|
|
327
355
|
}
|
|
328
356
|
);
|
|
@@ -352,6 +380,9 @@ const GridItem = vue.defineComponent({
|
|
|
352
380
|
gridX.set(pos.left);
|
|
353
381
|
gridY.set(pos.top);
|
|
354
382
|
gridAnimReady.value = true;
|
|
383
|
+
} else if (noAnimation.value) {
|
|
384
|
+
gridX.set(pos.left);
|
|
385
|
+
gridY.set(pos.top);
|
|
355
386
|
} else {
|
|
356
387
|
const cfg = {
|
|
357
388
|
type: "spring",
|
|
@@ -390,9 +421,14 @@ const GridItem = vue.defineComponent({
|
|
|
390
421
|
const nearestCorner = findFloatNearestCorner(currentX, currentY);
|
|
391
422
|
floatAnchor.value = nearestCorner;
|
|
392
423
|
const snapPos = getFloatCornerPos(nearestCorner);
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
424
|
+
if (noAnimation.value) {
|
|
425
|
+
x.set(snapPos.x);
|
|
426
|
+
y.set(snapPos.y);
|
|
427
|
+
} else {
|
|
428
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
429
|
+
motionV.animate(x, snapPos.x, springCfg);
|
|
430
|
+
motionV.animate(y, snapPos.y, springCfg);
|
|
431
|
+
}
|
|
396
432
|
};
|
|
397
433
|
return vue.h(
|
|
398
434
|
motionV.motion.div,
|
|
@@ -418,8 +454,8 @@ const GridItem = vue.defineComponent({
|
|
|
418
454
|
x,
|
|
419
455
|
y
|
|
420
456
|
},
|
|
421
|
-
whileDrag: { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
422
|
-
transition: { type: "spring", stiffness: 400, damping: 30 },
|
|
457
|
+
whileDrag: noAnimation.value ? { cursor: "grabbing" } : { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
458
|
+
transition: noAnimation.value ? { duration: 0 } : { type: "spring", stiffness: 400, damping: 30 },
|
|
423
459
|
"data-grid-index": props.index,
|
|
424
460
|
"data-grid-float": true,
|
|
425
461
|
onDragEnd: handleDragEnd
|
|
@@ -429,7 +465,7 @@ const GridItem = vue.defineComponent({
|
|
|
429
465
|
}
|
|
430
466
|
const itemWidth = dimensions.value.width;
|
|
431
467
|
const itemHeight = dimensions.value.height;
|
|
432
|
-
if (
|
|
468
|
+
if (noAnimation.value) {
|
|
433
469
|
return vue.h(
|
|
434
470
|
props.tag,
|
|
435
471
|
{
|
|
@@ -564,7 +600,7 @@ const FloatingGridItem = vue.defineComponent({
|
|
|
564
600
|
console.warn("FloatingGridItem must be used inside a GridContainer");
|
|
565
601
|
return () => null;
|
|
566
602
|
}
|
|
567
|
-
const { dimensions } = context;
|
|
603
|
+
const { dimensions, disableAnimation: containerDisableAnimation } = context;
|
|
568
604
|
const currentAnchor = vue.ref(props.anchor);
|
|
569
605
|
const effectiveSize = vue.computed(() => {
|
|
570
606
|
if (props.breakpoints && props.breakpoints.length > 0 && dimensions.value.width > 0) {
|
|
@@ -634,9 +670,14 @@ const FloatingGridItem = vue.defineComponent({
|
|
|
634
670
|
if (isInitialized.value && w > 0 && h2 > 0 && newAnchor !== currentAnchor.value) {
|
|
635
671
|
currentAnchor.value = newAnchor;
|
|
636
672
|
const pos = getCornerPosition(newAnchor);
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
673
|
+
if (containerDisableAnimation) {
|
|
674
|
+
x.set(pos.x);
|
|
675
|
+
y.set(pos.y);
|
|
676
|
+
} else {
|
|
677
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
678
|
+
motionV.animate(x, pos.x, springCfg);
|
|
679
|
+
motionV.animate(y, pos.y, springCfg);
|
|
680
|
+
}
|
|
640
681
|
}
|
|
641
682
|
}
|
|
642
683
|
);
|
|
@@ -645,9 +686,14 @@ const FloatingGridItem = vue.defineComponent({
|
|
|
645
686
|
() => {
|
|
646
687
|
if (isInitialized.value && containerDimensions.value.width > 0 && containerDimensions.value.height > 0) {
|
|
647
688
|
const pos = getCornerPosition(currentAnchor.value);
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
689
|
+
if (containerDisableAnimation) {
|
|
690
|
+
x.set(pos.x);
|
|
691
|
+
y.set(pos.y);
|
|
692
|
+
} else {
|
|
693
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
694
|
+
motionV.animate(x, pos.x, springCfg);
|
|
695
|
+
motionV.animate(y, pos.y, springCfg);
|
|
696
|
+
}
|
|
651
697
|
}
|
|
652
698
|
}
|
|
653
699
|
);
|
|
@@ -672,9 +718,14 @@ const FloatingGridItem = vue.defineComponent({
|
|
|
672
718
|
currentAnchor.value = nearestCorner;
|
|
673
719
|
emit("anchorChange", nearestCorner);
|
|
674
720
|
const snapPos = getCornerPosition(nearestCorner);
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
721
|
+
if (containerDisableAnimation) {
|
|
722
|
+
x.set(snapPos.x);
|
|
723
|
+
y.set(snapPos.y);
|
|
724
|
+
} else {
|
|
725
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
726
|
+
motionV.animate(x, snapPos.x, springCfg);
|
|
727
|
+
motionV.animate(y, snapPos.y, springCfg);
|
|
728
|
+
}
|
|
678
729
|
};
|
|
679
730
|
return vue.h(
|
|
680
731
|
motionV.motion.div,
|
|
@@ -698,8 +749,8 @@ const FloatingGridItem = vue.defineComponent({
|
|
|
698
749
|
x,
|
|
699
750
|
y
|
|
700
751
|
},
|
|
701
|
-
whileDrag: { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
702
|
-
transition: { type: "spring", stiffness: 400, damping: 30 },
|
|
752
|
+
whileDrag: containerDisableAnimation ? { cursor: "grabbing" } : { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
753
|
+
transition: containerDisableAnimation ? { duration: 0 } : { type: "spring", stiffness: 400, damping: 30 },
|
|
703
754
|
onDragEnd: handleDragEnd
|
|
704
755
|
},
|
|
705
756
|
slots.default?.()
|
package/dist/index.d.cts
CHANGED
|
@@ -50,6 +50,7 @@ interface GridContextValue {
|
|
|
50
50
|
grid: ComputedRef<MeetGridResult>;
|
|
51
51
|
springPreset: SpringPreset;
|
|
52
52
|
dimensions: Ref<GridDimensions>;
|
|
53
|
+
disableAnimation: boolean;
|
|
53
54
|
}
|
|
54
55
|
declare const GridContextKey: InjectionKey<GridContextValue>;
|
|
55
56
|
declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -160,6 +161,26 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
160
161
|
type: BooleanConstructor;
|
|
161
162
|
default: boolean;
|
|
162
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* Disable the floating PiP in 2-person mode.
|
|
166
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
167
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
disableFloat: {
|
|
171
|
+
type: BooleanConstructor;
|
|
172
|
+
default: boolean;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Disable all animations globally.
|
|
176
|
+
* When true, all grid items and float items render without
|
|
177
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
disableAnimation: {
|
|
181
|
+
type: BooleanConstructor;
|
|
182
|
+
default: boolean;
|
|
183
|
+
};
|
|
163
184
|
/** HTML tag to render */
|
|
164
185
|
tag: {
|
|
165
186
|
type: StringConstructor;
|
|
@@ -275,6 +296,26 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
275
296
|
type: BooleanConstructor;
|
|
276
297
|
default: boolean;
|
|
277
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* Disable the floating PiP in 2-person mode.
|
|
301
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
302
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
303
|
+
* @default false
|
|
304
|
+
*/
|
|
305
|
+
disableFloat: {
|
|
306
|
+
type: BooleanConstructor;
|
|
307
|
+
default: boolean;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Disable all animations globally.
|
|
311
|
+
* When true, all grid items and float items render without
|
|
312
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
disableAnimation: {
|
|
316
|
+
type: BooleanConstructor;
|
|
317
|
+
default: boolean;
|
|
318
|
+
};
|
|
278
319
|
/** HTML tag to render */
|
|
279
320
|
tag: {
|
|
280
321
|
type: StringConstructor;
|
|
@@ -297,6 +338,8 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
297
338
|
floatBreakpoints: PipBreakpoint[];
|
|
298
339
|
pipIndex: number;
|
|
299
340
|
pinOnly: boolean;
|
|
341
|
+
disableFloat: boolean;
|
|
342
|
+
disableAnimation: boolean;
|
|
300
343
|
tag: string;
|
|
301
344
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
302
345
|
declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -344,8 +387,8 @@ declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
344
387
|
default: string;
|
|
345
388
|
};
|
|
346
389
|
}>> & Readonly<{}>, {
|
|
347
|
-
tag: string;
|
|
348
390
|
disableAnimation: boolean;
|
|
391
|
+
tag: string;
|
|
349
392
|
itemAspectRatio: string;
|
|
350
393
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
351
394
|
declare const GridOverlay: vue.DefineComponent<vue.ExtractPropTypes<{
|
package/dist/index.d.mts
CHANGED
|
@@ -50,6 +50,7 @@ interface GridContextValue {
|
|
|
50
50
|
grid: ComputedRef<MeetGridResult>;
|
|
51
51
|
springPreset: SpringPreset;
|
|
52
52
|
dimensions: Ref<GridDimensions>;
|
|
53
|
+
disableAnimation: boolean;
|
|
53
54
|
}
|
|
54
55
|
declare const GridContextKey: InjectionKey<GridContextValue>;
|
|
55
56
|
declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -160,6 +161,26 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
160
161
|
type: BooleanConstructor;
|
|
161
162
|
default: boolean;
|
|
162
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* Disable the floating PiP in 2-person mode.
|
|
166
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
167
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
disableFloat: {
|
|
171
|
+
type: BooleanConstructor;
|
|
172
|
+
default: boolean;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Disable all animations globally.
|
|
176
|
+
* When true, all grid items and float items render without
|
|
177
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
disableAnimation: {
|
|
181
|
+
type: BooleanConstructor;
|
|
182
|
+
default: boolean;
|
|
183
|
+
};
|
|
163
184
|
/** HTML tag to render */
|
|
164
185
|
tag: {
|
|
165
186
|
type: StringConstructor;
|
|
@@ -275,6 +296,26 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
275
296
|
type: BooleanConstructor;
|
|
276
297
|
default: boolean;
|
|
277
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* Disable the floating PiP in 2-person mode.
|
|
301
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
302
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
303
|
+
* @default false
|
|
304
|
+
*/
|
|
305
|
+
disableFloat: {
|
|
306
|
+
type: BooleanConstructor;
|
|
307
|
+
default: boolean;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Disable all animations globally.
|
|
311
|
+
* When true, all grid items and float items render without
|
|
312
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
disableAnimation: {
|
|
316
|
+
type: BooleanConstructor;
|
|
317
|
+
default: boolean;
|
|
318
|
+
};
|
|
278
319
|
/** HTML tag to render */
|
|
279
320
|
tag: {
|
|
280
321
|
type: StringConstructor;
|
|
@@ -297,6 +338,8 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
297
338
|
floatBreakpoints: PipBreakpoint[];
|
|
298
339
|
pipIndex: number;
|
|
299
340
|
pinOnly: boolean;
|
|
341
|
+
disableFloat: boolean;
|
|
342
|
+
disableAnimation: boolean;
|
|
300
343
|
tag: string;
|
|
301
344
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
302
345
|
declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -344,8 +387,8 @@ declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
344
387
|
default: string;
|
|
345
388
|
};
|
|
346
389
|
}>> & Readonly<{}>, {
|
|
347
|
-
tag: string;
|
|
348
390
|
disableAnimation: boolean;
|
|
391
|
+
tag: string;
|
|
349
392
|
itemAspectRatio: string;
|
|
350
393
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
351
394
|
declare const GridOverlay: vue.DefineComponent<vue.ExtractPropTypes<{
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ interface GridContextValue {
|
|
|
50
50
|
grid: ComputedRef<MeetGridResult>;
|
|
51
51
|
springPreset: SpringPreset;
|
|
52
52
|
dimensions: Ref<GridDimensions>;
|
|
53
|
+
disableAnimation: boolean;
|
|
53
54
|
}
|
|
54
55
|
declare const GridContextKey: InjectionKey<GridContextValue>;
|
|
55
56
|
declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -160,6 +161,26 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
160
161
|
type: BooleanConstructor;
|
|
161
162
|
default: boolean;
|
|
162
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* Disable the floating PiP in 2-person mode.
|
|
166
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
167
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
disableFloat: {
|
|
171
|
+
type: BooleanConstructor;
|
|
172
|
+
default: boolean;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Disable all animations globally.
|
|
176
|
+
* When true, all grid items and float items render without
|
|
177
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
disableAnimation: {
|
|
181
|
+
type: BooleanConstructor;
|
|
182
|
+
default: boolean;
|
|
183
|
+
};
|
|
163
184
|
/** HTML tag to render */
|
|
164
185
|
tag: {
|
|
165
186
|
type: StringConstructor;
|
|
@@ -275,6 +296,26 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
275
296
|
type: BooleanConstructor;
|
|
276
297
|
default: boolean;
|
|
277
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* Disable the floating PiP in 2-person mode.
|
|
301
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
302
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
303
|
+
* @default false
|
|
304
|
+
*/
|
|
305
|
+
disableFloat: {
|
|
306
|
+
type: BooleanConstructor;
|
|
307
|
+
default: boolean;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Disable all animations globally.
|
|
311
|
+
* When true, all grid items and float items render without
|
|
312
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
disableAnimation: {
|
|
316
|
+
type: BooleanConstructor;
|
|
317
|
+
default: boolean;
|
|
318
|
+
};
|
|
278
319
|
/** HTML tag to render */
|
|
279
320
|
tag: {
|
|
280
321
|
type: StringConstructor;
|
|
@@ -297,6 +338,8 @@ declare const GridContainer: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
297
338
|
floatBreakpoints: PipBreakpoint[];
|
|
298
339
|
pipIndex: number;
|
|
299
340
|
pinOnly: boolean;
|
|
341
|
+
disableFloat: boolean;
|
|
342
|
+
disableAnimation: boolean;
|
|
300
343
|
tag: string;
|
|
301
344
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
302
345
|
declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
@@ -344,8 +387,8 @@ declare const GridItem: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
344
387
|
default: string;
|
|
345
388
|
};
|
|
346
389
|
}>> & Readonly<{}>, {
|
|
347
|
-
tag: string;
|
|
348
390
|
disableAnimation: boolean;
|
|
391
|
+
tag: string;
|
|
349
392
|
itemAspectRatio: string;
|
|
350
393
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
351
394
|
declare const GridOverlay: vue.DefineComponent<vue.ExtractPropTypes<{
|
package/dist/index.mjs
CHANGED
|
@@ -162,6 +162,26 @@ const GridContainer = defineComponent({
|
|
|
162
162
|
type: Boolean,
|
|
163
163
|
default: false
|
|
164
164
|
},
|
|
165
|
+
/**
|
|
166
|
+
* Disable the floating PiP in 2-person mode.
|
|
167
|
+
* When true, 2 participants are laid out in a standard gallery grid
|
|
168
|
+
* instead of one full-screen + one draggable floating PiP.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
disableFloat: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: false
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* Disable all animations globally.
|
|
177
|
+
* When true, all grid items and float items render without
|
|
178
|
+
* spring/transition animations. Items snap to positions instantly.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
disableAnimation: {
|
|
182
|
+
type: Boolean,
|
|
183
|
+
default: false
|
|
184
|
+
},
|
|
165
185
|
/** HTML tag to render */
|
|
166
186
|
tag: {
|
|
167
187
|
type: String,
|
|
@@ -188,13 +208,15 @@ const GridContainer = defineComponent({
|
|
|
188
208
|
floatHeight: props.floatHeight,
|
|
189
209
|
floatBreakpoints: props.floatBreakpoints,
|
|
190
210
|
pipIndex: props.pipIndex,
|
|
191
|
-
pinOnly: props.pinOnly
|
|
211
|
+
pinOnly: props.pinOnly,
|
|
212
|
+
disableFloat: props.disableFloat
|
|
192
213
|
}));
|
|
193
214
|
const grid = useMeetGrid(gridOptions);
|
|
194
215
|
provide(GridContextKey, {
|
|
195
216
|
grid,
|
|
196
217
|
springPreset: props.springPreset,
|
|
197
|
-
dimensions
|
|
218
|
+
dimensions,
|
|
219
|
+
disableAnimation: props.disableAnimation
|
|
198
220
|
});
|
|
199
221
|
return () => h(
|
|
200
222
|
props.tag,
|
|
@@ -241,7 +263,8 @@ const GridItem = defineComponent({
|
|
|
241
263
|
console.warn("GridItem must be used inside a GridContainer");
|
|
242
264
|
return () => null;
|
|
243
265
|
}
|
|
244
|
-
const { grid, springPreset, dimensions: containerDimensions } = context;
|
|
266
|
+
const { grid, springPreset, dimensions: containerDimensions, disableAnimation: containerDisableAnimation } = context;
|
|
267
|
+
const noAnimation = computed(() => containerDisableAnimation || props.disableAnimation);
|
|
245
268
|
const position = computed(() => grid.value.getPosition(props.index));
|
|
246
269
|
const dimensions = computed(() => grid.value.getItemDimensions(props.index));
|
|
247
270
|
const contentDimensions = computed(
|
|
@@ -319,9 +342,14 @@ const GridItem = defineComponent({
|
|
|
319
342
|
([, w, h2]) => {
|
|
320
343
|
if (isFloat.value && floatInitialized.value && w > 0 && h2 > 0) {
|
|
321
344
|
const pos = getFloatCornerPos(floatAnchor.value);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
345
|
+
if (noAnimation.value) {
|
|
346
|
+
x.set(pos.x);
|
|
347
|
+
y.set(pos.y);
|
|
348
|
+
} else {
|
|
349
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
350
|
+
animate(x, pos.x, springCfg);
|
|
351
|
+
animate(y, pos.y, springCfg);
|
|
352
|
+
}
|
|
325
353
|
}
|
|
326
354
|
}
|
|
327
355
|
);
|
|
@@ -351,6 +379,9 @@ const GridItem = defineComponent({
|
|
|
351
379
|
gridX.set(pos.left);
|
|
352
380
|
gridY.set(pos.top);
|
|
353
381
|
gridAnimReady.value = true;
|
|
382
|
+
} else if (noAnimation.value) {
|
|
383
|
+
gridX.set(pos.left);
|
|
384
|
+
gridY.set(pos.top);
|
|
354
385
|
} else {
|
|
355
386
|
const cfg = {
|
|
356
387
|
type: "spring",
|
|
@@ -389,9 +420,14 @@ const GridItem = defineComponent({
|
|
|
389
420
|
const nearestCorner = findFloatNearestCorner(currentX, currentY);
|
|
390
421
|
floatAnchor.value = nearestCorner;
|
|
391
422
|
const snapPos = getFloatCornerPos(nearestCorner);
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
423
|
+
if (noAnimation.value) {
|
|
424
|
+
x.set(snapPos.x);
|
|
425
|
+
y.set(snapPos.y);
|
|
426
|
+
} else {
|
|
427
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
428
|
+
animate(x, snapPos.x, springCfg);
|
|
429
|
+
animate(y, snapPos.y, springCfg);
|
|
430
|
+
}
|
|
395
431
|
};
|
|
396
432
|
return h(
|
|
397
433
|
motion.div,
|
|
@@ -417,8 +453,8 @@ const GridItem = defineComponent({
|
|
|
417
453
|
x,
|
|
418
454
|
y
|
|
419
455
|
},
|
|
420
|
-
whileDrag: { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
421
|
-
transition: { type: "spring", stiffness: 400, damping: 30 },
|
|
456
|
+
whileDrag: noAnimation.value ? { cursor: "grabbing" } : { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
457
|
+
transition: noAnimation.value ? { duration: 0 } : { type: "spring", stiffness: 400, damping: 30 },
|
|
422
458
|
"data-grid-index": props.index,
|
|
423
459
|
"data-grid-float": true,
|
|
424
460
|
onDragEnd: handleDragEnd
|
|
@@ -428,7 +464,7 @@ const GridItem = defineComponent({
|
|
|
428
464
|
}
|
|
429
465
|
const itemWidth = dimensions.value.width;
|
|
430
466
|
const itemHeight = dimensions.value.height;
|
|
431
|
-
if (
|
|
467
|
+
if (noAnimation.value) {
|
|
432
468
|
return h(
|
|
433
469
|
props.tag,
|
|
434
470
|
{
|
|
@@ -563,7 +599,7 @@ const FloatingGridItem = defineComponent({
|
|
|
563
599
|
console.warn("FloatingGridItem must be used inside a GridContainer");
|
|
564
600
|
return () => null;
|
|
565
601
|
}
|
|
566
|
-
const { dimensions } = context;
|
|
602
|
+
const { dimensions, disableAnimation: containerDisableAnimation } = context;
|
|
567
603
|
const currentAnchor = ref(props.anchor);
|
|
568
604
|
const effectiveSize = computed(() => {
|
|
569
605
|
if (props.breakpoints && props.breakpoints.length > 0 && dimensions.value.width > 0) {
|
|
@@ -633,9 +669,14 @@ const FloatingGridItem = defineComponent({
|
|
|
633
669
|
if (isInitialized.value && w > 0 && h2 > 0 && newAnchor !== currentAnchor.value) {
|
|
634
670
|
currentAnchor.value = newAnchor;
|
|
635
671
|
const pos = getCornerPosition(newAnchor);
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
672
|
+
if (containerDisableAnimation) {
|
|
673
|
+
x.set(pos.x);
|
|
674
|
+
y.set(pos.y);
|
|
675
|
+
} else {
|
|
676
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
677
|
+
animate(x, pos.x, springCfg);
|
|
678
|
+
animate(y, pos.y, springCfg);
|
|
679
|
+
}
|
|
639
680
|
}
|
|
640
681
|
}
|
|
641
682
|
);
|
|
@@ -644,9 +685,14 @@ const FloatingGridItem = defineComponent({
|
|
|
644
685
|
() => {
|
|
645
686
|
if (isInitialized.value && containerDimensions.value.width > 0 && containerDimensions.value.height > 0) {
|
|
646
687
|
const pos = getCornerPosition(currentAnchor.value);
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
688
|
+
if (containerDisableAnimation) {
|
|
689
|
+
x.set(pos.x);
|
|
690
|
+
y.set(pos.y);
|
|
691
|
+
} else {
|
|
692
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
693
|
+
animate(x, pos.x, springCfg);
|
|
694
|
+
animate(y, pos.y, springCfg);
|
|
695
|
+
}
|
|
650
696
|
}
|
|
651
697
|
}
|
|
652
698
|
);
|
|
@@ -671,9 +717,14 @@ const FloatingGridItem = defineComponent({
|
|
|
671
717
|
currentAnchor.value = nearestCorner;
|
|
672
718
|
emit("anchorChange", nearestCorner);
|
|
673
719
|
const snapPos = getCornerPosition(nearestCorner);
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
720
|
+
if (containerDisableAnimation) {
|
|
721
|
+
x.set(snapPos.x);
|
|
722
|
+
y.set(snapPos.y);
|
|
723
|
+
} else {
|
|
724
|
+
const springCfg = { type: "spring", stiffness: 400, damping: 30 };
|
|
725
|
+
animate(x, snapPos.x, springCfg);
|
|
726
|
+
animate(y, snapPos.y, springCfg);
|
|
727
|
+
}
|
|
677
728
|
};
|
|
678
729
|
return h(
|
|
679
730
|
motion.div,
|
|
@@ -697,8 +748,8 @@ const FloatingGridItem = defineComponent({
|
|
|
697
748
|
x,
|
|
698
749
|
y
|
|
699
750
|
},
|
|
700
|
-
whileDrag: { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
701
|
-
transition: { type: "spring", stiffness: 400, damping: 30 },
|
|
751
|
+
whileDrag: containerDisableAnimation ? { cursor: "grabbing" } : { cursor: "grabbing", scale: 1.05, boxShadow: "0 8px 32px rgba(0,0,0,0.4)" },
|
|
752
|
+
transition: containerDisableAnimation ? { duration: 0 } : { type: "spring", stiffness: 400, damping: 30 },
|
|
702
753
|
onDragEnd: handleDragEnd
|
|
703
754
|
},
|
|
704
755
|
slots.default?.()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thangdevalone/meeting-grid-layout-vue",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "Vue 3 integration for meeting-grid-layout with Motion animations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@vueuse/core": "^10.7.0",
|
|
45
45
|
"motion-v": "^1.0.0",
|
|
46
|
-
"@thangdevalone/meeting-grid-layout-core": "1.5.
|
|
46
|
+
"@thangdevalone/meeting-grid-layout-core": "1.5.8"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"vue": "^3.4.0",
|