-
Notifications
You must be signed in to change notification settings - Fork 84
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
Initial draft of cem-* elements for rendering manifest data #1425
base: main
Are you sure you want to change the base?
Conversation
A live preview of this PR will be available at the URL below and will update on each commit. = https://pr1425---site-khswqo4xea-wl.a.run.app/
|
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 seems ok to me to submit as a first cut!
</div> | ||
<cem-class-declaration id="content" .declaration=${declaration}> | ||
<div slot="usage"> | ||
<h4>Usage</h4> |
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.
Should the title go in the element so it's standardized?
"lit": "^2.6.0", | ||
"lit-analyzer": "^1.2.1" | ||
"lit-analyzer": "^1.2.1", | ||
"marked": "^4.2.5" |
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.
Todo: I think we should make a separate package that has a markdown parser pre-configured with all the plugins we accept so we make sure it's consistent across uses.
@@ -0,0 +1,292 @@ | |||
/** | |||
* @license | |||
* Copyright 2022 Google LLC |
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.
* Copyright 2022 Google LLC | |
* Copyright 2023 Google LLC |
>deprecated | ||
</span>` | ||
)} | ||
${privacy !== undefined && privacy !== 'public' |
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.
maybe pull up into a named variable so it can have a comment, like:
// only display private and protected privacy
const privacyString = privacy !== ...
: ''}${statik ? 'static ' : ''}${rest ? '...' : ''} | ||
${name}</code | ||
> | ||
${optional ? html`<span class="optional"> (optional)</span>` : ''} |
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'm assuming there's markup here and not for other modifiers because of the drafty nature of the PR? If so, I think I'd include a span/class for all modifiers or none and we can add them as needed later?
parameters, | ||
(params: cem.Parameter[]) => | ||
html` | ||
<table> |
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.
We might want to consider using CSS grid so that multiple parameters tables have their columns line up.
@customElement('cem-class-declaration') | ||
export class CemClassDeclaration extends LitElement { | ||
static styles = styles; | ||
@property() |
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.
formatting nit: give these some newlines so they have rom to breathe
this.declaration.members?.filter( | ||
(m) => m.kind === 'field' && m.privacy !== 'private' | ||
), | ||
(m) => html` <h4>Fields</h4> |
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.
nit: Prettier maintains leading whitespace if you initially had a newline. You can search for `` ` to find and remove these.
@@ -0,0 +1,94 @@ | |||
/** | |||
* @license | |||
* Copyright 2022 Google LLC |
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.
* Copyright 2022 Google LLC | |
* Copyright 2023 Google LLC |
here and elsewhere
export const styles = css` | ||
:host { | ||
display: block; | ||
padding: 0 0 15px 15px; |
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.
we'll need variables for all of these spacing and colors.
No description provided.