unframer 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/css.d.ts +10 -9
- package/dist/css.d.ts.map +1 -1
- package/dist/css.js +20 -16
- package/dist/css.js.map +1 -1
- package/dist/exporter.d.ts +9 -1
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +2 -2
- package/dist/exporter.js.map +1 -1
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +5303 -4661
- package/dist/framer.js.map +1 -1
- package/dist/react.d.ts +2 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +5 -3
- package/dist/react.js.map +1 -1
- package/esm/cli.d.ts.map +1 -1
- package/esm/cli.js +2 -1
- package/esm/cli.js.map +1 -1
- package/esm/css.d.ts +10 -9
- package/esm/css.d.ts.map +1 -1
- package/esm/css.js +12 -9
- package/esm/css.js.map +1 -1
- package/esm/exporter.d.ts +9 -1
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +2 -2
- package/esm/exporter.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +5281 -4640
- package/esm/framer.js.map +1 -1
- package/esm/react.d.ts +2 -2
- package/esm/react.d.ts.map +1 -1
- package/esm/react.js +6 -4
- package/esm/react.js.map +1 -1
- package/package.json +14 -3
- package/src/cli.tsx +4 -1
- package/src/css.ts +25 -20
- package/src/exporter.ts +3 -1
- package/src/framer.js +11451 -10299
- package/src/react.tsx +11 -6
package/src/react.tsx
CHANGED
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
useMemo,
|
|
10
10
|
useSyncExternalStore,
|
|
11
11
|
} from 'react'
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
breakpointsStyles,
|
|
14
|
+
defaultBreakpointSizes,
|
|
15
|
+
getFontsStyles,
|
|
16
|
+
} from './css.js'
|
|
13
17
|
|
|
14
18
|
function classNames(...args) {
|
|
15
19
|
return args.filter(Boolean).join(' ')
|
|
@@ -17,14 +21,14 @@ function classNames(...args) {
|
|
|
17
21
|
|
|
18
22
|
// breakpoints from the higher to the lower
|
|
19
23
|
const defaultBreakpoints = Object.keys(
|
|
20
|
-
|
|
24
|
+
defaultBreakpointSizes,
|
|
21
25
|
).reverse() as UnframerBreakpoint[]
|
|
22
26
|
|
|
23
|
-
export type UnframerBreakpoint = keyof typeof
|
|
27
|
+
export type UnframerBreakpoint = keyof typeof defaultBreakpointSizes
|
|
24
28
|
|
|
25
29
|
function getBreakpointNameFromWindowWidth(windowWidth: number) {
|
|
26
30
|
return defaultBreakpoints.find(
|
|
27
|
-
(name) => windowWidth >=
|
|
31
|
+
(name) => windowWidth >= defaultBreakpointSizes[name],
|
|
28
32
|
)
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -50,7 +54,6 @@ const nothing = () => {
|
|
|
50
54
|
return () => {}
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
|
|
54
57
|
/**
|
|
55
58
|
* @deprecated Use styles.css import instead
|
|
56
59
|
*/
|
|
@@ -62,7 +65,9 @@ export function FramerStyles({ Components = [] as any[] }): any {
|
|
|
62
65
|
)
|
|
63
66
|
const breakpoints = (
|
|
64
67
|
<style
|
|
65
|
-
dangerouslySetInnerHTML={{
|
|
68
|
+
dangerouslySetInnerHTML={{
|
|
69
|
+
__html: breakpointsStyles(defaultBreakpointSizes),
|
|
70
|
+
}}
|
|
66
71
|
key='breakpointsStyles'
|
|
67
72
|
suppressHydrationWarning
|
|
68
73
|
hidden
|