modern-idoc 0.2.4 → 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 +3 -3
- package/dist/index.d.cts +15 -12
- package/dist/index.d.mts +15 -12
- package/dist/index.d.ts +15 -12
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
@@ -67,6 +59,7 @@ interface Path2DDeclaration extends Partial<Path2DStyle> {
|
|
|
67
59
|
data: SVGPathData;
|
|
68
60
|
}
|
|
69
61
|
interface GeometryDeclaration {
|
|
62
|
+
name?: string;
|
|
70
63
|
data: Path2DDeclaration[];
|
|
71
64
|
}
|
|
72
65
|
type GeometryProp = Noneable | SVGPathData | SVGPathData[] | Path2DDeclaration[] | GeometryDeclaration;
|
|
@@ -81,8 +74,15 @@ interface IDOCNode {
|
|
|
81
74
|
meta?: MetaProp;
|
|
82
75
|
}
|
|
83
76
|
|
|
77
|
+
interface ImageRect {
|
|
78
|
+
left?: number;
|
|
79
|
+
top?: number;
|
|
80
|
+
bottom?: number;
|
|
81
|
+
right?: number;
|
|
82
|
+
}
|
|
84
83
|
interface ImageDeclaration {
|
|
85
|
-
|
|
84
|
+
src: string;
|
|
85
|
+
srcRect?: ImageRect;
|
|
86
86
|
opacity?: number;
|
|
87
87
|
}
|
|
88
88
|
type ImageProp = Noneable | string | ImageDeclaration;
|
|
@@ -292,7 +292,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
|
|
|
292
292
|
}) | TextDeclaration;
|
|
293
293
|
|
|
294
294
|
interface VideoDeclaration {
|
|
295
|
-
|
|
295
|
+
src: string;
|
|
296
296
|
opacity?: number;
|
|
297
297
|
}
|
|
298
298
|
type VideoProp = Noneable | string | VideoDeclaration;
|
|
@@ -324,6 +324,9 @@ interface IDOCElementDeclaration extends IDOCElement {
|
|
|
324
324
|
interface IDOCDocument extends IDOCElement {
|
|
325
325
|
fonts?: any;
|
|
326
326
|
}
|
|
327
|
+
interface IDOCDocumentDeclaration extends IDOCElementDeclaration {
|
|
328
|
+
fonts?: any;
|
|
329
|
+
}
|
|
327
330
|
|
|
328
331
|
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
329
332
|
|
|
@@ -358,4 +361,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
|
|
|
358
361
|
|
|
359
362
|
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
360
363
|
|
|
361
|
-
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 IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type
|
|
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
|
-
|
|
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 {
|
|
@@ -67,6 +59,7 @@ interface Path2DDeclaration extends Partial<Path2DStyle> {
|
|
|
67
59
|
data: SVGPathData;
|
|
68
60
|
}
|
|
69
61
|
interface GeometryDeclaration {
|
|
62
|
+
name?: string;
|
|
70
63
|
data: Path2DDeclaration[];
|
|
71
64
|
}
|
|
72
65
|
type GeometryProp = Noneable | SVGPathData | SVGPathData[] | Path2DDeclaration[] | GeometryDeclaration;
|
|
@@ -81,8 +74,15 @@ interface IDOCNode {
|
|
|
81
74
|
meta?: MetaProp;
|
|
82
75
|
}
|
|
83
76
|
|
|
77
|
+
interface ImageRect {
|
|
78
|
+
left?: number;
|
|
79
|
+
top?: number;
|
|
80
|
+
bottom?: number;
|
|
81
|
+
right?: number;
|
|
82
|
+
}
|
|
84
83
|
interface ImageDeclaration {
|
|
85
|
-
|
|
84
|
+
src: string;
|
|
85
|
+
srcRect?: ImageRect;
|
|
86
86
|
opacity?: number;
|
|
87
87
|
}
|
|
88
88
|
type ImageProp = Noneable | string | ImageDeclaration;
|
|
@@ -292,7 +292,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
|
|
|
292
292
|
}) | TextDeclaration;
|
|
293
293
|
|
|
294
294
|
interface VideoDeclaration {
|
|
295
|
-
|
|
295
|
+
src: string;
|
|
296
296
|
opacity?: number;
|
|
297
297
|
}
|
|
298
298
|
type VideoProp = Noneable | string | VideoDeclaration;
|
|
@@ -324,6 +324,9 @@ interface IDOCElementDeclaration extends IDOCElement {
|
|
|
324
324
|
interface IDOCDocument extends IDOCElement {
|
|
325
325
|
fonts?: any;
|
|
326
326
|
}
|
|
327
|
+
interface IDOCDocumentDeclaration extends IDOCElementDeclaration {
|
|
328
|
+
fonts?: any;
|
|
329
|
+
}
|
|
327
330
|
|
|
328
331
|
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
329
332
|
|
|
@@ -358,4 +361,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
|
|
|
358
361
|
|
|
359
362
|
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
360
363
|
|
|
361
|
-
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 IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type
|
|
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
|
-
|
|
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 {
|
|
@@ -67,6 +59,7 @@ interface Path2DDeclaration extends Partial<Path2DStyle> {
|
|
|
67
59
|
data: SVGPathData;
|
|
68
60
|
}
|
|
69
61
|
interface GeometryDeclaration {
|
|
62
|
+
name?: string;
|
|
70
63
|
data: Path2DDeclaration[];
|
|
71
64
|
}
|
|
72
65
|
type GeometryProp = Noneable | SVGPathData | SVGPathData[] | Path2DDeclaration[] | GeometryDeclaration;
|
|
@@ -81,8 +74,15 @@ interface IDOCNode {
|
|
|
81
74
|
meta?: MetaProp;
|
|
82
75
|
}
|
|
83
76
|
|
|
77
|
+
interface ImageRect {
|
|
78
|
+
left?: number;
|
|
79
|
+
top?: number;
|
|
80
|
+
bottom?: number;
|
|
81
|
+
right?: number;
|
|
82
|
+
}
|
|
84
83
|
interface ImageDeclaration {
|
|
85
|
-
|
|
84
|
+
src: string;
|
|
85
|
+
srcRect?: ImageRect;
|
|
86
86
|
opacity?: number;
|
|
87
87
|
}
|
|
88
88
|
type ImageProp = Noneable | string | ImageDeclaration;
|
|
@@ -292,7 +292,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
|
|
|
292
292
|
}) | TextDeclaration;
|
|
293
293
|
|
|
294
294
|
interface VideoDeclaration {
|
|
295
|
-
|
|
295
|
+
src: string;
|
|
296
296
|
opacity?: number;
|
|
297
297
|
}
|
|
298
298
|
type VideoProp = Noneable | string | VideoDeclaration;
|
|
@@ -324,6 +324,9 @@ interface IDOCElementDeclaration extends IDOCElement {
|
|
|
324
324
|
interface IDOCDocument extends IDOCElement {
|
|
325
325
|
fonts?: any;
|
|
326
326
|
}
|
|
327
|
+
interface IDOCDocumentDeclaration extends IDOCElementDeclaration {
|
|
328
|
+
fonts?: any;
|
|
329
|
+
}
|
|
327
330
|
|
|
328
331
|
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
329
332
|
|
|
@@ -358,4 +361,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
|
|
|
358
361
|
|
|
359
362
|
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
360
363
|
|
|
361
|
-
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 IDOCElement, type IDOCElementDeclaration, type IDOCNode, type ImageDeclaration, type ImageFillDeclaration, type
|
|
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"?{
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
320
|
+
src: video
|
|
321
321
|
};
|
|
322
322
|
} else {
|
|
323
323
|
return {
|