@sakura-ui/markdown 0.0.11 → 0.0.12

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/index.cjs.js CHANGED
@@ -414,6 +414,9 @@ Check the top-level render call using <`+_+">.")}return h}function Cr(s,h){if(!(
414
414
  w-full
415
415
  overflow-x-auto
416
416
  whitespace-nowrap
417
+ print:overflow-visible
418
+ print:whitespace-normal
419
+
417
420
  `,t),...r,children:n})},rr=e=>e.type==="containerDirective"||e.type==="leafDirective"||e.type==="textDirective",La=e=>e.type==="containerDirective",R_=e=>e.type==="textDirective",O_=e=>e.type==="heading",L_=()=>e=>{Nt(e,rr,t=>{if(t.type==="containerDirective"||t.type==="leafDirective"){if(t.name!=="youtube")return;const n=t.data||(t.data={}),r=t.attributes||{},u=r.id;u||console.error("Unexpected missing `id` on `youtube` directive");const a=t.children[0].value,l=r.width,c=r.height,f=r.allow||"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",d=r.referrerpolicy||"strict-origin-when-cross-origin";n.hName="iframe",n.hProperties={title:a,src:`https://www.youtube-nocookie.com/embed/${u}`,width:l,height:c,frameBorder:0,allow:f,referrerpolicy:d,allowFullScreen:!0,loading:"lazy"}}})},Ji={}.hasOwnProperty;function bc(e,t,n){const r=n&&P_(n);function u(i,a,...l){let c=-1,f;if(i==null){f={type:"root",children:[]};const d=a;l.unshift(d)}else if(f=ml(i,t),f.tagName=f.tagName.toLowerCase(),r&&Ji.call(r,f.tagName)&&(f.tagName=r[f.tagName]),F_(a))l.unshift(a);else{let d;for(d in a)Ji.call(a,d)&&v_(e,f.properties,d,a[d])}for(;++c<l.length;)Zi(f.children,l[c]);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return u}function F_(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const u=t[r];if(u&&typeof u=="object"){if(!Array.isArray(u))return!0;const i=u;for(const a of i)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function v_(e,t,n,r){const u=uu(e,n);let i=-1,a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?u.spaceSeparated?a=Jr(r):u.commaSeparated?a=xu(r):u.commaOrSpaceSeparated?a=Jr(xu(r).join(" ")):a=ao(u,u.property,r):Array.isArray(r)?a=r.concat():a=u.property==="style"?w_(r):String(r);if(Array.isArray(a)){const l=[];for(;++i<a.length;){const c=ao(u,u.property,a[i]);l[i]=c}a=l}if(u.property==="className"&&Array.isArray(t.className)){const l=a;a=t.className.concat(l)}t[u.property]=a}}function Zi(e,t){let n=-1;if(t!=null)if(typeof t=="string"||typeof t=="number")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(;++n<t.length;)Zi(e,t[n]);else if(typeof t=="object"&&"type"in t)t.type==="root"?Zi(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ao(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||qn(n)===qn(t)))return!0}return n}function w_(e){const t=[];let n;for(n in e)Ji.call(e,n)&&t.push([n,e[n]].join(": "));return t.join("; ")}function P_(e){const t={};let n=-1;for(;++n<e.length;)t[e[n].toLowerCase()]=e[n];return t}const B_=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],gn=bc(ar,"div");bc(Tn,"g",B_);const M_=()=>e=>{Nt(e,rr,t=>{t.data=t.data??{};const n=gn(t.name,t.attributes||{});t.data.hName=n.tagName,t.data.hProperties=n.properties})},H_=()=>e=>{Nt(e,R_,t=>{if(t.name!=="link-button")return;const n=t.data||(t.data={}),r="a";n.hName=r,t.attributes=t.attributes??{},t.attributes["data-node"]=t.name,n.hProperties=gn(r,t.attributes).properties})},U_=()=>e=>{Nt(e,La,t=>{if(!t.name.startsWith("grid-cols-"))return;t.attributes=t.attributes??{},t.attributes.as==="list"&&(t.attributes.as=void 0,t.attributes["data-behavior"]="list");const n=Number.parseInt(t.name.split("-").pop()||"1"),r={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-6",8:"md:grid-cols-6",9:"md:grid-cols-6",10:"md:grid-cols-6",11:"md:grid-cols-6",12:"md:grid-cols-12"};t.data=t.data??{};const u="div";t.data.hName=u,t.attributes.class=`flex flex-col md:grid ${r[n]} gap-8`,t.data.hProperties=gn(u,t.attributes).properties})},j_=()=>e=>{Nt(e,La,t=>{if(t.name!=="cell")return;t.data=t.data??{};const n="div";t.data.hName=n,t.attributes=t.attributes??{},t.attributes["data-node"]=t.name,t.data.hProperties=gn(n,t.attributes).properties,t.children.forEach(r=>{if(!rr(r)||r.name!=="cell-img")return;r.data=r.data??{};const u="img";r.data.hName=u,r.attributes=r.attributes??{},r.attributes["data-node"]=r.name,r.data.hProperties=gn(u,r.attributes).properties})})},z_=()=>e=>{Nt(e,rr,t=>{if(t.type!=="containerDirective"||t.name!=="card")return;t.data=t.data??{};const n="article";t.data.hName=n,t.attributes=t.attributes??{},t.attributes["data-node"]=t.name,t.attributes.as==="link"&&(t.attributes.as=void 0,t.attributes["data-behavior"]="link",t.attributes["data-href"]=t.attributes.href||""),t.data.hProperties=gn(n,t.attributes).properties,t.children.forEach(r=>{if(!rr(r))return;r.data=r.data??{};let u="div";r.name==="card-img"&&(u="img"),r.data.hName=u,r.attributes=r.attributes??{},r.attributes["data-node"]=r.name,r.data.hProperties=gn(u,r.attributes).properties})})},Y_=()=>e=>{Nt(e,La,t=>{if(t.name!=="faq")return;t.data=t.data??{};const n="dl";t.data.hName=n,t.data.hProperties=gn(n,t.attributes||{}).properties,t.children.forEach(r=>{if(!rr(r)||r.name!=="faq-q"&&r.name!=="faq-a")return;r.data=r.data??{};const u=r.name==="faq-q"?"dt":"dd";r.data.hName=u,r.data.hProperties=gn(u,r.attributes||{}).properties})})},$_=()=>(e,t)=>{const n=[],r=new cc;Nt(e,O_,i=>{const a={id:r.slug(Xr(i)),depth:i.depth,value:Xr(i)};n.push(a)}),t.data.fm||(t.data.fm={}),t.data.fm.headings=qT(n)},Tc=({items:e})=>Ye.jsx(Ye.Fragment,{children:e.map(t=>Ye.jsxs("li",{children:[Ye.jsx(Oa,{href:`#${t.id}`,children:t.value}),t.children?Ye.jsx(Ki,{children:Ye.jsx(Tc,{items:t.children})}):null]},t.id))}),V_=e=>{const{className:t,children:n,...r}=e;return Ye.jsx(I_,{children:Ye.jsx(y_,{className:nr(t),...r,children:n})})},q_=e=>{const{children:t,href:n,...r}=e;return r["data-node"]==="link-button"?Ye.jsx(Ia,{as:"a",variant:"secondary",href:n,children:t}):Ye.jsx(Oa,{href:n,...r,children:t})},W_=e=>{const{children:t,className:n,...r}=e;if(r["data-node"]==="card"){if(r["data-behavior"]==="link"){const i=r["data-href"];return Ye.jsx(s_,{href:i,className:nr(n),children:t})}return Ye.jsx(mc,{className:nr(n),children:t})}return Ye.jsx("article",{className:n,...r,children:t})},G_=e=>{const{children:t,...n}=e,r=n["data-node"];return r==="card-title"?Ye.jsx(o_,{children:t}):r==="card-description"?Ye.jsx(i_,{children:t}):r==="card-footer"?Ye.jsx(a_,{children:t}):n["data-behavior"]==="list"?Ye.jsx("ul",{className:n.className,children:mt.Children.map(t,u=>Ye.jsx("li",{className:"sm:grid",children:u},Math.random()))}):Ye.jsx("div",{...n,children:t})},Q_=e=>{const{children:t,className:n,...r}=e;return r["data-node"]==="card-img"?Ye.jsx(r_,{className:nr("w-full aspect-[352/226]",n),...r}):r["data-node"]==="cell-img"?Ye.jsx("img",{className:nr("mb-4",n),...r}):Ye.jsx("img",{className:n,...r})},X_=e=>{const{className:t,children:n,...r}=e,u=`
418
421
  my-8
419
422
  `;let i=`
package/dist/index.es.js CHANGED
@@ -21112,6 +21112,9 @@ const Ki = (e) => {
21112
21112
  w-full
21113
21113
  overflow-x-auto
21114
21114
  whitespace-nowrap
21115
+ print:overflow-visible
21116
+ print:whitespace-normal
21117
+
21115
21118
  `, t), ...r, children: n });
21116
21119
  }, rr = (e) => e.type === "containerDirective" || e.type === "leafDirective" || e.type === "textDirective", La = (e) => e.type === "containerDirective", O_ = (e) => e.type === "textDirective", L_ = (e) => e.type === "heading", F_ = () => (e) => {
21117
21120
  Nt(e, rr, (t) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura-ui/markdown",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "markdown"