@memberjunction/ng-whiteboard 0.0.1 → 5.41.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/README.md +302 -28
- package/dist/lib/whiteboard-agent-sees-popover.component.d.ts +31 -0
- package/dist/lib/whiteboard-agent-sees-popover.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-agent-sees-popover.component.js +132 -0
- package/dist/lib/whiteboard-agent-sees-popover.component.js.map +1 -0
- package/dist/lib/whiteboard-board.component.d.ts +458 -0
- package/dist/lib/whiteboard-board.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-board.component.js +2357 -0
- package/dist/lib/whiteboard-board.component.js.map +1 -0
- package/dist/lib/whiteboard-context-menu.d.ts +57 -0
- package/dist/lib/whiteboard-context-menu.d.ts.map +1 -0
- package/dist/lib/whiteboard-context-menu.js +69 -0
- package/dist/lib/whiteboard-context-menu.js.map +1 -0
- package/dist/lib/whiteboard-export.d.ts +94 -0
- package/dist/lib/whiteboard-export.d.ts.map +1 -0
- package/dist/lib/whiteboard-export.js +592 -0
- package/dist/lib/whiteboard-export.js.map +1 -0
- package/dist/lib/whiteboard-host.component.d.ts +174 -0
- package/dist/lib/whiteboard-host.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-host.component.js +758 -0
- package/dist/lib/whiteboard-host.component.js.map +1 -0
- package/dist/lib/whiteboard-pages.component.d.ts +83 -0
- package/dist/lib/whiteboard-pages.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-pages.component.js +211 -0
- package/dist/lib/whiteboard-pages.component.js.map +1 -0
- package/dist/lib/whiteboard-snapshot.component.d.ts +30 -0
- package/dist/lib/whiteboard-snapshot.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-snapshot.component.js +91 -0
- package/dist/lib/whiteboard-snapshot.component.js.map +1 -0
- package/dist/lib/whiteboard-srcdoc.pipe.d.ts +60 -0
- package/dist/lib/whiteboard-srcdoc.pipe.d.ts.map +1 -0
- package/dist/lib/whiteboard-srcdoc.pipe.js +75 -0
- package/dist/lib/whiteboard-srcdoc.pipe.js.map +1 -0
- package/dist/lib/whiteboard-state.d.ts +1113 -0
- package/dist/lib/whiteboard-state.d.ts.map +1 -0
- package/dist/lib/whiteboard-state.js +1396 -0
- package/dist/lib/whiteboard-state.js.map +1 -0
- package/dist/lib/whiteboard-toolbar.component.d.ts +95 -0
- package/dist/lib/whiteboard-toolbar.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-toolbar.component.js +344 -0
- package/dist/lib/whiteboard-toolbar.component.js.map +1 -0
- package/dist/lib/whiteboard-tools.d.ts +103 -0
- package/dist/lib/whiteboard-tools.d.ts.map +1 -0
- package/dist/lib/whiteboard-tools.js +748 -0
- package/dist/lib/whiteboard-tools.js.map +1 -0
- package/dist/lib/whiteboard-widget-bridge.d.ts +217 -0
- package/dist/lib/whiteboard-widget-bridge.d.ts.map +1 -0
- package/dist/lib/whiteboard-widget-bridge.js +254 -0
- package/dist/lib/whiteboard-widget-bridge.js.map +1 -0
- package/dist/lib/whiteboard-zoom.component.d.ts +55 -0
- package/dist/lib/whiteboard-zoom.component.d.ts.map +1 -0
- package/dist/lib/whiteboard-zoom.component.js +139 -0
- package/dist/lib/whiteboard-zoom.component.js.map +1 -0
- package/dist/lib/whiteboard.module.d.ts +29 -0
- package/dist/lib/whiteboard.module.d.ts.map +1 -0
- package/dist/lib/whiteboard.module.js +78 -0
- package/dist/lib/whiteboard.module.js.map +1 -0
- package/dist/public-api.d.ts +49 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +59 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +43 -6
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `wbWidgetSrcdoc` — builds the sandboxed iframe `srcdoc` document for one HTML widget,
|
|
6
|
+
* with a lifecycle that guarantees BOTH halves of the widget rendering contract:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Widget documents are rebuilt per MOUNT.** A pure pipe is instantiated per
|
|
9
|
+
* binding-in-view, so every time a widget frame is (re)created — page switch away and
|
|
10
|
+
* back, the viewport-lazy `@if` toggling, panel collapse/expand, whole-board
|
|
11
|
+
* re-creation — the NEW embedded view gets a NEW pipe instance and therefore a fresh
|
|
12
|
+
* `SafeHtml` whose first binding pass always writes `srcdoc` onto the new iframe.
|
|
13
|
+
* No component-level cache can hand a re-mounted frame a stale instance.
|
|
14
|
+
* 2. **Still-mounted widgets never reload on unrelated board activity.** While the view
|
|
15
|
+
* stays alive, Angular re-invokes a pure pipe only when the INPUT VALUE changes, and
|
|
16
|
+
* the per-instance memo below additionally pins the returned `SafeHtml` identity for
|
|
17
|
+
* an unchanged source. Whole-scene `'replace'` journal ops (undo / redo / page rename
|
|
18
|
+
* / `LoadFromJSON` restores) that re-create the item OBJECT but not its `Html` string
|
|
19
|
+
* therefore cause NO `srcdoc` rewrite and NO iframe reload — widget runtime state
|
|
20
|
+
* survives. Only an actual `Html` edit (rich editor Apply, `Whiteboard_UpdateContent`)
|
|
21
|
+
* produces a new document and reloads the frame.
|
|
22
|
+
*
|
|
23
|
+
* History: the board previously memoized `SafeHtml` per item ID in a component-level map
|
|
24
|
+
* invalidated from journal ops (`'remove'` / `'replace'`). That decoupled the cached
|
|
25
|
+
* document's lifetime from the iframe element's lifetime — unmount paths that journal
|
|
26
|
+
* nothing (the viewport-lazy toggle) left stale entries behind, and every `'replace'`
|
|
27
|
+
* (page switch, rename, undo) nuked the cache and force-reloaded widgets that never
|
|
28
|
+
* changed. Tying the memo to the VIEW (this pipe) removes the entire invalidation
|
|
29
|
+
* problem: mount ⇒ fresh document, unchanged source ⇒ stable identity, changed source ⇒
|
|
30
|
+
* new document.
|
|
31
|
+
*
|
|
32
|
+
* SECURITY — why `bypassSecurityTrustHtml` is correct here: Angular's sanitizer would
|
|
33
|
+
* strip the scripts/styles/SVG that make a widget useful, but the payload NEVER touches
|
|
34
|
+
* the app's DOM — it only becomes the `srcdoc` of an iframe whose `sandbox` attribute is
|
|
35
|
+
* `allow-scripts` ONLY. Without `allow-same-origin` the frame runs in a unique opaque
|
|
36
|
+
* origin: its scripts cannot reach the parent document, the MJ session, cookies, or any
|
|
37
|
+
* storage, and adding `allow-same-origin` (which would let the frame script remove its
|
|
38
|
+
* own sandbox) is deliberately ruled out. By design there is NO DOM sanitization inside
|
|
39
|
+
* the sandbox — the sandbox IS the boundary.
|
|
40
|
+
*
|
|
41
|
+
* Every produced document gets the `MJWhiteboard.submit` input-bridge helper prepended
|
|
42
|
+
* exactly once (idempotent — see {@link InjectWhiteboardSubmitHelper}), so the explicit
|
|
43
|
+
* submit path and the ambient interaction recorder work on every mount.
|
|
44
|
+
*/
|
|
45
|
+
export declare class WhiteboardWidgetSrcdocPipe implements PipeTransform {
|
|
46
|
+
private sanitizer;
|
|
47
|
+
/** Last source transformed by THIS instance (one instance per mounted frame). */
|
|
48
|
+
private lastHtml;
|
|
49
|
+
/** The pinned `SafeHtml` for {@link lastHtml} — identity-stable while mounted. */
|
|
50
|
+
private lastSafe;
|
|
51
|
+
/**
|
|
52
|
+
* The widget's iframe `srcdoc`: the helper-injected source wrapped as trusted HTML.
|
|
53
|
+
* Identity-stable for an unchanged `html` on the same instance (no iframe reload);
|
|
54
|
+
* a changed `html` — or a fresh instance on a re-mounted frame — builds a new document.
|
|
55
|
+
*/
|
|
56
|
+
transform(html: string): SafeHtml;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WhiteboardWidgetSrcdocPipe, never>;
|
|
58
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<WhiteboardWidgetSrcdocPipe, "wbWidgetSrcdoc", true>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=whiteboard-srcdoc.pipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whiteboard-srcdoc.pipe.d.ts","sourceRoot":"","sources":["../../src/lib/whiteboard-srcdoc.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAU,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAgB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;;AAGnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBACa,0BAA2B,YAAW,aAAa;IAC9D,OAAO,CAAC,SAAS,CAAwB;IAEzC,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAuB;IACvC,kFAAkF;IAClF,OAAO,CAAC,QAAQ,CAAyB;IAEzC;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;yCAb7B,0BAA0B;uCAA1B,0BAA0B;CAsBtC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Pipe, inject } from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
+
import { InjectWhiteboardSubmitHelper } from './whiteboard-widget-bridge';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* `wbWidgetSrcdoc` — builds the sandboxed iframe `srcdoc` document for one HTML widget,
|
|
7
|
+
* with a lifecycle that guarantees BOTH halves of the widget rendering contract:
|
|
8
|
+
*
|
|
9
|
+
* 1. **Widget documents are rebuilt per MOUNT.** A pure pipe is instantiated per
|
|
10
|
+
* binding-in-view, so every time a widget frame is (re)created — page switch away and
|
|
11
|
+
* back, the viewport-lazy `@if` toggling, panel collapse/expand, whole-board
|
|
12
|
+
* re-creation — the NEW embedded view gets a NEW pipe instance and therefore a fresh
|
|
13
|
+
* `SafeHtml` whose first binding pass always writes `srcdoc` onto the new iframe.
|
|
14
|
+
* No component-level cache can hand a re-mounted frame a stale instance.
|
|
15
|
+
* 2. **Still-mounted widgets never reload on unrelated board activity.** While the view
|
|
16
|
+
* stays alive, Angular re-invokes a pure pipe only when the INPUT VALUE changes, and
|
|
17
|
+
* the per-instance memo below additionally pins the returned `SafeHtml` identity for
|
|
18
|
+
* an unchanged source. Whole-scene `'replace'` journal ops (undo / redo / page rename
|
|
19
|
+
* / `LoadFromJSON` restores) that re-create the item OBJECT but not its `Html` string
|
|
20
|
+
* therefore cause NO `srcdoc` rewrite and NO iframe reload — widget runtime state
|
|
21
|
+
* survives. Only an actual `Html` edit (rich editor Apply, `Whiteboard_UpdateContent`)
|
|
22
|
+
* produces a new document and reloads the frame.
|
|
23
|
+
*
|
|
24
|
+
* History: the board previously memoized `SafeHtml` per item ID in a component-level map
|
|
25
|
+
* invalidated from journal ops (`'remove'` / `'replace'`). That decoupled the cached
|
|
26
|
+
* document's lifetime from the iframe element's lifetime — unmount paths that journal
|
|
27
|
+
* nothing (the viewport-lazy toggle) left stale entries behind, and every `'replace'`
|
|
28
|
+
* (page switch, rename, undo) nuked the cache and force-reloaded widgets that never
|
|
29
|
+
* changed. Tying the memo to the VIEW (this pipe) removes the entire invalidation
|
|
30
|
+
* problem: mount ⇒ fresh document, unchanged source ⇒ stable identity, changed source ⇒
|
|
31
|
+
* new document.
|
|
32
|
+
*
|
|
33
|
+
* SECURITY — why `bypassSecurityTrustHtml` is correct here: Angular's sanitizer would
|
|
34
|
+
* strip the scripts/styles/SVG that make a widget useful, but the payload NEVER touches
|
|
35
|
+
* the app's DOM — it only becomes the `srcdoc` of an iframe whose `sandbox` attribute is
|
|
36
|
+
* `allow-scripts` ONLY. Without `allow-same-origin` the frame runs in a unique opaque
|
|
37
|
+
* origin: its scripts cannot reach the parent document, the MJ session, cookies, or any
|
|
38
|
+
* storage, and adding `allow-same-origin` (which would let the frame script remove its
|
|
39
|
+
* own sandbox) is deliberately ruled out. By design there is NO DOM sanitization inside
|
|
40
|
+
* the sandbox — the sandbox IS the boundary.
|
|
41
|
+
*
|
|
42
|
+
* Every produced document gets the `MJWhiteboard.submit` input-bridge helper prepended
|
|
43
|
+
* exactly once (idempotent — see {@link InjectWhiteboardSubmitHelper}), so the explicit
|
|
44
|
+
* submit path and the ambient interaction recorder work on every mount.
|
|
45
|
+
*/
|
|
46
|
+
export class WhiteboardWidgetSrcdocPipe {
|
|
47
|
+
constructor() {
|
|
48
|
+
this.sanitizer = inject(DomSanitizer);
|
|
49
|
+
/** Last source transformed by THIS instance (one instance per mounted frame). */
|
|
50
|
+
this.lastHtml = null;
|
|
51
|
+
/** The pinned `SafeHtml` for {@link lastHtml} — identity-stable while mounted. */
|
|
52
|
+
this.lastSafe = null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The widget's iframe `srcdoc`: the helper-injected source wrapped as trusted HTML.
|
|
56
|
+
* Identity-stable for an unchanged `html` on the same instance (no iframe reload);
|
|
57
|
+
* a changed `html` — or a fresh instance on a re-mounted frame — builds a new document.
|
|
58
|
+
*/
|
|
59
|
+
transform(html) {
|
|
60
|
+
if (this.lastSafe !== null && this.lastHtml === html) {
|
|
61
|
+
return this.lastSafe;
|
|
62
|
+
}
|
|
63
|
+
const safe = this.sanitizer.bypassSecurityTrustHtml(InjectWhiteboardSubmitHelper(html));
|
|
64
|
+
this.lastHtml = html;
|
|
65
|
+
this.lastSafe = safe;
|
|
66
|
+
return safe;
|
|
67
|
+
}
|
|
68
|
+
static { this.ɵfac = function WhiteboardWidgetSrcdocPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || WhiteboardWidgetSrcdocPipe)(); }; }
|
|
69
|
+
static { this.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "wbWidgetSrcdoc", type: WhiteboardWidgetSrcdocPipe, pure: true }); }
|
|
70
|
+
}
|
|
71
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WhiteboardWidgetSrcdocPipe, [{
|
|
72
|
+
type: Pipe,
|
|
73
|
+
args: [{ name: 'wbWidgetSrcdoc', standalone: true, pure: true }]
|
|
74
|
+
}], null, null); })();
|
|
75
|
+
//# sourceMappingURL=whiteboard-srcdoc.pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whiteboard-srcdoc.pipe.js","sourceRoot":"","sources":["../../src/lib/whiteboard-srcdoc.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAY,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,MAAM,OAAO,0BAA0B;IADvC;QAEU,cAAS,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAEzC,iFAAiF;QACzE,aAAQ,GAAkB,IAAI,CAAC;QACvC,kFAAkF;QAC1E,aAAQ,GAAoB,IAAI,CAAC;KAgB1C;IAdC;;;;OAIG;IACI,SAAS,CAAC,IAAY;QAC3B,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YACrD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;2HArBU,0BAA0B;wFAA1B,0BAA0B;;iFAA1B,0BAA0B;cADtC,IAAI;eAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE","sourcesContent":["import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { InjectWhiteboardSubmitHelper } from './whiteboard-widget-bridge';\n\n/**\n * `wbWidgetSrcdoc` — builds the sandboxed iframe `srcdoc` document for one HTML widget,\n * with a lifecycle that guarantees BOTH halves of the widget rendering contract:\n *\n * 1. **Widget documents are rebuilt per MOUNT.** A pure pipe is instantiated per\n * binding-in-view, so every time a widget frame is (re)created — page switch away and\n * back, the viewport-lazy `@if` toggling, panel collapse/expand, whole-board\n * re-creation — the NEW embedded view gets a NEW pipe instance and therefore a fresh\n * `SafeHtml` whose first binding pass always writes `srcdoc` onto the new iframe.\n * No component-level cache can hand a re-mounted frame a stale instance.\n * 2. **Still-mounted widgets never reload on unrelated board activity.** While the view\n * stays alive, Angular re-invokes a pure pipe only when the INPUT VALUE changes, and\n * the per-instance memo below additionally pins the returned `SafeHtml` identity for\n * an unchanged source. Whole-scene `'replace'` journal ops (undo / redo / page rename\n * / `LoadFromJSON` restores) that re-create the item OBJECT but not its `Html` string\n * therefore cause NO `srcdoc` rewrite and NO iframe reload — widget runtime state\n * survives. Only an actual `Html` edit (rich editor Apply, `Whiteboard_UpdateContent`)\n * produces a new document and reloads the frame.\n *\n * History: the board previously memoized `SafeHtml` per item ID in a component-level map\n * invalidated from journal ops (`'remove'` / `'replace'`). That decoupled the cached\n * document's lifetime from the iframe element's lifetime — unmount paths that journal\n * nothing (the viewport-lazy toggle) left stale entries behind, and every `'replace'`\n * (page switch, rename, undo) nuked the cache and force-reloaded widgets that never\n * changed. Tying the memo to the VIEW (this pipe) removes the entire invalidation\n * problem: mount ⇒ fresh document, unchanged source ⇒ stable identity, changed source ⇒\n * new document.\n *\n * SECURITY — why `bypassSecurityTrustHtml` is correct here: Angular's sanitizer would\n * strip the scripts/styles/SVG that make a widget useful, but the payload NEVER touches\n * the app's DOM — it only becomes the `srcdoc` of an iframe whose `sandbox` attribute is\n * `allow-scripts` ONLY. Without `allow-same-origin` the frame runs in a unique opaque\n * origin: its scripts cannot reach the parent document, the MJ session, cookies, or any\n * storage, and adding `allow-same-origin` (which would let the frame script remove its\n * own sandbox) is deliberately ruled out. By design there is NO DOM sanitization inside\n * the sandbox — the sandbox IS the boundary.\n *\n * Every produced document gets the `MJWhiteboard.submit` input-bridge helper prepended\n * exactly once (idempotent — see {@link InjectWhiteboardSubmitHelper}), so the explicit\n * submit path and the ambient interaction recorder work on every mount.\n */\n@Pipe({ name: 'wbWidgetSrcdoc', standalone: true, pure: true })\nexport class WhiteboardWidgetSrcdocPipe implements PipeTransform {\n private sanitizer = inject(DomSanitizer);\n\n /** Last source transformed by THIS instance (one instance per mounted frame). */\n private lastHtml: string | null = null;\n /** The pinned `SafeHtml` for {@link lastHtml} — identity-stable while mounted. */\n private lastSafe: SafeHtml | null = null;\n\n /**\n * The widget's iframe `srcdoc`: the helper-injected source wrapped as trusted HTML.\n * Identity-stable for an unchanged `html` on the same instance (no iframe reload);\n * a changed `html` — or a fresh instance on a re-mounted frame — builds a new document.\n */\n public transform(html: string): SafeHtml {\n if (this.lastSafe !== null && this.lastHtml === html) {\n return this.lastSafe;\n }\n const safe = this.sanitizer.bypassSecurityTrustHtml(InjectWhiteboardSubmitHelper(html));\n this.lastHtml = html;\n this.lastSafe = safe;\n return safe;\n }\n}\n"]}
|