0.9.8 • Published 4 years ago

@superblocks-at/devtools v0.9.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@superblocks-at/devtools

Airtable blocks dev tools - an npm package that can be added to any block and includes the following tools:

  1. A GlobalConfig editor - so you can view AND edit global config in development mode AND in release mode.

  2. A blocks api explorer - with support for viewing the property values of the following models, exactly as you get them from the api:

  • Base
  • Active table
  • Active view
  • Selected record
  • Selected field
  • Cursor
  • Session
  • Viewport

Installation

In your custom block folder:

npm install @superblocks-at/devtools --save

Usage

import React from "react";
import { initializeBlock } from "@airtable/blocks/ui";

import { Devtools } from "@superblocks-at/devtools";

function BlockWithDevtools {
	// Wrap Devtools around your block code or put it wherever you want in your main component.
	// It will just work.
	return <Devtools>
		<MyBlock/>
	</Devtools>;

	// Another way of using Devtools
	// return <>
		// <Devtools/>
		// <MyBlock/>
	// </>;
}

initializeBlock(() => <BlockWithDevtools />);

To open and close devtools, press 'ddd' quick 3 times.

Devtools options / props

import { Devtools, Position} from "@superblocks-at/devtools";


<Devtools
  shortcutKey="d",
  timeout={500},
  position ={Position.bottom},
  overlap={100}
/>
Prop nameDescriptionDefault value
shortcutKeyThe key to press 3 times to open/close devtools"d"
timeoutThe max period between keystrokes in milliseconds before keystroke count is reset500
positionWhere to display devtools: bottom, left, top or rightPosition.bottom
overlapHow much of the block width or height the devtools ui overlaps100 (percent)

LICENSE

MIT

Contributions

Are more than welcome. The goal is to have the community expand the package with additional tools that can increase the productivity of Airtable custom blocks developers. Some ideas that come to mind:

  • Add Links to the relevant blocks api documentation section wherever appropriate.
  • Add the ability to execute api functions which also shows correct usage through pre-populated code snippets.

Development environment setup instructions for contributors

See the devtools-dev-env repo for instructions.

0.9.8

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago