diff --git a/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/ErdEditor.kt b/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/ErdEditor.kt index b73171a..4b07257 100644 --- a/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/ErdEditor.kt +++ b/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/ErdEditor.kt @@ -110,6 +110,7 @@ class ErdEditor( is VscodeBridgeAction.VscodeImportFile -> { // val type = action.payload.type +// val op = action.payload.op // val extensions = action.payload.accept.split(",") // .map { it.substringAfterLast(".", "") } // .toTypedArray() @@ -120,18 +121,20 @@ class ErdEditor( // ) // // ApplicationManager.getApplication().invokeLater { -// FileChooserFactory.getInstance().createFileChooser(descriptor, null, null).choose(null).also { files -> -// if (files.isEmpty()) { -// return@invokeLater -// } +// FileChooserFactory.getInstance() +// .createFileChooser(descriptor, null, null) +// .choose(null).also { files -> +// if (files.isEmpty()) { +// return@invokeLater +// } // -// val file = files.first() -// val value = file.inputStream.reader().readText() -// webviewPanel.dispatch( -// WebviewBridgeAction.WebviewImportFile( -// WebviewImportFilePayload(type, value) +// val file = files.first() +// val value = file.inputStream.reader().readText() +// webviewPanel.dispatch( +// WebviewBridgeAction.WebviewImportFile( +// WebviewImportFilePayload(type, op, value) +// ) // ) -// ) // } // } } diff --git a/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/WebviewBridge.kt b/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/WebviewBridge.kt index b74ecd8..e9ebf4b 100644 --- a/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/WebviewBridge.kt +++ b/src/main/kotlin/com/github/dineug/erdeditorintellijplugin/editor/WebviewBridge.kt @@ -48,7 +48,7 @@ sealed class VscodeBridgeAction { } } data class VscodeExportFilePayload(val value: String, val fileName: String) -data class VscodeImportFilePayload(val type: String, val accept: String) +data class VscodeImportFilePayload(val type: String, val op: String, val accept: String) data class VscodeSaveValuePayload(val value: String) data class VscodeSaveReplicationPayload(val actions: Any) data class VscodeSaveThemePayload(val appearance: String, val grayColor: String, val accentColor: String) @@ -70,7 +70,7 @@ sealed class WebviewBridgeAction { val type = "webviewReplication" } } -data class WebviewImportFilePayload(val type: String, val value: String) +data class WebviewImportFilePayload(val type: String, val op: String, val value: String) data class WebviewInitialValuePayload(val value: String) data class WebviewUpdateThemePayload(val appearance: String?, val grayColor: String?, val accentColor: String?) data class WebviewReplicationPayload(val actions: Any) \ No newline at end of file