@theme-ui/mdx
Advanced tools
Comparing version 0.3.0 to 0.3.2-alpha.10
@@ -6,4 +6,22 @@ import { jsx } from '@theme-ui/core'; | ||
import styled from '@emotion/styled'; | ||
import { MDXProvider, useMDXComponents } from '@mdx-js/react'; | ||
import { useMDXComponents, MDXProvider as MDXProvider$1 } from '@mdx-js/react'; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
var tags = ['p', 'b', 'i', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'pre', 'code', 'ol', 'ul', 'li', 'blockquote', 'hr', 'em', 'table', 'tr', 'th', 'td', 'em', 'strong', 'del', // mdx | ||
@@ -19,5 +37,11 @@ 'inlineCode', 'thematicBreak', // other | ||
var alias = function (n) { return aliases[n] || n; }; | ||
var alias = function alias(n) { | ||
return aliases[n] || n; | ||
}; | ||
var themed = function (key) { return function (props) { return css(get(props.theme, ("styles." + key)))(props.theme); }; }; | ||
var themed = function themed(key) { | ||
return function (props) { | ||
return css(get(props.theme, "styles." + key))(props.theme); | ||
}; | ||
}; | ||
var Styled = styled('div')(themed('div')); | ||
@@ -30,4 +54,5 @@ var components = {}; | ||
var createComponents = function (comps) { | ||
var next = Object.assign({}, components); | ||
var createComponents = function createComponents(comps) { | ||
var next = _extends({}, components); | ||
Object.keys(comps).forEach(function (key) { | ||
@@ -39,10 +64,8 @@ next[key] = styled(comps[key])(themed(key)); | ||
var MDXProvider$1 = function (ref) { | ||
var components = ref.components; | ||
var children = ref.children; | ||
var MDXProvider = function MDXProvider(_ref) { | ||
var components = _ref.components, | ||
children = _ref.children; | ||
var outer = useMDXComponents(); | ||
return jsx(MDXProvider, { | ||
components: createComponents(Object.assign({}, outer, | ||
components)), | ||
return jsx(MDXProvider$1, { | ||
components: createComponents(_extends({}, outer, components)), | ||
children: children | ||
@@ -52,3 +75,3 @@ }); | ||
export { themed, Styled, components, MDXProvider$1 as MDXProvider }; | ||
export { MDXProvider, Styled, components, themed }; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -10,2 +10,20 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
var tags = ['p', 'b', 'i', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'pre', 'code', 'ol', 'ul', 'li', 'blockquote', 'hr', 'em', 'table', 'tr', 'th', 'td', 'em', 'strong', 'del', // mdx | ||
@@ -21,5 +39,11 @@ 'inlineCode', 'thematicBreak', // other | ||
var alias = function (n) { return aliases[n] || n; }; | ||
var alias = function alias(n) { | ||
return aliases[n] || n; | ||
}; | ||
var themed = function (key) { return function (props) { return css.css(css.get(props.theme, ("styles." + key)))(props.theme); }; }; | ||
var themed = function themed(key) { | ||
return function (props) { | ||
return css.css(css.get(props.theme, "styles." + key))(props.theme); | ||
}; | ||
}; | ||
var Styled = styled('div')(themed('div')); | ||
@@ -32,4 +56,5 @@ var components = {}; | ||
var createComponents = function (comps) { | ||
var next = Object.assign({}, components); | ||
var createComponents = function createComponents(comps) { | ||
var next = _extends({}, components); | ||
Object.keys(comps).forEach(function (key) { | ||
@@ -41,10 +66,8 @@ next[key] = styled(comps[key])(themed(key)); | ||
var MDXProvider = function (ref) { | ||
var components = ref.components; | ||
var children = ref.children; | ||
var MDXProvider = function MDXProvider(_ref) { | ||
var components = _ref.components, | ||
children = _ref.children; | ||
var outer = react$1.useMDXComponents(); | ||
return core.jsx(react$1.MDXProvider, { | ||
components: createComponents(Object.assign({}, outer, | ||
components)), | ||
components: createComponents(_extends({}, outer, components)), | ||
children: children | ||
@@ -54,6 +77,6 @@ }); | ||
exports.themed = themed; | ||
exports.MDXProvider = MDXProvider; | ||
exports.Styled = Styled; | ||
exports.components = components; | ||
exports.MDXProvider = MDXProvider; | ||
exports.themed = themed; | ||
//# sourceMappingURL=index.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@theme-ui/core'), require('@theme-ui/css'), require('react'), require('@emotion/core'), require('@emotion/styled'), require('@mdx-js/react')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@theme-ui/core', '@theme-ui/css', 'react', '@emotion/core', '@emotion/styled', '@mdx-js/react'], factory) : | ||
(factory((global.mdx = {}),global.core,global.css,global.react,global.core$1,global.styled,global.react$1)); | ||
}(this, (function (exports,core,css,react,core$1,styled,react$1) { | ||
react = react && react.hasOwnProperty('default') ? react['default'] : react; | ||
styled = styled && styled.hasOwnProperty('default') ? styled['default'] : styled; | ||
(global = global || self, factory(global.mdx = {}, global.core, global.css, global.react, global.core$1, global.styled, global.react$1)); | ||
}(this, (function (exports, core, css, react, core$1, styled, react$1) { | ||
react = react && Object.prototype.hasOwnProperty.call(react, 'default') ? react['default'] : react; | ||
styled = styled && Object.prototype.hasOwnProperty.call(styled, 'default') ? styled['default'] : styled; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
var tags = ['p', 'b', 'i', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img', 'pre', 'code', 'ol', 'ul', 'li', 'blockquote', 'hr', 'em', 'table', 'tr', 'th', 'td', 'em', 'strong', 'del', // mdx | ||
@@ -19,5 +37,11 @@ 'inlineCode', 'thematicBreak', // other | ||
var alias = function (n) { return aliases[n] || n; }; | ||
var alias = function alias(n) { | ||
return aliases[n] || n; | ||
}; | ||
var themed = function (key) { return function (props) { return css.css(css.get(props.theme, ("styles." + key)))(props.theme); }; }; | ||
var themed = function themed(key) { | ||
return function (props) { | ||
return css.css(css.get(props.theme, "styles." + key))(props.theme); | ||
}; | ||
}; | ||
var Styled = styled('div')(themed('div')); | ||
@@ -30,4 +54,5 @@ var components = {}; | ||
var createComponents = function (comps) { | ||
var next = Object.assign({}, components); | ||
var createComponents = function createComponents(comps) { | ||
var next = _extends({}, components); | ||
Object.keys(comps).forEach(function (key) { | ||
@@ -39,10 +64,8 @@ next[key] = styled(comps[key])(themed(key)); | ||
var MDXProvider = function (ref) { | ||
var components = ref.components; | ||
var children = ref.children; | ||
var MDXProvider = function MDXProvider(_ref) { | ||
var components = _ref.components, | ||
children = _ref.children; | ||
var outer = react$1.useMDXComponents(); | ||
return core.jsx(react$1.MDXProvider, { | ||
components: createComponents(Object.assign({}, outer, | ||
components)), | ||
components: createComponents(_extends({}, outer, components)), | ||
children: children | ||
@@ -52,8 +75,8 @@ }); | ||
exports.themed = themed; | ||
exports.MDXProvider = MDXProvider; | ||
exports.Styled = Styled; | ||
exports.components = components; | ||
exports.MDXProvider = MDXProvider; | ||
exports.themed = themed; | ||
}))); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@theme-ui/mdx", | ||
"version": "0.3.0", | ||
"version": "0.3.2-alpha.10+80ad9af6", | ||
"main": "dist/index.js", | ||
@@ -27,3 +27,3 @@ "module": "dist/index.esm.js", | ||
}, | ||
"gitHead": "7663897ec671e1ff66b0d4ef946611dd57f3bb99" | ||
"gitHead": "80ad9af6483a680fb703d5ebd7b8564d06e7d6c7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
30152
14
442
2