Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
🤖 Generated by Copilot at a7c7d63
This pull request enhances the data binding capabilities of the
amis-editor
package by adding new methods and props to the editor and some plugins. It allows the dialog, input tree, and tree select components to generate and use data schemas based on their configuration and the host node data. It also improves the option resolution function inutil.ts
.🤖 Generated by Copilot at a7c7d63
Why
How
🤖 Generated by Copilot at a7c7d63
getHostNodeDataSchema
to theEditorProps
andSubEditorProps
interfaces to allow the editor and sub-editor to access the data schema of the host node (link, link)getHostNodeDataSchema
prop from the sub-editor props to the editor component in theSubEditor
class (link)pageParams
variable from thevariables
array in theSubEditor
class to avoid duplicating the page variables from the editor config (link)buildDataSchemas
to theDialogPlugin
,InputTreePlugin
andTreeSelectPlugin
classes to generate the data schema for the dialog, input tree and tree select nodes based on their schema and data or options properties (link, link, link)EditorNodeType
fromamis-editor-core
to use the type for thebuildDataSchemas
method in theDialog.tsx
,InputTree.tsx
andTreeSelect.tsx
files (link, link, link)resolveOptionType
function in theutil.ts
file to use thefindTree
function fromamis
to find the first valid option and handle the empty or undefined options cases (link)resolveOptionType
fromutil.ts
to use the function for thebuildDataSchemas
method in theInputTree.tsx
andTreeSelect.tsx
files (link, link)findTree
fromamis
to use the function for theresolveOptionType
function in theutil.ts
file (link)