@takumi-rs/helpers 0.30.2 → 0.31.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.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/jsx/jsx.cjs +1 -1
- package/dist/jsx/jsx.d.cts +2 -2
- package/dist/jsx/jsx.d.ts +2 -2
- package/dist/jsx/jsx.js +1 -1
- package/dist/{types-Bg4T_32S.d.cts → types-COELemna.d.cts} +65 -22
- package/dist/{types-Bg4T_32S.d.ts → types-COELemna.d.ts} +65 -22
- 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-COELemna.cjs';
|
|
2
|
+
export { A as AnyNode, J as JsonValue, N as Node } from './types-COELemna.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-COELemna.js';
|
|
2
|
+
export { A as AnyNode, J as JsonValue, N as Node } from './types-COELemna.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 f=Object.defineProperty;var
|
|
1
|
+
"use strict";var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},z=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $(t))!W.call(e,i)&&i!==r&&f(e,i,{get:()=>t[i],enumerable:!(o=O(t,i))||o.enumerable});return e};var I=e=>z(f({},"__esModule",{value:!0}),e);var Q={};F(Q,{fromJsx:()=>B});module.exports=I(Q);function u(e,t){t&&Object.keys(t).length>0&&(e.style=t)}function l(e){let t={type:"container",children:e.children};return u(t,e.style),t}function m(e,t){let r={type:"text",text:e};return u(r,t),r}function y(e){let t={type:"image",src:e.src};return u(t,e.style),t}function g(e){return{percentage:e}}function n(e){return{em:e}}function b(e,t,r,o=1){return[e,t,r,o]}var d={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:b(255,255,0),color:0},big:{fontSize:n(1.2)},small:{fontSize:n(1/1.2)}};function R(e,t){return e.type===t&&"props"in e}function E(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function s(e){return typeof e=="object"&&e!==null&&"type"in e}function c(e){return typeof e=="function"}var j=Symbol.for("react.forward_ref"),M=Symbol.for("react.memo"),X=Symbol.for("react.fragment");function P(e){return e.$$typeof===j}function x(e){return e.$$typeof===M}function k(e){return e.type===X}function J(e){return typeof e=="string"||typeof e=="number"}function w(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function _(e){return Object.keys(e).map(t=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(e[t]).trim()}`).join(";")}var H=["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 V(e,t){if(e==="children"||t==null)return;let r;if(e==="className"?r="class":H.includes(e)?r=E(e):r=e,typeof t=="boolean")return`${r}="${String(t)}"`;if(e==="style"&&typeof t=="object"){let o=_(t);if(o)return`style="${w(o)}"`}return`${r}="${w(String(t))}"`}function Y(e){return Object.entries(e).map(([t,r])=>V(t,r)).filter(t=>t!==void 0)}var D=(e,t)=>{let r=e.props||{};if(c(e.type))return p(e.type(e.props));if(typeof e.type=="symbol"||typeof e.type!="string")return"";let o=Y(r),i=r.children,S=Array.isArray(i)?i.map(L=>t(L)).join(""):t(i);return`<${e.type}${o.length>0?` ${o.join(" ")}`:""}>${S}</${e.type}>`},p=e=>e==null||e===!1?"":J(e)?String(e):Array.isArray(e)?e.map(p).join(""):s(e)?D(e,p):"";function C(e){let t=e.props||{};if(!("xmlns"in t)){let r={...e,props:{...t,xmlns:"http://www.w3.org/2000/svg"}};return p(r)||""}return p(e)||""}async function B(e){let t=await a(e);return t.length===0?l({}):t.length===1&&t[0]!==void 0?t[0]:l({children:t,style:{width:g(100),height:g(100)}})}async function a(e){if(e==null)return[];if(e instanceof Promise)return a(await e);if(typeof e=="object"&&Symbol.iterator in e)return U(e);if(s(e)){let t=await A(e);return Array.isArray(t)?t:t?[t]:[]}return[m(String(e))]}function K(e){if(!(typeof e.type!="object"||e.type===null)){if(P(e.type)&&"render"in e.type){let t=e.type;return a(t.render(e.props,null))}if(x(e.type)&&"type"in e.type){let r=e.type.type;if(c(r))return a(r(e.props));let o={...e,type:r};return A(o)}}}function T(e){if(!s(e))return Promise.resolve(void 0);let t=typeof e.props=="object"&&e.props!==null&&"children"in e.props?e.props.children:void 0;return typeof t=="string"?Promise.resolve(t):typeof t=="number"?Promise.resolve(String(t)):Array.isArray(t)?Promise.resolve(N(t)):typeof t=="object"&&t!==null&&Symbol.iterator in t?Promise.resolve(N(Array.from(t))):s(t)&&k(t)?T(t):Promise.resolve(void 0)}function N(e){if(!e.some(t=>s(t)))return e.map(t=>typeof t=="string"?t:typeof t=="number"?String(t):"").join("")}async function A(e){if(c(e.type))return a(e.type(e.props));let t=K(e);if(t!==void 0)return t;if(k(e))return await v(e)||[];if(R(e,"img"))return[q(e)];if(R(e,"svg"))return[Z(e)];let r=h(e.props);typeof e.type=="string"&&e.type in d&&Object.assign(r,d[e.type]);let o=await T(e);if(o!==void 0)return[m(o,r)];let i=await v(e);return[l({children:i,style:r})]}function q(e){if(!e.props.src)throw new Error("Image element must have a 'src' prop.");let t=h(e.props);return y({src:e.props.src,style:t})}function Z(e){let t=h(e.props),r=C(e);return y({style:t,src:r})}var G={WebkitTextStroke:"textStroke",WebkitTextStrokeWidth:"textStrokeWidth",WebkitTextStrokeColor:"textStrokeColor"};function h(e){if(typeof e!="object"||e===null)return{};let t="style"in e&&typeof e.style=="object"&&e.style!==null?e.style:{};if(Object.keys(t).length>0)for(let[r,o]of Object.entries(G))r in t&&(t[o]=t[r],delete t[r]);return t}function v(e){return typeof e.props!="object"||e.props===null||!("children"in e.props)?Promise.resolve([]):a(e.props.children)}function U(e){return Promise.all(Array.from(e).map(a)).then(t=>t.flat())}0&&(module.exports={fromJsx});
|
package/dist/jsx/jsx.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { N as Node } from '../types-
|
|
2
|
+
import { N as Node } from '../types-COELemna.cjs';
|
|
3
3
|
|
|
4
4
|
type ReactElementLike = {
|
|
5
|
-
type: string | ((props: unknown) => ReactElementLike) | ReactElementLike;
|
|
5
|
+
type: string | symbol | ((props: unknown) => ReactElementLike) | ReactElementLike;
|
|
6
6
|
props: unknown;
|
|
7
7
|
$$typeof?: symbol;
|
|
8
8
|
};
|
package/dist/jsx/jsx.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { N as Node } from '../types-
|
|
2
|
+
import { N as Node } from '../types-COELemna.js';
|
|
3
3
|
|
|
4
4
|
type ReactElementLike = {
|
|
5
|
-
type: string | ((props: unknown) => ReactElementLike) | ReactElementLike;
|
|
5
|
+
type: string | symbol | ((props: unknown) => ReactElementLike) | ReactElementLike;
|
|
6
6
|
props: unknown;
|
|
7
7
|
$$typeof?: symbol;
|
|
8
8
|
};
|
package/dist/jsx/jsx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function f(t
|
|
1
|
+
function f(e,t){t&&Object.keys(t).length>0&&(e.style=t)}function l(e){let t={type:"container",children:e.children};return f(t,e.style),t}function u(e,t){let r={type:"text",text:e};return f(r,t),r}function m(e){let t={type:"image",src:e.src};return f(t,e.style),t}function y(e){return{percentage:e}}function n(e){return{em:e}}function S(e,t,r,o=1){return[e,t,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:S(255,255,0),color:0},big:{fontSize:n(1.2)},small:{fontSize:n(1/1.2)}};function d(e,t){return e.type===t&&"props"in e}function b(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function i(e){return typeof e=="object"&&e!==null&&"type"in e}function c(e){return typeof e=="function"}var L=Symbol.for("react.forward_ref"),O=Symbol.for("react.memo"),$=Symbol.for("react.fragment");function E(e){return e.$$typeof===L}function P(e){return e.$$typeof===O}function R(e){return e.type===$}function W(e){return typeof e=="string"||typeof e=="number"}function x(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function F(e){return Object.keys(e).map(t=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}:${String(e[t]).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 I(e,t){if(e==="children"||t==null)return;let r;if(e==="className"?r="class":z.includes(e)?r=b(e):r=e,typeof t=="boolean")return`${r}="${String(t)}"`;if(e==="style"&&typeof t=="object"){let o=F(t);if(o)return`style="${x(o)}"`}return`${r}="${x(String(t))}"`}function j(e){return Object.entries(e).map(([t,r])=>I(t,r)).filter(t=>t!==void 0)}var M=(e,t)=>{let r=e.props||{};if(c(e.type))return p(e.type(e.props));if(typeof e.type=="symbol"||typeof e.type!="string")return"";let o=j(r),a=r.children,h=Array.isArray(a)?a.map(A=>t(A)).join(""):t(a);return`<${e.type}${o.length>0?` ${o.join(" ")}`:""}>${h}</${e.type}>`},p=e=>e==null||e===!1?"":W(e)?String(e):Array.isArray(e)?e.map(p).join(""):i(e)?M(e,p):"";function w(e){let t=e.props||{};if(!("xmlns"in t)){let r={...e,props:{...t,xmlns:"http://www.w3.org/2000/svg"}};return p(r)||""}return p(e)||""}async function te(e){let t=await s(e);return t.length===0?l({}):t.length===1&&t[0]!==void 0?t[0]:l({children:t,style:{width:y(100),height:y(100)}})}async function s(e){if(e==null)return[];if(e instanceof Promise)return s(await e);if(typeof e=="object"&&Symbol.iterator in e)return V(e);if(i(e)){let t=await T(e);return Array.isArray(t)?t:t?[t]:[]}return[u(String(e))]}function X(e){if(!(typeof e.type!="object"||e.type===null)){if(E(e.type)&&"render"in e.type){let t=e.type;return s(t.render(e.props,null))}if(P(e.type)&&"type"in e.type){let r=e.type.type;if(c(r))return s(r(e.props));let o={...e,type:r};return T(o)}}}function v(e){if(!i(e))return Promise.resolve(void 0);let t=typeof e.props=="object"&&e.props!==null&&"children"in e.props?e.props.children:void 0;return typeof t=="string"?Promise.resolve(t):typeof t=="number"?Promise.resolve(String(t)):Array.isArray(t)?Promise.resolve(C(t)):typeof t=="object"&&t!==null&&Symbol.iterator in t?Promise.resolve(C(Array.from(t))):i(t)&&R(t)?v(t):Promise.resolve(void 0)}function C(e){if(!e.some(t=>i(t)))return e.map(t=>typeof t=="string"?t:typeof t=="number"?String(t):"").join("")}async function T(e){if(c(e.type))return s(e.type(e.props));let t=X(e);if(t!==void 0)return t;if(R(e))return await N(e)||[];if(d(e,"img"))return[J(e)];if(d(e,"svg"))return[_(e)];let r=k(e.props);typeof e.type=="string"&&e.type in g&&Object.assign(r,g[e.type]);let o=await v(e);if(o!==void 0)return[u(o,r)];let a=await N(e);return[l({children:a,style:r})]}function J(e){if(!e.props.src)throw new Error("Image element must have a 'src' prop.");let t=k(e.props);return m({src:e.props.src,style:t})}function _(e){let t=k(e.props),r=w(e);return m({style:t,src:r})}var H={WebkitTextStroke:"textStroke",WebkitTextStrokeWidth:"textStrokeWidth",WebkitTextStrokeColor:"textStrokeColor"};function k(e){if(typeof e!="object"||e===null)return{};let t="style"in e&&typeof e.style=="object"&&e.style!==null?e.style:{};if(Object.keys(t).length>0)for(let[r,o]of Object.entries(H))r in t&&(t[o]=t[r],delete t[r]);return t}function N(e){return typeof e.props!="object"||e.props===null||!("children"in e.props)?Promise.resolve([]):s(e.props.children)}function V(e){return Promise.all(Array.from(e).map(s)).then(t=>t.flat())}export{te as fromJsx};
|
|
@@ -23,27 +23,27 @@ type Color = [number, number, number] | [number, number, number, number] | numbe
|
|
|
23
23
|
* or the 'auto' keyword for automatic sizing.
|
|
24
24
|
*/
|
|
25
25
|
type LengthUnit = "auto" | {
|
|
26
|
-
|
|
26
|
+
percentage: number;
|
|
27
27
|
} | {
|
|
28
|
-
|
|
28
|
+
rem: number;
|
|
29
29
|
} | {
|
|
30
|
-
|
|
30
|
+
em: number;
|
|
31
31
|
} | {
|
|
32
|
-
|
|
32
|
+
vh: number;
|
|
33
33
|
} | {
|
|
34
|
-
|
|
34
|
+
vw: number;
|
|
35
35
|
} | {
|
|
36
|
-
|
|
36
|
+
cm: number;
|
|
37
37
|
} | {
|
|
38
|
-
|
|
38
|
+
mm: number;
|
|
39
39
|
} | {
|
|
40
|
-
|
|
40
|
+
in: number;
|
|
41
41
|
} | {
|
|
42
|
-
|
|
42
|
+
Q: number;
|
|
43
43
|
} | {
|
|
44
|
-
|
|
44
|
+
Pt: number;
|
|
45
45
|
} | {
|
|
46
|
-
|
|
46
|
+
Pc: number;
|
|
47
47
|
} | number | string;
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -172,7 +172,7 @@ type PositionComponent = {
|
|
|
172
172
|
} | {
|
|
173
173
|
"keyword-y": PositionKeywordY;
|
|
174
174
|
} | {
|
|
175
|
-
|
|
175
|
+
length: LengthUnit;
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
/**
|
|
@@ -213,7 +213,7 @@ type BackgroundRepeats = Array<BackgroundRepeat> | string;
|
|
|
213
213
|
* Parsed `background-size` for one layer.
|
|
214
214
|
*/
|
|
215
215
|
type BackgroundSize = "Cover" | "Contain" | {
|
|
216
|
-
|
|
216
|
+
Explicit: {
|
|
217
217
|
/**
|
|
218
218
|
* Width value for the background image.
|
|
219
219
|
*/
|
|
@@ -230,6 +230,20 @@ type BackgroundSize = "Cover" | "Contain" | {
|
|
|
230
230
|
*/
|
|
231
231
|
type BackgroundSizes = Array<BackgroundSize> | string;
|
|
232
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Represents border style options (currently only solid is supported).
|
|
235
|
+
*/
|
|
236
|
+
type BorderStyle = "solid";
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Parsed `border` value.
|
|
240
|
+
*/
|
|
241
|
+
type Border = {
|
|
242
|
+
width: LengthUnit | null;
|
|
243
|
+
style: BorderStyle | null;
|
|
244
|
+
color: Color | null;
|
|
245
|
+
} | string;
|
|
246
|
+
|
|
233
247
|
/**
|
|
234
248
|
* Represents a box shadow with all its properties.
|
|
235
249
|
*
|
|
@@ -351,7 +365,7 @@ type GridAutoFlow = "row" | "column" | "row dense" | "column dense";
|
|
|
351
365
|
* Represents a grid placement with serde support
|
|
352
366
|
*/
|
|
353
367
|
type GridPlacement = "auto" | {
|
|
354
|
-
|
|
368
|
+
span: number;
|
|
355
369
|
} | number | string;
|
|
356
370
|
|
|
357
371
|
/**
|
|
@@ -380,7 +394,7 @@ type GridTemplateAreas = Array<Array<string>> | string;
|
|
|
380
394
|
* Represents a grid track sizing function with serde support
|
|
381
395
|
*/
|
|
382
396
|
type GridLengthUnit = {
|
|
383
|
-
|
|
397
|
+
fr: number;
|
|
384
398
|
} | LengthUnit | string;
|
|
385
399
|
|
|
386
400
|
/**
|
|
@@ -493,6 +507,30 @@ type Sides<T> = string | [T, T, T, T] | [T, T] | T;
|
|
|
493
507
|
*/
|
|
494
508
|
type TextAlign = "left" | "right" | "center" | "justify" | "start" | "end";
|
|
495
509
|
|
|
510
|
+
/**
|
|
511
|
+
* Represents text decoration line options.
|
|
512
|
+
*/
|
|
513
|
+
type TextDecorationLine = "underline" | "line-through" | "overline";
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Represents a collection of text decoration lines.
|
|
517
|
+
*/
|
|
518
|
+
type TextDecorationLines = Array<TextDecorationLine> | string;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Represents text decoration style options (currently only solid is supported).
|
|
522
|
+
*/
|
|
523
|
+
type TextDecorationStyle = "solid";
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Parsed `text-decoration` value.
|
|
527
|
+
*/
|
|
528
|
+
type TextDecoration = {
|
|
529
|
+
line: TextDecorationLines;
|
|
530
|
+
style: TextDecorationStyle | null;
|
|
531
|
+
color: Color | null;
|
|
532
|
+
} | string;
|
|
533
|
+
|
|
496
534
|
/**
|
|
497
535
|
* Defines how text should be overflowed.
|
|
498
536
|
*
|
|
@@ -576,15 +614,15 @@ type Affine = {
|
|
|
576
614
|
* Represents a single CSS transform operation
|
|
577
615
|
*/
|
|
578
616
|
type Transform = {
|
|
579
|
-
|
|
617
|
+
translate: [LengthUnit, LengthUnit];
|
|
580
618
|
} | {
|
|
581
|
-
|
|
619
|
+
scale: [number, number];
|
|
582
620
|
} | {
|
|
583
|
-
|
|
621
|
+
rotate: Angle;
|
|
584
622
|
} | {
|
|
585
|
-
|
|
623
|
+
skew: [Angle, Angle];
|
|
586
624
|
} | {
|
|
587
|
-
|
|
625
|
+
matrix: Affine;
|
|
588
626
|
};
|
|
589
627
|
|
|
590
628
|
/**
|
|
@@ -651,12 +689,14 @@ type Style = {
|
|
|
651
689
|
borderTopRightRadius: CssValue<LengthUnit | null>;
|
|
652
690
|
borderBottomRightRadius: CssValue<LengthUnit | null>;
|
|
653
691
|
borderBottomLeftRadius: CssValue<LengthUnit | null>;
|
|
654
|
-
borderWidth: CssValue<Sides<LengthUnit
|
|
692
|
+
borderWidth: CssValue<Sides<LengthUnit> | null>;
|
|
655
693
|
borderTopWidth: CssValue<LengthUnit | null>;
|
|
656
694
|
borderRightWidth: CssValue<LengthUnit | null>;
|
|
657
695
|
borderBottomWidth: CssValue<LengthUnit | null>;
|
|
658
696
|
borderLeftWidth: CssValue<LengthUnit | null>;
|
|
697
|
+
border: CssValue<Border>;
|
|
659
698
|
objectFit: CssValue<ObjectFit>;
|
|
699
|
+
objectPosition: CssValue<BackgroundPosition>;
|
|
660
700
|
backgroundImage: CssValue<BackgroundImages | null>;
|
|
661
701
|
backgroundPosition: CssValue<BackgroundPositions | null>;
|
|
662
702
|
backgroundSize: CssValue<BackgroundSizes | null>;
|
|
@@ -674,7 +714,7 @@ type Style = {
|
|
|
674
714
|
textOverflow: CssValue<TextOverflow>;
|
|
675
715
|
textTransform: CssValue<TextTransform>;
|
|
676
716
|
fontStyle: CssValue<FontStyle>;
|
|
677
|
-
borderColor: CssValue<Color>;
|
|
717
|
+
borderColor: CssValue<Color | null>;
|
|
678
718
|
color: CssValue<Color>;
|
|
679
719
|
fontSize: CssValue<LengthUnit>;
|
|
680
720
|
fontFamily: CssValue<FontFamily | null>;
|
|
@@ -688,6 +728,9 @@ type Style = {
|
|
|
688
728
|
textStrokeColor: CssValue<Color | null>;
|
|
689
729
|
textStroke: CssValue<TextStroke | null>;
|
|
690
730
|
textShadow: CssValue<TextShadows | null>;
|
|
731
|
+
textDecoration: CssValue<TextDecoration>;
|
|
732
|
+
textDecorationLine: CssValue<TextDecorationLines | null>;
|
|
733
|
+
textDecorationColor: CssValue<Color | null>;
|
|
691
734
|
letterSpacing: CssValue<LengthUnit | null>;
|
|
692
735
|
wordSpacing: CssValue<LengthUnit | null>;
|
|
693
736
|
imageRendering: CssValue<ImageScalingAlgorithm>;
|
|
@@ -23,27 +23,27 @@ type Color = [number, number, number] | [number, number, number, number] | numbe
|
|
|
23
23
|
* or the 'auto' keyword for automatic sizing.
|
|
24
24
|
*/
|
|
25
25
|
type LengthUnit = "auto" | {
|
|
26
|
-
|
|
26
|
+
percentage: number;
|
|
27
27
|
} | {
|
|
28
|
-
|
|
28
|
+
rem: number;
|
|
29
29
|
} | {
|
|
30
|
-
|
|
30
|
+
em: number;
|
|
31
31
|
} | {
|
|
32
|
-
|
|
32
|
+
vh: number;
|
|
33
33
|
} | {
|
|
34
|
-
|
|
34
|
+
vw: number;
|
|
35
35
|
} | {
|
|
36
|
-
|
|
36
|
+
cm: number;
|
|
37
37
|
} | {
|
|
38
|
-
|
|
38
|
+
mm: number;
|
|
39
39
|
} | {
|
|
40
|
-
|
|
40
|
+
in: number;
|
|
41
41
|
} | {
|
|
42
|
-
|
|
42
|
+
Q: number;
|
|
43
43
|
} | {
|
|
44
|
-
|
|
44
|
+
Pt: number;
|
|
45
45
|
} | {
|
|
46
|
-
|
|
46
|
+
Pc: number;
|
|
47
47
|
} | number | string;
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -172,7 +172,7 @@ type PositionComponent = {
|
|
|
172
172
|
} | {
|
|
173
173
|
"keyword-y": PositionKeywordY;
|
|
174
174
|
} | {
|
|
175
|
-
|
|
175
|
+
length: LengthUnit;
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
/**
|
|
@@ -213,7 +213,7 @@ type BackgroundRepeats = Array<BackgroundRepeat> | string;
|
|
|
213
213
|
* Parsed `background-size` for one layer.
|
|
214
214
|
*/
|
|
215
215
|
type BackgroundSize = "Cover" | "Contain" | {
|
|
216
|
-
|
|
216
|
+
Explicit: {
|
|
217
217
|
/**
|
|
218
218
|
* Width value for the background image.
|
|
219
219
|
*/
|
|
@@ -230,6 +230,20 @@ type BackgroundSize = "Cover" | "Contain" | {
|
|
|
230
230
|
*/
|
|
231
231
|
type BackgroundSizes = Array<BackgroundSize> | string;
|
|
232
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Represents border style options (currently only solid is supported).
|
|
235
|
+
*/
|
|
236
|
+
type BorderStyle = "solid";
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Parsed `border` value.
|
|
240
|
+
*/
|
|
241
|
+
type Border = {
|
|
242
|
+
width: LengthUnit | null;
|
|
243
|
+
style: BorderStyle | null;
|
|
244
|
+
color: Color | null;
|
|
245
|
+
} | string;
|
|
246
|
+
|
|
233
247
|
/**
|
|
234
248
|
* Represents a box shadow with all its properties.
|
|
235
249
|
*
|
|
@@ -351,7 +365,7 @@ type GridAutoFlow = "row" | "column" | "row dense" | "column dense";
|
|
|
351
365
|
* Represents a grid placement with serde support
|
|
352
366
|
*/
|
|
353
367
|
type GridPlacement = "auto" | {
|
|
354
|
-
|
|
368
|
+
span: number;
|
|
355
369
|
} | number | string;
|
|
356
370
|
|
|
357
371
|
/**
|
|
@@ -380,7 +394,7 @@ type GridTemplateAreas = Array<Array<string>> | string;
|
|
|
380
394
|
* Represents a grid track sizing function with serde support
|
|
381
395
|
*/
|
|
382
396
|
type GridLengthUnit = {
|
|
383
|
-
|
|
397
|
+
fr: number;
|
|
384
398
|
} | LengthUnit | string;
|
|
385
399
|
|
|
386
400
|
/**
|
|
@@ -493,6 +507,30 @@ type Sides<T> = string | [T, T, T, T] | [T, T] | T;
|
|
|
493
507
|
*/
|
|
494
508
|
type TextAlign = "left" | "right" | "center" | "justify" | "start" | "end";
|
|
495
509
|
|
|
510
|
+
/**
|
|
511
|
+
* Represents text decoration line options.
|
|
512
|
+
*/
|
|
513
|
+
type TextDecorationLine = "underline" | "line-through" | "overline";
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Represents a collection of text decoration lines.
|
|
517
|
+
*/
|
|
518
|
+
type TextDecorationLines = Array<TextDecorationLine> | string;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Represents text decoration style options (currently only solid is supported).
|
|
522
|
+
*/
|
|
523
|
+
type TextDecorationStyle = "solid";
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Parsed `text-decoration` value.
|
|
527
|
+
*/
|
|
528
|
+
type TextDecoration = {
|
|
529
|
+
line: TextDecorationLines;
|
|
530
|
+
style: TextDecorationStyle | null;
|
|
531
|
+
color: Color | null;
|
|
532
|
+
} | string;
|
|
533
|
+
|
|
496
534
|
/**
|
|
497
535
|
* Defines how text should be overflowed.
|
|
498
536
|
*
|
|
@@ -576,15 +614,15 @@ type Affine = {
|
|
|
576
614
|
* Represents a single CSS transform operation
|
|
577
615
|
*/
|
|
578
616
|
type Transform = {
|
|
579
|
-
|
|
617
|
+
translate: [LengthUnit, LengthUnit];
|
|
580
618
|
} | {
|
|
581
|
-
|
|
619
|
+
scale: [number, number];
|
|
582
620
|
} | {
|
|
583
|
-
|
|
621
|
+
rotate: Angle;
|
|
584
622
|
} | {
|
|
585
|
-
|
|
623
|
+
skew: [Angle, Angle];
|
|
586
624
|
} | {
|
|
587
|
-
|
|
625
|
+
matrix: Affine;
|
|
588
626
|
};
|
|
589
627
|
|
|
590
628
|
/**
|
|
@@ -651,12 +689,14 @@ type Style = {
|
|
|
651
689
|
borderTopRightRadius: CssValue<LengthUnit | null>;
|
|
652
690
|
borderBottomRightRadius: CssValue<LengthUnit | null>;
|
|
653
691
|
borderBottomLeftRadius: CssValue<LengthUnit | null>;
|
|
654
|
-
borderWidth: CssValue<Sides<LengthUnit
|
|
692
|
+
borderWidth: CssValue<Sides<LengthUnit> | null>;
|
|
655
693
|
borderTopWidth: CssValue<LengthUnit | null>;
|
|
656
694
|
borderRightWidth: CssValue<LengthUnit | null>;
|
|
657
695
|
borderBottomWidth: CssValue<LengthUnit | null>;
|
|
658
696
|
borderLeftWidth: CssValue<LengthUnit | null>;
|
|
697
|
+
border: CssValue<Border>;
|
|
659
698
|
objectFit: CssValue<ObjectFit>;
|
|
699
|
+
objectPosition: CssValue<BackgroundPosition>;
|
|
660
700
|
backgroundImage: CssValue<BackgroundImages | null>;
|
|
661
701
|
backgroundPosition: CssValue<BackgroundPositions | null>;
|
|
662
702
|
backgroundSize: CssValue<BackgroundSizes | null>;
|
|
@@ -674,7 +714,7 @@ type Style = {
|
|
|
674
714
|
textOverflow: CssValue<TextOverflow>;
|
|
675
715
|
textTransform: CssValue<TextTransform>;
|
|
676
716
|
fontStyle: CssValue<FontStyle>;
|
|
677
|
-
borderColor: CssValue<Color>;
|
|
717
|
+
borderColor: CssValue<Color | null>;
|
|
678
718
|
color: CssValue<Color>;
|
|
679
719
|
fontSize: CssValue<LengthUnit>;
|
|
680
720
|
fontFamily: CssValue<FontFamily | null>;
|
|
@@ -688,6 +728,9 @@ type Style = {
|
|
|
688
728
|
textStrokeColor: CssValue<Color | null>;
|
|
689
729
|
textStroke: CssValue<TextStroke | null>;
|
|
690
730
|
textShadow: CssValue<TextShadows | null>;
|
|
731
|
+
textDecoration: CssValue<TextDecoration>;
|
|
732
|
+
textDecorationLine: CssValue<TextDecorationLines | null>;
|
|
733
|
+
textDecorationColor: CssValue<Color | null>;
|
|
691
734
|
letterSpacing: CssValue<LengthUnit | null>;
|
|
692
735
|
wordSpacing: CssValue<LengthUnit | null>;
|
|
693
736
|
imageRendering: CssValue<ImageScalingAlgorithm>;
|