Skip to content

Commit

Permalink
Merge branch 'next' into svelte-5-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Apr 12, 2024
2 parents f5253d9 + 912601d commit f11c5cd
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This project is supported by the following beautiful people/organizations:

<p align="center">
<a href="https://github.com/sponsors/huntabyte">
<img src='https://cdn.jsdelivr.net/gh/huntabyte/static@main/sponsors.svg' alt="Logos from Sponsors" />
<img src='https://github.com/huntabyte/static/blob/main/sponsors.svg?raw=true' alt="Logos from Sponsors" />
</a>
</p>

Expand Down
6 changes: 6 additions & 0 deletions packages/bits-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# bits-ui

## 0.21.3

### Patch Changes

- fix: toolbar onValueChange firing ([#448](https://github.com/huntabyte/bits-ui/pull/448))

## 0.21.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bits-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This project is supported by the following beautiful people/organizations:

<p align="center">
<a href="https://github.com/sponsors/huntabyte">
<img src='https://cdn.jsdelivr.net/gh/huntabyte/static@main/sponsors.svg' alt="Logos from Sponsors" />
<img src='https://github.com/huntabyte/static/blob/main/sponsors.svg?raw=true' alt="Logos from Sponsors" />
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion packages/bits-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bits-ui",
"version": "0.21.2",
"version": "0.21.3",
"license": "MIT",
"repository": "github:huntabyte/bits-ui",
"funding": "https://github.com/sponsors/huntabyte",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { melt } from "@melt-ui/svelte";
import { setGroupCtx } from "../ctx.js";
import type { GroupProps } from "../index.js";
import { arraysAreEqual } from "$lib/internal/arrays.js";
type T = $$Generic<"single" | "multiple">;
type $$Props = GroupProps<T>;
Expand All @@ -24,8 +25,11 @@
defaultValue: value,
onValueChange: (({ next }: { next: $$Props["value"] }) => {
if (Array.isArray(next)) {
onValueChange?.(next);
value = next;
if (!Array.isArray(value) || !arraysAreEqual(value, next)) {
onValueChange?.(next);
value = next;
return next;
}
return next;
}
Expand All @@ -39,7 +43,8 @@
const attrs = getAttrs("group");
$: value !== undefined && localValue.set(value);
$: value !== undefined &&
localValue.set(Array.isArray(value) ? ([...value] as $$Props["value"]) : (value as any));
$: updateOption("disabled", disabled);
$: updateOption("type", type);
Expand Down
3 changes: 0 additions & 3 deletions packages/bits-ui/src/tests/toolbar/Toolbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ describe("toolbar", () => {
singleProps: { onValueChange: singleOnValueChange },
});

expect(newMultipleValue).toStrictEqual(["bold"]);
expect(newSingleValue).toBe(undefined);

await user.click(groupMultipleItemStrikethrough);
expect(newMultipleValue).toStrictEqual(["bold", "strikethrough"]);

Expand Down
4 changes: 0 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions sites/docs/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
const config = {
preprocess: [
mdsx(mdsxConfig),
vitePreprocess({
style: {
css: {
postcss: path.join(__dirname, "postcss.config.cjs"),
},
},
}),
vitePreprocess({
style: {
css: {
postcss: path.join(__dirname, "postcss.config.cjs"),
},
},
}),
preprocessMeltUI(),
],
extensions: [".svelte", ".md"],
Expand Down

0 comments on commit f11c5cd

Please sign in to comment.