Skip to content

Commit

Permalink
refactor: add config.toolbar.collapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious committed Mar 26, 2024
1 parent 17983f9 commit c6223da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Allow accessing `state.value` after destroying.
- Added toolbar config `collapsed` to set the default collapsed state of toolbar.

## 0.3.14

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$: phase = app?.phase;
$: disabled = !($writable && $phase === "connected");
let collapsed = false;
let collapsed = config.collapsed;
let container_height = svelte_writable(0);
let scroll_height = svelte_writable(0);
Expand Down
3 changes: 3 additions & 0 deletions packages/fastboard-ui/src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export interface ToolbarConfig {
placement?: "left" | "right";
/** @default ["clicker", "selector", "pencil", "text", "shapes", "eraser", "clear"] */
items?: ToolbarItem[];
/** @default false */
collapsed?: boolean;
/** Control the last button which opens apps stock on toolbar. */
apps?: { enable?: boolean };
}

Expand Down
1 change: 1 addition & 0 deletions packages/fastboard-ui/test/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
toolbar: {
items: toolbar_items_value,
placement: toolbar_placement,
collapsed: true,
apps: {
enable: !hide_apps,
},
Expand Down

0 comments on commit c6223da

Please sign in to comment.