Skip to content

Conversation

@jardicc
Copy link

@jardicc jardicc commented Jul 12, 2021

It is not perfect but works for me.

@thejustinwalsh
Copy link
Owner

Awesome!
I had no idea that size was available on so many components!

@@ -1 +1,2 @@
node_modules
package-lock.json
Copy link
Owner

Choose a reason for hiding this comment

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

Any particular reason why you are ignoring the package-lock.json?
Was under the impression that this would give us a deterministic install of the project.

Copy link
Author

Choose a reason for hiding this comment

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

You might be right. I am used to always ignore package-lock since it is auto-generated and I am thinking to have one source of the truth. But npm itself does recommend committing the file.

import { SpectrumComponentSize } from './common';
declare namespace Spectrum {
type IconName = 'ui:AlertMedium' | 'ui:AlertSmall' | 'ui:ArrowDownSmall' | 'ui:ArrowLeftMedium' | 'ui:ArrowUpSmall' | 'ui:Asterisk' | 'ui:CheckmarkMedium' | 'ui:CheckmarkSmall' | 'ui:ChevronDownMedium' | 'ui:ChevronDownSmall' | 'ui:ChevronLeftLarge' | 'ui:ChevronLeftMedium' | 'ui:ChevronRightLarge' | 'ui:ChevronRightMedium' | 'ui:ChevronRightSmall' | 'ui:ChevronUpSmall' | 'ui:CornerTriangle' | 'ui:CrossLarge' | 'ui:CrossMedium' | 'ui:CrossSmall' | 'ui:DashSmall' | 'ui:DoubleGripper' | 'ui:FolderBreadcrumb' | 'ui:HelpMedium' | 'ui:HelpSmall' | 'ui:InfoMedium' | 'ui:InfoSmall' | 'ui:Magnifier' | 'ui:More' | 'ui:SkipLeft' | 'ui:SkipRight' | 'ui:Star' | 'ui:StarOutline' | 'ui:SuccessMedium' | 'ui:SuccessSmall' | 'ui:TripleGripper';
type IconSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
Copy link
Owner

Choose a reason for hiding this comment

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

Do we lose icon sizes by this being replaced with common?
Do more icon sizes exist than do common sizes?

Copy link
Author

Choose a reason for hiding this comment

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

Somebody in Slack reported this as a "bug". I did not test it but I blindly trust it. :-D

'sp-menu-item': {
children?: React.ReactNode;
ref?: React.RefObject<HTMLElement>;
key?: string;
Copy link
Owner

Choose a reason for hiding this comment

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

Good call on adding key to the list types!

Copy link
Author

Choose a reason for hiding this comment

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

Yes, a few months ago I had to add "key" to the menu item component in order to update its state correctly. But we can't simply have "key" property on the component since it will be undefined. We have to find a better way.

Copy link
Owner

@thejustinwalsh thejustinwalsh Jul 13, 2021

Choose a reason for hiding this comment

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

The beauty of React here is that key={undefined} will actually not render a key at all!
I use the same trick for making sure false doesn't add an attribute to the web component when the spec calls for not rendering the attribute.

Alternatively, we could also generate keys if it is not passed into the React Component to silence warnings about missing keys in lists...

Maybe I should whip up some tests around these missing keys... 🤔

@jardicc
Copy link
Author

jardicc commented Jul 13, 2021

Awesome!
I had no idea that size was available on so many components!

You should doublecheck this with PS 22.5.0
I did test some of them and it worked but I did not test all of them. https://github.com/AdobeDocs/uxp-photoshop-plugin-samples/blob/uxp-5.2/ui-kitchen-sink/index.js#L10

@thejustinwalsh thejustinwalsh added the enhancement New feature or request label Jul 15, 2021
@thejustinwalsh thejustinwalsh self-assigned this Jul 15, 2021
@thejustinwalsh
Copy link
Owner

I noticed you had docs added to the PR. Was that because of the absence of a .gitignore, or do you prefer to have generated docs committed in the repo?

Should I add a .gitignore for the docs, or check the generated docs in? Could add a build step to just deploy the docs to GitHub pages upon commit/merge.

@jardicc
Copy link
Author

jardicc commented Jul 20, 2021

ah, I was just trying to figure out on how to build usable types and wasn't sure whether I should keep it or not. I don't see docs as valuable right now in my case. VSCode and intelli-sense can show you hints as well including your own descriptions.

@valentinsenm
Copy link

Will these changes be merged anytime soon?

@thejustinwalsh
Copy link
Owner

@valentinsenm looks like this PR has merge conflicts at the moment. If I get a clean PR happy to merge. I canceled my Adobe subscription and won't be able to validate the changes locally. If anyone is up for maintaining or pushing this repo forward, I will happily transfer ownership.

@jardicc
Copy link
Author

jardicc commented Oct 31, 2022

I would rather push on the folk in Adobe to provide official types. I don't want to maintain this either :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants