Skip to content

Commit

Permalink
fix: update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Mar 6, 2022
1 parent dee8483 commit 4a50802
Show file tree
Hide file tree
Showing 18 changed files with 370 additions and 436 deletions.
44 changes: 13 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,23 @@ window.addEventListener("wheel", e => {
guides.scroll(scrollX);
});

```

export interface RulerProps {
type?: "horizontal" | "vertical";
width?: number;
height?: number;
unit?: number;
zoom?: number;
direction?: "start" | "end";
style?: IObject<any>;
backgroundColor?: string;
lineColor?: string;
textColor?: string;
}

export interface GuidesOptions extends RulerProps {
className?: string;
setGuides?: (guides: number[]) => any;
rulerStyle?: IObject<any>;
snapThreshold?: number;
snaps?: number[];
displayDragPos?: boolean;
dragPosFormat?: (value: number) => string | number;
}

export interface GuidesInterface {
getGuides(): number[];
scroll(pos: number): void;
scrollGuides(pos: number): void;
loadGuides(guides: number[]): void;
resize(): void;
}
### Ruler Units

The default unit is px, and a line is drawn every 50px. If you want to use a different unit instead of the px unit, use it like this:

```
* 1px (Default)
* zoom: 1
* unit: 50 (every 50px)
* 1cm = 37.7952px
* zoom: 37.7952
* unit: 1 (every 1cm)
* 1in = 96px = 2.54cm
* zoom: 96
* unit: 1 (every 1in)

See: https://www.w3schools.com/cssref/css_units.asp

## ⚙️ Developments
### `npm run demo:start`
Expand Down
125 changes: 55 additions & 70 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scena/guides",
"version": "0.17.0",
"version": "0.18.1",
"description": "A Vanilla Guides component that can draw ruler and manage guidelines.",
"main": "./dist/guides.cjs.js",
"module": "./dist/guides.esm.js",
Expand Down Expand Up @@ -65,6 +65,7 @@
},
"dependencies": {
"@scena/event-emitter": "^1.0.4",
"react-compat-guides": "~0.14.0"
"react-compat-guides": "~0.15.1",
"react-simple-compat": "^1.2.2"
}
}
Loading

0 comments on commit 4a50802

Please sign in to comment.