@fluentui/react-icons-compat 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,31 @@
1
1
  # Change Log - @fluentui/react-icons-compat
2
2
 
3
- This log was last generated on Mon, 16 Dec 2024 16:22:08 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 22 Jan 2025 13:55:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.1.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-icons-compat_v0.1.8)
8
+
9
+ Wed, 22 Jan 2025 13:55:28 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-icons-compat_v0.1.7..@fluentui/react-icons-compat_v0.1.8)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-jsx-runtime to v9.0.50 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
15
+ - Bump @fluentui/react-utilities to v9.18.20 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
16
+
17
+ ## [0.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-icons-compat_v0.1.7)
18
+
19
+ Wed, 08 Jan 2025 18:33:36 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-icons-compat_v0.1.6..@fluentui/react-icons-compat_v0.1.7)
21
+
22
+ ### Patches
23
+
24
+ - Bump @fluentui/react-jsx-runtime to v9.0.49 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
25
+
7
26
  ## [0.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-icons-compat_v0.1.6)
8
27
 
9
- Mon, 16 Dec 2024 16:22:08 GMT
28
+ Mon, 16 Dec 2024 16:26:49 GMT
10
29
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-icons-compat_v0.1.5..@fluentui/react-icons-compat_v0.1.6)
11
30
 
12
31
  ### Patches
package/lib/icon.js CHANGED
@@ -101,7 +101,7 @@ const _iconSettings = GlobalSettings.getValue(ICON_SETTING_NAME, {
101
101
  }
102
102
  }
103
103
  } else {
104
- // eslint-disable-next-line deprecation/deprecation
104
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
105
105
  if (!options.disableWarnings && options.warnOnMissingIcons) {
106
106
  // eslint-disable-next-line no-console
107
107
  console.warn(`The icon "${name}" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`);
package/lib/icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/icon.ts"],"sourcesContent":["import * as React from 'react';\nimport { GlobalSettings } from './GlobalSettings';\n\nexport type T = React.ReactNode;\n\nexport interface IconSubset {\n icons: {\n [key: string]: string | JSX.Element;\n };\n /**\n * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element\n * onto the child content element registered for the icon which are valid for HTML images.\n */\n mergeImageProps?: boolean;\n}\n\nexport interface IconSubsetRecord extends IconSubset {\n isRegistered?: boolean;\n className?: string;\n}\n\nexport interface IconRecord {\n code: string | undefined;\n subset: IconSubsetRecord;\n}\n\nexport interface IconOptions {\n /**\n * By default, registering the same set of icons will generate a console warning per duplicate icon\n * registered, because this scenario can create unexpected consequences.\n *\n * Some scenarios include:\n *\n * Icon set was previously registered using a different base url.\n * Icon set was previously registered but a different version was provided.\n * Icons in a previous registered set overlap with a new set.\n *\n * To simply ignore previously registered icons, you can specify to disable warnings. This means\n * that if an icon which was previous registered is registered again, it will be silently ignored.\n * However, consider whether the problems listed above will cause issues.\n **/\n disableWarnings: boolean;\n\n /**\n * @deprecated Use `disableWarnings` instead.\n */\n warnOnMissingIcons?: boolean;\n}\n\nexport interface IconRecords {\n __options: IconOptions;\n __remapped: { [key: string]: string };\n [key: string]: IconRecord | {};\n}\n\nconst ICON_SETTING_NAME = 'icons';\n\nconst _iconSettings = GlobalSettings.getValue<IconRecords>(ICON_SETTING_NAME, {\n __options: {\n disableWarnings: false,\n warnOnMissingIcons: true,\n },\n __remapped: {},\n});\n\n/**\n * Normalizes an icon name for consistent mapping.\n * Current implementation is to convert the icon name to lower case.\n *\n * @param name - Icon name to normalize.\n * @returns {string} Normalized icon name to use for indexing and mapping.\n */\nconst normalizeIconName = (name: string): string => name.toLowerCase();\n\n/**\n * Registers a given subset of icons.\n *\n * @param iconSubset - the icon subset definition.\n */\nexport function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void {\n const subset = {\n ...iconSubset,\n isRegistered: false,\n className: undefined,\n };\n const { icons } = iconSubset;\n\n // Grab options, optionally mix user provided ones on top.\n options = options ? { ..._iconSettings.__options, ...options } : _iconSettings.__options;\n\n for (const iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n const code = icons[iconName];\n const normalizedIconName = normalizeIconName(iconName);\n\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n } else {\n _iconSettings[normalizedIconName] = {\n code,\n subset,\n } as IconRecord;\n }\n }\n }\n}\n\n/**\n * Unregisters icons by name.\n *\n * @param iconNames - List of icons to unregister.\n */\nexport function unregisterIcons(iconNames: string[]): void {\n const options = _iconSettings.__options;\n\n for (const iconName of iconNames) {\n const normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n delete _iconSettings[normalizedIconName];\n } else {\n // Warn that we are trying to delete an icon that doesn't exist\n if (!options.disableWarnings) {\n // eslint-disable-next-line no-console\n console.warn(`The icon \"${iconName}\" tried to unregister but was not registered.`);\n }\n }\n\n // Delete any aliases for this iconName\n if (_iconSettings.__remapped[normalizedIconName]) {\n delete _iconSettings.__remapped[normalizedIconName];\n }\n\n // Delete any items that were an alias for this iconName\n Object.keys(_iconSettings.__remapped).forEach((key: string) => {\n if (_iconSettings.__remapped[key] === normalizedIconName) {\n delete _iconSettings.__remapped[key];\n }\n });\n }\n}\n\n/**\n * Remaps one icon name to another.\n */\nexport function registerIconAlias(iconName: string, mappedToName: string): void {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}\n\n/**\n * Gets an icon definition. If an icon is requested but the subset has yet to be registered,\n * it will get registered immediately.\n *\n * @public\n * @param name - Name of icon.\n */\nexport function getIcon(name?: string): IconRecord | undefined {\n let icon: IconRecord | undefined = undefined;\n const options = _iconSettings.__options;\n\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n\n if (name) {\n icon = _iconSettings[name!] as IconRecord;\n\n if (icon) {\n const { subset } = icon;\n if (subset) {\n if (!subset.isRegistered) {\n subset.isRegistered = true;\n }\n }\n } else {\n // eslint-disable-next-line deprecation/deprecation\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n // eslint-disable-next-line no-console\n console.warn(\n `The icon \"${name}\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`,\n );\n }\n }\n }\n\n return icon;\n}\n\n/**\n * Sets the icon options.\n *\n * @public\n */\nexport function setIconOptions(options: Partial<IconOptions>): void {\n _iconSettings.__options = {\n ..._iconSettings.__options,\n ...options,\n };\n}\n\nlet _missingIcons: string[] = [];\n// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\nlet _missingIconsTimer: ReturnType<typeof setTimeout> | undefined = undefined;\n\nfunction _warnDuplicateIcon(iconName: string): void {\n const options = _iconSettings.__options;\n const warningDelay = 2000;\n const maxIconsInMessage = 10;\n\n if (!options.disableWarnings) {\n _missingIcons.push(iconName);\n if (_missingIconsTimer === undefined) {\n _missingIconsTimer =\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Some icons were re-registered. Applications should only call registerIcons for any given ` +\n `icon once. Redefining what an icon is may have unintended consequences. Duplicates ` +\n `include: \\n` +\n _missingIcons.slice(0, maxIconsInMessage).join(', ') +\n (_missingIcons.length > maxIconsInMessage ? ` (+ ${_missingIcons.length - maxIconsInMessage} more)` : ''),\n );\n _missingIconsTimer = undefined;\n _missingIcons = [];\n }, warningDelay);\n }\n }\n}\n"],"names":["React","GlobalSettings","ICON_SETTING_NAME","_iconSettings","getValue","__options","disableWarnings","warnOnMissingIcons","__remapped","normalizeIconName","name","toLowerCase","registerIcons","iconSubset","options","subset","isRegistered","className","undefined","icons","iconName","hasOwnProperty","code","normalizedIconName","_warnDuplicateIcon","unregisterIcons","iconNames","console","warn","Object","keys","forEach","key","registerIconAlias","mappedToName","getIcon","icon","setIconOptions","_missingIcons","_missingIconsTimer","warningDelay","maxIconsInMessage","push","setTimeout","slice","join","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,QAAQ,mBAAmB;AAsDlD,MAAMC,oBAAoB;AAE1B,MAAMC,gBAAgBF,eAAeG,QAAQ,CAAcF,mBAAmB;IAC5EG,WAAW;QACTC,iBAAiB;QACjBC,oBAAoB;IACtB;IACAC,YAAY,CAAC;AACf;AAEA;;;;;;CAMC,GACD,MAAMC,oBAAoB,CAACC,OAAyBA,KAAKC,WAAW;AAEpE;;;;CAIC,GACD,OAAO,SAASC,cAAcC,UAAsB,EAAEC,OAA8B;IAClF,MAAMC,SAAS;QACb,GAAGF,UAAU;QACbG,cAAc;QACdC,WAAWC;IACb;IACA,MAAM,EAAEC,KAAK,EAAE,GAAGN;IAElB,0DAA0D;IAC1DC,UAAUA,UAAU;QAAE,GAAGX,cAAcE,SAAS;QAAE,GAAGS,OAAO;IAAC,IAAIX,cAAcE,SAAS;IAExF,IAAK,MAAMe,YAAYD,MAAO;QAC5B,IAAIA,MAAME,cAAc,CAACD,WAAW;YAClC,MAAME,OAAOH,KAAK,CAACC,SAAS;YAC5B,MAAMG,qBAAqBd,kBA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import { GlobalSettings } from './GlobalSettings';\n\nexport type T = React.ReactNode;\n\nexport interface IconSubset {\n icons: {\n [key: string]: string | JSX.Element;\n };\n /**\n * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element\n * onto the child content element registered for the icon which are valid for HTML images.\n */\n mergeImageProps?: boolean;\n}\n\nexport interface IconSubsetRecord extends IconSubset {\n isRegistered?: boolean;\n className?: string;\n}\n\nexport interface IconRecord {\n code: string | undefined;\n subset: IconSubsetRecord;\n}\n\nexport interface IconOptions {\n /**\n * By default, registering the same set of icons will generate a console warning per duplicate icon\n * registered, because this scenario can create unexpected consequences.\n *\n * Some scenarios include:\n *\n * Icon set was previously registered using a different base url.\n * Icon set was previously registered but a different version was provided.\n * Icons in a previous registered set overlap with a new set.\n *\n * To simply ignore previously registered icons, you can specify to disable warnings. This means\n * that if an icon which was previous registered is registered again, it will be silently ignored.\n * However, consider whether the problems listed above will cause issues.\n **/\n disableWarnings: boolean;\n\n /**\n * @deprecated Use `disableWarnings` instead.\n */\n warnOnMissingIcons?: boolean;\n}\n\nexport interface IconRecords {\n __options: IconOptions;\n __remapped: { [key: string]: string };\n [key: string]: IconRecord | {};\n}\n\nconst ICON_SETTING_NAME = 'icons';\n\nconst _iconSettings = GlobalSettings.getValue<IconRecords>(ICON_SETTING_NAME, {\n __options: {\n disableWarnings: false,\n warnOnMissingIcons: true,\n },\n __remapped: {},\n});\n\n/**\n * Normalizes an icon name for consistent mapping.\n * Current implementation is to convert the icon name to lower case.\n *\n * @param name - Icon name to normalize.\n * @returns {string} Normalized icon name to use for indexing and mapping.\n */\nconst normalizeIconName = (name: string): string => name.toLowerCase();\n\n/**\n * Registers a given subset of icons.\n *\n * @param iconSubset - the icon subset definition.\n */\nexport function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void {\n const subset = {\n ...iconSubset,\n isRegistered: false,\n className: undefined,\n };\n const { icons } = iconSubset;\n\n // Grab options, optionally mix user provided ones on top.\n options = options ? { ..._iconSettings.__options, ...options } : _iconSettings.__options;\n\n for (const iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n const code = icons[iconName];\n const normalizedIconName = normalizeIconName(iconName);\n\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n } else {\n _iconSettings[normalizedIconName] = {\n code,\n subset,\n } as IconRecord;\n }\n }\n }\n}\n\n/**\n * Unregisters icons by name.\n *\n * @param iconNames - List of icons to unregister.\n */\nexport function unregisterIcons(iconNames: string[]): void {\n const options = _iconSettings.__options;\n\n for (const iconName of iconNames) {\n const normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n delete _iconSettings[normalizedIconName];\n } else {\n // Warn that we are trying to delete an icon that doesn't exist\n if (!options.disableWarnings) {\n // eslint-disable-next-line no-console\n console.warn(`The icon \"${iconName}\" tried to unregister but was not registered.`);\n }\n }\n\n // Delete any aliases for this iconName\n if (_iconSettings.__remapped[normalizedIconName]) {\n delete _iconSettings.__remapped[normalizedIconName];\n }\n\n // Delete any items that were an alias for this iconName\n Object.keys(_iconSettings.__remapped).forEach((key: string) => {\n if (_iconSettings.__remapped[key] === normalizedIconName) {\n delete _iconSettings.__remapped[key];\n }\n });\n }\n}\n\n/**\n * Remaps one icon name to another.\n */\nexport function registerIconAlias(iconName: string, mappedToName: string): void {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}\n\n/**\n * Gets an icon definition. If an icon is requested but the subset has yet to be registered,\n * it will get registered immediately.\n *\n * @public\n * @param name - Name of icon.\n */\nexport function getIcon(name?: string): IconRecord | undefined {\n let icon: IconRecord | undefined = undefined;\n const options = _iconSettings.__options;\n\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n\n if (name) {\n icon = _iconSettings[name!] as IconRecord;\n\n if (icon) {\n const { subset } = icon;\n if (subset) {\n if (!subset.isRegistered) {\n subset.isRegistered = true;\n }\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n // eslint-disable-next-line no-console\n console.warn(\n `The icon \"${name}\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`,\n );\n }\n }\n }\n\n return icon;\n}\n\n/**\n * Sets the icon options.\n *\n * @public\n */\nexport function setIconOptions(options: Partial<IconOptions>): void {\n _iconSettings.__options = {\n ..._iconSettings.__options,\n ...options,\n };\n}\n\nlet _missingIcons: string[] = [];\n// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\nlet _missingIconsTimer: ReturnType<typeof setTimeout> | undefined = undefined;\n\nfunction _warnDuplicateIcon(iconName: string): void {\n const options = _iconSettings.__options;\n const warningDelay = 2000;\n const maxIconsInMessage = 10;\n\n if (!options.disableWarnings) {\n _missingIcons.push(iconName);\n if (_missingIconsTimer === undefined) {\n _missingIconsTimer =\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Some icons were re-registered. Applications should only call registerIcons for any given ` +\n `icon once. Redefining what an icon is may have unintended consequences. Duplicates ` +\n `include: \\n` +\n _missingIcons.slice(0, maxIconsInMessage).join(', ') +\n (_missingIcons.length > maxIconsInMessage ? ` (+ ${_missingIcons.length - maxIconsInMessage} more)` : ''),\n );\n _missingIconsTimer = undefined;\n _missingIcons = [];\n }, warningDelay);\n }\n }\n}\n"],"names":["React","GlobalSettings","ICON_SETTING_NAME","_iconSettings","getValue","__options","disableWarnings","warnOnMissingIcons","__remapped","normalizeIconName","name","toLowerCase","registerIcons","iconSubset","options","subset","isRegistered","className","undefined","icons","iconName","hasOwnProperty","code","normalizedIconName","_warnDuplicateIcon","unregisterIcons","iconNames","console","warn","Object","keys","forEach","key","registerIconAlias","mappedToName","getIcon","icon","setIconOptions","_missingIcons","_missingIconsTimer","warningDelay","maxIconsInMessage","push","setTimeout","slice","join","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AevB,OAA6B;IAC1DX,cAAcE,SAAS,GAAG;QACxB,GAAGF,cAAcE,SAAS;QAC1B,GAAGS,OAAO;IACZ;AACF;AAEA,IAAIwB,gBAA0B,EAAE;AAChC,8FAA8F;AAC9F,IAAIC,qBAAgErB;AAEpE,SAASM,mBAAmBJ,QAAgB;IAC1C,MAAMN,UAAUX,cAAcE,SAAS;IACvC,MAAMmC,eAAe;IACrB,MAAMC,oBAAoB;IAE1B,IAAI,CAAC3B,QAAQR,eAAe,EAAE;QAC5BgC,cAAcI,IAAI,CAACtB;QACnB,IAAImB,uBAAuBrB,WAAW;YACpCqB,qBACE,+DAA+D;YAC/DI,WAAW;gBACT,sCAAsC;gBACtChB,QAAQC,IAAI,CACV,CAAC,yFAAyF,CAAC,GACzF,CAAC,mFAAmF,CAAC,GACrF,CAAC,WAAW,CAAC,GACbU,cAAcM,KAAK,CAAC,GAAGH,mBAAmBI,IAAI,CAAC,QAC9CP,CAAAA,cAAcQ,MAAM,GAAGL,oBAAoB,CAAC,IAAI,EAAEH,cAAcQ,MAAM,GAAGL,kBAAkB,MAAM,CAAC,GAAG,EAAC;gBAE3GF,qBAAqBrB;gBACrBoB,gBAAgB,EAAE;YACpB,GAAGE;QACP;IACF;AACF"}
@@ -113,7 +113,7 @@ function getIcon(name) {
113
113
  }
114
114
  }
115
115
  } else {
116
- // eslint-disable-next-line deprecation/deprecation
116
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
117
117
  if (!options.disableWarnings && options.warnOnMissingIcons) {
118
118
  // eslint-disable-next-line no-console
119
119
  console.warn(`The icon "${name}" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/icon.ts"],"sourcesContent":["import * as React from 'react';\nimport { GlobalSettings } from './GlobalSettings';\n\nexport type T = React.ReactNode;\n\nexport interface IconSubset {\n icons: {\n [key: string]: string | JSX.Element;\n };\n /**\n * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element\n * onto the child content element registered for the icon which are valid for HTML images.\n */\n mergeImageProps?: boolean;\n}\n\nexport interface IconSubsetRecord extends IconSubset {\n isRegistered?: boolean;\n className?: string;\n}\n\nexport interface IconRecord {\n code: string | undefined;\n subset: IconSubsetRecord;\n}\n\nexport interface IconOptions {\n /**\n * By default, registering the same set of icons will generate a console warning per duplicate icon\n * registered, because this scenario can create unexpected consequences.\n *\n * Some scenarios include:\n *\n * Icon set was previously registered using a different base url.\n * Icon set was previously registered but a different version was provided.\n * Icons in a previous registered set overlap with a new set.\n *\n * To simply ignore previously registered icons, you can specify to disable warnings. This means\n * that if an icon which was previous registered is registered again, it will be silently ignored.\n * However, consider whether the problems listed above will cause issues.\n **/\n disableWarnings: boolean;\n\n /**\n * @deprecated Use `disableWarnings` instead.\n */\n warnOnMissingIcons?: boolean;\n}\n\nexport interface IconRecords {\n __options: IconOptions;\n __remapped: { [key: string]: string };\n [key: string]: IconRecord | {};\n}\n\nconst ICON_SETTING_NAME = 'icons';\n\nconst _iconSettings = GlobalSettings.getValue<IconRecords>(ICON_SETTING_NAME, {\n __options: {\n disableWarnings: false,\n warnOnMissingIcons: true,\n },\n __remapped: {},\n});\n\n/**\n * Normalizes an icon name for consistent mapping.\n * Current implementation is to convert the icon name to lower case.\n *\n * @param name - Icon name to normalize.\n * @returns {string} Normalized icon name to use for indexing and mapping.\n */\nconst normalizeIconName = (name: string): string => name.toLowerCase();\n\n/**\n * Registers a given subset of icons.\n *\n * @param iconSubset - the icon subset definition.\n */\nexport function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void {\n const subset = {\n ...iconSubset,\n isRegistered: false,\n className: undefined,\n };\n const { icons } = iconSubset;\n\n // Grab options, optionally mix user provided ones on top.\n options = options ? { ..._iconSettings.__options, ...options } : _iconSettings.__options;\n\n for (const iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n const code = icons[iconName];\n const normalizedIconName = normalizeIconName(iconName);\n\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n } else {\n _iconSettings[normalizedIconName] = {\n code,\n subset,\n } as IconRecord;\n }\n }\n }\n}\n\n/**\n * Unregisters icons by name.\n *\n * @param iconNames - List of icons to unregister.\n */\nexport function unregisterIcons(iconNames: string[]): void {\n const options = _iconSettings.__options;\n\n for (const iconName of iconNames) {\n const normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n delete _iconSettings[normalizedIconName];\n } else {\n // Warn that we are trying to delete an icon that doesn't exist\n if (!options.disableWarnings) {\n // eslint-disable-next-line no-console\n console.warn(`The icon \"${iconName}\" tried to unregister but was not registered.`);\n }\n }\n\n // Delete any aliases for this iconName\n if (_iconSettings.__remapped[normalizedIconName]) {\n delete _iconSettings.__remapped[normalizedIconName];\n }\n\n // Delete any items that were an alias for this iconName\n Object.keys(_iconSettings.__remapped).forEach((key: string) => {\n if (_iconSettings.__remapped[key] === normalizedIconName) {\n delete _iconSettings.__remapped[key];\n }\n });\n }\n}\n\n/**\n * Remaps one icon name to another.\n */\nexport function registerIconAlias(iconName: string, mappedToName: string): void {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}\n\n/**\n * Gets an icon definition. If an icon is requested but the subset has yet to be registered,\n * it will get registered immediately.\n *\n * @public\n * @param name - Name of icon.\n */\nexport function getIcon(name?: string): IconRecord | undefined {\n let icon: IconRecord | undefined = undefined;\n const options = _iconSettings.__options;\n\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n\n if (name) {\n icon = _iconSettings[name!] as IconRecord;\n\n if (icon) {\n const { subset } = icon;\n if (subset) {\n if (!subset.isRegistered) {\n subset.isRegistered = true;\n }\n }\n } else {\n // eslint-disable-next-line deprecation/deprecation\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n // eslint-disable-next-line no-console\n console.warn(\n `The icon \"${name}\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`,\n );\n }\n }\n }\n\n return icon;\n}\n\n/**\n * Sets the icon options.\n *\n * @public\n */\nexport function setIconOptions(options: Partial<IconOptions>): void {\n _iconSettings.__options = {\n ..._iconSettings.__options,\n ...options,\n };\n}\n\nlet _missingIcons: string[] = [];\n// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\nlet _missingIconsTimer: ReturnType<typeof setTimeout> | undefined = undefined;\n\nfunction _warnDuplicateIcon(iconName: string): void {\n const options = _iconSettings.__options;\n const warningDelay = 2000;\n const maxIconsInMessage = 10;\n\n if (!options.disableWarnings) {\n _missingIcons.push(iconName);\n if (_missingIconsTimer === undefined) {\n _missingIconsTimer =\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Some icons were re-registered. Applications should only call registerIcons for any given ` +\n `icon once. Redefining what an icon is may have unintended consequences. Duplicates ` +\n `include: \\n` +\n _missingIcons.slice(0, maxIconsInMessage).join(', ') +\n (_missingIcons.length > maxIconsInMessage ? ` (+ ${_missingIcons.length - maxIconsInMessage} more)` : ''),\n );\n _missingIconsTimer = undefined;\n _missingIcons = [];\n }, warningDelay);\n }\n }\n}\n"],"names":["getIcon","registerIconAlias","registerIcons","setIconOptions","unregisterIcons","ICON_SETTING_NAME","_iconSettings","GlobalSettings","getValue","__options","disableWarnings","warnOnMissingIcons","__remapped","normalizeIconName","name","toLowerCase","iconSubset","options","subset","isRegistered","className","undefined","icons","iconName","hasOwnProperty","code","normalizedIconName","_warnDuplicateIcon","iconNames","console","warn","Object","keys","forEach","key","mappedToName","icon","_missingIcons","_missingIconsTimer","warningDelay","maxIconsInMessage","push","setTimeout","slice","join","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;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F;AAC9F,IAAIC,qBAAgEjB;AAEpE,SAASM,mBAAmBJ,QAAgB;IAC1C,MAAMN,UAAUX,cAAcG,SAAS;IACvC,MAAM8B,eAAe;IACrB,MAAMC,oBAAoB;IAE1B,IAAI,CAACvB,QAAQP,eAAe,EAAE;QAC5B2B,cAAcI,IAAI,CAAClB;QACnB,IAAIe,uBAAuBjB,WAAW;YACpCiB,qBACE,+DAA+D;YAC/DI,WAAW;gBACT,sCAAsC;gBACtCb,QAAQC,IAAI,CACV,CAAC,yFAAyF,CAAC,GACzF,CAAC,mFAAmF,CAAC,GACrF,CAAC,WAAW,CAAC,GACbO,cAAcM,KAAK,CAAC,GAAGH,mBAAmBI,IAAI,CAAC,QAC9CP,CAAAA,cAAcQ,MAAM,GAAGL,oBAAoB,CAAC,IAAI,EAAEH,cAAcQ,MAAM,GAAGL,kBAAkB,MAAM,CAAC,GAAG,EAAC;gBAE3GF,qBAAqBjB;gBACrBgB,gBAAgB,EAAE;YACpB,GAAGE;QACP;IACF;AACF"}
1
+ {"version":3,"sources":["../src/icon.ts"],"sourcesContent":["import * as React from 'react';\nimport { GlobalSettings } from './GlobalSettings';\n\nexport type T = React.ReactNode;\n\nexport interface IconSubset {\n icons: {\n [key: string]: string | JSX.Element;\n };\n /**\n * Indicates to the icon renderer that it is safe to merge any props on the original `Icon` element\n * onto the child content element registered for the icon which are valid for HTML images.\n */\n mergeImageProps?: boolean;\n}\n\nexport interface IconSubsetRecord extends IconSubset {\n isRegistered?: boolean;\n className?: string;\n}\n\nexport interface IconRecord {\n code: string | undefined;\n subset: IconSubsetRecord;\n}\n\nexport interface IconOptions {\n /**\n * By default, registering the same set of icons will generate a console warning per duplicate icon\n * registered, because this scenario can create unexpected consequences.\n *\n * Some scenarios include:\n *\n * Icon set was previously registered using a different base url.\n * Icon set was previously registered but a different version was provided.\n * Icons in a previous registered set overlap with a new set.\n *\n * To simply ignore previously registered icons, you can specify to disable warnings. This means\n * that if an icon which was previous registered is registered again, it will be silently ignored.\n * However, consider whether the problems listed above will cause issues.\n **/\n disableWarnings: boolean;\n\n /**\n * @deprecated Use `disableWarnings` instead.\n */\n warnOnMissingIcons?: boolean;\n}\n\nexport interface IconRecords {\n __options: IconOptions;\n __remapped: { [key: string]: string };\n [key: string]: IconRecord | {};\n}\n\nconst ICON_SETTING_NAME = 'icons';\n\nconst _iconSettings = GlobalSettings.getValue<IconRecords>(ICON_SETTING_NAME, {\n __options: {\n disableWarnings: false,\n warnOnMissingIcons: true,\n },\n __remapped: {},\n});\n\n/**\n * Normalizes an icon name for consistent mapping.\n * Current implementation is to convert the icon name to lower case.\n *\n * @param name - Icon name to normalize.\n * @returns {string} Normalized icon name to use for indexing and mapping.\n */\nconst normalizeIconName = (name: string): string => name.toLowerCase();\n\n/**\n * Registers a given subset of icons.\n *\n * @param iconSubset - the icon subset definition.\n */\nexport function registerIcons(iconSubset: IconSubset, options?: Partial<IconOptions>): void {\n const subset = {\n ...iconSubset,\n isRegistered: false,\n className: undefined,\n };\n const { icons } = iconSubset;\n\n // Grab options, optionally mix user provided ones on top.\n options = options ? { ..._iconSettings.__options, ...options } : _iconSettings.__options;\n\n for (const iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n const code = icons[iconName];\n const normalizedIconName = normalizeIconName(iconName);\n\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n } else {\n _iconSettings[normalizedIconName] = {\n code,\n subset,\n } as IconRecord;\n }\n }\n }\n}\n\n/**\n * Unregisters icons by name.\n *\n * @param iconNames - List of icons to unregister.\n */\nexport function unregisterIcons(iconNames: string[]): void {\n const options = _iconSettings.__options;\n\n for (const iconName of iconNames) {\n const normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n delete _iconSettings[normalizedIconName];\n } else {\n // Warn that we are trying to delete an icon that doesn't exist\n if (!options.disableWarnings) {\n // eslint-disable-next-line no-console\n console.warn(`The icon \"${iconName}\" tried to unregister but was not registered.`);\n }\n }\n\n // Delete any aliases for this iconName\n if (_iconSettings.__remapped[normalizedIconName]) {\n delete _iconSettings.__remapped[normalizedIconName];\n }\n\n // Delete any items that were an alias for this iconName\n Object.keys(_iconSettings.__remapped).forEach((key: string) => {\n if (_iconSettings.__remapped[key] === normalizedIconName) {\n delete _iconSettings.__remapped[key];\n }\n });\n }\n}\n\n/**\n * Remaps one icon name to another.\n */\nexport function registerIconAlias(iconName: string, mappedToName: string): void {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}\n\n/**\n * Gets an icon definition. If an icon is requested but the subset has yet to be registered,\n * it will get registered immediately.\n *\n * @public\n * @param name - Name of icon.\n */\nexport function getIcon(name?: string): IconRecord | undefined {\n let icon: IconRecord | undefined = undefined;\n const options = _iconSettings.__options;\n\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n\n if (name) {\n icon = _iconSettings[name!] as IconRecord;\n\n if (icon) {\n const { subset } = icon;\n if (subset) {\n if (!subset.isRegistered) {\n subset.isRegistered = true;\n }\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n // eslint-disable-next-line no-console\n console.warn(\n `The icon \"${name}\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.`,\n );\n }\n }\n }\n\n return icon;\n}\n\n/**\n * Sets the icon options.\n *\n * @public\n */\nexport function setIconOptions(options: Partial<IconOptions>): void {\n _iconSettings.__options = {\n ..._iconSettings.__options,\n ...options,\n };\n}\n\nlet _missingIcons: string[] = [];\n// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\nlet _missingIconsTimer: ReturnType<typeof setTimeout> | undefined = undefined;\n\nfunction _warnDuplicateIcon(iconName: string): void {\n const options = _iconSettings.__options;\n const warningDelay = 2000;\n const maxIconsInMessage = 10;\n\n if (!options.disableWarnings) {\n _missingIcons.push(iconName);\n if (_missingIconsTimer === undefined) {\n _missingIconsTimer =\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `Some icons were re-registered. Applications should only call registerIcons for any given ` +\n `icon once. Redefining what an icon is may have unintended consequences. Duplicates ` +\n `include: \\n` +\n _missingIcons.slice(0, maxIconsInMessage).join(', ') +\n (_missingIcons.length > maxIconsInMessage ? ` (+ ${_missingIcons.length - maxIconsInMessage} more)` : ''),\n );\n _missingIconsTimer = undefined;\n _missingIcons = [];\n }, warningDelay);\n }\n }\n}\n"],"names":["getIcon","registerIconAlias","registerIcons","setIconOptions","unregisterIcons","ICON_SETTING_NAME","_iconSettings","GlobalSettings","getValue","__options","disableWarnings","warnOnMissingIcons","__remapped","normalizeIconName","name","toLowerCase","iconSubset","options","subset","isRegistered","className","undefined","icons","iconName","hasOwnProperty","code","normalizedIconName","_warnDuplicateIcon","iconNames","console","warn","Object","keys","forEach","key","mappedToName","icon","_missingIcons","_missingIconsTimer","warningDelay","maxIconsInMessage","push","setTimeout","slice","join","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA2JgBA,OAAO;eAAPA;;IAXAC,iBAAiB;eAAjBA;;IAjEAC,aAAa;eAAbA;;IAgHAC,cAAc;eAAdA;;IA/EAC,eAAe;eAAfA;;;;iEAhHO;gCACQ;AAsD/B,MAAMC,oBAAoB;AAE1B,MAAMC,gBAAgBC,8BAAc,CAACC,QAAQ,CAAcH,mBAAmB;IAC5EI,WAAW;QACTC,iBAAiB;QACjBC,oBAAoB;IACtB;IACAC,YAAY,CAAC;AACf;AAEA;;;;;;CAMC,GACD,MAAMC,oBAAoB,CAACC,OAAyBA,KAAKC,WAAW;AAO7D,SAASb,cAAcc,UAAsB,EAAE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K,CAAC,GAAGH,mBAAmBI,IAAI,CAAC,QAC9CP,CAAAA,cAAcQ,MAAM,GAAGL,oBAAoB,CAAC,IAAI,EAAEH,cAAcQ,MAAM,GAAGL,kBAAkB,MAAM,CAAC,GAAG,EAAC;gBAE3GF,qBAAqBjB;gBACrBgB,gBAAgB,EAAE;YACpB,GAAGE;QACP;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-icons-compat",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Package for icon utility methods used by font and svg icons.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -24,10 +24,10 @@
24
24
  "@fluentui/scripts-api-extractor": "*"
25
25
  },
26
26
  "dependencies": {
27
- "@fluentui/react-jsx-runtime": "^9.0.48",
27
+ "@fluentui/react-jsx-runtime": "^9.0.50",
28
28
  "@fluentui/react-shared-contexts": "^9.21.2",
29
29
  "@fluentui/react-theme": "^9.1.24",
30
- "@fluentui/react-utilities": "^9.18.19",
30
+ "@fluentui/react-utilities": "^9.18.20",
31
31
  "@griffel/react": "^1.5.22",
32
32
  "@swc/helpers": "^0.5.1"
33
33
  },