unframer 2.7.11 → 2.9.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/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +10 -4
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +8 -0
- package/dist/cli.test.js.map +1 -1
- package/dist/exporter.d.ts +5 -1
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +75 -14
- package/dist/exporter.js.map +1 -1
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +116 -92
- package/dist/framer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +10 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -0
- package/dist/react.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +9 -0
- package/dist/utils.js.map +1 -1
- package/esm/cli.d.ts +10 -0
- package/esm/cli.d.ts.map +1 -1
- package/esm/cli.js +11 -5
- package/esm/cli.js.map +1 -1
- package/esm/cli.test.js +9 -1
- package/esm/cli.test.js.map +1 -1
- package/esm/exporter.d.ts +5 -1
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +75 -14
- package/esm/exporter.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +113 -92
- package/esm/framer.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/react.d.ts +10 -0
- package/esm/react.d.ts.map +1 -1
- package/esm/react.js +14 -0
- package/esm/react.js.map +1 -1
- package/esm/utils.d.ts +1 -0
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +8 -0
- package/esm/utils.js.map +1 -1
- package/package.json +7 -4
- package/src/cli.test.ts +20 -3
- package/src/cli.tsx +25 -5
- package/src/exporter.ts +94 -18
- package/src/framer.js +122 -93
- package/src/index.ts +1 -1
- package/src/react.tsx +46 -1
- package/src/utils.ts +9 -0
package/src/react.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { combinedCSSRules, LayoutGroup } from './framer.js'
|
|
2
|
+
import { combinedCSSRules, LayoutGroup, MotionConfig } from './framer.js'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
ComponentPropsWithoutRef,
|
|
@@ -192,3 +192,48 @@ const onResize = (callback) => {
|
|
|
192
192
|
window.addEventListener('resize', callback)
|
|
193
193
|
return () => window.removeEventListener('resize', callback)
|
|
194
194
|
}
|
|
195
|
+
|
|
196
|
+
import {
|
|
197
|
+
// @ts-ignore
|
|
198
|
+
CustomCursorHost,
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
FetchClientProvider,
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
FormContext,
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
Router,
|
|
205
|
+
} from './framer.js'
|
|
206
|
+
|
|
207
|
+
export function ContextProviders({
|
|
208
|
+
locale,
|
|
209
|
+
children,
|
|
210
|
+
framerSiteId,
|
|
211
|
+
routes,
|
|
212
|
+
routeId,
|
|
213
|
+
pathVariables,
|
|
214
|
+
collectionUtils,
|
|
215
|
+
locales,
|
|
216
|
+
}) {
|
|
217
|
+
const localeId = locales?.find(
|
|
218
|
+
(l) => l.slug === locale || l.code === locale || l.id === locale,
|
|
219
|
+
)?.id
|
|
220
|
+
return (
|
|
221
|
+
<FetchClientProvider>
|
|
222
|
+
<CustomCursorHost>
|
|
223
|
+
<FormContext.Provider value={framerSiteId}>
|
|
224
|
+
<Router
|
|
225
|
+
initialRoute={routeId}
|
|
226
|
+
initialPathVariables={pathVariables}
|
|
227
|
+
initialLocaleId={localeId}
|
|
228
|
+
enableImproveInpDuringHydration={true}
|
|
229
|
+
routes={routes}
|
|
230
|
+
collectionUtils={collectionUtils}
|
|
231
|
+
locales={locales}
|
|
232
|
+
>
|
|
233
|
+
{children}
|
|
234
|
+
</Router>
|
|
235
|
+
</FormContext.Provider>
|
|
236
|
+
</CustomCursorHost>
|
|
237
|
+
</FetchClientProvider>
|
|
238
|
+
)
|
|
239
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -3,6 +3,7 @@ import pico from 'picocolors'
|
|
|
3
3
|
import { marked } from 'marked'
|
|
4
4
|
import { markedTerminal } from 'marked-terminal'
|
|
5
5
|
import { createSpinner } from 'nanospinner'
|
|
6
|
+
import kebabCase from 'just-kebab-case'
|
|
6
7
|
|
|
7
8
|
export const spinner = createSpinner('Downloading Framer Components') as any
|
|
8
9
|
|
|
@@ -29,3 +30,11 @@ export const logger = {
|
|
|
29
30
|
console.error([prefix, ...args].map((x) => pico.red(x)).join(' '))
|
|
30
31
|
},
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
export function componentNameToPath(name: string) {
|
|
35
|
+
return name
|
|
36
|
+
.split('/')
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.map((part) => kebabCase(part))
|
|
39
|
+
.join('/')
|
|
40
|
+
}
|