@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.
Files changed (111) hide show
  1. package/README.md +389 -0
  2. package/bin.js +5 -0
  3. package/dist/babel-jsx.d.ts +24 -0
  4. package/dist/babel-jsx.js +299 -0
  5. package/dist/babel-plugin-imports.d.ts +15 -0
  6. package/dist/babel-plugin-imports.js +211 -0
  7. package/dist/babel-typedoc.d.ts +39 -0
  8. package/dist/babel-typedoc.js +76 -0
  9. package/dist/bin.d.ts +2 -0
  10. package/dist/bin.js +3 -0
  11. package/dist/cli.d.ts +59 -0
  12. package/dist/cli.js +821 -0
  13. package/dist/compat.d.ts +2 -0
  14. package/dist/compat.js +23 -0
  15. package/dist/config.d.ts +18 -0
  16. package/dist/config.js +27 -0
  17. package/dist/css-core.d.ts +50 -0
  18. package/dist/css-core.js +231 -0
  19. package/dist/css.d.ts +15 -0
  20. package/dist/css.js +36 -0
  21. package/dist/esbuild.d.ts +31 -0
  22. package/dist/esbuild.js +317 -0
  23. package/dist/exporter.d.ts +96 -0
  24. package/dist/exporter.js +1151 -0
  25. package/dist/flat-cache-interceptor.d.ts +24 -0
  26. package/dist/flat-cache-interceptor.js +87 -0
  27. package/dist/framer-chunks/chunk-IKQSD2QC.js +10 -0
  28. package/dist/framer-chunks/fontshare-PZLWRK4B-MHMZIGTX.js +7 -0
  29. package/dist/framer-chunks/fontshare-SXU5BGFE-OWTMMPGS.js +7 -0
  30. package/dist/framer-chunks/fontshare-TIA7QUPT-PUDLUTQ7.js +7 -0
  31. package/dist/framer-chunks/framer-font-RD2SUPQH-Q4MS7WS6.js +7 -0
  32. package/dist/framer-chunks/google-EGNT223R-P4DUHBW2.js +7 -0
  33. package/dist/framer-chunks/google-H6SFY4F5-5JSJCGDR.js +7 -0
  34. package/dist/framer-chunks/google-YSYBFRE6-L7YAHH7V.js +7 -0
  35. package/dist/framer-client.server.d.ts +4 -0
  36. package/dist/framer-client.server.js +45 -0
  37. package/dist/framer-package-versions.d.ts +781 -0
  38. package/dist/framer-package-versions.js +782 -0
  39. package/dist/framer-types.d.ts +30 -0
  40. package/dist/framer-types.js +35 -0
  41. package/dist/framer.d.ts +4990 -0
  42. package/dist/framer.js +64296 -0
  43. package/dist/index.d.ts +10 -0
  44. package/dist/index.js +13 -0
  45. package/dist/package-manager.d.ts +10 -0
  46. package/dist/package-manager.js +138 -0
  47. package/dist/plugin-mcp-dist/lib/client-websocket.d.ts +5 -0
  48. package/dist/plugin-mcp-dist/lib/client-websocket.js +103 -0
  49. package/dist/plugin-mcp-dist/lib/cms.d.ts +10 -0
  50. package/dist/plugin-mcp-dist/lib/cms.js +58 -0
  51. package/dist/plugin-mcp-dist/lib/errors.d.ts +5 -0
  52. package/dist/plugin-mcp-dist/lib/errors.js +48 -0
  53. package/dist/plugin-mcp-dist/lib/framer-client.d.ts +2 -0
  54. package/dist/plugin-mcp-dist/lib/framer-client.js +4 -0
  55. package/dist/plugin-mcp-dist/lib/framer-client.server.d.ts +3 -0
  56. package/dist/plugin-mcp-dist/lib/framer-client.server.js +46 -0
  57. package/dist/plugin-mcp-dist/lib/framer.d.ts +30 -0
  58. package/dist/plugin-mcp-dist/lib/framer.js +1084 -0
  59. package/dist/plugin-mcp-dist/lib/hooks.d.ts +6 -0
  60. package/dist/plugin-mcp-dist/lib/hooks.js +46 -0
  61. package/dist/plugin-mcp-dist/lib/mcp-client.d.ts +142 -0
  62. package/dist/plugin-mcp-dist/lib/mcp-client.js +40 -0
  63. package/dist/plugin-mcp-dist/lib/mcp-handlers.d.ts +385 -0
  64. package/dist/plugin-mcp-dist/lib/mcp-handlers.js +1924 -0
  65. package/dist/plugin-mcp-dist/lib/mcp-tools.d.ts +5 -0
  66. package/dist/plugin-mcp-dist/lib/mcp-tools.js +5 -0
  67. package/dist/plugin-mcp-dist/lib/mcp-websocket.d.ts +10 -0
  68. package/dist/plugin-mcp-dist/lib/mcp-websocket.js +88 -0
  69. package/dist/plugin-mcp-dist/lib/plugin-websocket.d.ts +5 -0
  70. package/dist/plugin-mcp-dist/lib/plugin-websocket.js +170 -0
  71. package/dist/plugin-mcp-dist/lib/react-export.d.ts +51 -0
  72. package/dist/plugin-mcp-dist/lib/react-export.js +358 -0
  73. package/dist/plugin-mcp-dist/lib/schema.d.ts +276 -0
  74. package/dist/plugin-mcp-dist/lib/schema.js +907 -0
  75. package/dist/plugin-mcp-dist/lib/store.d.ts +2 -0
  76. package/dist/plugin-mcp-dist/lib/store.js +10 -0
  77. package/dist/plugin-mcp-dist/lib/tree-utils.d.ts +6 -0
  78. package/dist/plugin-mcp-dist/lib/tree-utils.js +141 -0
  79. package/dist/plugin-mcp-dist/lib/tunnel.d.ts +46 -0
  80. package/dist/plugin-mcp-dist/lib/tunnel.js +117 -0
  81. package/dist/plugin-mcp-dist/lib/types.d.ts +110 -0
  82. package/dist/plugin-mcp-dist/lib/types.js +188 -0
  83. package/dist/plugin-mcp-dist/lib/upstream-socket.d.ts +13 -0
  84. package/dist/plugin-mcp-dist/lib/upstream-socket.js +56 -0
  85. package/dist/plugin-mcp-dist/lib/utils.d.ts +13 -0
  86. package/dist/plugin-mcp-dist/lib/utils.js +57 -0
  87. package/dist/plugin-mcp-dist/lib/websocket-server.d.ts +10 -0
  88. package/dist/plugin-mcp-dist/lib/websocket-server.js +88 -0
  89. package/dist/plugin-mcp-dist/lib/xml.d.ts +10 -0
  90. package/dist/plugin-mcp-dist/lib/xml.js +395 -0
  91. package/dist/react.d.ts +76 -0
  92. package/dist/react.js +280 -0
  93. package/dist/renamer.d.ts +11 -0
  94. package/dist/renamer.js +139 -0
  95. package/dist/sentry.d.ts +2 -0
  96. package/dist/sentry.js +5 -0
  97. package/dist/stackblitz.d.ts +9 -0
  98. package/dist/stackblitz.js +179 -0
  99. package/dist/styles/framer.css +920 -0
  100. package/dist/styles/reset.css +37 -0
  101. package/dist/typescript.d.ts +24 -0
  102. package/dist/typescript.js +197 -0
  103. package/dist/undici-dispatcher.d.ts +2 -0
  104. package/dist/undici-dispatcher.js +10 -0
  105. package/dist/unframer-loader.d.ts +2 -0
  106. package/dist/unframer-loader.js +12 -0
  107. package/dist/utils.d.ts +20 -0
  108. package/dist/utils.js +81 -0
  109. package/dist/version.d.ts +2 -0
  110. package/dist/version.js +2 -0
  111. 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,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/fontshare-PZLWRK4B.mjs
4
+ var fontshare_PZLWRK4B_default = {};
5
+ export {
6
+ fontshare_PZLWRK4B_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/fontshare-SXU5BGFE.mjs
4
+ var fontshare_SXU5BGFE_default = {};
5
+ export {
6
+ fontshare_SXU5BGFE_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/fontshare-TIA7QUPT.mjs
4
+ var fontshare_TIA7QUPT_default = {};
5
+ export {
6
+ fontshare_TIA7QUPT_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/framer-font-RD2SUPQH.mjs
4
+ var framer_font_RD2SUPQH_default = {};
5
+ export {
6
+ framer_font_RD2SUPQH_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/google-EGNT223R.mjs
4
+ var google_EGNT223R_default = {};
5
+ export {
6
+ google_EGNT223R_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/google-H6SFY4F5.mjs
4
+ var google_H6SFY4F5_default = {};
5
+ export {
6
+ google_H6SFY4F5_default as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import "./chunk-IKQSD2QC.js";
2
+
3
+ // /:https://app.framerstatic.com/google-YSYBFRE6.mjs
4
+ var google_YSYBFRE6_default = {};
5
+ export {
6
+ google_YSYBFRE6_default as default
7
+ };
@@ -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