fix: remove dist

This commit is contained in:
quillzhou@gmail.com 2023-12-23 16:19:23 +08:00
parent 44ad5e2a1f
commit a7421ed9f6
2 changed files with 1 additions and 54 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ yarn.lock
# Vite files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
src/figma/dist

View File

@ -1,54 +0,0 @@
"use strict";
(() => {
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/figma/code.ts
figma.showUI(`<script>window.location.href = '${"http://localhost:5173?figma=1"}'<\/script>`, {
width: 400,
height: 700
});
figma.ui.onmessage = (message, props) => __async(void 0, null, function* () {
if (!"http://localhost:5173?figma=1".includes(props.origin)) {
return;
}
switch (message.type) {
case "EVAL": {
const fn = eval.call(null, message.code);
try {
const result = yield fn(figma, message.params);
figma.ui.postMessage({
type: "EVAL_RESULT",
result,
id: message.id
});
} catch (e) {
figma.ui.postMessage({
type: "EVAL_REJECT",
error: typeof e === "string" ? e : e && typeof e === "object" && "message" in e ? e.message : null,
id: message.id
});
}
break;
}
}
});
})();