Conversation
62330af to
ddfd1bd
Compare
izaakschroeder
left a comment
There was a problem hiding this comment.
The ideas behind this seem pretty great to me. Left a few thoughts. The only thing that might be an area to dry up is there seems to be some repeat logic around document.documentElement. Nothing critical though.
packages/flowtip-core/src/Rect.js
Outdated
| } | ||
|
|
||
| /** | ||
| * Determne if a rect-like object has valid positive area. |
| ); | ||
| } | ||
|
|
||
| return null; |
There was a problem hiding this comment.
Should there be a warning in this case? Or use of invariant instead?
| * @param {number} size - Height of the triangle in px. | ||
| * @returns {Object} Border triangle style. | ||
| */ | ||
| export const cssTriangle = (region: Region, color: string, size: number) => { |
There was a problem hiding this comment.
What is this used for? There's no reference to it anywhere. Is this intended to be part of a separate thing to help consumers quickly generate carets for use in a tail component?
| } | ||
|
|
||
| /** | ||
| * Get current minimum linear overlap value. |
There was a problem hiding this comment.
I know you've used this term before but is there a definition of what "linear" overlap is vs some other kind of overlap? This comment has little to do with the PR itself, just if it's going to be part of the nomenclature for this library a working definition would be handy. A cursory google reveals no common definition or use of this term.
There was a problem hiding this comment.
overlap is one of the named config options of flowtip-core
There was a problem hiding this comment.
No concern with overlap – as above more curious what the linear qualifier means.
There was a problem hiding this comment.
"Linear" here refers to parallel with the edge of the target facing the content, as opposed to perpendicular.
The overlap related computations are effectively 2D with respect to one of the four regions.
packages/flowtip-core/src/Rect.js
Outdated
| /** | ||
| * Determne if a rect-like object has valid positive area. | ||
| * | ||
| * @param {object} [rect] A rect-like object. |
There was a problem hiding this comment.
Is there a reason this object is lowercase and all the other ones are not?
Remove the component rendering and style generation logic from within the `FlowTip` react component and allow it to be pluggable through a `render` interface. The previous behavior is preserved through the default configuration. Different renderer types (other than a `Content` and `Tail` component interface) can be easily replace the default renderer.
Remove the component rendering and style generation logic from within the
FlowTipreact component and allow it to be pluggable through arenderinterface.The previous behavior is preserved through the default configuration. Different renderer types (other than a
ContentandTailcomponent interface) can be easily replace the default renderer.Consumer-facing Changes:
Previously, the appearance could only be customized through the
tailandcontentcomponents. This interface remains supported and unchanged.Using the
renderprop, the consumer has lower-level access to the rendering behavior. This pattern has far fewer assumptions about the style or shape of the rendered DOM nodes.