Giter Site home page Giter Site logo

widgetbot-io / crate Goto Github PK

View Code? Open in Web Editor NEW
67.0 67.0 10.0 3.23 MB

Popup Discord widgets for your website ☄️

Home Page: https://docs.widgetbot.io/embed/crate/

License: GNU Affero General Public License v3.0

TypeScript 98.29% HTML 1.71%
crate hacktoberfest popup react widgetbot

crate's People

Contributors

advaith1 avatar alexprogrammerde avatar mason-rogers avatar samdenty avatar voakie avatar yomanz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crate's Issues

Floating Div causes issues

There's a floating div created by the widget which prevents clicking anything behind it. Super inconvenient on mobile specially.

image

Crate close button causes overlap when location changes

The close button in the default placement is neatly displayed to the right of message entry.

If moved to the top and left, the close button overlaps channel selection and is given priority.
If moved to the top and right, the close button overlaps join and is given priority.
If moved to the bottom and left, it overlaps a portion of message entry and is given priority.

I was unable to find an option for editing the location of the close button as part of the API, but the easiest solution appears to be hardcoding the close to the window, instead of moving it along with the crate button.

Mentions aren't rendered in crate notifications

Mentions (user mention, channel mention or role mention) aren't formatted in the small popup message of the crate.
Custom emotes also aren't formatted, which probably would be difficult to do tho.

image

Crate Notifications from multiple channels

I used to have a notification channel that pulled information from multiple different sources, and the Crate on my website served as a handy tool for users to see these notifications occur in realtime. However, because of how different all of those notifications were, I had to split them up into separate channels. Now, the Crate only listens and posts notifications from a single channel.

Would it be possible to allow Crate to listen and post notifications from a group of channels? I know you have to specify a channel when setting it up, and that's the one that initially renders, so this may be out of the scope of it, but figured I would open a FR to at least see if that could be done or even made sense.

Events emitted by Crate

It would be really good to have some events emitted by the Crate object which could be used by the app/website where it's installed. Example:

create.on('ready', (data) => {
   console.log('App is ready', data)
})

Personally I'd like to be able to see an event when the app is ready and is displaying first batch of messages. This way my app could display custom preloading animation and only show the widget when it's ready to use.

Discord API comes with a whole set of events so maybe that's a good starting point to move them over to crate.

Crate doesn't load properly sometimes

I've been having this issue recently, once in a while Crate just doesn't load and shows a tall WidgetBot embed in the bottom right corner. I see this once in a while and today one of our users reported it.
Screenshot
Also, the notification count badge shows in the top right corner of the screen.

[Reopen] Crate not working with Content Security Policy

I am reopening #13 since I think I have found an instance of eval that is not negated by setting "no-eval"=true.

In src/util/validate/index.ts Line 62, there is an eval that I don't quite understand the purpose of. However, it seems this code is there to validate options to Crate?

Perhaps it can be made optional or this eval removed another way?

This small change will I believe solve much of the problems with using CSP!

i can't run widgetbot because of this error:

I have tried running this application ,but I am faced with this problem:

error: unknown option '-d'

It creates the "dist" folder but the rest seems to be unsolved as "-d" remains an unknown command.

Usage with Vue

I'm trying to integrate the Crate button with my existing Vue application (via a Nuxt plugin), however it seems to not work properly

import Crate from '@widgetbot/crate';

export default ({app}) => {
    app.$crate = new Crate({
      // options
    });
};

Which results in the following error(s) (mostly seeming to be related to it not being a React app?)
errors

From my looking at the examples, something like this should be working fine, although those pull in via a script tag, so it could be a different situation.

Crate not working with Content Security Policy

Hi, I'm trying to add crate to my site and CSP is blocking the script because it uses eval()
It will be nice if you can remove eval() from the script.

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive

eval() - JavaScript MDN

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.