microboard-temp 0.6.4 → 0.7.0
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/cjs/browser.js +258 -48
- package/dist/cjs/index.js +258 -48
- package/dist/cjs/node.js +258 -48
- package/dist/esm/browser.js +258 -48
- package/dist/esm/index.js +258 -48
- package/dist/esm/node.js +258 -48
- package/dist/types/Color/ColorValue.d.ts +54 -0
- package/dist/types/Color/ContrastPalette.d.ts +45 -0
- package/dist/types/Color/colorUtils.d.ts +32 -0
- package/dist/types/Color/index.d.ts +6 -0
- package/dist/types/Color/resolveColor.d.ts +26 -0
- package/dist/types/Items/Connector/Connector.d.ts +4 -3
- package/dist/types/Items/Connector/ConnectorOperations.d.ts +3 -2
- package/dist/types/Items/Drawing/Drawing.d.ts +5 -3
- package/dist/types/Items/Drawing/DrawingOperation.d.ts +2 -1
- package/dist/types/Items/Frame/Frame.d.ts +7 -6
- package/dist/types/Items/Frame/FrameData.d.ts +6 -5
- package/dist/types/Items/Frame/FrameOperation.d.ts +2 -1
- package/dist/types/Items/Mbr/Mbr.d.ts +3 -3
- package/dist/types/Items/Shape/Shape.d.ts +9 -8
- package/dist/types/Items/Shape/ShapeData.d.ts +6 -5
- package/dist/types/Items/Shape/ShapeOperation.d.ts +3 -2
- package/dist/types/Items/Sticker/Sticker.d.ts +5 -4
- package/dist/types/Items/Sticker/StickerOperation.d.ts +4 -3
- package/dist/types/Settings.d.ts +7 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 2.1 color-contrast utilities.
|
|
3
|
+
*
|
|
4
|
+
* All calculations follow the W3C specification:
|
|
5
|
+
* https://www.w3.org/TR/WCAG21/#dfn-relative-luminance
|
|
6
|
+
*/
|
|
7
|
+
/** Convert a single sRGB channel value (0–255) to linear light. */
|
|
8
|
+
export declare function srgbChannelToLinear(channel: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Relative luminance of an sRGB colour (channels 0–255).
|
|
11
|
+
* Returns a value in [0, 1] where 0 = black, 1 = white.
|
|
12
|
+
*/
|
|
13
|
+
export declare function relativeLuminance(r: number, g: number, b: number): number;
|
|
14
|
+
/**
|
|
15
|
+
* WCAG contrast ratio between two relative luminance values.
|
|
16
|
+
* Returns a value ≥1 (1 = no contrast, 21 = black on white).
|
|
17
|
+
*/
|
|
18
|
+
export declare function contrastRatio(lum1: number, lum2: number): number;
|
|
19
|
+
/** Returns true if the contrast ratio meets WCAG 2.1 AA (≥4.5:1). */
|
|
20
|
+
export declare function meetsWCAG_AA(ratio: number): boolean;
|
|
21
|
+
/** Returns true if the contrast ratio meets WCAG 2.1 AAA (≥7:1). */
|
|
22
|
+
export declare function meetsWCAG_AAA(ratio: number): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Parse an `rgb(r, g, b)` or `rgba(r, g, b, a)` CSS string.
|
|
25
|
+
* Returns `[r, g, b]` channels in [0, 255], or `null` if unparseable.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseCssRgb(css: string): [number, number, number] | null;
|
|
28
|
+
/**
|
|
29
|
+
* Compute the WCAG contrast ratio between two CSS `rgb(…)` strings.
|
|
30
|
+
* Returns `null` if either string cannot be parsed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function cssContrastRatio(css1: string, css2: string): number | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { Theme, ColorRole, SemanticColorId, SemanticColor, FixedColor, ColorValue } from './ColorValue';
|
|
2
|
+
export { SEMANTIC_COLOR_IDS, semanticColor, fixedColor, coerceColorValue, coerceOptionalColorValue } from './ColorValue';
|
|
3
|
+
export type { ContrastPair } from './ContrastPalette';
|
|
4
|
+
export { CONTRAST_PALETTE, CONTRAST_PALETTE_LIST } from './ContrastPalette';
|
|
5
|
+
export { resolveColor, resolvePairedForeground } from './resolveColor';
|
|
6
|
+
export { srgbChannelToLinear, relativeLuminance, contrastRatio, meetsWCAG_AA, meetsWCAG_AAA, parseCssRgb, cssContrastRatio, } from './colorUtils';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ColorValue, ColorRole, Theme } from './ColorValue';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a `ColorValue` to a concrete CSS colour string for rendering.
|
|
4
|
+
*
|
|
5
|
+
* @param value The stored colour — either a semantic ID or a fixed string.
|
|
6
|
+
* @param theme The active display theme (`'light'` or `'dark'`).
|
|
7
|
+
* @param role Whether this colour is used as a `'background'` surface or a
|
|
8
|
+
* `'foreground'` element (text, stroke, icon).
|
|
9
|
+
*
|
|
10
|
+
* Resolution rules for semantic colours:
|
|
11
|
+
* ```
|
|
12
|
+
* light mode dark mode
|
|
13
|
+
* background pair.light → pair.dark
|
|
14
|
+
* foreground pair.dark → pair.light
|
|
15
|
+
* ```
|
|
16
|
+
* Fixed colours are returned unchanged regardless of theme or role.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveColor(value: ColorValue | string, theme: Theme, role: ColorRole): string;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve the *paired* foreground colour for a given background ColorValue.
|
|
21
|
+
*
|
|
22
|
+
* When a semantic colour is used as a background, this returns the guaranteed
|
|
23
|
+
* accessible foreground for the same pair. For fixed colours it falls back to
|
|
24
|
+
* a neutral dark or light foreground depending on theme.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolvePairedForeground(background: ColorValue, theme: Theme): string;
|
|
@@ -17,6 +17,7 @@ import { LinkTo } from '../LinkTo/LinkTo';
|
|
|
17
17
|
import { DocumentFactory } from '../../api/DocumentFactory';
|
|
18
18
|
import { ConnectorAnchorColors } from './types';
|
|
19
19
|
import { BaseItem } from "../BaseItem";
|
|
20
|
+
import { ColorValue } from '../../..';
|
|
20
21
|
export declare const ConnectorLineStyles: readonly ["straight", "curved", "orthogonal"];
|
|
21
22
|
export type ConnectorLineStyle = (typeof ConnectorLineStyles)[number];
|
|
22
23
|
export declare const ConnectionLineWidths: readonly [1, 2, 3, 4, 5, 6, 7, 8, 12];
|
|
@@ -52,7 +53,7 @@ export declare class Connector extends BaseItem {
|
|
|
52
53
|
readonly text: RichText;
|
|
53
54
|
transformationRenderBlock?: boolean;
|
|
54
55
|
private optionalFindItemFn?;
|
|
55
|
-
constructor(board: Board, startPoint?: ControlPoint, endPoint?: ControlPoint, lineStyle?: ConnectorLineStyle, startPointerStyle?: ConnectorPointerStyle, endPointerStyle?: ConnectorPointerStyle, lineColor?:
|
|
56
|
+
constructor(board: Board, startPoint?: ControlPoint, endPoint?: ControlPoint, lineStyle?: ConnectorLineStyle, startPointerStyle?: ConnectorPointerStyle, endPointerStyle?: ConnectorPointerStyle, lineColor?: ColorValue, lineWidth?: ConnectionLineWidth, strokeStyle?: BorderStyle, id?: string);
|
|
56
57
|
private initText;
|
|
57
58
|
observerStartPointItem: () => void;
|
|
58
59
|
observerEndPointItem: () => void;
|
|
@@ -76,7 +77,7 @@ export declare class Connector extends BaseItem {
|
|
|
76
77
|
private applyStartPointerStyle;
|
|
77
78
|
setEndPointerStyle(style: ConnectorPointerStyle): void;
|
|
78
79
|
private applyEndPointerStyle;
|
|
79
|
-
setLineColor(color:
|
|
80
|
+
setLineColor(color: ColorValue): void;
|
|
80
81
|
private applyLineColor;
|
|
81
82
|
setLineStyle(style: ConnectorLineStyle): void;
|
|
82
83
|
private applyLineStyle;
|
|
@@ -93,7 +94,7 @@ export declare class Connector extends BaseItem {
|
|
|
93
94
|
};
|
|
94
95
|
getStartPointerStyle(): ConnectorPointerStyle;
|
|
95
96
|
getEndPointerStyle(): ConnectorPointerStyle;
|
|
96
|
-
getLineColor():
|
|
97
|
+
getLineColor(): ColorValue;
|
|
97
98
|
getLineStyle(): ConnectorLineStyle;
|
|
98
99
|
getBorderStyle(): BorderStyle;
|
|
99
100
|
getLineWidth(): ConnectionLineWidth;
|
|
@@ -5,6 +5,7 @@ import { DefaultRichTextData } from "../RichText/RichTextData";
|
|
|
5
5
|
import { DefaultTransformationData } from "../Transformation/TransformationData";
|
|
6
6
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
7
7
|
import { BorderStyle } from "../Path";
|
|
8
|
+
import { ColorValue } from "../../..";
|
|
8
9
|
export declare class ConnectorData {
|
|
9
10
|
readonly itemType = "Connector";
|
|
10
11
|
startPoint: ControlPointData;
|
|
@@ -13,7 +14,7 @@ export declare class ConnectorData {
|
|
|
13
14
|
startPointerStyle: ConnectorPointerStyle;
|
|
14
15
|
endPointerStyle: ConnectorPointerStyle;
|
|
15
16
|
lineStyle: ConnectorLineStyle;
|
|
16
|
-
lineColor:
|
|
17
|
+
lineColor: ColorValue;
|
|
17
18
|
linkTo?: string | LinkTo;
|
|
18
19
|
lineWidth: ConnectionLineWidth;
|
|
19
20
|
borderStyle: BorderStyle;
|
|
@@ -70,7 +71,7 @@ interface SetLineColor {
|
|
|
70
71
|
class: "Connector";
|
|
71
72
|
method: "setLineColor";
|
|
72
73
|
item: string[];
|
|
73
|
-
lineColor:
|
|
74
|
+
lineColor: ColorValue;
|
|
74
75
|
}
|
|
75
76
|
interface SetLineWidth {
|
|
76
77
|
class: "Connector";
|
|
@@ -12,6 +12,7 @@ import { LinkTo } from "../LinkTo/LinkTo";
|
|
|
12
12
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
13
13
|
import { Board } from "../../Board";
|
|
14
14
|
import { BaseItem } from "../BaseItem/BaseItem";
|
|
15
|
+
import { ColorValue } from "../../..";
|
|
15
16
|
export interface DrawingData {
|
|
16
17
|
itemType: "Drawing";
|
|
17
18
|
points: {
|
|
@@ -19,7 +20,7 @@ export interface DrawingData {
|
|
|
19
20
|
y: number;
|
|
20
21
|
}[];
|
|
21
22
|
transformation: TransformationData;
|
|
22
|
-
strokeStyle: string;
|
|
23
|
+
strokeStyle: ColorValue | string;
|
|
23
24
|
strokeWidth: number;
|
|
24
25
|
linkTo?: string;
|
|
25
26
|
}
|
|
@@ -35,6 +36,7 @@ export declare class Drawing extends BaseItem {
|
|
|
35
36
|
private lines;
|
|
36
37
|
readonly linkTo: LinkTo;
|
|
37
38
|
strokeWidth: BorderWidth;
|
|
39
|
+
borderColor: ColorValue;
|
|
38
40
|
borderStyle: BorderStyle;
|
|
39
41
|
private linePattern;
|
|
40
42
|
private borderOpacity;
|
|
@@ -64,8 +66,8 @@ export declare class Drawing extends BaseItem {
|
|
|
64
66
|
getStrokeOpacity(): number;
|
|
65
67
|
setBorderStyle(style: BorderStyle): this;
|
|
66
68
|
getBorderStyle(): BorderStyle;
|
|
67
|
-
setStrokeColor(color:
|
|
68
|
-
getStrokeColor():
|
|
69
|
+
setStrokeColor(color: ColorValue): this;
|
|
70
|
+
getStrokeColor(): ColorValue;
|
|
69
71
|
setStrokeWidth(width: number): this;
|
|
70
72
|
getLinkTo(): string | undefined;
|
|
71
73
|
getStrokeWidth(): number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BorderStyle } from "../Path";
|
|
2
|
+
import { ColorValue } from "../../..";
|
|
2
3
|
interface DrawingSetStrokeColorOp {
|
|
3
4
|
class: "Drawing";
|
|
4
5
|
method: "setStrokeColor";
|
|
5
6
|
item: string[];
|
|
6
|
-
color:
|
|
7
|
+
color: ColorValue;
|
|
7
8
|
}
|
|
8
9
|
interface DrawingSetStrokeWidthOp {
|
|
9
10
|
class: "Drawing";
|
|
@@ -12,13 +12,14 @@ import { FrameData } from "./FrameData";
|
|
|
12
12
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
13
13
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
14
14
|
import { BaseItem } from "../BaseItem";
|
|
15
|
+
import { ColorValue } from "../../..";
|
|
15
16
|
export declare class Frame extends BaseItem {
|
|
16
17
|
private getItemById;
|
|
17
18
|
private name;
|
|
18
19
|
private shapeType;
|
|
19
|
-
backgroundColor:
|
|
20
|
+
backgroundColor: ColorValue;
|
|
20
21
|
backgroundOpacity: number;
|
|
21
|
-
borderColor:
|
|
22
|
+
borderColor: ColorValue;
|
|
22
23
|
borderOpacity: number;
|
|
23
24
|
borderStyle: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash";
|
|
24
25
|
borderWidth: number;
|
|
@@ -36,7 +37,7 @@ export declare class Frame extends BaseItem {
|
|
|
36
37
|
canBeNested: boolean;
|
|
37
38
|
newShape: FrameType | null;
|
|
38
39
|
transformationRenderBlock?: boolean;
|
|
39
|
-
constructor(board: Board, getItemById: (id: string) => Item | undefined, id?: string, name?: string, shapeType?: "Custom" | "A4" | "Letter" | "Frame16x9" | "Frame4x3" | "Frame1x1" | "Frame3x2" | "Frame9x18", backgroundColor?:
|
|
40
|
+
constructor(board: Board, getItemById: (id: string) => Item | undefined, id?: string, name?: string, shapeType?: "Custom" | "A4" | "Letter" | "Frame16x9" | "Frame4x3" | "Frame1x1" | "Frame3x2" | "Frame9x18", backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash", borderWidth?: number);
|
|
40
41
|
setBoard(board: Board): this;
|
|
41
42
|
/** Sets parent of child and emits add child message */
|
|
42
43
|
/**
|
|
@@ -90,12 +91,12 @@ export declare class Frame extends BaseItem {
|
|
|
90
91
|
getCanChangeRatio(): boolean;
|
|
91
92
|
private applyCanChangeRatio;
|
|
92
93
|
setCanChangeRatio(canChangeRatio: boolean): void;
|
|
93
|
-
getBorderColor():
|
|
94
|
+
getBorderColor(): ColorValue;
|
|
94
95
|
getBorderWidth(): number;
|
|
95
|
-
getBackgroundColor():
|
|
96
|
+
getBackgroundColor(): ColorValue;
|
|
96
97
|
setNewShape(type: FrameType | null): void;
|
|
97
98
|
private applyBackgroundColor;
|
|
98
|
-
setBackgroundColor(backgroundColor:
|
|
99
|
+
setBackgroundColor(backgroundColor: ColorValue): void;
|
|
99
100
|
getExportName(): string;
|
|
100
101
|
export(board: Board, name?: string): Promise<SnapshotInfo>;
|
|
101
102
|
render(context: DrawingContext): void;
|
|
@@ -2,6 +2,7 @@ import { DefaultTransformationData, TransformationData } from '../Transformation
|
|
|
2
2
|
import { RichTextData } from '../RichText';
|
|
3
3
|
import { BorderStyle, BorderWidth } from '../Path';
|
|
4
4
|
import { FrameType } from './Basic';
|
|
5
|
+
import { ColorValue } from '../../..';
|
|
5
6
|
export declare const FRAME_BORDER_COLOR = "rgba(10, 15, 41, 0.08)";
|
|
6
7
|
export declare const FRAME_HIGHLIGHTER_BORDER_COLOR = "#93AFF6";
|
|
7
8
|
export declare const FRAME_CHILDREN_HIGHLIGHTER_COLOR = "rgb(10, 15, 41, .08)";
|
|
@@ -37,9 +38,9 @@ export declare const FRAME_FILL_COLOR: string;
|
|
|
37
38
|
export interface FrameData {
|
|
38
39
|
readonly itemType: 'Frame';
|
|
39
40
|
shapeType: FrameType;
|
|
40
|
-
backgroundColor:
|
|
41
|
+
backgroundColor: ColorValue;
|
|
41
42
|
backgroundOpacity: number;
|
|
42
|
-
borderColor:
|
|
43
|
+
borderColor: ColorValue;
|
|
43
44
|
borderOpacity: number;
|
|
44
45
|
borderStyle: BorderStyle;
|
|
45
46
|
borderWidth: BorderWidth;
|
|
@@ -51,9 +52,9 @@ export interface FrameData {
|
|
|
51
52
|
}
|
|
52
53
|
export declare class DefaultFrameData implements FrameData {
|
|
53
54
|
shapeType: FrameType;
|
|
54
|
-
backgroundColor:
|
|
55
|
+
backgroundColor: ColorValue;
|
|
55
56
|
backgroundOpacity: number;
|
|
56
|
-
borderColor:
|
|
57
|
+
borderColor: ColorValue;
|
|
57
58
|
borderOpacity: number;
|
|
58
59
|
borderStyle: BorderStyle;
|
|
59
60
|
borderWidth: BorderWidth;
|
|
@@ -63,5 +64,5 @@ export declare class DefaultFrameData implements FrameData {
|
|
|
63
64
|
canChangeRatio: boolean;
|
|
64
65
|
linkTo?: string | undefined;
|
|
65
66
|
readonly itemType = "Frame";
|
|
66
|
-
constructor(shapeType?: FrameType, backgroundColor?:
|
|
67
|
+
constructor(shapeType?: FrameType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: BorderStyle, borderWidth?: BorderWidth, transformation?: DefaultTransformationData, children?: string[], text?: RichTextData, canChangeRatio?: boolean, linkTo?: string | undefined);
|
|
67
68
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FrameType } from "./Basic";
|
|
2
|
+
import { ColorValue } from "../../..";
|
|
2
3
|
interface SetBackgroundColor {
|
|
3
4
|
class: "Frame";
|
|
4
5
|
method: "setBackgroundColor";
|
|
5
6
|
item: string[];
|
|
6
|
-
backgroundColor:
|
|
7
|
+
backgroundColor: ColorValue;
|
|
7
8
|
}
|
|
8
9
|
interface SetCanChangeRatio {
|
|
9
10
|
class: "Frame";
|
|
@@ -16,12 +16,12 @@ export declare class Mbr implements Geometry {
|
|
|
16
16
|
top: number;
|
|
17
17
|
right: number;
|
|
18
18
|
bottom: number;
|
|
19
|
-
borderColor: string;
|
|
20
|
-
backgroundColor: string;
|
|
19
|
+
borderColor: string | import("../../Color/ColorValue").ColorValue;
|
|
20
|
+
backgroundColor: string | import("../../Color/ColorValue").ColorValue;
|
|
21
21
|
strokeWidth: number;
|
|
22
22
|
borderStyle: BorderStyle;
|
|
23
23
|
static fromDomRect(rect: DOMRect): Mbr;
|
|
24
|
-
constructor(left?: number, top?: number, right?: number, bottom?: number, borderColor?: string, backgroundColor?: string, strokeWidth?: number, borderStyle?: BorderStyle);
|
|
24
|
+
constructor(left?: number, top?: number, right?: number, bottom?: number, borderColor?: string | import("../../Color/ColorValue").ColorValue, backgroundColor?: string | import("../../Color/ColorValue").ColorValue, strokeWidth?: number, borderStyle?: BorderStyle);
|
|
25
25
|
getWidth(): number;
|
|
26
26
|
getHeight(): number;
|
|
27
27
|
getCenter(): Point;
|
|
@@ -13,6 +13,7 @@ import { Board } from "../../Board";
|
|
|
13
13
|
import { Subject } from "../../Subject";
|
|
14
14
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
15
15
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
16
|
+
import { ColorValue } from "../../..";
|
|
16
17
|
export declare const Shapes: {
|
|
17
18
|
BPMN_Gateway: {
|
|
18
19
|
name: string;
|
|
@@ -345,9 +346,9 @@ export declare const Shapes: {
|
|
|
345
346
|
};
|
|
346
347
|
export declare class Shape extends BaseItem {
|
|
347
348
|
shapeType: ShapeType;
|
|
348
|
-
backgroundColor:
|
|
349
|
+
backgroundColor: ColorValue;
|
|
349
350
|
backgroundOpacity: number;
|
|
350
|
-
borderColor:
|
|
351
|
+
borderColor: ColorValue;
|
|
351
352
|
borderOpacity: number;
|
|
352
353
|
borderStyle: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash";
|
|
353
354
|
borderWidth: number;
|
|
@@ -361,7 +362,7 @@ export declare class Shape extends BaseItem {
|
|
|
361
362
|
readonly linkTo: LinkTo;
|
|
362
363
|
readonly subject: Subject<Shape>;
|
|
363
364
|
transformationRenderBlock?: boolean;
|
|
364
|
-
constructor(board: Board, id?: string, shapeType?: ShapeType, backgroundColor?:
|
|
365
|
+
constructor(board: Board, id?: string, shapeType?: ShapeType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash", borderWidth?: number, mbr?: Mbr);
|
|
365
366
|
private saveShapeData;
|
|
366
367
|
emit(operation: ShapeOperation): void;
|
|
367
368
|
serialize(): ShapeData;
|
|
@@ -374,17 +375,17 @@ export declare class Shape extends BaseItem {
|
|
|
374
375
|
getLinkTo(): string | undefined;
|
|
375
376
|
private applyShapeType;
|
|
376
377
|
setShapeType(shapeType: ShapeType): void;
|
|
377
|
-
getBackgroundColor():
|
|
378
|
+
getBackgroundColor(): ColorValue;
|
|
378
379
|
private applyBackgroundColor;
|
|
379
|
-
setBackgroundColor(backgroundColor:
|
|
380
|
+
setBackgroundColor(backgroundColor: ColorValue): void;
|
|
380
381
|
getBackgroundOpacity(): number;
|
|
381
|
-
getBorderColor():
|
|
382
|
+
getBorderColor(): ColorValue;
|
|
382
383
|
getBorderWidth(): number;
|
|
383
384
|
private applyBackgroundOpacity;
|
|
384
385
|
setBackgroundOpacity(backgroundOpacity: number): void;
|
|
385
|
-
getStrokeColor():
|
|
386
|
+
getStrokeColor(): ColorValue;
|
|
386
387
|
private applyBorderColor;
|
|
387
|
-
setBorderColor(borderColor:
|
|
388
|
+
setBorderColor(borderColor: ColorValue): void;
|
|
388
389
|
getBorderOpacity(): number;
|
|
389
390
|
private applyBorderOpacity;
|
|
390
391
|
setBorderOpacity(borderOpacity: number): void;
|
|
@@ -3,12 +3,13 @@ import { RichTextData } from "../RichText";
|
|
|
3
3
|
import { DefaultRichTextData } from "../RichText/RichTextData";
|
|
4
4
|
import { TransformationData, DefaultTransformationData } from "../Transformation";
|
|
5
5
|
import { ShapeType } from "./index";
|
|
6
|
+
import { ColorValue } from "../../..";
|
|
6
7
|
export interface ShapeData {
|
|
7
8
|
readonly itemType: "Shape";
|
|
8
9
|
shapeType: ShapeType;
|
|
9
|
-
backgroundColor:
|
|
10
|
+
backgroundColor: ColorValue;
|
|
10
11
|
backgroundOpacity: number;
|
|
11
|
-
borderColor:
|
|
12
|
+
borderColor: ColorValue;
|
|
12
13
|
borderOpacity: number;
|
|
13
14
|
borderStyle: BorderStyle;
|
|
14
15
|
borderWidth: BorderWidth;
|
|
@@ -18,9 +19,9 @@ export interface ShapeData {
|
|
|
18
19
|
}
|
|
19
20
|
export declare class DefaultShapeData implements ShapeData {
|
|
20
21
|
shapeType: ShapeType;
|
|
21
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: ColorValue;
|
|
22
23
|
backgroundOpacity: number;
|
|
23
|
-
borderColor:
|
|
24
|
+
borderColor: ColorValue;
|
|
24
25
|
borderOpacity: number;
|
|
25
26
|
borderStyle: BorderStyle;
|
|
26
27
|
borderWidth: BorderWidth;
|
|
@@ -28,7 +29,7 @@ export declare class DefaultShapeData implements ShapeData {
|
|
|
28
29
|
text: DefaultRichTextData;
|
|
29
30
|
linkTo?: string | undefined;
|
|
30
31
|
readonly itemType = "Shape";
|
|
31
|
-
constructor(shapeType?: ShapeType, backgroundColor?:
|
|
32
|
+
constructor(shapeType?: ShapeType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: BorderStyle, borderWidth?: BorderWidth, transformation?: DefaultTransformationData, text?: DefaultRichTextData, linkTo?: string | undefined);
|
|
32
33
|
}
|
|
33
34
|
export declare const ADD_TO_SELECTION = true;
|
|
34
35
|
export declare const DEFAULT_SHAPE: ShapeType | "None";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BorderStyle } from "../Path";
|
|
2
2
|
import { ShapeType } from "./index";
|
|
3
|
+
import { ColorValue } from "../../..";
|
|
3
4
|
export type ShapeOperation = SetBackgroundColor | SetBackgroundOpacity | SetBorderColor | SetBorderOpacity | SetBorderStyle | SetBorderWidth | SetShapeType;
|
|
4
5
|
interface BaseShapeOperation {
|
|
5
6
|
class: "Shape";
|
|
@@ -7,7 +8,7 @@ interface BaseShapeOperation {
|
|
|
7
8
|
}
|
|
8
9
|
interface SetBackgroundColor extends BaseShapeOperation {
|
|
9
10
|
method: "setBackgroundColor";
|
|
10
|
-
backgroundColor:
|
|
11
|
+
backgroundColor: ColorValue;
|
|
11
12
|
}
|
|
12
13
|
interface SetBackgroundOpacity extends BaseShapeOperation {
|
|
13
14
|
method: "setBackgroundOpacity";
|
|
@@ -15,7 +16,7 @@ interface SetBackgroundOpacity extends BaseShapeOperation {
|
|
|
15
16
|
}
|
|
16
17
|
interface SetBorderColor extends BaseShapeOperation {
|
|
17
18
|
method: "setBorderColor";
|
|
18
|
-
borderColor:
|
|
19
|
+
borderColor: ColorValue;
|
|
19
20
|
}
|
|
20
21
|
interface SetBorderOpacity extends BaseShapeOperation {
|
|
21
22
|
method: "setBorderOpacity";
|
|
@@ -15,6 +15,7 @@ import { LinkTo } from "../LinkTo/LinkTo";
|
|
|
15
15
|
import { Board } from "../../Board";
|
|
16
16
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
17
17
|
import { BaseItem } from "../BaseItem";
|
|
18
|
+
import { ColorValue } from "../../..";
|
|
18
19
|
export declare const stickerColors: {
|
|
19
20
|
[color: string]: string;
|
|
20
21
|
};
|
|
@@ -25,7 +26,7 @@ export declare const StickerShape: {
|
|
|
25
26
|
DEFAULTS: number[];
|
|
26
27
|
};
|
|
27
28
|
export declare class Sticker extends BaseItem {
|
|
28
|
-
backgroundColor:
|
|
29
|
+
backgroundColor: ColorValue;
|
|
29
30
|
parent: string;
|
|
30
31
|
readonly itemType = "Sticker";
|
|
31
32
|
readonly transformation: Transformation;
|
|
@@ -35,7 +36,7 @@ export declare class Sticker extends BaseItem {
|
|
|
35
36
|
text: RichText;
|
|
36
37
|
readonly subject: Subject<Sticker>;
|
|
37
38
|
transformationRenderBlock?: boolean;
|
|
38
|
-
constructor(board: Board, id?: string, backgroundColor?:
|
|
39
|
+
constructor(board: Board, id?: string, backgroundColor?: ColorValue);
|
|
39
40
|
emit(operation: StickerOperation): void;
|
|
40
41
|
saveStickerData(): void;
|
|
41
42
|
serialize(): StickerData;
|
|
@@ -44,10 +45,10 @@ export declare class Sticker extends BaseItem {
|
|
|
44
45
|
setId(id: string): this;
|
|
45
46
|
getId(): string;
|
|
46
47
|
apply(op: Operation): void;
|
|
47
|
-
getBackgroundColor():
|
|
48
|
+
getBackgroundColor(): ColorValue;
|
|
48
49
|
getWidth(): number;
|
|
49
50
|
private applyBackgroundColor;
|
|
50
|
-
setBackgroundColor(backgroundColor:
|
|
51
|
+
setBackgroundColor(backgroundColor: ColorValue): void;
|
|
51
52
|
getIntersectionPoints(segment: Line): Point[];
|
|
52
53
|
getMbr(): Mbr;
|
|
53
54
|
getNearestEdgePointTo(point: Point): Point;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { LinkTo } from '../LinkTo/LinkTo';
|
|
2
2
|
import { DefaultRichTextData } from '../RichText/RichTextData';
|
|
3
3
|
import { DefaultTransformationData } from '../Transformation/TransformationData';
|
|
4
|
+
import { ColorValue } from '../../..';
|
|
4
5
|
export declare class StickerData {
|
|
5
|
-
backgroundColor:
|
|
6
|
+
backgroundColor: ColorValue;
|
|
6
7
|
transformation: DefaultTransformationData;
|
|
7
8
|
linkTo?: (string | LinkTo) | undefined;
|
|
8
9
|
text: DefaultRichTextData;
|
|
9
10
|
readonly itemType = "Sticker";
|
|
10
|
-
constructor(backgroundColor?:
|
|
11
|
+
constructor(backgroundColor?: ColorValue, transformation?: DefaultTransformationData, linkTo?: (string | LinkTo) | undefined, text?: DefaultRichTextData);
|
|
11
12
|
}
|
|
12
13
|
interface SetBackgroundColor {
|
|
13
14
|
class: 'Sticker';
|
|
14
15
|
method: 'setBackgroundColor';
|
|
15
16
|
item: string[];
|
|
16
|
-
backgroundColor:
|
|
17
|
+
backgroundColor: ColorValue;
|
|
17
18
|
}
|
|
18
19
|
export type StickerOperation = SetBackgroundColor;
|
|
19
20
|
export {};
|
package/dist/types/Settings.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { BrowserPath2D } from "./api/BrowserPath2DFactory";
|
|
|
4
4
|
import { MockDocumentFactory } from "./api/MockDocumentFactory";
|
|
5
5
|
import { MockPath2D } from "./api/MockPath2D";
|
|
6
6
|
import type { BorderStyle } from "./Items/Path/Path";
|
|
7
|
+
import type { Theme } from "./Color/ColorValue";
|
|
7
8
|
export interface Connection {
|
|
8
9
|
connectionId: number;
|
|
9
10
|
getCurrentUser: () => string;
|
|
@@ -142,6 +143,12 @@ export declare const conf: {
|
|
|
142
143
|
plus: string;
|
|
143
144
|
plusAI: string;
|
|
144
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Active display theme. Set this before mounting the board, or call
|
|
148
|
+
* `setTheme()` at runtime to trigger a full re-render of all semantic
|
|
149
|
+
* colours across the canvas.
|
|
150
|
+
*/
|
|
151
|
+
theme: Theme;
|
|
145
152
|
EVENTS_PUBLISH_INTERVAL: number;
|
|
146
153
|
EVENTS_RESEND_INTERVAL: number;
|
|
147
154
|
SELECTION_COLOR: string;
|
package/dist/types/index.d.ts
CHANGED