Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 图片上传外观配置 #6648

Merged
merged 5 commits into from
Apr 24, 2023
Merged

Conversation

hy993658052
Copy link
Collaborator

@hy993658052 hy993658052 commented Apr 19, 2023

What

🤖 Generated by Copilot at 9867cd0

This pull request adds a feature to the amis and amis-editor packages that allows users to customize the style and icon of the input image control in the schema editor. It also simplifies some props and removes some redundant code in the InputText and style-helper files. It updates the CSS files and the Item component to support the new feature. It modifies the editor.ts and ThemeCssCode.tsx files to handle the theme configuration data and the compound selectors.

🤖 Generated by Copilot at 9867cd0

We are the masters of the theme
We shape the style with our code
We use the props and the schema
We make the UI explode

Why

How

🤖 Generated by Copilot at 9867cd0

  • Add custom CSS style and icon customization for input image control
  • Add themeCss prop to Item component to accept custom CSS styles from theme configuration (link)
  • Add -icon case to formatStyle function to handle icon style properties in theme configuration (link)
  • Add inputStateFunc function and constants to generate schema for input image control based on theme configuration and state (link)
  • Add new fields and options to ImageControlPlugin schema to allow user to customize appearance and style of input image control (link)
  • Add insertCustomStyle import and function call to InputImage component to insert custom CSS styles from theme configuration (link, link)
  • Add new CSS classes and props to InputImage component and its sub-elements to apply custom CSS styles and icon content (link, link, link)
  • Add new CSS variable and selector to _components.scss and _image.scss files to define and style default icon for input image control (link, link, link, link, link, link)
  • Add condition to getCssAndSetValue function to handle compound selector with class selector for node selector (link)
  • Remove getValueByPath function from style-helper.ts file to avoid duplication (link)
  • Replace themeCss prop with editorDefaultData prop in MainStore class to store default values of theme configuration (link)
  • Add conditional statement to filterSchemaForEditor function to check and assign editorDefaultData prop of schema based on editorPath prop (link)
  • Add getValueByPath function to util.ts file to provide utility function for getting default value of theme configuration by path (link)
  • Remove getValueByPath import and use editorDefaultData prop instead in InputText component (link, link)
  • Format code of --Timeline-visible-border-radius variable in _components.scss file to improve readability and consistency (link)

@github-actions github-actions bot added the feat label Apr 19, 2023
@github-actions
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

icon="plus-fine"
className="icon"
iconContent={cx(
':ImageControl-addBtn-icon',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个:作用是?

classPrefix: ns
} = this.props;
const editorDefaultData = getValueByPath(editorPath, themeConfig);
const editorDefaultData = getValueByPath(
editorPath,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editorPath可以是一个组件内置的静态属性?不依赖外部传入

const editorDefaultData = getValueByPath(editorPath, themeConfig);
const editorDefaultData = getValueByPath(
editorPath,
(window as any).themeConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

themeConfig应该是一个从props.env下放的配置,不应该挂载在window

@qkiroc qkiroc merged commit 15ed762 into baidu:master Apr 24, 2023
hy993658052 pushed a commit to hy993658052/amis that referenced this pull request Apr 25, 2023
qkiroc added a commit that referenced this pull request Apr 25, 2023
feat: 图片上传外观配置

Co-authored-by: qkiroc <30946345+qkiroc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants