modern-idoc 0.2.5 → 0.2.8
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 +7 -5
- package/dist/index.d.cts +18 -15
- package/dist/index.d.mts +18 -15
- package/dist/index.d.ts +18 -15
- package/dist/index.js +1 -1
- package/dist/index.mjs +7 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -77,10 +77,12 @@ function getDefaultElementStyle() {
|
|
|
77
77
|
opacity: 1,
|
|
78
78
|
// background
|
|
79
79
|
backgroundImage: "none",
|
|
80
|
-
backgroundColor: "
|
|
80
|
+
backgroundColor: "none",
|
|
81
81
|
// border
|
|
82
82
|
borderRadius: 0,
|
|
83
|
-
borderColor: "
|
|
83
|
+
borderColor: "none",
|
|
84
|
+
borderStyle: "solid",
|
|
85
|
+
pointerEvents: "auto"
|
|
84
86
|
};
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -166,7 +168,7 @@ function normalizeAudio(audio) {
|
|
|
166
168
|
return void 0;
|
|
167
169
|
} else if (typeof audio === "string") {
|
|
168
170
|
return {
|
|
169
|
-
|
|
171
|
+
src: audio
|
|
170
172
|
};
|
|
171
173
|
} else {
|
|
172
174
|
return {
|
|
@@ -218,7 +220,7 @@ function normalizeImage(image) {
|
|
|
218
220
|
return void 0;
|
|
219
221
|
} else if (typeof image === "string") {
|
|
220
222
|
return {
|
|
221
|
-
|
|
223
|
+
src: image
|
|
222
224
|
};
|
|
223
225
|
} else {
|
|
224
226
|
return image;
|
|
@@ -319,7 +321,7 @@ function normalizeVideo(video) {
|
|
|
319
321
|
return void 0;
|
|
320
322
|
} else if (typeof video === "string") {
|
|
321
323
|
return {
|
|
322
|
-
|
|
324
|
+
src: video
|
|
323
325
|
};
|
|
324
326
|
} else {
|
|
325
327
|
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 {
|
|
@@ -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
|
-
|
|
84
|
+
src: string;
|
|
85
|
+
srcRect?: ImageRect;
|
|
87
86
|
opacity?: number;
|
|
88
87
|
}
|
|
89
88
|
type ImageProp = Noneable | string | ImageDeclaration;
|
|
@@ -125,7 +124,9 @@ type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
|
|
|
125
124
|
type FlexWrap = 'nowrap' | 'wrap' | 'Wrap-reverse';
|
|
126
125
|
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
127
126
|
type Position = 'static' | 'relative' | 'absolute';
|
|
127
|
+
type BorderStyle = Noneable | 'dashed' | 'solid';
|
|
128
128
|
type BoxSizing = 'border-box' | 'content-box';
|
|
129
|
+
type PointerEvents = 'auto' | 'none';
|
|
129
130
|
type ListStyleType = Noneable | 'disc';
|
|
130
131
|
type ListStyleImage = Noneable | string;
|
|
131
132
|
type ListStyleColormap = Noneable | Record<string, string>;
|
|
@@ -199,10 +200,12 @@ interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyle
|
|
|
199
200
|
visibility: Visibility;
|
|
200
201
|
filter: string;
|
|
201
202
|
opacity: number;
|
|
202
|
-
backgroundImage: string;
|
|
203
|
-
backgroundColor: string;
|
|
203
|
+
backgroundImage: Noneable | string;
|
|
204
|
+
backgroundColor: Noneable | string;
|
|
204
205
|
borderRadius: number;
|
|
205
|
-
borderColor: string;
|
|
206
|
+
borderColor: Noneable | string;
|
|
207
|
+
borderStyle: BorderStyle;
|
|
208
|
+
pointerEvents: PointerEvents;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
interface HighlightDeclaration {
|
|
@@ -293,7 +296,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
|
|
|
293
296
|
}) | TextDeclaration;
|
|
294
297
|
|
|
295
298
|
interface VideoDeclaration {
|
|
296
|
-
|
|
299
|
+
src: string;
|
|
297
300
|
opacity?: number;
|
|
298
301
|
}
|
|
299
302
|
type VideoProp = Noneable | string | VideoDeclaration;
|
|
@@ -362,4 +365,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
|
|
|
362
365
|
|
|
363
366
|
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
364
367
|
|
|
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
|
|
368
|
+
export { type Align, type AudioDeclaration, type AudioProp, type BorderStyle, 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 PointerEvents, 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 {
|
|
@@ -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
|
-
|
|
84
|
+
src: string;
|
|
85
|
+
srcRect?: ImageRect;
|
|
87
86
|
opacity?: number;
|
|
88
87
|
}
|
|
89
88
|
type ImageProp = Noneable | string | ImageDeclaration;
|
|
@@ -125,7 +124,9 @@ type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
|
|
|
125
124
|
type FlexWrap = 'nowrap' | 'wrap' | 'Wrap-reverse';
|
|
126
125
|
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
127
126
|
type Position = 'static' | 'relative' | 'absolute';
|
|
127
|
+
type BorderStyle = Noneable | 'dashed' | 'solid';
|
|
128
128
|
type BoxSizing = 'border-box' | 'content-box';
|
|
129
|
+
type PointerEvents = 'auto' | 'none';
|
|
129
130
|
type ListStyleType = Noneable | 'disc';
|
|
130
131
|
type ListStyleImage = Noneable | string;
|
|
131
132
|
type ListStyleColormap = Noneable | Record<string, string>;
|
|
@@ -199,10 +200,12 @@ interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyle
|
|
|
199
200
|
visibility: Visibility;
|
|
200
201
|
filter: string;
|
|
201
202
|
opacity: number;
|
|
202
|
-
backgroundImage: string;
|
|
203
|
-
backgroundColor: string;
|
|
203
|
+
backgroundImage: Noneable | string;
|
|
204
|
+
backgroundColor: Noneable | string;
|
|
204
205
|
borderRadius: number;
|
|
205
|
-
borderColor: string;
|
|
206
|
+
borderColor: Noneable | string;
|
|
207
|
+
borderStyle: BorderStyle;
|
|
208
|
+
pointerEvents: PointerEvents;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
interface HighlightDeclaration {
|
|
@@ -293,7 +296,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
|
|
|
293
296
|
}) | TextDeclaration;
|
|
294
297
|
|
|
295
298
|
interface VideoDeclaration {
|
|
296
|
-
|
|
299
|
+
src: string;
|
|
297
300
|
opacity?: number;
|
|
298
301
|
}
|
|
299
302
|
type VideoProp = Noneable | string | VideoDeclaration;
|
|
@@ -362,4 +365,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
|
|
|
362
365
|
|
|
363
366
|
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
364
367
|
|
|
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
|
|
368
|
+
export { type Align, type AudioDeclaration, type AudioProp, type BorderStyle, 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 PointerEvents, 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 {
|
|
@@ -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
|
-
|
|
84
|
+
src: string;
|
|
85
|
+
srcRect?: ImageRect;
|
|
87
86
|
opacity?: number;
|
|
88
87
|
}
|
|
89
88
|
type ImageProp = Noneable | string | ImageDeclaration;
|
|
@@ -125,7 +124,9 @@ type FlexDirection = 'column' | 'column-reverse' | 'row' | 'row-reverse';
|
|
|
125
124
|
type FlexWrap = 'nowrap' | 'wrap' | 'Wrap-reverse';
|
|
126
125
|
type Justify = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
127
126
|
type Position = 'static' | 'relative' | 'absolute';
|
|
127
|
+
type BorderStyle = Noneable | 'dashed' | 'solid';
|
|
128
128
|
type BoxSizing = 'border-box' | 'content-box';
|
|
129
|
+
type PointerEvents = 'auto' | 'none';
|
|
129
130
|
type ListStyleType = Noneable | 'disc';
|
|
130
131
|
type ListStyleImage = Noneable | string;
|
|
131
132
|
type ListStyleColormap = Noneable | Record<string, string>;
|
|
@@ -199,10 +200,12 @@ interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyle
|
|
|
199
200
|
visibility: Visibility;
|
|
200
201
|
filter: string;
|
|
201
202
|
opacity: number;
|
|
202
|
-
backgroundImage: string;
|
|
203
|
-
backgroundColor: string;
|
|
203
|
+
backgroundImage: Noneable | string;
|
|
204
|
+
backgroundColor: Noneable | string;
|
|
204
205
|
borderRadius: number;
|
|
205
|
-
borderColor: string;
|
|
206
|
+
borderColor: Noneable | string;
|
|
207
|
+
borderStyle: BorderStyle;
|
|
208
|
+
pointerEvents: PointerEvents;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
interface HighlightDeclaration {
|
|
@@ -293,7 +296,7 @@ type TextProp = string | TextContent | (TextDeclaration & {
|
|
|
293
296
|
}) | TextDeclaration;
|
|
294
297
|
|
|
295
298
|
interface VideoDeclaration {
|
|
296
|
-
|
|
299
|
+
src: string;
|
|
297
300
|
opacity?: number;
|
|
298
301
|
}
|
|
299
302
|
type VideoProp = Noneable | string | VideoDeclaration;
|
|
@@ -362,4 +365,4 @@ declare function normalizeTextContent(content?: TextContent): TextContentDeclara
|
|
|
362
365
|
|
|
363
366
|
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
364
367
|
|
|
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
|
|
368
|
+
export { type Align, type AudioDeclaration, type AudioProp, type BorderStyle, 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 PointerEvents, 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:"
|
|
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:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",pointerEvents:"auto"}}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 T(){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 z(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 p(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 v(e){var r;return l({...e,image:h(e.image),video:b(e.video),audio:d(e.audio),text:p(e.text),geometry:y(e.geometry),fill:m(e.fill),outline:S(e.outline),shadow:z(e.shadow),children:(r=e.children)==null?void 0:r.map(t=>v(t))})}n.clearUndef=l,n.deepClearUndef=w,n.getDefaultElementStyle=g,n.getDefaultShadowStyle=u,n.getDefaultStyle=T,n.getDefaultTextStyle=c,n.getDefaultTransformStyle=s,n.normalizeAudio=d,n.normalizeElement=v,n.normalizeFill=m,n.normalizeGeometry=y,n.normalizeImage=h,n.normalizeOutline=S,n.normalizeShadow=z,n.normalizeText=p,n.normalizeTextContent=f,n.normalizeVideo=b,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.mjs
CHANGED
|
@@ -75,10 +75,12 @@ function getDefaultElementStyle() {
|
|
|
75
75
|
opacity: 1,
|
|
76
76
|
// background
|
|
77
77
|
backgroundImage: "none",
|
|
78
|
-
backgroundColor: "
|
|
78
|
+
backgroundColor: "none",
|
|
79
79
|
// border
|
|
80
80
|
borderRadius: 0,
|
|
81
|
-
borderColor: "
|
|
81
|
+
borderColor: "none",
|
|
82
|
+
borderStyle: "solid",
|
|
83
|
+
pointerEvents: "auto"
|
|
82
84
|
};
|
|
83
85
|
}
|
|
84
86
|
|
|
@@ -164,7 +166,7 @@ function normalizeAudio(audio) {
|
|
|
164
166
|
return void 0;
|
|
165
167
|
} else if (typeof audio === "string") {
|
|
166
168
|
return {
|
|
167
|
-
|
|
169
|
+
src: audio
|
|
168
170
|
};
|
|
169
171
|
} else {
|
|
170
172
|
return {
|
|
@@ -216,7 +218,7 @@ function normalizeImage(image) {
|
|
|
216
218
|
return void 0;
|
|
217
219
|
} else if (typeof image === "string") {
|
|
218
220
|
return {
|
|
219
|
-
|
|
221
|
+
src: image
|
|
220
222
|
};
|
|
221
223
|
} else {
|
|
222
224
|
return image;
|
|
@@ -317,7 +319,7 @@ function normalizeVideo(video) {
|
|
|
317
319
|
return void 0;
|
|
318
320
|
} else if (typeof video === "string") {
|
|
319
321
|
return {
|
|
320
|
-
|
|
322
|
+
src: video
|
|
321
323
|
};
|
|
322
324
|
} else {
|
|
323
325
|
return {
|