modern-idoc 0.5.1 → 0.5.2

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
@@ -303,6 +303,7 @@ function getDefaultElementStyle() {
303
303
  ...getDefaultShadowStyle(),
304
304
  // background
305
305
  backgroundImage: "none",
306
+ backgroundSize: "auto, auto",
306
307
  backgroundColor: "none",
307
308
  // border
308
309
  borderRadius: 0,
package/dist/index.d.cts CHANGED
@@ -377,8 +377,10 @@ interface TransformStyleDeclaration {
377
377
  }
378
378
  declare function getDefaultTransformStyle(): TransformStyleDeclaration;
379
379
 
380
+ type BackgroundSize = 'contain' | 'cover' | string | 'stretch' | 'rigid';
380
381
  type ElementStyleDeclaration = Partial<LayoutStyleDeclaration> & TransformStyleDeclaration & ShadowStyleDeclaration & {
381
382
  backgroundImage: None | string;
383
+ backgroundSize: BackgroundSize;
382
384
  backgroundColor: None | ColorDeclaration;
383
385
  borderRadius: number;
384
386
  borderColor: None | ColorDeclaration;
@@ -543,4 +545,4 @@ declare function normalizeDocument(doc: Document): DocumentDeclaration;
543
545
 
544
546
  declare function clearUndef<T>(obj: T, deep?: boolean): T;
545
547
 
546
- export { type Align, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BackgroundPropertyObject, type BaseBackgroundDeclaration, type BaseForegroundDeclaration, type BaseOuterShadowDeclaration, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type Color, type ColorDeclaration, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type EffectPropertyObject, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillPropertyObject, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type ForegroundPropertyObject, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HeadEnd, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type InnerShadowDeclaration, type InnerShadowProperty, type InnerShadowPropertyObject, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type LineEndSize, type LineEndType, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OuterShadowDeclaration, type OuterShadowProperty, type OuterShadowPropertyObject, type OutlineDeclaration, type OutlineFillDeclaration, type OutlineProperty, type OutlinePropertyObject, type OutlineStyle, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbString, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowPropertyObject, type ShadowStyleDeclaration, type SoftEdgeDeclaration, type SoftEdgeProperty, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StylePropertyObject, type StyleUnit, type TailEnd, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type Uint32Color, type VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeColor, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor };
548
+ export { type Align, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BackgroundPropertyObject, type BackgroundSize, type BaseBackgroundDeclaration, type BaseForegroundDeclaration, type BaseOuterShadowDeclaration, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type Color, type ColorDeclaration, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type EffectPropertyObject, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillPropertyObject, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type ForegroundPropertyObject, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HeadEnd, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type InnerShadowDeclaration, type InnerShadowProperty, type InnerShadowPropertyObject, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type LineEndSize, type LineEndType, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OuterShadowDeclaration, type OuterShadowProperty, type OuterShadowPropertyObject, type OutlineDeclaration, type OutlineFillDeclaration, type OutlineProperty, type OutlinePropertyObject, type OutlineStyle, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbString, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowPropertyObject, type ShadowStyleDeclaration, type SoftEdgeDeclaration, type SoftEdgeProperty, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StylePropertyObject, type StyleUnit, type TailEnd, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type Uint32Color, type VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeColor, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor };
package/dist/index.d.mts CHANGED
@@ -377,8 +377,10 @@ interface TransformStyleDeclaration {
377
377
  }
378
378
  declare function getDefaultTransformStyle(): TransformStyleDeclaration;
379
379
 
380
+ type BackgroundSize = 'contain' | 'cover' | string | 'stretch' | 'rigid';
380
381
  type ElementStyleDeclaration = Partial<LayoutStyleDeclaration> & TransformStyleDeclaration & ShadowStyleDeclaration & {
381
382
  backgroundImage: None | string;
383
+ backgroundSize: BackgroundSize;
382
384
  backgroundColor: None | ColorDeclaration;
383
385
  borderRadius: number;
384
386
  borderColor: None | ColorDeclaration;
@@ -543,4 +545,4 @@ declare function normalizeDocument(doc: Document): DocumentDeclaration;
543
545
 
544
546
  declare function clearUndef<T>(obj: T, deep?: boolean): T;
545
547
 
546
- export { type Align, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BackgroundPropertyObject, type BaseBackgroundDeclaration, type BaseForegroundDeclaration, type BaseOuterShadowDeclaration, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type Color, type ColorDeclaration, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type EffectPropertyObject, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillPropertyObject, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type ForegroundPropertyObject, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HeadEnd, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type InnerShadowDeclaration, type InnerShadowProperty, type InnerShadowPropertyObject, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type LineEndSize, type LineEndType, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OuterShadowDeclaration, type OuterShadowProperty, type OuterShadowPropertyObject, type OutlineDeclaration, type OutlineFillDeclaration, type OutlineProperty, type OutlinePropertyObject, type OutlineStyle, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbString, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowPropertyObject, type ShadowStyleDeclaration, type SoftEdgeDeclaration, type SoftEdgeProperty, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StylePropertyObject, type StyleUnit, type TailEnd, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type Uint32Color, type VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeColor, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor };
548
+ export { type Align, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BackgroundPropertyObject, type BackgroundSize, type BaseBackgroundDeclaration, type BaseForegroundDeclaration, type BaseOuterShadowDeclaration, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type Color, type ColorDeclaration, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type EffectPropertyObject, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillPropertyObject, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type ForegroundPropertyObject, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HeadEnd, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type InnerShadowDeclaration, type InnerShadowProperty, type InnerShadowPropertyObject, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type LineEndSize, type LineEndType, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OuterShadowDeclaration, type OuterShadowProperty, type OuterShadowPropertyObject, type OutlineDeclaration, type OutlineFillDeclaration, type OutlineProperty, type OutlinePropertyObject, type OutlineStyle, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbString, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowPropertyObject, type ShadowStyleDeclaration, type SoftEdgeDeclaration, type SoftEdgeProperty, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StylePropertyObject, type StyleUnit, type TailEnd, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type Uint32Color, type VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeColor, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor };
package/dist/index.d.ts CHANGED
@@ -377,8 +377,10 @@ interface TransformStyleDeclaration {
377
377
  }
378
378
  declare function getDefaultTransformStyle(): TransformStyleDeclaration;
379
379
 
380
+ type BackgroundSize = 'contain' | 'cover' | string | 'stretch' | 'rigid';
380
381
  type ElementStyleDeclaration = Partial<LayoutStyleDeclaration> & TransformStyleDeclaration & ShadowStyleDeclaration & {
381
382
  backgroundImage: None | string;
383
+ backgroundSize: BackgroundSize;
382
384
  backgroundColor: None | ColorDeclaration;
383
385
  borderRadius: number;
384
386
  borderColor: None | ColorDeclaration;
@@ -543,4 +545,4 @@ declare function normalizeDocument(doc: Document): DocumentDeclaration;
543
545
 
544
546
  declare function clearUndef<T>(obj: T, deep?: boolean): T;
545
547
 
546
- export { type Align, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BackgroundPropertyObject, type BaseBackgroundDeclaration, type BaseForegroundDeclaration, type BaseOuterShadowDeclaration, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type Color, type ColorDeclaration, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type EffectPropertyObject, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillPropertyObject, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type ForegroundPropertyObject, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HeadEnd, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type InnerShadowDeclaration, type InnerShadowProperty, type InnerShadowPropertyObject, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type LineEndSize, type LineEndType, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OuterShadowDeclaration, type OuterShadowProperty, type OuterShadowPropertyObject, type OutlineDeclaration, type OutlineFillDeclaration, type OutlineProperty, type OutlinePropertyObject, type OutlineStyle, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbString, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowPropertyObject, type ShadowStyleDeclaration, type SoftEdgeDeclaration, type SoftEdgeProperty, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StylePropertyObject, type StyleUnit, type TailEnd, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type Uint32Color, type VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeColor, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor };
548
+ export { type Align, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BackgroundPropertyObject, type BackgroundSize, type BaseBackgroundDeclaration, type BaseForegroundDeclaration, type BaseOuterShadowDeclaration, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type Color, type ColorDeclaration, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type EffectPropertyObject, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillPropertyObject, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type ForegroundPropertyObject, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HeadEnd, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type InnerShadowDeclaration, type InnerShadowProperty, type InnerShadowPropertyObject, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type LineEndSize, type LineEndType, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OuterShadowDeclaration, type OuterShadowProperty, type OuterShadowPropertyObject, type OutlineDeclaration, type OutlineFillDeclaration, type OutlineProperty, type OutlinePropertyObject, type OutlineStyle, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbString, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowPropertyObject, type ShadowStyleDeclaration, type SoftEdgeDeclaration, type SoftEdgeProperty, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StylePropertyObject, type StyleUnit, type TailEnd, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type Uint32Color, type VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeColor, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(i,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(i=typeof globalThis<"u"?globalThis:i||self,v(i.modernIdoc={}))})(this,function(i){"use strict";function v(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:n}var ln={grad:.9,turn:360,rad:360/(2*Math.PI)},c=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},l=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*n)/e+0},s=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),n>e?e:n>t?n:t},A=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},H=function(n){return{r:s(n.r,0,255),g:s(n.g,0,255),b:s(n.b,0,255),a:s(n.a)}},S=function(n){return{r:l(n.r),g:l(n.g),b:l(n.b),a:l(n.a,3)}},fn=/^#([0-9a-f]{3,8})$/i,y=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},E=function(n){var t=n.r,e=n.g,r=n.b,o=n.a,u=Math.max(t,e,r),a=u-Math.min(t,e,r),d=a?u===t?(e-r)/a:u===e?2+(r-t)/a:4+(t-e)/a:0;return{h:60*(d<0?d+6:d),s:u?a/u*100:0,v:u/255*100,a:o}},L=function(n){var t=n.h,e=n.s,r=n.v,o=n.a;t=t/360*6,e/=100,r/=100;var u=Math.floor(t),a=r*(1-e),d=r*(1-(t-u)*e),T=r*(1-(1-t+u)*e),k=u%6;return{r:255*[r,d,a,a,T,r][k],g:255*[T,r,r,d,a,a][k],b:255*[a,a,T,r,r,d][k],a:o}},O=function(n){return{h:A(n.h),s:s(n.s,0,100),l:s(n.l,0,100),a:s(n.a)}},M=function(n){return{h:l(n.h),s:l(n.s),l:l(n.l),a:l(n.a,3)}},R=function(n){return L((e=(t=n).s,{h:t.h,s:(e*=((r=t.l)<50?r:100-r)/100)>0?2*e/(r+e)*100:0,v:r+e,a:t.a}));var t,e,r},b=function(n){return{h:(t=E(n)).h,s:(o=(200-(e=t.s))*(r=t.v)/100)>0&&o<200?e*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,e,r,o},sn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,W={string:[[function(n){var t=fn.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?l(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?l(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=gn.exec(n)||cn.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:H({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(n){var t=sn.exec(n)||dn.exec(n);if(!t)return null;var e,r,o=O({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(ln[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return R(o)},"hsl"]],object:[[function(n){var t=n.r,e=n.g,r=n.b,o=n.a,u=o===void 0?1:o;return c(t)&&c(e)&&c(r)?H({r:Number(t),g:Number(e),b:Number(r),a:Number(u)}):null},"rgb"],[function(n){var t=n.h,e=n.s,r=n.l,o=n.a,u=o===void 0?1:o;if(!c(t)||!c(e)||!c(r))return null;var a=O({h:Number(t),s:Number(e),l:Number(r),a:Number(u)});return R(a)},"hsl"],[function(n){var t=n.h,e=n.s,r=n.v,o=n.a,u=o===void 0?1:o;if(!c(t)||!c(e)||!c(r))return null;var a=function(d){return{h:A(d.h),s:s(d.s,0,100),v:s(d.v,0,100),a:s(d.a)}}({h:Number(t),s:Number(e),v:Number(r),a:Number(u)});return L(a)},"hsv"]]},F=function(n,t){for(var e=0;e<t.length;e++){var r=t[e][0](n);if(r)return[r,t[e][1]]}return[null,void 0]},hn=function(n){return typeof n=="string"?F(n.trim(),W.string):typeof n=="object"&&n!==null?F(n,W.object):[null,void 0]},z=function(n,t){var e=b(n);return{h:e.h,s:s(e.s+100*t,0,100),l:e.l,a:e.a}},D=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},$=function(n,t){var e=b(n);return{h:e.h,s:e.s,l:s(e.l+100*t,0,100),a:e.a}},x=function(){function n(t){this.parsed=hn(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return l(D(this.rgba),2)},n.prototype.isDark=function(){return D(this.rgba)<.5},n.prototype.isLight=function(){return D(this.rgba)>=.5},n.prototype.toHex=function(){return t=S(this.rgba),e=t.r,r=t.g,o=t.b,a=(u=t.a)<1?y(l(255*u)):"","#"+y(e)+y(r)+y(o)+a;var t,e,r,o,u,a},n.prototype.toRgb=function(){return S(this.rgba)},n.prototype.toRgbString=function(){return t=S(this.rgba),e=t.r,r=t.g,o=t.b,(u=t.a)<1?"rgba("+e+", "+r+", "+o+", "+u+")":"rgb("+e+", "+r+", "+o+")";var t,e,r,o,u},n.prototype.toHsl=function(){return M(b(this.rgba))},n.prototype.toHslString=function(){return t=M(b(this.rgba)),e=t.h,r=t.s,o=t.l,(u=t.a)<1?"hsla("+e+", "+r+"%, "+o+"%, "+u+")":"hsl("+e+", "+r+"%, "+o+"%)";var t,e,r,o,u},n.prototype.toHsv=function(){return t=E(this.rgba),{h:l(t.h),s:l(t.s),v:l(t.v),a:l(t.a,3)};var t},n.prototype.invert=function(){return g({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),g(z(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),g(z(this.rgba,-t))},n.prototype.grayscale=function(){return g(z(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),g($(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),g($(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?g({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):l(this.rgba.a,3);var e},n.prototype.hue=function(t){var e=b(this.rgba);return typeof t=="number"?g({h:t,s:e.s,l:e.l,a:e.a}):l(e.h)},n.prototype.isEqual=function(t){return this.toHex()===g(t).toHex()},n}(),g=function(n){return n instanceof x?n:new x(n)};function B(n){let t;return typeof n=="number"?t={r:n>>24&255,g:n>>16&255,b:n>>8&255,a:(n&255)/255}:t=n,g(t)}function f(n,t=!1){if(n===void 0||n==="none")return;const e=B(n);if(!e.isValid()){const r=`Failed to normalizeColor ${n}`;if(t)throw new Error(r);return console.warn(r),"rgb(0, 0, 0)"}return e.toRgbString()}function p(n){if(!(!n||n==="none"))return typeof n=="string"?{color:f(n)}:{...n,color:f(n.color)}}function X(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:{...n,...p(n)}}function h(n,t=!1){if(typeof n!="object"||!n)return n;if(Array.isArray(n))return t?n.map(r=>h(r,t)):n;const e={};for(const r in n){const o=n[r];o!=null&&(t?e[r]=h(o,t):e[r]=o)}return e}function w(){return{color:"rgb(0, 0, 0)",offsetX:0,offsetY:0,blurRadius:1}}function C(n){if(!(!n||n==="none"))return{...w(),...h({...n,color:f(n.color)})}}function Y(){return{...w(),scaleX:1,scaleY:1}}function V(n){if(!(!n||n==="none"))return{...Y(),...C(n)}}function G(n){if(!(!n||n==="none"))return n}function P(n){if(!(!n||n==="none"))return h({...n,softEdge:G(n.softEdge),outerShadow:V(n.outerShadow),innerShadow:C(n.innerShadow)})}function j(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:{...n,...p(n)}}function U(n){if(!(!n||n==="none"))return typeof n=="string"?{paths:[{data:n}]}:Array.isArray(n)?{paths:n.map(t=>typeof t=="string"?{data:t}:t)}:n}function q(n){if(!(!n||n==="none"))return typeof n=="string"?{color:f(n)}:{...n,color:f(n.color)}}function K(n){if(!(!n||n==="none"))return typeof n=="string"?{color:f(n)}:{...n,color:f(n.color)}}function J(){return{boxShadow:"none"}}function Q(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function Z(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function _(){return{...Q(),...Z(),...J(),backgroundImage:"none",backgroundColor:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function nn(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function tn(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function en(){return{...nn(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function rn(){return{...tn(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function on(){return{...rn(),...en(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function m(n){if(!(!n||n==="none"))return h({...n,color:f(n.color),backgroundColor:f(n.backgroundColor),borderColor:f(n.borderColor),outlineColor:f(n.outlineColor),shadowColor:f(n.shadowColor)})}function vn(){return{..._(),...on()}}function I(n=""){return(Array.isArray(n)?n:[n]).map(e=>typeof e=="string"?{fragments:[{content:e}]}:"content"in e?{fragments:[m(e)]}:"fragments"in e?{...m(e),fragments:e.fragments.map(r=>m(r))}:Array.isArray(e)?{fragments:e.map(r=>typeof r=="string"?{content:r}:m(r))}:{fragments:[]})}function un(n){if(!(!n||n==="none"))return typeof n=="string"?{content:[{fragments:[{content:n}]}]}:"content"in n?{...n,content:I(n.content)}:{content:I(n)}}function an(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:n}function N(n){var t;return h({...n,style:m(n.style),text:un(n.text),background:X(n.background),geometry:U(n.geometry),fill:p(n.fill),outline:q(n.outline),foreground:j(n.foreground),shadow:K(n.shadow),video:an(n.video),audio:v(n.audio),effect:P(n.effect),children:(t=n.children)==null?void 0:t.map(e=>N(e))})}function mn(n){return N(n)}i.clearUndef=h,i.getDefaultElementStyle=_,i.getDefaultHighlightStyle=nn,i.getDefaultInnerShadow=w,i.getDefaultLayoutStyle=Q,i.getDefaultListStyleStyle=tn,i.getDefaultOuterShadow=Y,i.getDefaultShadowStyle=J,i.getDefaultStyle=vn,i.getDefaultTextInlineStyle=en,i.getDefaultTextLineStyle=rn,i.getDefaultTextStyle=on,i.getDefaultTransformStyle=Z,i.normalizeAudio=v,i.normalizeBackground=X,i.normalizeColor=f,i.normalizeDocument=mn,i.normalizeEffect=P,i.normalizeElement=N,i.normalizeFill=p,i.normalizeForeground=j,i.normalizeGeometry=U,i.normalizeInnerShadow=C,i.normalizeOuterShadow=V,i.normalizeOutline=q,i.normalizeShadow=K,i.normalizeSoftEdge=G,i.normalizeStyle=m,i.normalizeText=un,i.normalizeTextContent=I,i.normalizeVideo=an,i.parseColor=B,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
1
+ (function(i,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(i=typeof globalThis<"u"?globalThis:i||self,v(i.modernIdoc={}))})(this,function(i){"use strict";function v(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:n}var ln={grad:.9,turn:360,rad:360/(2*Math.PI)},c=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},l=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*n)/e+0},s=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),n>e?e:n>t?n:t},A=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},H=function(n){return{r:s(n.r,0,255),g:s(n.g,0,255),b:s(n.b,0,255),a:s(n.a)}},S=function(n){return{r:l(n.r),g:l(n.g),b:l(n.b),a:l(n.a,3)}},fn=/^#([0-9a-f]{3,8})$/i,y=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},E=function(n){var t=n.r,e=n.g,r=n.b,o=n.a,u=Math.max(t,e,r),a=u-Math.min(t,e,r),d=a?u===t?(e-r)/a:u===e?2+(r-t)/a:4+(t-e)/a:0;return{h:60*(d<0?d+6:d),s:u?a/u*100:0,v:u/255*100,a:o}},L=function(n){var t=n.h,e=n.s,r=n.v,o=n.a;t=t/360*6,e/=100,r/=100;var u=Math.floor(t),a=r*(1-e),d=r*(1-(t-u)*e),T=r*(1-(1-t+u)*e),k=u%6;return{r:255*[r,d,a,a,T,r][k],g:255*[T,r,r,d,a,a][k],b:255*[a,a,T,r,r,d][k],a:o}},O=function(n){return{h:A(n.h),s:s(n.s,0,100),l:s(n.l,0,100),a:s(n.a)}},M=function(n){return{h:l(n.h),s:l(n.s),l:l(n.l),a:l(n.a,3)}},R=function(n){return L((e=(t=n).s,{h:t.h,s:(e*=((r=t.l)<50?r:100-r)/100)>0?2*e/(r+e)*100:0,v:r+e,a:t.a}));var t,e,r},b=function(n){return{h:(t=E(n)).h,s:(o=(200-(e=t.s))*(r=t.v)/100)>0&&o<200?e*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,e,r,o},sn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,W={string:[[function(n){var t=fn.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?l(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?l(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=gn.exec(n)||cn.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:H({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(n){var t=sn.exec(n)||dn.exec(n);if(!t)return null;var e,r,o=O({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(ln[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return R(o)},"hsl"]],object:[[function(n){var t=n.r,e=n.g,r=n.b,o=n.a,u=o===void 0?1:o;return c(t)&&c(e)&&c(r)?H({r:Number(t),g:Number(e),b:Number(r),a:Number(u)}):null},"rgb"],[function(n){var t=n.h,e=n.s,r=n.l,o=n.a,u=o===void 0?1:o;if(!c(t)||!c(e)||!c(r))return null;var a=O({h:Number(t),s:Number(e),l:Number(r),a:Number(u)});return R(a)},"hsl"],[function(n){var t=n.h,e=n.s,r=n.v,o=n.a,u=o===void 0?1:o;if(!c(t)||!c(e)||!c(r))return null;var a=function(d){return{h:A(d.h),s:s(d.s,0,100),v:s(d.v,0,100),a:s(d.a)}}({h:Number(t),s:Number(e),v:Number(r),a:Number(u)});return L(a)},"hsv"]]},F=function(n,t){for(var e=0;e<t.length;e++){var r=t[e][0](n);if(r)return[r,t[e][1]]}return[null,void 0]},hn=function(n){return typeof n=="string"?F(n.trim(),W.string):typeof n=="object"&&n!==null?F(n,W.object):[null,void 0]},z=function(n,t){var e=b(n);return{h:e.h,s:s(e.s+100*t,0,100),l:e.l,a:e.a}},D=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},$=function(n,t){var e=b(n);return{h:e.h,s:e.s,l:s(e.l+100*t,0,100),a:e.a}},x=function(){function n(t){this.parsed=hn(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return l(D(this.rgba),2)},n.prototype.isDark=function(){return D(this.rgba)<.5},n.prototype.isLight=function(){return D(this.rgba)>=.5},n.prototype.toHex=function(){return t=S(this.rgba),e=t.r,r=t.g,o=t.b,a=(u=t.a)<1?y(l(255*u)):"","#"+y(e)+y(r)+y(o)+a;var t,e,r,o,u,a},n.prototype.toRgb=function(){return S(this.rgba)},n.prototype.toRgbString=function(){return t=S(this.rgba),e=t.r,r=t.g,o=t.b,(u=t.a)<1?"rgba("+e+", "+r+", "+o+", "+u+")":"rgb("+e+", "+r+", "+o+")";var t,e,r,o,u},n.prototype.toHsl=function(){return M(b(this.rgba))},n.prototype.toHslString=function(){return t=M(b(this.rgba)),e=t.h,r=t.s,o=t.l,(u=t.a)<1?"hsla("+e+", "+r+"%, "+o+"%, "+u+")":"hsl("+e+", "+r+"%, "+o+"%)";var t,e,r,o,u},n.prototype.toHsv=function(){return t=E(this.rgba),{h:l(t.h),s:l(t.s),v:l(t.v),a:l(t.a,3)};var t},n.prototype.invert=function(){return g({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),g(z(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),g(z(this.rgba,-t))},n.prototype.grayscale=function(){return g(z(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),g($(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),g($(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?g({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):l(this.rgba.a,3);var e},n.prototype.hue=function(t){var e=b(this.rgba);return typeof t=="number"?g({h:t,s:e.s,l:e.l,a:e.a}):l(e.h)},n.prototype.isEqual=function(t){return this.toHex()===g(t).toHex()},n}(),g=function(n){return n instanceof x?n:new x(n)};function B(n){let t;return typeof n=="number"?t={r:n>>24&255,g:n>>16&255,b:n>>8&255,a:(n&255)/255}:t=n,g(t)}function f(n,t=!1){if(n===void 0||n==="none")return;const e=B(n);if(!e.isValid()){const r=`Failed to normalizeColor ${n}`;if(t)throw new Error(r);return console.warn(r),"rgb(0, 0, 0)"}return e.toRgbString()}function p(n){if(!(!n||n==="none"))return typeof n=="string"?{color:f(n)}:{...n,color:f(n.color)}}function X(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:{...n,...p(n)}}function h(n,t=!1){if(typeof n!="object"||!n)return n;if(Array.isArray(n))return t?n.map(r=>h(r,t)):n;const e={};for(const r in n){const o=n[r];o!=null&&(t?e[r]=h(o,t):e[r]=o)}return e}function w(){return{color:"rgb(0, 0, 0)",offsetX:0,offsetY:0,blurRadius:1}}function C(n){if(!(!n||n==="none"))return{...w(),...h({...n,color:f(n.color)})}}function Y(){return{...w(),scaleX:1,scaleY:1}}function V(n){if(!(!n||n==="none"))return{...Y(),...C(n)}}function G(n){if(!(!n||n==="none"))return n}function P(n){if(!(!n||n==="none"))return h({...n,softEdge:G(n.softEdge),outerShadow:V(n.outerShadow),innerShadow:C(n.innerShadow)})}function j(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:{...n,...p(n)}}function U(n){if(!(!n||n==="none"))return typeof n=="string"?{paths:[{data:n}]}:Array.isArray(n)?{paths:n.map(t=>typeof t=="string"?{data:t}:t)}:n}function q(n){if(!(!n||n==="none"))return typeof n=="string"?{color:f(n)}:{...n,color:f(n.color)}}function K(n){if(!(!n||n==="none"))return typeof n=="string"?{color:f(n)}:{...n,color:f(n.color)}}function J(){return{boxShadow:"none"}}function Q(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function Z(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function _(){return{...Q(),...Z(),...J(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function nn(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function tn(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function en(){return{...nn(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function rn(){return{...tn(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function on(){return{...rn(),...en(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function m(n){if(!(!n||n==="none"))return h({...n,color:f(n.color),backgroundColor:f(n.backgroundColor),borderColor:f(n.borderColor),outlineColor:f(n.outlineColor),shadowColor:f(n.shadowColor)})}function vn(){return{..._(),...on()}}function I(n=""){return(Array.isArray(n)?n:[n]).map(e=>typeof e=="string"?{fragments:[{content:e}]}:"content"in e?{fragments:[m(e)]}:"fragments"in e?{...m(e),fragments:e.fragments.map(r=>m(r))}:Array.isArray(e)?{fragments:e.map(r=>typeof r=="string"?{content:r}:m(r))}:{fragments:[]})}function un(n){if(!(!n||n==="none"))return typeof n=="string"?{content:[{fragments:[{content:n}]}]}:"content"in n?{...n,content:I(n.content)}:{content:I(n)}}function an(n){if(!(!n||n==="none"))return typeof n=="string"?{src:n}:n}function N(n){var t;return h({...n,style:m(n.style),text:un(n.text),background:X(n.background),geometry:U(n.geometry),fill:p(n.fill),outline:q(n.outline),foreground:j(n.foreground),shadow:K(n.shadow),video:an(n.video),audio:v(n.audio),effect:P(n.effect),children:(t=n.children)==null?void 0:t.map(e=>N(e))})}function mn(n){return N(n)}i.clearUndef=h,i.getDefaultElementStyle=_,i.getDefaultHighlightStyle=nn,i.getDefaultInnerShadow=w,i.getDefaultLayoutStyle=Q,i.getDefaultListStyleStyle=tn,i.getDefaultOuterShadow=Y,i.getDefaultShadowStyle=J,i.getDefaultStyle=vn,i.getDefaultTextInlineStyle=en,i.getDefaultTextLineStyle=rn,i.getDefaultTextStyle=on,i.getDefaultTransformStyle=Z,i.normalizeAudio=v,i.normalizeBackground=X,i.normalizeColor=f,i.normalizeDocument=mn,i.normalizeEffect=P,i.normalizeElement=N,i.normalizeFill=p,i.normalizeForeground=j,i.normalizeGeometry=U,i.normalizeInnerShadow=C,i.normalizeOuterShadow=V,i.normalizeOutline=q,i.normalizeShadow=K,i.normalizeSoftEdge=G,i.normalizeStyle=m,i.normalizeText=un,i.normalizeTextContent=I,i.normalizeVideo=an,i.parseColor=B,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/dist/index.mjs CHANGED
@@ -301,6 +301,7 @@ function getDefaultElementStyle() {
301
301
  ...getDefaultShadowStyle(),
302
302
  // background
303
303
  backgroundImage: "none",
304
+ backgroundSize: "auto, auto",
304
305
  backgroundColor: "none",
305
306
  // border
306
307
  borderRadius: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-idoc",
3
3
  "type": "module",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "Intermediate document for modern codec libs",
7
7
  "author": "wxm",