This commit is contained in:
Rizky 2024-07-15 12:52:30 +07:00
parent 837ec00cbe
commit b8aac498d9
3 changed files with 11 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -67,6 +67,9 @@ export const EdSidePropComp: FC<{ meta: IMeta }> = ({ meta }) => {
});
filtered = filtered.sort((a, b) => {
if (a.data?.name.startsWith('new_prop')) return 1;
if (b.data?.name.startsWith('new_prop')) return -1;
if (
a.data &&
b.data &&
@ -201,15 +204,15 @@ export const EdSidePropComp: FC<{ meta: IMeta }> = ({ meta }) => {
idx = parseInt(idx) + 1;
}
let name = `prop_${idx}`;
let name = `new_prop_${idx}`;
while (mprops.get(name)) {
idx = parseInt(idx) + 1;
name = `prop_${idx}`;
name = `new_prop_${idx}`;
}
const map = new Y.Map() as FMCompDef;
syncronize(map, {
idx: idx,
idx,
name,
type: "string",
value: '"hello"',

View File

@ -147,14 +147,14 @@ export const viEvalProps = (
`
);
script.props[name] = { value: src };
script.props[name] = { value: src, valueBuilt: src };
let val = fn(...Object.values(arg));
if (typeof val === "function") {
script.props[name].fn = val;
val = (...args: any[]) => {
if (script) return script.props?.[name].fn(...args);
};
// val = (...args: any[]) => {
// if (script) return script.props?.[name].fn(...args);
// };
}
arg[name] = val;