modern-idoc 0.2.5 → 0.2.7

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
@@ -166,7 +166,7 @@ function normalizeAudio(audio) {
166
166
  return void 0;
167
167
  } else if (typeof audio === "string") {
168
168
  return {
169
- url: audio
169
+ src: audio
170
170
  };
171
171
  } else {
172
172
  return {
@@ -218,7 +218,7 @@ function normalizeImage(image) {
218
218
  return void 0;
219
219
  } else if (typeof image === "string") {
220
220
  return {
221
- url: image
221
+ src: image
222
222
  };
223
223
  } else {
224
224
  return image;
@@ -319,7 +319,7 @@ function normalizeVideo(video) {
319
319
  return void 0;
320
320
  } else if (typeof video === "string") {
321
321
  return {
322
- url: video
322
+ src: video
323
323
  };
324
324
  } else {
325
325
  return {
package/dist/index.d.cts CHANGED
@@ -2,16 +2,10 @@ type Noneable = 'none';
2
2
  type Sizeable = `${number}%` | `${number}rem` | number;
3
3
 
4
4
  interface AudioDeclaration {
5
- url: string;
5
+ src: string;
6
6
  }
7
7
  type AudioProp = Noneable | string | AudioDeclaration;
8
8
 
9
- interface ImageFillRect {
10
- left?: number;
11
- top?: number;
12
- bottom?: number;
13
- right?: number;
14
- }
15
9
  interface ImageFillTile {
16
10
  alignment?: string;
17
11
  scaleX?: number;
@@ -28,8 +22,6 @@ interface ImageFillDeclaration extends CommonFillDeclaration {
28
22
  image: string;
29
23
  dpi?: number;
30
24
  rotateWithShape?: boolean;
31
- srcRect?: ImageFillRect;
32
- fillRect?: ImageFillRect;
33
25
  tile?: ImageFillTile;
34
26
  }
35
27
  interface ColorFillDeclaration extends CommonFillDeclaration {
@@ -82,8 +74,15 @@ interface IDOCNode {
82
74
  meta?: MetaProp;
83
75
  }
84
76
 
77
+ interface ImageRect {
78
+ left?: number;
79
+ top?: number;
80
+ bottom?: number;
81
+ right?: number;
82
+ }
85
83
  interface ImageDeclaration {
86
- url: string;
84
+ src: string;
85
+ srcRect?: ImageRect;
87
86
  opacity?: number;
88
87
  }
89
88
  type ImageProp = Noneable | string | ImageDeclaration;
@@ -293,7 +292,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
293
292
  }) | TextDeclaration;
294
293
 
295
294
  interface VideoDeclaration {
296
- url: string;
295
+ src: string;
297
296
  opacity?: number;
298
297
  }
299
298
  type VideoProp = Noneable | string | VideoDeclaration;
@@ -362,4 +361,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
362
361
 
363
362
  declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
364
363
 
365
- export { type Align, type AudioDeclaration, type AudioProp, type BoxSizing, type ColorFillDeclaration, type CommonFillDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProp, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryProp, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type ImageFillRect, type ImageFillTile, type ImageProp, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProp, type OutlineDeclaration, type OutlineProp, type Overflow, type ParagraphContent, type Path2DDeclaration, type Path2DStyle, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProp, type ShadowStyleDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProp, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProp, type TextStyleDeclaration, type TextTransform, type TextWrap, type TransformStyleDeclaration, type VerticalAlign, type VideoDeclaration, type VideoProp, type Visibility, type WritingMode, clearUndef, deepClearUndef, getDefaultElementStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeElement, normalizeFill, normalizeGeometry, normalizeImage, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
364
+ export { type Align, type AudioDeclaration, type AudioProp, type BoxSizing, type ColorFillDeclaration, type CommonFillDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProp, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryProp, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type ImageFillTile, type ImageProp, type ImageRect, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProp, type OutlineDeclaration, type OutlineProp, type Overflow, type ParagraphContent, type Path2DDeclaration, type Path2DStyle, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProp, type ShadowStyleDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProp, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProp, type TextStyleDeclaration, type TextTransform, type TextWrap, type TransformStyleDeclaration, type VerticalAlign, type VideoDeclaration, type VideoProp, type Visibility, type WritingMode, clearUndef, deepClearUndef, getDefaultElementStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeElement, normalizeFill, normalizeGeometry, normalizeImage, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
package/dist/index.d.mts CHANGED
@@ -2,16 +2,10 @@ type Noneable = 'none';
2
2
  type Sizeable = `${number}%` | `${number}rem` | number;
3
3
 
4
4
  interface AudioDeclaration {
5
- url: string;
5
+ src: string;
6
6
  }
7
7
  type AudioProp = Noneable | string | AudioDeclaration;
8
8
 
9
- interface ImageFillRect {
10
- left?: number;
11
- top?: number;
12
- bottom?: number;
13
- right?: number;
14
- }
15
9
  interface ImageFillTile {
16
10
  alignment?: string;
17
11
  scaleX?: number;
@@ -28,8 +22,6 @@ interface ImageFillDeclaration extends CommonFillDeclaration {
28
22
  image: string;
29
23
  dpi?: number;
30
24
  rotateWithShape?: boolean;
31
- srcRect?: ImageFillRect;
32
- fillRect?: ImageFillRect;
33
25
  tile?: ImageFillTile;
34
26
  }
35
27
  interface ColorFillDeclaration extends CommonFillDeclaration {
@@ -82,8 +74,15 @@ interface IDOCNode {
82
74
  meta?: MetaProp;
83
75
  }
84
76
 
77
+ interface ImageRect {
78
+ left?: number;
79
+ top?: number;
80
+ bottom?: number;
81
+ right?: number;
82
+ }
85
83
  interface ImageDeclaration {
86
- url: string;
84
+ src: string;
85
+ srcRect?: ImageRect;
87
86
  opacity?: number;
88
87
  }
89
88
  type ImageProp = Noneable | string | ImageDeclaration;
@@ -293,7 +292,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
293
292
  }) | TextDeclaration;
294
293
 
295
294
  interface VideoDeclaration {
296
- url: string;
295
+ src: string;
297
296
  opacity?: number;
298
297
  }
299
298
  type VideoProp = Noneable | string | VideoDeclaration;
@@ -362,4 +361,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
362
361
 
363
362
  declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
364
363
 
365
- export { type Align, type AudioDeclaration, type AudioProp, type BoxSizing, type ColorFillDeclaration, type CommonFillDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProp, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryProp, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type ImageFillRect, type ImageFillTile, type ImageProp, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProp, type OutlineDeclaration, type OutlineProp, type Overflow, type ParagraphContent, type Path2DDeclaration, type Path2DStyle, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProp, type ShadowStyleDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProp, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProp, type TextStyleDeclaration, type TextTransform, type TextWrap, type TransformStyleDeclaration, type VerticalAlign, type VideoDeclaration, type VideoProp, type Visibility, type WritingMode, clearUndef, deepClearUndef, getDefaultElementStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeElement, normalizeFill, normalizeGeometry, normalizeImage, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
364
+ export { type Align, type AudioDeclaration, type AudioProp, type BoxSizing, type ColorFillDeclaration, type CommonFillDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProp, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryProp, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type ImageFillTile, type ImageProp, type ImageRect, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProp, type OutlineDeclaration, type OutlineProp, type Overflow, type ParagraphContent, type Path2DDeclaration, type Path2DStyle, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProp, type ShadowStyleDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProp, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProp, type TextStyleDeclaration, type TextTransform, type TextWrap, type TransformStyleDeclaration, type VerticalAlign, type VideoDeclaration, type VideoProp, type Visibility, type WritingMode, clearUndef, deepClearUndef, getDefaultElementStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeElement, normalizeFill, normalizeGeometry, normalizeImage, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
package/dist/index.d.ts CHANGED
@@ -2,16 +2,10 @@ type Noneable = 'none';
2
2
  type Sizeable = `${number}%` | `${number}rem` | number;
3
3
 
4
4
  interface AudioDeclaration {
5
- url: string;
5
+ src: string;
6
6
  }
7
7
  type AudioProp = Noneable | string | AudioDeclaration;
8
8
 
9
- interface ImageFillRect {
10
- left?: number;
11
- top?: number;
12
- bottom?: number;
13
- right?: number;
14
- }
15
9
  interface ImageFillTile {
16
10
  alignment?: string;
17
11
  scaleX?: number;
@@ -28,8 +22,6 @@ interface ImageFillDeclaration extends CommonFillDeclaration {
28
22
  image: string;
29
23
  dpi?: number;
30
24
  rotateWithShape?: boolean;
31
- srcRect?: ImageFillRect;
32
- fillRect?: ImageFillRect;
33
25
  tile?: ImageFillTile;
34
26
  }
35
27
  interface ColorFillDeclaration extends CommonFillDeclaration {
@@ -82,8 +74,15 @@ interface IDOCNode {
82
74
  meta?: MetaProp;
83
75
  }
84
76
 
77
+ interface ImageRect {
78
+ left?: number;
79
+ top?: number;
80
+ bottom?: number;
81
+ right?: number;
82
+ }
85
83
  interface ImageDeclaration {
86
- url: string;
84
+ src: string;
85
+ srcRect?: ImageRect;
87
86
  opacity?: number;
88
87
  }
89
88
  type ImageProp = Noneable | string | ImageDeclaration;
@@ -293,7 +292,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
293
292
  }) | TextDeclaration;
294
293
 
295
294
  interface VideoDeclaration {
296
- url: string;
295
+ src: string;
297
296
  opacity?: number;
298
297
  }
299
298
  type VideoProp = Noneable | string | VideoDeclaration;
@@ -362,4 +361,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
362
361
 
363
362
  declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
364
363
 
365
- export { type Align, type AudioDeclaration, type AudioProp, type BoxSizing, type ColorFillDeclaration, type CommonFillDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProp, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryProp, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type ImageFillRect, type ImageFillTile, type ImageProp, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProp, type OutlineDeclaration, type OutlineProp, type Overflow, type ParagraphContent, type Path2DDeclaration, type Path2DStyle, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProp, type ShadowStyleDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProp, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProp, type TextStyleDeclaration, type TextTransform, type TextWrap, type TransformStyleDeclaration, type VerticalAlign, type VideoDeclaration, type VideoProp, type Visibility, type WritingMode, clearUndef, deepClearUndef, getDefaultElementStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeElement, normalizeFill, normalizeGeometry, normalizeImage, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
364
+ export { type Align, type AudioDeclaration, type AudioProp, type BoxSizing, type ColorFillDeclaration, type CommonFillDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProp, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryProp, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type ImageFillTile, type ImageProp, type ImageRect, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProp, type OutlineDeclaration, type OutlineProp, type Overflow, type ParagraphContent, type Path2DDeclaration, type Path2DStyle, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProp, type ShadowStyleDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProp, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProp, type TextStyleDeclaration, type TextTransform, type TextWrap, type TransformStyleDeclaration, type VerticalAlign, type VideoDeclaration, type VideoProp, type Visibility, type WritingMode, clearUndef, deepClearUndef, getDefaultElementStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeElement, normalizeFill, normalizeGeometry, normalizeImage, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.modernIdoc={}))})(this,function(n){"use strict";function o(){return{overflow:"visible",alignContent:"stretch",alignItems:"stretch",alignSelf:"auto",borderTop:"none",borderLeft:"none",borderRight:"none",borderBottom:"none",borderWidth:0,border:"none",direction:"inherit",display:"flex",flex:0,flexBasis:"auto",flexDirection:"row",flexGrow:0,flexShrink:1,flexWrap:"nowrap",height:"auto",justifyContent:"flex-start",gap:0,marginTop:0,marginLeft:0,marginRight:0,marginBottom:0,margin:0,maxHeight:0,maxWidth:0,minHeight:0,minWidth:0,paddingTop:0,paddingLeft:0,paddingRight:0,paddingBottom:0,padding:0,top:0,bottom:0,left:0,right:0,position:"static",boxSizing:"content-box",width:"auto"}}function u(){return{boxShadow:"none"}}function s(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function g(){return{...s(),...o(),...u(),visibility:"visible",filter:"none",opacity:1,backgroundImage:"none",backgroundColor:"transparent",borderRadius:0,borderColor:"transparent"}}function c(){return{writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1.2,letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textIndent:0,textTransform:"none",textOrientation:"mixed",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"black",color:"black",listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function v(){return{...g(),...c()}}function l(e,r=!1){if(typeof e!="object"||!e)return e;if(Array.isArray(e))return r?e.map(i=>l(i,r)):e;const t={};for(const i in e){const a=e[i];a!=null&&(r?t[i]=l(a,r):t[i]=a)}return t}function w(e){return l(e,!0)}function d(e){if(!(!e||e==="none"))return typeof e=="string"?{url:e}:{...e}}function m(e){if(!(!e||e==="none"))return typeof e=="string"?{type:"color",color:e}:e}function y(e){if(!(!e||e==="none"))return typeof e=="string"?{data:[{data:e}]}:Array.isArray(e)?{data:e.map(r=>typeof r=="string"?{data:r}:r)}:e}function h(e){if(!(!e||e==="none"))return typeof e=="string"?{url:e}:e}function S(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function p(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function f(e=""){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?{fragments:[{content:t}]}:"content"in t?{fragments:[{...t}]}:"fragments"in t?{...t,fragments:t.fragments.map(i=>({...i}))}:Array.isArray(t)?{fragments:t.map(i=>typeof i=="string"?{content:i}:{...i})}:{fragments:[]})}function z(e){if(!(!e||e==="none"))return typeof e=="string"?{content:[{fragments:[{content:e}]}]}:"content"in e?{...e,content:f(e.content)}:{content:f(e)}}function b(e){if(!(!e||e==="none"))return typeof e=="string"?{url:e}:{...e}}function T(e){var r;return l({...e,image:h(e.image),video:b(e.video),audio:d(e.audio),text:z(e.text),geometry:y(e.geometry),fill:m(e.fill),outline:S(e.outline),shadow:p(e.shadow),children:(r=e.children)==null?void 0:r.map(t=>T(t))})}n.clearUndef=l,n.deepClearUndef=w,n.getDefaultElementStyle=g,n.getDefaultShadowStyle=u,n.getDefaultStyle=v,n.getDefaultTextStyle=c,n.getDefaultTransformStyle=s,n.normalizeAudio=d,n.normalizeElement=T,n.normalizeFill=m,n.normalizeGeometry=y,n.normalizeImage=h,n.normalizeOutline=S,n.normalizeShadow=p,n.normalizeText=z,n.normalizeTextContent=f,n.normalizeVideo=b,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.modernIdoc={}))})(this,function(n){"use strict";function o(){return{overflow:"visible",alignContent:"stretch",alignItems:"stretch",alignSelf:"auto",borderTop:"none",borderLeft:"none",borderRight:"none",borderBottom:"none",borderWidth:0,border:"none",direction:"inherit",display:"flex",flex:0,flexBasis:"auto",flexDirection:"row",flexGrow:0,flexShrink:1,flexWrap:"nowrap",height:"auto",justifyContent:"flex-start",gap:0,marginTop:0,marginLeft:0,marginRight:0,marginBottom:0,margin:0,maxHeight:0,maxWidth:0,minHeight:0,minWidth:0,paddingTop:0,paddingLeft:0,paddingRight:0,paddingBottom:0,padding:0,top:0,bottom:0,left:0,right:0,position:"static",boxSizing:"content-box",width:"auto"}}function u(){return{boxShadow:"none"}}function s(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function g(){return{...s(),...o(),...u(),visibility:"visible",filter:"none",opacity:1,backgroundImage:"none",backgroundColor:"transparent",borderRadius:0,borderColor:"transparent"}}function c(){return{writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1.2,letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textIndent:0,textTransform:"none",textOrientation:"mixed",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"black",color:"black",listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function v(){return{...g(),...c()}}function l(e,r=!1){if(typeof e!="object"||!e)return e;if(Array.isArray(e))return r?e.map(i=>l(i,r)):e;const t={};for(const i in e){const a=e[i];a!=null&&(r?t[i]=l(a,r):t[i]=a)}return t}function w(e){return l(e,!0)}function d(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:{...e}}function m(e){if(!(!e||e==="none"))return typeof e=="string"?{type:"color",color:e}:e}function y(e){if(!(!e||e==="none"))return typeof e=="string"?{data:[{data:e}]}:Array.isArray(e)?{data:e.map(r=>typeof r=="string"?{data:r}:r)}:e}function h(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function S(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function p(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function f(e=""){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?{fragments:[{content:t}]}:"content"in t?{fragments:[{...t}]}:"fragments"in t?{...t,fragments:t.fragments.map(i=>({...i}))}:Array.isArray(t)?{fragments:t.map(i=>typeof i=="string"?{content:i}:{...i})}:{fragments:[]})}function z(e){if(!(!e||e==="none"))return typeof e=="string"?{content:[{fragments:[{content:e}]}]}:"content"in e?{...e,content:f(e.content)}:{content:f(e)}}function b(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:{...e}}function T(e){var r;return l({...e,image:h(e.image),video:b(e.video),audio:d(e.audio),text:z(e.text),geometry:y(e.geometry),fill:m(e.fill),outline:S(e.outline),shadow:p(e.shadow),children:(r=e.children)==null?void 0:r.map(t=>T(t))})}n.clearUndef=l,n.deepClearUndef=w,n.getDefaultElementStyle=g,n.getDefaultShadowStyle=u,n.getDefaultStyle=v,n.getDefaultTextStyle=c,n.getDefaultTransformStyle=s,n.normalizeAudio=d,n.normalizeElement=T,n.normalizeFill=m,n.normalizeGeometry=y,n.normalizeImage=h,n.normalizeOutline=S,n.normalizeShadow=p,n.normalizeText=z,n.normalizeTextContent=f,n.normalizeVideo=b,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/dist/index.mjs CHANGED
@@ -164,7 +164,7 @@ function normalizeAudio(audio) {
164
164
  return void 0;
165
165
  } else if (typeof audio === "string") {
166
166
  return {
167
- url: audio
167
+ src: audio
168
168
  };
169
169
  } else {
170
170
  return {
@@ -216,7 +216,7 @@ function normalizeImage(image) {
216
216
  return void 0;
217
217
  } else if (typeof image === "string") {
218
218
  return {
219
- url: image
219
+ src: image
220
220
  };
221
221
  } else {
222
222
  return image;
@@ -317,7 +317,7 @@ function normalizeVideo(video) {
317
317
  return void 0;
318
318
  } else if (typeof video === "string") {
319
319
  return {
320
- url: video
320
+ src: video
321
321
  };
322
322
  } else {
323
323
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-idoc",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "Intermediate document for modern codec libs",
7
7
  "author": "wxm",