@takumi-rs/helpers 0.52.2 → 0.53.1

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var n in e)u(t,n,{get:e[n],enumerable:!0})},a=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!m.call(t,o)&&o!==n&&u(t,o,{get:()=>e[o],enumerable:!(r=x(e,o))||r.enumerable});return t};var y=t=>a(u({},"__esModule",{value:!0}),t);var s={};c(s,{container:()=>f,em:()=>w,fr:()=>C,image:()=>N,percentage:()=>g,rem:()=>T,rgba:()=>I,style:()=>p,text:()=>l,vh:()=>h,vw:()=>b});module.exports=y(s);function i(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function f(t){let e={type:"container",children:t.children,tw:t.tw};return i(e,t.style),e}function l(t,e){if(typeof t=="string"){let r={type:"text",text:t};return i(r,e),r}let n={type:"text",text:t.text,tw:t.tw};return i(n,e??t.style),n}function N(t){let e={type:"image",src:t.src,width:t.width,height:t.height,tw:t.tw};return i(e,t.style),e}function p(t){return t}function g(t){return{percentage:t}}function b(t){return{vw:t}}function h(t){return{vh:t}}function w(t){return{em:t}}function T(t){return{rem:t}}function C(t){return{fr:t}}function I(t,e,n,r=1){return[t,e,n,r]}0&&(module.exports={container,em,fr,image,percentage,rem,rgba,style,text,vh,vw});
1
+ "use strict";var u=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})},s=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!m.call(e,o)&&o!==n&&u(e,o,{get:()=>t[o],enumerable:!(r=c(t,o))||r.enumerable});return e};var a=e=>s(u({},"__esModule",{value:!0}),e);var l={};d(l,{container:()=>f,em:()=>S,fr:()=>$,image:()=>p,percentage:()=>g,rem:()=>w,rgba:()=>C,style:()=>N,text:()=>y,vh:()=>h,vw:()=>b});module.exports=a(l);function i(e,t){t&&Object.keys(t).length>0&&(e.style=t)}function f(e){let t={type:"container",children:e.children,tw:e.tw};return i(t,e.style),t}function y(e,t){if(typeof e=="string"){let r={type:"text",text:e};return i(r,t),r}let n={type:"text",text:e.text,tw:e.tw};return i(n,t??e.style),n}function p(e){let t={type:"image",src:e.src,width:e.width,height:e.height,tw:e.tw};return i(t,e.style),t}function N(e){return e}function g(e){return`${e}%`}function b(e){return`${e}vw`}function h(e){return`${e}vh`}function S(e){return`${e}em`}function w(e){return`${e}rem`}function $(e){return`${e}fr`}function C(e,t,n,r=1){return`rgb(${e} ${t} ${n} / ${r})`}0&&(module.exports={container,em,fr,image,percentage,rem,rgba,style,text,vh,vw});
package/dist/index.d.cts CHANGED
@@ -1,34 +1,18 @@
1
- import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as ColorInput } from './types-Dm5SijB6.cjs';
2
- export { A as AnyNode, J as JsonValue, N as Node } from './types-Dm5SijB6.cjs';
1
+ import { CSSProperties } from 'react';
2
+ import { C as ContainerNode, T as TextNode, I as ImageNode } from './types-D4Tf1iTw.cjs';
3
+ export { A as AnyNode, N as Node, P as PartialStyle } from './types-D4Tf1iTw.cjs';
3
4
 
4
5
  declare function container(props: Omit<ContainerNode, "type">): ContainerNode;
5
- declare function text(text: string, style?: PartialStyle): TextNode;
6
+ declare function text(text: string, style?: CSSProperties): TextNode;
6
7
  declare function text(props: Omit<TextNode, "type">): TextNode;
7
8
  declare function image(props: Omit<ImageNode, "type">): ImageNode;
8
- declare function style(style: PartialStyle): Partial<Style>;
9
- /**
10
- * Convert a number to a percentage struct.
11
- * @param percentage - The percentage to convert (0.0 - 100.0).
12
- * @returns The percentage struct.
13
- */
14
- declare function percentage(percentage: number): {
15
- percentage: number;
16
- };
17
- declare function vw(vw: number): {
18
- vw: number;
19
- };
20
- declare function vh(vh: number): {
21
- vh: number;
22
- };
23
- declare function em(em: number): {
24
- em: number;
25
- };
26
- declare function rem(rem: number): {
27
- rem: number;
28
- };
29
- declare function fr(fr: number): {
30
- fr: number;
31
- };
32
- declare function rgba(r: number, g: number, b: number, a?: number): ColorInput;
9
+ declare function style(style: CSSProperties): CSSProperties;
10
+ declare function percentage(percentage: number): `${number}%`;
11
+ declare function vw(vw: number): `${number}vw`;
12
+ declare function vh(vh: number): `${number}vh`;
13
+ declare function em(em: number): `${number}em`;
14
+ declare function rem(rem: number): `${number}rem`;
15
+ declare function fr(fr: number): `${number}fr`;
16
+ declare function rgba(r: number, g: number, b: number, a?: number): `rgb(${number} ${number} ${number} / ${number})`;
33
17
 
34
- export { ContainerNode, ImageNode, PartialStyle, TextNode, container, em, fr, image, percentage, rem, rgba, style, text, vh, vw };
18
+ export { ContainerNode, ImageNode, TextNode, container, em, fr, image, percentage, rem, rgba, style, text, vh, vw };
package/dist/index.d.ts CHANGED
@@ -1,34 +1,18 @@
1
- import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as ColorInput } from './types-Dm5SijB6.js';
2
- export { A as AnyNode, J as JsonValue, N as Node } from './types-Dm5SijB6.js';
1
+ import { CSSProperties } from 'react';
2
+ import { C as ContainerNode, T as TextNode, I as ImageNode } from './types-D4Tf1iTw.js';
3
+ export { A as AnyNode, N as Node, P as PartialStyle } from './types-D4Tf1iTw.js';
3
4
 
4
5
  declare function container(props: Omit<ContainerNode, "type">): ContainerNode;
5
- declare function text(text: string, style?: PartialStyle): TextNode;
6
+ declare function text(text: string, style?: CSSProperties): TextNode;
6
7
  declare function text(props: Omit<TextNode, "type">): TextNode;
7
8
  declare function image(props: Omit<ImageNode, "type">): ImageNode;
8
- declare function style(style: PartialStyle): Partial<Style>;
9
- /**
10
- * Convert a number to a percentage struct.
11
- * @param percentage - The percentage to convert (0.0 - 100.0).
12
- * @returns The percentage struct.
13
- */
14
- declare function percentage(percentage: number): {
15
- percentage: number;
16
- };
17
- declare function vw(vw: number): {
18
- vw: number;
19
- };
20
- declare function vh(vh: number): {
21
- vh: number;
22
- };
23
- declare function em(em: number): {
24
- em: number;
25
- };
26
- declare function rem(rem: number): {
27
- rem: number;
28
- };
29
- declare function fr(fr: number): {
30
- fr: number;
31
- };
32
- declare function rgba(r: number, g: number, b: number, a?: number): ColorInput;
9
+ declare function style(style: CSSProperties): CSSProperties;
10
+ declare function percentage(percentage: number): `${number}%`;
11
+ declare function vw(vw: number): `${number}vw`;
12
+ declare function vh(vh: number): `${number}vh`;
13
+ declare function em(em: number): `${number}em`;
14
+ declare function rem(rem: number): `${number}rem`;
15
+ declare function fr(fr: number): `${number}fr`;
16
+ declare function rgba(r: number, g: number, b: number, a?: number): `rgb(${number} ${number} ${number} / ${number})`;
33
17
 
34
- export { ContainerNode, ImageNode, PartialStyle, TextNode, container, em, fr, image, percentage, rem, rgba, style, text, vh, vw };
18
+ export { ContainerNode, ImageNode, TextNode, container, em, fr, image, percentage, rem, rgba, style, text, vh, vw };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function o(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function i(t){let e={type:"container",children:t.children,tw:t.tw};return o(e,t.style),e}function u(t,e){if(typeof t=="string"){let r={type:"text",text:t};return o(r,e),r}let n={type:"text",text:t.text,tw:t.tw};return o(n,e??t.style),n}function x(t){let e={type:"image",src:t.src,width:t.width,height:t.height,tw:t.tw};return o(e,t.style),e}function d(t){return t}function m(t){return{percentage:t}}function c(t){return{vw:t}}function a(t){return{vh:t}}function y(t){return{em:t}}function f(t){return{rem:t}}function l(t){return{fr:t}}function N(t,e,n,r=1){return[t,e,n,r]}export{i as container,y as em,l as fr,x as image,m as percentage,f as rem,N as rgba,d as style,u as text,a as vh,c as vw};
1
+ function o(e,t){t&&Object.keys(t).length>0&&(e.style=t)}function i(e){let t={type:"container",children:e.children,tw:e.tw};return o(t,e.style),t}function u(e,t){if(typeof e=="string"){let r={type:"text",text:e};return o(r,t),r}let n={type:"text",text:e.text,tw:e.tw};return o(n,t??e.style),n}function c(e){let t={type:"image",src:e.src,width:e.width,height:e.height,tw:e.tw};return o(t,e.style),t}function x(e){return e}function m(e){return`${e}%`}function d(e){return`${e}vw`}function s(e){return`${e}vh`}function a(e){return`${e}em`}function f(e){return`${e}rem`}function y(e){return`${e}fr`}function p(e,t,n,r=1){return`rgb(${e} ${t} ${n} / ${r})`}export{i as container,a as em,y as fr,c as image,m as percentage,f as rem,p as rgba,x as style,u as text,s as vh,d as vw};
package/dist/jsx/jsx.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var g=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var W=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},j=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $(e))!I.call(t,o)&&o!==n&&g(t,o,{get:()=>e[o],enumerable:!(r=O(e,o))||r.enumerable});return t};var z=t=>j(g({},"__esModule",{value:!0}),t);var tt={};W(tt,{fromJsx:()=>K});module.exports=z(tt);function l(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function f(t){let e={type:"container",children:t.children,tw:t.tw};return l(e,t.style),e}function m(t,e){if(typeof t=="string"){let r={type:"text",text:t};return l(r,e),r}let n={type:"text",text:t.text,tw:t.tw};return l(n,e??t.style),n}function d(t){let e={type:"image",src:t.src,width:t.width,height:t.height,tw:t.tw};return l(e,t.style),e}function h(t){return{percentage:t}}var a={body:{margin:8},p:{marginTop:"1em",marginBottom:"1em",display:"block"},blockquote:{marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40,display:"block"},center:{textAlign:"center",display:"block"},hr:{marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,display:"block"},h1:{fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h2:{fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h3:{fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h4:{marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h5:{fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h6:{fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},u:{textDecoration:"underline",display:"inline"},strong:{fontWeight:"bold",display:"inline"},b:{fontWeight:"bold",display:"inline"},i:{fontStyle:"italic",display:"inline"},em:{fontStyle:"italic",display:"inline"},code:{fontFamily:"monospace",display:"inline"},kbd:{fontFamily:"monospace",display:"inline"},pre:{fontFamily:"monospace",margin:"1em 0",display:"block"},mark:{backgroundColor:"yellow",color:0,display:"inline"},big:{fontSize:"1.2em",display:"inline"},small:{fontSize:"0.8em",display:"inline"},s:{textDecoration:"line-through",display:"inline"},span:{display:"inline"},img:{display:"inline"},svg:{display:"inline"}};var F=new Set(["head","meta","link","style","script"]);function S(t){return F.has(t.type)}function u(t,e){return t.type===e&&"props"in t}function E(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function i(t){return typeof t=="object"&&t!==null&&"type"in t}function p(t){return typeof t=="function"}var B=Symbol.for("react.forward_ref"),M=Symbol.for("react.memo"),H=Symbol.for("react.fragment");function w(t){return t.$$typeof===B}function P(t){return t.$$typeof===M}function k(t){return t.type===H}function _(t){return typeof t=="string"||typeof t=="number"}function T(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function D(t){return Object.keys(t).map(e=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(t[e]).trim()}`).join(";")}var V=["stopColor","stopOpacity","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","fillRule","clipRule","colorInterpolationFilters","floodColor","floodOpacity","accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipPathUnits","colorInterpolation","colorProfile","colorRendering","enableBackground","fillOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","preserveAspectRatio","pointerEvents","shapeRendering","strokeMiterlimit","strokeOpacity","textAnchor","textDecoration","textRendering","transformOrigin","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vectorEffect","vertAdvY","vertOriginX","vertOriginY","vAlphabetic","vHanging","vIdeographic","vMathematical","wordSpacing","writingMode"];function X(t,e){if(t==="children"||e==null)return;let n;if(t==="className"?n="class":V.includes(t)?n=E(t):n=t,typeof e=="boolean")return`${n}="${String(e)}"`;if(t==="style"&&typeof e=="object"){let r=D(e);if(r)return`style="${T(r)}"`}return`${n}="${T(String(e))}"`}function J(t){return Object.entries(t).map(([e,n])=>X(e,n)).filter(e=>e!==void 0)}var Y=(t,e)=>{let n=t.props||{};if(p(t.type))return c(t.type(t.props));if(typeof t.type=="symbol"||typeof t.type!="string")return"";let r=J(n),o=n.children,y=Array.isArray(o)?o.map(x=>e(x)).join(""):e(o);return`<${t.type}${r.length>0?` ${r.join(" ")}`:""}>${y}</${t.type}>`},c=t=>t==null||t===!1?"":_(t)?String(t):Array.isArray(t)?t.map(c).join(""):i(t)?Y(t,c):"";function N(t){let e=t.props||{};if(!("xmlns"in e)){let n={...t,props:{...e,xmlns:"http://www.w3.org/2000/svg"}};return c(n)||""}return c(t)||""}async function K(t){let e=await s(t);return e.length===0?f({}):e.length===1&&e[0]!==void 0?e[0]:f({children:e,style:{width:h(100),height:h(100)}})}async function s(t){if(t==null||t===!1)return[];if(t instanceof Promise)return s(await t);if(typeof t=="object"&&Symbol.iterator in t)return Q(t);if(i(t)){let e=await A(t);return Array.isArray(e)?e:e?[e]:[]}return[m(String(t),a.span)]}function q(t){if(!(typeof t.type!="object"||t.type===null)){if(w(t.type)&&"render"in t.type){let e=t.type;return s(e.render(t.props,null))}if(P(t.type)&&"type"in t.type){let n=t.type.type;if(p(n))return s(n(t.props));let r={...t,type:n};return A(r)}}}function L(t){if(!i(t))return Promise.resolve(void 0);let e=typeof t.props=="object"&&t.props!==null&&"children"in t.props?t.props.children:void 0;return typeof e=="string"?Promise.resolve(e):typeof e=="number"?Promise.resolve(String(e)):Array.isArray(e)?Promise.resolve(C(e)):typeof e=="object"&&e!==null&&Symbol.iterator in e?Promise.resolve(C(Array.from(e))):i(e)&&k(e)?L(e):Promise.resolve(void 0)}function C(t){if(!t.some(e=>i(e)))return t.map(e=>typeof e=="string"?e:typeof e=="number"?String(e):"").join("")}async function A(t){if(p(t.type))return s(t.type(t.props));let e=q(t);if(e!==void 0)return e;if(k(t))return await v(t)||[];if(S(t))return[];if(u(t,"br"))return[m(`
2
- `,a.span)];if(u(t,"img"))return[Z(t)];if(u(t,"svg"))return[G(t)];let n=R(t),r=b(t),o=await L(t);if(o!==void 0)return[m({text:o,style:n,tw:r})];let y=await v(t);return[f({children:y,style:n,tw:r})]}function Z(t){if(!t.props.src)throw new Error("Image element must have a 'src' prop.");let e=R(t),n=b(t);return d({src:t.props.src,style:e,tw:n})}function G(t){let e=R(t),n=b(t),r=N(t);return d({style:e,src:r,tw:n})}var U={WebkitTextStroke:"textStroke",WebkitTextStrokeWidth:"textStrokeWidth",WebkitTextStrokeColor:"textStrokeColor"};function R(t){let e={};typeof t.type=="string"&&t.type in a&&Object.assign(e,a[t.type]);let n=typeof t.props=="object"&&t.props!==null&&"style"in t.props&&typeof t.props.style=="object"&&t.props.style!==null?t.props.style:void 0;if(n&&Object.keys(n).length>0){for(let[r,o]of Object.entries(U))r in n&&(e[o]=n[r],delete n[r]);Object.assign(e,n)}return e}function b(t){if(!(typeof t.props!="object"||t.props===null||!("tw"in t.props)))return t.props.tw}function v(t){return typeof t.props!="object"||t.props===null||!("children"in t.props)?Promise.resolve([]):s(t.props.children)}function Q(t){return Promise.all(Array.from(t).map(e=>s(e))).then(e=>e.flat())}0&&(module.exports={fromJsx});
1
+ "use strict";var d=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var n in e)d(t,n,{get:e[n],enumerable:!0})},j=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of O(e))!z.call(t,o)&&o!==n&&d(t,o,{get:()=>e[o],enumerable:!(r=$(e,o))||r.enumerable});return t};var I=t=>j(d({},"__esModule",{value:!0}),t);var Q={};F(Q,{fromJsx:()=>K});module.exports=I(Q);function l(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function f(t){let e={type:"container",children:t.children,tw:t.tw};return l(e,t.style),e}function m(t,e){if(typeof t=="string"){let r={type:"text",text:t};return l(r,e),r}let n={type:"text",text:t.text,tw:t.tw};return l(n,e??t.style),n}function y(t){let e={type:"image",src:t.src,width:t.width,height:t.height,tw:t.tw};return l(e,t.style),e}function h(t){return`${t}%`}var a={body:{margin:8},p:{marginTop:"1em",marginBottom:"1em",display:"block"},blockquote:{marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40,display:"block"},center:{textAlign:"center",display:"block"},hr:{marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,display:"block"},h1:{fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h2:{fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h3:{fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h4:{marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h5:{fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h6:{fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},u:{textDecoration:"underline",display:"inline"},strong:{fontWeight:"bold",display:"inline"},b:{fontWeight:"bold",display:"inline"},i:{fontStyle:"italic",display:"inline"},em:{fontStyle:"italic",display:"inline"},code:{fontFamily:"monospace",display:"inline"},kbd:{fontFamily:"monospace",display:"inline"},pre:{fontFamily:"monospace",margin:"1em 0",display:"block"},mark:{backgroundColor:"yellow",color:"black",display:"inline"},big:{fontSize:"1.2em",display:"inline"},small:{fontSize:"0.8em",display:"inline"},s:{textDecoration:"line-through",display:"inline"},span:{display:"inline"},img:{display:"inline"},svg:{display:"inline"}};var W=new Set(["head","meta","link","style","script"]);function S(t){return W.has(t.type)}function u(t,e){return t.type===e&&"props"in t}function E(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function i(t){return typeof t=="object"&&t!==null&&"type"in t}function p(t){return typeof t=="function"}var B=Symbol.for("react.forward_ref"),M=Symbol.for("react.memo"),H=Symbol.for("react.fragment");function w(t){return t.$$typeof===B}function P(t){return t.$$typeof===M}function R(t){return t.type===H}function _(t){return typeof t=="string"||typeof t=="number"}function T(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function D(t){return Object.keys(t).map(e=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(t[e]).trim()}`).join(";")}var V=["stopColor","stopOpacity","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","fillRule","clipRule","colorInterpolationFilters","floodColor","floodOpacity","accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipPathUnits","colorInterpolation","colorProfile","colorRendering","enableBackground","fillOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","preserveAspectRatio","pointerEvents","shapeRendering","strokeMiterlimit","strokeOpacity","textAnchor","textDecoration","textRendering","transformOrigin","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vectorEffect","vertAdvY","vertOriginX","vertOriginY","vAlphabetic","vHanging","vIdeographic","vMathematical","wordSpacing","writingMode"];function X(t,e){if(t==="children"||e==null)return;let n;if(t==="className"?n="class":V.includes(t)?n=E(t):n=t,typeof e=="boolean")return`${n}="${String(e)}"`;if(t==="style"&&typeof e=="object"){let r=D(e);if(r)return`style="${T(r)}"`}return`${n}="${T(String(e))}"`}function J(t){return Object.entries(t).map(([e,n])=>X(e,n)).filter(e=>e!==void 0)}var Y=(t,e)=>{let n=t.props||{};if(p(t.type))return c(t.type(t.props));if(typeof t.type=="symbol"||typeof t.type!="string")return"";let r=J(n),o=n.children,g=Array.isArray(o)?o.map(x=>e(x)).join(""):e(o);return`<${t.type}${r.length>0?` ${r.join(" ")}`:""}>${g}</${t.type}>`},c=t=>t==null||t===!1?"":_(t)?String(t):Array.isArray(t)?t.map(c).join(""):i(t)?Y(t,c):"";function C(t){let e=t.props||{};if(!("xmlns"in e)){let n={...t,props:{...e,xmlns:"http://www.w3.org/2000/svg"}};return c(n)||""}return c(t)||""}async function K(t){let e=await s(t);return e.length===0?f({}):e.length===1&&e[0]!==void 0?e[0]:f({children:e,style:{width:h(100),height:h(100)}})}async function s(t){if(t==null||t===!1)return[];if(t instanceof Promise)return s(await t);if(typeof t=="object"&&Symbol.iterator in t)return U(t);if(i(t)){let e=await A(t);return Array.isArray(e)?e:e?[e]:[]}return[m(String(t),a.span)]}function q(t){if(!(typeof t.type!="object"||t.type===null)){if(w(t.type)&&"render"in t.type){let e=t.type;return s(e.render(t.props,null))}if(P(t.type)&&"type"in t.type){let n=t.type.type;if(p(n))return s(n(t.props));let r={...t,type:n};return A(r)}}}function L(t){if(!i(t))return Promise.resolve(void 0);let e=typeof t.props=="object"&&t.props!==null&&"children"in t.props?t.props.children:void 0;return typeof e=="string"?Promise.resolve(e):typeof e=="number"?Promise.resolve(String(e)):Array.isArray(e)?Promise.resolve(N(e)):typeof e=="object"&&e!==null&&Symbol.iterator in e?Promise.resolve(N(Array.from(e))):i(e)&&R(e)?L(e):Promise.resolve(void 0)}function N(t){if(!t.some(e=>i(e)))return t.map(e=>typeof e=="string"?e:typeof e=="number"?String(e):"").join("")}async function A(t){if(p(t.type))return s(t.type(t.props));let e=q(t);if(e!==void 0)return e;if(R(t))return await v(t)||[];if(S(t))return[];if(u(t,"br"))return[m(`
2
+ `,a.span)];if(u(t,"img"))return[Z(t)];if(u(t,"svg"))return[G(t)];let n=b(t),r=k(t),o=await L(t);if(o!==void 0)return[m({text:o,style:n,tw:r})];let g=await v(t);return[f({children:g,style:n,tw:r})]}function Z(t){if(!t.props.src)throw new Error("Image element must have a 'src' prop.");let e=b(t),n=k(t);return y({src:t.props.src,style:e,tw:n})}function G(t){let e=b(t),n=k(t),r=C(t);return y({style:e,src:r,tw:n})}function b(t){let e={};typeof t.type=="string"&&t.type in a&&Object.assign(e,a[t.type]);let n=typeof t.props=="object"&&t.props!==null&&"style"in t.props&&typeof t.props.style=="object"&&t.props.style!==null?t.props.style:void 0;return n&&Object.keys(n).length>0&&Object.assign(e,n),e}function k(t){if(!(typeof t.props!="object"||t.props===null||!("tw"in t.props)))return t.props.tw}function v(t){return typeof t.props!="object"||t.props===null||!("children"in t.props)?Promise.resolve([]):s(t.props.children)}function U(t){return Promise.all(Array.from(t).map(e=>s(e))).then(e=>e.flat())}0&&(module.exports={fromJsx});
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { N as Node } from '../types-Dm5SijB6.cjs';
2
+ import { N as Node } from '../types-D4Tf1iTw.cjs';
3
3
 
4
4
  type ReactElementLike = {
5
5
  type: string | symbol | ((props: unknown) => ReactElementLike) | ReactElementLike;
package/dist/jsx/jsx.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { N as Node } from '../types-Dm5SijB6.js';
2
+ import { N as Node } from '../types-D4Tf1iTw.js';
3
3
 
4
4
  type ReactElementLike = {
5
5
  type: string | symbol | ((props: unknown) => ReactElementLike) | ReactElementLike;
package/dist/jsx/jsx.js CHANGED
@@ -1,2 +1,2 @@
1
- function l(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function f(t){let e={type:"container",children:t.children,tw:t.tw};return l(e,t.style),e}function m(t,e){if(typeof t=="string"){let r={type:"text",text:t};return l(r,e),r}let n={type:"text",text:t.text,tw:t.tw};return l(n,e??t.style),n}function g(t){let e={type:"image",src:t.src,width:t.width,height:t.height,tw:t.tw};return l(e,t.style),e}function d(t){return{percentage:t}}var a={body:{margin:8},p:{marginTop:"1em",marginBottom:"1em",display:"block"},blockquote:{marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40,display:"block"},center:{textAlign:"center",display:"block"},hr:{marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,display:"block"},h1:{fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h2:{fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h3:{fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h4:{marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h5:{fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h6:{fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},u:{textDecoration:"underline",display:"inline"},strong:{fontWeight:"bold",display:"inline"},b:{fontWeight:"bold",display:"inline"},i:{fontStyle:"italic",display:"inline"},em:{fontStyle:"italic",display:"inline"},code:{fontFamily:"monospace",display:"inline"},kbd:{fontFamily:"monospace",display:"inline"},pre:{fontFamily:"monospace",margin:"1em 0",display:"block"},mark:{backgroundColor:"yellow",color:0,display:"inline"},big:{fontSize:"1.2em",display:"inline"},small:{fontSize:"0.8em",display:"inline"},s:{textDecoration:"line-through",display:"inline"},span:{display:"inline"},img:{display:"inline"},svg:{display:"inline"}};var A=new Set(["head","meta","link","style","script"]);function x(t){return A.has(t.type)}function u(t,e){return t.type===e&&"props"in t}function S(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function i(t){return typeof t=="object"&&t!==null&&"type"in t}function p(t){return typeof t=="function"}var O=Symbol.for("react.forward_ref"),$=Symbol.for("react.memo"),I=Symbol.for("react.fragment");function E(t){return t.$$typeof===O}function w(t){return t.$$typeof===$}function h(t){return t.type===I}function W(t){return typeof t=="string"||typeof t=="number"}function P(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function j(t){return Object.keys(t).map(e=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(t[e]).trim()}`).join(";")}var z=["stopColor","stopOpacity","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","fillRule","clipRule","colorInterpolationFilters","floodColor","floodOpacity","accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipPathUnits","colorInterpolation","colorProfile","colorRendering","enableBackground","fillOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","preserveAspectRatio","pointerEvents","shapeRendering","strokeMiterlimit","strokeOpacity","textAnchor","textDecoration","textRendering","transformOrigin","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vectorEffect","vertAdvY","vertOriginX","vertOriginY","vAlphabetic","vHanging","vIdeographic","vMathematical","wordSpacing","writingMode"];function F(t,e){if(t==="children"||e==null)return;let n;if(t==="className"?n="class":z.includes(t)?n=S(t):n=t,typeof e=="boolean")return`${n}="${String(e)}"`;if(t==="style"&&typeof e=="object"){let r=j(e);if(r)return`style="${P(r)}"`}return`${n}="${P(String(e))}"`}function B(t){return Object.entries(t).map(([e,n])=>F(e,n)).filter(e=>e!==void 0)}var M=(t,e)=>{let n=t.props||{};if(p(t.type))return c(t.type(t.props));if(typeof t.type=="symbol"||typeof t.type!="string")return"";let r=B(n),o=n.children,y=Array.isArray(o)?o.map(b=>e(b)).join(""):e(o);return`<${t.type}${r.length>0?` ${r.join(" ")}`:""}>${y}</${t.type}>`},c=t=>t==null||t===!1?"":W(t)?String(t):Array.isArray(t)?t.map(c).join(""):i(t)?M(t,c):"";function T(t){let e=t.props||{};if(!("xmlns"in e)){let n={...t,props:{...e,xmlns:"http://www.w3.org/2000/svg"}};return c(n)||""}return c(t)||""}async function et(t){let e=await s(t);return e.length===0?f({}):e.length===1&&e[0]!==void 0?e[0]:f({children:e,style:{width:d(100),height:d(100)}})}async function s(t){if(t==null||t===!1)return[];if(t instanceof Promise)return s(await t);if(typeof t=="object"&&Symbol.iterator in t)return X(t);if(i(t)){let e=await L(t);return Array.isArray(e)?e:e?[e]:[]}return[m(String(t),a.span)]}function H(t){if(!(typeof t.type!="object"||t.type===null)){if(E(t.type)&&"render"in t.type){let e=t.type;return s(e.render(t.props,null))}if(w(t.type)&&"type"in t.type){let n=t.type.type;if(p(n))return s(n(t.props));let r={...t,type:n};return L(r)}}}function v(t){if(!i(t))return Promise.resolve(void 0);let e=typeof t.props=="object"&&t.props!==null&&"children"in t.props?t.props.children:void 0;return typeof e=="string"?Promise.resolve(e):typeof e=="number"?Promise.resolve(String(e)):Array.isArray(e)?Promise.resolve(N(e)):typeof e=="object"&&e!==null&&Symbol.iterator in e?Promise.resolve(N(Array.from(e))):i(e)&&h(e)?v(e):Promise.resolve(void 0)}function N(t){if(!t.some(e=>i(e)))return t.map(e=>typeof e=="string"?e:typeof e=="number"?String(e):"").join("")}async function L(t){if(p(t.type))return s(t.type(t.props));let e=H(t);if(e!==void 0)return e;if(h(t))return await C(t)||[];if(x(t))return[];if(u(t,"br"))return[m(`
2
- `,a.span)];if(u(t,"img"))return[_(t)];if(u(t,"svg"))return[D(t)];let n=k(t),r=R(t),o=await v(t);if(o!==void 0)return[m({text:o,style:n,tw:r})];let y=await C(t);return[f({children:y,style:n,tw:r})]}function _(t){if(!t.props.src)throw new Error("Image element must have a 'src' prop.");let e=k(t),n=R(t);return g({src:t.props.src,style:e,tw:n})}function D(t){let e=k(t),n=R(t),r=T(t);return g({style:e,src:r,tw:n})}var V={WebkitTextStroke:"textStroke",WebkitTextStrokeWidth:"textStrokeWidth",WebkitTextStrokeColor:"textStrokeColor"};function k(t){let e={};typeof t.type=="string"&&t.type in a&&Object.assign(e,a[t.type]);let n=typeof t.props=="object"&&t.props!==null&&"style"in t.props&&typeof t.props.style=="object"&&t.props.style!==null?t.props.style:void 0;if(n&&Object.keys(n).length>0){for(let[r,o]of Object.entries(V))r in n&&(e[o]=n[r],delete n[r]);Object.assign(e,n)}return e}function R(t){if(!(typeof t.props!="object"||t.props===null||!("tw"in t.props)))return t.props.tw}function C(t){return typeof t.props!="object"||t.props===null||!("children"in t.props)?Promise.resolve([]):s(t.props.children)}function X(t){return Promise.all(Array.from(t).map(e=>s(e))).then(e=>e.flat())}export{et as fromJsx};
1
+ function l(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function f(t){let e={type:"container",children:t.children,tw:t.tw};return l(e,t.style),e}function m(t,e){if(typeof t=="string"){let r={type:"text",text:t};return l(r,e),r}let n={type:"text",text:t.text,tw:t.tw};return l(n,e??t.style),n}function d(t){let e={type:"image",src:t.src,width:t.width,height:t.height,tw:t.tw};return l(e,t.style),e}function y(t){return`${t}%`}var a={body:{margin:8},p:{marginTop:"1em",marginBottom:"1em",display:"block"},blockquote:{marginTop:"1em",marginBottom:"1em",marginLeft:40,marginRight:40,display:"block"},center:{textAlign:"center",display:"block"},hr:{marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"auto",marginRight:"auto",borderWidth:1,display:"block"},h1:{fontSize:"2em",marginTop:"0.67em",marginBottom:"0.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h2:{fontSize:"1.5em",marginTop:"0.83em",marginBottom:"0.83em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h3:{fontSize:"1.17em",marginTop:"1em",marginBottom:"1em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h4:{marginTop:"1.33em",marginBottom:"1.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h5:{fontSize:"0.83em",marginTop:"1.67em",marginBottom:"1.67em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},h6:{fontSize:"0.67em",marginTop:"2.33em",marginBottom:"2.33em",marginLeft:0,marginRight:0,fontWeight:"bold",display:"block"},u:{textDecoration:"underline",display:"inline"},strong:{fontWeight:"bold",display:"inline"},b:{fontWeight:"bold",display:"inline"},i:{fontStyle:"italic",display:"inline"},em:{fontStyle:"italic",display:"inline"},code:{fontFamily:"monospace",display:"inline"},kbd:{fontFamily:"monospace",display:"inline"},pre:{fontFamily:"monospace",margin:"1em 0",display:"block"},mark:{backgroundColor:"yellow",color:"black",display:"inline"},big:{fontSize:"1.2em",display:"inline"},small:{fontSize:"0.8em",display:"inline"},s:{textDecoration:"line-through",display:"inline"},span:{display:"inline"},img:{display:"inline"},svg:{display:"inline"}};var A=new Set(["head","meta","link","style","script"]);function x(t){return A.has(t.type)}function u(t,e){return t.type===e&&"props"in t}function S(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function o(t){return typeof t=="object"&&t!==null&&"type"in t}function p(t){return typeof t=="function"}var $=Symbol.for("react.forward_ref"),O=Symbol.for("react.memo"),z=Symbol.for("react.fragment");function E(t){return t.$$typeof===$}function w(t){return t.$$typeof===O}function h(t){return t.type===z}function F(t){return typeof t=="string"||typeof t=="number"}function P(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function j(t){return Object.keys(t).map(e=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(t[e]).trim()}`).join(";")}var I=["stopColor","stopOpacity","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","fillRule","clipRule","colorInterpolationFilters","floodColor","floodOpacity","accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipPathUnits","colorInterpolation","colorProfile","colorRendering","enableBackground","fillOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","preserveAspectRatio","pointerEvents","shapeRendering","strokeMiterlimit","strokeOpacity","textAnchor","textDecoration","textRendering","transformOrigin","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vectorEffect","vertAdvY","vertOriginX","vertOriginY","vAlphabetic","vHanging","vIdeographic","vMathematical","wordSpacing","writingMode"];function W(t,e){if(t==="children"||e==null)return;let n;if(t==="className"?n="class":I.includes(t)?n=S(t):n=t,typeof e=="boolean")return`${n}="${String(e)}"`;if(t==="style"&&typeof e=="object"){let r=j(e);if(r)return`style="${P(r)}"`}return`${n}="${P(String(e))}"`}function B(t){return Object.entries(t).map(([e,n])=>W(e,n)).filter(e=>e!==void 0)}var M=(t,e)=>{let n=t.props||{};if(p(t.type))return c(t.type(t.props));if(typeof t.type=="symbol"||typeof t.type!="string")return"";let r=B(n),s=n.children,g=Array.isArray(s)?s.map(k=>e(k)).join(""):e(s);return`<${t.type}${r.length>0?` ${r.join(" ")}`:""}>${g}</${t.type}>`},c=t=>t==null||t===!1?"":F(t)?String(t):Array.isArray(t)?t.map(c).join(""):o(t)?M(t,c):"";function T(t){let e=t.props||{};if(!("xmlns"in e)){let n={...t,props:{...e,xmlns:"http://www.w3.org/2000/svg"}};return c(n)||""}return c(t)||""}async function tt(t){let e=await i(t);return e.length===0?f({}):e.length===1&&e[0]!==void 0?e[0]:f({children:e,style:{width:y(100),height:y(100)}})}async function i(t){if(t==null||t===!1)return[];if(t instanceof Promise)return i(await t);if(typeof t=="object"&&Symbol.iterator in t)return V(t);if(o(t)){let e=await L(t);return Array.isArray(e)?e:e?[e]:[]}return[m(String(t),a.span)]}function H(t){if(!(typeof t.type!="object"||t.type===null)){if(E(t.type)&&"render"in t.type){let e=t.type;return i(e.render(t.props,null))}if(w(t.type)&&"type"in t.type){let n=t.type.type;if(p(n))return i(n(t.props));let r={...t,type:n};return L(r)}}}function v(t){if(!o(t))return Promise.resolve(void 0);let e=typeof t.props=="object"&&t.props!==null&&"children"in t.props?t.props.children:void 0;return typeof e=="string"?Promise.resolve(e):typeof e=="number"?Promise.resolve(String(e)):Array.isArray(e)?Promise.resolve(C(e)):typeof e=="object"&&e!==null&&Symbol.iterator in e?Promise.resolve(C(Array.from(e))):o(e)&&h(e)?v(e):Promise.resolve(void 0)}function C(t){if(!t.some(e=>o(e)))return t.map(e=>typeof e=="string"?e:typeof e=="number"?String(e):"").join("")}async function L(t){if(p(t.type))return i(t.type(t.props));let e=H(t);if(e!==void 0)return e;if(h(t))return await N(t)||[];if(x(t))return[];if(u(t,"br"))return[m(`
2
+ `,a.span)];if(u(t,"img"))return[_(t)];if(u(t,"svg"))return[D(t)];let n=R(t),r=b(t),s=await v(t);if(s!==void 0)return[m({text:s,style:n,tw:r})];let g=await N(t);return[f({children:g,style:n,tw:r})]}function _(t){if(!t.props.src)throw new Error("Image element must have a 'src' prop.");let e=R(t),n=b(t);return d({src:t.props.src,style:e,tw:n})}function D(t){let e=R(t),n=b(t),r=T(t);return d({style:e,src:r,tw:n})}function R(t){let e={};typeof t.type=="string"&&t.type in a&&Object.assign(e,a[t.type]);let n=typeof t.props=="object"&&t.props!==null&&"style"in t.props&&typeof t.props.style=="object"&&t.props.style!==null?t.props.style:void 0;return n&&Object.keys(n).length>0&&Object.assign(e,n),e}function b(t){if(!(typeof t.props!="object"||t.props===null||!("tw"in t.props)))return t.props.tw}function N(t){return typeof t.props!="object"||t.props===null||!("children"in t.props)?Promise.resolve([]):i(t.props.children)}function V(t){return Promise.all(Array.from(t).map(e=>i(e))).then(e=>e.flat())}export{tt as fromJsx};
@@ -0,0 +1,35 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ type AnyNode = {
4
+ type: string;
5
+ style?: CSSProperties;
6
+ tw?: string;
7
+ [key: string]: unknown;
8
+ };
9
+ /**
10
+ * @deprecated Use {import("csstype").Properties} or {import("react").CSSProperties} instead
11
+ */
12
+ type PartialStyle = CSSProperties;
13
+ type Node = ContainerNode | TextNode | ImageNode | AnyNode;
14
+ type ContainerNode = {
15
+ type: "container";
16
+ style?: CSSProperties;
17
+ children?: Node[];
18
+ tw?: string;
19
+ };
20
+ type TextNode = {
21
+ type: "text";
22
+ text: string;
23
+ style?: CSSProperties;
24
+ tw?: string;
25
+ };
26
+ type ImageNode = {
27
+ type: "image";
28
+ src: string;
29
+ width?: number;
30
+ height?: number;
31
+ style?: CSSProperties;
32
+ tw?: string;
33
+ };
34
+
35
+ export type { AnyNode as A, ContainerNode as C, ImageNode as I, Node as N, PartialStyle as P, TextNode as T };
@@ -0,0 +1,35 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ type AnyNode = {
4
+ type: string;
5
+ style?: CSSProperties;
6
+ tw?: string;
7
+ [key: string]: unknown;
8
+ };
9
+ /**
10
+ * @deprecated Use {import("csstype").Properties} or {import("react").CSSProperties} instead
11
+ */
12
+ type PartialStyle = CSSProperties;
13
+ type Node = ContainerNode | TextNode | ImageNode | AnyNode;
14
+ type ContainerNode = {
15
+ type: "container";
16
+ style?: CSSProperties;
17
+ children?: Node[];
18
+ tw?: string;
19
+ };
20
+ type TextNode = {
21
+ type: "text";
22
+ text: string;
23
+ style?: CSSProperties;
24
+ tw?: string;
25
+ };
26
+ type ImageNode = {
27
+ type: "image";
28
+ src: string;
29
+ width?: number;
30
+ height?: number;
31
+ style?: CSSProperties;
32
+ tw?: string;
33
+ };
34
+
35
+ export type { AnyNode as A, ContainerNode as C, ImageNode as I, Node as N, PartialStyle as P, TextNode as T };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/helpers",
3
- "version": "0.52.2",
3
+ "version": "0.53.1",
4
4
  "author": {
5
5
  "email": "me@kane.tw",
6
6
  "name": "Kane Wang",