I hereby claim:
- I am sparragus on github.
- I am sparragus (https://keybase.io/sparragus) on keybase.
- I have a public key ASDsUBYFM9SpfxO-VHvZS506acdWkyN1lpzyu-eUVQN3dAo
To claim this, I am signing this object:
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
I hereby claim:
To claim this, I am signing this object:
{"lastUpload":"2020-02-11T14:33:38.015Z","extensionVersion":"v3.4.3"} |
{"lastUpload":"2020-02-11T14:32:55.527Z","extensionVersion":"v3.4.3"} |
import React from 'react'; | |
import useQuery from './useQuery.js'; | |
import * as api from './api.js'; | |
function LoadingPage () { | |
return <div>Loading...</div> | |
} | |
function ErrorPage ({ error }) { | |
return <div>Error: {error.message}</div> |
import { readAuthCookie } from '../helpers/cookie'; | |
import * as errorTracker from '../helpers/errorTracker'; | |
/* | |
Helpers | |
*/ | |
const BASE_PATH = '/api/v1'; | |
class APIError extends Error { | |
constructor(res, data) { |
In order to add custom attributes to an HTML element that is generated by GrapesJS, one can simply make use of traits. For example, if you wish to produce an HTML element which contains the tag data-noout
, a trait with the name data-noout
can be added to a custom component.
var domComps = editor.DomComponents;
var dType = domComps.getType('default');
var dModel = dType.model;
// Icon.js | |
import React from 'react' | |
export default function Icon ({ name }) { | |
const className = `icon-${name}` | |
return ( | |
<i className={className} /> | |
) | |
} |
// Icon.test.js | |
import React from 'react' | |
import { shallow } from 'enzyme' | |
import Icon from './Icon' | |
describe('Icon', () => { | |
let tree, props | |
const buildTree = (newProps = {}) => { |
const JSXELEMENT_CHILDREN = [ | |
'JSXText', | |
'JSXExpressionContainer', | |
'JSXSpreadChild', | |
'JSXElement', | |
'JSXFragment' | |
] | |
const isJSXElementChildrenType = x => x && JSXELEMENT_CHILDREN.includes(x.type) | |
module.exports = { |