unframer 3.0.2 → 3.0.5
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.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +14 -6
- package/dist/cli.test.js.map +1 -1
- package/dist/example-code.test.js +1 -1
- package/dist/exporter.d.ts +0 -14
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +14 -187
- package/dist/exporter.js.map +1 -1
- package/dist/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.d.ts +115 -0
- package/dist/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.d.ts.map +1 -0
- package/dist/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.js +8 -0
- package/dist/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.js.map +1 -0
- package/dist/framer-chunks/fontshare-622CVMZZ-HFPH543A.d.ts +781 -0
- package/dist/framer-chunks/fontshare-622CVMZZ-HFPH543A.d.ts.map +1 -0
- package/dist/framer-chunks/fontshare-622CVMZZ-HFPH543A.js +8 -0
- package/dist/framer-chunks/fontshare-622CVMZZ-HFPH543A.js.map +1 -0
- package/dist/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.d.ts +634 -0
- package/dist/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.d.ts.map +1 -0
- package/dist/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.js +8 -0
- package/dist/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.js.map +1 -0
- package/dist/framer-chunks/google-3ASCFEEO-3R47BR2A.d.ts +1561 -0
- package/dist/framer-chunks/google-3ASCFEEO-3R47BR2A.d.ts.map +1 -0
- package/dist/framer-chunks/google-3ASCFEEO-3R47BR2A.js +8 -0
- package/dist/framer-chunks/google-3ASCFEEO-3R47BR2A.js.map +1 -0
- package/dist/framer-chunks/google-C62SNV32-LCI4F7VO.d.ts +3546 -0
- package/dist/framer-chunks/google-C62SNV32-LCI4F7VO.d.ts.map +1 -0
- package/dist/framer-chunks/google-C62SNV32-LCI4F7VO.js +8 -0
- package/dist/framer-chunks/google-C62SNV32-LCI4F7VO.js.map +1 -0
- package/dist/framer-chunks/google-FDB6LUFQ-PFSUZGKF.d.ts +10258 -0
- package/dist/framer-chunks/google-FDB6LUFQ-PFSUZGKF.d.ts.map +1 -0
- package/dist/framer-chunks/google-FDB6LUFQ-PFSUZGKF.js +8 -0
- package/dist/framer-chunks/google-FDB6LUFQ-PFSUZGKF.js.map +1 -0
- package/dist/framer.js +1230 -223
- package/dist/generated/api-client.js.map +1 -1
- package/dist/typescript.d.ts +20 -0
- package/dist/typescript.d.ts.map +1 -0
- package/dist/typescript.js +169 -0
- package/dist/typescript.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/cli.js +1 -0
- package/esm/cli.js.map +1 -1
- package/esm/cli.test.js +9 -1
- package/esm/cli.test.js.map +1 -1
- package/esm/example-code.test.js +1 -1
- package/esm/exporter.d.ts +0 -14
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +11 -182
- package/esm/exporter.js.map +1 -1
- package/esm/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.d.ts +115 -0
- package/esm/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.d.ts.map +1 -0
- package/esm/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.js +5 -0
- package/esm/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.js.map +1 -0
- package/esm/framer-chunks/fontshare-622CVMZZ-HFPH543A.d.ts +781 -0
- package/esm/framer-chunks/fontshare-622CVMZZ-HFPH543A.d.ts.map +1 -0
- package/esm/framer-chunks/fontshare-622CVMZZ-HFPH543A.js +5 -0
- package/esm/framer-chunks/fontshare-622CVMZZ-HFPH543A.js.map +1 -0
- package/esm/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.d.ts +634 -0
- package/esm/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.d.ts.map +1 -0
- package/esm/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.js +5 -0
- package/esm/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.js.map +1 -0
- package/esm/framer-chunks/google-3ASCFEEO-3R47BR2A.d.ts +1561 -0
- package/esm/framer-chunks/google-3ASCFEEO-3R47BR2A.d.ts.map +1 -0
- package/esm/framer-chunks/google-3ASCFEEO-3R47BR2A.js +5 -0
- package/esm/framer-chunks/google-3ASCFEEO-3R47BR2A.js.map +1 -0
- package/esm/framer-chunks/google-C62SNV32-LCI4F7VO.d.ts +3546 -0
- package/esm/framer-chunks/google-C62SNV32-LCI4F7VO.d.ts.map +1 -0
- package/esm/framer-chunks/google-C62SNV32-LCI4F7VO.js +5 -0
- package/esm/framer-chunks/google-C62SNV32-LCI4F7VO.js.map +1 -0
- package/esm/framer-chunks/google-FDB6LUFQ-PFSUZGKF.d.ts +10258 -0
- package/esm/framer-chunks/google-FDB6LUFQ-PFSUZGKF.d.ts.map +1 -0
- package/esm/framer-chunks/google-FDB6LUFQ-PFSUZGKF.js +5 -0
- package/esm/framer-chunks/google-FDB6LUFQ-PFSUZGKF.js.map +1 -0
- package/esm/framer.js +1230 -224
- package/esm/generated/api-client.js.map +1 -1
- package/esm/typescript.d.ts +20 -0
- package/esm/typescript.d.ts.map +1 -0
- package/esm/typescript.js +165 -0
- package/esm/typescript.js.map +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +6 -3
- package/src/cli.test.ts +8 -1
- package/src/cli.ts +1 -1
- package/src/example-code.test.ts +1 -1
- package/src/exporter.ts +13 -203
- package/src/framer-chunks/fontshare-4J2ZFRBB-H5VQLZTM.js +7 -0
- package/src/framer-chunks/fontshare-622CVMZZ-HFPH543A.js +7 -0
- package/src/framer-chunks/fontshare-JGEKH7YN-QOX3MC3K.js +7 -0
- package/src/framer-chunks/google-3ASCFEEO-3R47BR2A.js +7 -0
- package/src/framer-chunks/google-C62SNV32-LCI4F7VO.js +7 -0
- package/src/framer-chunks/google-FDB6LUFQ-PFSUZGKF.js +7 -0
- package/src/framer.js +1170 -215
- package/src/generated/api-client.d.ts +790 -1042
- package/src/generated/api-client.js +5 -5
- package/src/styles/framer.css +1963 -0
- package/src/styles/reset.css +37 -0
- package/src/typescript.ts +196 -0
- package/src/version.ts +1 -1
- package/dist/generated/api-client.test.d.ts +0 -2
- package/dist/generated/api-client.test.d.ts.map +0 -1
- package/dist/generated/api-client.test.js +0 -3
- package/dist/generated/api-client.test.js.map +0 -1
- package/esm/generated/api-client.test.d.ts +0 -1
- package/esm/generated/api-client.test.d.ts.map +0 -1
- package/esm/generated/api-client.test.js +0 -2
- package/esm/generated/api-client.test.js.map +0 -1
- package/src/generated/api-client.d.ts.map +0 -1
- package/src/generated/api-client.js.map +0 -1
- package/src/generated/api-client.test.d.ts +0 -1
- package/src/generated/api-client.test.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/generated/api-client.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE;IACtC,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/generated/api-client.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE;IACtC,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,EAAE;QACtC,oCAAoC;QACpC,kDAAkD;QAClD,qBAAqB;QACrB,4CAA4C;QAC5C,QAAQ;QACR,iBAAiB;QACjB,KAAK;QACL,+BAA+B;QAC/B,0BAA0B;QAC1B,iDAAiD;QACjD,QAAQ;QACR,sBAAsB;QACtB,KAAK;QACL,OAAO;YACH,OAAO;YACP,yFAAyF;aACxF,CAAC;QACN,CAAC;KACJ,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,iFAAiF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PropertyControls } from './framer.js';
|
|
2
|
+
export declare function componentCamelCase(str: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Generates TypeDoc comments that will be injected into JSX files
|
|
5
|
+
* instead of generating separate .d.ts files
|
|
6
|
+
*/
|
|
7
|
+
export declare function propControlsToTypedocComments({ locales, componentImportedName, propertyControls, logger, includeLocaleTypes, }: {
|
|
8
|
+
propertyControls: PropertyControls;
|
|
9
|
+
componentImportedName: string;
|
|
10
|
+
locales?: Array<{
|
|
11
|
+
slug: string;
|
|
12
|
+
}>;
|
|
13
|
+
logger: any;
|
|
14
|
+
includeLocaleTypes?: boolean;
|
|
15
|
+
}): {
|
|
16
|
+
headerComment: string;
|
|
17
|
+
responsiveComment: string;
|
|
18
|
+
defaultExportComment: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE/E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,UAoC7C;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,EAC1C,OAAO,EACP,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,EACN,kBAA0B,GAC7B,EAAE;IACC,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,qBAAqB,EAAE,MAAM,CAAA;IAC7B,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACjC,MAAM,EAAE,GAAG,CAAA;IACX,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B;;;;EA0IA"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { propCamelCaseJustLikeFramer } from './compat.js';
|
|
2
|
+
import { ControlType } from './framer.js';
|
|
3
|
+
export function componentCamelCase(str) {
|
|
4
|
+
str = str?.replace(/\.jsx?$/, '');
|
|
5
|
+
if (!str) {
|
|
6
|
+
return 'FramerComponent';
|
|
7
|
+
}
|
|
8
|
+
// Take last part after slashes
|
|
9
|
+
str = str.split('/').filter(Boolean).pop() || '';
|
|
10
|
+
// Replace all non-alphanumeric characters with space
|
|
11
|
+
// This handles spaces, special chars, underscores, hyphens, etc.
|
|
12
|
+
str = str.replace(/[^a-zA-Z0-9]+/g, ' ');
|
|
13
|
+
// Convert to camelCase: split by spaces, capitalize each word except first
|
|
14
|
+
const words = str.trim().split(/\s+/).filter(Boolean);
|
|
15
|
+
if (words.length === 0) {
|
|
16
|
+
return 'FramerComponent';
|
|
17
|
+
}
|
|
18
|
+
str = words
|
|
19
|
+
.map((word, index) => {
|
|
20
|
+
// First word: capitalize only if it starts with lowercase
|
|
21
|
+
if (index === 0) {
|
|
22
|
+
return word[0].toUpperCase() + word.slice(1);
|
|
23
|
+
}
|
|
24
|
+
// Other words: always capitalize first letter
|
|
25
|
+
return word[0].toUpperCase() + word.slice(1);
|
|
26
|
+
})
|
|
27
|
+
.join('');
|
|
28
|
+
// If component name starts with a number, add prefix 'Framer'
|
|
29
|
+
if (/^[0-9]/.test(str)) {
|
|
30
|
+
str = 'Framer' + str;
|
|
31
|
+
}
|
|
32
|
+
str = str + 'FramerComponent';
|
|
33
|
+
return str;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generates TypeDoc comments that will be injected into JSX files
|
|
37
|
+
* instead of generating separate .d.ts files
|
|
38
|
+
*/
|
|
39
|
+
export function propControlsToTypedocComments({ locales, componentImportedName, propertyControls, logger, includeLocaleTypes = false, }) {
|
|
40
|
+
try {
|
|
41
|
+
const types = Object.entries(propertyControls || {})
|
|
42
|
+
.map(([key, value]) => {
|
|
43
|
+
if (!value) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const typescriptType = (value) => {
|
|
47
|
+
value.type;
|
|
48
|
+
switch (value.type) {
|
|
49
|
+
case ControlType.Color:
|
|
50
|
+
return 'string';
|
|
51
|
+
case ControlType.Boolean:
|
|
52
|
+
return 'boolean';
|
|
53
|
+
case ControlType.Number:
|
|
54
|
+
return 'number';
|
|
55
|
+
case ControlType.String:
|
|
56
|
+
return 'string';
|
|
57
|
+
case ControlType.Enum: {
|
|
58
|
+
// @ts-expect-error
|
|
59
|
+
const options = value.optionTitles || value.options;
|
|
60
|
+
return options.map((x) => `'${x}'`).join(' | ');
|
|
61
|
+
}
|
|
62
|
+
case ControlType.File:
|
|
63
|
+
return 'string';
|
|
64
|
+
case ControlType.Image:
|
|
65
|
+
return 'string';
|
|
66
|
+
case ControlType.ComponentInstance:
|
|
67
|
+
return 'React.ReactNode';
|
|
68
|
+
case ControlType.Array:
|
|
69
|
+
// @ts-expect-error
|
|
70
|
+
return `${typescriptType(value.control)}[]`;
|
|
71
|
+
case ControlType.Object:
|
|
72
|
+
// @ts-expect-error
|
|
73
|
+
return `{${Object.entries(value.controls)
|
|
74
|
+
.map(([k, v]) => {
|
|
75
|
+
// @ts-expect-error
|
|
76
|
+
return `${k}: ${typescriptType(v)}`;
|
|
77
|
+
})
|
|
78
|
+
.join(', ')}`;
|
|
79
|
+
case ControlType.Date:
|
|
80
|
+
return 'string | Date';
|
|
81
|
+
case ControlType.Link:
|
|
82
|
+
return 'string';
|
|
83
|
+
case ControlType.ResponsiveImage:
|
|
84
|
+
return `{src: string, srcSet?: string, alt?: string}`;
|
|
85
|
+
case ControlType.FusedNumber:
|
|
86
|
+
return 'number';
|
|
87
|
+
case ControlType.Transition:
|
|
88
|
+
return 'any';
|
|
89
|
+
case ControlType.EventHandler:
|
|
90
|
+
return 'Function';
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
let name = propCamelCaseJustLikeFramer(value.title || key || '');
|
|
94
|
+
if (!name) {
|
|
95
|
+
return '';
|
|
96
|
+
}
|
|
97
|
+
return ` * ${name}?: ${typescriptType(value)} // ${value.title || name}`;
|
|
98
|
+
})
|
|
99
|
+
.filter(Boolean)
|
|
100
|
+
.join('\n');
|
|
101
|
+
const componentName = componentImportedName;
|
|
102
|
+
const defaultPropsJsDoc = [
|
|
103
|
+
' * children?: React.ReactNode',
|
|
104
|
+
includeLocaleTypes ? ' * locale?: Locale' : null,
|
|
105
|
+
' * style?: React.CSSProperties',
|
|
106
|
+
' * className?: string',
|
|
107
|
+
' * id?: string',
|
|
108
|
+
' * ref?: any',
|
|
109
|
+
' * width?: any',
|
|
110
|
+
' * height?: any',
|
|
111
|
+
' * layoutId?: string',
|
|
112
|
+
].filter(Boolean).join('\n');
|
|
113
|
+
// Generate header comment with type definitions
|
|
114
|
+
let headerComment = '';
|
|
115
|
+
if (includeLocaleTypes) {
|
|
116
|
+
headerComment += '/**\n';
|
|
117
|
+
headerComment += ' * @typedef Locale\n';
|
|
118
|
+
// Generate union type from locales if available
|
|
119
|
+
const localeType = (() => {
|
|
120
|
+
if (locales && Array.isArray(locales) && locales.length > 0) {
|
|
121
|
+
return locales.map((locale) => `'${locale.slug}'`).join(' | ');
|
|
122
|
+
}
|
|
123
|
+
return 'string';
|
|
124
|
+
})();
|
|
125
|
+
headerComment += ` * ${localeType}\n`;
|
|
126
|
+
headerComment += ' */\n\n';
|
|
127
|
+
}
|
|
128
|
+
headerComment += '/**\n';
|
|
129
|
+
headerComment += ' * @typedef {{\n';
|
|
130
|
+
headerComment += defaultPropsJsDoc;
|
|
131
|
+
if (types) {
|
|
132
|
+
headerComment += '\n' + types;
|
|
133
|
+
}
|
|
134
|
+
headerComment += `\n}} Props\n`;
|
|
135
|
+
headerComment += '\n */';
|
|
136
|
+
// Generate responsive comment
|
|
137
|
+
let responsiveComment = '/**\n';
|
|
138
|
+
responsiveComment += ' * @type {import("unframer").UnframerBreakpoint}\n';
|
|
139
|
+
responsiveComment += ' * Represents a responsive breakpoint for unframer.\n';
|
|
140
|
+
responsiveComment += ' */\n\n';
|
|
141
|
+
responsiveComment += '/**\n';
|
|
142
|
+
responsiveComment += ' * @typedef VariantsMap\n';
|
|
143
|
+
responsiveComment += " * Partial record of UnframerBreakpoint to Props.variant, with a mandatory 'base' key.\n";
|
|
144
|
+
responsiveComment += " * { [key in UnframerBreakpoint]?: Props['variant'] } & { base: Props['variant'] }\n";
|
|
145
|
+
responsiveComment += ' */\n\n';
|
|
146
|
+
responsiveComment += `/**\n * Renders ${componentName} for all breakpoints with a variants map. Variant prop is inferred per breakpoint.\n * @function\n * @param {Omit<Props, 'variant'> & {variants?: VariantsMap}} props\n * @returns {any}\n */`;
|
|
147
|
+
// Generate default export comment - use inline function type instead of referencing undefined type
|
|
148
|
+
const defaultExportComment = `/** @type {function(Props): any} */`;
|
|
149
|
+
return {
|
|
150
|
+
headerComment,
|
|
151
|
+
responsiveComment,
|
|
152
|
+
defaultExportComment,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
logger.error(e.message);
|
|
157
|
+
logger.error('cannot generate typedoc comments', e.stack);
|
|
158
|
+
return {
|
|
159
|
+
headerComment: '',
|
|
160
|
+
responsiveComment: '',
|
|
161
|
+
defaultExportComment: '',
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAsB,WAAW,EAAoB,MAAM,aAAa,CAAA;AAE/E,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC1C,GAAG,GAAG,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE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,CAAA;QAC/G,iBAAiB,IAAI,sFAAsF,CAAA;QAC3G,iBAAiB,IAAI,SAAS,CAAA;QAC9B,iBAAiB,IAAI,mBAAmB,aAAa,+LAA+L,CAAA;QAEpP,mGAAmG;QACnG,MAAM,oBAAoB,GAAG,qCAAqC,CAAA;QAElE,OAAO;YACH,aAAa;YACb,iBAAiB;YACjB,oBAAoB;SACvB,CAAA;IACL,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QACvB,MAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAA;QACzD,OAAO;YACH,aAAa,EAAE,EAAE;YACjB,iBAAiB,EAAE,EAAE;YACrB,oBAAoB,EAAE,EAAE;SAC3B,CAAA;IACL,CAAC;AACL,CAAC"}
|
package/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "3.0.
|
|
1
|
+
export declare const version = "3.0.5";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '3.0.
|
|
1
|
+
export const version = '3.0.5';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unframer",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Import Framer components directly in your React app, type safe and customizable",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"repository": "https://github.com/remorses/unframer",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"module": "./esm/exporter.js",
|
|
30
30
|
"default": "./dist/exporter.js"
|
|
31
31
|
},
|
|
32
|
+
"./styles/*": {
|
|
33
|
+
"default": "./src/styles/*"
|
|
34
|
+
},
|
|
32
35
|
"./src/*": {
|
|
33
36
|
"default": "./src/*.ts"
|
|
34
37
|
},
|
|
@@ -51,11 +54,11 @@
|
|
|
51
54
|
"@biomejs/wasm-nodejs": "^1.9.4",
|
|
52
55
|
"async-sema": "^3.1.1",
|
|
53
56
|
"cac": "^6.7.14",
|
|
54
|
-
"esbuild": "^0.25.
|
|
57
|
+
"esbuild": "^0.25.8",
|
|
55
58
|
"esbuild-plugins-node-modules-polyfill": "^1.6.8",
|
|
56
59
|
"nanospinner": "^1.2.2",
|
|
57
60
|
"picocolors": "^1.1.1",
|
|
58
|
-
"real-framer-motion": "npm:framer-motion@^12.
|
|
61
|
+
"real-framer-motion": "npm:framer-motion@^12.23.12",
|
|
59
62
|
"spiceflow": "^1.13.2",
|
|
60
63
|
"string-dedent": "^3.0.1",
|
|
61
64
|
"undici": "^7.10.0"
|
package/src/cli.test.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { expect, test } from 'vitest'
|
|
2
2
|
import {
|
|
3
|
-
componentCamelCase,
|
|
4
3
|
extractTokenInfo,
|
|
5
4
|
findRelativeLinks,
|
|
6
5
|
} from './exporter.js'
|
|
6
|
+
import { componentCamelCase } from './typescript.js'
|
|
7
7
|
|
|
8
8
|
import { componentNameToPath } from './utils.js'
|
|
9
9
|
|
|
@@ -38,6 +38,13 @@ test('componentCamelCase', () => {
|
|
|
38
38
|
expect(componentCamelCase('shared/nav/framer-nav')).toMatchInlineSnapshot(
|
|
39
39
|
`"FramerNavFramerComponent"`,
|
|
40
40
|
)
|
|
41
|
+
// Test cases with spaces and special characters
|
|
42
|
+
expect(componentCamelCase('hero section')).toMatchInlineSnapshot(`"HeroSectionFramerComponent"`)
|
|
43
|
+
expect(componentCamelCase('hero-section with spaces')).toMatchInlineSnapshot(`"HeroSectionWithSpacesFramerComponent"`)
|
|
44
|
+
expect(componentCamelCase('component@#$name')).toMatchInlineSnapshot(`"ComponentNameFramerComponent"`)
|
|
45
|
+
expect(componentCamelCase('123-component')).toMatchInlineSnapshot(`"Framer123ComponentFramerComponent"`)
|
|
46
|
+
expect(componentCamelCase('component!!name??test')).toMatchInlineSnapshot(`"ComponentNameTestFramerComponent"`)
|
|
47
|
+
expect(componentCamelCase(' multiple spaces ')).toMatchInlineSnapshot(`"MultipleSpacesFramerComponent"`)
|
|
41
48
|
})
|
|
42
49
|
test('findRelativeLinks', () => {
|
|
43
50
|
expect(
|
package/src/cli.ts
CHANGED
package/src/example-code.test.ts
CHANGED
|
@@ -28,7 +28,7 @@ describe('createExampleComponentCode', () => {
|
|
|
28
28
|
|
|
29
29
|
export default function App() {
|
|
30
30
|
return (
|
|
31
|
-
<div className='flex flex-col items-center gap-3 '>
|
|
31
|
+
<div className='flex flex-col items-center gap-3 bg-[rgb(8,_8, 7)]'>
|
|
32
32
|
<NavigationFramerComponent.Responsive
|
|
33
33
|
ctaVariant={"Primary"}
|
|
34
34
|
/>
|
package/src/exporter.ts
CHANGED
|
@@ -30,6 +30,10 @@ import {
|
|
|
30
30
|
groupBy,
|
|
31
31
|
logFontsUsage,
|
|
32
32
|
} from './css.js'
|
|
33
|
+
import {
|
|
34
|
+
propControlsToTypedocComments,
|
|
35
|
+
componentCamelCase,
|
|
36
|
+
} from './typescript.js'
|
|
33
37
|
import {
|
|
34
38
|
defaultExternalPackages,
|
|
35
39
|
esbuildPluginBundleDependencies,
|
|
@@ -425,10 +429,13 @@ export async function bundle({
|
|
|
425
429
|
fileName: path.basename(file.path),
|
|
426
430
|
})),
|
|
427
431
|
)
|
|
432
|
+
const componentImportedName = componentCamelCase(name)
|
|
428
433
|
const typedocComments = propControlsToTypedocComments({
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
434
|
+
propertyControls: propertyControls!,
|
|
435
|
+
logger,
|
|
436
|
+
componentImportedName,
|
|
437
|
+
locales: config.locales,
|
|
438
|
+
includeLocaleTypes: true,
|
|
432
439
|
})
|
|
433
440
|
logger.log(
|
|
434
441
|
`Generated TypeDoc comments for ${name}: ${!!typedocComments.headerComment}`,
|
|
@@ -457,15 +464,12 @@ export async function bundle({
|
|
|
457
464
|
|
|
458
465
|
const cssString =
|
|
459
466
|
doNotEditComment +
|
|
460
|
-
'/* This css file has all the necessary styles to run all your components */\n' +
|
|
461
|
-
'
|
|
462
|
-
|
|
467
|
+
'/* This css file has all the necessary styles to run all your Framer components */\n' +
|
|
468
|
+
'@import "unframer/styles/reset.css";\n' +
|
|
469
|
+
'@import "unframer/styles/framer.css";\n\n' +
|
|
463
470
|
getStyleTokensCss(tokens || []) +
|
|
464
471
|
breakpointsStyles(breakpoints) +
|
|
465
472
|
'\n\n' +
|
|
466
|
-
combinedCSSRules
|
|
467
|
-
.map((x) => (x?.startsWith(' ') ? dedent(x) : x))
|
|
468
|
-
.join('\n') +
|
|
469
473
|
getFontsStyles(allFonts)
|
|
470
474
|
await fs.promises.writeFile(
|
|
471
475
|
path.resolve(out, 'styles.css'),
|
|
@@ -1144,159 +1148,6 @@ function safeJsonParse(text) {
|
|
|
1144
1148
|
}
|
|
1145
1149
|
}
|
|
1146
1150
|
|
|
1147
|
-
/**
|
|
1148
|
-
* Generates TypeDoc comments that will be injected into JSX files
|
|
1149
|
-
* instead of generating separate .d.ts files
|
|
1150
|
-
*/
|
|
1151
|
-
export function propControlsToTypedocComments({
|
|
1152
|
-
config,
|
|
1153
|
-
fileName,
|
|
1154
|
-
controls,
|
|
1155
|
-
}: {
|
|
1156
|
-
controls: PropertyControls
|
|
1157
|
-
fileName: string
|
|
1158
|
-
config: Config
|
|
1159
|
-
}) {
|
|
1160
|
-
try {
|
|
1161
|
-
const types = Object.entries(controls || ({} as PropertyControls))
|
|
1162
|
-
.map(([key, value]) => {
|
|
1163
|
-
if (!value) {
|
|
1164
|
-
return
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
const typescriptType = (value: ControlDescription<any>) => {
|
|
1168
|
-
value.type
|
|
1169
|
-
switch (value.type) {
|
|
1170
|
-
case ControlType.Color:
|
|
1171
|
-
return 'string'
|
|
1172
|
-
case ControlType.Boolean:
|
|
1173
|
-
return 'boolean'
|
|
1174
|
-
case ControlType.Number:
|
|
1175
|
-
return 'number'
|
|
1176
|
-
case ControlType.String:
|
|
1177
|
-
return 'string'
|
|
1178
|
-
case ControlType.Enum: {
|
|
1179
|
-
// @ts-expect-error
|
|
1180
|
-
const options = value.optionTitles || value.options
|
|
1181
|
-
return options.map((x) => `'${x}'`).join(' | ')
|
|
1182
|
-
}
|
|
1183
|
-
case ControlType.File:
|
|
1184
|
-
return 'string'
|
|
1185
|
-
case ControlType.Image:
|
|
1186
|
-
return 'string'
|
|
1187
|
-
case ControlType.ComponentInstance:
|
|
1188
|
-
return 'React.ReactNode'
|
|
1189
|
-
case ControlType.Array:
|
|
1190
|
-
// @ts-expect-error
|
|
1191
|
-
return `${typescriptType(value.control)}[]`
|
|
1192
|
-
case ControlType.Object:
|
|
1193
|
-
// @ts-expect-error
|
|
1194
|
-
return `{${Object.entries(value.controls)
|
|
1195
|
-
.map(([k, v]) => {
|
|
1196
|
-
// @ts-expect-error
|
|
1197
|
-
return `${k}: ${typescriptType(v)}`
|
|
1198
|
-
})
|
|
1199
|
-
.join(', ')}`
|
|
1200
|
-
case ControlType.Date:
|
|
1201
|
-
return 'string | Date'
|
|
1202
|
-
case ControlType.Link:
|
|
1203
|
-
return 'string'
|
|
1204
|
-
case ControlType.ResponsiveImage:
|
|
1205
|
-
return `{src: string, srcSet?: string, alt?: string}`
|
|
1206
|
-
case ControlType.FusedNumber:
|
|
1207
|
-
return 'number'
|
|
1208
|
-
case ControlType.Transition:
|
|
1209
|
-
return 'any'
|
|
1210
|
-
case ControlType.EventHandler:
|
|
1211
|
-
return 'Function'
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
let name = propCamelCaseJustLikeFramer(value.title || key || '')
|
|
1215
|
-
if (!name) {
|
|
1216
|
-
return ''
|
|
1217
|
-
}
|
|
1218
|
-
return ` * ${name}?: ${typescriptType(value)} // ${value.title || name}`
|
|
1219
|
-
})
|
|
1220
|
-
.filter(Boolean)
|
|
1221
|
-
.join('\n')
|
|
1222
|
-
|
|
1223
|
-
const componentName = componentCamelCase(fileName)
|
|
1224
|
-
|
|
1225
|
-
const defaultPropsJsDoc = [
|
|
1226
|
-
' * children?: React.ReactNode',
|
|
1227
|
-
' * locale?: Locale',
|
|
1228
|
-
' * style?: React.CSSProperties',
|
|
1229
|
-
' * className?: string',
|
|
1230
|
-
' * id?: string',
|
|
1231
|
-
' * ref?: any',
|
|
1232
|
-
' * width?: any',
|
|
1233
|
-
' * height?: any',
|
|
1234
|
-
' * layoutId?: string',
|
|
1235
|
-
].join('\n')
|
|
1236
|
-
|
|
1237
|
-
// Generate header comment with type definitions
|
|
1238
|
-
let headerComment = '/**\n'
|
|
1239
|
-
headerComment += ' * @typedef Locale\n'
|
|
1240
|
-
|
|
1241
|
-
// Generate union type from config.locales if available
|
|
1242
|
-
const localeType = (() => {
|
|
1243
|
-
if (
|
|
1244
|
-
config?.locales &&
|
|
1245
|
-
Array.isArray(config.locales) &&
|
|
1246
|
-
config.locales.length > 0
|
|
1247
|
-
) {
|
|
1248
|
-
return config.locales
|
|
1249
|
-
.map((locale) => `'${locale.slug}'`)
|
|
1250
|
-
.join(' | ')
|
|
1251
|
-
}
|
|
1252
|
-
return 'string'
|
|
1253
|
-
})()
|
|
1254
|
-
|
|
1255
|
-
headerComment += ` * ${localeType}\n`
|
|
1256
|
-
headerComment += ' */\n\n'
|
|
1257
|
-
headerComment += '/**\n'
|
|
1258
|
-
headerComment += ' * @typedef {{\n'
|
|
1259
|
-
headerComment += defaultPropsJsDoc
|
|
1260
|
-
|
|
1261
|
-
if (types) {
|
|
1262
|
-
headerComment += '\n' + types
|
|
1263
|
-
}
|
|
1264
|
-
headerComment += `\n}} Props\n`
|
|
1265
|
-
headerComment += '\n */\n\n'
|
|
1266
|
-
headerComment += '/**\n'
|
|
1267
|
-
headerComment += ' * @type {import("unframer").UnframerBreakpoint}\n'
|
|
1268
|
-
headerComment += ' * Represents a responsive breakpoint for unframer.\n'
|
|
1269
|
-
headerComment += ' */\n\n'
|
|
1270
|
-
headerComment += '/**\n'
|
|
1271
|
-
headerComment += ' * @typedef VariantsMap\n'
|
|
1272
|
-
headerComment +=
|
|
1273
|
-
" * Partial record of UnframerBreakpoint to Props.variant, with a mandatory 'base' key.\n"
|
|
1274
|
-
headerComment +=
|
|
1275
|
-
" * { [key in UnframerBreakpoint]?: Props['variant'] } & { base: Props['variant'] }\n"
|
|
1276
|
-
headerComment += ' */'
|
|
1277
|
-
|
|
1278
|
-
// Generate responsive comment
|
|
1279
|
-
const responsiveComment = `/**\n * Renders ${componentName} for all breakpoints with a variants map. Variant prop is inferred per breakpoint.\n * @function\n * @param {Omit<Props, 'variant'> & {variants?: VariantsMap}} props\n * @returns {any}\n */`
|
|
1280
|
-
|
|
1281
|
-
// Generate default export comment - use inline function type instead of referencing undefined type
|
|
1282
|
-
const defaultExportComment = `/** @type {function(Props): any} */`
|
|
1283
|
-
|
|
1284
|
-
return {
|
|
1285
|
-
headerComment,
|
|
1286
|
-
responsiveComment,
|
|
1287
|
-
defaultExportComment,
|
|
1288
|
-
}
|
|
1289
|
-
} catch (e: any) {
|
|
1290
|
-
logger.error(e.message)
|
|
1291
|
-
logger.error('cannot generate typedoc comments', e.stack)
|
|
1292
|
-
return {
|
|
1293
|
-
headerComment: '',
|
|
1294
|
-
responsiveComment: '',
|
|
1295
|
-
defaultExportComment: '',
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
1151
|
export function parsePropertyControls(code: string) {
|
|
1301
1152
|
const start = code.indexOf('addPropertyControls(')
|
|
1302
1153
|
if (start === -1) {
|
|
@@ -1411,20 +1262,6 @@ function splitOnce(str: string, separator: string) {
|
|
|
1411
1262
|
return [str.slice(0, index), str.slice(index + 1)]
|
|
1412
1263
|
}
|
|
1413
1264
|
|
|
1414
|
-
export function componentCamelCase(str: string) {
|
|
1415
|
-
str = str?.replace(/\.jsx?$/, '')
|
|
1416
|
-
if (!str) {
|
|
1417
|
-
return 'FramerComponent'
|
|
1418
|
-
}
|
|
1419
|
-
// Take last part after slashes
|
|
1420
|
-
str = str.split('/').filter(Boolean).pop() || ''
|
|
1421
|
-
str = str.replace(/-([\w])/g, (g) => g[1].toUpperCase())
|
|
1422
|
-
str = str.replace(/_([a-z])/g, (g) => g[1].toUpperCase())
|
|
1423
|
-
str = str[0].toUpperCase() + str.slice(1)
|
|
1424
|
-
str = str + 'FramerComponent'
|
|
1425
|
-
return str
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
1265
|
const breakpointVariants = ['mobile', 'tablet', 'desktop']
|
|
1429
1266
|
|
|
1430
1267
|
function getVariantsFromPropControls(propControls?: PropertyControls) {
|
|
@@ -1464,33 +1301,6 @@ function findExampleProperty(propertyControls?: PropertyControls) {
|
|
|
1464
1301
|
return propCamelCaseJustLikeFramer(stringProp[1]?.title || '')
|
|
1465
1302
|
}
|
|
1466
1303
|
|
|
1467
|
-
// these styles are global styles injected by Framer in the generated websites, without them things like icons can look weird
|
|
1468
|
-
const resetCssStyles = `
|
|
1469
|
-
|
|
1470
|
-
:root {
|
|
1471
|
-
-webkit-font-smoothing: antialiased;
|
|
1472
|
-
-moz-osx-font-smoothing: grayscale;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
* {
|
|
1476
|
-
box-sizing: border-box;
|
|
1477
|
-
-webkit-font-smoothing: inherit;
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
.unframer h1, .unframer h2, .unframer h3, .unframer h4, .unframer h5, .unframer h6, .unframer p, .unframer figure {
|
|
1481
|
-
margin: 0;
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
.unframer {
|
|
1485
|
-
line-height: normal;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
.unframer, .unframer input, .unframer textarea, .unframer select, .unframer button {
|
|
1489
|
-
font-size: 12px;
|
|
1490
|
-
font-family: sans-serif;
|
|
1491
|
-
}
|
|
1492
|
-
`
|
|
1493
|
-
|
|
1494
1304
|
async function recursiveReaddir(dir: string): Promise<string[]> {
|
|
1495
1305
|
const dirents = await fs.promises.readdir(dir, { withFileTypes: true })
|
|
1496
1306
|
const files = await Promise.all(
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-A2PMVMFI.js";
|
|
2
|
+
|
|
3
|
+
// /:https://app.framerstatic.com/fontshare-4J2ZFRBB.mjs
|
|
4
|
+
var fontshare_default = { "FS;Spline Sans": true, "FS;Satoshi": true, "FS;Epilogue": true, "FS;JetBrains Mono": true, "FS;Nippo": true, "FS;Boxing": true, "FS;Cabinet Grotesk": true, "FS;Bespoke Serif": true, "FS;Panchang": true, "FS;Sora": true, "FS;Familjen Grotesk": true, "FS;Sharpie": true, "FS;Chillax": true, "FS;Array": true, "FS;Boska": true, "FS;Clash Grotesk": true, "FS;Plus Jakarta Sans": true, "FS;Pally": true, "FS;Space Grotesk": true, "FS;Khand": true, "FS;Comico": true, "FS;Sentient": true, "FS;Plein": true, "FS;Rowan": true, "FS;Kalam": true, "FS;Stardom": true, "FS;Clash Display": true, "FS;Britney": true, "FS;Fira Sans": true, "FS;Quilon": true, "FS;Literata": true, "FS;Archivo": true, "FS;Manrope": true, "FS;Rosaline": true, "FS;Dancing Script": true, "FS;Syne": true, "FS;Outfit": true, "FS;Hind": true, "FS;Gambarino": true, "FS;Pilcrow Rounded": true, "FS;Bevellier": true, "FS;Telma": true, "FS;Supreme": true, "FS;Bespoke Slab": true, "FS;Aktura": true, "FS;Montserrat": true, "FS;Erode": true, "FS;Be Vietnam Pro": true, "FS;Melodrama": true, "FS;Pramukh Rounded": true, "FS;Bespoke Sans": true, "FS;Teko": true, "FS;Striper": true, "FS;General Sans": true, "FS;Lobster": true, "FS;Karma": true, "FS;Tabular": true, "FS;Karla": true, "FS;Tanker": true, "FS;Paquito": true, "FS;Kohinoor Zerone": true, "FS;Bespoke Stencil": true, "FS;Bebas Neue": true, "FS;Gambetta": true, "FS;Asap": true, "FS;Lora": true, "FS;Zina": true, "FS;Pencerio": true, "FS;Bonny": true, "FS;Author": true, "FS;Kola": true, "FS;Rajdhani": true, "FS;Switzer": true, "FS;Roundo": true, "FS;Red Hat Display": true, "FS;Zodiak": true, "FS;Styro": true, "FS;RX100": true, "FS;Quicksand": true, "FS;Urbanist": true, "FS;Oswald": true, "FS;Azeret Mono": true, "FS;Crimson Pro": true, "FS;Work Sans": true, "FS;Expose": true, "FS;Ranade": true, "FS;Merriweather Sans": true, "FS;Excon": true, "FS;Nunito": true, "FS;Synonym": true, "FS;Anton": true, "FS;Ballet": true, "FS;Trench Slab": true, "FS;New Title": true, "FS;Alpino": true, "FS;Halant": true, "FS;Recia": true, "FS;Kihim": true, "FS;Amulya": true, "FS;Raleway": true, "FS;Poppins": true, "FS;Stick No Bills": true, "FS;Technor": true, "FS;Chubbo": true, "FS;Segment": true, "FS;Public Sans": true, "FS;Neco": true, "FS;Rozha One": true, "FS;Tillana": true, "FS;Laila": true, "FS;Hoover": true };
|
|
5
|
+
export {
|
|
6
|
+
fontshare_default as default
|
|
7
|
+
};
|