Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remirror/react-renderer

Package Overview
Dependencies
Maintainers
1
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remirror/react-renderer - npm Package Compare versions

Comparing version 0.0.0-pr706.8 to 0.0.0-pr706.9

dist/declarations/src/handlers/heading.d.ts

64

dist/remirror-react-renderer.browser.cjs.js

@@ -9,4 +9,4 @@ 'use strict';

var core = require('@remirror/core');
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');
var jsxRuntime = require('react/jsx-runtime');
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');

@@ -85,2 +85,60 @@ var normalizeMark = mark => core.isString(mark) ? {

var Heading = props => {
var _ref, _props$node$attrs;
var content = props.node.content;
if (!content) {
return null;
}
var children = content.map((node, ii) => {
return /*#__PURE__*/jsxRuntime.jsx(TextHandler, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
node
})), ii);
});
var level = (_ref = (_props$node$attrs = props.node.attrs) === null || _props$node$attrs === void 0 ? void 0 : _props$node$attrs.level) !== null && _ref !== void 0 ? _ref : 1;
return /*#__PURE__*/react.createElement("h".concat(level), null, children);
};
var createIFrameHandler = overwriteAttrs => {
var iframeHandler = props => {
var _props$node$attrs;
// Remove remirror-internal attributes
var _ref = (_props$node$attrs = props.node.attrs) !== null && _props$node$attrs !== void 0 ? _props$node$attrs : {},
allowFullScreen = _ref.allowFullScreen;
_ref.type;
var attrs = _objectWithoutProperties(_ref, ["allowFullScreen", "type"]);
var normalizedAttrs = _objectSpread(_objectSpread({}, attrs), {}, {
// Prevent React error that allowFullScreen must be boolean (but is string in remirror)
allowFullScreen: allowFullScreen !== 'false'
}, overwriteAttrs);
return /*#__PURE__*/jsxRuntime.jsx("iframe", _objectSpread({}, normalizedAttrs));
};
return iframeHandler;
};
var createLinkHandler = overwriteAttrs => {
var linkHandler = (_ref) => {
var href = _ref.href,
target = _ref.target,
children = _ref.children;
var normalizedAttrs = _objectSpread({
href,
target: target !== null && target !== void 0 ? target : undefined
}, overwriteAttrs);
return /*#__PURE__*/jsxRuntime.jsx("a", _objectSpread(_objectSpread({}, normalizedAttrs), {}, {
children: children
}));
};
return linkHandler;
};
var Doc = (_ref) => {

@@ -113,3 +171,5 @@ var _node$attrs;

doc: Doc,
heading: Heading,
paragraph: 'p',
iframe: createIFrameHandler(),
image: 'img',

@@ -125,3 +185,3 @@ hardBreak: 'br',

code: 'code',
link: 'a',
link: createLinkHandler(),
underline: 'u'

@@ -128,0 +188,0 @@ };

@@ -5,4 +5,4 @@ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';

import { isString, isEmptyArray, object } from '@remirror/core';
import _createForOfIteratorHelper from '@babel/runtime/helpers/esm/createForOfIteratorHelper';
import { jsx } from 'react/jsx-runtime';
import _createForOfIteratorHelper from '@babel/runtime/helpers/esm/createForOfIteratorHelper';

@@ -81,2 +81,60 @@ var normalizeMark = mark => isString(mark) ? {

var Heading = props => {
var _ref, _props$node$attrs;
var content = props.node.content;
if (!content) {
return null;
}
var children = content.map((node, ii) => {
return /*#__PURE__*/jsx(TextHandler, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
node
})), ii);
});
var level = (_ref = (_props$node$attrs = props.node.attrs) === null || _props$node$attrs === void 0 ? void 0 : _props$node$attrs.level) !== null && _ref !== void 0 ? _ref : 1;
return /*#__PURE__*/createElement("h".concat(level), null, children);
};
var createIFrameHandler = overwriteAttrs => {
var iframeHandler = props => {
var _props$node$attrs;
// Remove remirror-internal attributes
var _ref = (_props$node$attrs = props.node.attrs) !== null && _props$node$attrs !== void 0 ? _props$node$attrs : {},
allowFullScreen = _ref.allowFullScreen;
_ref.type;
var attrs = _objectWithoutProperties(_ref, ["allowFullScreen", "type"]);
var normalizedAttrs = _objectSpread(_objectSpread({}, attrs), {}, {
// Prevent React error that allowFullScreen must be boolean (but is string in remirror)
allowFullScreen: allowFullScreen !== 'false'
}, overwriteAttrs);
return /*#__PURE__*/jsx("iframe", _objectSpread({}, normalizedAttrs));
};
return iframeHandler;
};
var createLinkHandler = overwriteAttrs => {
var linkHandler = (_ref) => {
var href = _ref.href,
target = _ref.target,
children = _ref.children;
var normalizedAttrs = _objectSpread({
href,
target: target !== null && target !== void 0 ? target : undefined
}, overwriteAttrs);
return /*#__PURE__*/jsx("a", _objectSpread(_objectSpread({}, normalizedAttrs), {}, {
children: children
}));
};
return linkHandler;
};
var Doc = (_ref) => {

@@ -109,3 +167,5 @@ var _node$attrs;

doc: Doc,
heading: Heading,
paragraph: 'p',
iframe: createIFrameHandler(),
image: 'img',

@@ -121,3 +181,3 @@ hardBreak: 'br',

code: 'code',
link: 'a',
link: createLinkHandler(),
underline: 'u'

@@ -124,0 +184,0 @@ };

@@ -9,4 +9,4 @@ 'use strict';

var core = require('@remirror/core');
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');
var jsxRuntime = require('react/jsx-runtime');
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');

@@ -85,2 +85,60 @@ var normalizeMark = mark => core.isString(mark) ? {

var Heading = props => {
var _ref, _props$node$attrs;
var content = props.node.content;
if (!content) {
return null;
}
var children = content.map((node, ii) => {
return /*#__PURE__*/jsxRuntime.jsx(TextHandler, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
node
})), ii);
});
var level = (_ref = (_props$node$attrs = props.node.attrs) === null || _props$node$attrs === void 0 ? void 0 : _props$node$attrs.level) !== null && _ref !== void 0 ? _ref : 1;
return /*#__PURE__*/react.createElement("h".concat(level), null, children);
};
var createIFrameHandler = overwriteAttrs => {
var iframeHandler = props => {
var _props$node$attrs;
// Remove remirror-internal attributes
var _ref = (_props$node$attrs = props.node.attrs) !== null && _props$node$attrs !== void 0 ? _props$node$attrs : {},
allowFullScreen = _ref.allowFullScreen;
_ref.type;
var attrs = _objectWithoutProperties(_ref, ["allowFullScreen", "type"]);
var normalizedAttrs = _objectSpread(_objectSpread({}, attrs), {}, {
// Prevent React error that allowFullScreen must be boolean (but is string in remirror)
allowFullScreen: allowFullScreen !== 'false'
}, overwriteAttrs);
return /*#__PURE__*/jsxRuntime.jsx("iframe", _objectSpread({}, normalizedAttrs));
};
return iframeHandler;
};
var createLinkHandler = overwriteAttrs => {
var linkHandler = (_ref) => {
var href = _ref.href,
target = _ref.target,
children = _ref.children;
var normalizedAttrs = _objectSpread({
href,
target: target !== null && target !== void 0 ? target : undefined
}, overwriteAttrs);
return /*#__PURE__*/jsxRuntime.jsx("a", _objectSpread(_objectSpread({}, normalizedAttrs), {}, {
children: children
}));
};
return linkHandler;
};
var Doc = (_ref) => {

@@ -113,3 +171,5 @@ var _node$attrs;

doc: Doc,
heading: Heading,
paragraph: 'p',
iframe: createIFrameHandler(),
image: 'img',

@@ -125,3 +185,3 @@ hardBreak: 'br',

code: 'code',
link: 'a',
link: createLinkHandler(),
underline: 'u'

@@ -128,0 +188,0 @@ };

@@ -9,4 +9,4 @@ 'use strict';

var core = require('@remirror/core');
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');
var jsxRuntime = require('react/jsx-runtime');
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');

@@ -85,2 +85,60 @@ var normalizeMark = mark => core.isString(mark) ? {

var Heading = props => {
var _ref, _props$node$attrs;
var content = props.node.content;
if (!content) {
return null;
}
var children = content.map((node, ii) => {
return /*#__PURE__*/jsxRuntime.jsx(TextHandler, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
node
})), ii);
});
var level = (_ref = (_props$node$attrs = props.node.attrs) === null || _props$node$attrs === void 0 ? void 0 : _props$node$attrs.level) !== null && _ref !== void 0 ? _ref : 1;
return /*#__PURE__*/react.createElement("h".concat(level), null, children);
};
var createIFrameHandler = overwriteAttrs => {
var iframeHandler = props => {
var _props$node$attrs;
// Remove remirror-internal attributes
var _ref = (_props$node$attrs = props.node.attrs) !== null && _props$node$attrs !== void 0 ? _props$node$attrs : {},
allowFullScreen = _ref.allowFullScreen;
_ref.type;
var attrs = _objectWithoutProperties(_ref, ["allowFullScreen", "type"]);
var normalizedAttrs = _objectSpread(_objectSpread({}, attrs), {}, {
// Prevent React error that allowFullScreen must be boolean (but is string in remirror)
allowFullScreen: allowFullScreen !== 'false'
}, overwriteAttrs);
return /*#__PURE__*/jsxRuntime.jsx("iframe", _objectSpread({}, normalizedAttrs));
};
return iframeHandler;
};
var createLinkHandler = overwriteAttrs => {
var linkHandler = (_ref) => {
var href = _ref.href,
target = _ref.target,
children = _ref.children;
var normalizedAttrs = _objectSpread({
href,
target: target !== null && target !== void 0 ? target : undefined
}, overwriteAttrs);
return /*#__PURE__*/jsxRuntime.jsx("a", _objectSpread(_objectSpread({}, normalizedAttrs), {}, {
children: children
}));
};
return linkHandler;
};
var Doc = (_ref) => {

@@ -113,3 +171,5 @@ var _node$attrs;

doc: Doc,
heading: Heading,
paragraph: 'p',
iframe: createIFrameHandler(),
image: 'img',

@@ -125,3 +185,3 @@ hardBreak: 'br',

code: 'code',
link: 'a',
link: createLinkHandler(),
underline: 'u'

@@ -128,0 +188,0 @@ };

@@ -5,4 +5,4 @@ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';

import { isString, isEmptyArray, object } from '@remirror/core';
import _createForOfIteratorHelper from '@babel/runtime/helpers/esm/createForOfIteratorHelper';
import { jsx } from 'react/jsx-runtime';
import _createForOfIteratorHelper from '@babel/runtime/helpers/esm/createForOfIteratorHelper';

@@ -81,2 +81,60 @@ var normalizeMark = mark => isString(mark) ? {

var Heading = props => {
var _ref, _props$node$attrs;
var content = props.node.content;
if (!content) {
return null;
}
var children = content.map((node, ii) => {
return /*#__PURE__*/jsx(TextHandler, _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
node
})), ii);
});
var level = (_ref = (_props$node$attrs = props.node.attrs) === null || _props$node$attrs === void 0 ? void 0 : _props$node$attrs.level) !== null && _ref !== void 0 ? _ref : 1;
return /*#__PURE__*/createElement("h".concat(level), null, children);
};
var createIFrameHandler = overwriteAttrs => {
var iframeHandler = props => {
var _props$node$attrs;
// Remove remirror-internal attributes
var _ref = (_props$node$attrs = props.node.attrs) !== null && _props$node$attrs !== void 0 ? _props$node$attrs : {},
allowFullScreen = _ref.allowFullScreen;
_ref.type;
var attrs = _objectWithoutProperties(_ref, ["allowFullScreen", "type"]);
var normalizedAttrs = _objectSpread(_objectSpread({}, attrs), {}, {
// Prevent React error that allowFullScreen must be boolean (but is string in remirror)
allowFullScreen: allowFullScreen !== 'false'
}, overwriteAttrs);
return /*#__PURE__*/jsx("iframe", _objectSpread({}, normalizedAttrs));
};
return iframeHandler;
};
var createLinkHandler = overwriteAttrs => {
var linkHandler = (_ref) => {
var href = _ref.href,
target = _ref.target,
children = _ref.children;
var normalizedAttrs = _objectSpread({
href,
target: target !== null && target !== void 0 ? target : undefined
}, overwriteAttrs);
return /*#__PURE__*/jsx("a", _objectSpread(_objectSpread({}, normalizedAttrs), {}, {
children: children
}));
};
return linkHandler;
};
var Doc = (_ref) => {

@@ -109,3 +167,5 @@ var _node$attrs;

doc: Doc,
heading: Heading,
paragraph: 'p',
iframe: createIFrameHandler(),
image: 'img',

@@ -121,3 +181,3 @@ hardBreak: 'br',

code: 'code',
link: 'a',
link: createLinkHandler(),
underline: 'u'

@@ -124,0 +184,0 @@ };

4

package.json
{
"name": "@remirror/react-renderer",
"version": "0.0.0-pr706.8",
"version": "0.0.0-pr706.9",
"description": "Render the JSON output from your remirror editor as a react component",

@@ -38,3 +38,3 @@ "keywords": [

"@babel/runtime": "^7.13.7",
"@remirror/core": "0.0.0-pr706.8"
"@remirror/core": "0.0.0-pr706.9"
},

@@ -41,0 +41,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc