MCPcopy Index your code
hub / github.com/charliewilco/react-gluejar

github.com/charliewilco/react-gluejar @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
21 symbols 32 edges 4 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

React Gluejar

Collects the images you paste from your clipboard.

Demo using react-gluejar

Installation

yarn add @charliewilco/gluejar

Example

import React, { Component } from 'react'
import { Gluejar } from '@charliewilco/gluejar'

class App extends Component {
  render() {
    return (
      <Gluejar onPaste={files => console.log(files)} onError={err => console.error(err)}>
        {({ images }) =>
          images.length > 0 &&
          images.map(image => <img src={image} key={image} alt={`Pasted: ${image}`} />)
        }
      </Gluejar>
    )
  }
}

Run this example locally by cloning the repo and running yarn example in the root directory. You can visit the example here.

Usage

Available Props

Prop Type Description Default
onPaste Function returns Array of image Blobs, responds to events () => null
onError Function returns error messages () => null
children Function returns Array of history of pasted images N/A
acceptedFiles Array<String> Array of accepted files to check for ['image/gif', 'image/png', 'image/jpeg', 'image/bmp']
container Element Element object to listen on window

Browser Support

Browser Support
Chrome 👍
IE 👎
Firefox 🙄
Edge 👍
Safari 👍
Opera 👍

🙄 = Look there's something going on in Firefox for a while. You can read the tracking issue here, but I don't insight into their timeline or priority.

Extension points exported contracts — how you extend this code

GlueJarOptions (Interface)
(no doc)
src/index.ts
GluejarState (Interface)
(no doc)
src/legacy.ts
IGlueJarState (Interface)
(no doc)
src/index.ts
GluejarProps (Interface)
(no doc)
src/legacy.ts

Core symbols most depended-on inside this repo

_transformImageDataToURL
called by 1
src/index.ts
isValidFormat
called by 1
src/index.ts
useGlueJarReducer
called by 1
src/index.ts
usePasteHandler
called by 1
src/index.ts
useGlueJar
called by 1
src/index.ts
render
called by 1
src/legacy.ts
App
called by 0
example/pastecontainer.tsx
Header
called by 0
example/header.tsx

Shape

Function 10
Interface 4
Method 4
Class 2
Enum 1

Languages

TypeScript100%

Modules by API surface

src/index.ts9 symbols
src/legacy.ts8 symbols
example/header.tsx3 symbols
example/pastecontainer.tsx1 symbols

For agents

$ claude mcp add react-gluejar \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact