davis-components 0.2.83 → 0.2.85

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.
@@ -1,6 +1,7 @@
1
- import { g as ni, D as oi } from "./main-o7foZry_.js";
2
- import ri from "react";
3
- import { r as ii } from "./immutable-CIS6pMM7.js";
1
+ import { g as ni } from "./main-1jFRsw9J.js";
2
+ import oi from "react";
3
+ import { a as ri } from "./Draft-gS_EaznZ.js";
4
+ import { r as ii } from "./immutable-DEDgyEm6.js";
4
5
  function ai(Ge, rt) {
5
6
  for (var Ze = 0; Ze < rt.length; Ze++) {
6
7
  const ze = rt[Ze];
@@ -20,7 +21,7 @@ function ai(Ge, rt) {
20
21
  var Mo = { exports: {} };
21
22
  (function(Ge, rt) {
22
23
  (function(Ze, ze) {
23
- Ge.exports = ze(ri, oi, ii());
24
+ Ge.exports = ze(oi, ri, ii());
24
25
  })(window, function(Ze, ze, Qe) {
25
26
  return Je = {}, pe.m = Rt = [function(S, A, E) {
26
27
  S.exports = E(10)();
@@ -4047,10 +4048,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4047
4048
  });
4048
4049
  })(Mo);
4049
4050
  var jo = Mo.exports;
4050
- const ci = /* @__PURE__ */ ni(jo), pi = /* @__PURE__ */ ai({
4051
+ const ci = /* @__PURE__ */ ni(jo), di = /* @__PURE__ */ ai({
4051
4052
  __proto__: null,
4052
4053
  default: ci
4053
4054
  }, [jo]);
4054
4055
  export {
4055
- pi as r
4056
+ di as r
4056
4057
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "dist/main.cjs.js",
4
4
  "module": "dist/main.es.js",
5
5
  "style": "dist/main.css",
6
- "version": "0.2.83",
6
+ "version": "0.2.85",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
@@ -1,3 +0,0 @@
1
- "use strict";const G=require("./main-D80J2qVi.cjs"),ft=require("./immutable-DKARb8Pa.cjs");function dt(L,H){for(var w=0;w<H.length;w++){const h=H[w];if(typeof h!="string"&&!Array.isArray(h)){for(const o in h)if(o!=="default"&&!(o in L)){const T=Object.getOwnPropertyDescriptor(h,o);T&&Object.defineProperty(L,o,T.get?T:{enumerable:!0,get:()=>h[o]})}}}return Object.freeze(Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}))}var V={exports:{}};(function(L,H){(function(w,h){L.exports=h(ft.requireImmutable(),G.Draft)})(window,function(w,h){return A={},o.m=T=[function(e,r){e.exports=w},function(e,r){e.exports=h},function(e,r,u){e.exports=u(3)},function(e,r,u){u.r(r);var c=u(1),l=u(0),J=function(t){var a,i=null;return document.implementation&&document.implementation.createHTMLDocument&&((a=document.implementation.createHTMLDocument("foo")).documentElement.innerHTML=t,i=a.getElementsByTagName("body")[0]),i},Q=function(t,a,i){var d,m=t.textContent;return m.trim()===""?{chunk:(d=i,{text:" ",inlines:[new l.OrderedSet],entities:[d],blocks:[]})}:{chunk:{text:m,inlines:Array(m.length).fill(a),entities:Array(m.length).fill(i),blocks:[]}}},X=function(){return{text:`
2
- `,inlines:[new l.OrderedSet],entities:new Array(1),blocks:[]}},Y=function(){return{text:"",inlines:[],entities:[],blocks:[]}},Z=function(t,a){return{text:"",inlines:[],entities:[],blocks:[{type:t,depth:0,data:a||new l.Map({})}]}},tt=function(t,a,i){return{text:"\r",inlines:[],entities:[],blocks:[{type:t,depth:Math.max(0,Math.min(4,a)),data:i||new l.Map({})}]}},D=function(t){return{text:"\r ",inlines:[new l.OrderedSet],entities:[t],blocks:[{type:"atomic",depth:0,data:new l.Map({})}]}},et=function(t,a){return{text:t.text+a.text,inlines:t.inlines.concat(a.inlines),entities:t.entities.concat(a.entities),blocks:t.blocks.concat(a.blocks)}},nt=new l.Map({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},"unordered-list-item":{element:"li",wrapper:"ul"},"ordered-list-item":{element:"li",wrapper:"ol"},blockquote:{element:"blockquote"},code:{element:"pre"},atomic:{element:"figure"},unstyled:{element:"p",aliasedElements:["div"]}}),I={code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",strong:"BOLD",ins:"UNDERLINE",sub:"SUBSCRIPT",sup:"SUPERSCRIPT"};function U(t){return t.style.textAlign?new l.Map({"text-align":t.style.textAlign}):t.style.marginLeft?new l.Map({"margin-left":t.style.marginLeft}):void 0}var rt=function(t){var a=void 0;if(t instanceof HTMLAnchorElement){var i={};a=t.dataset&&t.dataset.mention!==void 0?(i.url=t.href,i.text=t.innerHTML,i.value=t.dataset.value,c.Entity.__create("MENTION","IMMUTABLE",i)):(i.url=t.getAttribute&&t.getAttribute("href")||t.href,i.title=t.innerHTML,i.targetOption=t.target,c.Entity.__create("LINK","MUTABLE",i))}return a};u.d(r,"default",function(){return ot});var it=" ",at=new RegExp("&nbsp;","g"),B=!0;function R(t,a,i,d,m,O){var n=t.nodeName.toLowerCase();if(O){var g=O(n,t);if(g){var _=c.Entity.__create(g.type,g.mutability,g.data||{});return{chunk:D(_)}}}if(n==="#text"&&t.textContent!==`
3
- `)return Q(t,a,m);if(n==="br")return{chunk:X()};if(n==="img"&&t instanceof HTMLImageElement){var s={};s.src=t.getAttribute&&t.getAttribute("src")||t.src,s.alt=t.alt,s.height=t.style.height,s.width=t.style.width,t.style.float&&(s.alignment=t.style.float);var b=c.Entity.__create("IMAGE","MUTABLE",s);return{chunk:D(b)}}if(n==="video"&&t instanceof HTMLVideoElement){var p={};p.src=t.getAttribute&&t.getAttribute("src")||t.src,p.alt=t.alt,p.height=t.style.height,p.width=t.style.width,t.style.float&&(p.alignment=t.style.float);var P=c.Entity.__create("VIDEO","MUTABLE",p);return{chunk:D(P)}}if(n==="iframe"&&t instanceof HTMLIFrameElement){var E={};E.src=t.getAttribute&&t.getAttribute("src")||t.src,E.height=t.height,E.width=t.width;var N=c.Entity.__create("EMBEDDED_LINK","MUTABLE",E);return{chunk:D(N)}}var y,v=function(S,C){var j=nt.filter(function(f){return f.element===S&&(!f.wrapper||f.wrapper===C)||f.wrapper===S||f.aliasedElements&&-1<f.aliasedElements.indexOf(S)}).keySeq().toSet().toArray();if(j.length===1)return j[0]}(n,d);v&&(n==="ul"||n==="ol"?(d=n,i+=1):(v!=="unordered-list-item"&&v!=="ordered-list-item"&&(d="",i=-1),B?(y=Z(v,U(t)),B=!1):y=tt(v,i,U(t)))),y=y||Y(),a=function(S,C,j){var f,q=I[S];if(q)f=j.add(q).toOrderedSet();else if(C instanceof HTMLElement){var M=C;f=(f=j).withMutations(function(k){var K=M.style.color,$=M.style.backgroundColor,z=M.style.fontSize,F=M.style.fontFamily.replace(/^"|"$/g,""),ut=M.style.fontWeight,ct=M.style.textDecoration,st=M.style.fontStyle;K&&k.add("color-".concat(K.replace(/ /g,""))),$&&k.add("bgcolor-".concat($.replace(/ /g,""))),z&&k.add("fontsize-".concat(z.replace(/px$/g,""))),F&&k.add("fontfamily-".concat(F)),ut==="bold"&&k.add(I.strong),ct==="underline"&&k.add(I.ins),st==="italic"&&k.add(I.em)}).toOrderedSet()}return f}(n,t,a);for(var x=t.firstChild;x;){var lt=R(x,a,i,d,rt(x)||m,O).chunk;y=et(y,lt),x=x.nextSibling}return{chunk:y}}function ot(t,a){var i,d,m,O=(i=a,d=t.trim().replace(at,it),(m=J(d))?(B=!0,{chunk:R(m,new l.OrderedSet,-1,"",void 0,i).chunk}):null);if(O){var n=O.chunk,g=new l.OrderedMap({});n.entities&&n.entities.forEach(function(s){s&&(g=g.set(s,c.Entity.__get(s)))});var _=0;return{contentBlocks:n.text.split("\r").map(function(s,b){var p=_+s.length,P=n&&n.inlines.slice(_,p),E=n&&n.entities.slice(_,p),N=new l.List(P.map(function(y,v){var x={style:y,entity:null};return E[v]&&(x.entity=E[v]),c.CharacterMetadata.create(x)}));return _=p,new c.ContentBlock({key:Object(c.genKey)(),type:n&&n.blocks[b]&&n.blocks[b].type||"unstyled",depth:n&&n.blocks[b]&&n.blocks[b].depth,data:n&&n.blocks[b]&&n.blocks[b].data||new l.Map({}),text:s,characterList:N})}),entityMap:g}}return null}}],o.c=A,o.d=function(e,r,u){o.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:u})},o.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,r){if(1&r&&(e=o(e)),8&r||4&r&&typeof e=="object"&&e&&e.__esModule)return e;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:e}),2&r&&typeof e!="string")for(var c in e)o.d(u,c,function(l){return e[l]}.bind(null,c));return u},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="",o(o.s=2);function o(e){if(A[e])return A[e].exports;var r=A[e]={i:e,l:!1,exports:{}};return T[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}var T,A})})(V);var W=V.exports;const mt=G.getDefaultExportFromCjs(W),pt=dt({__proto__:null,default:mt},[W]);exports.htmlToDraftjs=pt;
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("./immutable-DKARb8Pa.cjs");require("./main-D80J2qVi.cjs");function Oe(e){return Ie(e)||we(e)||Se()}function Se(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function we(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Ie(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function X(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r}function Z(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(r,!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function De(e,t){return ke(e)||Re(e,t)||Ae()}function Ae(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Re(e,t){var r=[],n=!0,l=!1,a=void 0;try{for(var i=e[Symbol.iterator](),o;!(n=(o=i.next()).done)&&(r.push(o.value),!(t&&r.length===t));n=!0);}catch(u){l=!0,a=u}finally{try{!n&&i.return!=null&&i.return()}finally{if(l)throw a}}return r}function ke(e){if(Array.isArray(e))return e}function me(e,t){if(e==null)return t;for(var r=De(t,2),n=r[0],l=r[1],a=Z({},n),i=Oe(l),o=0,u=Object.keys(e);o<u.length;o++){var s=u[o];if(n.hasOwnProperty(s)){var h=n[s];a[s]=Z({},h,{},e[s])}else a[s]=e[s],i.push(s)}return[a,i]}var J={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"};function M(e){if(e==null)return e;for(var t={},r=!1,n=0,l=Object.keys(e);n<l.length;n++){var a=l[n],i=a;J.hasOwnProperty(a)&&(i=J[a],r=!0),t[i]=e[a]}return r?t:e}var Le=/^(moz|ms|o|webkit)-/,Pe=/^\d+$/,Ce=/([A-Z])/g,_e={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function Be(e){return e.replace(Ce,"-$1").toLowerCase().replace(Le,"-$1-")}function Ne(e,t){var r;return typeof t=="string"?r=Pe.test(t):(r=!0,t=String(t)),!r||t==="0"||_e[e]===!0?t:t+"px"}function R(e){return Object.keys(e).map(function(t){var r=Ne(t,e[t]),n=Be(t);return"".concat(n,": ").concat(r)}).join("; ")}var f={UNSTYLED:"unstyled",HEADER_ONE:"header-one",HEADER_TWO:"header-two",HEADER_THREE:"header-three",HEADER_FOUR:"header-four",HEADER_FIVE:"header-five",HEADER_SIX:"header-six",UNORDERED_LIST_ITEM:"unordered-list-item",ORDERED_LIST_ITEM:"ordered-list-item",BLOCKQUOTE:"blockquote",PULLQUOTE:"pullquote",CODE:"code-block",ATOMIC:"atomic"},S={LINK:"LINK",IMAGE:"IMAGE"},I={BOLD:"BOLD",CODE:"CODE",ITALIC:"ITALIC",STRIKETHROUGH:"STRIKETHROUGH",UNDERLINE:"UNDERLINE"},ae=Te.requireImmutable(),U=new ae.OrderedSet;function je(e,t){for(var r=null,n=null,l=[],a=0,i=0,o=e.length;i<o;i++){n=r;var u=t.get(i);r=u?u.getEntity():null,i>0&&r!==n&&(l.push([n,ee(e.slice(a,i),t.slice(a,i))]),a=i)}return l.push([r,ee(e.slice(a),t.slice(a))]),l}function ee(e,t){for(var r=U,n=U,l=[],a=0,i=0,o=e.length;i<o;i++){n=r;var u=t.get(i);r=u?u.getStyle():U,i>0&&!ae.is(r,n)&&(l.push([e.slice(a,i),n]),a=i)}return l.push([e.slice(a),r]),l}var E,k,m;function re(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r}function L(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?re(r,!0).forEach(function(n){c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x(e,t){return Ue(e)||Me(e,t)||He()}function He(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Me(e,t){var r=[],n=!0,l=!1,a=void 0;try{for(var i=e[Symbol.iterator](),o;!(n=(o=i.next()).done)&&(r.push(o.value),!(t&&r.length===t));n=!0);}catch(u){l=!0,a=u}finally{try{!n&&i.return!=null&&i.return()}finally{if(l)throw a}}return r}function Ue(e){if(Array.isArray(e))return e}function xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function We(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fe(e,t,r){return t&&We(e.prototype,t),e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ie=I.BOLD,W=I.CODE,le=I.ITALIC,oe=I.STRIKETHROUGH,ue=I.UNDERLINE,Ge=" ",se="<br>",te=/^data-([a-z0-9-]+)$/,Ye=(E={},c(E,ie,{element:"strong"}),c(E,W,{element:"code"}),c(E,le,{element:"em"}),c(E,oe,{element:"del"}),c(E,ue,{element:"u"}),E),qe=[ie,le,ue,oe,W],P=(k={},c(k,S.LINK,{url:"href",href:"href",rel:"rel",target:"target",title:"title",className:"class"}),c(k,S.IMAGE,{src:"src",height:"height",width:"width",alt:"alt",className:"class"}),k),C=(m={},c(m,S.LINK,function(e,t){for(var r=P.hasOwnProperty(e)?P[e]:{},n=t.getData(),l={},a=0,i=Object.keys(n);a<i.length;a++){var o=i[a],u=n[o];if(r.hasOwnProperty(o)){var s=r[o];l[s]=u}else te.test(o)&&(l[o]=u)}return l}),c(m,S.IMAGE,function(e,t){for(var r=P.hasOwnProperty(e)?P[e]:{},n=t.getData(),l={},a=0,i=Object.keys(n);a<i.length;a++){var o=i[a],u=n[o];if(r.hasOwnProperty(o)){var s=r[o];l[s]=u}else te.test(o)&&(l[o]=u)}return l}),m);function ne(e,t){switch(e){case f.HEADER_ONE:return["h1"];case f.HEADER_TWO:return["h2"];case f.HEADER_THREE:return["h3"];case f.HEADER_FOUR:return["h4"];case f.HEADER_FIVE:return["h5"];case f.HEADER_SIX:return["h6"];case f.UNORDERED_LIST_ITEM:case f.ORDERED_LIST_ITEM:return["li"];case f.BLOCKQUOTE:return["blockquote"];case f.CODE:return["pre","code"];case f.ATOMIC:return["figure"];default:return t===null?[]:[t||"p"]}}function ze(e){switch(e){case f.UNORDERED_LIST_ITEM:return"ul";case f.ORDERED_LIST_ITEM:return"ol";default:return null}}var Ke=function(){function e(t,r){xe(this,e),c(this,"blocks",void 0),c(this,"contentState",void 0),c(this,"currentBlock",void 0),c(this,"indentLevel",void 0),c(this,"output",void 0),c(this,"totalBlocks",void 0),c(this,"wrapperTag",void 0),c(this,"options",void 0),c(this,"inlineStyles",void 0),c(this,"inlineStyleFn",void 0),c(this,"styleOrder",void 0),r==null&&(r={}),this.contentState=t,this.options=r;var n=me(r.inlineStyles,[Ye,qe]),l=x(n,2),a=l[0],i=l[1];this.inlineStyles=a,this.inlineStyleFn=r.inlineStyleFn,this.styleOrder=i}return Fe(e,[{key:"generate",value:function(){for(this.output=[],this.blocks=this.contentState.getBlocksAsArray(),this.totalBlocks=this.blocks.length,this.currentBlock=0,this.indentLevel=0,this.wrapperTag=null;this.currentBlock<this.totalBlocks;)this.processBlock();return this.closeWrapperTag(),this.output.join("").trim()}},{key:"processBlock",value:function(){var r=this.options,n=r.blockRenderers,l=r.defaultBlockTag,a=this.blocks[this.currentBlock],i=a.getType(),o=ze(i);this.wrapperTag!==o&&(this.wrapperTag&&this.closeWrapperTag(),o&&this.openWrapperTag(o)),this.indent();var u=n!=null&&n.hasOwnProperty(i)?n[i]:null,s=u?u(a):null;if(s!=null){this.output.push(s),this.output.push(`
2
- `),this.currentBlock+=1;return}this.writeStartTag(a,l),this.output.push(this.renderBlockContent(a));var h=this.getNextBlock();if($e(i)&&h&&h.getDepth()===a.getDepth()+1){this.output.push(`
3
- `);var y=this.wrapperTag;this.wrapperTag=null,this.indentLevel+=1,this.currentBlock+=1,this.processBlocksAtDepth(h.getDepth()),this.wrapperTag=y,this.indentLevel-=1,this.indent()}else this.currentBlock+=1;this.writeEndTag(a,l)}},{key:"processBlocksAtDepth",value:function(r){for(var n=this.blocks[this.currentBlock];n&&n.getDepth()===r;)this.processBlock(),n=this.blocks[this.currentBlock];this.closeWrapperTag()}},{key:"getNextBlock",value:function(){return this.blocks[this.currentBlock+1]}},{key:"writeStartTag",value:function(r,n){var l=ne(r.getType(),n),a;if(this.options.blockStyleFn){var i=this.options.blockStyleFn(r)||{},o=i.attributes,u=i.style;if(o=M(o),u!=null){var s=R(u);o=o==null?{style:s}:L({},o,{style:s})}a=O(o)}else a="";var h=!0,y=!1,g=void 0;try{for(var v=l[Symbol.iterator](),p;!(h=(p=v.next()).done);h=!0){var b=p.value;this.output.push("<".concat(b).concat(a,">"))}}catch(w){y=!0,g=w}finally{try{!h&&v.return!=null&&v.return()}finally{if(y)throw g}}}},{key:"writeEndTag",value:function(r,n){var l=ne(r.getType(),n);if(l.length===1)this.output.push("</".concat(l[0],`>
4
- `));else{var a=[],i=!0,o=!1,u=void 0;try{for(var s=l[Symbol.iterator](),h;!(i=(h=s.next()).done);i=!0){var y=h.value;a.unshift("</".concat(y,">"))}}catch(g){o=!0,u=g}finally{try{!i&&s.return!=null&&s.return()}finally{if(o)throw u}}this.output.push(a.join("")+`
5
- `)}}},{key:"openWrapperTag",value:function(r){this.wrapperTag=r,this.indent(),this.output.push("<".concat(r,`>
6
- `)),this.indentLevel+=1}},{key:"closeWrapperTag",value:function(){var r=this.wrapperTag;r&&(this.indentLevel-=1,this.indent(),this.output.push("</".concat(r,`>
7
- `)),this.wrapperTag=null)}},{key:"indent",value:function(){this.output.push(Ge.repeat(this.indentLevel))}},{key:"withCustomInlineStyles",value:function(r,n){if(!this.inlineStyleFn)return r;var l=this.inlineStyleFn(n);if(!l)return r;var a=l.element,i=a===void 0?"span":a,o=l.attributes,u=l.style,s=O(L({},o,{style:u&&R(u)}));return"<".concat(i).concat(s,">").concat(r,"</").concat(i,">")}},{key:"renderBlockContent",value:function(r){var n=this,l=r.getType(),a=r.getText();if(a==="")return se;a=this.preserveWhitespace(a);var i=r.getCharacterList(),o=je(a,i);return o.map(function(u){var s=x(u,2),h=s[0],y=s[1],g=y.map(function(ye){var Y=x(ye,2),ge=Y[0],q=Y[1],_=Qe(ge),B=!0,z=!1,K=void 0;try{for(var N=n.styleOrder[Symbol.iterator](),$;!(B=($=N.next()).done);B=!0){var j=$.value;if(!(j===W&&l===f.CODE)&&q.has(j)){var H=n.inlineStyles[j],A=H.element,T=H.attributes,Q=H.style;if(A==null&&(A="span"),T=M(T),Q!=null){var V=R(Q);T=T==null?{style:V}:L({},T,{style:V})}var Ee=O(T);_="<".concat(A).concat(Ee,">").concat(_,"</").concat(A,">")}}}catch(de){z=!0,K=de}finally{try{!B&&N.return!=null&&N.return()}finally{if(z)throw K}}return n.withCustomInlineStyles(_,q)}).join(""),v=h?n.contentState.getEntity(h):null,p=v==null?null:v.getType().toUpperCase(),b;if(v!=null&&n.options.entityStyleFn&&(b=n.options.entityStyleFn(v))){var w=b,D=w.element,d=w.attributes,F=w.style;if(D==null&&(D="span"),d=M(d),F!=null){var G=R(F);d=d==null?{style:G}:L({},d,{style:G})}var ce=O(d);return"<".concat(D).concat(ce,">").concat(g,"</").concat(D,">")}else if(p!=null&&p===S.LINK){var fe=C.hasOwnProperty(p)?C[p](p,v):null,he=O(fe);return"<a".concat(he,">").concat(g,"</a>")}else if(p!=null&&p===S.IMAGE){var pe=C.hasOwnProperty(p)?C[p](p,v):null,ve=O(pe);return"<img".concat(ve,"/>")}else return g}).join("")}},{key:"preserveWhitespace",value:function(r){for(var n=r.length,l=new Array(n),a=0;a<n;a++)r[a]===" "&&(a===0||a===n-1||r[a-1]===" ")?l[a]=" ":l[a]=r[a];return l.join("")}}]),e}();function O(e){if(e==null)return"";for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var l=n[r],a=e[l];a!=null&&t.push(" ".concat(l,'="').concat(Ve(a+""),'"'))}return t.join("")}function $e(e){switch(e){case f.UNORDERED_LIST_ITEM:case f.ORDERED_LIST_ITEM:return!0;default:return!1}}function Qe(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split(" ").join("&nbsp;").split(`
8
- `).join(se+`
9
- `)}function Ve(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")}function Xe(e,t){return new Ke(e,t).generate()}exports.stateToHTML=Xe;