File size: 496 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<script>import { getCtx } from "../ctx.js";
import { melt } from "@melt-ui/svelte";
export let asChild = false;
export let el = void 0;
const {
  elements: { viewport },
  getAttrs
} = getCtx();
const bitsAttrs = getAttrs("viewport");
$:
  attrs = {
    ...$$restProps,
    ...bitsAttrs
  };
$:
  builder = $viewport;
$:
  Object.assign(builder, attrs);
</script>

{#if asChild}
	<slot {builder} />
{:else}
	<div {...builder} use:builder.action bind:this={el}>
		<slot {builder} />
	</div>
{/if}