mirror of
https://github.com/pheralb/svgl.git
synced 2024-11-10 14:46:54 +08:00
fix: remove dist
This commit is contained in:
parent
44ad5e2a1f
commit
a7421ed9f6
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,3 +20,4 @@ yarn.lock
|
||||
# Vite files
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
src/figma/dist
|
54
src/figma/dist/code.js
vendored
54
src/figma/dist/code.js
vendored
@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
Loading…
Reference in New Issue
Block a user