@helpdice/ui 1.7.9 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-complete/index.js +13 -4
- package/dist/breadcrumbs/index.js +4 -4
- package/dist/card/index.js +4 -4
- package/dist/carousal/index.js +2935 -7
- package/dist/image/index.js +4 -4
- package/dist/index.js +19 -11
- package/dist/link/index.js +4 -4
- package/dist/table/index.js +13 -4
- package/dist/user/index.js +4 -4
- package/esm/carousal/component/Thumbs.js +1 -1
- package/esm/link/link.js +4 -4
- package/esm/parser/HtmlParser.js +24 -0
- package/esm/parser/convertNodeToElement.js +13 -0
- package/esm/parser/dom/attributes/BooleanAttributes.js +9 -0
- package/esm/parser/dom/attributes/ReactAttributes.js +164 -0
- package/esm/parser/dom/elements/VoidElements.js +6 -0
- package/esm/parser/elementTypes/StyleElementType.js +24 -0
- package/esm/parser/elementTypes/TagElementType.js +34 -0
- package/esm/parser/elementTypes/TextElementType.js +10 -0
- package/esm/parser/elementTypes/UnsupportedElementType.js +9 -0
- package/esm/parser/elementTypes/index.js +13 -0
- package/esm/parser/index.js +7 -0
- package/esm/parser/processNodes.js +27 -0
- package/esm/parser/scripts/attributes-diff.js +26 -0
- package/esm/parser/utils/generatePropsFromAttributes.js +24 -0
- package/esm/parser/utils/htmlAttributesToReact.js +45 -0
- package/esm/parser/utils/inlineStyleToObject.js +43 -0
- package/esm/parser/utils/isEmptyTextNode.js +10 -0
- package/esm/parser/utils/isValidTagOrAttributeName.js +8 -0
- package/package.json +10 -9
package/dist/image/index.js
CHANGED
|
@@ -3168,13 +3168,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3168
3168
|
href: href
|
|
3169
3169
|
}, props, {
|
|
3170
3170
|
ref: ref,
|
|
3171
|
-
className: _JSXStyle.dynamic([["
|
|
3171
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
3172
3172
|
}), icon && icon, /*#__PURE__*/React.createElement("span", {
|
|
3173
|
-
className: _JSXStyle.dynamic([["
|
|
3173
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
|
|
3174
3174
|
}, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
3175
|
-
id: "
|
|
3175
|
+
id: "2838069667",
|
|
3176
3176
|
dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
|
|
3177
|
-
}, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
3177
|
+
}, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
3178
3178
|
});
|
|
3179
3179
|
LinkComponent.displayName = 'Link';
|
|
3180
3180
|
var Link = withScale(LinkComponent);
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,6 @@ var reactSyntaxHighlighter = require('react-syntax-highlighter');
|
|
|
8
8
|
var prism = require('react-syntax-highlighter/dist/cjs/styles/prism');
|
|
9
9
|
var require$$0 = require('react-is');
|
|
10
10
|
var isEqual = require('react-fast-compare');
|
|
11
|
-
var Button$1 = require('components/button');
|
|
12
11
|
|
|
13
12
|
function _interopNamespaceDefault(e) {
|
|
14
13
|
var n = Object.create(null);
|
|
@@ -4004,13 +4003,22 @@ var LoadingComponent = function LoadingComponent(_ref) {
|
|
|
4004
4003
|
LoadingComponent.displayName = 'Loading';
|
|
4005
4004
|
var Loading = withScale(LoadingComponent);
|
|
4006
4005
|
|
|
4007
|
-
|
|
4006
|
+
const defaultValues = {
|
|
4007
|
+
color: "#001A72",
|
|
4008
|
+
strokeWidth: "1.5",
|
|
4009
|
+
size: "24",
|
|
4010
|
+
set: "outline",
|
|
4011
|
+
};
|
|
4012
|
+
const IconContext = React.createContext(defaultValues);
|
|
4013
|
+
IconContext.displayName = "IconContext";
|
|
4014
|
+
|
|
4015
|
+
// 001A72
|
|
4008
4016
|
const createIcon = (Component) => {
|
|
4009
|
-
const IconWrapper = React.forwardRef(({ color = "
|
|
4010
|
-
|
|
4017
|
+
const IconWrapper = React.forwardRef(({ color = "inherit", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
|
|
4018
|
+
const context = React.useContext(IconContext);
|
|
4011
4019
|
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
|
|
4012
4020
|
React.createElement("title", null, "Icon"),
|
|
4013
|
-
React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
|
|
4021
|
+
React.createElement(Component, { color: context.color, strokeWidth: context.strokeWidth, set: context.set })));
|
|
4014
4022
|
});
|
|
4015
4023
|
const MemoIcon = React.memo(IconWrapper);
|
|
4016
4024
|
return MemoIcon;
|
|
@@ -14396,13 +14404,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
14396
14404
|
href: href
|
|
14397
14405
|
}, props, {
|
|
14398
14406
|
ref: ref,
|
|
14399
|
-
className: _JSXStyle.dynamic([["
|
|
14407
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
14400
14408
|
}), icon && icon, /*#__PURE__*/React.createElement("span", {
|
|
14401
|
-
className: _JSXStyle.dynamic([["
|
|
14409
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
|
|
14402
14410
|
}, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
14403
|
-
id: "
|
|
14411
|
+
id: "2838069667",
|
|
14404
14412
|
dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
|
|
14405
|
-
}, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
14413
|
+
}, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
14406
14414
|
});
|
|
14407
14415
|
LinkComponent.displayName = 'Link';
|
|
14408
14416
|
var Link = withScale(LinkComponent);
|
|
@@ -61917,7 +61925,7 @@ var Thumbs = /*#__PURE__*/function (_Component) {
|
|
|
61917
61925
|
}, /*#__PURE__*/React.createElement("div", {
|
|
61918
61926
|
ref: this.setItemsWrapperRef,
|
|
61919
61927
|
className: "jsx-3452014152" + " " + (klass.WRAPPER(false) || "")
|
|
61920
|
-
}, /*#__PURE__*/React.createElement(Button
|
|
61928
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
61921
61929
|
scale: 2 / 3,
|
|
61922
61930
|
auto: true,
|
|
61923
61931
|
px: 0.6,
|
|
@@ -61953,7 +61961,7 @@ var Thumbs = /*#__PURE__*/function (_Component) {
|
|
|
61953
61961
|
},
|
|
61954
61962
|
style: itemListStyles,
|
|
61955
61963
|
className: "jsx-3452014152" + " " + (klass.SLIDER(false, this.state.swiping) || "")
|
|
61956
|
-
}, this.renderItems()), /*#__PURE__*/React.createElement(Button
|
|
61964
|
+
}, this.renderItems()), /*#__PURE__*/React.createElement(Button, {
|
|
61957
61965
|
type: "button",
|
|
61958
61966
|
scale: 2 / 3,
|
|
61959
61967
|
auto: true,
|
package/dist/link/index.js
CHANGED
|
@@ -3065,13 +3065,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3065
3065
|
href: href
|
|
3066
3066
|
}, props, {
|
|
3067
3067
|
ref: ref,
|
|
3068
|
-
className: _JSXStyle.dynamic([["
|
|
3068
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
3069
3069
|
}), icon && icon, /*#__PURE__*/React.createElement("span", {
|
|
3070
|
-
className: _JSXStyle.dynamic([["
|
|
3070
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
|
|
3071
3071
|
}, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
3072
|
-
id: "
|
|
3072
|
+
id: "2838069667",
|
|
3073
3073
|
dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
|
|
3074
|
-
}, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
3074
|
+
}, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
3075
3075
|
});
|
|
3076
3076
|
LinkComponent.displayName = 'Link';
|
|
3077
3077
|
var Link = withScale(LinkComponent);
|
package/dist/table/index.js
CHANGED
|
@@ -22409,13 +22409,22 @@ var TableColumn = function TableColumn(columnProps) {
|
|
|
22409
22409
|
};
|
|
22410
22410
|
TableColumn.displayName = 'TableColumn';
|
|
22411
22411
|
|
|
22412
|
-
|
|
22412
|
+
const defaultValues = {
|
|
22413
|
+
color: "#001A72",
|
|
22414
|
+
strokeWidth: "1.5",
|
|
22415
|
+
size: "24",
|
|
22416
|
+
set: "outline",
|
|
22417
|
+
};
|
|
22418
|
+
const IconContext = React.createContext(defaultValues);
|
|
22419
|
+
IconContext.displayName = "IconContext";
|
|
22420
|
+
|
|
22421
|
+
// 001A72
|
|
22413
22422
|
const createIcon = (Component) => {
|
|
22414
|
-
const IconWrapper = React.forwardRef(({ color = "
|
|
22415
|
-
|
|
22423
|
+
const IconWrapper = React.forwardRef(({ color = "inherit", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
|
|
22424
|
+
const context = React.useContext(IconContext);
|
|
22416
22425
|
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
|
|
22417
22426
|
React.createElement("title", null, "Icon"),
|
|
22418
|
-
React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
|
|
22427
|
+
React.createElement(Component, { color: context.color, strokeWidth: context.strokeWidth, set: context.set })));
|
|
22419
22428
|
});
|
|
22420
22429
|
const MemoIcon = React.memo(IconWrapper);
|
|
22421
22430
|
return MemoIcon;
|
package/dist/user/index.js
CHANGED
|
@@ -3173,13 +3173,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3173
3173
|
href: href
|
|
3174
3174
|
}, props, {
|
|
3175
3175
|
ref: ref,
|
|
3176
|
-
className: _JSXStyle.dynamic([["
|
|
3176
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
3177
3177
|
}), icon && icon, /*#__PURE__*/React.createElement("span", {
|
|
3178
|
-
className: _JSXStyle.dynamic([["
|
|
3178
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
|
|
3179
3179
|
}, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
3180
|
-
id: "
|
|
3180
|
+
id: "2838069667",
|
|
3181
3181
|
dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
|
|
3182
|
-
}, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
3182
|
+
}, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
3183
3183
|
});
|
|
3184
3184
|
LinkComponent.displayName = 'Link';
|
|
3185
3185
|
var Link = withScale(LinkComponent);
|
|
@@ -15,7 +15,7 @@ import CSSTranslate from '../CSSTranslate';
|
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
import Swipe from '../../swipe';
|
|
17
17
|
import getWindow from '../shims/window';
|
|
18
|
-
import Button from '
|
|
18
|
+
import Button from '../../button';
|
|
19
19
|
import { ChevronLeft, ChevronRight } from '@helpdice/icons';
|
|
20
20
|
var isKeyboardEvent = function isKeyboardEvent(e) {
|
|
21
21
|
return e.hasOwnProperty('key');
|
package/esm/link/link.js
CHANGED
|
@@ -38,13 +38,13 @@ var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
38
38
|
href: href
|
|
39
39
|
}, props, {
|
|
40
40
|
ref: ref,
|
|
41
|
-
className: _JSXStyle.dynamic([["
|
|
41
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
42
42
|
}), icon && icon, /*#__PURE__*/React.createElement("span", {
|
|
43
|
-
className: _JSXStyle.dynamic([["
|
|
43
|
+
className: _JSXStyle.dynamic([["2838069667", [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra"
|
|
44
44
|
}, children, arrow && /*#__PURE__*/React.createElement(LinkIcon, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
45
|
-
id: "
|
|
45
|
+
id: "2838069667",
|
|
46
46
|
dynamic: [linkColor, block ? theme.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', hoverColor]
|
|
47
|
-
}, ".link.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
47
|
+
}, ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")));
|
|
48
48
|
});
|
|
49
49
|
LinkComponent.displayName = 'Link';
|
|
50
50
|
var Link = withScale(LinkComponent);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import htmlparser2 from 'htmlparser2';
|
|
2
|
+
import processNodes from './processNodes';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Parses a HTML string and returns a list of React components generated from it
|
|
6
|
+
*
|
|
7
|
+
* @param {String} html The HTML to convert into React component
|
|
8
|
+
* @param {Object} options Options to pass
|
|
9
|
+
* @returns {Array} List of top level React elements
|
|
10
|
+
*/
|
|
11
|
+
export default function HtmlParser(html) {
|
|
12
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
13
|
+
_ref$decodeEntities = _ref.decodeEntities,
|
|
14
|
+
decodeEntities = _ref$decodeEntities === void 0 ? true : _ref$decodeEntities,
|
|
15
|
+
transform = _ref.transform,
|
|
16
|
+
_ref$preprocessNodes = _ref.preprocessNodes,
|
|
17
|
+
preprocessNodes = _ref$preprocessNodes === void 0 ? function (nodes) {
|
|
18
|
+
return nodes;
|
|
19
|
+
} : _ref$preprocessNodes;
|
|
20
|
+
var nodes = preprocessNodes(htmlparser2.parseDOM(html, {
|
|
21
|
+
decodeEntities: decodeEntities
|
|
22
|
+
}));
|
|
23
|
+
return processNodes(nodes, transform);
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ElementTypes from './elementTypes';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a htmlparser2 node to a React element
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} node The htmlparser2 node to convert
|
|
7
|
+
* @param {Number} index The index of the current node
|
|
8
|
+
* @param {Function} transform Transform function to apply to children of the node
|
|
9
|
+
* @returns {React.Element}
|
|
10
|
+
*/
|
|
11
|
+
export default function convertNodeToElement(node, index, transform) {
|
|
12
|
+
return ElementTypes[node.type](node, index, transform);
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List of boolean attributes
|
|
3
|
+
* These attributes should have their React attribute value set to be the same as their name
|
|
4
|
+
* E.g. <input disabled> = <input disabled>
|
|
5
|
+
* <input disabled=""> = <input disabled>
|
|
6
|
+
* <input disabled="disabled"> = <input disabled>
|
|
7
|
+
* @type {Array}
|
|
8
|
+
*/
|
|
9
|
+
export default ['allowfullScreen', 'async', 'autoplay', 'capture', 'checked', 'controls', 'default', 'defer', 'disabled', 'formnovalidate', 'hidden', 'loop', 'multiple', 'muted', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'itemscope'];
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping of standard HTML attributes to their React counterparts
|
|
3
|
+
* List taken and reversed from react/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
|
|
4
|
+
* https://github.com/facebook/react/blob/c9c3c339b757682f1154f1c915eb55e6a8766933/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
|
|
5
|
+
* @type {Object}
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
/**
|
|
9
|
+
* Standard Properties
|
|
10
|
+
*/
|
|
11
|
+
accept: 'accept',
|
|
12
|
+
'accept-charset': 'acceptCharset',
|
|
13
|
+
accesskey: 'accessKey',
|
|
14
|
+
action: 'action',
|
|
15
|
+
allowfullscreen: 'allowFullScreen',
|
|
16
|
+
allowtransparency: 'allowTransparency',
|
|
17
|
+
alt: 'alt',
|
|
18
|
+
as: 'as',
|
|
19
|
+
async: 'async',
|
|
20
|
+
autocomplete: 'autoComplete',
|
|
21
|
+
autoplay: 'autoPlay',
|
|
22
|
+
capture: 'capture',
|
|
23
|
+
cellpadding: 'cellPadding',
|
|
24
|
+
cellspacing: 'cellSpacing',
|
|
25
|
+
charset: 'charSet',
|
|
26
|
+
challenge: 'challenge',
|
|
27
|
+
checked: 'checked',
|
|
28
|
+
cite: 'cite',
|
|
29
|
+
classid: 'classID',
|
|
30
|
+
"class": 'className',
|
|
31
|
+
cols: 'cols',
|
|
32
|
+
colspan: 'colSpan',
|
|
33
|
+
content: 'content',
|
|
34
|
+
contenteditable: 'contentEditable',
|
|
35
|
+
contextmenu: 'contextMenu',
|
|
36
|
+
controls: 'controls',
|
|
37
|
+
controlsList: 'controlsList',
|
|
38
|
+
coords: 'coords',
|
|
39
|
+
crossorigin: 'crossOrigin',
|
|
40
|
+
data: 'data',
|
|
41
|
+
datetime: 'dateTime',
|
|
42
|
+
"default": 'default',
|
|
43
|
+
defer: 'defer',
|
|
44
|
+
dir: 'dir',
|
|
45
|
+
disabled: 'disabled',
|
|
46
|
+
download: 'download',
|
|
47
|
+
draggable: 'draggable',
|
|
48
|
+
enctype: 'encType',
|
|
49
|
+
form: 'form',
|
|
50
|
+
formaction: 'formAction',
|
|
51
|
+
formenctype: 'formEncType',
|
|
52
|
+
formmethod: 'formMethod',
|
|
53
|
+
formnovalidate: 'formNoValidate',
|
|
54
|
+
formtarget: 'formTarget',
|
|
55
|
+
frameborder: 'frameBorder',
|
|
56
|
+
headers: 'headers',
|
|
57
|
+
height: 'height',
|
|
58
|
+
hidden: 'hidden',
|
|
59
|
+
high: 'high',
|
|
60
|
+
href: 'href',
|
|
61
|
+
hreflang: 'hrefLang',
|
|
62
|
+
"for": 'htmlFor',
|
|
63
|
+
'http-equiv': 'httpEquiv',
|
|
64
|
+
icon: 'icon',
|
|
65
|
+
id: 'id',
|
|
66
|
+
inputmode: 'inputMode',
|
|
67
|
+
integrity: 'integrity',
|
|
68
|
+
is: 'is',
|
|
69
|
+
keyparams: 'keyParams',
|
|
70
|
+
keytype: 'keyType',
|
|
71
|
+
kind: 'kind',
|
|
72
|
+
label: 'label',
|
|
73
|
+
lang: 'lang',
|
|
74
|
+
list: 'list',
|
|
75
|
+
loop: 'loop',
|
|
76
|
+
low: 'low',
|
|
77
|
+
manifest: 'manifest',
|
|
78
|
+
marginheight: 'marginHeight',
|
|
79
|
+
marginwidth: 'marginWidth',
|
|
80
|
+
max: 'max',
|
|
81
|
+
maxlength: 'maxLength',
|
|
82
|
+
media: 'media',
|
|
83
|
+
mediagroup: 'mediaGroup',
|
|
84
|
+
method: 'method',
|
|
85
|
+
min: 'min',
|
|
86
|
+
minlength: 'minLength',
|
|
87
|
+
multiple: 'multiple',
|
|
88
|
+
muted: 'muted',
|
|
89
|
+
name: 'name',
|
|
90
|
+
nonce: 'nonce',
|
|
91
|
+
novalidate: 'noValidate',
|
|
92
|
+
open: 'open',
|
|
93
|
+
optimum: 'optimum',
|
|
94
|
+
pattern: 'pattern',
|
|
95
|
+
placeholder: 'placeholder',
|
|
96
|
+
playsinline: 'playsInline',
|
|
97
|
+
poster: 'poster',
|
|
98
|
+
preload: 'preload',
|
|
99
|
+
profile: 'profile',
|
|
100
|
+
radiogroup: 'radioGroup',
|
|
101
|
+
readonly: 'readOnly',
|
|
102
|
+
referrerpolicy: 'referrerPolicy',
|
|
103
|
+
rel: 'rel',
|
|
104
|
+
required: 'required',
|
|
105
|
+
reversed: 'reversed',
|
|
106
|
+
role: 'role',
|
|
107
|
+
rows: 'rows',
|
|
108
|
+
rowspan: 'rowSpan',
|
|
109
|
+
sandbox: 'sandbox',
|
|
110
|
+
scope: 'scope',
|
|
111
|
+
scoped: 'scoped',
|
|
112
|
+
scrolling: 'scrolling',
|
|
113
|
+
seamless: 'seamless',
|
|
114
|
+
selected: 'selected',
|
|
115
|
+
shape: 'shape',
|
|
116
|
+
size: 'size',
|
|
117
|
+
sizes: 'sizes',
|
|
118
|
+
slot: 'slot',
|
|
119
|
+
span: 'span',
|
|
120
|
+
spellcheck: 'spellCheck',
|
|
121
|
+
src: 'src',
|
|
122
|
+
srcdoc: 'srcDoc',
|
|
123
|
+
srclang: 'srcLang',
|
|
124
|
+
srcset: 'srcSet',
|
|
125
|
+
start: 'start',
|
|
126
|
+
step: 'step',
|
|
127
|
+
style: 'style',
|
|
128
|
+
summary: 'summary',
|
|
129
|
+
tabindex: 'tabIndex',
|
|
130
|
+
target: 'target',
|
|
131
|
+
title: 'title',
|
|
132
|
+
type: 'type',
|
|
133
|
+
usemap: 'useMap',
|
|
134
|
+
value: 'value',
|
|
135
|
+
width: 'width',
|
|
136
|
+
wmode: 'wmode',
|
|
137
|
+
wrap: 'wrap',
|
|
138
|
+
/**
|
|
139
|
+
* RDFa Properties
|
|
140
|
+
*/
|
|
141
|
+
about: 'about',
|
|
142
|
+
datatype: 'datatype',
|
|
143
|
+
inlist: 'inlist',
|
|
144
|
+
prefix: 'prefix',
|
|
145
|
+
property: 'property',
|
|
146
|
+
resource: 'resource',
|
|
147
|
+
"typeof": 'typeof',
|
|
148
|
+
vocab: 'vocab',
|
|
149
|
+
/**
|
|
150
|
+
* Non-standard Properties
|
|
151
|
+
*/
|
|
152
|
+
autocapitalize: 'autoCapitalize',
|
|
153
|
+
autocorrect: 'autoCorrect',
|
|
154
|
+
autosave: 'autoSave',
|
|
155
|
+
color: 'color',
|
|
156
|
+
itemprop: 'itemProp',
|
|
157
|
+
itemscope: 'itemScope',
|
|
158
|
+
itemtype: 'itemType',
|
|
159
|
+
itemid: 'itemID',
|
|
160
|
+
itemref: 'itemRef',
|
|
161
|
+
results: 'results',
|
|
162
|
+
security: 'security',
|
|
163
|
+
unselectable: 'unselectable'
|
|
164
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import generateElementProps from '../utils/generatePropsFromAttributes';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Converts a <style> element to a React element
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} node The style node
|
|
8
|
+
* @param {String} index The index of the React element relative to it's parent
|
|
9
|
+
* @returns {React.Element} The React style element
|
|
10
|
+
*/
|
|
11
|
+
export default function StyleElementType(node, index) {
|
|
12
|
+
// The style element only ever has a single child which is the styles so try and find this to add as
|
|
13
|
+
// a child to the style element that will be created
|
|
14
|
+
var styles;
|
|
15
|
+
if (node.children.length > 0) {
|
|
16
|
+
styles = node.children[0].data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// generate props
|
|
20
|
+
var props = generateElementProps(node.attribs, index);
|
|
21
|
+
|
|
22
|
+
// create and return the element
|
|
23
|
+
return /*#__PURE__*/React.createElement('style', props, styles);
|
|
24
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import processNodes from '../processNodes';
|
|
3
|
+
import generatePropsFromAttributes from '../utils/generatePropsFromAttributes';
|
|
4
|
+
import VoidElements from '../dom/elements/VoidElements';
|
|
5
|
+
import isValidTagOrAttributeName from '../utils/isValidTagOrAttributeName';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Converts any element (excluding style - see StyleElementType - and script) to a react element.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} node The tag node
|
|
11
|
+
* @param {String} index The index of the React element relative to it's parent
|
|
12
|
+
* @param {Function} transform The transform function to apply to all children
|
|
13
|
+
* @returns {React.Element} The React tag element
|
|
14
|
+
*/
|
|
15
|
+
export default function TagElementType(node, index, transform) {
|
|
16
|
+
var tagName = node.name;
|
|
17
|
+
|
|
18
|
+
// validate tag name
|
|
19
|
+
if (!isValidTagOrAttributeName(tagName)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// generate props
|
|
24
|
+
var props = generatePropsFromAttributes(node.attribs, index);
|
|
25
|
+
|
|
26
|
+
// If the node is not a void element and has children then process them
|
|
27
|
+
var children = null;
|
|
28
|
+
if (VoidElements.indexOf(tagName) === -1) {
|
|
29
|
+
children = processNodes(node.children, transform);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// create and return the element
|
|
33
|
+
return /*#__PURE__*/React.createElement(tagName, props, children);
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a text node to a React text element
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} node The text node
|
|
5
|
+
* @returns {String} The text
|
|
6
|
+
*/
|
|
7
|
+
export default function TextElementType(node) {
|
|
8
|
+
// React will accept plain text for rendering so just return the node data
|
|
9
|
+
return node.data;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles an unsupported element type by returning null so nothing is rendered
|
|
3
|
+
* @returns {null}
|
|
4
|
+
*/
|
|
5
|
+
export default function UnsupportedElementType() {
|
|
6
|
+
// do nothing because the element type is unsupported
|
|
7
|
+
// comment, directive, script, cdata, doctype are all currently unsupported
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
/*
|
|
3
|
+
* Map each htmlparser2 element type to a function which will convert that element type to a React element
|
|
4
|
+
* Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
|
|
5
|
+
* value
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ElementType } from 'htmlparser2';
|
|
9
|
+
import TextElementType from './TextElementType';
|
|
10
|
+
import TagElementType from './TagElementType';
|
|
11
|
+
import StyleElementType from './StyleElementType';
|
|
12
|
+
import UnsupportedElementType from './UnsupportedElementType';
|
|
13
|
+
export default _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ElementType.Text, TextElementType), ElementType.Tag, TagElementType), ElementType.Style, StyleElementType), ElementType.Directive, UnsupportedElementType), ElementType.Comment, UnsupportedElementType), ElementType.Script, UnsupportedElementType), ElementType.CDATA, UnsupportedElementType), ElementType.Doctype, UnsupportedElementType);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import HtmlParser from './HtmlParser';
|
|
2
|
+
export default HtmlParser;
|
|
3
|
+
export { default as processNodes } from './processNodes';
|
|
4
|
+
export { default as convertNodeToElement } from './convertNodeToElement';
|
|
5
|
+
|
|
6
|
+
// expose htmlparser2 so it can be used if required
|
|
7
|
+
export { default as htmlparser2 } from 'htmlparser2';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import isEmptyTextNode from './utils/isEmptyTextNode';
|
|
2
|
+
import convertNodeToElement from './convertNodeToElement';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Processes the nodes generated by htmlparser2 and convert them all into React elements
|
|
6
|
+
*
|
|
7
|
+
* @param {Object[]} nodes List of nodes to process
|
|
8
|
+
* @param {Function} transform Transform function to optionally apply to nodes
|
|
9
|
+
* @returns {React.Element[]} The list of processed React elements
|
|
10
|
+
*/
|
|
11
|
+
export default function processNodes(nodes, transform) {
|
|
12
|
+
return nodes.filter(function (node) {
|
|
13
|
+
return !isEmptyTextNode(node);
|
|
14
|
+
}).map(function (node, index) {
|
|
15
|
+
// return the result of the transform function if applicable
|
|
16
|
+
var transformed;
|
|
17
|
+
if (typeof transform === 'function') {
|
|
18
|
+
transformed = transform(node, index);
|
|
19
|
+
if (transformed === null || !!transformed) {
|
|
20
|
+
return transformed;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// otherwise convert the node as standard
|
|
25
|
+
return convertNodeToElement(node, index, transform);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// this script diffs the react attribute whitelist with the one react html parser maintains
|
|
2
|
+
// to determine if it is out of date
|
|
3
|
+
// the build:lib task must have been run before this can work
|
|
4
|
+
|
|
5
|
+
var currentProperties = require('../lib/dom/attributes/ReactAttributes')["default"];
|
|
6
|
+
var reactProperties = require('react-dom/lib/HTMLDOMPropertyConfig').Properties;
|
|
7
|
+
var changes = {};
|
|
8
|
+
var currentKeys = Object.keys(currentProperties).map(function (key) {
|
|
9
|
+
return currentProperties[key];
|
|
10
|
+
});
|
|
11
|
+
var reactKeys = Object.keys(reactProperties);
|
|
12
|
+
|
|
13
|
+
// attributes that have been added to react
|
|
14
|
+
reactKeys.forEach(function (key) {
|
|
15
|
+
if (currentKeys.indexOf(key) === -1) {
|
|
16
|
+
changes[key] = 'add';
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// attributes that have been removed from react
|
|
21
|
+
currentKeys.forEach(function (key) {
|
|
22
|
+
if (reactKeys.indexOf(key) === -1) {
|
|
23
|
+
changes[key] = 'remove';
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
console.log(changes); // eslint-disable-line no-console
|