-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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(): Convert align guidelines to TS. Add build system for extensions #10043
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
fabric.ts
Outdated
@@ -178,3 +178,5 @@ export { Control } from './src/controls/Control'; | |||
export * as controlsUtils from './src/controls'; | |||
|
|||
export * from './src/filters'; | |||
|
|||
export { initAligningGuidelines } from './lib/aligning_guidelines/index'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the issue i want to solve. I don't want to package those in this way.
I ll need to work out a way for rollup to produce a different bundle that has fabric has an external dep and that is reacheable from fabric/plugin or something like that
I will rename lib into plugins as first step |
worked a bit on the build system this morning, still requires some tweaks. |
@@ -0,0 +1,11 @@ | |||
import * as fabric from 'fabric'; | |||
import { initAligningGuidelines } from 'fabric/extensions'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhe-he this is how i want to import the extensions like the guidelines.
I think we can refine this so that splitting and node/browser are still possible cdn links
? activeObjectX + activeObjectWidth / 2 + aligningLineOffset | ||
: activeObjectX - activeObjectWidth / 2 - aligningLineOffset, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhe-he this file seems completely unused. Why is it here? can i delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this file is not used anywhere, and you can delete it. In the original alignment version, there is a parameter called aligningLineOffset, and I found that its use case is completely ineffective in the new version. Later, I forgot to delete this file, and the offset property in AligningLineConfig should also be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will merge this code as is because i don't really have time to review the implementation. |
I set up the base for testing and building |
To avoid disrupting the original file structure, I placed the main code in the lib folder and only added exports in the entry file. At the same time, it supports the configuration related to reference lines.
how to use: