@esri/calcite-ui-icons 3.29.1-next.0 → 3.29.2
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/.github/workflows/npm-release.yml +20 -0
- package/CONTRIBUTE.md +29 -0
- package/LICENSE.md +5 -4
- package/README.md +41 -36
- package/bin/build.js +24 -0
- package/bin/cli.js +6 -0
- package/bin/convert-mobile.js +218 -0
- package/bin/optimize.js +68 -0
- package/bin/path-data.js +136 -0
- package/bin/server.js +41 -0
- package/bin/templates/imageset.json +29 -0
- package/bin/templates/xcassets.json +6 -0
- package/bower.json +27 -0
- package/docs/app.js +118 -0
- package/docs/icons.json +1 -1
- package/docs/index.html +132 -0
- package/docs/keywords.json +14583 -8278
- package/docs/resources/calcite-web.min.css +8 -0
- package/docs/resources/calcite-web.min.js +7 -0
- package/icons/closed-caption-16-f.svg +1 -0
- package/icons/closed-caption-16.svg +1 -0
- package/icons/closed-caption-24-f.svg +1 -0
- package/icons/closed-caption-24.svg +1 -0
- package/icons/closed-caption-32-f.svg +1 -0
- package/icons/closed-caption-32.svg +1 -0
- package/icons/flag-16-f.svg +1 -0
- package/icons/flag-16.svg +1 -0
- package/icons/flag-24-f.svg +1 -0
- package/icons/flag-24.svg +1 -0
- package/icons/flag-32-f.svg +1 -0
- package/icons/flag-32.svg +1 -0
- package/icons/flag-slash-16.svg +1 -0
- package/icons/flag-slash-24.svg +1 -0
- package/icons/flag-slash-32.svg +1 -0
- package/icons/layer-connection-16.svg +1 -0
- package/icons/layer-connection-24.svg +1 -0
- package/icons/layer-connection-32.svg +1 -0
- package/icons/transcript-16-f.svg +1 -0
- package/icons/transcript-16.svg +1 -0
- package/icons/transcript-24-f.svg +1 -0
- package/icons/transcript-24.svg +1 -0
- package/icons/transcript-32-f.svg +1 -0
- package/icons/transcript-32.svg +1 -0
- package/index.d.ts +3503 -3479
- package/index.js +3503 -3479
- package/js/ai16.d.ts +1 -0
- package/js/ai16.js +1 -0
- package/js/ai16.json +1 -0
- package/js/ai24.d.ts +1 -0
- package/js/ai24.js +1 -0
- package/js/ai24.json +1 -0
- package/js/ai32.d.ts +1 -0
- package/js/ai32.js +1 -0
- package/js/ai32.json +1 -0
- package/js/arrowCircleDownF16.d.ts +1 -0
- package/js/arrowCircleDownF16.js +1 -0
- package/js/arrowCircleDownF16.json +1 -0
- package/js/arrowCircleDownF24.d.ts +1 -0
- package/js/arrowCircleDownF24.js +1 -0
- package/js/arrowCircleDownF24.json +1 -0
- package/js/arrowCircleDownF32.d.ts +1 -0
- package/js/arrowCircleDownF32.js +1 -0
- package/js/arrowCircleDownF32.json +1 -0
- package/js/bookmarkF16.d.ts +1 -0
- package/js/bookmarkF16.js +1 -0
- package/js/bookmarkF16.json +1 -0
- package/js/bookmarkF24.d.ts +1 -0
- package/js/bookmarkF24.js +1 -0
- package/js/bookmarkF24.json +1 -0
- package/js/bookmarkF32.d.ts +1 -0
- package/js/bookmarkF32.js +1 -0
- package/js/bookmarkF32.json +1 -0
- package/js/closedCaption16.d.ts +1 -0
- package/js/closedCaption16.js +1 -0
- package/js/closedCaption16.json +1 -0
- package/js/closedCaption16F.d.ts +1 -0
- package/js/closedCaption16F.js +1 -0
- package/js/closedCaption16F.json +1 -0
- package/js/closedCaption24.d.ts +1 -0
- package/js/closedCaption24.js +1 -0
- package/js/closedCaption24.json +1 -0
- package/js/closedCaption24F.d.ts +1 -0
- package/js/closedCaption24F.js +1 -0
- package/js/closedCaption24F.json +1 -0
- package/js/closedCaption32.d.ts +1 -0
- package/js/closedCaption32.js +1 -0
- package/js/closedCaption32.json +1 -0
- package/js/closedCaption32F.d.ts +1 -0
- package/js/closedCaption32F.js +1 -0
- package/js/closedCaption32F.json +1 -0
- package/js/codeBrand16.d.ts +1 -0
- package/js/codeBrand16.js +1 -0
- package/js/codeBrand16.json +1 -0
- package/js/codeBrand24.d.ts +1 -0
- package/js/codeBrand24.js +1 -0
- package/js/codeBrand24.json +1 -0
- package/js/codeBrand32.d.ts +1 -0
- package/js/codeBrand32.js +1 -0
- package/js/codeBrand32.json +1 -0
- package/js/codeBrandEdit16.d.ts +1 -0
- package/js/codeBrandEdit16.js +1 -0
- package/js/codeBrandEdit16.json +1 -0
- package/js/codeBrandEdit24.d.ts +1 -0
- package/js/codeBrandEdit24.js +1 -0
- package/js/codeBrandEdit24.json +1 -0
- package/js/codeBrandEdit32.d.ts +1 -0
- package/js/codeBrandEdit32.js +1 -0
- package/js/codeBrandEdit32.json +1 -0
- package/js/esriCommunity16.d.ts +1 -0
- package/js/esriCommunity16.js +1 -0
- package/js/esriCommunity16.json +1 -0
- package/js/esriCommunity24.d.ts +1 -0
- package/js/esriCommunity24.js +1 -0
- package/js/esriCommunity24.json +1 -0
- package/js/esriCommunity32.d.ts +1 -0
- package/js/esriCommunity32.js +1 -0
- package/js/esriCommunity32.json +1 -0
- package/js/esriCommunityGlyph16.d.ts +1 -0
- package/js/esriCommunityGlyph16.js +1 -0
- package/js/esriCommunityGlyph16.json +1 -0
- package/js/esriCommunityGlyph24.d.ts +1 -0
- package/js/esriCommunityGlyph24.js +1 -0
- package/js/esriCommunityGlyph24.json +1 -0
- package/js/esriCommunityGlyph32.d.ts +1 -0
- package/js/esriCommunityGlyph32.js +1 -0
- package/js/esriCommunityGlyph32.json +1 -0
- package/js/featureDisplayOrder16.d.ts +1 -0
- package/js/featureDisplayOrder16.js +1 -0
- package/js/featureDisplayOrder16.json +1 -0
- package/js/featureDisplayOrder24.d.ts +1 -0
- package/js/featureDisplayOrder24.js +1 -0
- package/js/featureDisplayOrder24.json +1 -0
- package/js/featureDisplayOrder32.d.ts +1 -0
- package/js/featureDisplayOrder32.js +1 -0
- package/js/featureDisplayOrder32.json +1 -0
- package/js/flag16.d.ts +1 -0
- package/js/flag16.js +1 -0
- package/js/flag16.json +1 -0
- package/js/flag16F.d.ts +1 -0
- package/js/flag16F.js +1 -0
- package/js/flag16F.json +1 -0
- package/js/flag24.d.ts +1 -0
- package/js/flag24.js +1 -0
- package/js/flag24.json +1 -0
- package/js/flag24F.d.ts +1 -0
- package/js/flag24F.js +1 -0
- package/js/flag24F.json +1 -0
- package/js/flag32.d.ts +1 -0
- package/js/flag32.js +1 -0
- package/js/flag32.json +1 -0
- package/js/flag32F.d.ts +1 -0
- package/js/flag32F.js +1 -0
- package/js/flag32F.json +1 -0
- package/js/flagSlash16.d.ts +1 -0
- package/js/flagSlash16.js +1 -0
- package/js/flagSlash16.json +1 -0
- package/js/flagSlash24.d.ts +1 -0
- package/js/flagSlash24.js +1 -0
- package/js/flagSlash24.json +1 -0
- package/js/flagSlash32.d.ts +1 -0
- package/js/flagSlash32.js +1 -0
- package/js/flagSlash32.json +1 -0
- package/js/folderFill16F.d.ts +1 -0
- package/js/folderFill16F.js +1 -0
- package/js/folderFill16F.json +1 -0
- package/js/folderFill24F.d.ts +1 -0
- package/js/folderFill24F.js +1 -0
- package/js/folderFill24F.json +1 -0
- package/js/folderFill32F.d.ts +1 -0
- package/js/folderFill32F.js +1 -0
- package/js/folderFill32F.json +1 -0
- package/js/full1Column16.d.ts +1 -0
- package/js/full1Column16.js +1 -0
- package/js/full1Column16.json +1 -0
- package/js/full1Column24.d.ts +1 -0
- package/js/full1Column24.js +1 -0
- package/js/full1Column24.json +1 -0
- package/js/full1Column32.d.ts +1 -0
- package/js/full1Column32.js +1 -0
- package/js/full1Column32.json +1 -0
- package/js/fullMedium1Column16.d.ts +1 -0
- package/js/fullMedium1Column16.js +1 -0
- package/js/fullMedium1Column16.json +1 -0
- package/js/fullMedium1Column24.d.ts +1 -0
- package/js/fullMedium1Column24.js +1 -0
- package/js/fullMedium1Column24.json +1 -0
- package/js/fullMedium1Column32.d.ts +1 -0
- package/js/fullMedium1Column32.js +1 -0
- package/js/fullMedium1Column32.json +1 -0
- package/js/fullSmall1Column16.d.ts +1 -0
- package/js/fullSmall1Column16.js +1 -0
- package/js/fullSmall1Column16.json +1 -0
- package/js/fullSmall1Column24.d.ts +1 -0
- package/js/fullSmall1Column24.js +1 -0
- package/js/fullSmall1Column24.json +1 -0
- package/js/fullSmall1Column32.d.ts +1 -0
- package/js/fullSmall1Column32.js +1 -0
- package/js/fullSmall1Column32.json +1 -0
- package/js/i12XPlaybackSpeed16.d.ts +1 -0
- package/js/i12XPlaybackSpeed16.js +1 -0
- package/js/i12XPlaybackSpeed16.json +1 -0
- package/js/i12XPlaybackSpeed24.d.ts +1 -0
- package/js/i12XPlaybackSpeed24.js +1 -0
- package/js/i12XPlaybackSpeed24.json +1 -0
- package/js/i12XPlaybackSpeed32.d.ts +1 -0
- package/js/i12XPlaybackSpeed32.js +1 -0
- package/js/i12XPlaybackSpeed32.json +1 -0
- package/js/i14XPlaybackSpeed16.d.ts +1 -0
- package/js/i14XPlaybackSpeed16.js +1 -0
- package/js/i14XPlaybackSpeed16.json +1 -0
- package/js/i14XPlaybackSpeed24.d.ts +1 -0
- package/js/i14XPlaybackSpeed24.js +1 -0
- package/js/i14XPlaybackSpeed24.json +1 -0
- package/js/i14XPlaybackSpeed32.d.ts +1 -0
- package/js/i14XPlaybackSpeed32.js +1 -0
- package/js/i14XPlaybackSpeed32.json +1 -0
- package/js/i18XPlaybackSpeed16.d.ts +1 -0
- package/js/i18XPlaybackSpeed16.js +1 -0
- package/js/i18XPlaybackSpeed16.json +1 -0
- package/js/i18XPlaybackSpeed24.d.ts +1 -0
- package/js/i18XPlaybackSpeed24.js +1 -0
- package/js/i18XPlaybackSpeed24.json +1 -0
- package/js/i18XPlaybackSpeed32.d.ts +1 -0
- package/js/i18XPlaybackSpeed32.js +1 -0
- package/js/i18XPlaybackSpeed32.json +1 -0
- package/js/i1XPlaybackSpeed16.d.ts +1 -0
- package/js/i1XPlaybackSpeed16.js +1 -0
- package/js/i1XPlaybackSpeed16.json +1 -0
- package/js/i1XPlaybackSpeed24.d.ts +1 -0
- package/js/i1XPlaybackSpeed24.js +1 -0
- package/js/i1XPlaybackSpeed24.json +1 -0
- package/js/i1XPlaybackSpeed32.d.ts +1 -0
- package/js/i1XPlaybackSpeed32.js +1 -0
- package/js/i1XPlaybackSpeed32.json +1 -0
- package/js/i2XPlaybackSpeed16.d.ts +1 -0
- package/js/i2XPlaybackSpeed16.js +1 -0
- package/js/i2XPlaybackSpeed16.json +1 -0
- package/js/i2XPlaybackSpeed24.d.ts +1 -0
- package/js/i2XPlaybackSpeed24.js +1 -0
- package/js/i2XPlaybackSpeed24.json +1 -0
- package/js/i2XPlaybackSpeed32.d.ts +1 -0
- package/js/i2XPlaybackSpeed32.js +1 -0
- package/js/i2XPlaybackSpeed32.json +1 -0
- package/js/i4XPlaybackSpeed16.d.ts +1 -0
- package/js/i4XPlaybackSpeed16.js +1 -0
- package/js/i4XPlaybackSpeed16.json +1 -0
- package/js/i4XPlaybackSpeed24.d.ts +1 -0
- package/js/i4XPlaybackSpeed24.js +1 -0
- package/js/i4XPlaybackSpeed24.json +1 -0
- package/js/i4XPlaybackSpeed32.d.ts +1 -0
- package/js/i4XPlaybackSpeed32.js +1 -0
- package/js/i4XPlaybackSpeed32.json +1 -0
- package/js/i8XPlaybackSpeed16.d.ts +1 -0
- package/js/i8XPlaybackSpeed16.js +1 -0
- package/js/i8XPlaybackSpeed16.json +1 -0
- package/js/i8XPlaybackSpeed24.d.ts +1 -0
- package/js/i8XPlaybackSpeed24.js +1 -0
- package/js/i8XPlaybackSpeed24.json +1 -0
- package/js/i8XPlaybackSpeed32.d.ts +1 -0
- package/js/i8XPlaybackSpeed32.js +1 -0
- package/js/i8XPlaybackSpeed32.json +1 -0
- package/js/large2Column16.d.ts +1 -0
- package/js/large2Column16.js +1 -0
- package/js/large2Column16.json +1 -0
- package/js/large2Column24.d.ts +1 -0
- package/js/large2Column24.js +1 -0
- package/js/large2Column24.json +1 -0
- package/js/large2Column32.d.ts +1 -0
- package/js/large2Column32.js +1 -0
- package/js/large2Column32.json +1 -0
- package/js/layerConnection16.d.ts +1 -0
- package/js/layerConnection16.js +1 -0
- package/js/layerConnection16.json +1 -0
- package/js/layerConnection24.d.ts +1 -0
- package/js/layerConnection24.js +1 -0
- package/js/layerConnection24.json +1 -0
- package/js/layerConnection32.d.ts +1 -0
- package/js/layerConnection32.js +1 -0
- package/js/layerConnection32.json +1 -0
- package/js/locationSharingDisabled16.d.ts +1 -0
- package/js/locationSharingDisabled16.js +1 -0
- package/js/locationSharingDisabled16.json +1 -0
- package/js/locationSharingDisabled24.d.ts +1 -0
- package/js/locationSharingDisabled24.js +1 -0
- package/js/locationSharingDisabled24.json +1 -0
- package/js/locationSharingDisabled32.d.ts +1 -0
- package/js/locationSharingDisabled32.js +1 -0
- package/js/locationSharingDisabled32.json +1 -0
- package/js/locationSharingEnabled16.d.ts +1 -0
- package/js/locationSharingEnabled16.js +1 -0
- package/js/locationSharingEnabled16.json +1 -0
- package/js/locationSharingEnabled24.d.ts +1 -0
- package/js/locationSharingEnabled24.js +1 -0
- package/js/locationSharingEnabled24.json +1 -0
- package/js/locationSharingEnabled32.d.ts +1 -0
- package/js/locationSharingEnabled32.js +1 -0
- package/js/locationSharingEnabled32.json +1 -0
- package/js/locationSharingFilled16.d.ts +1 -0
- package/js/locationSharingFilled16.js +1 -0
- package/js/locationSharingFilled16.json +1 -0
- package/js/locationSharingFilled24.d.ts +1 -0
- package/js/locationSharingFilled24.js +1 -0
- package/js/locationSharingFilled24.json +1 -0
- package/js/locationSharingFilled32.d.ts +1 -0
- package/js/locationSharingFilled32.js +1 -0
- package/js/locationSharingFilled32.json +1 -0
- package/js/medium2Column16.d.ts +1 -0
- package/js/medium2Column16.js +1 -0
- package/js/medium2Column16.json +1 -0
- package/js/medium2Column24.d.ts +1 -0
- package/js/medium2Column24.js +1 -0
- package/js/medium2Column24.json +1 -0
- package/js/medium2Column32.d.ts +1 -0
- package/js/medium2Column32.js +1 -0
- package/js/medium2Column32.json +1 -0
- package/js/numberCircle1F16.d.ts +1 -0
- package/js/numberCircle1F16.js +1 -0
- package/js/numberCircle1F16.json +1 -0
- package/js/numberCircle1F24.d.ts +1 -0
- package/js/numberCircle1F24.js +1 -0
- package/js/numberCircle1F24.json +1 -0
- package/js/numberCircle1F32.d.ts +1 -0
- package/js/numberCircle1F32.js +1 -0
- package/js/numberCircle1F32.json +1 -0
- package/js/numberCircle2F16.d.ts +1 -0
- package/js/numberCircle2F16.js +1 -0
- package/js/numberCircle2F16.json +1 -0
- package/js/numberCircle2F24.d.ts +1 -0
- package/js/numberCircle2F24.js +1 -0
- package/js/numberCircle2F24.json +1 -0
- package/js/numberCircle2F32.d.ts +1 -0
- package/js/numberCircle2F32.js +1 -0
- package/js/numberCircle2F32.json +1 -0
- package/js/numberCircle3F16.d.ts +1 -0
- package/js/numberCircle3F16.js +1 -0
- package/js/numberCircle3F16.json +1 -0
- package/js/numberCircle3F24.d.ts +1 -0
- package/js/numberCircle3F24.js +1 -0
- package/js/numberCircle3F24.json +1 -0
- package/js/numberCircle3F32.d.ts +1 -0
- package/js/numberCircle3F32.js +1 -0
- package/js/numberCircle3F32.json +1 -0
- package/js/numberCircle4F16.d.ts +1 -0
- package/js/numberCircle4F16.js +1 -0
- package/js/numberCircle4F16.json +1 -0
- package/js/numberCircle4F24.d.ts +1 -0
- package/js/numberCircle4F24.js +1 -0
- package/js/numberCircle4F24.json +1 -0
- package/js/numberCircle4F32.d.ts +1 -0
- package/js/numberCircle4F32.js +1 -0
- package/js/numberCircle4F32.json +1 -0
- package/js/numberCircle5F16.d.ts +1 -0
- package/js/numberCircle5F16.js +1 -0
- package/js/numberCircle5F16.json +1 -0
- package/js/numberCircle5F24.d.ts +1 -0
- package/js/numberCircle5F24.js +1 -0
- package/js/numberCircle5F24.json +1 -0
- package/js/numberCircle5F32.d.ts +1 -0
- package/js/numberCircle5F32.js +1 -0
- package/js/numberCircle5F32.json +1 -0
- package/js/numberCircle6F16.d.ts +1 -0
- package/js/numberCircle6F16.js +1 -0
- package/js/numberCircle6F16.json +1 -0
- package/js/numberCircle6F24.d.ts +1 -0
- package/js/numberCircle6F24.js +1 -0
- package/js/numberCircle6F24.json +1 -0
- package/js/numberCircle6F32.d.ts +1 -0
- package/js/numberCircle6F32.js +1 -0
- package/js/numberCircle6F32.json +1 -0
- package/js/numberCircle7F16.d.ts +1 -0
- package/js/numberCircle7F16.js +1 -0
- package/js/numberCircle7F16.json +1 -0
- package/js/numberCircle7F24.d.ts +1 -0
- package/js/numberCircle7F24.js +1 -0
- package/js/numberCircle7F24.json +1 -0
- package/js/numberCircle7F32.d.ts +1 -0
- package/js/numberCircle7F32.js +1 -0
- package/js/numberCircle7F32.json +1 -0
- package/js/numberCircle8F16.d.ts +1 -0
- package/js/numberCircle8F16.js +1 -0
- package/js/numberCircle8F16.json +1 -0
- package/js/numberCircle8F24.d.ts +1 -0
- package/js/numberCircle8F24.js +1 -0
- package/js/numberCircle8F24.json +1 -0
- package/js/numberCircle8F32.d.ts +1 -0
- package/js/numberCircle8F32.js +1 -0
- package/js/numberCircle8F32.json +1 -0
- package/js/numberCircle9F16.d.ts +1 -0
- package/js/numberCircle9F16.js +1 -0
- package/js/numberCircle9F16.json +1 -0
- package/js/numberCircle9F24.d.ts +1 -0
- package/js/numberCircle9F24.js +1 -0
- package/js/numberCircle9F24.json +1 -0
- package/js/numberCircle9F32.d.ts +1 -0
- package/js/numberCircle9F32.js +1 -0
- package/js/numberCircle9F32.json +1 -0
- package/js/partlyCloud16.d.ts +1 -0
- package/js/partlyCloud16.js +1 -0
- package/js/partlyCloud16.json +1 -0
- package/js/partlyCloud24.d.ts +1 -0
- package/js/partlyCloud24.js +1 -0
- package/js/partlyCloud24.json +1 -0
- package/js/partlyCloud32.d.ts +1 -0
- package/js/partlyCloud32.js +1 -0
- package/js/partlyCloud32.json +1 -0
- package/js/pinTearF16.d.ts +1 -0
- package/js/pinTearF16.js +1 -0
- package/js/pinTearF16.json +1 -0
- package/js/pinTearF24.d.ts +1 -0
- package/js/pinTearF24.js +1 -0
- package/js/pinTearF24.json +1 -0
- package/js/pinTearF32.d.ts +1 -0
- package/js/pinTearF32.js +1 -0
- package/js/pinTearF32.json +1 -0
- package/js/popUpBlankF16.d.ts +1 -0
- package/js/popUpBlankF16.js +1 -0
- package/js/popUpBlankF16.json +1 -0
- package/js/popUpBlankF24.d.ts +1 -0
- package/js/popUpBlankF24.js +1 -0
- package/js/popUpBlankF24.json +1 -0
- package/js/popUpBlankF32.d.ts +1 -0
- package/js/popUpBlankF32.js +1 -0
- package/js/popUpBlankF32.json +1 -0
- package/js/radialTreeLinkChartYayout16.d.ts +1 -0
- package/js/radialTreeLinkChartYayout16.js +1 -0
- package/js/radialTreeLinkChartYayout16.json +1 -0
- package/js/radialTreeLinkChartYayout24.d.ts +1 -0
- package/js/radialTreeLinkChartYayout24.js +1 -0
- package/js/radialTreeLinkChartYayout24.json +1 -0
- package/js/radialTreeLinkChartYayout32.d.ts +1 -0
- package/js/radialTreeLinkChartYayout32.js +1 -0
- package/js/radialTreeLinkChartYayout32.json +1 -0
- package/js/satellite0F16.d.ts +1 -0
- package/js/satellite0F16.js +1 -0
- package/js/satellite0F16.json +1 -0
- package/js/satellite0F24.d.ts +1 -0
- package/js/satellite0F24.js +1 -0
- package/js/satellite0F24.json +1 -0
- package/js/satellite0F32.d.ts +1 -0
- package/js/satellite0F32.js +1 -0
- package/js/satellite0F32.json +1 -0
- package/js/satellite1F16.d.ts +1 -0
- package/js/satellite1F16.js +1 -0
- package/js/satellite1F16.json +1 -0
- package/js/satellite1F24.d.ts +1 -0
- package/js/satellite1F24.js +1 -0
- package/js/satellite1F24.json +1 -0
- package/js/satellite1F32.d.ts +1 -0
- package/js/satellite1F32.js +1 -0
- package/js/satellite1F32.json +1 -0
- package/js/satellite2F16.d.ts +1 -0
- package/js/satellite2F16.js +1 -0
- package/js/satellite2F16.json +1 -0
- package/js/satellite2F24.d.ts +1 -0
- package/js/satellite2F24.js +1 -0
- package/js/satellite2F24.json +1 -0
- package/js/satellite2F32.d.ts +1 -0
- package/js/satellite2F32.js +1 -0
- package/js/satellite2F32.json +1 -0
- package/js/satellite3F16.d.ts +1 -0
- package/js/satellite3F16.js +1 -0
- package/js/satellite3F16.json +1 -0
- package/js/satellite3F24.d.ts +1 -0
- package/js/satellite3F24.js +1 -0
- package/js/satellite3F24.json +1 -0
- package/js/satellite3F32.d.ts +1 -0
- package/js/satellite3F32.js +1 -0
- package/js/satellite3F32.json +1 -0
- package/js/sensor21.d.ts +1 -0
- package/js/sensor21.js +1 -0
- package/js/sensor21.json +1 -0
- package/js/sensor48.d.ts +1 -0
- package/js/sensor48.js +1 -0
- package/js/sensor48.json +1 -0
- package/js/sensor64.d.ts +1 -0
- package/js/sensor64.js +1 -0
- package/js/sensor64.json +1 -0
- package/js/sheildCoin16.d.ts +1 -0
- package/js/sheildCoin16.js +1 -0
- package/js/sheildCoin16.json +1 -0
- package/js/sheildCoin24.d.ts +1 -0
- package/js/sheildCoin24.js +1 -0
- package/js/sheildCoin24.json +1 -0
- package/js/sheildCoin32.d.ts +1 -0
- package/js/sheildCoin32.js +1 -0
- package/js/sheildCoin32.json +1 -0
- package/js/small2Column16.d.ts +1 -0
- package/js/small2Column16.js +1 -0
- package/js/small2Column16.json +1 -0
- package/js/small2Column24.d.ts +1 -0
- package/js/small2Column24.js +1 -0
- package/js/small2Column24.json +1 -0
- package/js/small2Column32.d.ts +1 -0
- package/js/small2Column32.js +1 -0
- package/js/small2Column32.json +1 -0
- package/js/transcript16.d.ts +1 -0
- package/js/transcript16.js +1 -0
- package/js/transcript16.json +1 -0
- package/js/transcript16F.d.ts +1 -0
- package/js/transcript16F.js +1 -0
- package/js/transcript16F.json +1 -0
- package/js/transcript24.d.ts +1 -0
- package/js/transcript24.js +1 -0
- package/js/transcript24.json +1 -0
- package/js/transcript24F.d.ts +1 -0
- package/js/transcript24F.js +1 -0
- package/js/transcript24F.json +1 -0
- package/js/transcript32.d.ts +1 -0
- package/js/transcript32.js +1 -0
- package/js/transcript32.json +1 -0
- package/js/transcript32F.d.ts +1 -0
- package/js/transcript32F.js +1 -0
- package/js/transcript32F.json +1 -0
- package/launch-calcite.command +1 -0
- package/launch-meridian.command +1 -0
- package/lib/spriter/cli.js +8 -7
- package/lib/spriter/index.js +40 -37
- package/package.json +37 -45
- package/sprite-16.svg +1 -1
- package/sprite-24.svg +1 -1
- package/sprite-32.svg +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: NPM Release
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
jobs:
|
|
6
|
+
release:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
|
+
with:
|
|
11
|
+
ref: master
|
|
12
|
+
- uses: actions/setup-node@v3
|
|
13
|
+
with:
|
|
14
|
+
node-version: lts/*
|
|
15
|
+
registry-url: "https://registry.npmjs.org"
|
|
16
|
+
- run: npm i
|
|
17
|
+
- run: npm start
|
|
18
|
+
- run: npm publish
|
|
19
|
+
env:
|
|
20
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CONTRIBUTE.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Contributing to calcite-ui-icons
|
|
2
|
+
|
|
3
|
+
The creative lab is the main contributor as they provide the various icons used by the different apps.
|
|
4
|
+
|
|
5
|
+
#### Bugs
|
|
6
|
+
|
|
7
|
+
Create an issue that describes clearly the issue and the reproducible steps.
|
|
8
|
+
|
|
9
|
+
#### Pull Requests
|
|
10
|
+
|
|
11
|
+
If you feel the urge to contribute, submit your updates with pull request.
|
|
12
|
+
|
|
13
|
+
## Running the Doc Site
|
|
14
|
+
|
|
15
|
+
First install all dependencies:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Next, run the server:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
npm run server
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This will optimize the icons, create a JSON file with all the icon path data, and start up a development server with live reload capabilities.
|
|
28
|
+
|
|
29
|
+
This task also watches for changes and rebuilds the JSON file whenever icons are added or edited, automatically reloading your browser to display changes as they come in.
|
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# License
|
|
2
2
|
|
|
3
|
-
COPYRIGHT ©
|
|
3
|
+
COPYRIGHT © 2021 Esri
|
|
4
4
|
|
|
5
5
|
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
|
|
6
6
|
|
|
7
7
|
This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
|
|
8
8
|
|
|
9
|
-
See use restrictions at
|
|
9
|
+
See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
|
|
10
10
|
|
|
11
11
|
For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
|
|
12
12
|
|
|
13
|
-
email:
|
|
13
|
+
email: contracts@esri.com
|
|
14
|
+
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# calcite-ui-icons
|
|
2
2
|
|
|
3
3
|
A collection of UI SVG icons created by Esri for mapping applications.
|
|
4
|
-
|
|
4
|
+
https://esri.github.io/calcite-ui-icons/
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -13,16 +13,15 @@ Icons use an outlined style. Some icons include an additional filled version.
|
|
|
13
13
|
|
|
14
14
|
Every concept has 3 sizes:
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* **16x16**
|
|
17
|
+
* **24x24**
|
|
18
|
+
* **32x32**
|
|
19
19
|
|
|
20
20
|
### Why 3 Sizes?
|
|
21
21
|
|
|
22
22
|
More info on what happens when you scale vector based icons [here](https://github.com/Esri/calcite-ui-icons/wiki/What-Happens-When-You-Scale-Vector-Based-Icons)
|
|
23
23
|
|
|
24
24
|
### Outline icons are the standard
|
|
25
|
-
|
|
26
25
|
Outline icons have the default name. For example, `trash-16.svg` will render the default outline icon.
|
|
27
26
|
|
|
28
27
|
Some icons have alternative states for toggling or greater flexibility. For those icons, appending `-f` (`information-16-f.svg`) will render the filled version.
|
|
@@ -31,17 +30,16 @@ Some icons have alternative states for toggling or greater flexibility. For thos
|
|
|
31
30
|
|
|
32
31
|
For web apps, the easiest way to use calcite-ui-icons is with [calcite-components](https://github.com/Esri/calcite-components). The [calcite-icon](https://github.com/Esri/calcite-components/tree/master/src/components/calcite-icon) component will handle fetching and rendering any icon from this set with the following api:
|
|
33
32
|
|
|
34
|
-
```
|
|
33
|
+
```
|
|
35
34
|
<calcite-icon icon="arrowLeft" scale="m"></calcite-icon>
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
### Sprite packages
|
|
39
|
-
|
|
40
38
|
Furthermore, sprites are available in 3 packages and live outside the `icons/` directory:
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
* sprite-16.svg
|
|
41
|
+
* sprite-24.svg
|
|
42
|
+
* sprite-32.svg
|
|
45
43
|
|
|
46
44
|
Alternative filled versions of the outlined icons have `-f` appended to their name, and are included in the sprites above.
|
|
47
45
|
|
|
@@ -70,7 +68,7 @@ Some icons use multiple paths and opacity in their construction, for these the d
|
|
|
70
68
|
```js
|
|
71
69
|
import { imageLayer16 } from "@esri/calcite-ui-icons/js/imageLayer16.js";
|
|
72
70
|
|
|
73
|
-
console.log(imageLayer16)
|
|
71
|
+
console.log(imageLayer16) // => [{ path: "M16 6v3H5.035l5 5H6.5L0 7.5 6.5 1h3.536l-5 5z", opacity: .4 }, ...]
|
|
74
72
|
```
|
|
75
73
|
|
|
76
74
|
**Note**: It is not recommended to import the entire library of icons. This will have negative performance implications. Use the technique above to select only the icons your users actually need to download.
|
|
@@ -84,7 +82,7 @@ Types are also available for projects leveraging TypeScript. `CalciteIconPath` d
|
|
|
84
82
|
All icons are also provided as part of a JSON file. If you installed via npm, you can import the full icon data set using the following:
|
|
85
83
|
|
|
86
84
|
```js
|
|
87
|
-
var calciteIcons = require(
|
|
85
|
+
var calciteIcons = require('@esri/calcite-ui-icons/docs/icons.json');
|
|
88
86
|
```
|
|
89
87
|
|
|
90
88
|
This will give you an object containing all the icons in the library at all sizes:
|
|
@@ -112,20 +110,18 @@ This will give you an object containing all the icons in the library at all size
|
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
```
|
|
113
|
+
_Note: path data omitted for brevity_.
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Most icons will have simple strings as path data, but some will be more complex as they need to store not only path, but opacity as well for multiple shapes. Icons of this structure will be annotated with the `multiPath` flag.
|
|
115
|
+
Most icons will have simple strings as path data, but some will be more complex as they need to store not only path, but opacity as well for multiple shapes. Icons of this structure will be anotated with the `multiPath` flag.
|
|
119
116
|
|
|
120
117
|
### Individual icons structure
|
|
121
|
-
|
|
122
118
|
All the individual SVG icons have a common file structure.
|
|
123
119
|
|
|
124
120
|
This is what the `close-16.svg` looks like:
|
|
125
121
|
|
|
126
122
|
```html
|
|
127
123
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
|
128
|
-
<path d="M0 10V7h10.965l-5-5H9.5L16 8.5 9.5 15H5.964l5-5H0z"
|
|
124
|
+
<path d="M0 10V7h10.965l-5-5H9.5L16 8.5 9.5 15H5.964l5-5H0z"/>
|
|
129
125
|
</svg>
|
|
130
126
|
```
|
|
131
127
|
|
|
@@ -157,34 +153,43 @@ npm install
|
|
|
157
153
|
|
|
158
154
|
Then:
|
|
159
155
|
|
|
160
|
-
|
|
156
|
+
* To create Xcode image sets (for use with iOS, macOS, iPadOS) with a default size:
|
|
161
157
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
```sh
|
|
159
|
+
npm run convert-all-ios
|
|
160
|
+
```
|
|
165
161
|
|
|
166
|
-
|
|
162
|
+
* To create Xcode image sets with a specified size (e.g. 44x44):
|
|
167
163
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
```sh
|
|
165
|
+
npm run convert-all-ios:size 44
|
|
166
|
+
```
|
|
171
167
|
|
|
172
|
-
|
|
168
|
+
* To create versions for use on desktop in one size:
|
|
173
169
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
```sh
|
|
171
|
+
npm run convert-all-desktop:size 64
|
|
172
|
+
```
|
|
177
173
|
|
|
178
|
-
|
|
174
|
+
* To create versions for use on desktop in sizes ranging from 16 to 64, run:
|
|
179
175
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
```sh
|
|
177
|
+
npm run convert-all-desktop-multi
|
|
178
|
+
```
|
|
183
179
|
|
|
184
180
|
## Licensing
|
|
185
181
|
|
|
186
|
-
|
|
182
|
+
COPYRIGHT © 2020 Esri
|
|
187
183
|
|
|
188
|
-
|
|
184
|
+
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
|
|
185
|
+
|
|
186
|
+
This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
|
|
187
|
+
|
|
188
|
+
See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
|
|
191
|
+
|
|
192
|
+
email: contracts@esri.com
|
|
193
|
+
|
|
194
|
+
## Contributing
|
|
195
|
+
Please read the [contribute document](CONTRIBUTE.md).
|
package/bin/build.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const optimize = require('./optimize');
|
|
2
|
+
const generatePathFile = require('./path-data');
|
|
3
|
+
|
|
4
|
+
module.exports = function () {
|
|
5
|
+
return optimize('*.svg')
|
|
6
|
+
.then(() => optimize('icons/*.svg', true))
|
|
7
|
+
.catch((error) => {
|
|
8
|
+
console.error('🚨 Error while optimizing icons');
|
|
9
|
+
throw error;
|
|
10
|
+
})
|
|
11
|
+
.then(() => {
|
|
12
|
+
console.log('✨ icons optimized successfully');
|
|
13
|
+
return generatePathFile();
|
|
14
|
+
})
|
|
15
|
+
.catch((error) => {
|
|
16
|
+
console.error('🚨 Error while generating icons.json');
|
|
17
|
+
console.error(error);
|
|
18
|
+
throw error;
|
|
19
|
+
})
|
|
20
|
+
.then((files) => {
|
|
21
|
+
console.log('✨ path file generated at ./docs/icons.json');
|
|
22
|
+
return files;
|
|
23
|
+
});
|
|
24
|
+
}
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const svg2img = require('svg2img');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const yargs = require('yargs');
|
|
7
|
+
|
|
8
|
+
const options = yargs
|
|
9
|
+
.usage('Usage: -n <name of icon, omit if doing bulk>, \n-s <output size, defaults to 24>, \n-o <output path (defaults to ./output)>, \n-p <target platform (e.g. ios) \n-i <16, 24, 32, omit for 16>')
|
|
10
|
+
.option('n', { alias: 'name', describe: 'name of icon, without -32.svg; omit to convert all icons', type: 'string', demandOption: false })
|
|
11
|
+
.option('o', { alias: 'outputDir', describe: 'output path, relative to this script', type: 'string', demandOption: false })
|
|
12
|
+
.option('p', { alias: 'outputPlatform', describe: 'target platform, valid options are: ios', type: 'string', demandOption: false })
|
|
13
|
+
.option('i', { alias: 'inSize', describe: 'source svg variant, defaults to 16', type: 'string', demandOption: false })
|
|
14
|
+
.option('s', { alias: 'outSize', describe: 'size of output image', type: 'string', demandOption: false})
|
|
15
|
+
.argv;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Converts a single svg to png, with given width & height values. The function will automatically append '.png'
|
|
19
|
+
* @param {string} svgFilePath - filepath to icon .svg
|
|
20
|
+
* @param {int} width - width of output file
|
|
21
|
+
* @param {int} height - height of output file
|
|
22
|
+
* @param {string} outputBasePath - base directory in which to store output
|
|
23
|
+
* @param {string} outputName - name of output png image, excluding '.png'
|
|
24
|
+
* @param {string} outputSuffix - suffix appended to output file name (ex, '@2x')
|
|
25
|
+
*/
|
|
26
|
+
function convertSingleIconToPng(svgFilePath, width, height, outputBasePath, outputName, outputSuffix=null) {
|
|
27
|
+
// make sure output base path exists
|
|
28
|
+
if (!fs.existsSync(outputBasePath)) {
|
|
29
|
+
fs.mkdirSync(outputBasePath, {
|
|
30
|
+
recursive: true
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// concatenate real output path
|
|
34
|
+
let real_output_path = path.join(outputBasePath, outputName);
|
|
35
|
+
if (outputSuffix) {
|
|
36
|
+
real_output_path += outputSuffix
|
|
37
|
+
}
|
|
38
|
+
real_output_path += '.png'
|
|
39
|
+
// convert and save the image
|
|
40
|
+
svg2img(svgFilePath, { 'width': width, 'height': height }, function (error, buffer) {
|
|
41
|
+
if (error){
|
|
42
|
+
console.log(error);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
fs.writeFileSync(real_output_path, buffer);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Creates an ImageSet (including Contents.json file) for an icon
|
|
51
|
+
* @param {string} svgFilePath - filepath to icon .svg
|
|
52
|
+
* @param {int} width - width of output file @1x
|
|
53
|
+
* @param {int} height - height of output file @1x
|
|
54
|
+
* @param {string} outputBasePath - base directory in which to store output
|
|
55
|
+
* @param {string} outputName - name of output png image, excluding '.png'
|
|
56
|
+
*/
|
|
57
|
+
function convertIconToXcodeImageSet(svgFilePath, width, height, outputBasePath, outputName) {
|
|
58
|
+
const outputImagesetPath = path.join(outputBasePath, outputName + '.imageset');
|
|
59
|
+
|
|
60
|
+
// Create images at 3 sizes
|
|
61
|
+
convertSingleIconToPng(svgFilePath, width, height, outputImagesetPath, outputName, '@1x');
|
|
62
|
+
convertSingleIconToPng(svgFilePath, width * 2, height * 2, outputImagesetPath, outputName, '@2x');
|
|
63
|
+
convertSingleIconToPng(svgFilePath, width * 3, height * 3, outputImagesetPath, outputName, '@3x');
|
|
64
|
+
|
|
65
|
+
// read template
|
|
66
|
+
const imagesetTemplatePath = path.join(__dirname, 'templates', 'imageset.json');
|
|
67
|
+
// create Contents.json for asset catalog asset
|
|
68
|
+
fs.readFile(imagesetTemplatePath, 'utf8', function (error, buffer) {
|
|
69
|
+
if (error) {
|
|
70
|
+
console.log(error);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
const contentsJsonBuffer = buffer.replace(/\$\{NAME\}/g, outputName);
|
|
74
|
+
const contentsJsonOutputPath = path.join(outputImagesetPath, 'Contents.json');
|
|
75
|
+
fs.writeFileSync(contentsJsonOutputPath, contentsJsonBuffer)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Indexes all calcite icons contained in directory at path
|
|
81
|
+
* @param {string} baseIconPath - path to calcite .svg icons directory
|
|
82
|
+
*/
|
|
83
|
+
async function indexCalciteIcons(baseIconPath) {
|
|
84
|
+
return new Promise(resolve => {
|
|
85
|
+
var iconIndex = {};
|
|
86
|
+
fs.readdir(baseIconPath, function (error, files) {
|
|
87
|
+
if (error) {
|
|
88
|
+
console.log(error);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
files.forEach(function (file) {
|
|
92
|
+
// strip all files of file size information, catalog in an index
|
|
93
|
+
var base_name = path.basename(file);
|
|
94
|
+
base_name = base_name.replace('.svg', '');
|
|
95
|
+
var size = undefined;
|
|
96
|
+
if (base_name.includes('-16')) {
|
|
97
|
+
base_name = base_name.replace('-16', '');
|
|
98
|
+
size = 16;
|
|
99
|
+
}
|
|
100
|
+
else if (base_name.includes('-24')) {
|
|
101
|
+
base_name = base_name.replace('-24', '');
|
|
102
|
+
size = 24;
|
|
103
|
+
}
|
|
104
|
+
else if (base_name.includes('-32')) {
|
|
105
|
+
base_name = base_name.replace('-32', '');
|
|
106
|
+
size = 32;
|
|
107
|
+
}
|
|
108
|
+
if (!iconIndex[base_name]) {
|
|
109
|
+
iconIndex[base_name] = {}
|
|
110
|
+
}
|
|
111
|
+
iconIndex[base_name][size] = path.join(baseIconPath, file);
|
|
112
|
+
});
|
|
113
|
+
resolve(iconIndex);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Indexes all calcite icons contained in directory at path
|
|
120
|
+
* @param {string} xcAssetsBaseDirectory - path where to derive calcite.xcassets
|
|
121
|
+
*/
|
|
122
|
+
async function createCalciteXCAssets(xcAssetsBaseDirectory) {
|
|
123
|
+
return new Promise(resolve => {
|
|
124
|
+
// Put in .xcassets folder
|
|
125
|
+
var directory = path.join(xcAssetsBaseDirectory, 'calcite.xcassets');
|
|
126
|
+
// Make sure dir exists
|
|
127
|
+
if (!fs.existsSync(directory)) {
|
|
128
|
+
fs.mkdirSync(directory, {
|
|
129
|
+
recursive: true
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// read contents.json template
|
|
133
|
+
let template_path = path.join(__dirname, 'templates', 'xcassets.json');
|
|
134
|
+
// write out file
|
|
135
|
+
fs.readFile(template_path, 'utf8', function (error, buffer) {
|
|
136
|
+
if (error) {
|
|
137
|
+
console.log(error);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
const contents_output_path = path.join(directory, 'Contents.json');
|
|
141
|
+
fs.writeFile(contents_output_path, buffer, function (error) {
|
|
142
|
+
resolve(directory);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async function main() {
|
|
149
|
+
// index all calcite icons
|
|
150
|
+
let iconIndex = await indexCalciteIcons('./icons/');
|
|
151
|
+
// establish output root path
|
|
152
|
+
var outputRoot = path.join(__dirname, 'output')
|
|
153
|
+
if (options.outputDir) {
|
|
154
|
+
outputRoot = path.join(__dirname, options.outputDir);
|
|
155
|
+
}
|
|
156
|
+
// establish input size
|
|
157
|
+
var inputSize = 24;
|
|
158
|
+
if (options.inSize === '16'){
|
|
159
|
+
inputSize = 16;
|
|
160
|
+
} else if (options.inSize === '24'){
|
|
161
|
+
inputSize = 24;
|
|
162
|
+
} else if (options.inSize === '32'){
|
|
163
|
+
inputSize = 32;
|
|
164
|
+
} else if (options.outSize) {
|
|
165
|
+
let size = parseInt(options.outSize);
|
|
166
|
+
if (size < 24) {
|
|
167
|
+
inputSize = 16;
|
|
168
|
+
} else if (size < 32) {
|
|
169
|
+
inputSize = 24;
|
|
170
|
+
} else if (size >= 32) {
|
|
171
|
+
inputSize = 32;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// establish output size (in pixels)
|
|
175
|
+
var outputSize = 24;
|
|
176
|
+
if (options.outSize) {
|
|
177
|
+
let size = parseInt(options.outSize);
|
|
178
|
+
if (size) {
|
|
179
|
+
outputSize = size;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// ensure icon name is valid, checking index
|
|
183
|
+
if (options.name) {
|
|
184
|
+
if (!(options.name in iconIndex)) {
|
|
185
|
+
console.log("Invalid icon name " + options.name);
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// build xcassets if output for iOS
|
|
190
|
+
if (options.outputPlatform === 'ios') {
|
|
191
|
+
let xcAssetsDirectory = await createCalciteXCAssets(outputRoot);
|
|
192
|
+
if (options.name) {
|
|
193
|
+
let name = options.name;
|
|
194
|
+
let file = iconIndex[name][inputSize];
|
|
195
|
+
convertIconToXcodeImageSet(file, outputSize, outputSize, xcAssetsDirectory, name);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
for (let key in iconIndex) {
|
|
199
|
+
let file = iconIndex[key][inputSize];
|
|
200
|
+
convertIconToXcodeImageSet(file, outputSize, outputSize, xcAssetsDirectory, key)
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
} else { // platform is not ios, render plain png
|
|
204
|
+
if (options.name) {
|
|
205
|
+
let name = options.name;
|
|
206
|
+
let file = iconIndex[name][inputSize];
|
|
207
|
+
convertSingleIconToPng(file, outputSize, outputSize, outputRoot, name, undefined);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
for (let key in iconIndex) {
|
|
211
|
+
let file = iconIndex[key][inputSize];
|
|
212
|
+
convertSingleIconToPng(file, outputSize, outputSize, outputRoot, key, undefined);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
main();
|
package/bin/optimize.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const glob = require('glob-promise');
|
|
3
|
+
const SVGO = require('svgo');
|
|
4
|
+
const progress = require('cli-progress');
|
|
5
|
+
|
|
6
|
+
let options = {
|
|
7
|
+
plugins: [
|
|
8
|
+
{cleanupIDs: {remove: false}},
|
|
9
|
+
{removeStyleElement: true},
|
|
10
|
+
{removeUselessDefs: true},
|
|
11
|
+
{removeUselessStrokeAndFill: false},
|
|
12
|
+
{removeHiddenElems: true},
|
|
13
|
+
{removeEmptyText: true},
|
|
14
|
+
{convertShapeToPath: { convertArcs: true }},
|
|
15
|
+
{convertPathData: { noSpaceAfterFlags: false }},
|
|
16
|
+
{removeEmptyAttrs: true},
|
|
17
|
+
{removeEmptyContainers: true},
|
|
18
|
+
{mergePaths: false},
|
|
19
|
+
{removeTitle: true},
|
|
20
|
+
{removeDesc: true},
|
|
21
|
+
{removeDimensions: true},
|
|
22
|
+
{removeAttrs: {attrs: ['class', '(stroke)']}}
|
|
23
|
+
],
|
|
24
|
+
multipass: true
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Reads an icon file off disk and optimizes it, saving to same location
|
|
29
|
+
* @param {string[]} filePaths array of relative file paths
|
|
30
|
+
* @param {SVGO} svgo SVGO instance with correct options
|
|
31
|
+
* @param {SingleBar} bar progress bar instance
|
|
32
|
+
* @return {Promise}
|
|
33
|
+
*/
|
|
34
|
+
function optimizeIcons (filePaths, svgo, bar) {
|
|
35
|
+
var num = 0;
|
|
36
|
+
return Promise.all(filePaths.map((path) => {
|
|
37
|
+
return fs.readFile(path, 'utf-8')
|
|
38
|
+
.then((svg) => svgo.optimize(svg, { path }))
|
|
39
|
+
.then((result) => {
|
|
40
|
+
num++;
|
|
41
|
+
bar.update(num);
|
|
42
|
+
return fs.writeFile(path, result.data, 'utf-8');
|
|
43
|
+
});
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Optimize a set of icons
|
|
49
|
+
* @param {string} files Glob pattern for icons source
|
|
50
|
+
* @param {boolean} remove Remove id attributes from output
|
|
51
|
+
* @return {Promise} Formatted object with all icon metadata
|
|
52
|
+
*/
|
|
53
|
+
module.exports = function (files, remove) {
|
|
54
|
+
if (!files) {
|
|
55
|
+
return Promise.resolve(true);
|
|
56
|
+
}
|
|
57
|
+
options.plugins[0] = {cleanupIDs: { remove }};
|
|
58
|
+
svgo = new SVGO(options);
|
|
59
|
+
return glob(files).then((iconPaths) => {
|
|
60
|
+
const format = " \x1b[32m {bar} {percentage}% | {value}/{total} \x1b[0m";
|
|
61
|
+
const bar = new progress.SingleBar({ format }, progress.Presets.shades_classic);
|
|
62
|
+
bar.start(iconPaths.length, 0);
|
|
63
|
+
return optimizeIcons(iconPaths, svgo, bar).then(() => {
|
|
64
|
+
bar.stop();
|
|
65
|
+
console.log("");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
package/bin/path-data.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const camelCase = require('camelcase');
|
|
2
|
+
const fs = require('fs-extra');
|
|
3
|
+
const glob = require('glob-promise');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const util = require('util');
|
|
6
|
+
const svgson = util.promisify(require('svgson'));
|
|
7
|
+
const version = require('../package.json').version;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Gets all important information about an icon.
|
|
11
|
+
* @param {string} svg - Path to icon file.
|
|
12
|
+
* @return {object} - Formatted object with all icon metadata
|
|
13
|
+
*/
|
|
14
|
+
function formatSVG (svg) {
|
|
15
|
+
let file = path.basename(svg.file);
|
|
16
|
+
let filled = file.indexOf('-f.svg') > -1;
|
|
17
|
+
return {
|
|
18
|
+
file,
|
|
19
|
+
filled,
|
|
20
|
+
paths: getPaths(svg.contents),
|
|
21
|
+
size: getSize(file),
|
|
22
|
+
variant: getVariant(file, filled)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Find the path(s) from an icon's svgson data
|
|
28
|
+
* @param {object} svg - Object as returned from svgson.
|
|
29
|
+
* @return {array} - Array of paths
|
|
30
|
+
*/
|
|
31
|
+
function getPaths (svg) {
|
|
32
|
+
const bbPaths = ['M0 0h16v16H0z', 'M0 0h24v24H0z', 'M0 0h32v32H0z'];
|
|
33
|
+
return svg.childs
|
|
34
|
+
.filter(child => child.name === 'path' && bbPaths.indexOf(child.attrs.d) === -1) // filter out bounding box paths
|
|
35
|
+
.map(child => ({ opacity: child.attrs.opacity, d: child.attrs.d }));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Find the base icon name
|
|
40
|
+
* @param {string} name - Icon filename
|
|
41
|
+
* @param {boolean} filled - Icon filename
|
|
42
|
+
* @return {array} - Icon filename without size, fill, or file extension
|
|
43
|
+
*/
|
|
44
|
+
function getVariant (name, filled) {
|
|
45
|
+
var noF = name.replace('-f.svg', '.svg');
|
|
46
|
+
return noF.substring(0, noF.length - 7) + (filled ? "-f" : "");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Find an icon's size
|
|
51
|
+
* @param {string} name - Icon filename
|
|
52
|
+
* @return {integer} - 16, 24, 36
|
|
53
|
+
*/
|
|
54
|
+
function getSize(name) {
|
|
55
|
+
var noF = name.replace('-f.svg', '.svg');
|
|
56
|
+
return parseInt(noF.substring(noF.length - 4, noF.length - 6), 10);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Read an icon from disc and get data as json
|
|
61
|
+
* @param {string} fileName - Icon filename (full path)
|
|
62
|
+
* @return {Promise} - Promise resolving to object which includes name and svgson data
|
|
63
|
+
*/
|
|
64
|
+
function readSVG (fileName) {
|
|
65
|
+
return new Promise(function(resolve, reject) {
|
|
66
|
+
fs.readFile(fileName, 'utf-8').then(function (svg) {
|
|
67
|
+
svgson(svg, {}, function (contents) {
|
|
68
|
+
resolve({file: fileName, contents});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = function generatePathFile () {
|
|
75
|
+
let banner = '// File generated automatically by path-data.js, do not edit directly\n';
|
|
76
|
+
let jsFile = `${banner}`;
|
|
77
|
+
let tsFile = `
|
|
78
|
+
${banner}
|
|
79
|
+
interface CalciteMultiPathEntry {
|
|
80
|
+
d: string;
|
|
81
|
+
opacity?: string;
|
|
82
|
+
}
|
|
83
|
+
export type CalciteIconPath = string | CalciteMultiPathEntry[];
|
|
84
|
+
`;
|
|
85
|
+
return glob('icons/*.svg')
|
|
86
|
+
.then(filePaths => Promise.all(filePaths.map(readSVG)))
|
|
87
|
+
.then(files => files.map(formatSVG))
|
|
88
|
+
.then(files => {
|
|
89
|
+
let icons = {};
|
|
90
|
+
let keywords = JSON.parse(fs.readFileSync('docs/keywords.json', 'utf-8'));
|
|
91
|
+
files.forEach(file => {
|
|
92
|
+
// add to json file
|
|
93
|
+
icons[file.variant] = icons[file.variant] || keywords[file.variant] || { alias: [], category: "", release: "" };
|
|
94
|
+
var icon = icons[file.variant];
|
|
95
|
+
const firstPath = file.paths[0] || { d: "" }; // back up for "blank" icon
|
|
96
|
+
const paths = file.paths.length > 1 ? file.paths : firstPath.d;
|
|
97
|
+
icon[file.size] = paths;
|
|
98
|
+
var base = file.variant.substring(0, file.variant.length - 2);
|
|
99
|
+
// make sure filled variants get the keywords from their standard counterpart
|
|
100
|
+
if (file.filled && !icon.release) {
|
|
101
|
+
const variantKeywords = keywords[base];
|
|
102
|
+
if (variantKeywords) {
|
|
103
|
+
icon.alias = variantKeywords.alias;
|
|
104
|
+
icon.category = variantKeywords.category;
|
|
105
|
+
icon.release = variantKeywords.release;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// add to ts and js files
|
|
109
|
+
const variant = file.variant.match(/^\d/) ? `i${file.variant}`: file.variant;
|
|
110
|
+
const camelCaseName = camelCase(`${file.filled ? base: variant }-${file.size}${ file.filled ? "-f" : ""}`);
|
|
111
|
+
jsFile += `export {${camelCaseName}} from "./js/${camelCaseName}.js";\n`;
|
|
112
|
+
|
|
113
|
+
let contents, tsContents;
|
|
114
|
+
if (typeof paths === "string") {
|
|
115
|
+
tsFile += `export const ${camelCaseName}: string;\n`;
|
|
116
|
+
contents = `export const ${camelCaseName} = "${paths}";\n`;
|
|
117
|
+
tsContents = `export const ${camelCaseName}: string;\n`;
|
|
118
|
+
} else {
|
|
119
|
+
icon.multiPath = true;
|
|
120
|
+
tsFile += `export const ${camelCaseName}: CalciteMultiPathEntry[];\n`;
|
|
121
|
+
contents = `export const ${camelCaseName} = ${JSON.stringify(paths)};\n`;
|
|
122
|
+
tsContents = `export const ${camelCaseName}: CalciteMultiPathEntry[];\n`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
fs.writeFile(`js/${camelCaseName}.js`, contents, 'utf8');
|
|
126
|
+
fs.writeFile(`js/${camelCaseName}.d.ts`, tsContents, 'utf8');
|
|
127
|
+
fs.writeFile(`js/${camelCaseName}.json`, JSON.stringify(paths), 'utf8');
|
|
128
|
+
});
|
|
129
|
+
let promises = [
|
|
130
|
+
fs.writeFile('docs/icons.json', JSON.stringify({ version, icons }), 'utf8'),
|
|
131
|
+
fs.writeFile('index.d.ts', tsFile, 'utf8'),
|
|
132
|
+
fs.writeFile('index.js', jsFile, 'utf8')
|
|
133
|
+
];
|
|
134
|
+
return Promise.all(promises);
|
|
135
|
+
});
|
|
136
|
+
};
|