@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
import type * as CacheInterceptor from 'undici/types/cache-interceptor.d.ts';
|
|
3
|
+
type CacheKey = CacheInterceptor.default.CacheKey;
|
|
4
|
+
type CacheValue = CacheInterceptor.default.CacheValue;
|
|
5
|
+
type GetResult = CacheInterceptor.default.GetResult;
|
|
6
|
+
type CacheStore = CacheInterceptor.default.CacheStore;
|
|
7
|
+
/**
|
|
8
|
+
* A CacheStore that persists each entry as separate files in os.tmpdir()/.unframer.
|
|
9
|
+
* Each cache entry creates a .json file for metadata and a .bin file for the body.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FlatCacheStore implements CacheStore {
|
|
12
|
+
private readonly cacheDir;
|
|
13
|
+
constructor({ cacheDir }: {
|
|
14
|
+
cacheDir: string;
|
|
15
|
+
});
|
|
16
|
+
private ensureCacheDir;
|
|
17
|
+
private getFileHash;
|
|
18
|
+
private getFilePaths;
|
|
19
|
+
get(key: CacheKey): Promise<GetResult | undefined>;
|
|
20
|
+
createWriteStream(key: CacheKey, meta: CacheValue): Writable;
|
|
21
|
+
delete(key: CacheKey): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=flat-cache-interceptor.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// FlatCacheStore.ts
|
|
2
|
+
import { Writable } from 'node:stream';
|
|
3
|
+
import { promises as fs } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { createHash } from 'node:crypto';
|
|
7
|
+
import { logger } from './utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* A CacheStore that persists each entry as separate files in os.tmpdir()/.unframer.
|
|
10
|
+
* Each cache entry creates a .json file for metadata and a .bin file for the body.
|
|
11
|
+
*/
|
|
12
|
+
export class FlatCacheStore {
|
|
13
|
+
cacheDir;
|
|
14
|
+
constructor({ cacheDir }) {
|
|
15
|
+
this.cacheDir = join(tmpdir(), cacheDir);
|
|
16
|
+
logger.log(`using cache dir`, this.cacheDir);
|
|
17
|
+
this.ensureCacheDir();
|
|
18
|
+
}
|
|
19
|
+
async ensureCacheDir() {
|
|
20
|
+
try {
|
|
21
|
+
await fs.mkdir(this.cacheDir, { recursive: true });
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// Directory might already exist, ignore error
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
getFileHash(key) {
|
|
28
|
+
return createHash('sha256').update(JSON.stringify(key)).digest('hex');
|
|
29
|
+
}
|
|
30
|
+
getFilePaths(key) {
|
|
31
|
+
const hash = this.getFileHash(key);
|
|
32
|
+
return {
|
|
33
|
+
metaPath: join(this.cacheDir, `${hash}.json`),
|
|
34
|
+
bodyPath: join(this.cacheDir, `${hash}.bin`),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async get(key) {
|
|
38
|
+
try {
|
|
39
|
+
const { metaPath, bodyPath } = this.getFilePaths(key);
|
|
40
|
+
const [metaData, bodyData] = await Promise.all([
|
|
41
|
+
fs.readFile(metaPath, 'utf-8'),
|
|
42
|
+
fs.readFile(bodyPath),
|
|
43
|
+
]);
|
|
44
|
+
const meta = JSON.parse(metaData);
|
|
45
|
+
return { ...meta, body: bodyData };
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
createWriteStream(key, meta) {
|
|
52
|
+
const chunks = [];
|
|
53
|
+
return new Writable({
|
|
54
|
+
write(chunk, _enc, cb) {
|
|
55
|
+
chunks.push(chunk);
|
|
56
|
+
cb();
|
|
57
|
+
},
|
|
58
|
+
final: async (cb) => {
|
|
59
|
+
try {
|
|
60
|
+
await this.ensureCacheDir();
|
|
61
|
+
const { metaPath, bodyPath } = this.getFilePaths(key);
|
|
62
|
+
await Promise.all([
|
|
63
|
+
fs.writeFile(metaPath, JSON.stringify(meta, null, 2)),
|
|
64
|
+
fs.writeFile(bodyPath, Buffer.concat(chunks)),
|
|
65
|
+
]);
|
|
66
|
+
cb();
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
cb(error);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
async delete(key) {
|
|
75
|
+
try {
|
|
76
|
+
const { metaPath, bodyPath } = this.getFilePaths(key);
|
|
77
|
+
await Promise.all([
|
|
78
|
+
fs.unlink(metaPath).catch(() => { }),
|
|
79
|
+
fs.unlink(bodyPath).catch(() => { }),
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Ignore errors when deleting non-existent files
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=flat-cache-interceptor.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__require
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Framer } from 'framer-api';
|
|
2
|
+
export { isComponentInstanceNode, isComponentNode, isFrameNode, isTextNode, isWebPageNode, isDesignPageNode, isColorStyle, isImageAsset, isFileAsset, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundImage, supportsBorder, supportsBorderRadius, supportsFont, supportsImageRendering, supportsInlineTextStyle, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSize, supportsSizeConstraints, supportsSVG, supportsTextTruncation, supportsVisible, supportsZIndex, } from 'framer-api';
|
|
3
|
+
export declare const framer: Framer;
|
|
4
|
+
//# sourceMappingURL=framer-client.server.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { isComponentInstanceNode, isComponentNode, isFrameNode, isTextNode, isWebPageNode, isDesignPageNode, isColorStyle, isImageAsset, isFileAsset, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundImage, supportsBorder, supportsBorderRadius, supportsFont, supportsImageRendering, supportsInlineTextStyle, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSize, supportsSizeConstraints, supportsSVG, supportsTextTruncation, supportsVisible, supportsZIndex, } from 'framer-api';
|
|
2
|
+
const allowAllPermissions = () => {
|
|
3
|
+
return true;
|
|
4
|
+
};
|
|
5
|
+
const noOpNotify = async (message, options) => {
|
|
6
|
+
console.warn('[framer-api server shim notify]', message, options);
|
|
7
|
+
};
|
|
8
|
+
const emptySelection = async () => {
|
|
9
|
+
return [];
|
|
10
|
+
};
|
|
11
|
+
const noOpZoomIntoView = async () => {
|
|
12
|
+
return;
|
|
13
|
+
};
|
|
14
|
+
function getRuntimeFramer() {
|
|
15
|
+
const globalWithFramer = globalThis;
|
|
16
|
+
if (!globalWithFramer.framer) {
|
|
17
|
+
throw new Error('Server runtime framer client is not initialized. Connect first and assign globalThis.framer.');
|
|
18
|
+
}
|
|
19
|
+
return globalWithFramer.framer;
|
|
20
|
+
}
|
|
21
|
+
export const framer = new Proxy({}, {
|
|
22
|
+
get(_target, property, receiver) {
|
|
23
|
+
const runtimeFramer = getRuntimeFramer();
|
|
24
|
+
const value = Reflect.get(runtimeFramer, property, receiver);
|
|
25
|
+
if (value === undefined) {
|
|
26
|
+
if (property === 'isAllowedTo') {
|
|
27
|
+
return allowAllPermissions;
|
|
28
|
+
}
|
|
29
|
+
if (property === 'notify') {
|
|
30
|
+
return noOpNotify;
|
|
31
|
+
}
|
|
32
|
+
if (property === 'getSelection') {
|
|
33
|
+
return emptySelection;
|
|
34
|
+
}
|
|
35
|
+
if (property === 'zoomIntoView') {
|
|
36
|
+
return noOpZoomIntoView;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (typeof value === 'function') {
|
|
40
|
+
return value.bind(runtimeFramer);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=framer-client.server.js.map
|