@reframejs/unframer 4.2.0-reframe.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 +389 -0
- package/bin.js +5 -0
- package/dist/babel-jsx.d.ts +24 -0
- package/dist/babel-jsx.js +299 -0
- package/dist/babel-plugin-imports.d.ts +15 -0
- package/dist/babel-plugin-imports.js +211 -0
- package/dist/babel-typedoc.d.ts +39 -0
- package/dist/babel-typedoc.js +76 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +3 -0
- package/dist/cli.d.ts +59 -0
- package/dist/cli.js +821 -0
- package/dist/compat.d.ts +2 -0
- package/dist/compat.js +23 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.js +27 -0
- package/dist/css-core.d.ts +50 -0
- package/dist/css-core.js +231 -0
- package/dist/css.d.ts +15 -0
- package/dist/css.js +36 -0
- package/dist/esbuild.d.ts +31 -0
- package/dist/esbuild.js +317 -0
- package/dist/exporter.d.ts +96 -0
- package/dist/exporter.js +1151 -0
- package/dist/flat-cache-interceptor.d.ts +24 -0
- package/dist/flat-cache-interceptor.js +87 -0
- package/dist/framer-chunks/chunk-IKQSD2QC.js +10 -0
- package/dist/framer-chunks/fontshare-PZLWRK4B-MHMZIGTX.js +7 -0
- package/dist/framer-chunks/fontshare-SXU5BGFE-OWTMMPGS.js +7 -0
- package/dist/framer-chunks/fontshare-TIA7QUPT-PUDLUTQ7.js +7 -0
- package/dist/framer-chunks/framer-font-RD2SUPQH-Q4MS7WS6.js +7 -0
- package/dist/framer-chunks/google-EGNT223R-P4DUHBW2.js +7 -0
- package/dist/framer-chunks/google-H6SFY4F5-5JSJCGDR.js +7 -0
- package/dist/framer-chunks/google-YSYBFRE6-L7YAHH7V.js +7 -0
- package/dist/framer-client.server.d.ts +4 -0
- package/dist/framer-client.server.js +45 -0
- package/dist/framer-package-versions.d.ts +781 -0
- package/dist/framer-package-versions.js +782 -0
- package/dist/framer-types.d.ts +30 -0
- package/dist/framer-types.js +35 -0
- package/dist/framer.d.ts +4990 -0
- package/dist/framer.js +64296 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13 -0
- package/dist/package-manager.d.ts +10 -0
- package/dist/package-manager.js +138 -0
- package/dist/plugin-mcp-dist/lib/client-websocket.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/client-websocket.js +103 -0
- package/dist/plugin-mcp-dist/lib/cms.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/cms.js +58 -0
- package/dist/plugin-mcp-dist/lib/errors.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/errors.js +48 -0
- package/dist/plugin-mcp-dist/lib/framer-client.d.ts +2 -0
- package/dist/plugin-mcp-dist/lib/framer-client.js +4 -0
- package/dist/plugin-mcp-dist/lib/framer-client.server.d.ts +3 -0
- package/dist/plugin-mcp-dist/lib/framer-client.server.js +46 -0
- package/dist/plugin-mcp-dist/lib/framer.d.ts +30 -0
- package/dist/plugin-mcp-dist/lib/framer.js +1084 -0
- package/dist/plugin-mcp-dist/lib/hooks.d.ts +6 -0
- package/dist/plugin-mcp-dist/lib/hooks.js +46 -0
- package/dist/plugin-mcp-dist/lib/mcp-client.d.ts +142 -0
- package/dist/plugin-mcp-dist/lib/mcp-client.js +40 -0
- package/dist/plugin-mcp-dist/lib/mcp-handlers.d.ts +385 -0
- package/dist/plugin-mcp-dist/lib/mcp-handlers.js +1924 -0
- package/dist/plugin-mcp-dist/lib/mcp-tools.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/mcp-tools.js +5 -0
- package/dist/plugin-mcp-dist/lib/mcp-websocket.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/mcp-websocket.js +88 -0
- package/dist/plugin-mcp-dist/lib/plugin-websocket.d.ts +5 -0
- package/dist/plugin-mcp-dist/lib/plugin-websocket.js +170 -0
- package/dist/plugin-mcp-dist/lib/react-export.d.ts +51 -0
- package/dist/plugin-mcp-dist/lib/react-export.js +358 -0
- package/dist/plugin-mcp-dist/lib/schema.d.ts +276 -0
- package/dist/plugin-mcp-dist/lib/schema.js +907 -0
- package/dist/plugin-mcp-dist/lib/store.d.ts +2 -0
- package/dist/plugin-mcp-dist/lib/store.js +10 -0
- package/dist/plugin-mcp-dist/lib/tree-utils.d.ts +6 -0
- package/dist/plugin-mcp-dist/lib/tree-utils.js +141 -0
- package/dist/plugin-mcp-dist/lib/tunnel.d.ts +46 -0
- package/dist/plugin-mcp-dist/lib/tunnel.js +117 -0
- package/dist/plugin-mcp-dist/lib/types.d.ts +110 -0
- package/dist/plugin-mcp-dist/lib/types.js +188 -0
- package/dist/plugin-mcp-dist/lib/upstream-socket.d.ts +13 -0
- package/dist/plugin-mcp-dist/lib/upstream-socket.js +56 -0
- package/dist/plugin-mcp-dist/lib/utils.d.ts +13 -0
- package/dist/plugin-mcp-dist/lib/utils.js +57 -0
- package/dist/plugin-mcp-dist/lib/websocket-server.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/websocket-server.js +88 -0
- package/dist/plugin-mcp-dist/lib/xml.d.ts +10 -0
- package/dist/plugin-mcp-dist/lib/xml.js +395 -0
- package/dist/react.d.ts +76 -0
- package/dist/react.js +280 -0
- package/dist/renamer.d.ts +11 -0
- package/dist/renamer.js +139 -0
- package/dist/sentry.d.ts +2 -0
- package/dist/sentry.js +5 -0
- package/dist/stackblitz.d.ts +9 -0
- package/dist/stackblitz.js +179 -0
- package/dist/styles/framer.css +920 -0
- package/dist/styles/reset.css +37 -0
- package/dist/typescript.d.ts +24 -0
- package/dist/typescript.js +197 -0
- package/dist/undici-dispatcher.d.ts +2 -0
- package/dist/undici-dispatcher.js +10 -0
- package/dist/unframer-loader.d.ts +2 -0
- package/dist/unframer-loader.js +12 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +81 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/package.json +131 -0
package/dist/compat.d.ts
ADDED
package/dist/compat.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function propCamelCaseJustLikeFramer(str) {
|
|
2
|
+
if (!str) {
|
|
3
|
+
return '';
|
|
4
|
+
}
|
|
5
|
+
// Handle consecutive uppercase letters followed by lowercase, this is a bug in Framer, makes it match Framer
|
|
6
|
+
str = str.replace(/([A-Z]{2,})([a-z])/g, (_, upper, lower) => {
|
|
7
|
+
return upper + lower.toUpperCase();
|
|
8
|
+
});
|
|
9
|
+
// Remove spaces (e.g. "Foo Bar" -> "fooBar")
|
|
10
|
+
str = str.replace(/\s+(.)/g, (_, c) => c.toUpperCase());
|
|
11
|
+
// Convert dashes to camelCase (e.g. foo-bar -> fooBar)
|
|
12
|
+
str = str.replace(/-([\w])/g, (g) => g[1].toUpperCase());
|
|
13
|
+
// Convert underscores to camelCase (e.g. foo_bar -> fooBar)
|
|
14
|
+
str = str.replace(/_([a-z])/g, (g) => g[1].toUpperCase());
|
|
15
|
+
// Ensure first character is lowercase
|
|
16
|
+
str = str[0].toLowerCase() + str.slice(1);
|
|
17
|
+
// Add underscore prefix if starts with number
|
|
18
|
+
if (/^\d/.test(str)) {
|
|
19
|
+
str = '_' + str;
|
|
20
|
+
}
|
|
21
|
+
return str;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=compat.js.map
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CachedMcpTools } from '@goke/mcp';
|
|
2
|
+
export type McpMode = 'plugin' | 'server-api';
|
|
3
|
+
export interface UnframerConfig {
|
|
4
|
+
/** MCP mode: 'plugin' uses WebSocket tunnel, 'server-api' uses framer-api directly */
|
|
5
|
+
mode?: McpMode;
|
|
6
|
+
/** MCP URL for plugin mode (from Framer MCP plugin) */
|
|
7
|
+
mcpUrl?: string;
|
|
8
|
+
/** Framer API key for server-api mode */
|
|
9
|
+
framerApiKey?: string;
|
|
10
|
+
/** Default Framer project URL for server-api mode */
|
|
11
|
+
framerProjectUrl?: string;
|
|
12
|
+
/** Cached MCP tools schema */
|
|
13
|
+
cachedMcpTools?: CachedMcpTools;
|
|
14
|
+
}
|
|
15
|
+
export declare function loadConfig(): UnframerConfig;
|
|
16
|
+
export declare function saveConfig(config: UnframerConfig): void;
|
|
17
|
+
export declare function getConfigPath(): string;
|
|
18
|
+
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// CLI config persistence for MCP auth mode, credentials, and cached tool metadata.
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
const CONFIG_DIR = path.join(os.homedir(), '.unframer');
|
|
6
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
7
|
+
export function loadConfig() {
|
|
8
|
+
if (!fs.existsSync(CONFIG_FILE)) {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function saveConfig(config) {
|
|
19
|
+
if (!fs.existsSync(CONFIG_DIR)) {
|
|
20
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
23
|
+
}
|
|
24
|
+
export function getConfigPath() {
|
|
25
|
+
return CONFIG_FILE;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface ComponentFont {
|
|
2
|
+
cssFamilyName?: string;
|
|
3
|
+
family?: string;
|
|
4
|
+
url: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
weight?: string | number;
|
|
7
|
+
unicodeRange?: string;
|
|
8
|
+
}
|
|
9
|
+
export type ComponentFontBundle = {
|
|
10
|
+
/**
|
|
11
|
+
* This flag specifies whether the font bundle includes the specific font
|
|
12
|
+
* weights of Framer’s Inter font that the component uses. New smart
|
|
13
|
+
* components do that (which means we can emit CSS only for Inter fonts that
|
|
14
|
+
* are actually used); older smart components don’t (which means some places
|
|
15
|
+
* will emit CSS for all Inter fonts if this flag is not set).
|
|
16
|
+
* https://www.notion.so/framer/RFC-ComponentFont-v2-d5fd3e822fb049ffb6971554ab0e4e42
|
|
17
|
+
*/
|
|
18
|
+
explicitInter: boolean;
|
|
19
|
+
fileName?: string;
|
|
20
|
+
fonts: ComponentFont[];
|
|
21
|
+
};
|
|
22
|
+
export declare function logFontsUsage(fontsBundles: ComponentFontBundle[]): string;
|
|
23
|
+
export declare function getFontsStyles(_fontsDefs: ComponentFontBundle[]): string;
|
|
24
|
+
export declare const defaultBreakpointSizes: {
|
|
25
|
+
readonly base: 0;
|
|
26
|
+
readonly sm: 320;
|
|
27
|
+
readonly md: 768;
|
|
28
|
+
readonly lg: 960;
|
|
29
|
+
readonly xl: 1200;
|
|
30
|
+
readonly '2xl': 1536;
|
|
31
|
+
};
|
|
32
|
+
export type BreakpointSizes = typeof defaultBreakpointSizes;
|
|
33
|
+
export declare const breakpointsStylesLegacy: (breakpointSizes?: {
|
|
34
|
+
readonly base: 0;
|
|
35
|
+
readonly sm: 320;
|
|
36
|
+
readonly md: 768;
|
|
37
|
+
readonly lg: 960;
|
|
38
|
+
readonly xl: 1200;
|
|
39
|
+
readonly '2xl': 1536;
|
|
40
|
+
} | undefined) => string;
|
|
41
|
+
export declare const breakpointsStyles: (breakpointSizes?: {
|
|
42
|
+
readonly base: 0;
|
|
43
|
+
readonly sm: 320;
|
|
44
|
+
readonly md: 768;
|
|
45
|
+
readonly lg: 960;
|
|
46
|
+
readonly xl: 1200;
|
|
47
|
+
readonly '2xl': 1536;
|
|
48
|
+
} | undefined) => string;
|
|
49
|
+
export declare function groupBy<T>(arr: T[], key: (x: T) => string): Map<string, T[]>;
|
|
50
|
+
//# sourceMappingURL=css-core.d.ts.map
|
package/dist/css-core.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure CSS generation helpers for exported Framer components.
|
|
3
|
+
* This file must not import React or framer.js so server-only tools can use it
|
|
4
|
+
* without loading the generated Framer runtime in React Server Components.
|
|
5
|
+
*/
|
|
6
|
+
import dedent from 'string-dedent';
|
|
7
|
+
function getFontFamilyName(font) {
|
|
8
|
+
return font.cssFamilyName || font.family;
|
|
9
|
+
}
|
|
10
|
+
function deduplicateByKey(arr, key) {
|
|
11
|
+
const map = new Map();
|
|
12
|
+
for (const item of arr) {
|
|
13
|
+
const value = key(item);
|
|
14
|
+
if (map.has(value)) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
map.set(value, item);
|
|
18
|
+
}
|
|
19
|
+
return Array.from(map.values());
|
|
20
|
+
}
|
|
21
|
+
export function logFontsUsage(fontsBundles) {
|
|
22
|
+
if (!fontsBundles.length) {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
const familyToFilenames = new Map();
|
|
26
|
+
for (const fontDefBundle of fontsBundles) {
|
|
27
|
+
const filename = fontDefBundle.fileName;
|
|
28
|
+
for (const font of fontDefBundle.fonts) {
|
|
29
|
+
const familyName = getFontFamilyName(font);
|
|
30
|
+
if (!familyName)
|
|
31
|
+
continue;
|
|
32
|
+
if (familyToFilenames.has(familyName)) {
|
|
33
|
+
familyToFilenames.get(familyName).add(filename);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
familyToFilenames.set(familyName, new Set([filename]));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let str = `There are ${familyToFilenames.size} fonts used:\n`;
|
|
41
|
+
for (const [family, filenames] of familyToFilenames.entries()) {
|
|
42
|
+
str += `${JSON.stringify(family)}, used by\n`;
|
|
43
|
+
for (const filename of filenames) {
|
|
44
|
+
str += ` - ${filename}\n`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return str;
|
|
48
|
+
}
|
|
49
|
+
export function getFontsStyles(_fontsDefs) {
|
|
50
|
+
if (!_fontsDefs.length) {
|
|
51
|
+
return '';
|
|
52
|
+
}
|
|
53
|
+
const urlToFilenames = new Map();
|
|
54
|
+
for (const fontDefBundle of _fontsDefs) {
|
|
55
|
+
const filename = fontDefBundle.fileName;
|
|
56
|
+
for (const font of fontDefBundle.fonts) {
|
|
57
|
+
if (urlToFilenames.has(font.url)) {
|
|
58
|
+
urlToFilenames.get(font.url).add(filename);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
urlToFilenames.set(font.url, new Set([filename]));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const allFonts = deduplicateByKey(_fontsDefs.flatMap((x) => x.fonts), (x) => x?.url)
|
|
66
|
+
.filter((x) => {
|
|
67
|
+
if (!x.url)
|
|
68
|
+
return false;
|
|
69
|
+
const familyName = getFontFamilyName(x);
|
|
70
|
+
if (!familyName) {
|
|
71
|
+
console.log('Font missing family field:', JSON.stringify(x, null, 2));
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
})
|
|
76
|
+
.sort((a, b) => a.url.localeCompare(b.url));
|
|
77
|
+
const grouped = groupBy(allFonts, (x) => {
|
|
78
|
+
return [...(urlToFilenames.get(x.url) || [])].sort().join(', ');
|
|
79
|
+
});
|
|
80
|
+
let str = '\n\n';
|
|
81
|
+
for (let [groupComment, fonts] of grouped.entries()) {
|
|
82
|
+
fonts = sortByKey(fonts, (x) => x.url);
|
|
83
|
+
str += `/* used by ${groupComment} */\n`;
|
|
84
|
+
str +=
|
|
85
|
+
'\n' +
|
|
86
|
+
fonts
|
|
87
|
+
.map((x) => {
|
|
88
|
+
let str = '';
|
|
89
|
+
const familyName = getFontFamilyName(x);
|
|
90
|
+
str += dedent `
|
|
91
|
+
@font-face {
|
|
92
|
+
font-family: "${familyName}";
|
|
93
|
+
src: url('${x.url}');\n
|
|
94
|
+
`;
|
|
95
|
+
if (x.style) {
|
|
96
|
+
str += ` font-style: ${x.style};\n`;
|
|
97
|
+
}
|
|
98
|
+
if (x.weight) {
|
|
99
|
+
str += ` font-weight: ${x.weight};\n`;
|
|
100
|
+
}
|
|
101
|
+
if (x.unicodeRange) {
|
|
102
|
+
str += ` unicode-range: ${x.unicodeRange};\n`;
|
|
103
|
+
}
|
|
104
|
+
str += `}\n`;
|
|
105
|
+
return str;
|
|
106
|
+
})
|
|
107
|
+
.join('\n') +
|
|
108
|
+
'\n';
|
|
109
|
+
}
|
|
110
|
+
return str;
|
|
111
|
+
}
|
|
112
|
+
export const defaultBreakpointSizes = {
|
|
113
|
+
base: 0,
|
|
114
|
+
sm: 320,
|
|
115
|
+
md: 768,
|
|
116
|
+
lg: 960,
|
|
117
|
+
xl: 1200,
|
|
118
|
+
'2xl': 1536,
|
|
119
|
+
};
|
|
120
|
+
export const breakpointsStylesLegacy = (breakpointSizes) => {
|
|
121
|
+
breakpointSizes = { ...defaultBreakpointSizes, ...breakpointSizes };
|
|
122
|
+
return /* css */ `
|
|
123
|
+
/* Base */
|
|
124
|
+
@media (min-width: ${breakpointSizes.base}px) and (max-width: ${breakpointSizes.sm - 1}px) {
|
|
125
|
+
.unframer-hidden.unframer-base {
|
|
126
|
+
display: contents;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Small */
|
|
131
|
+
@media (min-width: ${breakpointSizes.sm}px) and (max-width: ${breakpointSizes.md - 1}px) {
|
|
132
|
+
.unframer-hidden.unframer-sm {
|
|
133
|
+
display: contents;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Medium */
|
|
138
|
+
@media (min-width: ${breakpointSizes.md}px) and (max-width: ${breakpointSizes.lg - 1}px) {
|
|
139
|
+
.unframer-hidden.unframer-md {
|
|
140
|
+
display: contents;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Large */
|
|
145
|
+
@media (min-width: ${breakpointSizes.lg}px) and (max-width: ${breakpointSizes.xl - 1}px) {
|
|
146
|
+
.unframer-hidden.unframer-lg {
|
|
147
|
+
display: contents;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Extra Large */
|
|
152
|
+
@media (min-width: ${breakpointSizes.xl}px) and (max-width: ${breakpointSizes['2xl'] - 1}px) {
|
|
153
|
+
.unframer-hidden.unframer-xl {
|
|
154
|
+
display: contents;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* 2 Extra Large */
|
|
159
|
+
@media (min-width: ${breakpointSizes['2xl']}px) {
|
|
160
|
+
.unframer-hidden.unframer-2xl {
|
|
161
|
+
display: contents;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.unframer-hidden {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
};
|
|
170
|
+
export const breakpointsStyles = (breakpointSizes) => {
|
|
171
|
+
breakpointSizes = { ...defaultBreakpointSizes, ...breakpointSizes };
|
|
172
|
+
return /* css */ `
|
|
173
|
+
|
|
174
|
+
/* Base */
|
|
175
|
+
@media (min-width: ${breakpointSizes.base}px) and (max-width: ${breakpointSizes.sm - 1}px) {
|
|
176
|
+
.unframer-hidden:not(.unframer-base) {
|
|
177
|
+
display: none !important;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Small */
|
|
182
|
+
@media (min-width: ${breakpointSizes.sm}px) and (max-width: ${breakpointSizes.md - 1}px) {
|
|
183
|
+
.unframer-hidden:not(.unframer-sm) {
|
|
184
|
+
display: none !important;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Medium */
|
|
189
|
+
@media (min-width: ${breakpointSizes.md}px) and (max-width: ${breakpointSizes.lg - 1}px) {
|
|
190
|
+
.unframer-hidden:not(.unframer-md) {
|
|
191
|
+
display: none !important;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Large */
|
|
196
|
+
@media (min-width: ${breakpointSizes.lg}px) and (max-width: ${breakpointSizes.xl - 1}px) {
|
|
197
|
+
.unframer-hidden:not(.unframer-lg) {
|
|
198
|
+
display: none !important;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Extra Large */
|
|
203
|
+
@media (min-width: ${breakpointSizes.xl}px) and (max-width: ${breakpointSizes['2xl'] - 1}px) {
|
|
204
|
+
.unframer-hidden:not(.unframer-xl) {
|
|
205
|
+
display: none !important;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* 2 Extra Large */
|
|
210
|
+
@media (min-width: ${breakpointSizes['2xl']}px) {
|
|
211
|
+
.unframer-hidden:not(.unframer-2xl) {
|
|
212
|
+
display: none !important;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
`;
|
|
216
|
+
};
|
|
217
|
+
export function groupBy(arr, key) {
|
|
218
|
+
const map = new Map();
|
|
219
|
+
for (const item of arr) {
|
|
220
|
+
const k = key(item);
|
|
221
|
+
if (!map.has(k)) {
|
|
222
|
+
map.set(k, []);
|
|
223
|
+
}
|
|
224
|
+
map.get(k)?.push(item);
|
|
225
|
+
}
|
|
226
|
+
return map;
|
|
227
|
+
}
|
|
228
|
+
function sortByKey(arr, key) {
|
|
229
|
+
return arr.slice().sort((a, b) => key(a).localeCompare(key(b)));
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=css-core.js.map
|
package/dist/css.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export * from './css-core.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom withCSS function that restores the previous behavior
|
|
5
|
+
* of rendering inline style tags instead of using cssCollector.
|
|
6
|
+
*
|
|
7
|
+
* On the client we return withCSSOriginal so the component tree structure
|
|
8
|
+
* matches what framer.js internal components produce (just <Component/>,
|
|
9
|
+
* no Fragment wrapper). On the server we render <style> + <Component>
|
|
10
|
+
* inside a Fragment to inject CSS into the SSR HTML. The tree differs
|
|
11
|
+
* between server and client but suppressHydrationWarning on the Component
|
|
12
|
+
* handles the mismatch.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withCSS(Component: any, escapedCSS: any, componentSerializationId?: string): React.ForwardRefExoticComponent<object & React.RefAttributes<unknown>> | ((props: any) => React.JSX.Element);
|
|
15
|
+
//# sourceMappingURL=css.d.ts.map
|
package/dist/css.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { withCSS as withCSSOriginal } from './framer.js';
|
|
3
|
+
export * from './css-core.js';
|
|
4
|
+
/**
|
|
5
|
+
* Custom withCSS function that restores the previous behavior
|
|
6
|
+
* of rendering inline style tags instead of using cssCollector.
|
|
7
|
+
*
|
|
8
|
+
* On the client we return withCSSOriginal so the component tree structure
|
|
9
|
+
* matches what framer.js internal components produce (just <Component/>,
|
|
10
|
+
* no Fragment wrapper). On the server we render <style> + <Component>
|
|
11
|
+
* inside a Fragment to inject CSS into the SSR HTML. The tree differs
|
|
12
|
+
* between server and client but suppressHydrationWarning on the Component
|
|
13
|
+
* handles the mismatch.
|
|
14
|
+
*/
|
|
15
|
+
export function withCSS(Component, escapedCSS, componentSerializationId) {
|
|
16
|
+
const framerCSSMarker = 'data-framer-css-ssr';
|
|
17
|
+
if (typeof window !== 'undefined' && typeof window.document !== 'undefined')
|
|
18
|
+
return withCSSOriginal(Component, escapedCSS, componentSerializationId || '');
|
|
19
|
+
return (props) => {
|
|
20
|
+
const isBrowser = typeof window !== 'undefined' &&
|
|
21
|
+
typeof window.document !== 'undefined';
|
|
22
|
+
if (!isBrowser) {
|
|
23
|
+
const id = componentSerializationId;
|
|
24
|
+
const cssContent = typeof escapedCSS === 'function'
|
|
25
|
+
? escapedCSS('EXPORT')
|
|
26
|
+
: Array.isArray(escapedCSS)
|
|
27
|
+
? escapedCSS.join('\n')
|
|
28
|
+
: escapedCSS;
|
|
29
|
+
return (_jsxs(_Fragment, { children: [
|
|
30
|
+
_jsx("style", { [framerCSSMarker]: true, "data-framer-component": id, dangerouslySetInnerHTML: { __html: cssContent } }), _jsx(Component, { ...props })
|
|
31
|
+
] }));
|
|
32
|
+
}
|
|
33
|
+
return _jsx(Component, { ...props });
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=css.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { fetch } from 'undici';
|
|
2
|
+
import { Plugin } from 'esbuild';
|
|
3
|
+
export declare const defaultExternalPackages: string[];
|
|
4
|
+
export declare const replaceWebPageIds: ({ elements, code, }: {
|
|
5
|
+
elements: {
|
|
6
|
+
webPageId: string;
|
|
7
|
+
path: string;
|
|
8
|
+
}[];
|
|
9
|
+
code: string;
|
|
10
|
+
}) => string;
|
|
11
|
+
export declare function esbuildPluginBundleDependencies({ signal, externalPackages, externalizeNpm, outDir, onCollectMissingPackage, onFetch }: {
|
|
12
|
+
externalPackages?: string[] | undefined;
|
|
13
|
+
externalizeNpm?: boolean | undefined;
|
|
14
|
+
onCollectMissingPackage?: ((pkg: string) => void) | undefined;
|
|
15
|
+
onFetch?: ((info: {
|
|
16
|
+
url: string;
|
|
17
|
+
resolvedUrl: string;
|
|
18
|
+
}) => void) | undefined;
|
|
19
|
+
outDir: any;
|
|
20
|
+
signal?: AbortSignal | undefined;
|
|
21
|
+
}): Plugin;
|
|
22
|
+
export declare function resolveRedirect({ redirectCache, signal, url }: {
|
|
23
|
+
url?: string;
|
|
24
|
+
redirectCache?: any;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}): Promise<any>;
|
|
27
|
+
export declare function recursiveResolveRedirect(url?: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
28
|
+
export declare const fetchWithRetry: typeof fetch;
|
|
29
|
+
export declare function retryTwice<F extends Function>(fn: Function): Function;
|
|
30
|
+
export declare function getPackageName(importPath: string): string;
|
|
31
|
+
//# sourceMappingURL=esbuild.d.ts.map
|