GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - betteridea-dev/codecell: Portable BetterIDEa code cells

This repository was archived by the owner on Dec 16, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

45 Commits
45 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.node.json
tsconfig.node.json
 
 
vite.config.ts
vite.config.ts
 
 
vite.config.ts.timestamp-1718890642315-1faf2aee25154.mjs
vite.config.ts.timestamp-1718890642315-1faf2aee25154.mjs
 
 

Repository files navigation

BetterIDEa CodeCell

Now you can integrate our code cells into your webapps and run AO LUA anywhere 🎉

npm downloads X Follow

Installation

npm install @betteridea/codecell

API

<CodeCell .../>

A react component to render a code cell in your app.

Props

Prop Type Description
cellId string Unique id for the cell
appName string Unique app name
code string Initial code for the cell
nowallet boolean Set this to true if you dont want to use a web wallet, and generate a local jwk file (works on mobile) Recommended for playgrounds
enableToasts boolean Set this to true if you want to enable toast notifications for the cell
onAOProcess (pid:string) => void Callback function that run whenever a process is is loaded
onNewMessage (msgs: msg[]) => void Callback function, runs whenever process gets new messages
onInbox (inbox: msg[]) => void Callback function, runs whenever Inbox is received after calling getInbox()
width string Width of the cell
height string Height of the cell
className string Class names for styling
style React.CSSProperties Inline styles
devMode boolean Boolean to enable dev mode

getInbox(...)

Fetches latest Inbox messages from the process.

Arguments

Argument Type Description
cellId string Unique id of the cell
devMode boolean Boolean to enable dev mode

setCellCode(...)

To update the code in a cell, after it has been rendered. It is discouraged to update code by changing the code prop directly, since it re-renders the webview, again this is personal preference.

Arguments

Argument Type Description
cellId string Unique id of the cell
code string Code to set in the cell
devMode boolean Boolean to enable dev mode

Usage

import { CodeCell } from '@betteridea/codecell';

// in your react app
<CodeCell
  cellId="1"
  appName="BetterIDEa-Code-Cell"
  code="print('Portable code cell ftw!')"
  onAOProcess={(pid)=> console.log("using process: ", pid)}
  onNewMessage={(msgs) => console.log("new messages: ", msgs)}
  onInbox={(inbox) => console.log("got inbox: ", inbox)}
/>

To update the cell with a different code snippet, you can use the setCellCode function.

import { setCellCode, getInbox } from '@betteridea/codecell';

...

// This will update the code in the cell with the id provided
setCellCode("1", "print('Updated code!')");

// This will fetch the latest inbox messages from the process
getInbox("1");
// as soon as the inbox is received, onInbox callback will be called
Deprecation Warning

runCell() function has been deprecated due to security reasons, since it might be possible anyone can run some mischevious code in your process without you knowing.

runCell(...) (deprecated due to security reasons)

To run the code in a cell, after it has been rendered (optional, since the cell already has a run button)

Arguments

  • cellId - Unique id of the cell to run
  • devMode - Boolean to enable dev mode
import { runCell } from '@betteridea/codecell';

...

// This will run whatever code is typed in the cell with the id provided
runCell("1");

Developing

To start the vite development server, run:

cd packages/codecell
npm install
npm run dev

then make changes to the component and run function and test them in the vite app at http://localhost:5173

  1. CodeCell component -> ./src/components/CodeCell.tsx

  2. Library functions -> ./src/lib

  3. /codecell webview -> next_app/src/pages/codecell.tsx

The package is essentially a wrapper around https://ide.betteridea.dev/codecell route from the main IDE to run code in any webapp through a webview.

About

Portable BetterIDEa code cells

www.npmjs.com/package/@betteridea/codecell

Topics

aoarweavebetterideacodecellportable

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.