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) => { filtered = filtered.sort((a, b) => {
if (a.data?.name.startsWith('new_prop')) return 1;
if (b.data?.name.startsWith('new_prop')) return -1;
if ( if (
a.data && a.data &&
b.data && b.data &&
@ -201,15 +204,15 @@ export const EdSidePropComp: FC<{ meta: IMeta }> = ({ meta }) => {
idx = parseInt(idx) + 1; idx = parseInt(idx) + 1;
} }
let name = `prop_${idx}`; let name = `new_prop_${idx}`;
while (mprops.get(name)) { while (mprops.get(name)) {
idx = parseInt(idx) + 1; idx = parseInt(idx) + 1;
name = `prop_${idx}`; name = `new_prop_${idx}`;
} }
const map = new Y.Map() as FMCompDef; const map = new Y.Map() as FMCompDef;
syncronize(map, { syncronize(map, {
idx: idx, idx,
name, name,
type: "string", type: "string",
value: '"hello"', 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)); let val = fn(...Object.values(arg));
if (typeof val === "function") { if (typeof val === "function") {
script.props[name].fn = val; script.props[name].fn = val;
val = (...args: any[]) => { // val = (...args: any[]) => {
if (script) return script.props?.[name].fn(...args); // if (script) return script.props?.[name].fn(...args);
}; // };
} }
arg[name] = val; arg[name] = val;