@takumi-rs/helpers 0.28.4 → 0.29.0
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.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/jsx/jsx.cjs +1 -1
- package/dist/jsx/jsx.d.cts +8 -2
- package/dist/jsx/jsx.d.ts +8 -2
- package/dist/jsx/jsx.js +1 -1
- package/dist/{types-8M7fRh4t.d.cts → types-CV2M3RYA.d.cts} +67 -15
- package/dist/{types-8M7fRh4t.d.ts → types-CV2M3RYA.d.ts} +67 -15
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-
|
|
2
|
-
export { A as AnyNode, J as JsonValue, N as Node } from './types-
|
|
1
|
+
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-CV2M3RYA.cjs';
|
|
2
|
+
export { A as AnyNode, J as JsonValue, N as Node } from './types-CV2M3RYA.cjs';
|
|
3
3
|
|
|
4
4
|
declare function container(props: Omit<ContainerNode, "type">): ContainerNode;
|
|
5
5
|
declare function text(text: string, style?: PartialStyle): TextNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-
|
|
2
|
-
export { A as AnyNode, J as JsonValue, N as Node } from './types-
|
|
1
|
+
import { C as ContainerNode, P as PartialStyle, T as TextNode, I as ImageNode, S as Style, a as Color } from './types-CV2M3RYA.js';
|
|
2
|
+
export { A as AnyNode, J as JsonValue, N as Node } from './types-CV2M3RYA.js';
|
|
3
3
|
|
|
4
4
|
declare function container(props: Omit<ContainerNode, "type">): ContainerNode;
|
|
5
5
|
declare function text(text: string, style?: PartialStyle): TextNode;
|
package/dist/jsx/jsx.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var $=(t,e)=>{for(var r in e)f(t,r,{get:e[r],enumerable:!0})},O=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of T(e))!L.call(t,i)&&i!==r&&f(t,i,{get:()=>e[i],enumerable:!(o=A(e,i))||o.enumerable});return t};var z=t=>O(f({},"__esModule",{value:!0}),t);var q={};$(q,{fromJsx:()=>_});module.exports=z(q);function u(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function p(t){let e={type:"container",children:t.children};return u(e,t.style),e}function S(t,e){let r={type:"text",text:t};return u(r,e),r}function m(t){let e={type:"image",src:t.src};return u(e,t.style),e}function y(t){return{percentage:t}}function n(t){return{em:t}}function k(t,e,r,o=1){return[t,e,r,o]}var g={p:{margin:[n(1),0]},blockquote:{margin:[n(1),40]},center:{textAlign:"center"},hr:{margin:[n(.5),"auto"],borderWidth:1},h1:{fontSize:n(2),margin:[n(.67),0],fontWeight:700},h2:{fontSize:n(1.5),margin:[n(.83),0],fontWeight:700},h3:{fontSize:n(1.17),margin:[n(1),0],fontWeight:700},h4:{margin:[n(1.33),0],fontWeight:700},h5:{fontSize:n(.83),margin:[n(1.67),0],fontWeight:700},h6:{fontSize:n(.67),margin:[n(2.33),0],fontWeight:700},strong:{fontWeight:700},b:{fontWeight:700},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{fontFamily:"monospace",margin:[n(1),0]},mark:{backgroundColor:k(255,255,0),color:0},big:{fontSize:n(1.2)},small:{fontSize:n(1/1.2)}};function d(t,e){return t.type===e&&"props"in t}function E(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function l(t){return typeof t=="object"&&t!==null&&"type"in t}function a(t){return typeof t=="function"}var I=Symbol.for("react.forward_ref"),F=Symbol.for("react.memo");function b(t){return t.$$typeof===I}function P(t){return t.$$typeof===F}function W(t){return typeof t=="string"||typeof t=="number"}function w(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function j(t){return Object.keys(t).map(e=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(t[e]).trim()}`).join(";")}var M=["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 r;if(t==="className"?r="class":M.includes(t)?r=E(t):r=t,typeof e=="boolean")return`${r}="${String(e)}"`;if(t==="style"&&typeof e=="object"){let o=j(e);if(o)return`style="${w(o)}"`}return`${r}="${w(String(e))}"`}function H(t){return Object.entries(t).map(([e,r])=>X(e,r)).filter(e=>e!==void 0)}var J=(t,e)=>{let r=t.props||{};if(a(t.type))return c(t.type(t.props));if(typeof t.type=="symbol"||typeof t.type!="string")return"";let o=H(r),i=r.children,h=Array.isArray(i)?i.map(v=>e(v)).join(""):e(i);return`<${t.type}${o.length>0?` ${o.join(" ")}`:""}>${h}</${t.type}>`},c=t=>t==null||t===!1?"":W(t)?String(t):Array.isArray(t)?t.map(c).join(""):l(t)?J(t,c):"";function x(t){let e=t.props||{};if(!("xmlns"in e)){let r={...t,props:{...e,xmlns:"http://www.w3.org/2000/svg"}};return c(r)||""}return c(t)||""}async function _(t){let e=await s(t);return e.length===0?p({}):e.length===1&&e[0]!==void 0?e[0]:p({children:e,style:{width:y(100),height:y(100)}})}async function s(t){if(t==null)return[];if(t instanceof Promise)return s(await t);if(typeof t=="object"&&Symbol.iterator in t)return K(t);if(l(t)){let e=await C(t);return Array.isArray(e)?e:e?[e]:[]}return[S(String(t))]}function V(t){if(!(typeof t.type!="object"||t.type===null)&&b(t.type)&&"render"in t.type){let e=t.type;return s(e.render(t.props,null))}}function D(t){if(!(typeof t.type!="object"||t.type===null)&&P(t.type)&&"type"in t.type){let r=t.type.type;if(a(r))return s(r(t.props));let o={...t,type:r};return C(o)}}async function C(t){if(a(t.type))return s(t.type(t.props));let e=V(t);if(e!==void 0)return e;let r=D(t);if(r!==void 0)return r;if(typeof t.type=="symbol"&&t.type===Symbol.for("react.fragment"))return await N(t)||[];if(d(t,"img"))return[Y(t)];if(d(t,"svg"))return[B(t)];let o=await N(t),i=R(t.props);return typeof t.type=="string"&&t.type in g&&Object.assign(i,g[t.type]),[p({children:o,style:i})]}function Y(t){if(!t.props.src)throw new Error("Image element must have a 'src' prop.");let e=R(t.props);return m({src:t.props.src,style:e})}function B(t){let e=R(t.props),r=x(t);return m({src:r,style:e})}function R(t){return typeof t!="object"||t===null?{}:"style"in t&&typeof t.style=="object"?t.style:{}}function N(t){return typeof t.props!="object"||t.props===null||!("children"in t.props)?Promise.resolve([]):s(t.props.children)}async function K(t){return(await Promise.all(Array.from(t).map(s))).flat()}0&&(module.exports={fromJsx});
|
package/dist/jsx/jsx.d.cts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { N as Node } from '../types-
|
|
2
|
+
import { N as Node } from '../types-CV2M3RYA.cjs';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type ReactElementLike = {
|
|
5
|
+
type: string | ((props: unknown) => ReactElementLike) | ReactElementLike;
|
|
6
|
+
props: unknown;
|
|
7
|
+
$$typeof?: symbol;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare function fromJsx(element: ReactNode | ReactElementLike): Promise<Node>;
|
|
5
11
|
|
|
6
12
|
export { fromJsx };
|
package/dist/jsx/jsx.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { N as Node } from '../types-
|
|
2
|
+
import { N as Node } from '../types-CV2M3RYA.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type ReactElementLike = {
|
|
5
|
+
type: string | ((props: unknown) => ReactElementLike) | ReactElementLike;
|
|
6
|
+
props: unknown;
|
|
7
|
+
$$typeof?: symbol;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare function fromJsx(element: ReactNode | ReactElementLike): Promise<Node>;
|
|
5
11
|
|
|
6
12
|
export { fromJsx };
|
package/dist/jsx/jsx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function f(t,e){e&&Object.keys(e).length>0&&(t.style=e)}function p(t){let e={type:"container",children:t.children};return f(e,t.style),e}function h(t,e){let r={type:"text",text:t};return f(r,e),r}function u(t){let e={type:"image",src:t.src};return f(e,t.style),e}function m(t){return{percentage:t}}function n(t){return{em:t}}function S(t,e,r,o=1){return[t,e,r,o]}var y={p:{margin:[n(1),0]},blockquote:{margin:[n(1),40]},center:{textAlign:"center"},hr:{margin:[n(.5),"auto"],borderWidth:1},h1:{fontSize:n(2),margin:[n(.67),0],fontWeight:700},h2:{fontSize:n(1.5),margin:[n(.83),0],fontWeight:700},h3:{fontSize:n(1.17),margin:[n(1),0],fontWeight:700},h4:{margin:[n(1.33),0],fontWeight:700},h5:{fontSize:n(.83),margin:[n(1.67),0],fontWeight:700},h6:{fontSize:n(.67),margin:[n(2.33),0],fontWeight:700},strong:{fontWeight:700},b:{fontWeight:700},code:{fontFamily:"monospace"},kbd:{fontFamily:"monospace"},pre:{fontFamily:"monospace",margin:[n(1),0]},mark:{backgroundColor:S(255,255,0),color:0},big:{fontSize:n(1.2)},small:{fontSize:n(1/1.2)}};function g(t,e){return t.type===e&&"props"in t}function k(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function l(t){return typeof t=="object"&&t!==null&&"type"in t}function a(t){return typeof t=="function"}var v=Symbol.for("react.forward_ref"),A=Symbol.for("react.memo");function E(t){return t.$$typeof===v}function b(t){return t.$$typeof===A}function T(t){return typeof t=="string"||typeof t=="number"}function P(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function L(t){return Object.keys(t).map(e=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(t[e]).trim()}`).join(";")}var $=["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 O(t,e){if(t==="children"||e==null)return;let r;if(t==="className"?r="class":$.includes(t)?r=k(t):r=t,typeof e=="boolean")return`${r}="${String(e)}"`;if(t==="style"&&typeof e=="object"){let o=L(e);if(o)return`style="${P(o)}"`}return`${r}="${P(String(e))}"`}function z(t){return Object.entries(t).map(([e,r])=>O(e,r)).filter(e=>e!==void 0)}var I=(t,e)=>{let r=t.props||{};if(a(t.type))return c(t.type(t.props));if(typeof t.type=="symbol"||typeof t.type!="string")return"";let o=z(r),s=r.children,R=Array.isArray(s)?s.map(C=>e(C)).join(""):e(s);return`<${t.type}${o.length>0?` ${o.join(" ")}`:""}>${R}</${t.type}>`},c=t=>t==null||t===!1?"":T(t)?String(t):Array.isArray(t)?t.map(c).join(""):l(t)?I(t,c):"";function w(t){let e=t.props||{};if(!("xmlns"in e)){let r={...t,props:{...e,xmlns:"http://www.w3.org/2000/svg"}};return c(r)||""}return c(t)||""}async function U(t){let e=await i(t);return e.length===0?p({}):e.length===1&&e[0]!==void 0?e[0]:p({children:e,style:{width:m(100),height:m(100)}})}async function i(t){if(t==null)return[];if(t instanceof Promise)return i(await t);if(typeof t=="object"&&Symbol.iterator in t)return X(t);if(l(t)){let e=await N(t);return Array.isArray(e)?e:e?[e]:[]}return[h(String(t))]}function F(t){if(!(typeof t.type!="object"||t.type===null)&&E(t.type)&&"render"in t.type){let e=t.type;return i(e.render(t.props,null))}}function W(t){if(!(typeof t.type!="object"||t.type===null)&&b(t.type)&&"type"in t.type){let r=t.type.type;if(a(r))return i(r(t.props));let o={...t,type:r};return N(o)}}async function N(t){if(a(t.type))return i(t.type(t.props));let e=F(t);if(e!==void 0)return e;let r=W(t);if(r!==void 0)return r;if(typeof t.type=="symbol"&&t.type===Symbol.for("react.fragment"))return await x(t)||[];if(g(t,"img"))return[j(t)];if(g(t,"svg"))return[M(t)];let o=await x(t),s=d(t.props);return typeof t.type=="string"&&t.type in y&&Object.assign(s,y[t.type]),[p({children:o,style:s})]}function j(t){if(!t.props.src)throw new Error("Image element must have a 'src' prop.");let e=d(t.props);return u({src:t.props.src,style:e})}function M(t){let e=d(t.props),r=w(t);return u({src:r,style:e})}function d(t){return typeof t!="object"||t===null?{}:"style"in t&&typeof t.style=="object"?t.style:{}}function x(t){return typeof t.props!="object"||t.props===null||!("children"in t.props)?Promise.resolve([]):i(t.props.children)}async function X(t){return(await Promise.all(Array.from(t).map(i))).flat()}export{U as fromJsx};
|
|
@@ -299,20 +299,19 @@ type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
|
299
299
|
|
|
300
300
|
/**
|
|
301
301
|
* Represents a font family for text rendering.
|
|
302
|
-
*
|
|
303
|
-
* Multi-word names are allowed (e.g., "Noto Sans") and should be provided as-is without quotes.
|
|
302
|
+
* Multi value fallback is supported.
|
|
304
303
|
*/
|
|
305
|
-
type FontFamily =
|
|
304
|
+
type FontFamily = string;
|
|
306
305
|
|
|
307
306
|
/**
|
|
308
|
-
*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
*
|
|
307
|
+
* Controls the slant (italic/oblique) of text rendering.
|
|
308
|
+
*/
|
|
309
|
+
type FontStyle = "normal" | "italic" | "oblique" | `oblique ${string}deg`;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Represents font weight value.
|
|
314
313
|
*/
|
|
315
|
-
type FontWeight =
|
|
314
|
+
type FontWeight = string | number;
|
|
316
315
|
|
|
317
316
|
/**
|
|
318
317
|
* Represents spacing between flex items.
|
|
@@ -449,6 +448,11 @@ type LineHeight = number | string | LengthUnit;
|
|
|
449
448
|
*/
|
|
450
449
|
type ObjectFit = "fill" | "contain" | "cover" | "scale-down" | "none";
|
|
451
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Controls how text should be overflowed.
|
|
453
|
+
*/
|
|
454
|
+
type OverflowWrap = "normal" | "anywhere" | "break-word";
|
|
455
|
+
|
|
452
456
|
/**
|
|
453
457
|
* Defines the positioning method for an element.
|
|
454
458
|
*
|
|
@@ -476,14 +480,39 @@ type TextAlign = "left" | "right" | "center" | "justify" | "start" | "end";
|
|
|
476
480
|
type TextOverflow = "ellipsis" | "clip";
|
|
477
481
|
|
|
478
482
|
/**
|
|
479
|
-
* Controls
|
|
483
|
+
* Controls text case transformation when rendering.
|
|
480
484
|
*/
|
|
481
|
-
type
|
|
485
|
+
type TextTransform = "none" | "uppercase" | "lowercase" | "capitalize";
|
|
482
486
|
|
|
483
487
|
/**
|
|
484
|
-
*
|
|
488
|
+
* Represents an affine transform matrix
|
|
485
489
|
*/
|
|
486
|
-
type
|
|
490
|
+
type Affine = {
|
|
491
|
+
/**
|
|
492
|
+
* Horizontal scaling / cosine of rotation
|
|
493
|
+
*/
|
|
494
|
+
a: number;
|
|
495
|
+
/**
|
|
496
|
+
* Vertical shear / sine of rotation
|
|
497
|
+
*/
|
|
498
|
+
b: number;
|
|
499
|
+
/**
|
|
500
|
+
* Horizontal shear / negative sine of rotation
|
|
501
|
+
*/
|
|
502
|
+
c: number;
|
|
503
|
+
/**
|
|
504
|
+
* Vertical scaling / cosine of rotation
|
|
505
|
+
*/
|
|
506
|
+
d: number;
|
|
507
|
+
/**
|
|
508
|
+
* Horizontal translation (always orthogonal regardless of rotation)
|
|
509
|
+
*/
|
|
510
|
+
x: number;
|
|
511
|
+
/**
|
|
512
|
+
* Vertical translation (always orthogonal regardless of rotation)
|
|
513
|
+
*/
|
|
514
|
+
y: number;
|
|
515
|
+
};
|
|
487
516
|
|
|
488
517
|
/**
|
|
489
518
|
* Represents a single CSS transform operation
|
|
@@ -494,6 +523,10 @@ type Transform = {
|
|
|
494
523
|
"scale": [number, number];
|
|
495
524
|
} | {
|
|
496
525
|
"rotate": Angle;
|
|
526
|
+
} | {
|
|
527
|
+
"skew": [Angle, Angle];
|
|
528
|
+
} | {
|
|
529
|
+
"matrix": Affine;
|
|
497
530
|
};
|
|
498
531
|
|
|
499
532
|
/**
|
|
@@ -501,6 +534,13 @@ type Transform = {
|
|
|
501
534
|
*/
|
|
502
535
|
type Transforms = Array<Transform> | string;
|
|
503
536
|
|
|
537
|
+
/**
|
|
538
|
+
* Controls how text should be broken at word boundaries.
|
|
539
|
+
*
|
|
540
|
+
* Corresponds to CSS word-break property.
|
|
541
|
+
*/
|
|
542
|
+
type WordBreak = "normal" | "break-all" | "keep-all";
|
|
543
|
+
|
|
504
544
|
/**
|
|
505
545
|
* Main styling structure that contains all layout and visual properties.
|
|
506
546
|
*/
|
|
@@ -788,7 +828,7 @@ type Style = {
|
|
|
788
828
|
/**
|
|
789
829
|
* Font slant style (normal, italic, oblique).
|
|
790
830
|
*/
|
|
791
|
-
|
|
831
|
+
fontStyle?: FontStyle;
|
|
792
832
|
/**
|
|
793
833
|
* Color of the element's border.
|
|
794
834
|
*/
|
|
@@ -825,10 +865,22 @@ type Style = {
|
|
|
825
865
|
* Additional spacing between characters in text.
|
|
826
866
|
*/
|
|
827
867
|
letterSpacing?: LengthUnit;
|
|
868
|
+
/**
|
|
869
|
+
* Additional spacing between words in text.
|
|
870
|
+
*/
|
|
871
|
+
wordSpacing?: LengthUnit;
|
|
828
872
|
/**
|
|
829
873
|
* Controls how images are scaled when rendered.
|
|
830
874
|
*/
|
|
831
875
|
imageRendering?: ImageScalingAlgorithm;
|
|
876
|
+
/**
|
|
877
|
+
* How text should be overflowed.
|
|
878
|
+
*/
|
|
879
|
+
overflowWrap?: OverflowWrap;
|
|
880
|
+
/**
|
|
881
|
+
* How text should be broken at word boundaries.
|
|
882
|
+
*/
|
|
883
|
+
wordBreak?: WordBreak;
|
|
832
884
|
};
|
|
833
885
|
|
|
834
886
|
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
@@ -299,20 +299,19 @@ type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
|
299
299
|
|
|
300
300
|
/**
|
|
301
301
|
* Represents a font family for text rendering.
|
|
302
|
-
*
|
|
303
|
-
* Multi-word names are allowed (e.g., "Noto Sans") and should be provided as-is without quotes.
|
|
302
|
+
* Multi value fallback is supported.
|
|
304
303
|
*/
|
|
305
|
-
type FontFamily =
|
|
304
|
+
type FontFamily = string;
|
|
306
305
|
|
|
307
306
|
/**
|
|
308
|
-
*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
*
|
|
307
|
+
* Controls the slant (italic/oblique) of text rendering.
|
|
308
|
+
*/
|
|
309
|
+
type FontStyle = "normal" | "italic" | "oblique" | `oblique ${string}deg`;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Represents font weight value.
|
|
314
313
|
*/
|
|
315
|
-
type FontWeight =
|
|
314
|
+
type FontWeight = string | number;
|
|
316
315
|
|
|
317
316
|
/**
|
|
318
317
|
* Represents spacing between flex items.
|
|
@@ -449,6 +448,11 @@ type LineHeight = number | string | LengthUnit;
|
|
|
449
448
|
*/
|
|
450
449
|
type ObjectFit = "fill" | "contain" | "cover" | "scale-down" | "none";
|
|
451
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Controls how text should be overflowed.
|
|
453
|
+
*/
|
|
454
|
+
type OverflowWrap = "normal" | "anywhere" | "break-word";
|
|
455
|
+
|
|
452
456
|
/**
|
|
453
457
|
* Defines the positioning method for an element.
|
|
454
458
|
*
|
|
@@ -476,14 +480,39 @@ type TextAlign = "left" | "right" | "center" | "justify" | "start" | "end";
|
|
|
476
480
|
type TextOverflow = "ellipsis" | "clip";
|
|
477
481
|
|
|
478
482
|
/**
|
|
479
|
-
* Controls
|
|
483
|
+
* Controls text case transformation when rendering.
|
|
480
484
|
*/
|
|
481
|
-
type
|
|
485
|
+
type TextTransform = "none" | "uppercase" | "lowercase" | "capitalize";
|
|
482
486
|
|
|
483
487
|
/**
|
|
484
|
-
*
|
|
488
|
+
* Represents an affine transform matrix
|
|
485
489
|
*/
|
|
486
|
-
type
|
|
490
|
+
type Affine = {
|
|
491
|
+
/**
|
|
492
|
+
* Horizontal scaling / cosine of rotation
|
|
493
|
+
*/
|
|
494
|
+
a: number;
|
|
495
|
+
/**
|
|
496
|
+
* Vertical shear / sine of rotation
|
|
497
|
+
*/
|
|
498
|
+
b: number;
|
|
499
|
+
/**
|
|
500
|
+
* Horizontal shear / negative sine of rotation
|
|
501
|
+
*/
|
|
502
|
+
c: number;
|
|
503
|
+
/**
|
|
504
|
+
* Vertical scaling / cosine of rotation
|
|
505
|
+
*/
|
|
506
|
+
d: number;
|
|
507
|
+
/**
|
|
508
|
+
* Horizontal translation (always orthogonal regardless of rotation)
|
|
509
|
+
*/
|
|
510
|
+
x: number;
|
|
511
|
+
/**
|
|
512
|
+
* Vertical translation (always orthogonal regardless of rotation)
|
|
513
|
+
*/
|
|
514
|
+
y: number;
|
|
515
|
+
};
|
|
487
516
|
|
|
488
517
|
/**
|
|
489
518
|
* Represents a single CSS transform operation
|
|
@@ -494,6 +523,10 @@ type Transform = {
|
|
|
494
523
|
"scale": [number, number];
|
|
495
524
|
} | {
|
|
496
525
|
"rotate": Angle;
|
|
526
|
+
} | {
|
|
527
|
+
"skew": [Angle, Angle];
|
|
528
|
+
} | {
|
|
529
|
+
"matrix": Affine;
|
|
497
530
|
};
|
|
498
531
|
|
|
499
532
|
/**
|
|
@@ -501,6 +534,13 @@ type Transform = {
|
|
|
501
534
|
*/
|
|
502
535
|
type Transforms = Array<Transform> | string;
|
|
503
536
|
|
|
537
|
+
/**
|
|
538
|
+
* Controls how text should be broken at word boundaries.
|
|
539
|
+
*
|
|
540
|
+
* Corresponds to CSS word-break property.
|
|
541
|
+
*/
|
|
542
|
+
type WordBreak = "normal" | "break-all" | "keep-all";
|
|
543
|
+
|
|
504
544
|
/**
|
|
505
545
|
* Main styling structure that contains all layout and visual properties.
|
|
506
546
|
*/
|
|
@@ -788,7 +828,7 @@ type Style = {
|
|
|
788
828
|
/**
|
|
789
829
|
* Font slant style (normal, italic, oblique).
|
|
790
830
|
*/
|
|
791
|
-
|
|
831
|
+
fontStyle?: FontStyle;
|
|
792
832
|
/**
|
|
793
833
|
* Color of the element's border.
|
|
794
834
|
*/
|
|
@@ -825,10 +865,22 @@ type Style = {
|
|
|
825
865
|
* Additional spacing between characters in text.
|
|
826
866
|
*/
|
|
827
867
|
letterSpacing?: LengthUnit;
|
|
868
|
+
/**
|
|
869
|
+
* Additional spacing between words in text.
|
|
870
|
+
*/
|
|
871
|
+
wordSpacing?: LengthUnit;
|
|
828
872
|
/**
|
|
829
873
|
* Controls how images are scaled when rendered.
|
|
830
874
|
*/
|
|
831
875
|
imageRendering?: ImageScalingAlgorithm;
|
|
876
|
+
/**
|
|
877
|
+
* How text should be overflowed.
|
|
878
|
+
*/
|
|
879
|
+
overflowWrap?: OverflowWrap;
|
|
880
|
+
/**
|
|
881
|
+
* How text should be broken at word boundaries.
|
|
882
|
+
*/
|
|
883
|
+
wordBreak?: WordBreak;
|
|
832
884
|
};
|
|
833
885
|
|
|
834
886
|
type JsonValue = string | number | boolean | null | JsonValue[] | {
|