From ead6340370d7dc88701f9928d5b356be382952c0 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Thu, 13 Nov 2025 17:09:23 +0900 Subject: [PATCH 1/6] export convertLegacyData --- src/patch-map.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/patch-map.ts b/src/patch-map.ts index 9b3a1f1a..21b04976 100644 --- a/src/patch-map.ts +++ b/src/patch-map.ts @@ -1,7 +1,8 @@ -export { Patchmap } from './patchmap'; -export { UndoRedoManager } from './command/UndoRedoManager'; export { Command } from './command/commands/base'; -export { default as Transformer } from './transformer/Transformer'; +export { UndoRedoManager } from './command/UndoRedoManager'; export { default as State, PROPAGATE_EVENT } from './events/states/State'; -export { selector } from './utils/selector/selector'; +export { Patchmap } from './patchmap'; +export { default as Transformer } from './transformer/Transformer'; export * from './utils'; +export { convertLegacyData } from './utils/convert'; +export { selector } from './utils/selector/selector'; From 813492885a16bfb03227f8a5432105a3a6e257c5 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Fri, 14 Nov 2025 14:40:02 +0900 Subject: [PATCH 2/6] fix --- src/utils/convert.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/convert.js b/src/utils/convert.js index 6bd0d612..8637d284 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -129,7 +129,10 @@ export const convertLegacyData = (data) => { attrs: { x: transform.x, y: transform.y, - metadata: props, + metadata: Object.assign( + props, + key === 'inverters' ? { strings: value.children } : {}, + ), display: key === 'combines' ? 'combiner' : key.slice(0, -1), }, }); From 00141b46215be68b47c7a215c1acd966de11a818 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Fri, 14 Nov 2025 17:20:01 +0900 Subject: [PATCH 3/6] fix --- src/utils/convert.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/utils/convert.js b/src/utils/convert.js index 8637d284..8ea9af5d 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -68,6 +68,7 @@ export const convertLegacyData = (data) => { objs[key].show = false; objs[key].attrs = { zIndex: 20 }; for (const value of values) { + const props = value.properties; objs[key].children.push({ type: 'relations', id: value.id, @@ -93,7 +94,16 @@ export const convertLegacyData = (data) => { join: 'round', }, attrs: { - metadata: value.properties, + metadata: { + ...(props?.props + ? { + ...props.props, + ...Object.fromEntries( + Object.entries(props).filter(([k]) => k !== 'props'), + ), + } + : props), + }, display: key.slice(0, -1), }, }); @@ -129,10 +139,10 @@ export const convertLegacyData = (data) => { attrs: { x: transform.x, y: transform.y, - metadata: Object.assign( - props, - key === 'inverters' ? { strings: value.children } : {}, - ), + metadata: { + ...props, + ...(key === 'inverters' ? { strings: value.children } : {}), + }, display: key === 'combines' ? 'combiner' : key.slice(0, -1), }, }); From c517bc39aff8e209fd6ea690078decbdae44c0fb Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Fri, 21 Nov 2025 11:21:44 +0900 Subject: [PATCH 4/6] fix --- src/utils/convert.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/convert.js b/src/utils/convert.js index 8ea9af5d..a2a35b0d 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -98,9 +98,11 @@ export const convertLegacyData = (data) => { ...(props?.props ? { ...props.props, - ...Object.fromEntries( - Object.entries(props).filter(([k]) => k !== 'props'), - ), + ...(() => { + if (!props?.props) return props; + const { props: nested, ...rest } = props; + return { ...nested, ...rest }; + })(), } : props), }, From 26d18d092aa45cab1a4853278f8515d58bcd2a58 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Fri, 21 Nov 2025 11:24:40 +0900 Subject: [PATCH 5/6] fix --- src/utils/convert.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/utils/convert.js b/src/utils/convert.js index a2a35b0d..12023001 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -69,6 +69,7 @@ export const convertLegacyData = (data) => { objs[key].attrs = { zIndex: 20 }; for (const value of values) { const props = value.properties; + console.log(props); objs[key].children.push({ type: 'relations', id: value.id, @@ -95,16 +96,11 @@ export const convertLegacyData = (data) => { }, attrs: { metadata: { - ...(props?.props - ? { - ...props.props, - ...(() => { - if (!props?.props) return props; - const { props: nested, ...rest } = props; - return { ...nested, ...rest }; - })(), - } - : props), + ...(() => { + if (!props?.props) return props; + const { props: nested, ...rest } = props; + return { ...nested, ...rest }; + })(), }, display: key.slice(0, -1), }, From 63e902e007d0a5ee4d110be854e9a4bcc25b76ed Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Fri, 21 Nov 2025 11:25:09 +0900 Subject: [PATCH 6/6] chore --- src/utils/convert.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/convert.js b/src/utils/convert.js index 12023001..f4eaf76c 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -69,7 +69,6 @@ export const convertLegacyData = (data) => { objs[key].attrs = { zIndex: 20 }; for (const value of values) { const props = value.properties; - console.log(props); objs[key].children.push({ type: 'relations', id: value.id,