modern-idoc 0.4.0 → 0.4.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
@@ -20,6 +20,30 @@ function normalizeBackground(background) {
20
20
  }
21
21
  }
22
22
 
23
+ function normalizeEffect(effect) {
24
+ if (!effect || effect === "none") {
25
+ return void 0;
26
+ } else {
27
+ return effect;
28
+ }
29
+ }
30
+
31
+ function normalizeInnerShadow(shadow) {
32
+ if (!shadow || shadow === "none") {
33
+ return void 0;
34
+ } else {
35
+ return shadow;
36
+ }
37
+ }
38
+
39
+ function normalizeOuterShadow(shadow) {
40
+ if (!shadow || shadow === "none") {
41
+ return void 0;
42
+ } else {
43
+ return shadow;
44
+ }
45
+ }
46
+
23
47
  function normalizeFill(fill) {
24
48
  if (!fill || fill === "none") {
25
49
  return void 0;
@@ -206,6 +230,7 @@ function normalizeElement(element) {
206
230
  shadow: normalizeShadow(element.shadow),
207
231
  video: normalizeVideo(element.video),
208
232
  audio: normalizeVideo(element.audio),
233
+ effect: normalizeEffect(element.effect),
209
234
  children: element.children?.map((child) => normalizeElement(child))
210
235
  });
211
236
  }
@@ -390,10 +415,13 @@ exports.getDefaultTransformStyle = getDefaultTransformStyle;
390
415
  exports.normalizeAudio = normalizeAudio;
391
416
  exports.normalizeBackground = normalizeBackground;
392
417
  exports.normalizeDocument = normalizeDocument;
418
+ exports.normalizeEffect = normalizeEffect;
393
419
  exports.normalizeElement = normalizeElement;
394
420
  exports.normalizeFill = normalizeFill;
395
421
  exports.normalizeForeground = normalizeForeground;
396
422
  exports.normalizeGeometry = normalizeGeometry;
423
+ exports.normalizeInnerShadow = normalizeInnerShadow;
424
+ exports.normalizeOuterShadow = normalizeOuterShadow;
397
425
  exports.normalizeOutline = normalizeOutline;
398
426
  exports.normalizeShadow = normalizeShadow;
399
427
  exports.normalizeText = normalizeText;
package/dist/index.d.cts CHANGED
@@ -122,6 +122,34 @@ type BackgroundDeclaration = FillDeclaration;
122
122
  type BackgroundProperty = None | string | BackgroundDeclaration;
123
123
  declare function normalizeBackground(background?: BackgroundProperty): BackgroundDeclaration | undefined;
124
124
 
125
+ interface InnerShadowDeclaration {
126
+ color: ColorValue;
127
+ offsetX?: number;
128
+ offsetY?: number;
129
+ blur?: number;
130
+ }
131
+ type InnerShadowProperty = None | InnerShadowDeclaration;
132
+ declare function normalizeInnerShadow(shadow?: InnerShadowProperty): InnerShadowDeclaration | undefined;
133
+
134
+ interface OuterShadowDeclaration extends InnerShadowDeclaration {
135
+ }
136
+ type OuterShadowProperty = None | OuterShadowDeclaration;
137
+ declare function normalizeOuterShadow(shadow?: OuterShadowProperty): OuterShadowDeclaration | undefined;
138
+
139
+ interface SoftEdgeDeclaration {
140
+ radius: number;
141
+ }
142
+ interface SoftEdge {
143
+ }
144
+
145
+ interface EffectDeclaration {
146
+ innerShadow?: InnerShadowDeclaration;
147
+ outerShadow?: OuterShadowDeclaration;
148
+ softEdge?: SoftEdgeDeclaration;
149
+ }
150
+ type EffectProperty = None | EffectDeclaration;
151
+ declare function normalizeEffect(effect?: EffectProperty): EffectDeclaration | undefined;
152
+
125
153
  type ForegroundDeclaration = FillDeclaration;
126
154
  type ForegroundProperty = None | string | ForegroundDeclaration;
127
155
  declare function normalizeForeground(foreground?: ForegroundProperty): ForegroundDeclaration | undefined;
@@ -424,6 +452,7 @@ interface Element<T = MetaProperty> extends Node<T> {
424
452
  shadow?: ShadowProperty;
425
453
  video?: VideoProperty;
426
454
  audio?: AudioProperty;
455
+ effect?: EffectProperty;
427
456
  children?: Element[];
428
457
  }
429
458
  interface ElementDeclaration<T = MetaProperty> extends Element<T> {
@@ -436,6 +465,7 @@ interface ElementDeclaration<T = MetaProperty> extends Element<T> {
436
465
  shadow?: ShadowDeclaration;
437
466
  video?: VideoDeclaration;
438
467
  audio?: AudioDeclaration;
468
+ effect?: EffectDeclaration;
439
469
  children?: ElementDeclaration[];
440
470
  }
441
471
  declare function normalizeElement<T = MetaProperty>(element: Element<T>): ElementDeclaration<T>;
@@ -450,4 +480,4 @@ declare function normalizeDocument(doc: Document): DocumentDeclaration;
450
480
 
451
481
  declare function clearUndef<T>(obj: T, deep?: boolean): T;
452
482
 
453
- export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, 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 Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, 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 VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
483
+ export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, 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 Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, 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 OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SoftEdge, type SoftEdgeDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, 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 VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
package/dist/index.d.mts CHANGED
@@ -122,6 +122,34 @@ type BackgroundDeclaration = FillDeclaration;
122
122
  type BackgroundProperty = None | string | BackgroundDeclaration;
123
123
  declare function normalizeBackground(background?: BackgroundProperty): BackgroundDeclaration | undefined;
124
124
 
125
+ interface InnerShadowDeclaration {
126
+ color: ColorValue;
127
+ offsetX?: number;
128
+ offsetY?: number;
129
+ blur?: number;
130
+ }
131
+ type InnerShadowProperty = None | InnerShadowDeclaration;
132
+ declare function normalizeInnerShadow(shadow?: InnerShadowProperty): InnerShadowDeclaration | undefined;
133
+
134
+ interface OuterShadowDeclaration extends InnerShadowDeclaration {
135
+ }
136
+ type OuterShadowProperty = None | OuterShadowDeclaration;
137
+ declare function normalizeOuterShadow(shadow?: OuterShadowProperty): OuterShadowDeclaration | undefined;
138
+
139
+ interface SoftEdgeDeclaration {
140
+ radius: number;
141
+ }
142
+ interface SoftEdge {
143
+ }
144
+
145
+ interface EffectDeclaration {
146
+ innerShadow?: InnerShadowDeclaration;
147
+ outerShadow?: OuterShadowDeclaration;
148
+ softEdge?: SoftEdgeDeclaration;
149
+ }
150
+ type EffectProperty = None | EffectDeclaration;
151
+ declare function normalizeEffect(effect?: EffectProperty): EffectDeclaration | undefined;
152
+
125
153
  type ForegroundDeclaration = FillDeclaration;
126
154
  type ForegroundProperty = None | string | ForegroundDeclaration;
127
155
  declare function normalizeForeground(foreground?: ForegroundProperty): ForegroundDeclaration | undefined;
@@ -424,6 +452,7 @@ interface Element<T = MetaProperty> extends Node<T> {
424
452
  shadow?: ShadowProperty;
425
453
  video?: VideoProperty;
426
454
  audio?: AudioProperty;
455
+ effect?: EffectProperty;
427
456
  children?: Element[];
428
457
  }
429
458
  interface ElementDeclaration<T = MetaProperty> extends Element<T> {
@@ -436,6 +465,7 @@ interface ElementDeclaration<T = MetaProperty> extends Element<T> {
436
465
  shadow?: ShadowDeclaration;
437
466
  video?: VideoDeclaration;
438
467
  audio?: AudioDeclaration;
468
+ effect?: EffectDeclaration;
439
469
  children?: ElementDeclaration[];
440
470
  }
441
471
  declare function normalizeElement<T = MetaProperty>(element: Element<T>): ElementDeclaration<T>;
@@ -450,4 +480,4 @@ declare function normalizeDocument(doc: Document): DocumentDeclaration;
450
480
 
451
481
  declare function clearUndef<T>(obj: T, deep?: boolean): T;
452
482
 
453
- export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, 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 Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, 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 VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
483
+ export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, 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 Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, 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 OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SoftEdge, type SoftEdgeDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, 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 VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
package/dist/index.d.ts CHANGED
@@ -122,6 +122,34 @@ type BackgroundDeclaration = FillDeclaration;
122
122
  type BackgroundProperty = None | string | BackgroundDeclaration;
123
123
  declare function normalizeBackground(background?: BackgroundProperty): BackgroundDeclaration | undefined;
124
124
 
125
+ interface InnerShadowDeclaration {
126
+ color: ColorValue;
127
+ offsetX?: number;
128
+ offsetY?: number;
129
+ blur?: number;
130
+ }
131
+ type InnerShadowProperty = None | InnerShadowDeclaration;
132
+ declare function normalizeInnerShadow(shadow?: InnerShadowProperty): InnerShadowDeclaration | undefined;
133
+
134
+ interface OuterShadowDeclaration extends InnerShadowDeclaration {
135
+ }
136
+ type OuterShadowProperty = None | OuterShadowDeclaration;
137
+ declare function normalizeOuterShadow(shadow?: OuterShadowProperty): OuterShadowDeclaration | undefined;
138
+
139
+ interface SoftEdgeDeclaration {
140
+ radius: number;
141
+ }
142
+ interface SoftEdge {
143
+ }
144
+
145
+ interface EffectDeclaration {
146
+ innerShadow?: InnerShadowDeclaration;
147
+ outerShadow?: OuterShadowDeclaration;
148
+ softEdge?: SoftEdgeDeclaration;
149
+ }
150
+ type EffectProperty = None | EffectDeclaration;
151
+ declare function normalizeEffect(effect?: EffectProperty): EffectDeclaration | undefined;
152
+
125
153
  type ForegroundDeclaration = FillDeclaration;
126
154
  type ForegroundProperty = None | string | ForegroundDeclaration;
127
155
  declare function normalizeForeground(foreground?: ForegroundProperty): ForegroundDeclaration | undefined;
@@ -424,6 +452,7 @@ interface Element<T = MetaProperty> extends Node<T> {
424
452
  shadow?: ShadowProperty;
425
453
  video?: VideoProperty;
426
454
  audio?: AudioProperty;
455
+ effect?: EffectProperty;
427
456
  children?: Element[];
428
457
  }
429
458
  interface ElementDeclaration<T = MetaProperty> extends Element<T> {
@@ -436,6 +465,7 @@ interface ElementDeclaration<T = MetaProperty> extends Element<T> {
436
465
  shadow?: ShadowDeclaration;
437
466
  video?: VideoDeclaration;
438
467
  audio?: AudioDeclaration;
468
+ effect?: EffectDeclaration;
439
469
  children?: ElementDeclaration[];
440
470
  }
441
471
  declare function normalizeElement<T = MetaProperty>(element: Element<T>): ElementDeclaration<T>;
@@ -450,4 +480,4 @@ declare function normalizeDocument(doc: Document): DocumentDeclaration;
450
480
 
451
481
  declare function clearUndef<T>(obj: T, deep?: boolean): T;
452
482
 
453
- export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, 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 Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type Node, type None, type ObjectColor, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, 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 VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
483
+ export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type EffectDeclaration, type EffectProperty, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, 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 Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, 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 OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SoftEdge, type SoftEdgeDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, 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 VerticalAlign, type VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, 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(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function g(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 c(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function m(e){if(!(!e||e==="none"))return typeof e=="string"?{paths:[{data:e}]}:Array.isArray(e)?{paths:e.map(i=>typeof i=="string"?{data:i}:i)}:e}function y(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function v(){return{boxShadow:"none"}}function h(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(r=>({...r}))}:Array.isArray(t)?{fragments:t.map(r=>typeof r=="string"?{content:r}:{...r})}:{fragments:[]})}function S(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 l(e,i=!1){if(typeof e!="object"||!e)return e;if(Array.isArray(e))return i?e.map(r=>l(r,i)):e;const t={};for(const r in e){const a=e[r];a!=null&&(i?t[r]=l(a,i):t[r]=a)}return t}function u(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function d(e){var i;return l({...e,text:S(e.text),background:g(e.background),geometry:m(e.geometry),fill:s(e.fill),outline:y(e.outline),foreground:c(e.foreground),shadow:h(e.shadow),video:u(e.video),audio:u(e.audio),children:(i=e.children)==null?void 0:i.map(t=>d(t))})}function C(e){return d(e)}function z(){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 D(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function T(){return{...z(),...D(),...v(),backgroundImage:"none",backgroundColor:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"#000000",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function b(){return{highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function p(){return{listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function k(){return{...b(),color:"black",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function w(){return{...p(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function A(){return{...w(),...k(),textStrokeWidth:0,textStrokeColor:"black"}}function I(){return{...T(),...A()}}n.clearUndef=l,n.getDefaultElementStyle=T,n.getDefaultHighlightStyle=b,n.getDefaultLayoutStyle=z,n.getDefaultListStyleStyle=p,n.getDefaultShadowStyle=v,n.getDefaultStyle=I,n.getDefaultTextInlineStyle=k,n.getDefaultTextLineStyle=w,n.getDefaultTextStyle=A,n.getDefaultTransformStyle=D,n.normalizeAudio=o,n.normalizeBackground=g,n.normalizeDocument=C,n.normalizeElement=d,n.normalizeFill=s,n.normalizeForeground=c,n.normalizeGeometry=m,n.normalizeOutline=y,n.normalizeShadow=h,n.normalizeText=S,n.normalizeTextContent=f,n.normalizeVideo=u,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(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function g(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function s(e){if(!(!e||e==="none"))return e}function C(e){if(!(!e||e==="none"))return e}function L(e){if(!(!e||e==="none"))return e}function c(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function m(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function y(e){if(!(!e||e==="none"))return typeof e=="string"?{paths:[{data:e}]}:Array.isArray(e)?{paths:e.map(i=>typeof i=="string"?{data:i}:i)}:e}function v(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function h(){return{boxShadow:"none"}}function S(e){if(!(!e||e==="none"))return typeof e=="string"?{color:e}:e}function a(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(r=>({...r}))}:Array.isArray(t)?{fragments:t.map(r=>typeof r=="string"?{content:r}:{...r})}:{fragments:[]})}function z(e){if(!(!e||e==="none"))return typeof e=="string"?{content:[{fragments:[{content:e}]}]}:"content"in e?{...e,content:a(e.content)}:{content:a(e)}}function l(e,i=!1){if(typeof e!="object"||!e)return e;if(Array.isArray(e))return i?e.map(r=>l(r,i)):e;const t={};for(const r in e){const f=e[r];f!=null&&(i?t[r]=l(f,i):t[r]=f)}return t}function u(e){if(!(!e||e==="none"))return typeof e=="string"?{src:e}:e}function d(e){var i;return l({...e,text:z(e.text),background:g(e.background),geometry:y(e.geometry),fill:c(e.fill),outline:v(e.outline),foreground:m(e.foreground),shadow:S(e.shadow),video:u(e.video),audio:u(e.audio),effect:s(e.effect),children:(i=e.children)==null?void 0:i.map(t=>d(t))})}function O(e){return d(e)}function D(){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 T(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function b(){return{...D(),...T(),...h(),backgroundImage:"none",backgroundColor:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"#000000",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function p(){return{highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function k(){return{listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function w(){return{...p(),color:"black",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function A(){return{...k(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function I(){return{...A(),...w(),textStrokeWidth:0,textStrokeColor:"black"}}function W(){return{...b(),...I()}}n.clearUndef=l,n.getDefaultElementStyle=b,n.getDefaultHighlightStyle=p,n.getDefaultLayoutStyle=D,n.getDefaultListStyleStyle=k,n.getDefaultShadowStyle=h,n.getDefaultStyle=W,n.getDefaultTextInlineStyle=w,n.getDefaultTextLineStyle=A,n.getDefaultTextStyle=I,n.getDefaultTransformStyle=T,n.normalizeAudio=o,n.normalizeBackground=g,n.normalizeDocument=O,n.normalizeEffect=s,n.normalizeElement=d,n.normalizeFill=c,n.normalizeForeground=m,n.normalizeGeometry=y,n.normalizeInnerShadow=C,n.normalizeOuterShadow=L,n.normalizeOutline=v,n.normalizeShadow=S,n.normalizeText=z,n.normalizeTextContent=a,n.normalizeVideo=u,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/dist/index.mjs CHANGED
@@ -18,6 +18,30 @@ function normalizeBackground(background) {
18
18
  }
19
19
  }
20
20
 
21
+ function normalizeEffect(effect) {
22
+ if (!effect || effect === "none") {
23
+ return void 0;
24
+ } else {
25
+ return effect;
26
+ }
27
+ }
28
+
29
+ function normalizeInnerShadow(shadow) {
30
+ if (!shadow || shadow === "none") {
31
+ return void 0;
32
+ } else {
33
+ return shadow;
34
+ }
35
+ }
36
+
37
+ function normalizeOuterShadow(shadow) {
38
+ if (!shadow || shadow === "none") {
39
+ return void 0;
40
+ } else {
41
+ return shadow;
42
+ }
43
+ }
44
+
21
45
  function normalizeFill(fill) {
22
46
  if (!fill || fill === "none") {
23
47
  return void 0;
@@ -204,6 +228,7 @@ function normalizeElement(element) {
204
228
  shadow: normalizeShadow(element.shadow),
205
229
  video: normalizeVideo(element.video),
206
230
  audio: normalizeVideo(element.audio),
231
+ effect: normalizeEffect(element.effect),
207
232
  children: element.children?.map((child) => normalizeElement(child))
208
233
  });
209
234
  }
@@ -374,4 +399,4 @@ function getDefaultStyle() {
374
399
  };
375
400
  }
376
401
 
377
- export { clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
402
+ export { clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-idoc",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "Intermediate document for modern codec libs",
7
7
  "author": "wxm",