-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(react-file-type-icons): align v9 file type icon package path #36330
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
Draft
bigbadcapers
wants to merge
215
commits into
microsoft:master
Choose a base branch
from
bigbadcapers:caperez/fti-weaved
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
215 commits
Select commit
Hold shift + click to select a range
9fba299
Adding `portfolio` (Microsoft Project item type) to the list of non-f…
bigbadcapers 63f928c
More filetype support.
bigbadcapers 3ccf0e3
update CDN url and typo
bigbadcapers fab6a3a
yarn change
bigbadcapers 55294b5
API update (from yarn nx run-many -t build)
bigbadcapers f025f9e
Merge branch 'master' into caperez/sep-filetype-icon-update
bigbadcapers bbeb40a
Ran `yarn nx format`
bigbadcapers 0bcee33
Merge branch 'master' into caperez/sep-filetype-icon-update
bigbadcapers a7180bf
Merge branch 'caperez/sep-filetype-icon-update' of https://github.com…
bigbadcapers 280fe2c
Changing FileIconType-based icon searching to use the same scalable m…
bigbadcapers d87a2a5
Merge branch 'upstream-master' into caperez/newTypeMethod
bigbadcapers d9cc656
removing stray outdated yarn change files
bigbadcapers a7884fb
yarn change
bigbadcapers b12c050
Ran `yarn nx format`
bigbadcapers 71faacd
post-refactoring cleanup of an unused type
bigbadcapers d6b0c08
fixing error reported by `lint`: error The body of a for-in should b…
bigbadcapers 60556e3
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 5e51678
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 348dc4d
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 22c8545
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 696661f
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers fa910b5
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 7e42ae8
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 00bbcd6
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers e49f620
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 6640d15
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 765313e
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 0b1cf0b
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 24c626f
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers ae68e6d
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 4b1d12e
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers a41fc17
Merge branch 'upstream-master' into caperez/newTypeMethod
bigbadcapers b86c403
adding album entry to filetypeicon mapping
bigbadcapers b5a574c
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 3fc8bc6
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 4da5e8a
Merge remote-tracking branch 'upstream/master' into caperez/newTypeMe…
bigbadcapers 856c284
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers e1019ad
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers d759bf1
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 91b7b95
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers fe0881e
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 17bf0e5
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers ddf6351
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers e54435a
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 54df488
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 9f3c6da
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers ada0165
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers ad8552c
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers d2c9ff6
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 0af5721
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers e7964db
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 1aa9f16
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers cbdba53
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 19cd862
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 209fd2c
Merge branch 'microsoft:master' into caperez/newTypeMethod
bigbadcapers aa8ffda
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers f74d77b
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers a19592f
first drop of creating a Fluent v9 version of the react-file-type-ico…
bigbadcapers 0b1c4fb
refreshing filetype icon references in other storybooks to new icon s…
bigbadcapers ce3262c
more touch-ups in other places that reference the CDN url
bigbadcapers e08e1ba
verified new file-type-icons-preview package is rendering icons in th…
bigbadcapers 641eb02
simplified documentation.
bigbadcapers 59298fa
simplifying getFileTypeIconAsURL and getFileTypeIconAsHTMLString
bigbadcapers 792e792
updated storybook / tests to evaluate helper functions
bigbadcapers 3c64988
organizing storybook place in nav
bigbadcapers cbf2f29
Merge branch 'master' into caperez/newTypeMethod
bigbadcapers 27a704e
Merge remote-tracking branch 'origin/caperez/newTypeMethod' into cape…
bigbadcapers 8d379e6
update getFileTypeIconProps to use same mapping file FileTypeIconMap.…
bigbadcapers e51a9c6
new documentation pass 1 (broken)
bigbadcapers 213d6f0
documentation rendering ok, ready to condense
bigbadcapers f0a02bf
refining FileIconType and storybook
bigbadcapers 71338bf
story condensation snapshot
bigbadcapers 93a577b
condensation 2
bigbadcapers 3d484ae
improving alt tag generation in the control itself, removing a11y sto…
bigbadcapers 199803c
ran all pre-checks from plan-testingAndPromotionEnhanced. ready to st…
bigbadcapers 325af7b
package move to remove -preview suffix
bigbadcapers 092682f
first test passed after package rename
bigbadcapers f5b16cc
API update and undoing newFileTypeMethod in v8 package
bigbadcapers baa3430
package semver cleanup, build pass, documentation simplification
bigbadcapers 1f48612
error checking and optimizations
bigbadcapers 5996d70
initializeFileTypeIcons with alternate CDN URL is now honored by new …
bigbadcapers e89bd7b
improved icon size checking, removing unnecessary public exports, fix…
bigbadcapers 917c256
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 9af6811
cleanup stray API file
bigbadcapers fb25605
Merge branch 'caperez/filetype-icons-for-v9' of https://github.com/bi…
bigbadcapers df430ed
changing v8 package name and adding publishConfig so it emits to the …
bigbadcapers 0204824
updating swc packages and lint tweaks
bigbadcapers 3b2ed13
yarn change
bigbadcapers c5b3ca1
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 07d1b03
remove private flag from package.json for react-file-type-icons
bigbadcapers b2a45e8
Merge branch 'caperez/filetype-icons-for-v9' of https://github.com/bi…
bigbadcapers 3794169
deduplicating yarn lock and solving plugin issue in react-utilities .…
bigbadcapers 935f967
yarn change for react-utilities
bigbadcapers 237b828
npx yarn-deduplicate --strategy fewer
bigbadcapers cb42047
Add path mapping for react-file-type-icons-v8 in tsconfig.base.all.json
bigbadcapers cfa9fba
re-running yarn nx format:write
bigbadcapers ef929f1
undoing removal of indent rule
bigbadcapers 9824a02
plugin swc-plugin-de-indent-template-literal is crashing, removing
bigbadcapers 9b0917c
yarn change for experimental swc.rs indentation plugin removal
bigbadcapers 2d73b85
fix missing param in documentation for getFileTypeIcon
bigbadcapers 13974b7
Add missing dependency and update styles in file type icon stories
bigbadcapers d949974
lint and yarn change again
bigbadcapers 2d6e940
undoing overeager deletion of a file i had no business touching
bigbadcapers ba6015c
fixing compilation config issues - no change
bigbadcapers c2ad25a
Refactor UrlAndHtml component export and update story parameters
bigbadcapers c31ef7e
Add device pixel ratio state and effect to UrlAndHtml component to pa…
bigbadcapers 6c94223
yarn nx format:write prettier
bigbadcapers 917f878
dead end ci/cd solving ci/main no dice
bigbadcapers ae682cc
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers f1984d1
first late undo
bigbadcapers cb3066c
Merge branch 'caperez/filetype-icons-for-v9' of https://github.com/bi…
bigbadcapers f55e035
attempted reset
bigbadcapers 15c87a6
yarn change in shared-contexts
bigbadcapers 6bfae2c
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers a0f11fd
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 921aeff
chore: update package dependencies for react and charting components
bigbadcapers 32e1197
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 91ed548
feat: add public docsite setup for v8 version of file-type-icons package
bigbadcapers 47aec0f
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 17569a9
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers e740fbf
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers dee9653
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers c7a1388
missing comma after merge
bigbadcapers 5b170c8
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 741d4b3
fixing overwritten package name differentiation, retaining publishCon…
bigbadcapers e41a839
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers f06399e
added correct config in syncpack semvergroups to support sim-shipping
bigbadcapers 2812aee
Merge branch 'caperez/filetype-icons-for-v9' of https://github.com/bi…
bigbadcapers f98c7f1
fixing syncpack config
bigbadcapers 85c4d99
update package name for file type icons to v8 version
bigbadcapers 2b58691
fixing name error - undoing
bigbadcapers 1b1abc6
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 983c8be
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 18780ad
fix: correct JSON formatting in package.json by adding missing comma
bigbadcapers 0965187
chore: update yarn.lock
bigbadcapers 43a15f5
chore: update API file for react-file-type-icons
bigbadcapers fb56561
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 41940e8
feat: add targets configuration for generate-api in project.json
bigbadcapers ab8d637
Merge branches 'caperez/filetype-icons-for-v9' and 'caperez/filetype-…
bigbadcapers 6d7057b
initial ship of v9 in v8
bigbadcapers 4a6db74
feat: enhance FileTypeIcon documentation and add migration/playground…
bigbadcapers 38bf864
feat: add Storybook support for react-file-type-icons and mock set-ve…
bigbadcapers 557cfd5
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers b95cdd5
feat(nx): add skills for generating code, managing plugins, running t…
bigbadcapers cbfc4a1
feat: optimize file type icon mapping by introducing FileIconTypeToIc…
bigbadcapers edb869a
Merge remote-tracking branch 'upstream/master' into user/caperez/v9-f…
bigbadcapers 6adc099
in progress of creating v9-in-v8 version of file type icons package
bigbadcapers 4f4a7f5
chore: update TypeScript configuration to include ignoreDeprecations …
bigbadcapers 919c50f
Merge remote-tracking branch 'upstream/master' into user/caperez/v9-f…
bigbadcapers 73e4c30
v1 of storybook integration, but at the wrong spot
bigbadcapers 6ba104e
feat: update Storybook integration for v9 and remove deprecated FileT…
bigbadcapers 61674ff
Merge remote-tracking branch 'upstream/master' into user/caperez/v9-f…
bigbadcapers 7f2e8d7
Merge branch 'user/caperez/v9-fit-in-8' into caperez/filetype-icons-f…
bigbadcapers 090ec88
yarn change
bigbadcapers b19ef42
fix(Fluent v9 Storybook and FileTypeIcon.Basic.Example): update filet…
bigbadcapers f3fafdf
fix: update package dependencies and clean up tsconfig files
bigbadcapers cedc96c
storybook build artiface cleanup
bigbadcapers acc722b
testing and CI fixups
bigbadcapers 09ae4eb
fix: improve window handling and type annotations in file type icon f…
bigbadcapers cfb64b7
fix: add path for react-file-type-icons stories in tsconfig
bigbadcapers 1b0d3af
fix: correct indentation in JSDoc parameter comment in webpackFinal f…
bigbadcapers abb6f54
fix: enhance window resolution handling in getFileTypeIconSuffix func…
bigbadcapers 0a121a8
adding line required to properly do liniting in the CI. should this m…
bigbadcapers 1d3e054
trying to solve CI failure: nx run react-file-type-icons-stories:lint
bigbadcapers 829bcbd
fix: add path for react-file-type-icons to package.json workspaces
bigbadcapers d2cae7a
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 3add5b0
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 5171370
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 69c792f
feat: add file type icon stories for default, custom base URL, size a…
bigbadcapers 22206f3
feat(react-file-type-icons): move package under react-components
bigbadcapers 2962441
chore(react-file-type-icons): finish validation fixes
bigbadcapers ad693a8
chore(react-file-type-icons): align story file names
bigbadcapers a3a693e
fix(storybook): support Windows sandbox source generation
bigbadcapers e0d9d4a
fix(react-file-type-icons): avoid JSX runtime in legacy utility builds
bigbadcapers dc528ba
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers eac8cfb
refactor: clean up VSCode settings and remove unused tasks; update St…
bigbadcapers 9ead6de
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 6ed82ba
refactor: simplify import initialization in modifyImportsPlugin
bigbadcapers d598cea
fix: register file type icons without style-utilities
bigbadcapers b07fd74
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers a7e417f
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 279217f
feat(react-file-type-icons): refactor stories to use new file structu…
bigbadcapers acdc7c1
STORY feat(react-file-type-icons): enhance stories with descriptions …
bigbadcapers 6235bda
STORY 2 feat(react-file-type-icons): update story descriptions and or…
bigbadcapers a4c3c20
STORY 3 feat(react-file-type-icons): update story descriptions and na…
bigbadcapers 1ee2f60
STORY 4
bigbadcapers 3baf58d
STORY tidying 5
bigbadcapers a07c04b
story tidied
bigbadcapers d4bf96f
params tidied
bigbadcapers b65c792
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 400ff84
story and PR tweaks
bigbadcapers 49fb607
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers e89d027
API update
bigbadcapers c334994
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 836aaef
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers e326ec5
This branch showed lint problems when merged an unrelated commit, sub…
bigbadcapers f401478
chore: add linter fix configuration for @fluentui/react-headless-comp…
bigbadcapers 7ab7926
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 9aea845
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 4a43cb7
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers aa06bf2
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 7f6692e
Merge branch 'caperez/filetype-icons-for-v9' of https://github.com/bi…
bigbadcapers 8331a7e
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers b428b4c
Merge branch 'caperez/filetype-icons-for-v9' of https://github.com/bi…
bigbadcapers 75f2355
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 21fe266
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers ff795c7
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 0af7858
fix(modifyImports): ensure importMappings is defined with a fallback
bigbadcapers a1133e1
Address PR review feedback for react-file-type-icons v9
bigbadcapers a370fdb
chore: add change file for babel-preset-storybook-full-source
bigbadcapers 52f54bf
chore: revert react-file-type-icons change-type to minor (major is di…
bigbadcapers de3b833
Merge remote-tracking branch 'upstream/master' into caperez/filetype-…
bigbadcapers 24f9427
fix: use globalThis for window reference in getDevicePixelRatioVariant
bigbadcapers 441ae1f
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers 8fe1f29
Merge branch 'master' into caperez/filetype-icons-for-v9
bigbadcapers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/vr-tests-react-components/src/stories/FileTypeIcon/FileTypeIcon.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import * as React from 'react'; | ||
| import type { Meta } from '@storybook/react-webpack5'; | ||
| import { Steps } from 'storywright'; | ||
| import type { StoryParameters } from 'storywright'; | ||
| import { FileIconType, FileTypeIcon } from '@fluentui/react-file-type-icons'; | ||
| import { DARK_MODE, getStoryVariant, HIGH_CONTRAST, TestWrapperDecorator } from '../../utilities'; | ||
|
|
||
| export default { | ||
| title: 'FileTypeIcon', | ||
| component: FileTypeIcon, | ||
| decorators: [TestWrapperDecorator], | ||
| parameters: { | ||
| storyWright: { | ||
| steps: new Steps().snapshot('default', { cropTo: '.testWrapper' }).end(), | ||
| }, | ||
| } satisfies StoryParameters, | ||
| } satisfies Meta<typeof FileTypeIcon>; | ||
|
|
||
| export const Default = () => ( | ||
| <div> | ||
| <FileTypeIcon extension="docx" /> | ||
| <FileTypeIcon extension="xlsx" size={20} /> | ||
| <FileTypeIcon extension="pptx" size={24} /> | ||
| <FileTypeIcon type={FileIconType.folder} size={32} imageFileType="png" /> | ||
| <FileTypeIcon extension="unknown" size={40} /> | ||
| </div> | ||
| ); | ||
| Default.storyName = 'default'; | ||
|
|
||
| export const DefaultHighContrast = getStoryVariant(Default, HIGH_CONTRAST); | ||
|
|
||
| export const DefaultDarkMode = getStoryVariant(Default, DARK_MODE); |
7 changes: 7 additions & 0 deletions
7
...ge/@fluentui-babel-preset-storybook-full-source-443e9121-6ba8-4f1e-a657-36bae8b67e43.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "Minor refactor of modifyImports/fullsource helpers carried on this branch from an earlier dev session; no published runtime changes.", | ||
| "packageName": "@fluentui/babel-preset-storybook-full-source", | ||
| "email": "caperez@microsoft.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-file-type-icons-8ed04cc5-3dd7-452c-a5a2-c18c9ca7638a.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "minor", | ||
| "comment": "Move @fluentui/react-file-type-icons under react-components and ship as 9.0.0 (same npm name, major bump - v8 consumers must opt in). Adds the FileTypeIcon v9 component while preserving the v8 utility surface (initializeFileTypeIcons, getFileTypeIconProps, getFileTypeIconAsHTMLString, getFileTypeIconAsUrl, FileIconType, FileTypeIconMap). Behavior notes: initializeFileTypeIcons now honors its options.disableWarnings flag (warns on duplicate icon registration unless suppressed) but overwrites existing entries rather than skipping them; getFileTypeIconSuffix is SSR-safe and falls back to a 1x device pixel ratio when window is absent instead of throwing; icons are still written to globalThis.__globalSettings__.icons with the same record shape, preserving interop with v8 @fluentui/react <Icon>; src/version.ts is removed (no setVersion call), so the v8 duplicate-package warning will not fire if 8.x and 9.x copies are bundled together.", | ||
| "packageName": "@fluentui/react-file-type-icons", | ||
| "email": "caperez@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-headless-components-preview-782ee96a-e8c3-404e-94c9-923f0faca775.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "This branch showed lint problems when merged an unrelated commit, submitting with linter fix to ensure the GH Actions pass.", | ||
| "packageName": "@fluentui/react-headless-components-preview", | ||
| "email": "caperez@microsoft.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-shared-contexts-filetypeicon-stylehook.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "Add FileTypeIcon custom style hook key", | ||
| "packageName": "@fluentui/react-shared-contexts", | ||
| "email": "caperez@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/react-components/react-file-type-icons/library/.swcrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/swcrc", | ||
| "exclude": [ | ||
| "/testing", | ||
| "/**/*.cy.ts", | ||
| "/**/*.cy.tsx", | ||
| "/**/*.spec.ts", | ||
| "/**/*.spec.tsx", | ||
| "/**/*.test.ts", | ||
| "/**/*.test.tsx" | ||
| ], | ||
| "jsc": { | ||
| "parser": { | ||
| "syntax": "typescript", | ||
| "tsx": true, | ||
| "decorators": false, | ||
| "dynamicImport": false | ||
| }, | ||
| "externalHelpers": true, | ||
| "transform": { | ||
| "react": { | ||
| "runtime": "classic", | ||
| "useSpread": true | ||
| } | ||
| }, | ||
| "target": "es2019" | ||
| }, | ||
| "minify": false, | ||
| "sourceMaps": true | ||
| } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions
51
packages/react-components/react-file-type-icons/library/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # @fluentui/react-file-type-icons | ||
|
|
||
| **File type icons for [Fluent UI React](https://react.fluentui.dev/)** | ||
|
|
||
| This package includes a collection of icons to represent file types. | ||
|
|
||
| ## Getting started | ||
|
|
||
| If you are using the v8 `Icon` component or composing with icon-name utilities, you can make all file type icons available by calling the `initializeFileTypeIcons` function from the `@fluentui/react-file-type-icons` package: | ||
|
|
||
| ```tsx | ||
| import { initializeFileTypeIcons } from '@fluentui/react-file-type-icons'; | ||
|
|
||
| // Register icons and load assets from the default Microsoft Fluent CDN: | ||
| initializeFileTypeIcons(); | ||
|
|
||
| // Or register icons and load assets from a different CDN or folder path: | ||
| initializeFileTypeIcons('https://my.cdn.com/path/to/icons/'); | ||
| ``` | ||
|
|
||
| **NOTE:** Proceed carefully if you override the default CDN location, whose contents may not match the registered file type icons and supported extensions. Do not use the `item-types-fluent` icon set that was previously uploaded to the Fluent CDN; it's deprecated. | ||
|
|
||
| ## Usage in code | ||
|
|
||
| If you are using Fluent UI React, you can use the `Icon` component and pass in the corresponding icon properties to render a given icon. | ||
|
|
||
| ```tsx | ||
| import { Icon } from '@fluentui/react/lib/Icon'; | ||
| import { getFileTypeIconProps } from '@fluentui/react-file-type-icons'; | ||
|
|
||
| <Icon {...getFileTypeIconProps({ extension: 'docx', size: 16 })} />; | ||
| ``` | ||
|
|
||
| ## FileTypeIcon component | ||
|
|
||
| `@fluentui/react-file-type-icons` is a Fluent UI React v9 package under the `react-components` package model. It also keeps the existing utility APIs for scenarios that still compose file icons manually. | ||
|
|
||
| This package also exports a `FileTypeIcon` React component that can be used directly without separately composing icon props or calling `initializeFileTypeIcons`. | ||
|
|
||
| ```tsx | ||
| import { FileTypeIcon, FileIconType } from '@fluentui/react-file-type-icons'; | ||
|
|
||
| <FileTypeIcon extension="docx" size={20} />; | ||
| <FileTypeIcon type={FileIconType.folder} imageFileType="png" size={32} />; | ||
| ``` | ||
|
|
||
| `FileTypeIcon` resolves icons through the same shared extension/type logic as `getFileTypeIconProps` to keep utility and component-based usage in sync. | ||
|
|
||
| ## Notes | ||
|
|
||
| See [GitHub](https://github.com/microsoft/fluentui) for more details on the Fluent UI React project and packages within. |
5 changes: 5 additions & 0 deletions
5
packages/react-components/react-file-type-icons/library/config/api-extractor.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "@fluentui/scripts-api-extractor/api-extractor.common.v-next.json", | ||
| "mainEntryPointFilePath": "<projectRoot>/../../../../../../dist/out-tsc/types/packages/react-components/<unscopedPackageName>/library/src/index.d.ts" | ||
| } |
1 change: 1 addition & 0 deletions
1
packages/react-components/react-file-type-icons/library/config/tests.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /** Jest test setup file. */ |
File renamed without changes.
148 changes: 148 additions & 0 deletions
148
...react-components/react-file-type-icons/library/etc/react-file-type-icons.api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| ## API Report File for "@fluentui/react-file-type-icons" | ||
|
|
||
| > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
|
||
| ```ts | ||
|
|
||
| import type { ComponentProps } from '@fluentui/react-utilities'; | ||
| import type { ComponentState } from '@fluentui/react-utilities'; | ||
| import type { ForwardRefComponent } from '@fluentui/react-utilities'; | ||
| import type { JSXElement } from '@fluentui/react-utilities'; | ||
| import * as React_2 from 'react'; | ||
| import type { Slot } from '@fluentui/react-utilities'; | ||
| import type { SlotClassNames } from '@fluentui/react-utilities'; | ||
|
|
||
| // @public | ||
| export enum FileIconType { | ||
| // (undocumented) | ||
| album = 21,// Start at 1 so it will evaluate as "truthy" | ||
| // (undocumented) | ||
| campaign = 23, | ||
| // (undocumented) | ||
| desktopFolder = 9, | ||
| // (undocumented) | ||
| docset = 1, | ||
| // (undocumented) | ||
| documentsFolder = 10, | ||
| // (undocumented) | ||
| folder = 2, | ||
| // (undocumented) | ||
| form = 14, | ||
| // (undocumented) | ||
| genericFile = 3, | ||
| // (undocumented) | ||
| linkedFolder = 12, | ||
| // (undocumented) | ||
| list = 13, | ||
| // (undocumented) | ||
| listForm = 22, | ||
| // (undocumented) | ||
| listItem = 4, | ||
| // (undocumented) | ||
| loopworkspace = 17, | ||
| // (undocumented) | ||
| multiple = 6, | ||
| // (undocumented) | ||
| news = 8, | ||
| // (undocumented) | ||
| picturesFolder = 11, | ||
| // (undocumented) | ||
| planner = 18, | ||
| // (undocumented) | ||
| playlist = 16, | ||
| // (undocumented) | ||
| portfolio = 20, | ||
| // (undocumented) | ||
| sharedFolder = 5, | ||
| // (undocumented) | ||
| shortcutsdefaultfolder = 24, | ||
| // (undocumented) | ||
| stream = 7, | ||
| // (undocumented) | ||
| sway = 15, | ||
| // (undocumented) | ||
| todoItem = 19 | ||
| } | ||
|
|
||
| // @public | ||
| export const FileTypeIcon: ForwardRefComponent<FileTypeIconProps>; | ||
|
|
||
| // @public (undocumented) | ||
| export const fileTypeIconClassNames: SlotClassNames<FileTypeIconSlots>; | ||
|
|
||
| // @public | ||
| export const FileTypeIconMap: { | ||
| [key: string]: { | ||
| extensions?: string[]; | ||
| types?: FileIconType[]; | ||
| }; | ||
| }; | ||
|
|
||
| // @public (undocumented) | ||
| export type FileTypeIconProps = Omit<ComponentProps<FileTypeIconSlots>, 'src'> & IFileTypeIconOptions & { | ||
| baseUrl?: string; | ||
| }; | ||
|
|
||
| // @public (undocumented) | ||
| export type FileTypeIconSize = 16 | 20 | 24 | 32 | 40 | 48 | 64 | 96; | ||
|
|
||
| // @public (undocumented) | ||
| export type FileTypeIconSlots = { | ||
| root: Slot<'img'>; | ||
| }; | ||
|
|
||
| // @public (undocumented) | ||
| export type FileTypeIconState = ComponentState<FileTypeIconSlots> & Required<Pick<IFileTypeIconOptions, 'size' | 'imageFileType'>> & { | ||
| baseUrl?: string; | ||
| iconName: string; | ||
| src?: string; | ||
| extension?: string; | ||
| type?: IFileTypeIconOptions['type']; | ||
| }; | ||
|
|
||
| // @public | ||
| export function getFileTypeIconAsHTMLString(options: IFileTypeIconOptions, baseUrl?: string): string | undefined; | ||
|
|
||
| // @public | ||
| export function getFileTypeIconAsUrl(options: IFileTypeIconOptions, baseUrl?: string): string | undefined; | ||
|
|
||
| // @public | ||
| export function getFileTypeIconProps(options: IFileTypeIconOptions): { | ||
| iconName: string; | ||
| 'aria-label'?: string; | ||
| }; | ||
|
|
||
| // @public (undocumented) | ||
| export interface IFileTypeIconOptions { | ||
| extension?: string; | ||
| imageFileType?: ImageFileType; | ||
| size?: FileTypeIconSize; | ||
| type?: FileIconTypeInput; | ||
| } | ||
|
|
||
| // @public (undocumented) | ||
| export interface IIconOptions { | ||
| // (undocumented) | ||
| disableWarnings: boolean; | ||
| // (undocumented) | ||
| warnOnMissingIcons?: boolean; | ||
| } | ||
|
|
||
| // @public (undocumented) | ||
| export type ImageFileType = 'svg' | 'png'; | ||
|
|
||
| // @public (undocumented) | ||
| export function initializeFileTypeIcons(baseUrl?: string, options?: Partial<IIconOptions>): void; | ||
|
|
||
| // @public | ||
| export const renderFileTypeIcon_unstable: (state: FileTypeIconState) => JSXElement; | ||
|
|
||
| // @public | ||
| export const useFileTypeIcon_unstable: (props: FileTypeIconProps, ref: React_2.Ref<HTMLImageElement>) => FileTypeIconState; | ||
|
|
||
| // @public (undocumented) | ||
| export const useFileTypeIconStyles_unstable: (state: FileTypeIconState) => FileTypeIconState; | ||
|
|
||
| // (No @packageDocumentation comment for this package) | ||
|
|
||
| ``` |
25 changes: 25 additions & 0 deletions
25
packages/react-components/react-file-type-icons/library/jest.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // @ts-check | ||
| /* eslint-disable */ | ||
|
|
||
| const { readFileSync } = require('node:fs'); | ||
| const { join } = require('node:path'); | ||
|
|
||
| const { exclude: _, ...swcJestConfig } = JSON.parse(readFileSync(join(__dirname, '.swcrc'), 'utf-8')); | ||
|
|
||
| if (swcJestConfig.swcrc === undefined) { | ||
| swcJestConfig.swcrc = false; | ||
| } | ||
|
|
||
| /** | ||
| * @type {import('@jest/types').Config.InitialOptions} | ||
| */ | ||
| module.exports = { | ||
| displayName: 'react-file-type-icons', | ||
| preset: '../../../../jest.preset.js', | ||
| transform: { | ||
| '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], | ||
| }, | ||
| coverageDirectory: './coverage', | ||
| setupFilesAfterEnv: ['./config/tests.js'], | ||
| snapshotSerializers: ['@griffel/jest-serializer'], | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/CalendarCompat 4 screenshots
vr-tests-react-components/FileTypeIcon 3 screenshots
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
vr-tests-react-components/Positioning 2 screenshots
vr-tests-react-components/ProgressBar converged 2 screenshots
vr-tests-react-components/TagPicker 2 screenshots
vr-tests-web-components/Badge 1 screenshots
vr-tests-web-components/RadioGroup 1 screenshots
vr-tests/Callout 3 screenshots
vr-tests/Coachmark 1 screenshots
vr-tests/react-charting-VerticalBarChart 1 screenshots
There were 6 duplicate changes discarded. Check the build logs for more information.