@bimetal/whiteboard-angular-components 0.29.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/LICENSE ADDED
@@ -0,0 +1,129 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright Andreas Biederbeck (https://bimetal.dev)
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or any agreement made under them,
97
+ you have 32 calendar days to come into compliance. If you come
98
+ into compliance, your licenses revive and continue as if you had
99
+ never violated.
100
+
101
+ ## No Liability
102
+
103
+ ***As far as the law allows, the software comes as is, without
104
+ any warranty or condition, and the licensor will not be liable
105
+ to you for any damages arising out of these terms or the use
106
+ or nature of the software, under any kind of legal claim.***
107
+
108
+ ## Definitions
109
+
110
+ The **licensor** is the individual or entity offering these
111
+ terms, and the **software** is the software the licensor makes
112
+ available under these terms.
113
+
114
+ **You** refers to the individual or entity agreeing to these
115
+ terms.
116
+
117
+ **Your company** is any legal entity, sole proprietorship,
118
+ or other kind of organization that you work for, plus all
119
+ organizations that have control over, are under the control of,
120
+ or are under common control with that organization. **Control**
121
+ means ownership of substantially all the assets of an entity,
122
+ or the power to direct its management and policies by vote,
123
+ contract, or otherwise. Control can be direct or indirect.
124
+
125
+ **Your licenses** are all the licenses granted to you for the
126
+ software under these terms.
127
+
128
+ **Use** means anything you do with the software requiring one
129
+ of your licenses.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # @bimetal/whiteboard-angular-components
2
+
3
+ The default **Angular whiteboard** for BIMETAL — a thin binding over the canonical
4
+ [`@bimetal/whiteboard-headless`](../whiteboard-headless) controller. Every
5
+ interaction decision (the tool FSM, create/drag/marquee, resize/rotate math, snap
6
+ guides, align/distribute, group cohesion, input parsing) lives in the controller;
7
+ this package owns only the DOM: it converts the single piece of geometry
8
+ (`screenToBoard`), wires pointer + wheel events, and renders the snapshot. Ships as
9
+ standalone components.
10
+
11
+ ## Features
12
+
13
+ - **Infinite canvas** — pan (wheel/trackpad) and zoom (Ctrl/Cmd + wheel), a
14
+ grid that tracks the camera, reset-to-100%.
15
+ - **Shapes** — rect / ellipse / diamond / text / note / frame, real
16
+ drag-move, eight-handle resize, and a 15°-snapped rotate knob.
17
+ - **Connectors** with routed elbow paths + arrowheads, **freehand draw**, a
18
+ **laser pointer** (transient top overlay), and **smart guides** while dragging.
19
+ - **Align / distribute**, **group / ungroup**, **frames** with reparent-on-drop,
20
+ **comments** (pins + thread editor), a **style panel**, a **text dialog**, undo.
21
+ - **Keyboard a11y** — the full key map is forwarded to the controller.
22
+
23
+ Event-sourced: the whole canvas is one aggregate, every change is an event, and
24
+ undo + full history come for free.
25
+
26
+ ## Usage
27
+
28
+ ```ts
29
+ import { Component } from '@angular/core';
30
+ import { WhiteboardComponent } from '@bimetal/whiteboard-angular-components';
31
+ import { createWhiteboardStore } from '@bimetal/whiteboard-data';
32
+ import '@bimetal/whiteboard-angular-components/styles';
33
+
34
+ @Component({
35
+ selector: 'app-root',
36
+ standalone: true,
37
+ imports: [WhiteboardComponent],
38
+ template: `<bm-whiteboard [store]="store" canvasId="canvas-1"></bm-whiteboard>`,
39
+ })
40
+ export class AppComponent {
41
+ store = createWhiteboardStore();
42
+ // …seed the canvas…
43
+ }
44
+ ```
45
+
46
+ The component is `bm-whiteboard`. Pass `[darkMode]="true"` for the dark token set,
47
+ `[config]` for locale/metric overrides, and `[onError]` to surface infrastructure
48
+ errors.
49
+
50
+ ## License
51
+
52
+ PolyForm-Noncommercial-1.0.0
@@ -0,0 +1,31 @@
1
+ import { EventEmitter, OnChanges } from '@angular/core';
2
+ import type { Point, WhiteboardLocale } from '@bimetal/whiteboard-headless';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The comment editor popover (new draft OR existing thread), floated in SCREEN
6
+ * space at `at`. The resolve/delete actions appear only for an EXISTING comment
7
+ * (`existing`). `commit` owns the persist-and-close decision in the parent (commit
8
+ * a draft, or update + close a thread); a blank draft commit cancels in the
9
+ * controller. 1:1 with the React reference.
10
+ */
11
+ export declare class CommentThreadComponent implements OnChanges {
12
+ at: Point;
13
+ initial: string;
14
+ resolved: boolean;
15
+ existing: boolean;
16
+ locale: WhiteboardLocale;
17
+ commit: EventEmitter<string>;
18
+ close: EventEmitter<void>;
19
+ resolve: EventEmitter<void>;
20
+ delete: EventEmitter<void>;
21
+ text: string;
22
+ private seeded;
23
+ readonly onClose: () => void;
24
+ get posStyle(): Record<string, string>;
25
+ ngOnChanges(): void;
26
+ onInput(e: Event): void;
27
+ stop(e: Event): void;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommentThreadComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<CommentThreadComponent, "bm-wb-comment-thread", never, { "at": { "alias": "at"; "required": true; }; "initial": { "alias": "initial"; "required": false; }; "resolved": { "alias": "resolved"; "required": false; }; "existing": { "alias": "existing"; "required": false; }; "locale": { "alias": "locale"; "required": true; }; }, { "commit": "commit"; "close": "close"; "resolve": "resolve"; "delete": "delete"; }, never, never, true, never>;
30
+ }
31
+ //# sourceMappingURL=CommentThread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentThread.d.ts","sourceRoot":"","sources":["../../src/components/CommentThread.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EACtC,SAAS,EACV,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;;AAE5E;;;;;;GAMG;AACH,qBAuBa,sBAAuB,YAAW,SAAS;IAC3B,EAAE,EAAG,KAAK,CAAC;IAC7B,OAAO,SAAM;IACb,QAAQ,UAAS;IACjB,QAAQ,UAAS;IACC,MAAM,EAAG,gBAAgB,CAAC;IAC3C,MAAM,uBAA8B;IACpC,KAAK,qBAA4B;IACjC,OAAO,qBAA4B;IACnC,MAAM,qBAA4B;IAE5C,IAAI,SAAM;IACV,OAAO,CAAC,MAAM,CAAS;IAIvB,QAAQ,CAAC,OAAO,aAA2B;IAE3C,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAErC;IAED,WAAW;IAMX,OAAO,CAAC,CAAC,EAAE,KAAK;IAChB,IAAI,CAAC,CAAC,EAAE,KAAK;yCA7BF,sBAAsB;2CAAtB,sBAAsB;CA8BlC"}
@@ -0,0 +1,138 @@
1
+ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FocusTrapDirective } from '@bimetal/angular';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@angular/common";
6
+ function CommentThreadComponent_button_3_Template(rf, ctx) { if (rf & 1) {
7
+ const _r1 = i0.ɵɵgetCurrentView();
8
+ i0.ɵɵelementStart(0, "button", 6);
9
+ i0.ɵɵlistener("click", function CommentThreadComponent_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.delete.emit()); });
10
+ i0.ɵɵtext(1);
11
+ i0.ɵɵelementEnd();
12
+ } if (rf & 2) {
13
+ const ctx_r1 = i0.ɵɵnextContext();
14
+ i0.ɵɵadvance();
15
+ i0.ɵɵtextInterpolate(ctx_r1.locale.delete);
16
+ } }
17
+ function CommentThreadComponent_button_4_Template(rf, ctx) { if (rf & 1) {
18
+ const _r3 = i0.ɵɵgetCurrentView();
19
+ i0.ɵɵelementStart(0, "button", 6);
20
+ i0.ɵɵlistener("click", function CommentThreadComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.resolve.emit()); });
21
+ i0.ɵɵtext(1);
22
+ i0.ɵɵelementEnd();
23
+ } if (rf & 2) {
24
+ const ctx_r1 = i0.ɵɵnextContext();
25
+ i0.ɵɵadvance();
26
+ i0.ɵɵtextInterpolate(ctx_r1.resolved ? ctx_r1.locale.commentReopen : ctx_r1.locale.commentResolve);
27
+ } }
28
+ /**
29
+ * The comment editor popover (new draft OR existing thread), floated in SCREEN
30
+ * space at `at`. The resolve/delete actions appear only for an EXISTING comment
31
+ * (`existing`). `commit` owns the persist-and-close decision in the parent (commit
32
+ * a draft, or update + close a thread); a blank draft commit cancels in the
33
+ * controller. 1:1 with the React reference.
34
+ */
35
+ export class CommentThreadComponent {
36
+ at;
37
+ initial = '';
38
+ resolved = false;
39
+ existing = false;
40
+ locale;
41
+ commit = new EventEmitter();
42
+ close = new EventEmitter();
43
+ resolve = new EventEmitter();
44
+ delete = new EventEmitter();
45
+ text = '';
46
+ seeded = false;
47
+ // v0.29 Tastatur: NON-modal dialog ([bmFocusTrapModal]="false") — focus-on-open + Escape
48
+ // + restore, Tab may leave. The trap's onEscape closes it. Stable arrow for the template.
49
+ onClose = () => this.close.emit();
50
+ get posStyle() {
51
+ return { left: `${this.at.x}px`, top: `${this.at.y}px` };
52
+ }
53
+ ngOnChanges() {
54
+ // Seed the draft once from `initial` (the thread's stored text stays constant
55
+ // mid-edit, so we never clobber typing).
56
+ if (!this.seeded) {
57
+ this.text = this.initial;
58
+ this.seeded = true;
59
+ }
60
+ }
61
+ onInput(e) { this.text = e.target.value; }
62
+ stop(e) { e.stopPropagation(); }
63
+ static ɵfac = function CommentThreadComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommentThreadComponent)(); };
64
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CommentThreadComponent, selectors: [["bm-wb-comment-thread"]], hostAttrs: [2, "display", "contents"], inputs: { at: "at", initial: "initial", resolved: "resolved", existing: "existing", locale: "locale" }, outputs: { commit: "commit", close: "close", resolve: "resolve", delete: "delete" }, features: [i0.ɵɵNgOnChangesFeature], decls: 8, vars: 9, consts: [["role", "dialog", "bmFocusTrap", "", 1, "bm-wb__comment-thread", 3, "pointerdown", "ngStyle", "bmFocusTrapOnEscape", "bmFocusTrapModal"], [1, "bm-wb__comment-input", 3, "input", "value"], [1, "bm-wb__comment-actions"], ["type", "button", "class", "bm-wb__btn", 3, "click", 4, "ngIf"], [2, "flex", "1"], ["type", "button", 1, "bm-wb__tool", "bm-wb__tool--active", 3, "click"], ["type", "button", 1, "bm-wb__btn", 3, "click"]], template: function CommentThreadComponent_Template(rf, ctx) { if (rf & 1) {
65
+ i0.ɵɵelementStart(0, "div", 0);
66
+ i0.ɵɵlistener("pointerdown", function CommentThreadComponent_Template_div_pointerdown_0_listener($event) { return ctx.stop($event); });
67
+ i0.ɵɵelementStart(1, "textarea", 1);
68
+ i0.ɵɵlistener("input", function CommentThreadComponent_Template_textarea_input_1_listener($event) { return ctx.onInput($event); });
69
+ i0.ɵɵelementEnd();
70
+ i0.ɵɵelementStart(2, "div", 2);
71
+ i0.ɵɵtemplate(3, CommentThreadComponent_button_3_Template, 2, 1, "button", 3)(4, CommentThreadComponent_button_4_Template, 2, 1, "button", 3);
72
+ i0.ɵɵelement(5, "span", 4);
73
+ i0.ɵɵelementStart(6, "button", 5);
74
+ i0.ɵɵlistener("click", function CommentThreadComponent_Template_button_click_6_listener() { return ctx.commit.emit(ctx.text); });
75
+ i0.ɵɵtext(7);
76
+ i0.ɵɵelementEnd()()();
77
+ } if (rf & 2) {
78
+ i0.ɵɵproperty("ngStyle", ctx.posStyle)("bmFocusTrapOnEscape", ctx.onClose)("bmFocusTrapModal", false);
79
+ i0.ɵɵattribute("aria-label", ctx.locale.tools.comment);
80
+ i0.ɵɵadvance();
81
+ i0.ɵɵproperty("value", ctx.text);
82
+ i0.ɵɵattribute("placeholder", ctx.locale.commentPlaceholder);
83
+ i0.ɵɵadvance(2);
84
+ i0.ɵɵproperty("ngIf", ctx.existing);
85
+ i0.ɵɵadvance();
86
+ i0.ɵɵproperty("ngIf", ctx.existing);
87
+ i0.ɵɵadvance(3);
88
+ i0.ɵɵtextInterpolate(ctx.locale.save);
89
+ } }, dependencies: [CommonModule, i1.NgIf, i1.NgStyle, FocusTrapDirective], encapsulation: 2, changeDetection: 0 });
90
+ }
91
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommentThreadComponent, [{
92
+ type: Component,
93
+ args: [{
94
+ selector: 'bm-wb-comment-thread',
95
+ standalone: true,
96
+ host: { style: 'display: contents' },
97
+ imports: [CommonModule, FocusTrapDirective],
98
+ changeDetection: ChangeDetectionStrategy.OnPush,
99
+ template: `
100
+ <div class="bm-wb__comment-thread" role="dialog" [attr.aria-label]="locale.tools.comment" [ngStyle]="posStyle" (pointerdown)="stop($event)"
101
+ bmFocusTrap [bmFocusTrapOnEscape]="onClose" [bmFocusTrapModal]="false">
102
+ <textarea
103
+ class="bm-wb__comment-input"
104
+ [value]="text"
105
+ [attr.placeholder]="locale.commentPlaceholder"
106
+ (input)="onInput($event)"></textarea>
107
+ <div class="bm-wb__comment-actions">
108
+ <button *ngIf="existing" type="button" class="bm-wb__btn" (click)="delete.emit()">{{ locale.delete }}</button>
109
+ <button *ngIf="existing" type="button" class="bm-wb__btn" (click)="resolve.emit()">{{ resolved ? locale.commentReopen : locale.commentResolve }}</button>
110
+ <span style="flex:1"></span>
111
+ <button type="button" class="bm-wb__tool bm-wb__tool--active" (click)="commit.emit(text)">{{ locale.save }}</button>
112
+ </div>
113
+ </div>
114
+ `,
115
+ }]
116
+ }], null, { at: [{
117
+ type: Input,
118
+ args: [{ required: true }]
119
+ }], initial: [{
120
+ type: Input
121
+ }], resolved: [{
122
+ type: Input
123
+ }], existing: [{
124
+ type: Input
125
+ }], locale: [{
126
+ type: Input,
127
+ args: [{ required: true }]
128
+ }], commit: [{
129
+ type: Output
130
+ }], close: [{
131
+ type: Output
132
+ }], resolve: [{
133
+ type: Output
134
+ }], delete: [{
135
+ type: Output
136
+ }] }); })();
137
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CommentThreadComponent, { className: "CommentThreadComponent", filePath: "components/commentthread.ts", lineNumber: 39 }); })();
138
+ //# sourceMappingURL=CommentThread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentThread.js","sourceRoot":"","sources":["../../src/components/CommentThread.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAC3B,uBAAuB,GACnC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;;;;;IAyB9C,iCAAkF;IAAxB,qLAAS,oBAAa,KAAC;IAAC,YAAmB;IAAA,iBAAS;;;IAA5B,cAAmB;IAAnB,0CAAmB;;;;IACrG,iCAAmF;IAAzB,qLAAS,qBAAc,KAAC;IAAC,YAA6D;IAAA,iBAAS;;;IAAtE,cAA6D;IAA7D,kGAA6D;;AAvBxJ;;;;;;GAMG;AAwBH,MAAM,OAAO,sBAAsB;IACN,EAAE,CAAS;IAC7B,OAAO,GAAG,EAAE,CAAC;IACb,QAAQ,GAAG,KAAK,CAAC;IACjB,QAAQ,GAAG,KAAK,CAAC;IACC,MAAM,CAAoB;IAC3C,MAAM,GAAG,IAAI,YAAY,EAAU,CAAC;IACpC,KAAK,GAAG,IAAI,YAAY,EAAQ,CAAC;IACjC,OAAO,GAAG,IAAI,YAAY,EAAQ,CAAC;IACnC,MAAM,GAAG,IAAI,YAAY,EAAQ,CAAC;IAE5C,IAAI,GAAG,EAAE,CAAC;IACF,MAAM,GAAG,KAAK,CAAC;IAEv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B,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;gBACpC,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;gBAC3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,QAAQ,EAAE;;;;;;;;;;;;;;;GAeT;aACF;gBAE4B,EAAE;kBAA5B,KAAK;mBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChB,OAAO;kBAAf,KAAK;YACG,QAAQ;kBAAhB,KAAK;YACG,QAAQ;kBAAhB,KAAK;YACqB,MAAM;kBAAhC,KAAK;mBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;YACf,MAAM;kBAAf,MAAM;YACG,KAAK;kBAAd,MAAM;YACG,OAAO;kBAAhB,MAAM;YACG,MAAM;kBAAf,MAAM;;kFATI,sBAAsB"}
@@ -0,0 +1,19 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import type { ShapeStyle, StyleInput, WhiteboardLocale } from '@bimetal/whiteboard-headless';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The style editor for the current selection. The inputs forward RAW string
6
+ * values (`StyleInput`); the controller parses/clamps/validates and batches the
7
+ * change into ONE `SetShapesStyle` (one undo). No `Number(...)`, cast or min/max
8
+ * policy here — the DOM min/max are UX hints only. Labels come from the locale.
9
+ * 1:1 with the React reference.
10
+ */
11
+ export declare class StylePanelComponent {
12
+ style: ShapeStyle;
13
+ locale: WhiteboardLocale;
14
+ styleInput: EventEmitter<StyleInput>;
15
+ emit(field: keyof StyleInput, e: Event): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<StylePanelComponent, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<StylePanelComponent, "bm-wb-style-panel", never, { "style": { "alias": "style"; "required": true; }; "locale": { "alias": "locale"; "required": true; }; }, { "styleInput": "styleInput"; }, never, never, true, never>;
18
+ }
19
+ //# sourceMappingURL=StylePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StylePanel.d.ts","sourceRoot":"","sources":["../../src/components/StylePanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAA2B,MAAM,eAAe,CAAC;AAEhG,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;;AAE7F;;;;;;GAMG;AACH,qBAuCa,mBAAmB;IACH,KAAK,EAAG,UAAU,CAAC;IACnB,MAAM,EAAG,gBAAgB,CAAC;IAC3C,UAAU,2BAAkC;IAEtD,IAAI,CAAC,KAAK,EAAE,MAAM,UAAU,EAAE,CAAC,EAAE,KAAK;yCAL3B,mBAAmB;2CAAnB,mBAAmB;CAS/B"}
@@ -0,0 +1,150 @@
1
+ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The style editor for the current selection. The inputs forward RAW string
6
+ * values (`StyleInput`); the controller parses/clamps/validates and batches the
7
+ * change into ONE `SetShapesStyle` (one undo). No `Number(...)`, cast or min/max
8
+ * policy here — the DOM min/max are UX hints only. Labels come from the locale.
9
+ * 1:1 with the React reference.
10
+ */
11
+ export class StylePanelComponent {
12
+ style;
13
+ locale;
14
+ styleInput = new EventEmitter();
15
+ emit(field, e) {
16
+ const value = e.target.value;
17
+ this.styleInput.emit({ [field]: value });
18
+ }
19
+ static ɵfac = function StylePanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || StylePanelComponent)(); };
20
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: StylePanelComponent, selectors: [["bm-wb-style-panel"]], hostAttrs: [2, "display", "contents"], inputs: { style: "style", locale: "locale" }, outputs: { styleInput: "styleInput" }, decls: 31, vars: 15, consts: [["data-testid", "wb-style-panel", 1, "bm-wb__panel"], [1, "bm-wb__field"], ["for", "bmw-fill"], ["id", "bmw-fill", "type", "color", "data-style", "fill", 3, "change", "value"], ["for", "bmw-stroke"], ["id", "bmw-stroke", "type", "color", "data-style", "stroke", 3, "change", "value"], ["for", "bmw-strokeWidth"], ["id", "bmw-strokeWidth", "type", "range", "min", "1", "max", "12", "data-style", "strokeWidth", 3, "change", "value"], ["for", "bmw-dash"], ["id", "bmw-dash", "data-style", "dash", 3, "change", "value"], ["value", "solid"], ["value", "dashed"], ["value", "dotted"], ["for", "bmw-opacity"], ["id", "bmw-opacity", "type", "range", "min", "0.1", "max", "1", "step", "0.1", "data-style", "opacity", 3, "change", "value"], ["for", "bmw-fontSize"], ["id", "bmw-fontSize", "type", "number", "min", "8", "max", "96", "data-style", "fontSize", 3, "change", "value"]], template: function StylePanelComponent_Template(rf, ctx) { if (rf & 1) {
21
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "label", 2);
22
+ i0.ɵɵtext(3);
23
+ i0.ɵɵelementEnd();
24
+ i0.ɵɵelementStart(4, "input", 3);
25
+ i0.ɵɵlistener("change", function StylePanelComponent_Template_input_change_4_listener($event) { return ctx.emit("fill", $event); });
26
+ i0.ɵɵelementEnd()();
27
+ i0.ɵɵelementStart(5, "div", 1)(6, "label", 4);
28
+ i0.ɵɵtext(7);
29
+ i0.ɵɵelementEnd();
30
+ i0.ɵɵelementStart(8, "input", 5);
31
+ i0.ɵɵlistener("change", function StylePanelComponent_Template_input_change_8_listener($event) { return ctx.emit("stroke", $event); });
32
+ i0.ɵɵelementEnd()();
33
+ i0.ɵɵelementStart(9, "div", 1)(10, "label", 6);
34
+ i0.ɵɵtext(11);
35
+ i0.ɵɵelementEnd();
36
+ i0.ɵɵelementStart(12, "input", 7);
37
+ i0.ɵɵlistener("change", function StylePanelComponent_Template_input_change_12_listener($event) { return ctx.emit("strokeWidth", $event); });
38
+ i0.ɵɵelementEnd()();
39
+ i0.ɵɵelementStart(13, "div", 1)(14, "label", 8);
40
+ i0.ɵɵtext(15);
41
+ i0.ɵɵelementEnd();
42
+ i0.ɵɵelementStart(16, "select", 9);
43
+ i0.ɵɵlistener("change", function StylePanelComponent_Template_select_change_16_listener($event) { return ctx.emit("dash", $event); });
44
+ i0.ɵɵelementStart(17, "option", 10);
45
+ i0.ɵɵtext(18);
46
+ i0.ɵɵelementEnd();
47
+ i0.ɵɵelementStart(19, "option", 11);
48
+ i0.ɵɵtext(20);
49
+ i0.ɵɵelementEnd();
50
+ i0.ɵɵelementStart(21, "option", 12);
51
+ i0.ɵɵtext(22);
52
+ i0.ɵɵelementEnd()()();
53
+ i0.ɵɵelementStart(23, "div", 1)(24, "label", 13);
54
+ i0.ɵɵtext(25);
55
+ i0.ɵɵelementEnd();
56
+ i0.ɵɵelementStart(26, "input", 14);
57
+ i0.ɵɵlistener("change", function StylePanelComponent_Template_input_change_26_listener($event) { return ctx.emit("opacity", $event); });
58
+ i0.ɵɵelementEnd()();
59
+ i0.ɵɵelementStart(27, "div", 1)(28, "label", 15);
60
+ i0.ɵɵtext(29);
61
+ i0.ɵɵelementEnd();
62
+ i0.ɵɵelementStart(30, "input", 16);
63
+ i0.ɵɵlistener("change", function StylePanelComponent_Template_input_change_30_listener($event) { return ctx.emit("fontSize", $event); });
64
+ i0.ɵɵelementEnd()()();
65
+ } if (rf & 2) {
66
+ let tmp_1_0;
67
+ i0.ɵɵadvance(3);
68
+ i0.ɵɵtextInterpolate(ctx.locale.styleFill);
69
+ i0.ɵɵadvance();
70
+ i0.ɵɵproperty("value", (tmp_1_0 = ctx.style.fill) !== null && tmp_1_0 !== undefined ? tmp_1_0 : "#ffffff");
71
+ i0.ɵɵadvance(3);
72
+ i0.ɵɵtextInterpolate(ctx.locale.styleStroke);
73
+ i0.ɵɵadvance();
74
+ i0.ɵɵproperty("value", ctx.style.stroke);
75
+ i0.ɵɵadvance(3);
76
+ i0.ɵɵtextInterpolate(ctx.locale.styleWidth);
77
+ i0.ɵɵadvance();
78
+ i0.ɵɵproperty("value", ctx.style.strokeWidth);
79
+ i0.ɵɵadvance(3);
80
+ i0.ɵɵtextInterpolate(ctx.locale.styleDash);
81
+ i0.ɵɵadvance();
82
+ i0.ɵɵproperty("value", ctx.style.dash);
83
+ i0.ɵɵadvance(2);
84
+ i0.ɵɵtextInterpolate(ctx.locale.dashSolid);
85
+ i0.ɵɵadvance(2);
86
+ i0.ɵɵtextInterpolate(ctx.locale.dashDashed);
87
+ i0.ɵɵadvance(2);
88
+ i0.ɵɵtextInterpolate(ctx.locale.dashDotted);
89
+ i0.ɵɵadvance(3);
90
+ i0.ɵɵtextInterpolate(ctx.locale.styleOpacity);
91
+ i0.ɵɵadvance();
92
+ i0.ɵɵproperty("value", ctx.style.opacity);
93
+ i0.ɵɵadvance(3);
94
+ i0.ɵɵtextInterpolate(ctx.locale.styleFont);
95
+ i0.ɵɵadvance();
96
+ i0.ɵɵproperty("value", ctx.style.fontSize);
97
+ } }, dependencies: [CommonModule], encapsulation: 2, changeDetection: 0 });
98
+ }
99
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StylePanelComponent, [{
100
+ type: Component,
101
+ args: [{
102
+ selector: 'bm-wb-style-panel',
103
+ standalone: true,
104
+ host: { style: 'display: contents' },
105
+ imports: [CommonModule],
106
+ changeDetection: ChangeDetectionStrategy.OnPush,
107
+ template: `
108
+ <div class="bm-wb__panel" data-testid="wb-style-panel">
109
+ <div class="bm-wb__field">
110
+ <label for="bmw-fill">{{ locale.styleFill }}</label>
111
+ <input id="bmw-fill" type="color" data-style="fill" [value]="style.fill ?? '#ffffff'" (change)="emit('fill', $event)" />
112
+ </div>
113
+ <div class="bm-wb__field">
114
+ <label for="bmw-stroke">{{ locale.styleStroke }}</label>
115
+ <input id="bmw-stroke" type="color" data-style="stroke" [value]="style.stroke" (change)="emit('stroke', $event)" />
116
+ </div>
117
+ <div class="bm-wb__field">
118
+ <label for="bmw-strokeWidth">{{ locale.styleWidth }}</label>
119
+ <input id="bmw-strokeWidth" type="range" min="1" max="12" data-style="strokeWidth" [value]="style.strokeWidth" (change)="emit('strokeWidth', $event)" />
120
+ </div>
121
+ <div class="bm-wb__field">
122
+ <label for="bmw-dash">{{ locale.styleDash }}</label>
123
+ <select id="bmw-dash" data-style="dash" [value]="style.dash" (change)="emit('dash', $event)">
124
+ <option value="solid">{{ locale.dashSolid }}</option>
125
+ <option value="dashed">{{ locale.dashDashed }}</option>
126
+ <option value="dotted">{{ locale.dashDotted }}</option>
127
+ </select>
128
+ </div>
129
+ <div class="bm-wb__field">
130
+ <label for="bmw-opacity">{{ locale.styleOpacity }}</label>
131
+ <input id="bmw-opacity" type="range" min="0.1" max="1" step="0.1" data-style="opacity" [value]="style.opacity" (change)="emit('opacity', $event)" />
132
+ </div>
133
+ <div class="bm-wb__field">
134
+ <label for="bmw-fontSize">{{ locale.styleFont }}</label>
135
+ <input id="bmw-fontSize" type="number" min="8" max="96" data-style="fontSize" [value]="style.fontSize" (change)="emit('fontSize', $event)" />
136
+ </div>
137
+ </div>
138
+ `,
139
+ }]
140
+ }], null, { style: [{
141
+ type: Input,
142
+ args: [{ required: true }]
143
+ }], locale: [{
144
+ type: Input,
145
+ args: [{ required: true }]
146
+ }], styleInput: [{
147
+ type: Output
148
+ }] }); })();
149
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StylePanelComponent, { className: "StylePanelComponent", filePath: "components/stylepanel.ts", lineNumber: 51 }); })();
150
+ //# sourceMappingURL=StylePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StylePanel.js","sourceRoot":"","sources":["../../src/components/StylePanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;;AAG/C;;;;;;GAMG;AAwCH,MAAM,OAAO,mBAAmB;IACH,KAAK,CAAc;IACnB,MAAM,CAAoB;IAC3C,UAAU,GAAG,IAAI,YAAY,EAAc,CAAC;IAEtD,IA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C,0GAAiC;YAG7D,eAAwB;YAAxB,4CAAwB;YACQ,cAAsB;YAAtB,wCAAsB;YAGjD,eAAuB;YAAvB,2CAAuB;YAC+B,cAA2B;YAA3B,6CAA2B;YAGxF,eAAsB;YAAtB,0CAAsB;YACJ,cAAoB;YAApB,sCAAoB;YACpC,eAAsB;YAAtB,0CAAsB;YACrB,eAAuB;YAAvB,2CAAuB;YACvB,eAAuB;YAAvB,2CAAuB;YAIvB,eAAyB;YAAzB,6CAAyB;YACqC,cAAuB;YAAvB,yCAAuB;YAGpF,eAAsB;YAAtB,0CAAsB;YAC8B,cAAwB;YAAxB,0CAAwB;4BA9BlG,YAAY;;iFAmCX,mBAAmB;cAvC/B,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;gBACpC,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BT;aACF;gBAE4B,KAAK;kBAA/B,KAAK;mBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;YACE,MAAM;kBAAhC,KAAK;mBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;YACf,UAAU;kBAAnB,MAAM;;kFAHI,mBAAmB"}
@@ -0,0 +1,30 @@
1
+ import { EventEmitter, OnChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export interface TextDialogLocale {
4
+ save: string;
5
+ cancel: string;
6
+ delete: string;
7
+ editShape: string;
8
+ titlePlaceholder: string;
9
+ }
10
+ /**
11
+ * The double-click edit dialog for a shape's text. Rendered with a host `*ngIf`;
12
+ * the draft resets per target on the shape-identity change. 1:1 with the React
13
+ * reference.
14
+ */
15
+ export declare class TextDialogComponent implements OnChanges {
16
+ initial: string;
17
+ locale: TextDialogLocale;
18
+ save: EventEmitter<string>;
19
+ close: EventEmitter<void>;
20
+ delete: EventEmitter<void>;
21
+ text: string;
22
+ private lastInitial;
23
+ readonly onEscape: () => void;
24
+ ngOnChanges(): void;
25
+ onInput(e: Event): void;
26
+ stop(e: Event): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextDialogComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextDialogComponent, "bm-wb-text-dialog", never, { "initial": { "alias": "initial"; "required": false; }; "locale": { "alias": "locale"; "required": true; }; }, { "save": "save"; "close": "close"; "delete": "delete"; }, never, never, true, never>;
29
+ }
30
+ //# sourceMappingURL=TextDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextDialog.d.ts","sourceRoot":"","sources":["../../src/components/TextDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EACtC,SAAS,EACV,MAAM,eAAe,CAAC;;AAIvB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,qBAyBa,mBAAoB,YAAW,SAAS;IAC1C,OAAO,SAAM;IACK,MAAM,EAAG,gBAAgB,CAAC;IAC3C,IAAI,uBAA8B;IAClC,KAAK,qBAA4B;IACjC,MAAM,qBAA4B;IAE5C,IAAI,SAAM;IACV,OAAO,CAAC,WAAW,CAAuB;IAI1C,QAAQ,CAAC,QAAQ,aAA2B;IAE5C,WAAW;IAKX,OAAO,CAAC,CAAC,EAAE,KAAK;IAChB,IAAI,CAAC,CAAC,EAAE,KAAK;yCApBF,mBAAmB;2CAAnB,mBAAmB;CAqB/B"}