Giter Site home page Giter Site logo

44px / widget-kit Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 4.0 510 KB

A set of utilities for embeddable widgets

Home Page: https://44px.github.io/widget-kit/

License: MIT License

JavaScript 9.23% TypeScript 90.77%
iframe postmessage cross-domain embed iframe-embeds widget popup chat widget-kit

widget-kit's Introduction

widget-kit

A set of utilities for embeddable widgets — apps which are installed on a wide range of different sites. They have to work in unpredictable environment and interact with external code. widget-kit aims to make these tasks easier.

What's included

@widget-kit/rpc

npm gzip size

Establishes connection between two windows allowing both to send and handle requests.

@widget-kit/container

npm gzip size

Loads widget into iframe to isolate it from site’s CSS and provide own JS context. This package bundles @widget-kit/rpc so widget and site can communicate.

If you are building widget from scratch you can start with container and use plugins for common tasks:

@widget-kit/container-plugin-size

npm gzip size

Change iframe size from widget (example).

@widget-kit/container-plugin-position-fixed

npm gzip size

Control iframe position relative to viewport. Useful for widgets which "floats" on a page, like chats and popups.

Development

npm install — install common dev dependencies and each package dependencies

npm run bootstrap — install dependencies for packages and create symlinks

npm test — run tests for all packages

widget-kit's People

Contributors

44px avatar

Stargazers

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

Watchers

 avatar

widget-kit's Issues

Changes to packages are not picked up

Hi there,

I am trying to add a simple box shadow to my iframe. So in packages/container/src/container.ts I set iframe.style.boxShadow = "rgb(0 0 0 / 15%) 0px 2px 10px;"

However, these changes are not picked up. I've tried to run npm install and npm run bootstrap but they don't help either.

Ive also tried to change the examples/package.json to point to local file versions such as "@widget-kit/container": "file:../packages/container", - but this does not work either.

Any suggestions on how to develop and make changes to the packages during development and have it all linked locally rather than from npm?

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.