missive / emoji-mart

🏪 One component to pick them all
https://missiveapp.com/open/emoji-mart
MIT License
8.67k stars 835 forks source link

Serving from other source than unpkg.com #553

Closed theunreal closed 2 years ago

theunreal commented 2 years ago

Due to security concerns, it's not that safe to whitelist all unpkg.com domains from applications, Is there any workaround to load the emojis from somewhere else (e.g locally path?)

Thanks!

Tanmayshetty commented 2 years ago

@theunreal Please refer backgroundImageFn prop and the following issue image

https://github.com/missive/emoji-mart/issues/413#issuecomment-587141570

<Picker
  backgroundImageFn={(set, sheetSize) => {
    return '/assets/sheet.png'
  }}
/>
dpatra commented 2 years ago

backgroundImageFn Not working in v5.1.0

dpatra commented 2 years ago

To assign a local sheet, it works like the following in v5.1.0

import spriteSheet from '../../assets/emoji/14_apple_sheets_256_64.png';

....

<Picker
getSpritesheetURL={() => {
        return spriteSheet;
    }}
/>
VictorYeung0725 commented 7 months ago

@theunreal Please refer backgroundImageFn prop and the following issue image

#413 (comment)

<Picker
  backgroundImageFn={(set, sheetSize) => {
    return '/assets/sheet.png'
  }}
/>

is this props still avaliable now 2024? i did not found this props in the documentation but still need to use local image

VictorYeung0725 commented 7 months ago

getSpritesheetURL={() => { return spriteSheet; }}

thank you @dpatra after apply this it atually did not fetch another network request but the picker lost emoji resulting no emoji show up in picker but still are able to select

Screenshot from 2024-04-18 11-00-30

did you encounter this issue ?