safe-mdx 1.3.2 → 1.3.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.
Files changed (77) hide show
  1. package/README.md +14 -14
  2. package/dist/assets/HtmlToJsxConverter-Ds0bTjpw.js +24 -0
  3. package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  4. package/dist/assets/index-B5fPOjPt.css +1 -0
  5. package/dist/assets/index-B7ATSoRE.js +9 -0
  6. package/dist/assets/index-BwZ2FTRd.js +146 -0
  7. package/dist/assets/index-R1UqLMGJ.js +1 -0
  8. package/dist/assets/index-c0qeY2gs.js +9 -0
  9. package/dist/assets/jsx-runtime-BhZZLbvw.js +9 -0
  10. package/dist/assets/jsx-runtime-NArryeSM.js +1 -0
  11. package/dist/assets/react-Ca6JzGpx.js +1 -0
  12. package/dist/assets/react-dom-BYRHYqYl.js +1 -0
  13. package/dist/html/attributes.d.ts +19 -0
  14. package/dist/html/attributes.d.ts.map +1 -0
  15. package/dist/html/attributes.js +289 -0
  16. package/dist/html/attributes.js.map +1 -0
  17. package/dist/html/convert-attributes.d.ts +6 -0
  18. package/dist/html/convert-attributes.d.ts.map +1 -0
  19. package/dist/html/convert-attributes.js +43 -0
  20. package/dist/html/convert-attributes.js.map +1 -0
  21. package/dist/html/domparser-browser.d.ts +4 -0
  22. package/dist/html/domparser-browser.d.ts.map +1 -0
  23. package/dist/html/domparser-browser.js +7 -0
  24. package/dist/html/domparser-browser.js.map +1 -0
  25. package/dist/html/domparser.d.ts +2 -0
  26. package/dist/html/domparser.d.ts.map +1 -0
  27. package/dist/html/domparser.js +5 -0
  28. package/dist/html/domparser.js.map +1 -0
  29. package/dist/html/html-to-mdx-ast.d.ts +23 -0
  30. package/dist/html/html-to-mdx-ast.d.ts.map +1 -0
  31. package/dist/html/html-to-mdx-ast.js +227 -0
  32. package/dist/html/html-to-mdx-ast.js.map +1 -0
  33. package/dist/html/html-to-mdx-ast.test.d.ts +2 -0
  34. package/dist/html/html-to-mdx-ast.test.d.ts.map +1 -0
  35. package/dist/html/html-to-mdx-ast.test.js +324 -0
  36. package/dist/html/html-to-mdx-ast.test.js.map +1 -0
  37. package/dist/html/remark-mdx-jsx-normalize.d.ts +10 -0
  38. package/dist/html/remark-mdx-jsx-normalize.d.ts.map +1 -0
  39. package/dist/html/remark-mdx-jsx-normalize.js +117 -0
  40. package/dist/html/remark-mdx-jsx-normalize.js.map +1 -0
  41. package/dist/html/valid-html-elements.d.ts +10 -0
  42. package/dist/html/valid-html-elements.d.ts.map +1 -0
  43. package/dist/html/valid-html-elements.js +50 -0
  44. package/dist/html/valid-html-elements.js.map +1 -0
  45. package/dist/index.html +19 -0
  46. package/dist/parse.d.ts +2 -0
  47. package/dist/parse.d.ts.map +1 -1
  48. package/dist/parse.js +2 -0
  49. package/dist/parse.js.map +1 -1
  50. package/dist/safe-mdx.d.ts +1 -1
  51. package/dist/safe-mdx.d.ts.map +1 -1
  52. package/dist/safe-mdx.js +23 -71
  53. package/dist/safe-mdx.js.map +1 -1
  54. package/dist/safe-mdx.test.js +161 -8
  55. package/dist/safe-mdx.test.js.map +1 -1
  56. package/package.json +27 -6
  57. package/src/html/README +17 -0
  58. package/src/html/attributes.ts +297 -0
  59. package/src/html/convert-attributes.ts +59 -0
  60. package/src/html/domparser-browser.ts +6 -0
  61. package/src/html/domparser.ts +5 -0
  62. package/src/html/html-to-mdx-ast.test.ts +365 -0
  63. package/src/html/html-to-mdx-ast.ts +304 -0
  64. package/src/html/remark-mdx-jsx-normalize.ts +128 -0
  65. package/src/html/valid-html-elements.ts +65 -0
  66. package/src/parse.ts +3 -0
  67. package/src/safe-mdx.test.tsx +178 -12
  68. package/src/safe-mdx.tsx +23 -79
  69. package/dist/HtmlToJsxConverter.d.ts +0 -10
  70. package/dist/HtmlToJsxConverter.d.ts.map +0 -1
  71. package/dist/HtmlToJsxConverter.js +0 -22
  72. package/dist/HtmlToJsxConverter.js.map +0 -1
  73. package/dist/plugins.d.ts +0 -12
  74. package/dist/plugins.d.ts.map +0 -1
  75. package/dist/plugins.js +0 -68
  76. package/dist/plugins.js.map +0 -1
  77. package/src/HtmlToJsxConverter.tsx +0 -37
@@ -0,0 +1 @@
1
+ import{g as r}from"./_commonjsHelpers-CqkleIqs.js";import{r as t}from"./index-c0qeY2gs.js";var a=t();const s=r(a);export{s as R,a as r};
@@ -0,0 +1,9 @@
1
+ var m={exports:{}},o={};/**
2
+ * @license React
3
+ * react.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var N;function Z(){if(N)return o;N=1;var E=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),k=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),D=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),w=Symbol.iterator;function z(t){return t===null||typeof t!="object"?null:(t=w&&t[w]||t["@@iterator"],typeof t=="function"?t:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,S={};function a(t,e,n){this.props=t,this.context=e,this.refs=S,this.updater=n||A}a.prototype.isReactComponent={},a.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},a.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function g(){}g.prototype=a.prototype;function y(t,e,n){this.props=t,this.context=e,this.refs=S,this.updater=n||A}var v=y.prototype=new g;v.constructor=y,h(v,a.prototype),v.isPureReactComponent=!0;var O=Array.isArray,i={H:null,A:null,T:null,S:null,V:null},H=Object.prototype.hasOwnProperty;function R(t,e,n,r,s,f){return n=f.ref,{$$typeof:E,type:t,key:e,ref:n!==void 0?n:null,props:f}}function G(t,e){return R(t.type,e,void 0,void 0,void 0,t.props)}function T(t){return typeof t=="object"&&t!==null&&t.$$typeof===E}function K(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var j=/\/+/g;function d(t,e){return typeof t=="object"&&t!==null&&t.key!=null?K(""+t.key):e.toString(36)}function P(){}function B(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(P,P):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function _(t,e,n,r,s){var f=typeof t;(f==="undefined"||f==="boolean")&&(t=null);var u=!1;if(t===null)u=!0;else switch(f){case"bigint":case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case E:case Y:u=!0;break;case C:return u=t._init,_(u(t._payload),e,n,r,s)}}if(u)return s=s(t),u=r===""?"."+d(t,0):r,O(s)?(n="",u!=null&&(n=u.replace(j,"$&/")+"/"),_(s,e,n,"",function(X){return X})):s!=null&&(T(s)&&(s=G(s,n+(s.key==null||t&&t.key===s.key?"":(""+s.key).replace(j,"$&/")+"/")+u)),e.push(s)),1;u=0;var p=r===""?".":r+":";if(O(t))for(var c=0;c<t.length;c++)r=t[c],f=p+d(r,c),u+=_(r,e,n,f,s);else if(c=z(t),typeof c=="function")for(t=c.call(t),c=0;!(r=t.next()).done;)r=r.value,f=p+d(r,c++),u+=_(r,e,n,f,s);else if(f==="object"){if(typeof t.then=="function")return _(B(t),e,n,r,s);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return u}function l(t,e,n){if(t==null)return t;var r=[],s=0;return _(t,r,"","",function(f){return e.call(n,f,s++)}),r}function W(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var $=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Q(){}return o.Children={map:l,forEach:function(t,e,n){l(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return l(t,function(){e++}),e},toArray:function(t){return l(t,function(e){return e})||[]},only:function(t){if(!T(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},o.Component=a,o.Fragment=x,o.Profiler=L,o.PureComponent=y,o.StrictMode=I,o.Suspense=q,o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,o.__COMPILER_RUNTIME={__proto__:null,c:function(t){return i.H.useMemoCache(t)}},o.cache=function(t){return function(){return t.apply(null,arguments)}},o.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var r=h({},t.props),s=t.key,f=void 0;if(e!=null)for(u in e.ref!==void 0&&(f=void 0),e.key!==void 0&&(s=""+e.key),e)!H.call(e,u)||u==="key"||u==="__self"||u==="__source"||u==="ref"&&e.ref===void 0||(r[u]=e[u]);var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){for(var p=Array(u),c=0;c<u;c++)p[c]=arguments[c+2];r.children=p}return R(t.type,s,void 0,void 0,f,r)},o.createContext=function(t){return t={$$typeof:k,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:U,_context:t},t},o.createElement=function(t,e,n){var r,s={},f=null;if(e!=null)for(r in e.key!==void 0&&(f=""+e.key),e)H.call(e,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(s[r]=e[r]);var u=arguments.length-2;if(u===1)s.children=n;else if(1<u){for(var p=Array(u),c=0;c<u;c++)p[c]=arguments[c+2];s.children=p}if(t&&t.defaultProps)for(r in u=t.defaultProps,u)s[r]===void 0&&(s[r]=u[r]);return R(t,f,void 0,void 0,null,s)},o.createRef=function(){return{current:null}},o.forwardRef=function(t){return{$$typeof:b,render:t}},o.isValidElement=T,o.lazy=function(t){return{$$typeof:C,_payload:{_status:-1,_result:t},_init:W}},o.memo=function(t,e){return{$$typeof:D,type:t,compare:e===void 0?null:e}},o.startTransition=function(t){var e=i.T,n={};i.T=n;try{var r=t(),s=i.S;s!==null&&s(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Q,$)}catch(f){$(f)}finally{i.T=e}},o.unstable_useCacheRefresh=function(){return i.H.useCacheRefresh()},o.use=function(t){return i.H.use(t)},o.useActionState=function(t,e,n){return i.H.useActionState(t,e,n)},o.useCallback=function(t,e){return i.H.useCallback(t,e)},o.useContext=function(t){return i.H.useContext(t)},o.useDebugValue=function(){},o.useDeferredValue=function(t,e){return i.H.useDeferredValue(t,e)},o.useEffect=function(t,e,n){var r=i.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(t,e)},o.useId=function(){return i.H.useId()},o.useImperativeHandle=function(t,e,n){return i.H.useImperativeHandle(t,e,n)},o.useInsertionEffect=function(t,e){return i.H.useInsertionEffect(t,e)},o.useLayoutEffect=function(t,e){return i.H.useLayoutEffect(t,e)},o.useMemo=function(t,e){return i.H.useMemo(t,e)},o.useOptimistic=function(t,e){return i.H.useOptimistic(t,e)},o.useReducer=function(t,e,n){return i.H.useReducer(t,e,n)},o.useRef=function(t){return i.H.useRef(t)},o.useState=function(t){return i.H.useState(t)},o.useSyncExternalStore=function(t,e,n){return i.H.useSyncExternalStore(t,e,n)},o.useTransition=function(){return i.H.useTransition()},o.version="19.1.0",o}var M;function J(){return M||(M=1,m.exports=Z()),m.exports}export{J as r};
@@ -0,0 +1,9 @@
1
+ import{g as v}from"./_commonjsHelpers-CqkleIqs.js";var n={exports:{}},e={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var i;function l(){if(i)return e;i=1;var a=Symbol.for("react.transitional.element"),R=Symbol.for("react.fragment");function o(p,r,t){var s=null;if(t!==void 0&&(s=""+t),r.key!==void 0&&(s=""+r.key),"key"in r){t={};for(var u in r)u!=="key"&&(t[u]=r[u])}else t=r;return r=t.ref,{$$typeof:a,type:p,key:s,ref:r!==void 0?r:null,props:t}}return e.Fragment=R,e.jsx=o,e.jsxs=o,e}var x;function E(){return x||(x=1,n.exports=l()),n.exports}var d=E();const j=v(d);export{j as R,d as j};
@@ -0,0 +1 @@
1
+ import{R as t}from"./jsx-runtime-BhZZLbvw.js";import"./_commonjsHelpers-CqkleIqs.js";const{jsx:s,jsxs:a,Fragment:m}=t,e=import.meta.url;export{m as Fragment,t as default,s as jsx,a as jsxs,e as url};
@@ -0,0 +1 @@
1
+ import{R as e}from"./index-R1UqLMGJ.js";import"./_commonjsHelpers-CqkleIqs.js";import"./index-c0qeY2gs.js";const{isValidElement:u,createElement:a,Fragment:n,useState:o,useEffect:c,useRef:i,useMemo:l,useCallback:m,useContext:f,Children:p,cloneElement:d,createContext:E,forwardRef:S,lazy:C,memo:R,Profiler:x,PureComponent:y,Suspense:I,Component:V,startTransition:b,useDebugValue:g,useDeferredValue:h,useId:k,useImperativeHandle:w,useInsertionEffect:D,useLayoutEffect:M,useReducer:O,useSyncExternalStore:P,useTransition:T,createRef:v,cache:z,useOptimistic:A,StrictMode:F,captureOwnerStack:H,useActionState:L,use:j}=e,q=import.meta.url;export{p as Children,V as Component,n as Fragment,x as Profiler,y as PureComponent,F as StrictMode,I as Suspense,z as cache,H as captureOwnerStack,d as cloneElement,E as createContext,a as createElement,v as createRef,e as default,S as forwardRef,u as isValidElement,C as lazy,R as memo,b as startTransition,q as url,j as use,L as useActionState,m as useCallback,f as useContext,g as useDebugValue,h as useDeferredValue,c as useEffect,k as useId,w as useImperativeHandle,D as useInsertionEffect,M as useLayoutEffect,l as useMemo,A as useOptimistic,O as useReducer,i as useRef,o as useState,P as useSyncExternalStore,T as useTransition};
@@ -0,0 +1 @@
1
+ import{R as e}from"./index-B7ATSoRE.js";import"./_commonjsHelpers-CqkleIqs.js";import"./index-c0qeY2gs.js";const{flushSync:a,createPortal:p,version:s,preconnect:u,prefetchDNS:i,preload:l,useFormState:m,preinit:c,useFormStatus:n,preinitModule:d,preloadModule:f,requestFormReset:S}=e,F=import.meta.url;export{p as createPortal,e as default,a as flushSync,u as preconnect,i as prefetchDNS,c as preinit,d as preinitModule,l as preload,f as preloadModule,S as requestFormReset,F as url,m as useFormState,n as useFormStatus,s as version};
@@ -0,0 +1,19 @@
1
+ export declare const renamedAttributes: Map<string, string>;
2
+ export declare const coerceToBooleanAttributes: string[];
3
+ export declare const svgCoerceToBooleanAttributes: string[];
4
+ export declare const numberAttributes: string[];
5
+ export declare const svgCamelizedAttributes: (string | boolean)[][];
6
+ export declare const eventHandlerAttributes: string[];
7
+ export declare const lowercasedAttributes: string[];
8
+ /**
9
+ * Don't strip the px suffix from these style attributes
10
+ * because they can contain both length (e.g. `13px`) and
11
+ * unitless values (e.g. `3`), which have different
12
+ * meanings.
13
+ *
14
+ * (Background: React automatically adds a `px` to unitless
15
+ * numbers specified in style attributes, so these attributes
16
+ * should not be included in `px` stripping).
17
+ */
18
+ export declare const styleDontStripPx: string[];
19
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/html/attributes.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,qBAK5B,CAAC;AAKH,eAAO,MAAM,yBAAyB,UAqCrC,CAAC;AAMF,eAAO,MAAM,4BAA4B,UAKxC,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAe5B,CAAC;AAKF,eAAO,MAAM,sBAAsB,wBA0ElC,CAAC;AAIF,eAAO,MAAM,sBAAsB,UAkFlC,CAAC;AAIF,eAAO,MAAM,oBAAoB,UA4BhC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,UAM5B,CAAC"}
@@ -0,0 +1,289 @@
1
+ // The following element listings are taken from the facebook/react repository.
2
+ // https://github.com/facebook/react/blob/main/packages/react-dom/src/shared/DOMProperty.js
3
+ // A few React string attributes have a different name.
4
+ // This is a mapping from React prop names to the attribute names.
5
+ export const renamedAttributes = new Map([
6
+ ["accept-charset", "acceptCharset"],
7
+ ["class", "className"],
8
+ ["for", "htmlFor"],
9
+ ["http-equiv", "httpEquiv"],
10
+ ]);
11
+ // These are "enumerated" HTML attributes that accept "true" and "false".
12
+ // In React, we let users pass `true` and `false` even though technically
13
+ // these aren't boolean attributes (they are coerced to strings).
14
+ export const coerceToBooleanAttributes = [
15
+ "allowFullScreen",
16
+ "async",
17
+ "autoFocus",
18
+ "autoPlay",
19
+ "checked",
20
+ "contentEditable",
21
+ "controls",
22
+ "default",
23
+ "defer",
24
+ "disabled",
25
+ "disablePictureInPicture",
26
+ "disableRemotePlayback",
27
+ "draggable",
28
+ "formNoValidate",
29
+ "hidden",
30
+ "itemScope",
31
+ "loop",
32
+ "multiple",
33
+ "muted",
34
+ "noModule",
35
+ "noValidate",
36
+ "open",
37
+ "playsInline",
38
+ "readOnly",
39
+ "required",
40
+ "reversed",
41
+ "scoped",
42
+ "seamless",
43
+ "selected",
44
+ "spellCheck",
45
+ "value",
46
+ // These accept other values than true and false which are just left as is.
47
+ // true and false will get converted to booleans.
48
+ "capture",
49
+ "download",
50
+ ];
51
+ // These are "enumerated" SVG attributes that accept "true" and "false".
52
+ // In React, we let users pass `true` and `false` even though technically
53
+ // these aren't boolean attributes (they are coerced to strings).
54
+ // Since these are SVG attributes, their attribute names are case-sensitive.
55
+ export const svgCoerceToBooleanAttributes = [
56
+ "autoReverse",
57
+ "externalResourcesRequired",
58
+ "focusable",
59
+ "preserveAlpha",
60
+ ];
61
+ // These are HTML attributes that must be positive numbers.
62
+ export const numberAttributes = [
63
+ "border",
64
+ "cellPadding",
65
+ "cellSpacing",
66
+ "cols",
67
+ "marginHeight",
68
+ "marginWidth",
69
+ "maxLength",
70
+ "minLength",
71
+ "rows",
72
+ "rowSpan",
73
+ "size",
74
+ "span",
75
+ "start",
76
+ "tabIndex",
77
+ ];
78
+ // These properties are SVG and have to be camelized.
79
+ // The second value in the array determines should be converted to a number if
80
+ // possible.
81
+ export const svgCamelizedAttributes = [
82
+ ["accent-height", false],
83
+ ["alignment-baseline", false],
84
+ ["arabic-form", false],
85
+ ["baseline-shift", false],
86
+ ["cap-height", true],
87
+ ["clip-path", false],
88
+ ["clip-rule", false],
89
+ ["color-interpolation-filters", false],
90
+ ["color-interpolation", false],
91
+ ["color-profile", false],
92
+ ["color-rendering", false],
93
+ ["dominant-baseline", false],
94
+ ["enable-background", false],
95
+ ["fill-opacity", false],
96
+ ["fill-rule", false],
97
+ ["flood-color", false],
98
+ ["flood-opacity", false],
99
+ ["font-family", false],
100
+ ["font-size-adjust", true],
101
+ ["font-size", true],
102
+ ["font-stretch", false],
103
+ ["font-style", false],
104
+ ["font-variant", false],
105
+ ["font-weight", true],
106
+ ["glyph-name", false],
107
+ ["glyph-orientation-horizontal", false],
108
+ ["glyph-orientation-vertical", false],
109
+ ["horiz-adv-x", true],
110
+ ["horiz-origin-x", true],
111
+ ["image-rendering", false],
112
+ ["letter-spacing", true],
113
+ ["lighting-color", false],
114
+ ["marker-end", false],
115
+ ["marker-mid", false],
116
+ ["marker-start", false],
117
+ ["overline-position", true],
118
+ ["overline-thickness", true],
119
+ ["paint-order", false],
120
+ ["panose-1", false],
121
+ ["pointer-events", false],
122
+ ["rendering-intent", false],
123
+ ["shape-rendering", false],
124
+ ["stop-color", false],
125
+ ["stop-opacity", false],
126
+ ["strikethrough-position", true],
127
+ ["strikethrough-thickness", true],
128
+ ["stroke-dasharray", false],
129
+ ["stroke-dashoffset", true],
130
+ ["stroke-linecap", false],
131
+ ["stroke-linejoin", false],
132
+ ["stroke-miterlimit", true],
133
+ ["stroke-opacity", false],
134
+ ["stroke-width", true],
135
+ ["text-anchor", false],
136
+ ["text-decoration", false],
137
+ ["text-rendering", false],
138
+ ["underline-position", true],
139
+ ["underline-thickness", true],
140
+ ["unicode-bidi", false],
141
+ ["unicode-range", false],
142
+ ["units-per-em", true],
143
+ ["v-alphabetic", true],
144
+ ["v-hanging", true],
145
+ ["v-ideographic", true],
146
+ ["v-mathematical", true],
147
+ ["vector-effect", false],
148
+ ["vert-adv-y", true],
149
+ ["vert-origin-x", true],
150
+ ["vert-origin-y", true],
151
+ ["word-spacing", true],
152
+ ["writing-mode", false],
153
+ ["x-height", true],
154
+ ["xmlns:xlink", false],
155
+ ];
156
+ // Supported event attributes in React, taken from
157
+ // https://reactjs.org/docs/events.html
158
+ export const eventHandlerAttributes = [
159
+ "onAbort",
160
+ "onAnimationEnd",
161
+ "onAnimationIteration",
162
+ "onAnimationStart",
163
+ "onBlur",
164
+ "onCanPlay",
165
+ "onCanPlayThrough",
166
+ "onChange",
167
+ "onClick",
168
+ "onCompositionEnd",
169
+ "onCompositionStart",
170
+ "onCompositionUpdate",
171
+ "onContextMenu",
172
+ "onCopy",
173
+ "onCut",
174
+ "onDoubleClick",
175
+ "onDrag",
176
+ "onDragEnd",
177
+ "onDragEnter",
178
+ "onDragExit",
179
+ "onDragLeave",
180
+ "onDragOver",
181
+ "onDragStart",
182
+ "onDrop",
183
+ "onDurationChange",
184
+ "onEmptied",
185
+ "onEncrypted",
186
+ "onEnded",
187
+ "onError",
188
+ "onError",
189
+ "onFocus",
190
+ "onGotPointerCapture",
191
+ "onInput",
192
+ "onInvalid",
193
+ "onKeyDown",
194
+ "onKeyPress",
195
+ "onKeyUp",
196
+ "onLoad",
197
+ "onLoadedData",
198
+ "onLoadedMetadata",
199
+ "onLoadStart",
200
+ "onLostPointerCapture",
201
+ "onMouseDown",
202
+ "onMouseEnter",
203
+ "onMouseLeave",
204
+ "onMouseMove",
205
+ "onMouseOut",
206
+ "onMouseOver",
207
+ "onMouseUp",
208
+ "onPaste",
209
+ "onPause",
210
+ "onPlay",
211
+ "onPlaying",
212
+ "onPointerCancel",
213
+ "onPointerDown",
214
+ "onPointerEnter",
215
+ "onPointerLeave",
216
+ "onPointerMove",
217
+ "onPointerOut",
218
+ "onPointerOver",
219
+ "onPointerUp",
220
+ "onProgress",
221
+ "onRateChange",
222
+ "onReset",
223
+ "onScroll",
224
+ "onSeeked",
225
+ "onSeeking",
226
+ "onSelect",
227
+ "onStalled",
228
+ "onSubmit",
229
+ "onSuspend",
230
+ "onTimeUpdate",
231
+ "onToggle",
232
+ "onTouchCancel",
233
+ "onTouchEnd",
234
+ "onTouchMove",
235
+ "onTouchStart",
236
+ "onTransitionEnd",
237
+ "onVolumeChange",
238
+ "onWaiting",
239
+ "onWheel",
240
+ ];
241
+ // List of attributes that are lower-cased in HTML but have to be camel-cased in
242
+ // JSX code. Taken from https://reactjs.org/docs/dom-elements.html
243
+ export const lowercasedAttributes = [
244
+ "accessKey",
245
+ "autoComplete",
246
+ "charSet",
247
+ "classID",
248
+ "colSpan",
249
+ "cellSpacing",
250
+ "cellMargin",
251
+ "contextMenu",
252
+ "controlsList",
253
+ "crossOrigin",
254
+ "dateTime",
255
+ "encType",
256
+ "formAction",
257
+ "formEncType",
258
+ "formMethod",
259
+ "formTarget",
260
+ "frameBorder",
261
+ "hrefLang",
262
+ "inputMode",
263
+ "keyParams",
264
+ "keyType",
265
+ "mediaGroup",
266
+ "radioGroup",
267
+ "srcDoc",
268
+ "srcLang",
269
+ "srcSet",
270
+ "useMap",
271
+ ];
272
+ /**
273
+ * Don't strip the px suffix from these style attributes
274
+ * because they can contain both length (e.g. `13px`) and
275
+ * unitless values (e.g. `3`), which have different
276
+ * meanings.
277
+ *
278
+ * (Background: React automatically adds a `px` to unitless
279
+ * numbers specified in style attributes, so these attributes
280
+ * should not be included in `px` stripping).
281
+ */
282
+ export const styleDontStripPx = [
283
+ "line-height",
284
+ "flex",
285
+ "mask-border-outset",
286
+ "mask-box-outset",
287
+ "mask-border-width",
288
+ ];
289
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../src/html/attributes.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,2FAA2F;AAE3F,uDAAuD;AACvD,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACvC,CAAC,gBAAgB,EAAE,eAAe,CAAC;IACnC,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,KAAK,EAAE,SAAS,CAAC;IAClB,CAAC,YAAY,EAAE,WAAW,CAAC;CAC5B,CAAC,CAAC;AAEH,yEAAyE;AACzE,yEAAyE;AACzE,iEAAiE;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,iBAAiB;IACjB,OAAO;IACP,WAAW;IACX,UAAU;IACV,SAAS;IACT,iBAAiB;IACjB,UAAU;IACV,SAAS;IACT,OAAO;IACP,UAAU;IACV,yBAAyB;IACzB,uBAAuB;IACvB,WAAW;IACX,gBAAgB;IAChB,QAAQ;IACR,WAAW;IACX,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,YAAY;IACZ,MAAM;IACN,aAAa;IACb,UAAU;IACV,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;IACZ,OAAO;IAEP,2EAA2E;IAC3E,iDAAiD;IACjD,SAAS;IACT,UAAU;CACX,CAAC;AAEF,wEAAwE;AACxE,yEAAyE;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Q;IACR,cAAc;IACd,kBAAkB;IAClB,aAAa;IACb,sBAAsB;IACtB,aAAa;IACb,cAAc;IACd,cAAc;IACd,aAAa;IACb,YAAY;IACZ,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,eAAe;IACf,aAAa;IACb,YAAY;IACZ,cAAc;IACd,SAAS;IACT,UAAU;IACV,UAAU;IACV,WAAW;IACX,UAAU;IACV,WAAW;IACX,UAAU;IACV,WAAW;IACX,cAAc;IACd,UAAU;IACV,eAAe;IACf,YAAY;IACZ,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,SAAS;CACV,CAAC;AAEF,gFAAgF;AAChF,kEAAkE;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW;IACX,cAAc;IACd,SAAS;IACT,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,aAAa;IACb,cAAc;IACd,aAAa;IACb,UAAU;IACV,SAAS;IACT,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,UAAU;IACV,WAAW;IACX,WAAW;IACX,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,aAAa;IACb,MAAM;IACN,oBAAoB;IACpB,iBAAiB;IACjB,mBAAmB;CACpB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function convertAttributeNameToJSX(htmlName: string): string;
2
+ /**
3
+ * Converts kebab-case or colon:case to camelCase
4
+ */
5
+ export declare function camelize(string: string): string;
6
+ //# sourceMappingURL=convert-attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-attributes.d.ts","sourceRoot":"","sources":["../../src/html/convert-attributes.ts"],"names":[],"mappings":"AAaA,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA8BlE;AAOD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,UAKtC"}
@@ -0,0 +1,43 @@
1
+ import { eventHandlerAttributes, lowercasedAttributes, renamedAttributes, svgCamelizedAttributes, } from "./attributes.js";
2
+ // Export function to convert HTML attribute name to JSX attribute name
3
+ export function convertAttributeNameToJSX(htmlName) {
4
+ // Check renamed attributes
5
+ for (const [html, jsx] of renamedAttributes) {
6
+ if (html === htmlName) {
7
+ return jsx;
8
+ }
9
+ }
10
+ // Check event handler attributes
11
+ for (const jsxAttribute of eventHandlerAttributes) {
12
+ if (htmlName === jsxAttribute.toLowerCase()) {
13
+ return jsxAttribute;
14
+ }
15
+ }
16
+ // Check lowercased attributes
17
+ for (const jsxAttribute of lowercasedAttributes) {
18
+ if (htmlName === jsxAttribute.toLowerCase()) {
19
+ return jsxAttribute;
20
+ }
21
+ }
22
+ // Check SVG camelized attributes
23
+ for (const [jsxAttribute] of svgCamelizedAttributes) {
24
+ if (htmlName === jsxAttribute) {
25
+ return camelize(htmlName);
26
+ }
27
+ }
28
+ return htmlName;
29
+ }
30
+ const CAMELIZE = /[\-\:]([a-z])/g;
31
+ const capitalize = (token) => token[1].toUpperCase();
32
+ const IS_CSS_VARIBLE = /^--\w+/;
33
+ /**
34
+ * Converts kebab-case or colon:case to camelCase
35
+ */
36
+ export function camelize(string) {
37
+ // Skip the attribute if it is a css variable.
38
+ // It looks something like this: style="--bgColor: red"
39
+ if (IS_CSS_VARIBLE.test(string))
40
+ return `"${string}"`;
41
+ return string.replace(CAMELIZE, capitalize);
42
+ }
43
+ //# sourceMappingURL=convert-attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-attributes.js","sourceRoot":"","sources":["../../src/html/convert-attributes.ts"],"names":[],"mappings":"AACA,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"}
@@ -0,0 +1,4 @@
1
+ export declare function parseHTML(html: string): {
2
+ document: Document;
3
+ };
4
+ //# sourceMappingURL=domparser-browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domparser-browser.d.ts","sourceRoot":"","sources":["../../src/html/domparser-browser.ts"],"names":[],"mappings":"AACA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM;;EAIrC"}
@@ -0,0 +1,7 @@
1
+ // Browser-specific DOMParser implementation
2
+ export function parseHTML(html) {
3
+ const parser = new DOMParser();
4
+ const doc = parser.parseFromString(html, 'text/html');
5
+ return { document: doc };
6
+ }
7
+ //# sourceMappingURL=domparser-browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domparser-browser.js","sourceRoot":"","sources":["../../src/html/domparser-browser.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,UAAU,SAAS,CAAC,IAAY;IAClC,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;IAC/B,MAAM,GAAG,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACtD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function parseHTML(html: string): Window & typeof globalThis;
2
+ //# sourceMappingURL=domparser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domparser.d.ts","sourceRoot":"","sources":["../../src/html/domparser.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,8BAErC"}
@@ -0,0 +1,5 @@
1
+ import { parseHTML as linkedomParseHTML } from 'linkedom';
2
+ export function parseHTML(html) {
3
+ return linkedomParseHTML(html);
4
+ }
5
+ //# sourceMappingURL=domparser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domparser.js","sourceRoot":"","sources":["../../src/html/domparser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,UAAU,SAAS,CAAC,IAAY;IAClC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { RootContent } from 'mdast';
2
+ export { default as remarkMdxJsxNormalize } from './remark-mdx-jsx-normalize.js';
3
+ export type ConvertTagName = (args: {
4
+ tagName: string;
5
+ }) => string;
6
+ export type TextToMdast = (args: {
7
+ text: string;
8
+ }) => RootContent | RootContent[];
9
+ export type ConvertAttributeValue = (args: {
10
+ name: string;
11
+ value: string;
12
+ tagName: string;
13
+ }) => string;
14
+ export interface ParseHtmlToMdxAstOptions {
15
+ html: string;
16
+ onError?: (error: unknown, text: string) => void;
17
+ convertTagName?: ConvertTagName;
18
+ textToMdast?: TextToMdast;
19
+ convertAttributeValue?: ConvertAttributeValue;
20
+ }
21
+ export declare function htmlToMdxAst(options: ParseHtmlToMdxAstOptions): RootContent | RootContent[];
22
+ export declare function parseHtmlToMdxAst(options: ParseHtmlToMdxAstOptions): RootContent[];
23
+ //# sourceMappingURL=html-to-mdx-ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-to-mdx-ast.d.ts","sourceRoot":"","sources":["../../src/html/html-to-mdx-ast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,WAAW,EAAqB,MAAM,OAAO,CAAA;AAWjE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAGhF,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,CAAA;AAGlE,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE;IAC7B,IAAI,EAAE,MAAM,CAAA;CACf,KAAK,WAAW,GAAG,WAAW,EAAE,CAAA;AAGjC,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAClB,KAAK,MAAM,CAAA;AAGZ,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;CAChD;AAwND,wBAAgB,YAAY,CACxB,OAAO,EAAE,wBAAwB,GAClC,WAAW,GAAG,WAAW,EAAE,CA0C7B;AAGD,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,wBAAwB,GAClC,WAAW,EAAE,CAGf"}