unframer 2.0.1 → 2.1.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 +4 -5
- package/dist/cli.test.js +0 -37
- package/dist/cli.test.js.map +1 -1
- package/dist/css.d.ts.map +1 -1
- package/dist/css.js +3 -1
- package/dist/css.js.map +1 -1
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +7 -6
- package/dist/exporter.js.map +1 -1
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +114 -51
- package/dist/framer.js.map +1 -1
- package/esm/cli.test.js +1 -35
- package/esm/cli.test.js.map +1 -1
- package/esm/css.d.ts.map +1 -1
- package/esm/css.js +3 -1
- package/esm/css.js.map +1 -1
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +8 -7
- package/esm/exporter.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +123 -60
- package/esm/framer.js.map +1 -1
- package/package.json +3 -2
- package/src/cli.test.ts +0 -47
- package/src/css.ts +3 -1
- package/src/exporter.ts +14 -7
- package/src/framer.js +126 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unframer",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "https://github.com/remorses/unframer",
|
|
6
6
|
"bin": "bin.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"module": "./esm/index.js",
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
22
23
|
},
|
|
23
24
|
"keywords": [],
|
|
24
25
|
"author": "Tommaso De Rossi, morse <beats.by.morse@gmail.com>",
|
package/src/cli.test.ts
CHANGED
|
@@ -97,50 +97,3 @@ test(
|
|
|
97
97
|
},
|
|
98
98
|
1000 * 10,
|
|
99
99
|
)
|
|
100
|
-
test(
|
|
101
|
-
'bundle simple component',
|
|
102
|
-
async () => {
|
|
103
|
-
const tempFolder = tmp.dirSync({ unsafeCleanup: true }).name
|
|
104
|
-
console.log('tempFolder', tempFolder)
|
|
105
|
-
const url =
|
|
106
|
-
'https://framer.com/m/Logo-Ticker-1CEq.js@YtVlixDzOkypVBs3Dpav'
|
|
107
|
-
await bundle({
|
|
108
|
-
components: {
|
|
109
|
-
ticker: url,
|
|
110
|
-
},
|
|
111
|
-
cwd: tempFolder,
|
|
112
|
-
})
|
|
113
|
-
},
|
|
114
|
-
1000 * 10,
|
|
115
|
-
)
|
|
116
|
-
test(
|
|
117
|
-
'issue #1',
|
|
118
|
-
async () => {
|
|
119
|
-
const tempFolder = tmp.dirSync({ unsafeCleanup: true }).name
|
|
120
|
-
console.log('tempFolder', tempFolder)
|
|
121
|
-
const url = 'https://framer.com/m/Item-Qetw.js@vUDyI0yvPLONiBDf8Kzw'
|
|
122
|
-
await bundle({
|
|
123
|
-
components: {
|
|
124
|
-
item: url,
|
|
125
|
-
},
|
|
126
|
-
cwd: tempFolder,
|
|
127
|
-
})
|
|
128
|
-
},
|
|
129
|
-
1000 * 10,
|
|
130
|
-
)
|
|
131
|
-
test(
|
|
132
|
-
'bundle ticker variant',
|
|
133
|
-
async () => {
|
|
134
|
-
const tempFolder = tmp.dirSync({ unsafeCleanup: true }).name
|
|
135
|
-
console.log('tempFolder', tempFolder)
|
|
136
|
-
const url =
|
|
137
|
-
'https://framer.com/m/Brand-Logo-Ticker-Uc8E.js@WLfLN2D3C6m9DWtZu0ci'
|
|
138
|
-
await bundle({
|
|
139
|
-
components: {
|
|
140
|
-
logos: url,
|
|
141
|
-
},
|
|
142
|
-
cwd: tempFolder,
|
|
143
|
-
})
|
|
144
|
-
},
|
|
145
|
-
1000 * 10,
|
|
146
|
-
)
|
package/src/css.ts
CHANGED
|
@@ -80,7 +80,9 @@ export function getFontsStyles(_fontsDefs: ComponentFontBundle[]) {
|
|
|
80
80
|
const allFonts = deduplicateByKey(
|
|
81
81
|
_fontsDefs.flatMap((x) => x.fonts),
|
|
82
82
|
(x) => x?.url,
|
|
83
|
-
)
|
|
83
|
+
)
|
|
84
|
+
.filter((x) => x.url)
|
|
85
|
+
.sort((a, b) => a.url.localeCompare(b.url))
|
|
84
86
|
|
|
85
87
|
// group fonts by the filenames users
|
|
86
88
|
const grouped = groupBy(allFonts, (x) => {
|
package/src/exporter.ts
CHANGED
|
@@ -26,7 +26,11 @@ import {
|
|
|
26
26
|
} from './css.js'
|
|
27
27
|
import dedent from 'dedent'
|
|
28
28
|
import { logger } from './utils.js'
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
esbuildPluginBundleDependencies,
|
|
31
|
+
resolveRedirect,
|
|
32
|
+
externalPackages,
|
|
33
|
+
} from './esbuild'
|
|
30
34
|
|
|
31
35
|
function validateUrl(url: string) {
|
|
32
36
|
try {
|
|
@@ -69,6 +73,7 @@ export async function bundle({
|
|
|
69
73
|
metafile: true,
|
|
70
74
|
format: 'esm',
|
|
71
75
|
minify: false,
|
|
76
|
+
|
|
72
77
|
treeShaking: true,
|
|
73
78
|
splitting: true,
|
|
74
79
|
// splitting: true,
|
|
@@ -132,12 +137,14 @@ export async function bundle({
|
|
|
132
137
|
.readFile(file.path, 'utf-8')
|
|
133
138
|
.catch(() => null)
|
|
134
139
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
let codeNew =
|
|
141
|
+
`/* eslint-disable */\n` +
|
|
142
|
+
dprint.format(resultPathAbs, file.text, {
|
|
143
|
+
lineWidth: 140,
|
|
144
|
+
quoteStyle: 'alwaysSingle',
|
|
145
|
+
trailingCommas: 'always',
|
|
146
|
+
semiColons: 'always',
|
|
147
|
+
})
|
|
141
148
|
const lines = findRelativeLinks(codeNew)
|
|
142
149
|
if (lines.length) {
|
|
143
150
|
logger.error(
|
package/src/framer.js
CHANGED
|
@@ -9089,7 +9089,7 @@ var cancelSync = stepsOrder.reduce((acc, key7,) => {
|
|
|
9089
9089
|
return acc;
|
|
9090
9090
|
}, {},);
|
|
9091
9091
|
|
|
9092
|
-
// https :https://app.framerstatic.com/framer.
|
|
9092
|
+
// https :https://app.framerstatic.com/framer.PRO3WDEJ.js
|
|
9093
9093
|
import { Component as Component2, } from 'react';
|
|
9094
9094
|
import React12 from 'react';
|
|
9095
9095
|
import { jsx as _jsx5, } from 'react/jsx-runtime';
|
|
@@ -9288,13 +9288,13 @@ import { jsx as jsx54, jsxs as jsxs18, } from 'react/jsx-runtime';
|
|
|
9288
9288
|
import { jsx as jsx55, } from 'react/jsx-runtime';
|
|
9289
9289
|
import { jsx as jsx56, } from 'react/jsx-runtime';
|
|
9290
9290
|
import { jsx as jsx57, } from 'react/jsx-runtime';
|
|
9291
|
+
import React85 from 'react';
|
|
9291
9292
|
import { jsx as jsx58, } from 'react/jsx-runtime';
|
|
9292
|
-
import { useRef as useRef18, } from 'react';
|
|
9293
9293
|
import { jsx as jsx59, } from 'react/jsx-runtime';
|
|
9294
|
-
import
|
|
9295
|
-
import { jsx as jsx60, } from 'react/jsx-runtime';
|
|
9296
|
-
import
|
|
9297
|
-
import { jsx as jsx61, jsxs as
|
|
9294
|
+
import React86 from 'react';
|
|
9295
|
+
import { jsx as jsx60, jsxs as jsxs19, } from 'react/jsx-runtime';
|
|
9296
|
+
import React87 from 'react';
|
|
9297
|
+
import { jsx as jsx61, jsxs as jsxs20, } from 'react/jsx-runtime';
|
|
9298
9298
|
import {
|
|
9299
9299
|
Children as Children32,
|
|
9300
9300
|
cloneElement as cloneElement32,
|
|
@@ -9302,10 +9302,10 @@ import {
|
|
|
9302
9302
|
isValidElement as isValidElement32,
|
|
9303
9303
|
useContext as useContext162,
|
|
9304
9304
|
useInsertionEffect as useInsertionEffect42,
|
|
9305
|
-
useRef as
|
|
9305
|
+
useRef as useRef19,
|
|
9306
9306
|
} from 'react';
|
|
9307
|
-
import * as
|
|
9308
|
-
import { useRef as
|
|
9307
|
+
import * as React88 from 'react';
|
|
9308
|
+
import { useRef as useRef18, } from 'react';
|
|
9309
9309
|
import { jsx as jsx62, } from 'react/jsx-runtime';
|
|
9310
9310
|
import { jsx as jsx63, } from 'react/jsx-runtime';
|
|
9311
9311
|
import { useEffect as useEffect142, useState as useState22, } from 'react';
|
|
@@ -10463,12 +10463,13 @@ var require_fontfaceobserver_standalone = __commonJS({
|
|
|
10463
10463
|
},
|
|
10464
10464
|
},);
|
|
10465
10465
|
function renderPage(Page4, defaultPageStyle,) {
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
: React12.createElement(Page4, { style: defaultPageStyle, },);
|
|
10466
|
+
const style = { style: defaultPageStyle, };
|
|
10467
|
+
return React12.isValidElement(Page4,) ? React12.cloneElement(Page4, style,) : React12.createElement(Page4, style,);
|
|
10469
10468
|
}
|
|
10470
10469
|
var NotFoundError = class extends Error {
|
|
10471
10470
|
};
|
|
10471
|
+
var ErrorBoundaryCaughtError = class extends Error {
|
|
10472
|
+
};
|
|
10472
10473
|
var ErrorBoundary = class extends Component2 {
|
|
10473
10474
|
constructor(props,) {
|
|
10474
10475
|
super(props,);
|
|
@@ -10495,7 +10496,9 @@ var ErrorBoundary = class extends Component2 {
|
|
|
10495
10496
|
return this.props.children;
|
|
10496
10497
|
}
|
|
10497
10498
|
if (!(this.state.error instanceof NotFoundError)) {
|
|
10498
|
-
|
|
10499
|
+
const error = new ErrorBoundaryCaughtError();
|
|
10500
|
+
error.cause = this.state.error;
|
|
10501
|
+
throw error;
|
|
10499
10502
|
}
|
|
10500
10503
|
const { notFoundPage, defaultPageStyle, } = this.props;
|
|
10501
10504
|
if (!notFoundPage) {
|
|
@@ -11377,17 +11380,17 @@ function RoutesProvider({ routes, children, },) {
|
|
|
11377
11380
|
return _jsx2(RouterContext.Provider, { value: { getRoute, }, children, },);
|
|
11378
11381
|
}
|
|
11379
11382
|
var SuspenseErrorBoundary = class extends Component22 {
|
|
11380
|
-
constructor(
|
|
11381
|
-
super(
|
|
11383
|
+
constructor() {
|
|
11384
|
+
super(...arguments,);
|
|
11382
11385
|
this.state = { error: void 0, };
|
|
11383
11386
|
}
|
|
11384
11387
|
static getDerivedStateFromError(error,) {
|
|
11385
|
-
console.error('
|
|
11388
|
+
console.error('Derived error in SuspenseErrorBoundary', error,);
|
|
11386
11389
|
return { error, };
|
|
11387
11390
|
}
|
|
11388
11391
|
componentDidCatch(error, errorInfo,) {
|
|
11389
11392
|
var _a;
|
|
11390
|
-
console.error('Caught error in
|
|
11393
|
+
console.error('Caught error in SuspenseErrorBoundary', error, errorInfo,);
|
|
11391
11394
|
(_a = window.__framer_events) === null || _a === void 0 ? void 0 : _a.push([
|
|
11392
11395
|
'published_site_load_recoverable_error',
|
|
11393
11396
|
{
|
|
@@ -11400,6 +11403,9 @@ var SuspenseErrorBoundary = class extends Component22 {
|
|
|
11400
11403
|
if (this.state.error === void 0) {
|
|
11401
11404
|
return this.props.children;
|
|
11402
11405
|
}
|
|
11406
|
+
if (this.state.error instanceof ErrorBoundaryCaughtError) {
|
|
11407
|
+
throw this.state.error.cause;
|
|
11408
|
+
}
|
|
11403
11409
|
return _jsx3(Suspense, { children: this.props.fallbackChildren, },);
|
|
11404
11410
|
}
|
|
11405
11411
|
};
|
|
@@ -17030,6 +17036,7 @@ var hideScrollbars = [
|
|
|
17030
17036
|
`[data-hide-scrollbars="true"]::-webkit-scrollbar { width: 0px; height: 0px; }`,
|
|
17031
17037
|
`[data-hide-scrollbars="true"]::-webkit-scrollbar-thumb { background: transparent; }`,
|
|
17032
17038
|
];
|
|
17039
|
+
var formInputRules = [`[data-framer-component-type="Form"] input { padding: var(--input-padding); }`,];
|
|
17033
17040
|
var frameCSSRules = (isPreview,) => {
|
|
17034
17041
|
return isPreview ? frameCSS : [];
|
|
17035
17042
|
};
|
|
@@ -17051,6 +17058,7 @@ var combineCSSRules = (isPreview,) => [
|
|
|
17051
17058
|
...svgCSSRules,
|
|
17052
17059
|
...resetCSS,
|
|
17053
17060
|
...hideScrollbars,
|
|
17061
|
+
...formInputRules,
|
|
17054
17062
|
];
|
|
17055
17063
|
export var combinedCSSRules = combineCSSRules(false,);
|
|
17056
17064
|
var combinedCSSRulesForPreview = combineCSSRules(true,);
|
|
@@ -20674,7 +20682,7 @@ var VisibleFrame = /* @__PURE__ */ forwardRef4(function VisibleFrame2(props, for
|
|
|
20674
20682
|
const fallbackRef = useRef62(null,);
|
|
20675
20683
|
const ref = forwardedRef ?? fallbackRef;
|
|
20676
20684
|
const dataProps = {
|
|
20677
|
-
'data-framer-component-type': 'Frame',
|
|
20685
|
+
'data-framer-component-type': props.componentType ?? 'Frame',
|
|
20678
20686
|
'data-framer-cursor': cursor,
|
|
20679
20687
|
'data-framer-highlight': cursor === 'pointer' ? true : void 0,
|
|
20680
20688
|
'data-layoutid': layoutId,
|
|
@@ -24573,6 +24581,9 @@ function makePaddingString({
|
|
|
24573
24581
|
bottom,
|
|
24574
24582
|
right,
|
|
24575
24583
|
},) {
|
|
24584
|
+
if (top === right && right === bottom && bottom === left) {
|
|
24585
|
+
return `${top}px`;
|
|
24586
|
+
}
|
|
24576
24587
|
return `${top}px ${right}px ${bottom}px ${left}px`;
|
|
24577
24588
|
}
|
|
24578
24589
|
function triggerStackReflow(element, display,) {
|
|
@@ -28220,6 +28231,9 @@ function useStyleTransform({
|
|
|
28220
28231
|
if (pageInputRange.length !== outputRange[key7].length) {
|
|
28221
28232
|
continue;
|
|
28222
28233
|
}
|
|
28234
|
+
if (outputRange[key7][0] === void 0) {
|
|
28235
|
+
continue;
|
|
28236
|
+
}
|
|
28223
28237
|
effect.values[key7].set(transform(scrollY.progress, pageInputRange, outputRange[key7],),);
|
|
28224
28238
|
}
|
|
28225
28239
|
},
|
|
@@ -28249,6 +28263,9 @@ function useStyleTransform({
|
|
|
28249
28263
|
if (scrollYInputRange.length !== effectKeyOutputRange[key7].length) {
|
|
28250
28264
|
continue;
|
|
28251
28265
|
}
|
|
28266
|
+
if (effectKeyOutputRange[key7][0] === void 0) {
|
|
28267
|
+
continue;
|
|
28268
|
+
}
|
|
28252
28269
|
effect.values[key7].set(transform(scrollY.current, scrollYInputRange, effectKeyOutputRange[key7],),);
|
|
28253
28270
|
}
|
|
28254
28271
|
},);
|
|
@@ -37658,37 +37675,37 @@ function CustomProperties({
|
|
|
37658
37675
|
},) {
|
|
37659
37676
|
return /* @__PURE__ */ jsx57('div', { style: customProperties, children, },);
|
|
37660
37677
|
}
|
|
37661
|
-
var
|
|
37662
|
-
|
|
37663
|
-
};
|
|
37664
|
-
var FormButton = (props,) => {
|
|
37665
|
-
const { __fromCanvasComponent, style: baseStyle2, } = props;
|
|
37666
|
-
const layoutId = useLayoutId2(props,);
|
|
37667
|
-
const ref = useRef18(null,);
|
|
37678
|
+
var FormButton = /* @__PURE__ */ React85.forwardRef(function FormButon(props, ref,) {
|
|
37679
|
+
const [submitting, setSubmitting,] = React85.useState(false,);
|
|
37680
|
+
const { style: baseStyle2, } = props;
|
|
37668
37681
|
const style = mergeWithDefaultStyle(baseStyle2 ?? {},);
|
|
37669
|
-
const
|
|
37670
|
-
|
|
37682
|
+
const onSubmit = () => {
|
|
37683
|
+
setSubmitting(true,);
|
|
37684
|
+
setTimeout(() => {
|
|
37685
|
+
setSubmitting(false,);
|
|
37686
|
+
}, 500,);
|
|
37671
37687
|
};
|
|
37672
|
-
|
|
37673
|
-
useMeasureLayout(props, ref,);
|
|
37674
|
-
return /* @__PURE__ */ jsx59(
|
|
37688
|
+
return /* @__PURE__ */ jsx58(
|
|
37675
37689
|
motion.input,
|
|
37676
37690
|
{
|
|
37677
37691
|
type: props.type,
|
|
37678
|
-
|
|
37679
|
-
|
|
37680
|
-
layoutId,
|
|
37692
|
+
'data-submitting': submitting,
|
|
37693
|
+
disabled: props.isDisabled || submitting,
|
|
37681
37694
|
ref,
|
|
37682
|
-
style
|
|
37683
|
-
value: props.value ?? 'Submit',
|
|
37695
|
+
style,
|
|
37696
|
+
value: submitting ? 'Submitting' : props.value ?? 'Submit',
|
|
37697
|
+
onClick: onSubmit,
|
|
37684
37698
|
},
|
|
37685
37699
|
);
|
|
37686
|
-
};
|
|
37700
|
+
},);
|
|
37687
37701
|
function mergeWithDefaultStyle(style,) {
|
|
37688
37702
|
return {
|
|
37689
37703
|
display: 'block',
|
|
37690
37704
|
padding: '12px',
|
|
37705
|
+
fontSize: '14px',
|
|
37691
37706
|
width: '100%',
|
|
37707
|
+
fontWeight: 'bold',
|
|
37708
|
+
cursor: 'pointer',
|
|
37692
37709
|
background: '#222',
|
|
37693
37710
|
color: '#fff',
|
|
37694
37711
|
borderRadius: '10px',
|
|
@@ -37696,45 +37713,88 @@ function mergeWithDefaultStyle(style,) {
|
|
|
37696
37713
|
...style,
|
|
37697
37714
|
};
|
|
37698
37715
|
}
|
|
37699
|
-
var
|
|
37700
|
-
const
|
|
37701
|
-
|
|
37702
|
-
|
|
37716
|
+
var FormContainer = ({ action: _, formId, ...props },) => {
|
|
37717
|
+
const handleSubmit = async (event,) => {
|
|
37718
|
+
event.preventDefault();
|
|
37719
|
+
const data2 = new URLSearchParams();
|
|
37720
|
+
for (const [key7, value,] of new FormData(event.currentTarget,)) {
|
|
37721
|
+
data2.append(key7, value,);
|
|
37722
|
+
}
|
|
37723
|
+
await fetch('https://hooks.zapier.com/hooks/catch/8935032/3pzgf76/', {
|
|
37724
|
+
body: new URLSearchParams(data2,),
|
|
37725
|
+
method: 'POST',
|
|
37726
|
+
},);
|
|
37727
|
+
};
|
|
37728
|
+
return /* @__PURE__ */ jsx59(motion.form, { ...props, 'data-formid': formId, onSubmit: handleSubmit, children: props.children, },);
|
|
37729
|
+
};
|
|
37730
|
+
var passwordManagerIgnoreDataProps = {
|
|
37731
|
+
// 1Password
|
|
37732
|
+
'data-1p-ignore': true,
|
|
37733
|
+
// LastPass
|
|
37734
|
+
'data-lpignore': true,
|
|
37735
|
+
};
|
|
37736
|
+
var sensibleInputDefaults = {
|
|
37737
|
+
autocomplete: 'off',
|
|
37738
|
+
};
|
|
37739
|
+
var labelStyles = {
|
|
37740
|
+
display: 'block',
|
|
37741
|
+
marginBottom: 8,
|
|
37742
|
+
fontSize: 12,
|
|
37743
|
+
color: '#000',
|
|
37744
|
+
width: '100%',
|
|
37745
|
+
fontWeight: 'bold',
|
|
37746
|
+
textTransform: 'capitalize',
|
|
37747
|
+
};
|
|
37748
|
+
var FormPlainTextInput = /* @__PURE__ */ React86.forwardRef(function FormPlainTextInput2(props, ref,) {
|
|
37703
37749
|
const dataProps = {
|
|
37704
|
-
|
|
37750
|
+
...sensibleInputDefaults,
|
|
37751
|
+
...passwordManagerIgnoreDataProps,
|
|
37705
37752
|
};
|
|
37706
|
-
const isDisabled = Boolean(__fromCanvasComponent,);
|
|
37707
|
-
useMeasureLayout(props, ref,);
|
|
37708
37753
|
const baseStyle2 = {
|
|
37709
|
-
|
|
37754
|
+
fontSize: '14px',
|
|
37710
37755
|
width: '100%',
|
|
37711
37756
|
background: '#f5f5f5',
|
|
37712
37757
|
borderRadius: '10px',
|
|
37713
37758
|
border: '1px solid rgba(0,0,0,0.05)',
|
|
37714
37759
|
};
|
|
37715
|
-
|
|
37760
|
+
const input = /* @__PURE__ */ jsx60(
|
|
37716
37761
|
motion.input,
|
|
37717
37762
|
{
|
|
37718
|
-
|
|
37763
|
+
id: props.inputName,
|
|
37764
|
+
disabled: props.isDisabled,
|
|
37719
37765
|
...dataProps,
|
|
37720
|
-
|
|
37721
|
-
|
|
37722
|
-
|
|
37723
|
-
|
|
37724
|
-
|
|
37725
|
-
},
|
|
37766
|
+
type: props.type,
|
|
37767
|
+
required: props.required,
|
|
37768
|
+
autoFocus: props.autoFocus,
|
|
37769
|
+
name: props.inputName,
|
|
37770
|
+
style: baseStyle2,
|
|
37726
37771
|
placeholder: props.placeholder,
|
|
37727
37772
|
},
|
|
37728
37773
|
);
|
|
37729
|
-
|
|
37730
|
-
|
|
37774
|
+
if (props.label) {
|
|
37775
|
+
return /* @__PURE__ */ jsx60('div', {
|
|
37776
|
+
ref,
|
|
37777
|
+
style: { width: '100%', },
|
|
37778
|
+
children: /* @__PURE__ */ jsxs19('label', {
|
|
37779
|
+
style: { width: '100%', },
|
|
37780
|
+
htmlFor: props.inputName,
|
|
37781
|
+
children: [
|
|
37782
|
+
/* @__PURE__ */ jsx60('span', { style: labelStyles, children: props.label, },),
|
|
37783
|
+
input,
|
|
37784
|
+
],
|
|
37785
|
+
},),
|
|
37786
|
+
},);
|
|
37787
|
+
}
|
|
37788
|
+
return /* @__PURE__ */ jsx60('div', { ref, style: { width: '100%', }, children: input, },);
|
|
37789
|
+
},);
|
|
37790
|
+
var Image2 = /* @__PURE__ */ React87.forwardRef(function Image3(props, ref,) {
|
|
37731
37791
|
const { background, children, alt, ...rest } = props;
|
|
37732
37792
|
const style = { ...rest.style, };
|
|
37733
37793
|
if (background) {
|
|
37734
37794
|
delete style.background;
|
|
37735
37795
|
}
|
|
37736
37796
|
const MotionComponent = htmlElementAsMotionComponent(props.as,);
|
|
37737
|
-
return /* @__PURE__ */
|
|
37797
|
+
return /* @__PURE__ */ jsxs20(MotionComponent, {
|
|
37738
37798
|
...rest,
|
|
37739
37799
|
style,
|
|
37740
37800
|
ref,
|
|
@@ -37874,7 +37934,7 @@ function escapeHTML2(str,) {
|
|
|
37874
37934
|
}
|
|
37875
37935
|
var deprecatedRichTextPlaceholder = '{{ text-placeholder }}';
|
|
37876
37936
|
var richTextWrapperClassName = 'rich-text-wrapper';
|
|
37877
|
-
var DeprecatedRichText = /* @__PURE__ */
|
|
37937
|
+
var DeprecatedRichText = /* @__PURE__ */ React88.forwardRef(
|
|
37878
37938
|
function Text3(props, forwardedRef,) {
|
|
37879
37939
|
const {
|
|
37880
37940
|
id: id3,
|
|
@@ -37916,13 +37976,13 @@ var DeprecatedRichText = /* @__PURE__ */ React86.forwardRef(
|
|
|
37916
37976
|
} = props;
|
|
37917
37977
|
const parentSize = useParentSize();
|
|
37918
37978
|
const layoutId = useLayoutId2(props,);
|
|
37919
|
-
const fallbackLayoutRef =
|
|
37979
|
+
const fallbackLayoutRef = useRef18(null,);
|
|
37920
37980
|
const layoutRef = forwardedRef ?? fallbackLayoutRef;
|
|
37921
37981
|
const { navigate, getRoute, } = useRouter();
|
|
37922
37982
|
const currentRoute = useCurrentRoute();
|
|
37923
37983
|
useRoutePreloader(props.preload ?? [],);
|
|
37924
37984
|
useMeasureLayout(props, layoutRef,);
|
|
37925
|
-
const inCodeComponent =
|
|
37985
|
+
const inCodeComponent = React88.useContext(ComponentContainerContext,);
|
|
37926
37986
|
const isOnCanvas = useIsOnFramerCanvas();
|
|
37927
37987
|
let textOrOverride = text;
|
|
37928
37988
|
const forwardedOverrideId = _forwardedOverrideId ?? id3;
|
|
@@ -37945,13 +38005,13 @@ var DeprecatedRichText = /* @__PURE__ */ React86.forwardRef(
|
|
|
37945
38005
|
innerHTML = htmlFromDesign;
|
|
37946
38006
|
}
|
|
37947
38007
|
const implicitPathVariables = useImplicitPathVariables();
|
|
37948
|
-
const innerHTMLWithReplacedFramerPageLinks =
|
|
38008
|
+
const innerHTMLWithReplacedFramerPageLinks = React88.useMemo(() => {
|
|
37949
38009
|
if (isOnCanvas || !getRoute || !currentRoute) {
|
|
37950
38010
|
return innerHTML;
|
|
37951
38011
|
}
|
|
37952
38012
|
return replaceFramerPageLinks(innerHTML, getRoute, currentRoute, implicitPathVariables,);
|
|
37953
38013
|
}, [isOnCanvas, innerHTML, getRoute, currentRoute, implicitPathVariables,],);
|
|
37954
|
-
|
|
38014
|
+
React88.useEffect(() => {
|
|
37955
38015
|
const container = layoutRef.current;
|
|
37956
38016
|
if (container === null) {
|
|
37957
38017
|
return;
|
|
@@ -37972,7 +38032,7 @@ var DeprecatedRichText = /* @__PURE__ */ React86.forwardRef(
|
|
|
37972
38032
|
};
|
|
37973
38033
|
}, [navigate, implicitPathVariables,],);
|
|
37974
38034
|
useLoadFonts(fonts, __fromCanvasComponent, layoutRef,);
|
|
37975
|
-
|
|
38035
|
+
React88.useInsertionEffect(() => {
|
|
37976
38036
|
injectComponentCSSRules();
|
|
37977
38037
|
}, [],);
|
|
37978
38038
|
if (!visible) {
|
|
@@ -38057,7 +38117,7 @@ function convertVerticalAlignment2(verticalAlignment,) {
|
|
|
38057
38117
|
}
|
|
38058
38118
|
}
|
|
38059
38119
|
function useLoadFonts(fonts, fromCanvasComponent, containerRef,) {
|
|
38060
|
-
const prevFontsRef =
|
|
38120
|
+
const prevFontsRef = useRef18([],);
|
|
38061
38121
|
if (!isShallowEqualArray(prevFontsRef.current, fonts,)) {
|
|
38062
38122
|
prevFontsRef.current = fonts;
|
|
38063
38123
|
fontStore.loadFonts(fonts,).then(({ newlyLoadedFontCount, },) => {
|
|
@@ -38133,7 +38193,7 @@ var RichTextContainer = /* @__PURE__ */ forwardRef52(
|
|
|
38133
38193
|
const isOnCanvas = useIsOnFramerCanvas();
|
|
38134
38194
|
const inCodeComponent = useContext162(ComponentContainerContext,);
|
|
38135
38195
|
const layoutId = useLayoutId2(props,);
|
|
38136
|
-
const fallbackRef =
|
|
38196
|
+
const fallbackRef = useRef19(null,);
|
|
38137
38197
|
const containerRef = ref ?? fallbackRef;
|
|
38138
38198
|
useMeasureLayout(props, containerRef,);
|
|
38139
38199
|
useLoadFonts(fonts, __fromCanvasComponent, containerRef,);
|
|
@@ -38697,7 +38757,9 @@ var package_default = {
|
|
|
38697
38757
|
scripts: {
|
|
38698
38758
|
prepublishOnly: 'make build',
|
|
38699
38759
|
coverage: 'yarn :jest --coverage',
|
|
38700
|
-
lint: 'yarn :eslint ./src --ext .ts,.tsx --format codeframe --quiet',
|
|
38760
|
+
lint: 'yarn format-check:ts && yarn :eslint ./src --ext .ts,.tsx --format codeframe --quiet',
|
|
38761
|
+
'format:ts': 'yarn :format "src/**/*.{ts,tsx}"',
|
|
38762
|
+
'format-check:ts': 'yarn :format-check "src/**/*.{ts,tsx}"',
|
|
38701
38763
|
'lint:fix': 'yarn lint --fix --cache',
|
|
38702
38764
|
test: 'yarn :jest',
|
|
38703
38765
|
watch: 'yarn :jest --watch',
|