@remirror/react-renderer
Advanced tools
Comparing version 0.0.0-pr706.8 to 0.0.0-pr706.9
@@ -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 @@ }; |
{ | ||
"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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41657
20
1073
+ Added@remirror/core@0.0.0-pr706.9(transitive)
+ Added@remirror/core-constants@0.0.0-pr706.9(transitive)
+ Added@remirror/core-helpers@0.0.0-pr706.9(transitive)
+ Added@remirror/core-types@0.0.0-pr706.9(transitive)
+ Added@remirror/core-utils@0.0.0-pr706.9(transitive)
+ Added@remirror/i18n@0.0.0-pr706.9(transitive)
+ Added@remirror/icons@0.0.0-pr706.9(transitive)
+ Added@remirror/messages@0.0.0-pr706.9(transitive)
+ Added@remirror/pm@0.0.0-pr706.9(transitive)
+ Added@remirror/theme@0.0.0-pr706.9(transitive)
+ Addedprosemirror-paste-rules@0.0.0-pr706.9(transitive)
+ Addedprosemirror-suggest@0.0.0-pr706.9(transitive)
+ Addedprosemirror-trailing-node@0.0.0-pr706.9(transitive)
- Removed@remirror/core@0.0.0-pr706.8(transitive)
- Removed@remirror/core-constants@0.0.0-pr706.8(transitive)
- Removed@remirror/core-helpers@0.0.0-pr706.8(transitive)
- Removed@remirror/core-types@0.0.0-pr706.8(transitive)
- Removed@remirror/core-utils@0.0.0-pr706.8(transitive)
- Removed@remirror/i18n@0.0.0-pr706.8(transitive)
- Removed@remirror/icons@0.0.0-pr706.8(transitive)
- Removed@remirror/messages@0.0.0-pr706.8(transitive)
- Removed@remirror/pm@0.0.0-pr706.8(transitive)
- Removed@remirror/theme@0.0.0-pr706.8(transitive)
- Removedprosemirror-paste-rules@0.0.0-pr706.8(transitive)
- Removedprosemirror-suggest@0.0.0-pr706.8(transitive)
- Removedprosemirror-trailing-node@0.0.0-pr706.8(transitive)
Updated@remirror/core@0.0.0-pr706.9