modern-text 1.6.4 → 1.7.1

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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Text = require('./shared/modern-text.Dr7A9mkS.cjs');
3
+ const Text = require('./shared/modern-text.DRQ7O0S3.cjs');
4
4
  require('modern-idoc');
5
5
  require('modern-path2d');
6
6
  require('modern-font');
@@ -30,7 +30,7 @@ exports.Fragment = Text.Fragment;
30
30
  exports.Measurer = Text.Measurer;
31
31
  exports.Paragraph = Text.Paragraph;
32
32
  exports.Text = Text.Text;
33
- exports.background = Text.background;
33
+ exports.backgroundPlugin = Text.backgroundPlugin;
34
34
  exports.createSVGLoader = Text.createSVGLoader;
35
35
  exports.createSVGParser = Text.createSVGParser;
36
36
  exports.definePlugin = Text.definePlugin;
@@ -39,17 +39,17 @@ exports.filterEmpty = Text.filterEmpty;
39
39
  exports.getHighlightStyle = Text.getHighlightStyle;
40
40
  exports.getTransform2D = Text.getTransform2D;
41
41
  exports.hexToRgb = Text.hexToRgb;
42
- exports.highlight = Text.highlight;
42
+ exports.highlightPlugin = Text.highlightPlugin;
43
43
  exports.isEqualObject = Text.isEqualObject;
44
44
  exports.isEqualValue = Text.isEqualValue;
45
- exports.listStyle = Text.listStyle;
46
- exports.outline = Text.outline;
45
+ exports.listStylePlugin = Text.listStylePlugin;
46
+ exports.outlinePlugin = Text.outlinePlugin;
47
47
  exports.parseColor = Text.parseColor;
48
48
  exports.parseColormap = Text.parseColormap;
49
49
  exports.parseValueNumber = Text.parseValueNumber;
50
- exports.render = Text.render;
50
+ exports.renderPlugin = Text.renderPlugin;
51
51
  exports.setupView = Text.setupView;
52
- exports.textDecoration = Text.textDecoration;
52
+ exports.textDecorationPlugin = Text.textDecorationPlugin;
53
53
  exports.textDefaultStyle = Text.textDefaultStyle;
54
54
  exports.uploadColor = Text.uploadColor;
55
55
  exports.uploadColors = Text.uploadColors;
package/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { NormalizedStyle, NormalizedHighlight } from 'modern-idoc';
2
2
  import { BoundingBox, Path2DDrawStyle, Path2D, Matrix3, Path2DSet } from 'modern-path2d';
3
- import { T as Text, a as TextPlugin, b as TextOptions, M as MeasureResult, c as TextRenderOptions } from './shared/modern-text.BkGahE0H.cjs';
4
- export { C as Character, F as Fragment, f as MeasuredCharacter, e as MeasuredFragment, d as MeasuredParagraph, g as Measurer, P as Paragraph, h as TextEventMap, m as measureDOMResult, t as textDefaultStyle } from './shared/modern-text.BkGahE0H.cjs';
3
+ import { T as Text, a as TextPlugin, b as TextOptions, M as MeasureResult, c as TextRenderOptions } from './shared/modern-text.BExNokxh.cjs';
4
+ export { C as Character, F as Fragment, f as MeasuredCharacter, e as MeasuredFragment, d as MeasuredParagraph, g as Measurer, P as Paragraph, h as TextEventMap, m as measureDOMResult, t as textDefaultStyle } from './shared/modern-text.BExNokxh.cjs';
5
5
  import 'modern-font';
6
6
 
7
7
  declare function parseColor(ctx: CanvasRenderingContext2D, source: string | CanvasGradient | CanvasPattern, box: BoundingBox): string | CanvasGradient | CanvasPattern;
8
- declare function uploadColor(style: Partial<NormalizedStyle>, box: BoundingBox, ctx: CanvasRenderingContext2D): void;
8
+ declare function uploadColor(style: NormalizedStyle, box: BoundingBox, ctx: CanvasRenderingContext2D): void;
9
9
  interface LinearGradient {
10
10
  x0: number;
11
11
  y0: number;
@@ -17,7 +17,7 @@ interface LinearGradient {
17
17
  }[];
18
18
  }
19
19
 
20
- interface DrawShapePathsOptions extends Partial<NormalizedStyle>, Omit<Partial<Path2DDrawStyle>, 'fill' | 'outline'> {
20
+ interface DrawShapePathsOptions extends NormalizedStyle, Omit<Partial<Path2DDrawStyle>, 'fill' | 'outline'> {
21
21
  ctx: CanvasRenderingContext2D;
22
22
  path: Path2D;
23
23
  fontSize: number;
@@ -38,19 +38,19 @@ type RenderTextOptions = TextOptions & TextRenderOptions;
38
38
  declare function renderText(options: RenderTextOptions, load: true): Promise<void>;
39
39
  declare function renderText(options: RenderTextOptions): void;
40
40
 
41
- declare function background(): TextPlugin;
41
+ declare function backgroundPlugin(): TextPlugin;
42
42
 
43
43
  declare function getHighlightStyle(style: NormalizedStyle): NormalizedHighlight;
44
- declare function highlight(): TextPlugin;
44
+ declare function highlightPlugin(): TextPlugin;
45
45
 
46
- declare function listStyle(): TextPlugin;
46
+ declare function listStylePlugin(): TextPlugin;
47
47
 
48
- declare function outline(): TextPlugin;
48
+ declare function outlinePlugin(): TextPlugin;
49
49
 
50
- declare function render(): TextPlugin;
51
- declare function getTransform2D(text: Text, style: Partial<NormalizedStyle>): Matrix3;
50
+ declare function renderPlugin(): TextPlugin;
51
+ declare function getTransform2D(text: Text, style: NormalizedStyle): Matrix3;
52
52
 
53
- declare function textDecoration(): TextPlugin;
53
+ declare function textDecorationPlugin(): TextPlugin;
54
54
 
55
55
  interface SVGLoader {
56
56
  loaded: Map<string, string>;
@@ -82,5 +82,5 @@ declare function isEqualValue(val1: any, val2: any): boolean;
82
82
  declare function hexToRgb(hex: string): string | null;
83
83
  declare function filterEmpty(val: Record<string, any> | undefined): Record<string, any> | undefined;
84
84
 
85
- export { MeasureResult, Text, TextOptions, TextPlugin, TextRenderOptions, background, createSVGLoader, createSVGParser, definePlugin, drawPath, filterEmpty, getHighlightStyle, getTransform2D, hexToRgb, highlight, isEqualObject, isEqualValue, listStyle, measureText, outline, parseColor, parseColormap, parseValueNumber, render, renderText, setupView, textDecoration, uploadColor, uploadColors };
85
+ export { MeasureResult, Text, TextOptions, TextPlugin, TextRenderOptions, backgroundPlugin, createSVGLoader, createSVGParser, definePlugin, drawPath, filterEmpty, getHighlightStyle, getTransform2D, hexToRgb, highlightPlugin, isEqualObject, isEqualValue, listStylePlugin, measureText, outlinePlugin, parseColor, parseColormap, parseValueNumber, renderPlugin, renderText, setupView, textDecorationPlugin, uploadColor, uploadColors };
86
86
  export type { DrawShapePathsOptions, LinearGradient, RenderTextOptions, SVGLoader, SVGParser };
package/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { NormalizedStyle, NormalizedHighlight } from 'modern-idoc';
2
2
  import { BoundingBox, Path2DDrawStyle, Path2D, Matrix3, Path2DSet } from 'modern-path2d';
3
- import { T as Text, a as TextPlugin, b as TextOptions, M as MeasureResult, c as TextRenderOptions } from './shared/modern-text.BkGahE0H.mjs';
4
- export { C as Character, F as Fragment, f as MeasuredCharacter, e as MeasuredFragment, d as MeasuredParagraph, g as Measurer, P as Paragraph, h as TextEventMap, m as measureDOMResult, t as textDefaultStyle } from './shared/modern-text.BkGahE0H.mjs';
3
+ import { T as Text, a as TextPlugin, b as TextOptions, M as MeasureResult, c as TextRenderOptions } from './shared/modern-text.BExNokxh.mjs';
4
+ export { C as Character, F as Fragment, f as MeasuredCharacter, e as MeasuredFragment, d as MeasuredParagraph, g as Measurer, P as Paragraph, h as TextEventMap, m as measureDOMResult, t as textDefaultStyle } from './shared/modern-text.BExNokxh.mjs';
5
5
  import 'modern-font';
6
6
 
7
7
  declare function parseColor(ctx: CanvasRenderingContext2D, source: string | CanvasGradient | CanvasPattern, box: BoundingBox): string | CanvasGradient | CanvasPattern;
8
- declare function uploadColor(style: Partial<NormalizedStyle>, box: BoundingBox, ctx: CanvasRenderingContext2D): void;
8
+ declare function uploadColor(style: NormalizedStyle, box: BoundingBox, ctx: CanvasRenderingContext2D): void;
9
9
  interface LinearGradient {
10
10
  x0: number;
11
11
  y0: number;
@@ -17,7 +17,7 @@ interface LinearGradient {
17
17
  }[];
18
18
  }
19
19
 
20
- interface DrawShapePathsOptions extends Partial<NormalizedStyle>, Omit<Partial<Path2DDrawStyle>, 'fill' | 'outline'> {
20
+ interface DrawShapePathsOptions extends NormalizedStyle, Omit<Partial<Path2DDrawStyle>, 'fill' | 'outline'> {
21
21
  ctx: CanvasRenderingContext2D;
22
22
  path: Path2D;
23
23
  fontSize: number;
@@ -38,19 +38,19 @@ type RenderTextOptions = TextOptions & TextRenderOptions;
38
38
  declare function renderText(options: RenderTextOptions, load: true): Promise<void>;
39
39
  declare function renderText(options: RenderTextOptions): void;
40
40
 
41
- declare function background(): TextPlugin;
41
+ declare function backgroundPlugin(): TextPlugin;
42
42
 
43
43
  declare function getHighlightStyle(style: NormalizedStyle): NormalizedHighlight;
44
- declare function highlight(): TextPlugin;
44
+ declare function highlightPlugin(): TextPlugin;
45
45
 
46
- declare function listStyle(): TextPlugin;
46
+ declare function listStylePlugin(): TextPlugin;
47
47
 
48
- declare function outline(): TextPlugin;
48
+ declare function outlinePlugin(): TextPlugin;
49
49
 
50
- declare function render(): TextPlugin;
51
- declare function getTransform2D(text: Text, style: Partial<NormalizedStyle>): Matrix3;
50
+ declare function renderPlugin(): TextPlugin;
51
+ declare function getTransform2D(text: Text, style: NormalizedStyle): Matrix3;
52
52
 
53
- declare function textDecoration(): TextPlugin;
53
+ declare function textDecorationPlugin(): TextPlugin;
54
54
 
55
55
  interface SVGLoader {
56
56
  loaded: Map<string, string>;
@@ -82,5 +82,5 @@ declare function isEqualValue(val1: any, val2: any): boolean;
82
82
  declare function hexToRgb(hex: string): string | null;
83
83
  declare function filterEmpty(val: Record<string, any> | undefined): Record<string, any> | undefined;
84
84
 
85
- export { MeasureResult, Text, TextOptions, TextPlugin, TextRenderOptions, background, createSVGLoader, createSVGParser, definePlugin, drawPath, filterEmpty, getHighlightStyle, getTransform2D, hexToRgb, highlight, isEqualObject, isEqualValue, listStyle, measureText, outline, parseColor, parseColormap, parseValueNumber, render, renderText, setupView, textDecoration, uploadColor, uploadColors };
85
+ export { MeasureResult, Text, TextOptions, TextPlugin, TextRenderOptions, backgroundPlugin, createSVGLoader, createSVGParser, definePlugin, drawPath, filterEmpty, getHighlightStyle, getTransform2D, hexToRgb, highlightPlugin, isEqualObject, isEqualValue, listStylePlugin, measureText, outlinePlugin, parseColor, parseColormap, parseValueNumber, renderPlugin, renderText, setupView, textDecorationPlugin, uploadColor, uploadColors };
86
86
  export type { DrawShapePathsOptions, LinearGradient, RenderTextOptions, SVGLoader, SVGParser };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { NormalizedStyle, NormalizedHighlight } from 'modern-idoc';
2
2
  import { BoundingBox, Path2DDrawStyle, Path2D, Matrix3, Path2DSet } from 'modern-path2d';
3
- import { T as Text, a as TextPlugin, b as TextOptions, M as MeasureResult, c as TextRenderOptions } from './shared/modern-text.BkGahE0H.js';
4
- export { C as Character, F as Fragment, f as MeasuredCharacter, e as MeasuredFragment, d as MeasuredParagraph, g as Measurer, P as Paragraph, h as TextEventMap, m as measureDOMResult, t as textDefaultStyle } from './shared/modern-text.BkGahE0H.js';
3
+ import { T as Text, a as TextPlugin, b as TextOptions, M as MeasureResult, c as TextRenderOptions } from './shared/modern-text.BExNokxh.js';
4
+ export { C as Character, F as Fragment, f as MeasuredCharacter, e as MeasuredFragment, d as MeasuredParagraph, g as Measurer, P as Paragraph, h as TextEventMap, m as measureDOMResult, t as textDefaultStyle } from './shared/modern-text.BExNokxh.js';
5
5
  import 'modern-font';
6
6
 
7
7
  declare function parseColor(ctx: CanvasRenderingContext2D, source: string | CanvasGradient | CanvasPattern, box: BoundingBox): string | CanvasGradient | CanvasPattern;
8
- declare function uploadColor(style: Partial<NormalizedStyle>, box: BoundingBox, ctx: CanvasRenderingContext2D): void;
8
+ declare function uploadColor(style: NormalizedStyle, box: BoundingBox, ctx: CanvasRenderingContext2D): void;
9
9
  interface LinearGradient {
10
10
  x0: number;
11
11
  y0: number;
@@ -17,7 +17,7 @@ interface LinearGradient {
17
17
  }[];
18
18
  }
19
19
 
20
- interface DrawShapePathsOptions extends Partial<NormalizedStyle>, Omit<Partial<Path2DDrawStyle>, 'fill' | 'outline'> {
20
+ interface DrawShapePathsOptions extends NormalizedStyle, Omit<Partial<Path2DDrawStyle>, 'fill' | 'outline'> {
21
21
  ctx: CanvasRenderingContext2D;
22
22
  path: Path2D;
23
23
  fontSize: number;
@@ -38,19 +38,19 @@ type RenderTextOptions = TextOptions & TextRenderOptions;
38
38
  declare function renderText(options: RenderTextOptions, load: true): Promise<void>;
39
39
  declare function renderText(options: RenderTextOptions): void;
40
40
 
41
- declare function background(): TextPlugin;
41
+ declare function backgroundPlugin(): TextPlugin;
42
42
 
43
43
  declare function getHighlightStyle(style: NormalizedStyle): NormalizedHighlight;
44
- declare function highlight(): TextPlugin;
44
+ declare function highlightPlugin(): TextPlugin;
45
45
 
46
- declare function listStyle(): TextPlugin;
46
+ declare function listStylePlugin(): TextPlugin;
47
47
 
48
- declare function outline(): TextPlugin;
48
+ declare function outlinePlugin(): TextPlugin;
49
49
 
50
- declare function render(): TextPlugin;
51
- declare function getTransform2D(text: Text, style: Partial<NormalizedStyle>): Matrix3;
50
+ declare function renderPlugin(): TextPlugin;
51
+ declare function getTransform2D(text: Text, style: NormalizedStyle): Matrix3;
52
52
 
53
- declare function textDecoration(): TextPlugin;
53
+ declare function textDecorationPlugin(): TextPlugin;
54
54
 
55
55
  interface SVGLoader {
56
56
  loaded: Map<string, string>;
@@ -82,5 +82,5 @@ declare function isEqualValue(val1: any, val2: any): boolean;
82
82
  declare function hexToRgb(hex: string): string | null;
83
83
  declare function filterEmpty(val: Record<string, any> | undefined): Record<string, any> | undefined;
84
84
 
85
- export { MeasureResult, Text, TextOptions, TextPlugin, TextRenderOptions, background, createSVGLoader, createSVGParser, definePlugin, drawPath, filterEmpty, getHighlightStyle, getTransform2D, hexToRgb, highlight, isEqualObject, isEqualValue, listStyle, measureText, outline, parseColor, parseColormap, parseValueNumber, render, renderText, setupView, textDecoration, uploadColor, uploadColors };
85
+ export { MeasureResult, Text, TextOptions, TextPlugin, TextRenderOptions, backgroundPlugin, createSVGLoader, createSVGParser, definePlugin, drawPath, filterEmpty, getHighlightStyle, getTransform2D, hexToRgb, highlightPlugin, isEqualObject, isEqualValue, listStylePlugin, measureText, outlinePlugin, parseColor, parseColormap, parseValueNumber, renderPlugin, renderText, setupView, textDecorationPlugin, uploadColor, uploadColors };
86
86
  export type { DrawShapePathsOptions, LinearGradient, RenderTextOptions, SVGLoader, SVGParser };