diff --git a/.github/workflows/optimize-svgs.yml b/.github/workflows/optimize-svgs.yml new file mode 100644 index 000000000..71044b4b9 --- /dev/null +++ b/.github/workflows/optimize-svgs.yml @@ -0,0 +1,37 @@ +name: optimize-svgs +run-name: Optimize SVG size with SVGO +on: + push: + branches: + - main + paths: + - '**.svg' + pull_request: + paths: + - '**.svg' + +permissions: + contents: write + pull-requests: write + +jobs: + run-svgo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ericcornelissen/svgo-action@v4 + id: svgo + with: + repo-token: ${{secrets.GITHUB_TOKEN}} + svgo-version: 3 + - name: Commit optimizations + uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{steps.svgo.outputs.DID_OPTIMIZE}} + with: + commit_message: Optimize ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s) + - name: Comment on Pull Request + uses: thollander/actions-comment-pull-request@v1 + if: ${{steps.svgo.outputs.DID_OPTIMIZE && github.event_name == 'pull_request'}} + with: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + message: Optimized ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s) \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e079bd483..6c6e5b36f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ have good reasons for rejecting. If you'd like to test and/or contribute please follow these instructions. -[Fork this repo on GitHub](https://github.com/twitter/twemoji.git/fork) +[Fork this repo on GitHub](https://github.com/jdecked/twemoji.git/fork) ### Setup diff --git a/LEGACY.md b/LEGACY.md index 17b4e57ed..2c2a73d96 100644 --- a/LEGACY.md +++ b/LEGACY.md @@ -4,15 +4,11 @@ ### CDN Support -The folks over at [MaxCDN](https://www.maxcdn.com) have graciously provided CDN support. +Previously, MaxCDN provided support for V1 of the Twemoji API. MaxCDN shut down on December 31, 2022. -Use the following in the `` tag of your HTML document(s): +Support for V1 of the Twemoji API is no longer available and is not planned. Please migrate to V2. -```html - -``` - -This guarantees that you are using the V1 version of the library. +The rest of this README is kept around for historical purposes and may not work as described. ### Download diff --git a/README.md b/README.md index d7a93bc33..c34d6f498 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,19 @@ The Twemoji library offers support for all Unicode-defined emoji which are recom ### CDN Support -The folks over at [MaxCDN](https://www.maxcdn.com) have graciously provided CDN support. - -MaxCDN is shut down right now, so in the meanwhile use a different CDN or download the assets. (See [Maxcdn has shut down, cdn not working anymore. · Issue #580 · twitter/twemoji](https://github.com/twitter/twemoji/issues/580)). +Default CDN support is provided via [jsDelivr](https://www.jsdelivr.com/). Use the following in the `` tag of your HTML document(s): ```html - + ``` This guarantees that you will always use the latest version of the library. If, instead, you'd like to include the latest version explicitly, you can add the following tag: ```html - + ``` ### Download @@ -39,9 +37,9 @@ Following are all the methods exposed in the `twemoji` namespace. This is the main parsing utility and has 3 overloads per parsing type. -Although there are two kinds of parsing supported by this utility, we recommend you use [DOM parsing](https://github.com/twitter/twemoji#dom-parsing), explained below. Each type of parsing accepts a callback to generate an image source or an options object with parsing info. +Although there are two kinds of parsing supported by this utility, we recommend you use [DOM parsing](https://github.com/jdecked/twemoji#dom-parsing), explained below. Each type of parsing accepts a callback to generate an image source or an options object with parsing info. -The second kind of parsing is string parsing, explained in the legacy documentation [here](https://github.com/twitter/twemoji/blob/master/LEGACY.md#string-parsing). This is unrecommended because this method does not sanitize the string or otherwise prevent malicious code from being executed; such sanitization is out of scope. +The second kind of parsing is string parsing, explained in the legacy documentation [here](https://github.com/jdecked/twemoji/blob/master/LEGACY.md#string-parsing). This is unrecommended because this method does not sanitize the string or otherwise prevent malicious code from being executed; such sanitization is out of scope. #### DOM parsing @@ -61,7 +59,7 @@ var img = div.querySelector('img'); // note the div is preserved img.parentNode === div; // true -img.src; // https://twemoji.maxcdn.com/v/latest/72x72/2764.png +img.src; // https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/72x72/2764.png img.alt; // \u2764\uFE0F img.className; // emoji img.draggable; // false @@ -78,7 +76,7 @@ Here's the list of properties accepted by the optional object that can be passed { callback: Function, // default the common replacer attributes: Function, // default returns {} - base: string, // default MaxCDN + base: string, // default jsDelivr ext: string, // default ".png" className: string, // default "emoji" size: string|number, // default "72x72" @@ -136,7 +134,7 @@ twemoji.parse(genericNode, { }); ``` -This will generate urls such `https://twemoji.maxcdn.com/svg/2764.svg` instead of using a specific size based image. +This will generate urls such `https://cdn.jsdelivr.net/gh/jdecked/twemoji@latest/assets/svg/2764.svg` instead of using a specific size based image. ## Utilities @@ -208,11 +206,11 @@ twemoji.parse(document.body, { ## Legacy API (V1) -If you're still using our V1 API, you can read our legacy documentation [here](https://github.com/twitter/twemoji/tree/master/LEGACY.md). +If you're still using our V1 API, you can read our legacy documentation [here](https://github.com/jdecked/twemoji/tree/master/LEGACY.md). ## Contributing -The contributing documentation can be found [here](https://github.com/twitter/twemoji/tree/master/CONTRIBUTING.md). +The contributing documentation can be found [here](https://github.com/jdecked/twemoji/tree/master/CONTRIBUTING.md). ## Attribution Requirements @@ -242,8 +240,8 @@ However, we consider the guide a bit onerous and as a project, will accept a men ## Committers and Contributors -* Justine De Caires (Twitter) -* Jason Sofonia (Twitter) +* Justine De Caires (ex-Twitter) +* Jason Sofonia (ex-Twitter) * Bryan Haggerty (ex-Twitter) * Nathan Downs (ex-Twitter) * Tom Wuttke (ex-Twitter) @@ -255,7 +253,7 @@ The goal of this project is to simply provide emoji for everyone. We definitely The rules for contributing are available in the `CONTRIBUTING.md` file. -Thank you to all of our [contributors](https://github.com/twitter/twemoji/graphs/contributors). +Thank you to all of our [contributors](https://github.com/jdecked/twemoji/graphs/contributors). ## License diff --git a/assets/72x72/1f1f2-1f1fe.png b/assets/72x72/1f1f2-1f1fe.png index 108dd99da..ee84ec4d6 100644 Binary files a/assets/72x72/1f1f2-1f1fe.png and b/assets/72x72/1f1f2-1f1fe.png differ diff --git a/assets/72x72/1f301.png b/assets/72x72/1f301.png index ff0622f54..aef27ad58 100644 Binary files a/assets/72x72/1f301.png and b/assets/72x72/1f301.png differ diff --git a/assets/72x72/1f3e5.png b/assets/72x72/1f3e5.png index 5781697a9..b038bb58e 100644 Binary files a/assets/72x72/1f3e5.png and b/assets/72x72/1f3e5.png differ diff --git a/assets/72x72/1f50f.png b/assets/72x72/1f50f.png index bd5af0edf..9651c3848 100644 Binary files a/assets/72x72/1f50f.png and b/assets/72x72/1f50f.png differ diff --git a/assets/72x72/1f510.png b/assets/72x72/1f510.png index 8ba2a9f00..e1366af45 100644 Binary files a/assets/72x72/1f510.png and b/assets/72x72/1f510.png differ diff --git a/assets/72x72/1f512.png b/assets/72x72/1f512.png index 4a91357b5..b5d9e2334 100644 Binary files a/assets/72x72/1f512.png and b/assets/72x72/1f512.png differ diff --git a/assets/72x72/1f513.png b/assets/72x72/1f513.png index ac2f5865f..2b69f8f94 100644 Binary files a/assets/72x72/1f513.png and b/assets/72x72/1f513.png differ diff --git a/assets/72x72/1f691.png b/assets/72x72/1f691.png index bf6e87894..154fafae9 100644 Binary files a/assets/72x72/1f691.png and b/assets/72x72/1f691.png differ diff --git a/assets/72x72/1f979.png b/assets/72x72/1f979.png old mode 100755 new mode 100644 index 8410ca858..d109b1645 Binary files a/assets/72x72/1f979.png and b/assets/72x72/1f979.png differ diff --git a/assets/72x72/1f97a.png b/assets/72x72/1f97a.png index e3c26b3dc..b1cc8fb71 100644 Binary files a/assets/72x72/1f97a.png and b/assets/72x72/1f97a.png differ diff --git a/assets/svg/1f1f2-1f1fe.svg b/assets/svg/1f1f2-1f1fe.svg index 0480330cd..29a3e3f79 100644 --- a/assets/svg/1f1f2-1f1fe.svg +++ b/assets/svg/1f1f2-1f1fe.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f301.svg b/assets/svg/1f301.svg index d6298de42..dfec94836 100644 --- a/assets/svg/1f301.svg +++ b/assets/svg/1f301.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f3e5.svg b/assets/svg/1f3e5.svg index 0b2748a52..33884c8ce 100644 --- a/assets/svg/1f3e5.svg +++ b/assets/svg/1f3e5.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f50f.svg b/assets/svg/1f50f.svg index d2ae4863c..d4e864daa 100644 --- a/assets/svg/1f50f.svg +++ b/assets/svg/1f50f.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f510.svg b/assets/svg/1f510.svg index 014079e8b..45f288f10 100644 --- a/assets/svg/1f510.svg +++ b/assets/svg/1f510.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f512.svg b/assets/svg/1f512.svg index 378fabf40..4cd1facae 100644 --- a/assets/svg/1f512.svg +++ b/assets/svg/1f512.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f513.svg b/assets/svg/1f513.svg index cd82ec8e3..b9ffd7b93 100644 --- a/assets/svg/1f513.svg +++ b/assets/svg/1f513.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f691.svg b/assets/svg/1f691.svg index 844dd40f0..e6b1cc7ba 100644 --- a/assets/svg/1f691.svg +++ b/assets/svg/1f691.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f979.svg b/assets/svg/1f979.svg old mode 100755 new mode 100644 index 1944a5463..fff924319 --- a/assets/svg/1f979.svg +++ b/assets/svg/1f979.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/svg/1f97a.svg b/assets/svg/1f97a.svg index fe9336084..3240471fb 100644 --- a/assets/svg/1f97a.svg +++ b/assets/svg/1f97a.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/bower.json b/bower.json index a131d1409..a9b75c187 100644 --- a/bower.json +++ b/bower.json @@ -12,8 +12,8 @@ "!LICENSE", "!README.md" ], - "twemoji": "git://github.com/twitter/twemoji.git#gh-pages", - "homepage": "https://github.com/twitter/twemoji", + "twemoji": "git://github.com/jdecked/twemoji.git#gh-pages", + "homepage": "https://github.com/jdecked/twemoji", "authors": [ "Twitter, Inc." ], diff --git a/component.json b/component.json index 7b51b0e57..3b8c81df9 100644 --- a/component.json +++ b/component.json @@ -3,7 +3,7 @@ "name": "twemoji", "license": ["MIT", "CC-BY-4.0"], "description": "A Unicode standard based way to implement emoji across all platforms.", - "homepage": "https://github.com/twitter/twemoji", + "homepage": "https://github.com/jdecked/twemoji", "keywords": [ "emoji", "DOM", diff --git a/index.d.ts b/index.d.ts index da76b2cef..c8d73da21 100644 --- a/index.d.ts +++ b/index.d.ts @@ -13,7 +13,7 @@ export type ReplacerFunction = (substring: string, ...args: any[]) => string; export type TwemojiOptions = { /** - * Default: Cloudflare + * Default: jsDelivr */ base?: string; /** diff --git a/index.html b/index.html index 6649d8171..3fba9e440 100644 --- a/index.html +++ b/index.html @@ -35,7 +35,7 @@

Twem❤ji

Sharing Twitter emoji everywhere

Version 14.0 Is Out!

-

Grab me on GitHub ↗

+

Grab me on GitHub ↗

Tweet #TwemojiParty @@ -44,7 +44,7 @@

Twem❤ji

Code licensed under MIT. Graphics licensed under CC-BY

- + +