From 64db7da151a4f7db7d89ea236c173514c65618fd Mon Sep 17 00:00:00 2001
From: Hunter Johnston <64506580+huntabyte@users.noreply.github.com>
Date: Mon, 21 Aug 2023 20:47:28 -0400
Subject: [PATCH] hotfix: bug (#74)
---
.changeset/shiny-icons-smile.md | 5 +++++
package.json | 2 +-
patches/@melt-ui__svelte@0.37.2.patch | 18 ------------------
pnpm-lock.yaml | 14 +++++++-------
src/components/demos/alert-dialog-demo.svelte | 4 +---
src/components/demos/select-demo.svelte | 7 +++++--
src/components/ui/alert-dialog/index.ts | 2 +-
src/components/ui/select/select-content.svelte | 3 ---
.../alert-dialog/components/AlertDialog.svelte | 2 +-
src/lib/bits/dialog/components/Dialog.svelte | 4 ++--
src/lib/internal/helpers.ts | 2 +-
src/lib/internal/index.ts | 2 +-
12 files changed, 25 insertions(+), 40 deletions(-)
create mode 100644 .changeset/shiny-icons-smile.md
delete mode 100644 patches/@melt-ui__svelte@0.37.2.patch
diff --git a/.changeset/shiny-icons-smile.md b/.changeset/shiny-icons-smile.md
new file mode 100644
index 000000000..d9168bde0
--- /dev/null
+++ b/.changeset/shiny-icons-smile.md
@@ -0,0 +1,5 @@
+---
+"bits-ui": patch
+---
+
+hotfix: bug
diff --git a/package.json b/package.json
index 6aea60428..bf327c7a0 100644
--- a/package.json
+++ b/package.json
@@ -74,7 +74,7 @@
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
- "@melt-ui/svelte": "0.37.2",
+ "@melt-ui/svelte": "0.37.5",
"@sveltejs/adapter-vercel": "^3.0.3",
"nanoid": "^4.0.2",
"shiki": "^0.14.3",
diff --git a/patches/@melt-ui__svelte@0.37.2.patch b/patches/@melt-ui__svelte@0.37.2.patch
deleted file mode 100644
index 036a977c9..000000000
--- a/patches/@melt-ui__svelte@0.37.2.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/dist/internal/helpers/overridable.js b/dist/internal/helpers/overridable.js
-index 4bfd74ec7fc838dbce59491c37180f9a3cd798c2..a92e724ef14e9148e5bdf40c1e5a1e5817d61ed7 100644
---- a/dist/internal/helpers/overridable.js
-+++ b/dist/internal/helpers/overridable.js
-@@ -1,10 +1,10 @@
--export const overridable = (store, onChange) => {
-+export const overridable = async (store, onChange) => {
- const update = (updater, sideEffect) => {
-- store.update((curr) => {
-+ store.update(async (curr) => {
- const next = updater(curr);
- let res = next;
- if (onChange) {
-- res = onChange({ curr, next });
-+ res = await onChange({ curr, next });
- }
- sideEffect?.(res);
- return res;
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ef94fdc3e..ebe8b85cb 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6,8 +6,8 @@ settings:
dependencies:
'@melt-ui/svelte':
- specifier: 0.37.2
- version: 0.37.2(svelte@4.1.2)
+ specifier: 0.37.5
+ version: 0.37.5(svelte@4.1.2)
'@sveltejs/adapter-vercel':
specifier: ^3.0.3
version: 3.0.3(@sveltejs/kit@1.22.4)
@@ -33,7 +33,7 @@ devDependencies:
version: 0.16.5(svelte@4.1.2)
'@melt-ui/pp':
specifier: ^0.1.2
- version: 0.1.2(@melt-ui/svelte@0.37.2)(svelte@4.1.2)
+ version: 0.1.2(@melt-ui/svelte@0.37.5)(svelte@4.1.2)
'@playwright/test':
specifier: ^1.28.1
version: 1.36.2
@@ -706,19 +706,19 @@ packages:
- supports-color
dev: false
- /@melt-ui/pp@0.1.2(@melt-ui/svelte@0.37.2)(svelte@4.1.2):
+ /@melt-ui/pp@0.1.2(@melt-ui/svelte@0.37.5)(svelte@4.1.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.37.2(svelte@4.1.2)
+ '@melt-ui/svelte': 0.37.5(svelte@4.1.2)
svelte: 4.1.2
dev: true
- /@melt-ui/svelte@0.37.2(svelte@4.1.2):
- resolution: {integrity: sha512-MdFnsY/yL2p/y0m2PqaM/tGmJ/ZsUAhACksPXCbrTXBw042rHkZHC8ykp5E5MVXGPn/eWc9nt9Vh3tmB+2CjXw==}
+ /@melt-ui/svelte@0.37.5(svelte@4.1.2):
+ resolution: {integrity: sha512-bQ368VNw8tTT7DrD9/6KMU6O/NRBoZlh4pUv4tQVVlgBq5G9ZnKJ/5nJ28EE2ONd8jwykTTIHBVBpEtEVF8Hlw==}
peerDependencies:
svelte: '>=3 <5'
dependencies:
diff --git a/src/components/demos/alert-dialog-demo.svelte b/src/components/demos/alert-dialog-demo.svelte
index a9a7e59a5..b466b6e6d 100644
--- a/src/components/demos/alert-dialog-demo.svelte
+++ b/src/components/demos/alert-dialog-demo.svelte
@@ -1,11 +1,9 @@
-
+
diff --git a/src/components/demos/select-demo.svelte b/src/components/demos/select-demo.svelte
index 1fbf2f7e9..9e9b0ed30 100644
--- a/src/components/demos/select-demo.svelte
+++ b/src/components/demos/select-demo.svelte
@@ -8,9 +8,10 @@
{ value: "grapes", label: "Grapes" },
{ value: "pineapple", label: "Pineapple" }
];
+ let value: any;
-
+
@@ -18,7 +19,9 @@
Fruits
{#each fruits as fruit}
- {fruit.label}
+ console.log("click")}
+ >{fruit.label}
{/each}
diff --git a/src/components/ui/alert-dialog/index.ts b/src/components/ui/alert-dialog/index.ts
index d391aa4a1..57716eb33 100644
--- a/src/components/ui/alert-dialog/index.ts
+++ b/src/components/ui/alert-dialog/index.ts
@@ -1,5 +1,4 @@
import { AlertDialog as AlertDialogPrimitive } from "@/lib";
-
const Root = AlertDialogPrimitive.Root;
const Trigger = AlertDialogPrimitive.Trigger;
@@ -12,6 +11,7 @@ import Header from "./alert-dialog-header.svelte";
import Overlay from "./alert-dialog-overlay.svelte";
import Content from "./alert-dialog-content.svelte";
import Description from "./alert-dialog-description.svelte";
+
import type { TransitionConfig } from "svelte/transition";
import { cubicOut } from "svelte/easing";
diff --git a/src/components/ui/select/select-content.svelte b/src/components/ui/select/select-content.svelte
index 5c1ee8681..cb14ef84f 100644
--- a/src/components/ui/select/select-content.svelte
+++ b/src/components/ui/select/select-content.svelte
@@ -7,9 +7,6 @@
let className: $$Props["class"] = undefined;
export { className as class };
-
- const some =
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";
+ import { onDestroy } from "svelte";
import { writable } from "svelte/store";
import { ctx } from "../ctx.js";
import type { Props } from "../types.js";
import type { TransitionTimes } from "$lib/internal/types.js";
- import { isBrowser } from "$lib/internal/index.js";
- import { onDestroy } from "svelte";
+ import { isBrowser } from "$lib/internal/is.js";
type $$Props = Props;
diff --git a/src/lib/internal/helpers.ts b/src/lib/internal/helpers.ts
index 8851f6e9c..82b63794b 100644
--- a/src/lib/internal/helpers.ts
+++ b/src/lib/internal/helpers.ts
@@ -3,7 +3,7 @@ import { nanoid } from "nanoid/non-secure";
import type { Writable } from "svelte/store";
import type { ActionReturn } from "svelte/action";
import type { Builder, Transition, TransitionParams, TransitionTimesStore } from "./types.js";
-import { isBrowser } from "$lib/internal/index.js";
+import { isBrowser } from "./is.js";
export function noop() {
// do nothing
diff --git a/src/lib/internal/index.ts b/src/lib/internal/index.ts
index e851990c1..7cc2d8bf6 100644
--- a/src/lib/internal/index.ts
+++ b/src/lib/internal/index.ts
@@ -1,3 +1,3 @@
+export * from "./is.js";
export * from "./helpers.js";
export * from "./types.js";
-export * from "./is.js";