Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Parity #160

Draft
wants to merge 89 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
19d448a
more
huntabyte Jan 8, 2025
72ec579
some stuff
huntabyte Jan 8, 2025
6ff3339
urg
huntabyte Jan 9, 2025
35203e9
whew
huntabyte Jan 10, 2025
6fcbef6
Merge branch 'main' into feat/hook-parity
Hugos68 Jan 10, 2025
ddfd345
click & dismiss
huntabyte Jan 10, 2025
45979d4
click dismiss focus progress
huntabyte Jan 10, 2025
db9e494
more progress
huntabyte Jan 10, 2025
3dfb82f
more things
huntabyte Jan 10, 2025
4c93759
follow hugos insanity with exports ;)
huntabyte Jan 10, 2025
aeb1be8
things are not good
huntabyte Jan 10, 2025
09cf58f
some work
huntabyte Jan 11, 2025
8988a65
closer but not yet
huntabyte Jan 11, 2025
a747eb2
lets go
huntabyte Jan 12, 2025
1553c67
lets goooo
huntabyte Jan 12, 2025
ddb75cf
tests passing
huntabyte Jan 12, 2025
3b647ee
some housekeeping
huntabyte Jan 12, 2025
bacb86d
useMergeRefs
huntabyte Jan 12, 2025
bae10ab
progress
huntabyte Jan 13, 2025
6f2f035
floating focus manager
huntabyte Jan 13, 2025
7cce28a
some stuff
huntabyte Jan 14, 2025
5b19001
Merge remote-tracking branch 'upstream/main' into feat/hook-parity
huntabyte Jan 14, 2025
37718b4
focus manager tests wip
huntabyte Jan 15, 2025
51a8adc
we are cooking
huntabyte Jan 15, 2025
13181cc
alrighty we are back in the kitchen
huntabyte Jan 15, 2025
5aba0af
tidy tests
huntabyte Jan 15, 2025
0919376
lets gooo
huntabyte Jan 15, 2025
4124950
cleanup unused
huntabyte Jan 15, 2025
d499f77
test failing
huntabyte Jan 15, 2025
c9d5730
deps
huntabyte Jan 16, 2025
2e0da08
housekeeping
huntabyte Jan 16, 2025
2aa8818
unsure
huntabyte Jan 16, 2025
df8a594
something to do with mutation not running fast enough
huntabyte Jan 16, 2025
52f71d2
some tidying but tests still failing urg
huntabyte Jan 19, 2025
fd6d3a2
sleep
huntabyte Jan 19, 2025
cc7c431
more tests
huntabyte Jan 19, 2025
13efcdc
more
huntabyte Jan 19, 2025
6bf7852
wow that was a lot of tests
huntabyte Jan 19, 2025
d43d9fb
wip client point
huntabyte Jan 19, 2025
eda47fd
feat: useClientPoint
huntabyte Jan 19, 2025
cfbfb58
feat: floating delay group
huntabyte Jan 19, 2025
35a59d8
floating delay group tests
huntabyte Jan 19, 2025
f2c5069
more
huntabyte Jan 19, 2025
d6f9282
rearranging for visual test sandbox
huntabyte Jan 19, 2025
afe0b17
init visual
huntabyte Jan 19, 2025
88783e3
visual testing
huntabyte Jan 19, 2025
1832e4b
init tooltip visual test
huntabyte Jan 19, 2025
093b866
tooltip visual testing
huntabyte Jan 19, 2025
e659564
popover visual testing
huntabyte Jan 19, 2025
403a4ce
more
huntabyte Jan 20, 2025
85b7615
wip list navigation tests
huntabyte Jan 20, 2025
b1ce76b
new
huntabyte Jan 20, 2025
c86bd31
fix
huntabyte Jan 20, 2025
e07ab9f
broken list items, need to figure out how to better sync updates
huntabyte Jan 20, 2025
df21cb6
woohoo
huntabyte Jan 21, 2025
747ebc5
whew
huntabyte Jan 21, 2025
43b8042
did someone ask for housekeeping
huntabyte Jan 22, 2025
62f9a07
need to debug why hover over nested breaks and closes
huntabyte Jan 22, 2025
2362cd1
fix some stuff
huntabyte Jan 22, 2025
bbce13e
polygon debugger
huntabyte Jan 22, 2025
41e8775
lets try something different here
huntabyte Jan 23, 2025
134c6b3
some progress I think?
huntabyte Jan 24, 2025
62ae2d7
ughhhhhhhhhhh
huntabyte Jan 24, 2025
ce7cba1
lfg
huntabyte Jan 24, 2025
5f1a0ad
idk man
huntabyte Jan 25, 2025
bec4f00
still nada
huntabyte Jan 25, 2025
edd6ee9
cmon
huntabyte Jan 25, 2025
cf2e463
wow I cannot believe I cannot figure this out rn
huntabyte Jan 26, 2025
7a805f4
closures are important :)
huntabyte Jan 26, 2025
b3cc670
typeahead tests ✅
huntabyte Jan 26, 2025
0bbc533
dismiss tests
huntabyte Jan 27, 2025
c0a394b
need to fix the nested dismiss by snapshotting state or something?
huntabyte Jan 27, 2025
40003b0
fix get children
huntabyte Jan 27, 2025
67c3797
todo: capture tests
huntabyte Jan 27, 2025
bceeb27
hmm
huntabyte Jan 27, 2025
04c6e29
skip capture till we work out a solution
huntabyte Jan 27, 2025
f210f9e
add select demo
huntabyte Jan 27, 2025
3d44195
autocomplete
huntabyte Jan 27, 2025
3d7f6f4
menubar demo
huntabyte Jan 28, 2025
f8386f5
lfg
huntabyte Jan 28, 2025
51defc3
menu virtual
huntabyte Jan 29, 2025
fe4fca9
cleanup some stuff
huntabyte Jan 29, 2025
60ad11b
cleanup
huntabyte Jan 29, 2025
2189a78
we like removing code
huntabyte Jan 29, 2025
362e23f
more code removal
huntabyte Jan 29, 2025
5821d3e
all list nav tests passing
huntabyte Jan 29, 2025
90751c4
smore
huntabyte Jan 29, 2025
5d7c501
remove logs
huntabyte Feb 1, 2025
c1f97d8
functions
huntabyte Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# IDE's
.idea
.vscode

# Artifacts
node_modules
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[typescript][javascript][json][html][css][jsonc][markdown][typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
}
}
19 changes: 18 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,24 @@
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
"useImportType": "off",
"noNonNullAssertion": "off"
},
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
},
{
"include": ["*.ts"],
"linter": {
"rules": {
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "monorepo",
"private": true,
"scripts": {
"dev": "pnpm -F \"./packages/**\" sync && pnpm -r --parallel --reporter append-only --color dev",
"format": "biome check . --write",
"format:check": "biome check .",
"build": "pnpm --recursive build",
"build:watch": "pnpm --recursive --parallel build:watch",
"test": "pnpm --recursive test",
"test:watch": "pnpm --recursive test:watch",
"sync": "pnpm --recursive sync",
"postinstall": "pnpm sync"
"test": "pnpm --recursive --reporter append-only --color test",
"test:watch": "pnpm --recursive --reporter append-only --color test:watch",
"sync": "pnpm --recursive sync"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
Expand Down
18 changes: 15 additions & 3 deletions packages/floating-ui-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"name": "@skeletonlabs/floating-ui-svelte",
"version": "0.3.9",
"scripts": {
"dev": "pnpm \"/dev:/\"",
"build": "svelte-package --input ./src",
"build:watch": "pnpm build --watch",
"test": "vitest run",
"dev:visual": "vite dev",
"dev:build": "pnpm build:watch",
"test:watch": "pnpm test --watch",
"sync": "svelte-kit sync && pnpm build"
},
Expand All @@ -31,17 +34,26 @@
"@sveltejs/kit": "^2.15.1",
"@sveltejs/package": "^2.3.7",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/vite": "4.0.0-beta.9",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/svelte": "^5.2.6",
"@testing-library/user-event": "^14.5.2",
"bits-ui": "^1.0.0-next.78",
"clsx": "^2.1.1",
"csstype": "^3.1.3",
"svelte": "^5.16.0",
"lucide-svelte": "^0.469.0",
"resize-observer-polyfill": "^1.5.1",
"svelte": "^5.17.3",
"tailwindcss": "4.0.0-beta.9",
"typescript": "^5.7.2",
"vite": "^6.0.6",
"vite": "6.0.7",
"vitest": "^2.1.8"
},
"dependencies": {
"@floating-ui/dom": "^1.6.12",
"@floating-ui/utils": "^0.2.8"
"@floating-ui/utils": "^0.2.8",
"esm-env": "^1.2.1",
"style-to-object": "^1.0.8",
"tabbable": "^6.2.0"
}
}
12 changes: 12 additions & 0 deletions packages/floating-ui-svelte/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// These global variables enable projects that potentially use multiple versions of
// floating ui via dependencies, etc. to share these variables across all instances.
// From experience with vaul-svelte using Bits UI under the hood, without these globals,
// composing multiple instances of floating ui components would not work as expected.
declare global {
var fuiLockCount: { current: number };
// biome-ignore lint/complexity/noBannedTypes: <explanation>
var fuiLockCleanup: { current: Function };
var fuiPrevFocusedElements: Element[];
}

export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { Boxed, WithRef } from "../../types.js";
import type { HTMLAttributes } from "svelte/elements";
import { CompositeContext } from "./context.js";
import { useListItem } from "../floating-list/hooks.svelte.js";
import { box } from "../../internal/box.svelte.js";

interface CompositeItemProps {
render?: Snippet<
[HTMLAttributes<HTMLElement>, Boxed<HTMLElement | null>]
>;
}

export type { CompositeItemProps };
</script>

<script lang="ts">
let {
ref = $bindable(null),
render,
...rest
}: WithRef & HTMLAttributes<HTMLElement> & CompositeItemProps = $props();

const ctx = CompositeContext.get();
const listItem = useListItem();

const isActive = $derived(ctx.activeIndex === listItem.index);

const mergedProps: HTMLAttributes<HTMLElement> = $derived({
...rest,
tabindex: isActive ? 0 : -1,
"data-active": isActive ? "" : undefined,
onfocus: (event) => {
rest.onfocus?.(event);
ctx.onNavigate(listItem.index);
},
});

const boxedRef = box.with(
() => ref,
(v) => {
ref = v;
listItem.ref = v;
}
);
</script>

{#if render}
{@render render(mergedProps, boxedRef)}
{:else}
{@const { children, ...restMerged } = mergedProps}
<div {...restMerged} bind:this={boxedRef.current}>
{@render children?.()}
</div>
{/if}
Loading