From 7223bfbb207b997f8852395c0ab0958082beaa65 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 27 Oct 2023 19:56:54 -0400 Subject: [PATCH] pass ids as slot props to builders --- package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- .../context-menu/components/ContextMenu.svelte | 5 +++-- .../context-menu/components/ContextMenuSub.svelte | 4 ++-- .../dropdown-menu/components/DropdownMenu.svelte | 5 +++-- .../components/DropdownMenuSub.svelte | 4 ++-- src/lib/bits/menubar/components/Menubar.svelte | 7 ++++--- src/lib/bits/menubar/components/MenubarMenu.svelte | 5 +++-- src/lib/bits/menubar/components/MenubarSub.svelte | 4 ++-- 9 files changed, 27 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 0c24fecd5..534994a58 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "types": "./dist/index.d.ts", "type": "module", "dependencies": { - "@melt-ui/svelte": "0.57.0", + "@melt-ui/svelte": "0.57.1", "nanoid": "^5.0.2" }, "peerDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2647ae777..04c933112 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@melt-ui/svelte': - specifier: 0.57.0 - version: 0.57.0(svelte@4.2.2) + specifier: 0.57.1 + version: 0.57.1(svelte@4.2.2) nanoid: specifier: ^5.0.2 version: 5.0.2 @@ -21,7 +21,7 @@ devDependencies: version: 0.16.5(svelte@4.2.2) '@melt-ui/pp': specifier: ^0.1.2 - version: 0.1.2(@melt-ui/svelte@0.57.0)(svelte@4.2.2) + version: 0.1.2(@melt-ui/svelte@0.57.1)(svelte@4.2.2) '@playwright/test': specifier: ^1.28.1 version: 1.36.2 @@ -1016,19 +1016,19 @@ packages: - supports-color dev: true - /@melt-ui/pp@0.1.2(@melt-ui/svelte@0.57.0)(svelte@4.2.2): + /@melt-ui/pp@0.1.2(@melt-ui/svelte@0.57.1)(svelte@4.2.2): resolution: {integrity: sha512-GZeqp7UWLNZUC2dJpREnZrWMR88vy27WO7C3cIBz4KW3/CFD19FjNkd3VbSRfcRryrMkdnEs9nu2VUa8/0u58w==} engines: {pnpm: '>=8.6.3'} peerDependencies: '@melt-ui/svelte': '>= 0.29.0' svelte: ^3.55.0 || ^4.0.0 dependencies: - '@melt-ui/svelte': 0.57.0(svelte@4.2.2) + '@melt-ui/svelte': 0.57.1(svelte@4.2.2) svelte: 4.2.2 dev: true - /@melt-ui/svelte@0.57.0(svelte@4.2.2): - resolution: {integrity: sha512-vfrkYw+sqYTwR1U4T5lkaHsNN6ZnchnRaKjalf1t0IrOVX/QlkyhUS9ZFlhaIUp+qam0mQW1H+f+AzNz/HTNEA==} + /@melt-ui/svelte@0.57.1(svelte@4.2.2): + resolution: {integrity: sha512-MnW/wsuRzpVqDsaBFr6+gNAC4EdGjJ7MsnHBBvBhacxqbrfruCB2aRDIe1ovmLtAkQDHGWyYS08NcHMHiXPnSg==} peerDependencies: svelte: '>=3 <5' dependencies: diff --git a/src/lib/bits/context-menu/components/ContextMenu.svelte b/src/lib/bits/context-menu/components/ContextMenu.svelte index d2fe5bb79..8f0668733 100644 --- a/src/lib/bits/context-menu/components/ContextMenu.svelte +++ b/src/lib/bits/context-menu/components/ContextMenu.svelte @@ -20,7 +20,8 @@ const { states: { open: localOpen }, - updateOption + updateOption, + ids } = setCtx({ closeOnOutsideClick, closeOnEscape, @@ -60,4 +61,4 @@ $: updateOption("typeahead", typeahead); - + diff --git a/src/lib/bits/context-menu/components/ContextMenuSub.svelte b/src/lib/bits/context-menu/components/ContextMenuSub.svelte index 275d45be4..d635ae8b0 100644 --- a/src/lib/bits/context-menu/components/ContextMenuSub.svelte +++ b/src/lib/bits/context-menu/components/ContextMenuSub.svelte @@ -7,7 +7,7 @@ export let disabled: $$Props["disabled"] = undefined; export let arrowSize: $$Props["arrowSize"] = undefined; - const { updateOption } = setSubMenuCtx({ + const { updateOption, ids } = setSubMenuCtx({ positioning, disabled, arrowSize @@ -18,4 +18,4 @@ $: updateOption("arrowSize", arrowSize); - + diff --git a/src/lib/bits/dropdown-menu/components/DropdownMenu.svelte b/src/lib/bits/dropdown-menu/components/DropdownMenu.svelte index bb1e3ae77..c4748b075 100644 --- a/src/lib/bits/dropdown-menu/components/DropdownMenu.svelte +++ b/src/lib/bits/dropdown-menu/components/DropdownMenu.svelte @@ -20,7 +20,8 @@ const { states: { open: localOpen }, - updateOption + updateOption, + ids } = setCtx({ closeOnOutsideClick, closeOnEscape, @@ -59,4 +60,4 @@ $: updateOption("typeahead", typeahead); - + diff --git a/src/lib/bits/dropdown-menu/components/DropdownMenuSub.svelte b/src/lib/bits/dropdown-menu/components/DropdownMenuSub.svelte index 275d45be4..d635ae8b0 100644 --- a/src/lib/bits/dropdown-menu/components/DropdownMenuSub.svelte +++ b/src/lib/bits/dropdown-menu/components/DropdownMenuSub.svelte @@ -7,7 +7,7 @@ export let disabled: $$Props["disabled"] = undefined; export let arrowSize: $$Props["arrowSize"] = undefined; - const { updateOption } = setSubMenuCtx({ + const { updateOption, ids } = setSubMenuCtx({ positioning, disabled, arrowSize @@ -18,4 +18,4 @@ $: updateOption("arrowSize", arrowSize); - + diff --git a/src/lib/bits/menubar/components/Menubar.svelte b/src/lib/bits/menubar/components/Menubar.svelte index a1aa3bf86..563206b39 100644 --- a/src/lib/bits/menubar/components/Menubar.svelte +++ b/src/lib/bits/menubar/components/Menubar.svelte @@ -11,7 +11,8 @@ const { elements: { menubar }, - updateOption + updateOption, + ids } = setCtx({ loop, closeOnEscape }); $: updateOption("loop", loop); @@ -21,9 +22,9 @@ {#if asChild} - + {:else}
- +
{/if} diff --git a/src/lib/bits/menubar/components/MenubarMenu.svelte b/src/lib/bits/menubar/components/MenubarMenu.svelte index 9ad0eeed5..e255fdedf 100644 --- a/src/lib/bits/menubar/components/MenubarMenu.svelte +++ b/src/lib/bits/menubar/components/MenubarMenu.svelte @@ -19,7 +19,8 @@ const { states: { open: localOpen }, - updateOption + updateOption, + ids } = setMenuCtx({ closeOnOutsideClick, closeOnEscape, @@ -55,4 +56,4 @@ $: updateOption("typeahead", typeahead); - + diff --git a/src/lib/bits/menubar/components/MenubarSub.svelte b/src/lib/bits/menubar/components/MenubarSub.svelte index 275d45be4..d635ae8b0 100644 --- a/src/lib/bits/menubar/components/MenubarSub.svelte +++ b/src/lib/bits/menubar/components/MenubarSub.svelte @@ -7,7 +7,7 @@ export let disabled: $$Props["disabled"] = undefined; export let arrowSize: $$Props["arrowSize"] = undefined; - const { updateOption } = setSubMenuCtx({ + const { updateOption, ids } = setSubMenuCtx({ positioning, disabled, arrowSize @@ -18,4 +18,4 @@ $: updateOption("arrowSize", arrowSize); - +