@mml-io/networked-dom-document 0.3.0 → 0.4.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/build/common.d.ts +1 -1
- package/build/index.js +190 -158
- package/build/index.js.map +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/build/common.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type VirtualDOMDiffStruct = {
|
|
|
10
10
|
virtualDOMDiffs: Array<rfc6902.Operation>;
|
|
11
11
|
};
|
|
12
12
|
export type StaticVirtualDOMMutationRecord = {
|
|
13
|
-
type: "attributes" | "characterData" | "childList";
|
|
13
|
+
type: "attributes" | "characterData" | "childList" | "snapshot";
|
|
14
14
|
target: StaticVirtualDOMElement;
|
|
15
15
|
addedNodes: Array<StaticVirtualDOMElement>;
|
|
16
16
|
removedNodes: Array<StaticVirtualDOMElement>;
|
package/build/index.js
CHANGED
|
@@ -45,125 +45,143 @@ var visibleToAttrName = "visible-to";
|
|
|
45
45
|
var hiddenFromAttrName = "hidden-from";
|
|
46
46
|
function diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(mutation, parentNode, connectionId, visibleNodesForConnection) {
|
|
47
47
|
const virtualDOMElement = mutation.target;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!parentNode) {
|
|
51
|
-
throw new Error("Node has no parent");
|
|
52
|
-
}
|
|
53
|
-
const parentNodeId = parentNode.nodeId;
|
|
54
|
-
const shouldBeVisible = shouldShowNodeToConnectionId(virtualDOMElement, connectionId) && visibleNodesForConnection.has(parentNodeId);
|
|
55
|
-
const attributeName = mutation.attributeName;
|
|
56
|
-
if (visible && shouldBeVisible) {
|
|
57
|
-
let newValue = null;
|
|
58
|
-
if (virtualDOMElement.attributes[attributeName] !== void 0) {
|
|
59
|
-
newValue = virtualDOMElement.attributes[attributeName];
|
|
60
|
-
}
|
|
61
|
-
const diff = {
|
|
62
|
-
type: "attributeChange",
|
|
63
|
-
nodeId: virtualDOMElement.nodeId,
|
|
64
|
-
attribute: attributeName,
|
|
65
|
-
newValue
|
|
66
|
-
};
|
|
67
|
-
return diff;
|
|
68
|
-
} else if (!visible && shouldBeVisible) {
|
|
69
|
-
visibleNodesForConnection.add(virtualDOMElement.nodeId);
|
|
70
|
-
const index = parentNode.childNodes.indexOf(virtualDOMElement);
|
|
71
|
-
if (index === -1) {
|
|
72
|
-
throw new Error("Node not found in parent's children");
|
|
73
|
-
}
|
|
74
|
-
let previousNodeId = null;
|
|
75
|
-
if (index > 0) {
|
|
76
|
-
previousNodeId = getNodeIdOfPreviousVisibleSibling(
|
|
77
|
-
parentNode,
|
|
78
|
-
index - 1,
|
|
79
|
-
visibleNodesForConnection
|
|
80
|
-
);
|
|
81
|
-
}
|
|
48
|
+
switch (mutation.type) {
|
|
49
|
+
case "snapshot": {
|
|
82
50
|
const nodeDescription = describeNodeWithChildrenForConnectionId(
|
|
83
51
|
virtualDOMElement,
|
|
84
52
|
connectionId,
|
|
85
53
|
visibleNodesForConnection
|
|
86
54
|
);
|
|
87
55
|
if (!nodeDescription) {
|
|
88
|
-
|
|
56
|
+
return null;
|
|
89
57
|
}
|
|
90
58
|
const diff = {
|
|
91
|
-
type: "
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
addedNodes: [nodeDescription],
|
|
95
|
-
removedNodes: []
|
|
59
|
+
type: "snapshot",
|
|
60
|
+
snapshot: nodeDescription,
|
|
61
|
+
documentTime: 0
|
|
96
62
|
};
|
|
97
63
|
return diff;
|
|
98
|
-
}
|
|
99
|
-
|
|
64
|
+
}
|
|
65
|
+
case "attributes": {
|
|
66
|
+
const visible = visibleNodesForConnection.has(virtualDOMElement.nodeId);
|
|
67
|
+
if (!parentNode) {
|
|
68
|
+
throw new Error("Node has no parent");
|
|
69
|
+
}
|
|
70
|
+
const parentNodeId = parentNode.nodeId;
|
|
71
|
+
const shouldBeVisible = shouldShowNodeToConnectionId(virtualDOMElement, connectionId) && visibleNodesForConnection.has(parentNodeId);
|
|
72
|
+
const attributeName = mutation.attributeName;
|
|
73
|
+
if (visible && shouldBeVisible) {
|
|
74
|
+
let newValue = null;
|
|
75
|
+
if (virtualDOMElement.attributes[attributeName] !== void 0) {
|
|
76
|
+
newValue = virtualDOMElement.attributes[attributeName];
|
|
77
|
+
}
|
|
78
|
+
const diff = {
|
|
79
|
+
type: "attributeChange",
|
|
80
|
+
nodeId: virtualDOMElement.nodeId,
|
|
81
|
+
attribute: attributeName,
|
|
82
|
+
newValue
|
|
83
|
+
};
|
|
84
|
+
return diff;
|
|
85
|
+
} else if (!visible && shouldBeVisible) {
|
|
86
|
+
visibleNodesForConnection.add(virtualDOMElement.nodeId);
|
|
87
|
+
const index = parentNode.childNodes.indexOf(virtualDOMElement);
|
|
88
|
+
if (index === -1) {
|
|
89
|
+
throw new Error("Node not found in parent's children");
|
|
90
|
+
}
|
|
91
|
+
let previousNodeId = null;
|
|
92
|
+
if (index > 0) {
|
|
93
|
+
previousNodeId = getNodeIdOfPreviousVisibleSibling(
|
|
94
|
+
parentNode,
|
|
95
|
+
index - 1,
|
|
96
|
+
visibleNodesForConnection
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
const nodeDescription = describeNodeWithChildrenForConnectionId(
|
|
100
|
+
virtualDOMElement,
|
|
101
|
+
connectionId,
|
|
102
|
+
visibleNodesForConnection
|
|
103
|
+
);
|
|
104
|
+
if (!nodeDescription) {
|
|
105
|
+
throw new Error("Node description not found");
|
|
106
|
+
}
|
|
107
|
+
const diff = {
|
|
108
|
+
type: "childrenChanged",
|
|
109
|
+
nodeId: parentNodeId,
|
|
110
|
+
previousNodeId,
|
|
111
|
+
addedNodes: [nodeDescription],
|
|
112
|
+
removedNodes: []
|
|
113
|
+
};
|
|
114
|
+
return diff;
|
|
115
|
+
} else if (visible && !shouldBeVisible) {
|
|
116
|
+
removeNodeAndChildrenFromVisibleNodes(virtualDOMElement, visibleNodesForConnection);
|
|
117
|
+
const diff = {
|
|
118
|
+
type: "childrenChanged",
|
|
119
|
+
nodeId: parentNodeId,
|
|
120
|
+
previousNodeId: null,
|
|
121
|
+
addedNodes: [],
|
|
122
|
+
removedNodes: [virtualDOMElement.nodeId]
|
|
123
|
+
};
|
|
124
|
+
return diff;
|
|
125
|
+
} else if (!visible && !shouldBeVisible) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case "characterData": {
|
|
100
131
|
const diff = {
|
|
101
|
-
type: "
|
|
102
|
-
nodeId:
|
|
103
|
-
|
|
104
|
-
addedNodes: [],
|
|
105
|
-
removedNodes: [virtualDOMElement.nodeId]
|
|
132
|
+
type: "textChanged",
|
|
133
|
+
nodeId: virtualDOMElement.nodeId,
|
|
134
|
+
text: virtualDOMElement.textContent || ""
|
|
106
135
|
};
|
|
107
136
|
return diff;
|
|
108
|
-
} else if (!visible && !shouldBeVisible) {
|
|
109
|
-
return null;
|
|
110
137
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (mutation.type === "childList") {
|
|
124
|
-
let previousSibling = mutation.previousSibling;
|
|
125
|
-
let previousNodeId = null;
|
|
126
|
-
if (previousSibling) {
|
|
127
|
-
let previousIndex = virtualDOMElement.childNodes.indexOf(previousSibling);
|
|
128
|
-
while (previousIndex !== -1) {
|
|
129
|
-
previousSibling = virtualDOMElement.childNodes[previousIndex];
|
|
130
|
-
if (visibleNodesForConnection.has(previousSibling.nodeId)) {
|
|
131
|
-
previousNodeId = previousSibling.nodeId;
|
|
132
|
-
break;
|
|
138
|
+
case "childList": {
|
|
139
|
+
let previousSibling = mutation.previousSibling;
|
|
140
|
+
let previousNodeId = null;
|
|
141
|
+
if (previousSibling) {
|
|
142
|
+
let previousIndex = virtualDOMElement.childNodes.indexOf(previousSibling);
|
|
143
|
+
while (previousIndex !== -1) {
|
|
144
|
+
previousSibling = virtualDOMElement.childNodes[previousIndex];
|
|
145
|
+
if (visibleNodesForConnection.has(previousSibling.nodeId)) {
|
|
146
|
+
previousNodeId = previousSibling.nodeId;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
previousIndex--;
|
|
133
150
|
}
|
|
134
|
-
previousIndex--;
|
|
135
151
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
const diff = {
|
|
153
|
+
type: "childrenChanged",
|
|
154
|
+
nodeId: virtualDOMElement.nodeId,
|
|
155
|
+
previousNodeId,
|
|
156
|
+
addedNodes: [],
|
|
157
|
+
removedNodes: []
|
|
158
|
+
};
|
|
159
|
+
mutation.addedNodes.forEach((childVirtualDOMElement) => {
|
|
160
|
+
const describedNode = describeNodeWithChildrenForConnectionId(
|
|
161
|
+
childVirtualDOMElement,
|
|
162
|
+
connectionId,
|
|
163
|
+
visibleNodesForConnection
|
|
164
|
+
);
|
|
165
|
+
if (!describedNode) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
diff.addedNodes.push(describedNode);
|
|
169
|
+
});
|
|
170
|
+
mutation.removedNodes.forEach((childVirtualDOMElement) => {
|
|
171
|
+
if (visibleNodesForConnection.has(childVirtualDOMElement.nodeId)) {
|
|
172
|
+
removeNodeAndChildrenFromVisibleNodes(childVirtualDOMElement, visibleNodesForConnection);
|
|
173
|
+
diff.removedNodes.push(childVirtualDOMElement.nodeId);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
if (diff.addedNodes.length > 0 || diff.removedNodes.length > 0) {
|
|
177
|
+
return diff;
|
|
159
178
|
}
|
|
160
|
-
|
|
161
|
-
if (diff.addedNodes.length > 0 || diff.removedNodes.length > 0) {
|
|
162
|
-
return diff;
|
|
179
|
+
return null;
|
|
163
180
|
}
|
|
164
|
-
|
|
181
|
+
default:
|
|
182
|
+
console.error("Unknown mutation type: " + mutation.type);
|
|
183
|
+
break;
|
|
165
184
|
}
|
|
166
|
-
console.error("Unknown mutation type: " + mutation.type);
|
|
167
185
|
return null;
|
|
168
186
|
}
|
|
169
187
|
function getNodeIdOfPreviousVisibleSibling(parentVirtualElement, candidateIndex, visibleNodesForConnection) {
|
|
@@ -308,55 +326,72 @@ function virtualDOMDiffToVirtualDOMMutationRecord(virtualStructure, domDiff) {
|
|
|
308
326
|
}
|
|
309
327
|
const addedNodes = [];
|
|
310
328
|
const removedNodes = [];
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
329
|
+
switch (domDiff.op) {
|
|
330
|
+
case "add": {
|
|
331
|
+
addedNodes.push(domDiff.value);
|
|
332
|
+
return [
|
|
333
|
+
{
|
|
334
|
+
type: "childList",
|
|
335
|
+
target: node,
|
|
336
|
+
addedNodes,
|
|
337
|
+
removedNodes,
|
|
338
|
+
previousSibling,
|
|
339
|
+
attributeName: null
|
|
340
|
+
}
|
|
341
|
+
];
|
|
342
|
+
}
|
|
343
|
+
case "remove": {
|
|
344
|
+
const removedNode = pointer.get(virtualStructure);
|
|
345
|
+
removedNodes.push(removedNode);
|
|
346
|
+
return [
|
|
347
|
+
{
|
|
348
|
+
type: "childList",
|
|
349
|
+
target: node,
|
|
350
|
+
addedNodes,
|
|
351
|
+
removedNodes,
|
|
352
|
+
previousSibling,
|
|
353
|
+
attributeName: null
|
|
354
|
+
}
|
|
355
|
+
];
|
|
356
|
+
}
|
|
357
|
+
case "replace": {
|
|
358
|
+
const removedNode = pointer.get(virtualStructure);
|
|
359
|
+
removedNodes.push(removedNode);
|
|
360
|
+
addedNodes.push(domDiff.value);
|
|
361
|
+
return [
|
|
362
|
+
{
|
|
363
|
+
type: "childList",
|
|
364
|
+
target: node,
|
|
365
|
+
addedNodes: [],
|
|
366
|
+
removedNodes,
|
|
367
|
+
previousSibling,
|
|
368
|
+
attributeName: null
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
type: "childList",
|
|
372
|
+
target: node,
|
|
373
|
+
addedNodes,
|
|
374
|
+
removedNodes: [],
|
|
375
|
+
previousSibling,
|
|
376
|
+
attributeName: null
|
|
377
|
+
}
|
|
378
|
+
];
|
|
379
|
+
}
|
|
358
380
|
}
|
|
359
381
|
}
|
|
382
|
+
if (domDiff.op === "replace" && domDiff.path === "") {
|
|
383
|
+
const node = domDiff.value;
|
|
384
|
+
return [
|
|
385
|
+
{
|
|
386
|
+
type: "snapshot",
|
|
387
|
+
target: node,
|
|
388
|
+
addedNodes: [],
|
|
389
|
+
removedNodes: [],
|
|
390
|
+
previousSibling: null,
|
|
391
|
+
attributeName: null
|
|
392
|
+
}
|
|
393
|
+
];
|
|
394
|
+
}
|
|
360
395
|
console.error("Unhandled JSON diff:", JSON.stringify(domDiff, null, 2));
|
|
361
396
|
throw new Error("Unhandled diff type");
|
|
362
397
|
}
|
|
@@ -641,19 +676,19 @@ var _NetworkedDOM = class {
|
|
|
641
676
|
domDiff.originalState,
|
|
642
677
|
virtualDOMDiff
|
|
643
678
|
);
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
679
|
+
if (virtualDOMDiff.path === "" && virtualDOMDiff.op === "replace") {
|
|
680
|
+
} else {
|
|
681
|
+
const patchResults = (0, import_rfc6902.applyPatch)(domDiff.originalState, [virtualDOMDiff]);
|
|
682
|
+
for (const patchResult of patchResults) {
|
|
683
|
+
if (patchResult !== null) {
|
|
684
|
+
console.error("Patching virtual dom structure resulted in error", patchResult);
|
|
685
|
+
throw patchResult;
|
|
686
|
+
}
|
|
649
687
|
}
|
|
650
688
|
}
|
|
651
689
|
for (const mutationRecordLike of mutationRecordLikes) {
|
|
652
690
|
const targetNodeId = mutationRecordLike.target.nodeId;
|
|
653
691
|
const virtualElementParent = findParentNodeOfNodeId(domDiff.originalState, targetNodeId);
|
|
654
|
-
if (!virtualElementParent) {
|
|
655
|
-
throw new Error(`could not find parent node of nodeId ${targetNodeId}`);
|
|
656
|
-
}
|
|
657
692
|
diffsByConnectionId.forEach((diffs, connectionId) => {
|
|
658
693
|
const mutationDiff = diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(
|
|
659
694
|
mutationRecordLike,
|
|
@@ -817,9 +852,6 @@ var _NetworkedDOM = class {
|
|
|
817
852
|
}
|
|
818
853
|
dispose() {
|
|
819
854
|
this.disposed = true;
|
|
820
|
-
for (const [, connectionId] of this.webSocketToConnectionId) {
|
|
821
|
-
this.observableDOM.removeConnectedUserId(connectionId);
|
|
822
|
-
}
|
|
823
855
|
this.observableDOM.dispose();
|
|
824
856
|
for (const [webSocket, connectionId] of this.webSocketToConnectionId) {
|
|
825
857
|
const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);
|
package/build/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/NetworkedDOM.ts", "../src/diffing.ts", "../src/EditableNetworkedDOM.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./NetworkedDOM\";\nexport * from \"./EditableNetworkedDOM\";\n", "import {\n ClientMessage,\n Diff,\n NodeDescription,\n PongMessage,\n RemoteEvent,\n ServerMessage,\n SnapshotMessage,\n} from \"@mml-io/networked-dom-protocol\";\nimport {\n LogMessage,\n ObservableDOMInterface,\n ObservableDOMMessage,\n ObservableDOMParameters,\n StaticVirtualDOMElement,\n StaticVirtualDOMMutationIdsRecord,\n} from \"@mml-io/observable-dom-common\";\nimport { applyPatch } from \"rfc6902\";\n\nimport { StaticVirtualDOMMutationRecord, VirtualDOMDiffStruct } from \"./common\";\nimport {\n calculateStaticVirtualDOMDiff,\n describeNodeWithChildrenForConnectionId,\n diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection,\n findParentNodeOfNodeId,\n virtualDOMDiffToVirtualDOMMutationRecord,\n} from \"./diffing\";\n\nexport const networkedDOMProtocolSubProtocol_v0_1 = \"networked-dom-v0.1\";\nexport const defaultWebsocketSubProtocol = networkedDOMProtocolSubProtocol_v0_1;\n\nexport type ObservableDOMFactory = (\n observableDOMParameters: ObservableDOMParameters,\n callback: (message: ObservableDOMMessage, observableDOM: ObservableDOMInterface) => void,\n) => ObservableDOMInterface;\n\nexport class NetworkedDOM {\n // First to last in order of preference\n public static SupportedWebsocketSubProtocolsPreferenceOrder = [\n networkedDOMProtocolSubProtocol_v0_1,\n ];\n\n // Map from the node ids that the DOM uses internally to the node ids that clients refer to.\n private internalNodeIdToClientNodeId = new Map<number, number>();\n\n // Map from the node ids that clients refer to to the node ids that the DOM uses internally.\n private clientNodeIdToInternalNodeId = new Map<number, number>();\n\n private currentConnectionId = 1;\n private connectionIdToWebSocketContext = new Map<\n number,\n { webSocket: WebSocket; messageListener: (messageEvent: MessageEvent) => void }\n >();\n private webSocketToConnectionId = new Map<WebSocket, number>();\n private visibleNodeIdsByConnectionId = new Map<number, Set<number>>();\n private initialLoad = true;\n private readonly htmlPath: string;\n\n private disposed = false;\n private ignoreTextNodes: boolean;\n\n private documentRoot!: StaticVirtualDOMElement;\n private nodeIdToNode = new Map<number, StaticVirtualDOMElement>();\n private nodeIdToParentNodeId = new Map<number, number>();\n\n private observableDOM: ObservableDOMInterface;\n\n private documentEffectiveStartTime = Date.now();\n private latestDocumentTime = 0;\n private pingCounter = 1;\n private maximumNodeId = 0;\n\n private logCallback?: (message: LogMessage) => void;\n\n constructor(\n observableDOMFactory: ObservableDOMFactory,\n htmlPath: string,\n htmlContents: string,\n oldInstanceDocumentRoot: StaticVirtualDOMElement | null,\n onLoad: (domDiff: VirtualDOMDiffStruct | null, networkedDOM: NetworkedDOM) => void,\n params = {},\n ignoreTextNodes = true,\n logCallback?: (message: LogMessage) => void,\n ) {\n this.htmlPath = htmlPath;\n this.ignoreTextNodes = ignoreTextNodes;\n\n this.logCallback = logCallback || this.defaultLogCallback;\n\n this.observableDOM = observableDOMFactory(\n {\n htmlPath,\n htmlContents,\n params,\n ignoreTextNodes,\n pingIntervalMilliseconds: 5000,\n },\n (message: ObservableDOMMessage, observableDOM: ObservableDOMInterface) => {\n this.observableDOM = observableDOM;\n if (message.documentTime) {\n this.documentEffectiveStartTime = Date.now() - message.documentTime;\n this.latestDocumentTime = message.documentTime;\n }\n if (message.snapshot) {\n this.documentRoot = message.snapshot;\n const clonedSnapshot = JSON.parse(JSON.stringify(message.snapshot));\n\n if (!this.initialLoad) {\n throw new Error(\"Received snapshot after initial load\");\n }\n this.initialLoad = false;\n\n let domDiff: VirtualDOMDiffStruct | null = null;\n if (oldInstanceDocumentRoot) {\n domDiff = calculateStaticVirtualDOMDiff(oldInstanceDocumentRoot, clonedSnapshot);\n for (const remapping of domDiff.nodeIdRemappings) {\n this.addRemappedNodeId(remapping.clientFacingNodeId, remapping.internalNodeId);\n }\n }\n\n this.addAndRemapNodeFromInstance(this.documentRoot, -1);\n\n onLoad(domDiff, this);\n } else if (message.mutation) {\n if (this.initialLoad) {\n throw new Error(\"Received mutation before initial load\");\n }\n const mutation = this.addKnownNodesInMutation(message.mutation);\n this.processModification(mutation);\n this.removeKnownNodesInMutation(mutation);\n } else if (message.logMessage) {\n if (this.logCallback) {\n this.logCallback(message.logMessage);\n }\n } else {\n if (message.documentTime) {\n // This is just a regular ping message to update the document time - send the document time to all connected clients\n this.sendPings();\n return;\n }\n console.error(\"Unknown message type from observableDOM\", message);\n }\n },\n );\n }\n\n private defaultLogCallback(message: LogMessage) {\n const getLogFn = (level: string) => {\n switch (level) {\n case \"system\":\n return console.error;\n case \"error\":\n return console.error;\n case \"warn\":\n return console.warn;\n case \"log\":\n return console.log;\n case \"info\":\n return console.info;\n default:\n return console.log;\n }\n };\n\n const logFn = getLogFn(message.level);\n logFn(`${message.level.toUpperCase()} (${this.htmlPath}):`, ...message.content);\n }\n\n private addRemappedNodeId(clientFacingNodeId: number, internalNodeId: number) {\n this.internalNodeIdToClientNodeId.set(internalNodeId, clientFacingNodeId);\n this.clientNodeIdToInternalNodeId.set(clientFacingNodeId, internalNodeId);\n this.maximumNodeId = Math.max(this.maximumNodeId, Math.max(clientFacingNodeId, internalNodeId));\n }\n\n private sendPings() {\n const ping = this.pingCounter++;\n if (this.pingCounter > 1000) {\n this.pingCounter = 1;\n }\n const pingMessage: Array<ServerMessage> = [\n {\n type: \"ping\",\n ping,\n documentTime: this.getDocumentTime(),\n },\n ];\n const stringified = JSON.stringify(pingMessage);\n this.connectionIdToWebSocketContext.forEach((webSocketContext) => {\n webSocketContext.webSocket.send(stringified);\n });\n }\n\n private getInitialSnapshot(\n connectionId: number,\n documentVirtualDOMElement: StaticVirtualDOMElement,\n ): SnapshotMessage {\n const visibleNodesForConnection = this.visibleNodeIdsByConnectionId.get(connectionId);\n if (!visibleNodesForConnection) {\n const err = new Error(\n `visibleNodesForConnection not found for connectionId in getInitialSnapshot: ${connectionId}`,\n );\n console.error(err);\n throw err;\n }\n const domSnapshot: NodeDescription | null = describeNodeWithChildrenForConnectionId(\n documentVirtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!domSnapshot) {\n throw new Error(`domSnapshot was not generated`);\n }\n return {\n type: \"snapshot\",\n snapshot: domSnapshot,\n documentTime: Date.now() - this.documentEffectiveStartTime,\n };\n }\n\n public getDocumentTime(): number {\n return this.latestDocumentTime;\n }\n\n public addExistingWebsockets(\n websockets: Array<WebSocket>,\n existingWebsocketMap: Map<WebSocket, number> | null,\n domDiff: VirtualDOMDiffStruct | null,\n ) {\n const connectionIds = [];\n for (const websocket of websockets) {\n let existingId = null;\n if (existingWebsocketMap !== null) {\n existingId = existingWebsocketMap.get(websocket);\n }\n const { connectionId } = this.registerWebsocket(websocket, existingId);\n connectionIds.push(connectionId);\n }\n\n if (domDiff) {\n const diffsByConnectionId = new Map<number, Array<Diff>>(\n connectionIds.map((connectionId) => [connectionId, []]),\n );\n\n // Each of the websockets needs to have the original state of the document re-applied to it to determine visible\n // nodes, but not sent (they already have the old version of the document as their state).\n for (const connectionId of connectionIds) {\n // Ignore the return value - the side effect is that the visible nodes for the connection are set\n this.getInitialSnapshot(connectionId, domDiff.originalState);\n }\n\n for (const virtualDOMDiff of domDiff.virtualDOMDiffs) {\n // Convert the diff of the virtual dom data structure to a MutationRecord-like diff and then handle it as if it were a MutationRecord\n // The difficulty here is that the JSON diff is typed by add/remove/replace of elements of a hierarchy specified by paths, but MutationRecords are specified by type of operation and nodeIds\n\n const mutationRecordLikes = virtualDOMDiffToVirtualDOMMutationRecord(\n domDiff.originalState,\n virtualDOMDiff,\n );\n\n const patchResults = applyPatch(domDiff.originalState, [virtualDOMDiff]);\n for (const patchResult of patchResults) {\n if (patchResult !== null) {\n console.error(\"Patching virtual dom structure resulted in error\", patchResult);\n throw patchResult;\n }\n }\n\n for (const mutationRecordLike of mutationRecordLikes) {\n const targetNodeId = mutationRecordLike.target.nodeId;\n const virtualElementParent = findParentNodeOfNodeId(domDiff.originalState, targetNodeId);\n if (!virtualElementParent) {\n throw new Error(`could not find parent node of nodeId ${targetNodeId}`);\n }\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n const mutationDiff = diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(\n mutationRecordLike,\n virtualElementParent,\n connectionId,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.visibleNodeIdsByConnectionId.get(connectionId)!,\n );\n if (mutationDiff) {\n diffs.push(mutationDiff);\n }\n });\n }\n }\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n if (diffs.length === 0) {\n // Need to add an \"empty\" message to allow passing the document time to the client\n diffs.push({\n type: \"childrenChanged\",\n nodeId: this.documentRoot.nodeId,\n previousNodeId: null,\n addedNodes: [],\n removedNodes: [],\n });\n }\n const asServerMessages: Array<ServerMessage> = diffs;\n const firstDiff = diffs[0];\n firstDiff.documentTime = this.getDocumentTime();\n const serializedDiffs = JSON.stringify(asServerMessages, null, 4);\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(`webSocketContext not found in addExistingWebsockets`);\n }\n webSocketContext.webSocket.send(serializedDiffs);\n });\n } else {\n const documentVirtualDOMElement = this.documentRoot;\n if (!documentVirtualDOMElement) {\n throw new Error(`documentVirtualDOMElement not found in getInitialSnapshot`);\n }\n for (const connectionId of connectionIds) {\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(`webSocketContext not found in addExistingWebsockets`);\n }\n const asServerMessages: Array<ServerMessage> = [\n this.getInitialSnapshot(connectionId, documentVirtualDOMElement),\n ];\n const serializedSnapshotMessage = JSON.stringify(asServerMessages);\n webSocketContext.webSocket.send(serializedSnapshotMessage);\n }\n }\n\n for (const connectionId of connectionIds) {\n this.observableDOM.addConnectedUserId(connectionId);\n }\n }\n\n private findParentNodeOfNodeId(targetNodeId: number): StaticVirtualDOMElement | null {\n const parentNodeId = this.nodeIdToParentNodeId.get(targetNodeId);\n if (parentNodeId === undefined) {\n throw new Error(\"Parent node ID not found\");\n }\n return this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(parentNodeId);\n }\n\n private registerWebsocket(\n webSocket: WebSocket,\n existingConnectionId: number | null = null,\n ): { connectionId: number } {\n let connectionId: number;\n if (existingConnectionId !== null) {\n connectionId = existingConnectionId;\n this.currentConnectionId = Math.max(this.currentConnectionId, connectionId + 1);\n } else {\n connectionId = this.currentConnectionId++;\n }\n const webSocketContext = {\n webSocket,\n messageListener: (messageEvent: MessageEvent) => {\n const string = String(messageEvent.data);\n let parsed;\n try {\n parsed = JSON.parse(string) as ClientMessage;\n } catch (e) {\n console.error(`Error parsing message from websocket: ${string}`);\n console.trace();\n return;\n }\n\n if (NetworkedDOM.IsPongMessage(parsed)) {\n // Ignore pongs for now\n return;\n }\n\n this.dispatchRemoteEvent(webSocket, parsed);\n },\n };\n this.connectionIdToWebSocketContext.set(connectionId, webSocketContext);\n this.visibleNodeIdsByConnectionId.set(connectionId, new Set());\n this.webSocketToConnectionId.set(webSocket, connectionId);\n webSocket.addEventListener(\"message\", webSocketContext.messageListener);\n return { connectionId };\n }\n\n public static handleWebsocketSubprotocol(protocols: Set<string> | Array<string>): string | false {\n const protocolsSet = new Set(protocols);\n // Find highest priority (first in the array) protocol that is supported\n for (const protocol of NetworkedDOM.SupportedWebsocketSubProtocolsPreferenceOrder) {\n if (protocolsSet.has(protocol)) {\n return protocol;\n }\n }\n return false;\n }\n\n public addWebSocket(webSocket: WebSocket): void {\n if (this.initialLoad) {\n throw new Error(\"addWebSocket called before initial load - unsupported at this time\");\n }\n if (this.disposed) {\n console.error(\"addWebSocket called on disposed NetworkedDOM\");\n throw new Error(\"This NetworkedDOM has been disposed\");\n }\n\n if (webSocket.protocol) {\n if (\n NetworkedDOM.SupportedWebsocketSubProtocolsPreferenceOrder.indexOf(webSocket.protocol) ===\n -1\n ) {\n const errorMessageString = `Unsupported websocket subprotocol: ${webSocket.protocol}`;\n const errorMessage: Array<ServerMessage> = [\n {\n type: \"error\",\n message: errorMessageString,\n },\n ];\n webSocket.send(JSON.stringify(errorMessage));\n webSocket.close();\n return;\n }\n } else {\n // TODO - Revisit the default handling of non-protocol websockets. It is easier to debug if a lack of protocol results in an error.\n // Assume for now that this client is a legacy MML client that doesn't send a protocol, but send a warning to the client to encourage specifying a protocol\n const warningMessageString = `No websocket subprotocol specified. Please specify a subprotocol to ensure compatibility with networked-dom servers. Assuming subprotocol \"${defaultWebsocketSubProtocol}\" for this connection.`;\n const warningMessage: Array<ServerMessage> = [\n {\n type: \"warning\",\n message: warningMessageString,\n },\n ];\n webSocket.send(JSON.stringify(warningMessage));\n }\n\n const { connectionId } = this.registerWebsocket(webSocket);\n const documentVirtualDOMElement = this.documentRoot;\n if (!documentVirtualDOMElement) {\n throw new Error(`documentVirtualDOMElement not found in getInitialSnapshot`);\n }\n const asServerMessages: Array<ServerMessage> = [\n this.getInitialSnapshot(connectionId, documentVirtualDOMElement),\n ];\n const serializedSnapshotMessage = JSON.stringify(asServerMessages);\n webSocket.send(serializedSnapshotMessage);\n this.observableDOM.addConnectedUserId(connectionId);\n }\n\n public removeWebSocket(webSocket: WebSocket): void {\n const connectionId = this.webSocketToConnectionId.get(webSocket);\n if (!connectionId) {\n return;\n }\n this.observableDOM.removeConnectedUserId(connectionId);\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(\"Missing context for websocket\");\n }\n webSocket.removeEventListener(\"message\", webSocketContext.messageListener);\n this.connectionIdToWebSocketContext.delete(connectionId);\n this.visibleNodeIdsByConnectionId.delete(connectionId);\n this.webSocketToConnectionId.delete(webSocket);\n }\n\n public dispose(): void {\n this.disposed = true;\n for (const [, connectionId] of this.webSocketToConnectionId) {\n this.observableDOM.removeConnectedUserId(connectionId);\n }\n\n // Handle all of the remaining mutations that the disconnections could have caused\n this.observableDOM.dispose();\n\n for (const [webSocket, connectionId] of this.webSocketToConnectionId) {\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(\"Missing context for websocket\");\n }\n webSocket.removeEventListener(\"message\", webSocketContext.messageListener);\n this.connectionIdToWebSocketContext.delete(connectionId);\n this.visibleNodeIdsByConnectionId.delete(connectionId);\n this.webSocketToConnectionId.delete(webSocket);\n }\n }\n\n private processModification(mutationRecord: StaticVirtualDOMMutationRecord): void {\n const documentVirtualDOMElement = this.documentRoot;\n if (!documentVirtualDOMElement) {\n throw new Error(`document not created in processModification`);\n }\n\n for (const [, visibleNodesForConnection] of this.visibleNodeIdsByConnectionId) {\n visibleNodesForConnection.add(documentVirtualDOMElement.nodeId);\n }\n\n const diffsByConnectionId = new Map<number, Array<Diff>>(\n Array.from(this.connectionIdToWebSocketContext.keys()).map((connectionId) => [\n connectionId,\n [],\n ]),\n );\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n const parentNode = this.findParentNodeOfNodeId(mutationRecord.target.nodeId);\n if (mutationRecord.type === \"attributes\" && !parentNode) {\n console.error(\"parentNode not found for attribute mutationRecord\", mutationRecord);\n console.error(\"this.documentRoot\", JSON.stringify(this.documentRoot, null, 2));\n }\n const diff = diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(\n mutationRecord,\n parentNode,\n connectionId,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.visibleNodeIdsByConnectionId.get(connectionId)!,\n );\n if (diff) {\n diffs.push(diff);\n }\n });\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n if (diffs.length > 0) {\n const asServerMessages: Array<ServerMessage> = diffs;\n const serializedDiffs = JSON.stringify(asServerMessages, null, 4);\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(`webSocketContext not found in processModificationList`);\n }\n webSocketContext.webSocket.send(serializedDiffs);\n }\n });\n }\n\n private removeKnownNodesInMutation(mutation: StaticVirtualDOMMutationRecord): void {\n const virtualDOMElement = mutation.target;\n if (mutation.type === \"childList\") {\n mutation.removedNodes.forEach((childDOMElement: StaticVirtualDOMElement) => {\n this.removeVirtualDOMElement(childDOMElement);\n const index = virtualDOMElement.childNodes.indexOf(childDOMElement);\n virtualDOMElement.childNodes.splice(index, 1);\n });\n return;\n }\n }\n\n private removeVirtualDOMElement(virtualDOMElement: StaticVirtualDOMElement): void {\n this.nodeIdToNode.delete(virtualDOMElement.nodeId);\n this.nodeIdToParentNodeId.delete(virtualDOMElement.nodeId);\n for (const child of virtualDOMElement.childNodes) {\n this.removeVirtualDOMElement(child);\n }\n }\n\n static IsPongMessage(message: ClientMessage): message is PongMessage {\n return (message as PongMessage).type === \"pong\";\n }\n\n private dispatchRemoteEvent(webSocket: WebSocket, remoteEvent: RemoteEvent): void {\n if (this.disposed) {\n console.error(\"Cannot dispatch remote event after dispose\");\n throw new Error(\"This NetworkedDOM has been disposed\");\n }\n\n const connectionId = this.webSocketToConnectionId.get(webSocket);\n if (!connectionId) {\n console.error(\"Unknown web socket dispatched event:\", webSocket);\n return;\n }\n\n const visibleNodes = this.visibleNodeIdsByConnectionId.get(connectionId);\n if (!visibleNodes) {\n console.error(\"No visible nodes for connection: \" + connectionId);\n return;\n }\n\n if (!visibleNodes.has(remoteEvent.nodeId)) {\n // TODO - do a pass through the hierarchy to determine if this node should be visible to this connection id to prevent clients submitting events for nodes they can't (currently) see\n console.error(\"Node not visible for connection: \" + remoteEvent.nodeId);\n return;\n }\n\n const remappedNode = this.clientNodeIdToInternalNodeId.get(remoteEvent.nodeId);\n if (remappedNode) {\n remoteEvent.nodeId = remappedNode;\n }\n\n this.observableDOM.dispatchRemoteEventFromConnectionId(connectionId, remoteEvent);\n }\n\n private getStaticVirtualDOMElementByInternalNodeIdOrThrow(\n internalNodeId: number,\n ): StaticVirtualDOMElement {\n const remappedId = this.internalNodeIdToClientNodeId.get(internalNodeId);\n if (remappedId !== undefined) {\n const node = this.nodeIdToNode.get(remappedId);\n if (!node) {\n throw new Error(\"Remapped node not found with nodeId \" + remappedId);\n }\n return node;\n }\n const node = this.nodeIdToNode.get(internalNodeId);\n if (!node) {\n throw new Error(\"Node not found with nodeId:\" + internalNodeId);\n }\n return node;\n }\n\n private addKnownNodesInMutation(\n mutation: StaticVirtualDOMMutationIdsRecord,\n ): StaticVirtualDOMMutationRecord {\n const target = this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(mutation.targetId);\n\n // TODO - avoid mutation in this conversion - use the attribute pair in the handling (would require changing StaticVirtualDOMMutationRecord.attributeName to be the key/value pair).\n if (mutation.attribute) {\n if (mutation.attribute.value !== null) {\n target.attributes[mutation.attribute.attributeName] = mutation.attribute.value;\n } else {\n delete target.attributes[mutation.attribute.attributeName];\n }\n }\n\n const previousSibling = mutation.previousSiblingId\n ? this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(mutation.previousSiblingId)\n : null;\n\n if (mutation.type === \"childList\") {\n let index = 0;\n if (previousSibling) {\n index = target.childNodes.indexOf(previousSibling);\n if (index === -1) {\n throw new Error(\"Previous sibling is not currently a child of the parent element\");\n }\n index += 1;\n }\n mutation.addedNodes.forEach((childVirtualDOMElement: StaticVirtualDOMElement) => {\n this.addAndRemapNodeFromInstance(childVirtualDOMElement, target.nodeId);\n\n if (target.childNodes.indexOf(childVirtualDOMElement) === -1) {\n target.childNodes.splice(index, 0, childVirtualDOMElement);\n index++;\n }\n });\n } else if (mutation.type === \"attributes\") {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const attributePair = mutation.attribute!;\n if (attributePair.value === null) {\n delete target.attributes[attributePair.attributeName];\n } else {\n target.attributes[attributePair.attributeName] = attributePair.value;\n }\n } else if (mutation.type === \"characterData\") {\n // TODO - reimplement characterData\n throw new Error(\"characterData not supported\");\n // virtualDOMElement.textContent = targetNode.textContent ? targetNode.textContent : undefined;\n }\n\n const record: StaticVirtualDOMMutationRecord = {\n type: mutation.type,\n target,\n addedNodes: mutation.addedNodes,\n removedNodes: mutation.removedNodeIds.map((nodeId) => {\n return this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(nodeId);\n }),\n previousSibling: mutation.previousSiblingId\n ? this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(mutation.previousSiblingId)\n : null,\n attributeName: mutation.attribute ? mutation.attribute.attributeName : null,\n };\n\n return record;\n }\n\n getSnapshot(): StaticVirtualDOMElement {\n return this.documentRoot;\n }\n\n private addAndRemapNodeFromInstance(node: StaticVirtualDOMElement, parentNodeId: number) {\n const remappedNodeId = this.internalNodeIdToClientNodeId.get(node.nodeId);\n if (remappedNodeId !== undefined) {\n node.nodeId = remappedNodeId;\n } else {\n // This id might already refer to a node in this client's view. If so, we need to remap it to a new id.\n const existingClientReference = this.clientNodeIdToInternalNodeId.get(node.nodeId);\n if (existingClientReference) {\n const newNodeId = ++this.maximumNodeId;\n this.addRemappedNodeId(newNodeId, node.nodeId);\n node.nodeId = newNodeId;\n }\n }\n\n if (this.nodeIdToNode.has(node.nodeId)) {\n throw new Error(\"Node already exists with id \" + node.nodeId);\n }\n\n this.nodeIdToNode.set(node.nodeId, node);\n this.nodeIdToParentNodeId.set(node.nodeId, parentNodeId);\n this.maximumNodeId = Math.max(this.maximumNodeId, node.nodeId);\n\n for (const childNode of node.childNodes) {\n this.addAndRemapNodeFromInstance(childNode, node.nodeId);\n }\n }\n\n public getWebsocketConnectionIdMap() {\n // return a clone of the map\n return new Map(this.webSocketToConnectionId);\n }\n}\n", "import {\n AttributeChangedDiff,\n ChildrenChangedDiff,\n Diff,\n ElementNodeDescription,\n NodeDescription,\n TextChangedDiff,\n TextNodeDescription,\n} from \"@mml-io/networked-dom-protocol\";\nimport { StaticVirtualDOMElement } from \"@mml-io/observable-dom-common\";\nimport * as rfc6902 from \"rfc6902\";\n\nimport { NodeMapping, StaticVirtualDOMMutationRecord, VirtualDOMDiffStruct } from \"./common\";\n\nexport const visibleToAttrName = \"visible-to\";\nexport const hiddenFromAttrName = \"hidden-from\";\n\n// This function does a lot of heavy lifting - it takes a mutation and applies it to the connection's view (affecting which nodes are visible based on attributes etc.)\n// As a result of that application it generates a diff for that client's view of the DOM.\nexport function diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(\n mutation: StaticVirtualDOMMutationRecord,\n parentNode: StaticVirtualDOMElement | null,\n connectionId: number,\n visibleNodesForConnection: Set<number>,\n): Diff | null {\n const virtualDOMElement = mutation.target;\n\n if (mutation.type === \"attributes\") {\n const visible = visibleNodesForConnection.has(virtualDOMElement.nodeId);\n\n if (!parentNode) {\n throw new Error(\"Node has no parent\");\n }\n const parentNodeId = parentNode.nodeId;\n const shouldBeVisible =\n shouldShowNodeToConnectionId(virtualDOMElement, connectionId) &&\n visibleNodesForConnection.has(parentNodeId);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const attributeName = mutation.attributeName!;\n\n if (visible && shouldBeVisible) {\n let newValue = null; // null indicates deleted\n if (virtualDOMElement.attributes[attributeName] !== undefined) {\n newValue = virtualDOMElement.attributes[attributeName];\n }\n const diff: AttributeChangedDiff = {\n type: \"attributeChange\",\n nodeId: virtualDOMElement.nodeId,\n attribute: attributeName,\n newValue,\n };\n return diff;\n } else if (!visible && shouldBeVisible) {\n // Need to add this child to the connection's view now\n visibleNodesForConnection.add(virtualDOMElement.nodeId);\n\n const index = parentNode.childNodes.indexOf(virtualDOMElement);\n if (index === -1) {\n throw new Error(\"Node not found in parent's children\");\n }\n\n let previousNodeId = null;\n if (index > 0) {\n previousNodeId = getNodeIdOfPreviousVisibleSibling(\n parentNode,\n index - 1,\n visibleNodesForConnection,\n );\n }\n\n const nodeDescription = describeNodeWithChildrenForConnectionId(\n virtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!nodeDescription) {\n throw new Error(\"Node description not found\");\n }\n const diff: ChildrenChangedDiff = {\n type: \"childrenChanged\",\n nodeId: parentNodeId,\n previousNodeId,\n addedNodes: [nodeDescription],\n removedNodes: [],\n };\n return diff;\n } else if (visible && !shouldBeVisible) {\n removeNodeAndChildrenFromVisibleNodes(virtualDOMElement, visibleNodesForConnection);\n const diff: ChildrenChangedDiff = {\n type: \"childrenChanged\",\n nodeId: parentNodeId,\n previousNodeId: null,\n addedNodes: [],\n removedNodes: [virtualDOMElement.nodeId],\n };\n return diff;\n } else if (!visible && !shouldBeVisible) {\n return null;\n }\n }\n\n if (!visibleNodesForConnection.has(virtualDOMElement.nodeId)) {\n // This element is not visible to the connection, so we don't need to send a diff for it or its children\n return null;\n }\n\n if (mutation.type === \"characterData\") {\n const diff: TextChangedDiff = {\n type: \"textChanged\",\n nodeId: virtualDOMElement.nodeId,\n text: virtualDOMElement.textContent || \"\",\n };\n return diff;\n }\n\n if (mutation.type === \"childList\") {\n let previousSibling = mutation.previousSibling;\n let previousNodeId: number | null = null;\n if (previousSibling) {\n let previousIndex = virtualDOMElement.childNodes.indexOf(previousSibling);\n while (previousIndex !== -1) {\n previousSibling = virtualDOMElement.childNodes[previousIndex];\n if (visibleNodesForConnection.has(previousSibling.nodeId)) {\n previousNodeId = previousSibling.nodeId;\n break;\n }\n previousIndex--;\n }\n }\n\n const diff: ChildrenChangedDiff = {\n type: \"childrenChanged\",\n nodeId: virtualDOMElement.nodeId,\n previousNodeId,\n addedNodes: [],\n removedNodes: [],\n };\n\n mutation.addedNodes.forEach((childVirtualDOMElement: StaticVirtualDOMElement) => {\n const describedNode = describeNodeWithChildrenForConnectionId(\n childVirtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!describedNode) {\n return;\n }\n diff.addedNodes.push(describedNode);\n });\n mutation.removedNodes.forEach((childVirtualDOMElement: StaticVirtualDOMElement) => {\n if (visibleNodesForConnection.has(childVirtualDOMElement.nodeId)) {\n removeNodeAndChildrenFromVisibleNodes(childVirtualDOMElement, visibleNodesForConnection);\n diff.removedNodes.push(childVirtualDOMElement.nodeId);\n }\n });\n\n if (diff.addedNodes.length > 0 || diff.removedNodes.length > 0) {\n return diff;\n }\n return null;\n }\n\n console.error(\"Unknown mutation type: \" + mutation.type);\n return null;\n}\n\nfunction getNodeIdOfPreviousVisibleSibling(\n parentVirtualElement: StaticVirtualDOMElement,\n candidateIndex: number,\n visibleNodesForConnection: Set<number>,\n): number | null {\n if (candidateIndex > 0) {\n let previousSiblingIndex = candidateIndex;\n while (previousSiblingIndex >= 0) {\n const previousSibling = parentVirtualElement.childNodes[previousSiblingIndex];\n if (visibleNodesForConnection.has(previousSibling.nodeId)) {\n return previousSibling.nodeId;\n }\n previousSiblingIndex--;\n }\n }\n return null;\n}\n\nfunction shouldShowNodeToConnectionId(\n virtualDOMElement: StaticVirtualDOMElement,\n connectionId: number,\n): boolean {\n const visibleToAttr = virtualDOMElement.attributes[visibleToAttrName];\n const hiddenFromAttr = virtualDOMElement.attributes[hiddenFromAttrName];\n const connectionIdString = connectionId.toString();\n if (visibleToAttr !== undefined) {\n const visibleToList = visibleToAttr.split(\" \");\n const explicityVisible = visibleToList.includes(connectionIdString);\n if (!explicityVisible) {\n return false;\n }\n }\n if (hiddenFromAttr !== undefined) {\n const hiddenFromList = hiddenFromAttr.split(\" \");\n const explicityHidden = hiddenFromList.includes(connectionIdString);\n if (explicityHidden) {\n return false;\n }\n }\n return true;\n}\n\nexport function describeNodeWithChildrenForConnectionId(\n virtualDOMElement: StaticVirtualDOMElement,\n connectionId: number,\n visibleNodesForConnection: Set<number>,\n): NodeDescription | null {\n if (!shouldShowNodeToConnectionId(virtualDOMElement, connectionId)) {\n return null;\n }\n\n let emittedTagName = virtualDOMElement.tag;\n if (emittedTagName === \"#document\") {\n emittedTagName = \"DIV\";\n }\n if (emittedTagName === \"#text\") {\n const textNode: TextNodeDescription = {\n type: \"text\",\n nodeId: virtualDOMElement.nodeId,\n text: virtualDOMElement.textContent || \"\",\n };\n visibleNodesForConnection.add(textNode.nodeId);\n return textNode;\n } else {\n const node: ElementNodeDescription = {\n type: \"element\",\n nodeId: virtualDOMElement.nodeId,\n tag: emittedTagName,\n attributes: virtualDOMElement.attributes,\n children: [],\n text: virtualDOMElement.textContent,\n };\n visibleNodesForConnection.add(node.nodeId);\n\n for (const child of virtualDOMElement.childNodes) {\n const childNodeDescription = describeNodeWithChildrenForConnectionId(\n child,\n connectionId,\n visibleNodesForConnection,\n );\n if (childNodeDescription) {\n node.children.push(childNodeDescription);\n }\n }\n return node;\n }\n}\n\nfunction removeNodeAndChildrenFromVisibleNodes(\n virtualDOMElement: StaticVirtualDOMElement,\n visibleNodesForConnection: Set<number>,\n): void {\n visibleNodesForConnection.delete(virtualDOMElement.nodeId);\n for (const child of virtualDOMElement.childNodes) {\n if (!visibleNodesForConnection.has(child.nodeId)) {\n console.error(\"Inner child of removed element was not visible\", child.nodeId);\n }\n removeNodeAndChildrenFromVisibleNodes(child, visibleNodesForConnection);\n }\n}\n\nexport function findParentNodeOfNodeId(\n virtualDOMElement: StaticVirtualDOMElement,\n targetNodeId: number,\n): StaticVirtualDOMElement | null {\n // TODO - avoid a search of the whole tree for the node's parent\n // depth-first search of the whole virtual dom structure to find the node's parent\n for (const child of virtualDOMElement.childNodes) {\n if (child.nodeId === targetNodeId) {\n return virtualDOMElement;\n } else {\n const foundParentId = findParentNodeOfNodeId(child, targetNodeId);\n if (foundParentId) {\n return foundParentId;\n }\n }\n }\n return null;\n}\n\nexport function virtualDOMDiffToVirtualDOMMutationRecord(\n virtualStructure: StaticVirtualDOMElement,\n domDiff: rfc6902.Operation,\n): Array<StaticVirtualDOMMutationRecord> {\n const pointer = rfc6902.Pointer.fromJSON(domDiff.path);\n const grandParentTokens = pointer.tokens.slice(0, pointer.tokens.length - 2);\n const lastToken = pointer.tokens[pointer.tokens.length - 1];\n const secondLastToken = pointer.tokens[pointer.tokens.length - 2];\n\n if (lastToken === \"textContent\") {\n const nodePointer = new rfc6902.Pointer(pointer.tokens.slice(0, pointer.tokens.length - 1));\n const node = nodePointer.get(virtualStructure) as StaticVirtualDOMElement;\n return [\n {\n type: \"characterData\",\n target: node,\n addedNodes: [],\n removedNodes: [],\n attributeName: null,\n previousSibling: null,\n },\n ];\n }\n\n if (secondLastToken === \"attributes\") {\n // This handles attribute additions, changes, and removals\n const nodePointer = new rfc6902.Pointer(grandParentTokens);\n const node = nodePointer.get(virtualStructure) as StaticVirtualDOMElement;\n return [\n {\n type: \"attributes\",\n target: node,\n addedNodes: [],\n removedNodes: [],\n attributeName: lastToken,\n previousSibling: null,\n },\n ];\n }\n\n // Child changes\n\n if (secondLastToken === \"childNodes\") {\n const nodePointer = new rfc6902.Pointer(grandParentTokens);\n const node = nodePointer.get(virtualStructure) as StaticVirtualDOMElement;\n\n let previousSibling: StaticVirtualDOMElement | null = null;\n if (lastToken === \"-\") {\n // Append to the end of the children\n } else {\n const index = parseInt(lastToken, 10);\n if (index === 0) {\n previousSibling = null;\n } else {\n previousSibling = node.childNodes[index - 1];\n }\n }\n const addedNodes: Array<StaticVirtualDOMElement> = [];\n const removedNodes: Array<StaticVirtualDOMElement> = [];\n if (domDiff.op === \"add\") {\n addedNodes.push(domDiff.value);\n return [\n {\n type: \"childList\",\n target: node,\n addedNodes,\n removedNodes,\n previousSibling,\n attributeName: null,\n },\n ];\n } else if (domDiff.op === \"remove\") {\n const removedNode = pointer.get(virtualStructure) as StaticVirtualDOMElement;\n removedNodes.push(removedNode);\n return [\n {\n type: \"childList\",\n target: node,\n addedNodes,\n removedNodes,\n previousSibling,\n attributeName: null,\n },\n ];\n } else if (domDiff.op === \"replace\") {\n // This is a replacement of a single node\n const removedNode = pointer.get(virtualStructure) as StaticVirtualDOMElement;\n removedNodes.push(removedNode);\n addedNodes.push(domDiff.value);\n return [\n {\n type: \"childList\",\n target: node,\n addedNodes: [],\n removedNodes,\n previousSibling,\n attributeName: null,\n },\n {\n type: \"childList\",\n target: node,\n addedNodes,\n removedNodes: [],\n previousSibling,\n attributeName: null,\n },\n ];\n }\n }\n\n console.error(\"Unhandled JSON diff:\", JSON.stringify(domDiff, null, 2));\n throw new Error(\"Unhandled diff type\");\n}\n\nexport function calculateStaticVirtualDOMDiff(\n originalState: StaticVirtualDOMElement,\n latestState: StaticVirtualDOMElement,\n): VirtualDOMDiffStruct {\n const jsonPatchDiffs = rfc6902.createPatch(\n originalState,\n latestState,\n (a, b, ptr: rfc6902.Pointer) => {\n if (a.tag !== b.tag) {\n return [{ op: \"replace\", path: ptr.toString(), value: b }];\n }\n return;\n },\n );\n\n const nodeIdRemappings: Array<NodeMapping> = [];\n const virtualDOMDiffs: Array<rfc6902.Operation> = [];\n for (const diff of jsonPatchDiffs) {\n if (diff.op === \"replace\" && diff.path.endsWith(\"/nodeId\")) {\n const pointer = rfc6902.Pointer.fromJSON(diff.path);\n const value = pointer.get(originalState);\n nodeIdRemappings.push({\n internalNodeId: diff.value,\n clientFacingNodeId: value,\n });\n } else {\n virtualDOMDiffs.push(diff);\n }\n }\n\n return remapDuplicatedNodeIdsInOperations(\n {\n originalState,\n nodeIdRemappings,\n virtualDOMDiffs,\n },\n latestState,\n );\n}\n\nfunction getHighestNodeId(node: StaticVirtualDOMElement) {\n let highest = node.nodeId;\n for (const child of node.childNodes) {\n highest = Math.max(highest, getHighestNodeId(child));\n }\n return highest;\n}\n\nfunction getRemovedNodeIds(before: StaticVirtualDOMElement, diff: rfc6902.Operation) {\n const removedIds = new Set<number>();\n function addNode(node: StaticVirtualDOMElement) {\n removedIds.add(node.nodeId);\n for (const child of node.childNodes) {\n addNode(child);\n }\n }\n if (diff.op === \"replace\" || diff.op === \"remove\") {\n const removedNode = rfc6902.Pointer.fromJSON(diff.path).get(before);\n addNode(removedNode);\n }\n return removedIds;\n}\n\nfunction getNodeIdsFromNodeAndChildren(node: StaticVirtualDOMElement) {\n const nodeIds = new Set<number>();\n function addNode(node: StaticVirtualDOMElement) {\n nodeIds.add(node.nodeId);\n for (const child of node.childNodes) {\n addNode(child);\n }\n }\n addNode(node);\n return nodeIds;\n}\n\n// To avoid duplicate node ids at any point in the sequence of operations, apply the operations and determine if any node ids are duplicated at any point. If so, remap the node ids to be unique.\nfunction remapDuplicatedNodeIdsInOperations(\n virtualDOMDiffStruct: VirtualDOMDiffStruct,\n latestState: StaticVirtualDOMElement,\n): VirtualDOMDiffStruct {\n const { originalState, nodeIdRemappings, virtualDOMDiffs } = virtualDOMDiffStruct;\n\n const highestNodeIdAcrossStartAndEnd = Math.max(\n getHighestNodeId(originalState),\n getHighestNodeId(latestState),\n );\n let nextNodeId = highestNodeIdAcrossStartAndEnd + 1;\n\n const before = JSON.parse(JSON.stringify(originalState));\n\n function checkAndReplaceNodeIdsIfAlreadyInUse(\n node: StaticVirtualDOMElement,\n addingNodeIds: Set<number>,\n removedIds: Set<number>,\n ) {\n if (existingNodeIds.has(node.nodeId) && removedIds && !removedIds.has(node.nodeId)) {\n // This node id is already present so it must be replaced\n const newNodeId = nextNodeId++;\n nodeIdRemappings.push({\n internalNodeId: node.nodeId,\n clientFacingNodeId: newNodeId,\n });\n node.nodeId = newNodeId;\n addingNodeIds.add(newNodeId);\n } else {\n addingNodeIds.add(node.nodeId);\n }\n for (const child of node.childNodes) {\n checkAndReplaceNodeIdsIfAlreadyInUse(child, addingNodeIds, removedIds);\n }\n }\n\n const existingNodeIds = getNodeIdsFromNodeAndChildren(before);\n\n for (const diff of virtualDOMDiffs) {\n const pointer = rfc6902.Pointer.fromJSON(diff.path);\n const secondLastToken = pointer.tokens[pointer.tokens.length - 2];\n if (secondLastToken !== \"childNodes\") {\n continue;\n }\n const removedIds = getRemovedNodeIds(before, diff);\n const addingNodeIds = new Set<number>();\n if (diff.op === \"replace\" || diff.op === \"add\") {\n // The added node can use removed node ids, but it must not use any node ids that are still in use.\n checkAndReplaceNodeIdsIfAlreadyInUse(diff.value, addingNodeIds, removedIds);\n }\n removedIds.forEach((removedId) => {\n existingNodeIds.delete(removedId);\n });\n addingNodeIds.forEach((addingNodeId) => {\n existingNodeIds.add(addingNodeId);\n });\n\n const patchErrors = rfc6902.applyPatch(before, [diff]);\n if (patchErrors.length !== 1 || patchErrors[0] !== null) {\n throw new Error(\"Patch failed\");\n }\n }\n\n return virtualDOMDiffStruct;\n}\n", "import { LogMessage, StaticVirtualDOMElement } from \"@mml-io/observable-dom-common\";\n\nimport { VirtualDOMDiffStruct } from \"./common\";\nimport { NetworkedDOM, ObservableDOMFactory } from \"./NetworkedDOM\";\n\ntype LoadedState = {\n htmlContents: string;\n networkedDOM: NetworkedDOM;\n loaded: boolean;\n};\n\n// EditableNetworkedDOM wraps NetworkedDOM instances and presents them as a single document that can iterate through\n// revisions by being loaded multiple times with different contents. The connected clients receive deltas between the\n// revisions rather than a complete refresh.\nexport class EditableNetworkedDOM {\n private htmlPath: string;\n private params: object = {};\n\n private websockets = new Set<WebSocket>();\n private loadedState: LoadedState | null = null;\n\n private observableDOMFactory: ObservableDOMFactory;\n private ignoreTextNodes: boolean;\n\n private logCallback?: (message: LogMessage) => void;\n\n constructor(\n htmlPath: string,\n observableDOMFactory: ObservableDOMFactory,\n ignoreTextNodes = true,\n logCallback?: (message: LogMessage) => void,\n ) {\n this.htmlPath = htmlPath;\n this.observableDOMFactory = observableDOMFactory;\n this.ignoreTextNodes = ignoreTextNodes;\n this.logCallback = logCallback;\n }\n\n public isLoaded() {\n return this.loadedState !== null;\n }\n\n public load(htmlContents: string, params?: object) {\n if (params !== undefined) {\n this.params = params;\n }\n\n let oldInstanceRoot: StaticVirtualDOMElement | null = null;\n let existingWebsocketMap: Map<WebSocket, number> | null = null;\n if (this.loadedState) {\n const oldInstance = this.loadedState.networkedDOM;\n existingWebsocketMap = oldInstance.getWebsocketConnectionIdMap();\n oldInstance.dispose();\n oldInstanceRoot = oldInstance.getSnapshot();\n }\n this.loadedState = null;\n\n let didLoad = false;\n const networkedDOM = new NetworkedDOM(\n this.observableDOMFactory,\n this.htmlPath,\n htmlContents,\n oldInstanceRoot,\n (domDiff: VirtualDOMDiffStruct | null, networkedDOM: NetworkedDOM) => {\n didLoad = true;\n if (this.loadedState) {\n this.loadedState.loaded = true;\n }\n networkedDOM.addExistingWebsockets(\n Array.from(this.websockets),\n existingWebsocketMap,\n domDiff,\n );\n },\n this.params,\n this.ignoreTextNodes,\n this.logCallback,\n );\n this.loadedState = {\n htmlContents,\n networkedDOM,\n loaded: didLoad,\n };\n }\n\n public reload() {\n if (this.loadedState) {\n this.load(this.loadedState.htmlContents, this.params);\n } else {\n console.warn(\"EditableNetworkedDOM.reload called whilst not loaded\");\n }\n }\n\n public dispose() {\n for (const ws of this.websockets) {\n ws.close();\n }\n this.websockets.clear();\n if (this.loadedState) {\n this.loadedState.networkedDOM.dispose();\n }\n this.loadedState = null;\n }\n\n public addWebSocket(webSocket: WebSocket) {\n this.websockets.add(webSocket);\n if (this.loadedState && this.loadedState.loaded) {\n this.loadedState.networkedDOM.addWebSocket(webSocket);\n }\n }\n\n public removeWebSocket(webSocket: WebSocket) {\n this.websockets.delete(webSocket);\n if (this.loadedState && this.loadedState.loaded) {\n this.loadedState.networkedDOM.removeWebSocket(webSocket);\n }\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,qBAA2B;;;ACP3B,cAAyB;AAIlB,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB;AAI3B,SAAS,gEACd,UACA,YACA,cACA,2BACa;AACb,QAAM,oBAAoB,SAAS;AAEnC,MAAI,SAAS,SAAS,cAAc;AAClC,UAAM,UAAU,0BAA0B,IAAI,kBAAkB,MAAM;AAEtE,QAAI,CAAC,YAAY;AACf,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,UAAM,eAAe,WAAW;AAChC,UAAM,kBACJ,6BAA6B,mBAAmB,YAAY,KAC5D,0BAA0B,IAAI,YAAY;AAG5C,UAAM,gBAAgB,SAAS;AAE/B,QAAI,WAAW,iBAAiB;AAC9B,UAAI,WAAW;AACf,UAAI,kBAAkB,WAAW,aAAa,MAAM,QAAW;AAC7D,mBAAW,kBAAkB,WAAW,aAAa;AAAA,MACvD;A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C,WAAK,YAAY,aAAa,gBAAgB,SAAS;AAAA,IACzD;AAAA,EACF;AACF;",
|
|
4
|
+
"sourcesContent": ["export * from \"./NetworkedDOM\";\nexport * from \"./EditableNetworkedDOM\";\n", "import {\n ClientMessage,\n Diff,\n NodeDescription,\n PongMessage,\n RemoteEvent,\n ServerMessage,\n SnapshotMessage,\n} from \"@mml-io/networked-dom-protocol\";\nimport {\n LogMessage,\n ObservableDOMInterface,\n ObservableDOMMessage,\n ObservableDOMParameters,\n StaticVirtualDOMElement,\n StaticVirtualDOMMutationIdsRecord,\n} from \"@mml-io/observable-dom-common\";\nimport { applyPatch } from \"rfc6902\";\n\nimport { StaticVirtualDOMMutationRecord, VirtualDOMDiffStruct } from \"./common\";\nimport {\n calculateStaticVirtualDOMDiff,\n describeNodeWithChildrenForConnectionId,\n diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection,\n findParentNodeOfNodeId,\n virtualDOMDiffToVirtualDOMMutationRecord,\n} from \"./diffing\";\n\nexport const networkedDOMProtocolSubProtocol_v0_1 = \"networked-dom-v0.1\";\nexport const defaultWebsocketSubProtocol = networkedDOMProtocolSubProtocol_v0_1;\n\nexport type ObservableDOMFactory = (\n observableDOMParameters: ObservableDOMParameters,\n callback: (message: ObservableDOMMessage, observableDOM: ObservableDOMInterface) => void,\n) => ObservableDOMInterface;\n\nexport class NetworkedDOM {\n // First to last in order of preference\n public static SupportedWebsocketSubProtocolsPreferenceOrder = [\n networkedDOMProtocolSubProtocol_v0_1,\n ];\n\n // Map from the node ids that the DOM uses internally to the node ids that clients refer to.\n private internalNodeIdToClientNodeId = new Map<number, number>();\n\n // Map from the node ids that clients refer to to the node ids that the DOM uses internally.\n private clientNodeIdToInternalNodeId = new Map<number, number>();\n\n private currentConnectionId = 1;\n private connectionIdToWebSocketContext = new Map<\n number,\n { webSocket: WebSocket; messageListener: (messageEvent: MessageEvent) => void }\n >();\n private webSocketToConnectionId = new Map<WebSocket, number>();\n private visibleNodeIdsByConnectionId = new Map<number, Set<number>>();\n private initialLoad = true;\n private readonly htmlPath: string;\n\n private disposed = false;\n private ignoreTextNodes: boolean;\n\n private documentRoot!: StaticVirtualDOMElement;\n private nodeIdToNode = new Map<number, StaticVirtualDOMElement>();\n private nodeIdToParentNodeId = new Map<number, number>();\n\n private observableDOM: ObservableDOMInterface;\n\n private documentEffectiveStartTime = Date.now();\n private latestDocumentTime = 0;\n private pingCounter = 1;\n private maximumNodeId = 0;\n\n private logCallback?: (message: LogMessage) => void;\n\n constructor(\n observableDOMFactory: ObservableDOMFactory,\n htmlPath: string,\n htmlContents: string,\n oldInstanceDocumentRoot: StaticVirtualDOMElement | null,\n onLoad: (domDiff: VirtualDOMDiffStruct | null, networkedDOM: NetworkedDOM) => void,\n params = {},\n ignoreTextNodes = true,\n logCallback?: (message: LogMessage) => void,\n ) {\n this.htmlPath = htmlPath;\n this.ignoreTextNodes = ignoreTextNodes;\n\n this.logCallback = logCallback || this.defaultLogCallback;\n\n this.observableDOM = observableDOMFactory(\n {\n htmlPath,\n htmlContents,\n params,\n ignoreTextNodes,\n pingIntervalMilliseconds: 5000,\n },\n (message: ObservableDOMMessage, observableDOM: ObservableDOMInterface) => {\n this.observableDOM = observableDOM;\n if (message.documentTime) {\n this.documentEffectiveStartTime = Date.now() - message.documentTime;\n this.latestDocumentTime = message.documentTime;\n }\n if (message.snapshot) {\n this.documentRoot = message.snapshot;\n const clonedSnapshot = JSON.parse(JSON.stringify(message.snapshot));\n\n if (!this.initialLoad) {\n throw new Error(\"Received snapshot after initial load\");\n }\n this.initialLoad = false;\n\n let domDiff: VirtualDOMDiffStruct | null = null;\n if (oldInstanceDocumentRoot) {\n domDiff = calculateStaticVirtualDOMDiff(oldInstanceDocumentRoot, clonedSnapshot);\n for (const remapping of domDiff.nodeIdRemappings) {\n this.addRemappedNodeId(remapping.clientFacingNodeId, remapping.internalNodeId);\n }\n }\n\n this.addAndRemapNodeFromInstance(this.documentRoot, -1);\n\n onLoad(domDiff, this);\n } else if (message.mutation) {\n if (this.initialLoad) {\n throw new Error(\"Received mutation before initial load\");\n }\n const mutation = this.addKnownNodesInMutation(message.mutation);\n this.processModification(mutation);\n this.removeKnownNodesInMutation(mutation);\n } else if (message.logMessage) {\n if (this.logCallback) {\n this.logCallback(message.logMessage);\n }\n } else {\n if (message.documentTime) {\n // This is just a regular ping message to update the document time - send the document time to all connected clients\n this.sendPings();\n return;\n }\n console.error(\"Unknown message type from observableDOM\", message);\n }\n },\n );\n }\n\n private defaultLogCallback(message: LogMessage) {\n const getLogFn = (level: string) => {\n switch (level) {\n case \"system\":\n return console.error;\n case \"error\":\n return console.error;\n case \"warn\":\n return console.warn;\n case \"log\":\n return console.log;\n case \"info\":\n return console.info;\n default:\n return console.log;\n }\n };\n\n const logFn = getLogFn(message.level);\n logFn(`${message.level.toUpperCase()} (${this.htmlPath}):`, ...message.content);\n }\n\n private addRemappedNodeId(clientFacingNodeId: number, internalNodeId: number) {\n this.internalNodeIdToClientNodeId.set(internalNodeId, clientFacingNodeId);\n this.clientNodeIdToInternalNodeId.set(clientFacingNodeId, internalNodeId);\n this.maximumNodeId = Math.max(this.maximumNodeId, Math.max(clientFacingNodeId, internalNodeId));\n }\n\n private sendPings() {\n const ping = this.pingCounter++;\n if (this.pingCounter > 1000) {\n this.pingCounter = 1;\n }\n const pingMessage: Array<ServerMessage> = [\n {\n type: \"ping\",\n ping,\n documentTime: this.getDocumentTime(),\n },\n ];\n const stringified = JSON.stringify(pingMessage);\n this.connectionIdToWebSocketContext.forEach((webSocketContext) => {\n webSocketContext.webSocket.send(stringified);\n });\n }\n\n private getInitialSnapshot(\n connectionId: number,\n documentVirtualDOMElement: StaticVirtualDOMElement,\n ): SnapshotMessage {\n const visibleNodesForConnection = this.visibleNodeIdsByConnectionId.get(connectionId);\n if (!visibleNodesForConnection) {\n const err = new Error(\n `visibleNodesForConnection not found for connectionId in getInitialSnapshot: ${connectionId}`,\n );\n console.error(err);\n throw err;\n }\n const domSnapshot: NodeDescription | null = describeNodeWithChildrenForConnectionId(\n documentVirtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!domSnapshot) {\n throw new Error(`domSnapshot was not generated`);\n }\n return {\n type: \"snapshot\",\n snapshot: domSnapshot,\n documentTime: Date.now() - this.documentEffectiveStartTime,\n };\n }\n\n public getDocumentTime(): number {\n return this.latestDocumentTime;\n }\n\n public addExistingWebsockets(\n websockets: Array<WebSocket>,\n existingWebsocketMap: Map<WebSocket, number> | null,\n domDiff: VirtualDOMDiffStruct | null,\n ) {\n const connectionIds = [];\n for (const websocket of websockets) {\n let existingId = null;\n if (existingWebsocketMap !== null) {\n existingId = existingWebsocketMap.get(websocket);\n }\n const { connectionId } = this.registerWebsocket(websocket, existingId);\n connectionIds.push(connectionId);\n }\n\n if (domDiff) {\n const diffsByConnectionId = new Map<number, Array<Diff>>(\n connectionIds.map((connectionId) => [connectionId, []]),\n );\n\n // Each of the websockets needs to have the original state of the document re-applied to it to determine visible\n // nodes, but not sent (they already have the old version of the document as their state).\n for (const connectionId of connectionIds) {\n // Ignore the return value - the side effect is that the visible nodes for the connection are set\n this.getInitialSnapshot(connectionId, domDiff.originalState);\n }\n\n for (const virtualDOMDiff of domDiff.virtualDOMDiffs) {\n // Convert the diff of the virtual dom data structure to a MutationRecord-like diff and then handle it as if it were a MutationRecord\n // The difficulty here is that the JSON diff is typed by add/remove/replace of elements of a hierarchy specified by paths, but MutationRecords are specified by type of operation and nodeIds\n\n const mutationRecordLikes = virtualDOMDiffToVirtualDOMMutationRecord(\n domDiff.originalState,\n virtualDOMDiff,\n );\n\n if (virtualDOMDiff.path === \"\" && virtualDOMDiff.op === \"replace\") {\n // The patch is a snapshot replacement - no need to check the patch validity\n } else {\n const patchResults = applyPatch(domDiff.originalState, [virtualDOMDiff]);\n for (const patchResult of patchResults) {\n if (patchResult !== null) {\n console.error(\"Patching virtual dom structure resulted in error\", patchResult);\n throw patchResult;\n }\n }\n }\n\n for (const mutationRecordLike of mutationRecordLikes) {\n const targetNodeId = mutationRecordLike.target.nodeId;\n const virtualElementParent = findParentNodeOfNodeId(domDiff.originalState, targetNodeId);\n diffsByConnectionId.forEach((diffs, connectionId) => {\n const mutationDiff = diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(\n mutationRecordLike,\n virtualElementParent,\n connectionId,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.visibleNodeIdsByConnectionId.get(connectionId)!,\n );\n if (mutationDiff) {\n diffs.push(mutationDiff);\n }\n });\n }\n }\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n if (diffs.length === 0) {\n // Need to add an \"empty\" message to allow passing the document time to the client\n diffs.push({\n type: \"childrenChanged\",\n nodeId: this.documentRoot.nodeId,\n previousNodeId: null,\n addedNodes: [],\n removedNodes: [],\n });\n }\n const asServerMessages: Array<ServerMessage> = diffs;\n const firstDiff = diffs[0];\n firstDiff.documentTime = this.getDocumentTime();\n const serializedDiffs = JSON.stringify(asServerMessages, null, 4);\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(`webSocketContext not found in addExistingWebsockets`);\n }\n webSocketContext.webSocket.send(serializedDiffs);\n });\n } else {\n const documentVirtualDOMElement = this.documentRoot;\n if (!documentVirtualDOMElement) {\n throw new Error(`documentVirtualDOMElement not found in getInitialSnapshot`);\n }\n for (const connectionId of connectionIds) {\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(`webSocketContext not found in addExistingWebsockets`);\n }\n const asServerMessages: Array<ServerMessage> = [\n this.getInitialSnapshot(connectionId, documentVirtualDOMElement),\n ];\n const serializedSnapshotMessage = JSON.stringify(asServerMessages);\n webSocketContext.webSocket.send(serializedSnapshotMessage);\n }\n }\n\n for (const connectionId of connectionIds) {\n this.observableDOM.addConnectedUserId(connectionId);\n }\n }\n\n private findParentNodeOfNodeId(targetNodeId: number): StaticVirtualDOMElement | null {\n const parentNodeId = this.nodeIdToParentNodeId.get(targetNodeId);\n if (parentNodeId === undefined) {\n throw new Error(\"Parent node ID not found\");\n }\n return this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(parentNodeId);\n }\n\n private registerWebsocket(\n webSocket: WebSocket,\n existingConnectionId: number | null = null,\n ): { connectionId: number } {\n let connectionId: number;\n if (existingConnectionId !== null) {\n connectionId = existingConnectionId;\n this.currentConnectionId = Math.max(this.currentConnectionId, connectionId + 1);\n } else {\n connectionId = this.currentConnectionId++;\n }\n const webSocketContext = {\n webSocket,\n messageListener: (messageEvent: MessageEvent) => {\n const string = String(messageEvent.data);\n let parsed;\n try {\n parsed = JSON.parse(string) as ClientMessage;\n } catch (e) {\n console.error(`Error parsing message from websocket: ${string}`);\n console.trace();\n return;\n }\n\n if (NetworkedDOM.IsPongMessage(parsed)) {\n // Ignore pongs for now\n return;\n }\n\n this.dispatchRemoteEvent(webSocket, parsed);\n },\n };\n this.connectionIdToWebSocketContext.set(connectionId, webSocketContext);\n this.visibleNodeIdsByConnectionId.set(connectionId, new Set());\n this.webSocketToConnectionId.set(webSocket, connectionId);\n webSocket.addEventListener(\"message\", webSocketContext.messageListener);\n return { connectionId };\n }\n\n public static handleWebsocketSubprotocol(protocols: Set<string> | Array<string>): string | false {\n const protocolsSet = new Set(protocols);\n // Find highest priority (first in the array) protocol that is supported\n for (const protocol of NetworkedDOM.SupportedWebsocketSubProtocolsPreferenceOrder) {\n if (protocolsSet.has(protocol)) {\n return protocol;\n }\n }\n return false;\n }\n\n public addWebSocket(webSocket: WebSocket): void {\n if (this.initialLoad) {\n throw new Error(\"addWebSocket called before initial load - unsupported at this time\");\n }\n if (this.disposed) {\n console.error(\"addWebSocket called on disposed NetworkedDOM\");\n throw new Error(\"This NetworkedDOM has been disposed\");\n }\n\n if (webSocket.protocol) {\n if (\n NetworkedDOM.SupportedWebsocketSubProtocolsPreferenceOrder.indexOf(webSocket.protocol) ===\n -1\n ) {\n const errorMessageString = `Unsupported websocket subprotocol: ${webSocket.protocol}`;\n const errorMessage: Array<ServerMessage> = [\n {\n type: \"error\",\n message: errorMessageString,\n },\n ];\n webSocket.send(JSON.stringify(errorMessage));\n webSocket.close();\n return;\n }\n } else {\n // TODO - Revisit the default handling of non-protocol websockets. It is easier to debug if a lack of protocol results in an error.\n // Assume for now that this client is a legacy MML client that doesn't send a protocol, but send a warning to the client to encourage specifying a protocol\n const warningMessageString = `No websocket subprotocol specified. Please specify a subprotocol to ensure compatibility with networked-dom servers. Assuming subprotocol \"${defaultWebsocketSubProtocol}\" for this connection.`;\n const warningMessage: Array<ServerMessage> = [\n {\n type: \"warning\",\n message: warningMessageString,\n },\n ];\n webSocket.send(JSON.stringify(warningMessage));\n }\n\n const { connectionId } = this.registerWebsocket(webSocket);\n const documentVirtualDOMElement = this.documentRoot;\n if (!documentVirtualDOMElement) {\n throw new Error(`documentVirtualDOMElement not found in getInitialSnapshot`);\n }\n const asServerMessages: Array<ServerMessage> = [\n this.getInitialSnapshot(connectionId, documentVirtualDOMElement),\n ];\n const serializedSnapshotMessage = JSON.stringify(asServerMessages);\n webSocket.send(serializedSnapshotMessage);\n this.observableDOM.addConnectedUserId(connectionId);\n }\n\n public removeWebSocket(webSocket: WebSocket): void {\n const connectionId = this.webSocketToConnectionId.get(webSocket);\n if (!connectionId) {\n return;\n }\n this.observableDOM.removeConnectedUserId(connectionId);\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(\"Missing context for websocket\");\n }\n webSocket.removeEventListener(\"message\", webSocketContext.messageListener);\n this.connectionIdToWebSocketContext.delete(connectionId);\n this.visibleNodeIdsByConnectionId.delete(connectionId);\n this.webSocketToConnectionId.delete(webSocket);\n }\n\n public dispose(): void {\n this.disposed = true;\n\n // Handle all of the remaining mutations that the disconnections could have caused\n this.observableDOM.dispose();\n\n for (const [webSocket, connectionId] of this.webSocketToConnectionId) {\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(\"Missing context for websocket\");\n }\n webSocket.removeEventListener(\"message\", webSocketContext.messageListener);\n this.connectionIdToWebSocketContext.delete(connectionId);\n this.visibleNodeIdsByConnectionId.delete(connectionId);\n this.webSocketToConnectionId.delete(webSocket);\n }\n }\n\n private processModification(mutationRecord: StaticVirtualDOMMutationRecord): void {\n const documentVirtualDOMElement = this.documentRoot;\n if (!documentVirtualDOMElement) {\n throw new Error(`document not created in processModification`);\n }\n\n for (const [, visibleNodesForConnection] of this.visibleNodeIdsByConnectionId) {\n visibleNodesForConnection.add(documentVirtualDOMElement.nodeId);\n }\n\n const diffsByConnectionId = new Map<number, Array<Diff>>(\n Array.from(this.connectionIdToWebSocketContext.keys()).map((connectionId) => [\n connectionId,\n [],\n ]),\n );\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n const parentNode = this.findParentNodeOfNodeId(mutationRecord.target.nodeId);\n if (mutationRecord.type === \"attributes\" && !parentNode) {\n console.error(\"parentNode not found for attribute mutationRecord\", mutationRecord);\n console.error(\"this.documentRoot\", JSON.stringify(this.documentRoot, null, 2));\n }\n const diff = diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(\n mutationRecord,\n parentNode,\n connectionId,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.visibleNodeIdsByConnectionId.get(connectionId)!,\n );\n if (diff) {\n diffs.push(diff);\n }\n });\n\n diffsByConnectionId.forEach((diffs, connectionId) => {\n if (diffs.length > 0) {\n const asServerMessages: Array<ServerMessage> = diffs;\n const serializedDiffs = JSON.stringify(asServerMessages, null, 4);\n const webSocketContext = this.connectionIdToWebSocketContext.get(connectionId);\n if (!webSocketContext) {\n throw new Error(`webSocketContext not found in processModificationList`);\n }\n webSocketContext.webSocket.send(serializedDiffs);\n }\n });\n }\n\n private removeKnownNodesInMutation(mutation: StaticVirtualDOMMutationRecord): void {\n const virtualDOMElement = mutation.target;\n if (mutation.type === \"childList\") {\n mutation.removedNodes.forEach((childDOMElement: StaticVirtualDOMElement) => {\n this.removeVirtualDOMElement(childDOMElement);\n const index = virtualDOMElement.childNodes.indexOf(childDOMElement);\n virtualDOMElement.childNodes.splice(index, 1);\n });\n return;\n }\n }\n\n private removeVirtualDOMElement(virtualDOMElement: StaticVirtualDOMElement): void {\n this.nodeIdToNode.delete(virtualDOMElement.nodeId);\n this.nodeIdToParentNodeId.delete(virtualDOMElement.nodeId);\n for (const child of virtualDOMElement.childNodes) {\n this.removeVirtualDOMElement(child);\n }\n }\n\n static IsPongMessage(message: ClientMessage): message is PongMessage {\n return (message as PongMessage).type === \"pong\";\n }\n\n private dispatchRemoteEvent(webSocket: WebSocket, remoteEvent: RemoteEvent): void {\n if (this.disposed) {\n console.error(\"Cannot dispatch remote event after dispose\");\n throw new Error(\"This NetworkedDOM has been disposed\");\n }\n\n const connectionId = this.webSocketToConnectionId.get(webSocket);\n if (!connectionId) {\n console.error(\"Unknown web socket dispatched event:\", webSocket);\n return;\n }\n\n const visibleNodes = this.visibleNodeIdsByConnectionId.get(connectionId);\n if (!visibleNodes) {\n console.error(\"No visible nodes for connection: \" + connectionId);\n return;\n }\n\n if (!visibleNodes.has(remoteEvent.nodeId)) {\n // TODO - do a pass through the hierarchy to determine if this node should be visible to this connection id to prevent clients submitting events for nodes they can't (currently) see\n console.error(\"Node not visible for connection: \" + remoteEvent.nodeId);\n return;\n }\n\n const remappedNode = this.clientNodeIdToInternalNodeId.get(remoteEvent.nodeId);\n if (remappedNode) {\n remoteEvent.nodeId = remappedNode;\n }\n\n this.observableDOM.dispatchRemoteEventFromConnectionId(connectionId, remoteEvent);\n }\n\n private getStaticVirtualDOMElementByInternalNodeIdOrThrow(\n internalNodeId: number,\n ): StaticVirtualDOMElement {\n const remappedId = this.internalNodeIdToClientNodeId.get(internalNodeId);\n if (remappedId !== undefined) {\n const node = this.nodeIdToNode.get(remappedId);\n if (!node) {\n throw new Error(\"Remapped node not found with nodeId \" + remappedId);\n }\n return node;\n }\n const node = this.nodeIdToNode.get(internalNodeId);\n if (!node) {\n throw new Error(\"Node not found with nodeId:\" + internalNodeId);\n }\n return node;\n }\n\n private addKnownNodesInMutation(\n mutation: StaticVirtualDOMMutationIdsRecord,\n ): StaticVirtualDOMMutationRecord {\n const target = this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(mutation.targetId);\n\n // TODO - avoid mutation in this conversion - use the attribute pair in the handling (would require changing StaticVirtualDOMMutationRecord.attributeName to be the key/value pair).\n if (mutation.attribute) {\n if (mutation.attribute.value !== null) {\n target.attributes[mutation.attribute.attributeName] = mutation.attribute.value;\n } else {\n delete target.attributes[mutation.attribute.attributeName];\n }\n }\n\n const previousSibling = mutation.previousSiblingId\n ? this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(mutation.previousSiblingId)\n : null;\n\n if (mutation.type === \"childList\") {\n let index = 0;\n if (previousSibling) {\n index = target.childNodes.indexOf(previousSibling);\n if (index === -1) {\n throw new Error(\"Previous sibling is not currently a child of the parent element\");\n }\n index += 1;\n }\n mutation.addedNodes.forEach((childVirtualDOMElement: StaticVirtualDOMElement) => {\n this.addAndRemapNodeFromInstance(childVirtualDOMElement, target.nodeId);\n\n if (target.childNodes.indexOf(childVirtualDOMElement) === -1) {\n target.childNodes.splice(index, 0, childVirtualDOMElement);\n index++;\n }\n });\n } else if (mutation.type === \"attributes\") {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const attributePair = mutation.attribute!;\n if (attributePair.value === null) {\n delete target.attributes[attributePair.attributeName];\n } else {\n target.attributes[attributePair.attributeName] = attributePair.value;\n }\n } else if (mutation.type === \"characterData\") {\n // TODO - reimplement characterData\n throw new Error(\"characterData not supported\");\n // virtualDOMElement.textContent = targetNode.textContent ? targetNode.textContent : undefined;\n }\n\n const record: StaticVirtualDOMMutationRecord = {\n type: mutation.type,\n target,\n addedNodes: mutation.addedNodes,\n removedNodes: mutation.removedNodeIds.map((nodeId) => {\n return this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(nodeId);\n }),\n previousSibling: mutation.previousSiblingId\n ? this.getStaticVirtualDOMElementByInternalNodeIdOrThrow(mutation.previousSiblingId)\n : null,\n attributeName: mutation.attribute ? mutation.attribute.attributeName : null,\n };\n\n return record;\n }\n\n getSnapshot(): StaticVirtualDOMElement {\n return this.documentRoot;\n }\n\n private addAndRemapNodeFromInstance(node: StaticVirtualDOMElement, parentNodeId: number) {\n const remappedNodeId = this.internalNodeIdToClientNodeId.get(node.nodeId);\n if (remappedNodeId !== undefined) {\n node.nodeId = remappedNodeId;\n } else {\n // This id might already refer to a node in this client's view. If so, we need to remap it to a new id.\n const existingClientReference = this.clientNodeIdToInternalNodeId.get(node.nodeId);\n if (existingClientReference) {\n const newNodeId = ++this.maximumNodeId;\n this.addRemappedNodeId(newNodeId, node.nodeId);\n node.nodeId = newNodeId;\n }\n }\n\n if (this.nodeIdToNode.has(node.nodeId)) {\n throw new Error(\"Node already exists with id \" + node.nodeId);\n }\n\n this.nodeIdToNode.set(node.nodeId, node);\n this.nodeIdToParentNodeId.set(node.nodeId, parentNodeId);\n this.maximumNodeId = Math.max(this.maximumNodeId, node.nodeId);\n\n for (const childNode of node.childNodes) {\n this.addAndRemapNodeFromInstance(childNode, node.nodeId);\n }\n }\n\n public getWebsocketConnectionIdMap() {\n // return a clone of the map\n return new Map(this.webSocketToConnectionId);\n }\n}\n", "import {\n AttributeChangedDiff,\n ChildrenChangedDiff,\n Diff,\n ElementNodeDescription,\n NodeDescription,\n SnapshotMessage,\n TextChangedDiff,\n TextNodeDescription,\n} from \"@mml-io/networked-dom-protocol\";\nimport { StaticVirtualDOMElement } from \"@mml-io/observable-dom-common\";\nimport * as rfc6902 from \"rfc6902\";\n\nimport { NodeMapping, StaticVirtualDOMMutationRecord, VirtualDOMDiffStruct } from \"./common\";\n\nexport const visibleToAttrName = \"visible-to\";\nexport const hiddenFromAttrName = \"hidden-from\";\n\n// This function does a lot of heavy lifting - it takes a mutation and applies it to the connection's view (affecting which nodes are visible based on attributes etc.)\n// As a result of that application it generates a diff for that client's view of the DOM.\nexport function diffFromApplicationOfStaticVirtualDOMMutationRecordToConnection(\n mutation: StaticVirtualDOMMutationRecord,\n parentNode: StaticVirtualDOMElement | null,\n connectionId: number,\n visibleNodesForConnection: Set<number>,\n): Diff | null {\n const virtualDOMElement = mutation.target;\n\n switch (mutation.type) {\n case \"snapshot\": {\n const nodeDescription = describeNodeWithChildrenForConnectionId(\n virtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!nodeDescription) {\n return null;\n }\n const diff: SnapshotMessage = {\n type: \"snapshot\",\n snapshot: nodeDescription,\n documentTime: 0,\n };\n return diff;\n }\n case \"attributes\": {\n const visible = visibleNodesForConnection.has(virtualDOMElement.nodeId);\n\n if (!parentNode) {\n throw new Error(\"Node has no parent\");\n }\n const parentNodeId = parentNode.nodeId;\n const shouldBeVisible =\n shouldShowNodeToConnectionId(virtualDOMElement, connectionId) &&\n visibleNodesForConnection.has(parentNodeId);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const attributeName = mutation.attributeName!;\n\n if (visible && shouldBeVisible) {\n let newValue = null; // null indicates deleted\n if (virtualDOMElement.attributes[attributeName] !== undefined) {\n newValue = virtualDOMElement.attributes[attributeName];\n }\n const diff: AttributeChangedDiff = {\n type: \"attributeChange\",\n nodeId: virtualDOMElement.nodeId,\n attribute: attributeName,\n newValue,\n };\n return diff;\n } else if (!visible && shouldBeVisible) {\n // Need to add this child to the connection's view now\n visibleNodesForConnection.add(virtualDOMElement.nodeId);\n\n const index = parentNode.childNodes.indexOf(virtualDOMElement);\n if (index === -1) {\n throw new Error(\"Node not found in parent's children\");\n }\n\n let previousNodeId = null;\n if (index > 0) {\n previousNodeId = getNodeIdOfPreviousVisibleSibling(\n parentNode,\n index - 1,\n visibleNodesForConnection,\n );\n }\n\n const nodeDescription = describeNodeWithChildrenForConnectionId(\n virtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!nodeDescription) {\n throw new Error(\"Node description not found\");\n }\n const diff: ChildrenChangedDiff = {\n type: \"childrenChanged\",\n nodeId: parentNodeId,\n previousNodeId,\n addedNodes: [nodeDescription],\n removedNodes: [],\n };\n return diff;\n } else if (visible && !shouldBeVisible) {\n removeNodeAndChildrenFromVisibleNodes(virtualDOMElement, visibleNodesForConnection);\n const diff: ChildrenChangedDiff = {\n type: \"childrenChanged\",\n nodeId: parentNodeId,\n previousNodeId: null,\n addedNodes: [],\n removedNodes: [virtualDOMElement.nodeId],\n };\n return diff;\n } else if (!visible && !shouldBeVisible) {\n return null;\n }\n break;\n }\n case \"characterData\": {\n const diff: TextChangedDiff = {\n type: \"textChanged\",\n nodeId: virtualDOMElement.nodeId,\n text: virtualDOMElement.textContent || \"\",\n };\n return diff;\n }\n case \"childList\": {\n let previousSibling = mutation.previousSibling;\n let previousNodeId: number | null = null;\n if (previousSibling) {\n let previousIndex = virtualDOMElement.childNodes.indexOf(previousSibling);\n while (previousIndex !== -1) {\n previousSibling = virtualDOMElement.childNodes[previousIndex];\n if (visibleNodesForConnection.has(previousSibling.nodeId)) {\n previousNodeId = previousSibling.nodeId;\n break;\n }\n previousIndex--;\n }\n }\n\n const diff: ChildrenChangedDiff = {\n type: \"childrenChanged\",\n nodeId: virtualDOMElement.nodeId,\n previousNodeId,\n addedNodes: [],\n removedNodes: [],\n };\n\n mutation.addedNodes.forEach((childVirtualDOMElement: StaticVirtualDOMElement) => {\n const describedNode = describeNodeWithChildrenForConnectionId(\n childVirtualDOMElement,\n connectionId,\n visibleNodesForConnection,\n );\n if (!describedNode) {\n return;\n }\n diff.addedNodes.push(describedNode);\n });\n mutation.removedNodes.forEach((childVirtualDOMElement: StaticVirtualDOMElement) => {\n if (visibleNodesForConnection.has(childVirtualDOMElement.nodeId)) {\n removeNodeAndChildrenFromVisibleNodes(childVirtualDOMElement, visibleNodesForConnection);\n diff.removedNodes.push(childVirtualDOMElement.nodeId);\n }\n });\n\n if (diff.addedNodes.length > 0 || diff.removedNodes.length > 0) {\n return diff;\n }\n return null;\n }\n default:\n console.error(\"Unknown mutation type: \" + mutation.type);\n break;\n }\n return null;\n}\n\nfunction getNodeIdOfPreviousVisibleSibling(\n parentVirtualElement: StaticVirtualDOMElement,\n candidateIndex: number,\n visibleNodesForConnection: Set<number>,\n): number | null {\n if (candidateIndex > 0) {\n let previousSiblingIndex = candidateIndex;\n while (previousSiblingIndex >= 0) {\n const previousSibling = parentVirtualElement.childNodes[previousSiblingIndex];\n if (visibleNodesForConnection.has(previousSibling.nodeId)) {\n return previousSibling.nodeId;\n }\n previousSiblingIndex--;\n }\n }\n return null;\n}\n\nfunction shouldShowNodeToConnectionId(\n virtualDOMElement: StaticVirtualDOMElement,\n connectionId: number,\n): boolean {\n const visibleToAttr = virtualDOMElement.attributes[visibleToAttrName];\n const hiddenFromAttr = virtualDOMElement.attributes[hiddenFromAttrName];\n const connectionIdString = connectionId.toString();\n if (visibleToAttr !== undefined) {\n const visibleToList = visibleToAttr.split(\" \");\n const explicityVisible = visibleToList.includes(connectionIdString);\n if (!explicityVisible) {\n return false;\n }\n }\n if (hiddenFromAttr !== undefined) {\n const hiddenFromList = hiddenFromAttr.split(\" \");\n const explicityHidden = hiddenFromList.includes(connectionIdString);\n if (explicityHidden) {\n return false;\n }\n }\n return true;\n}\n\nexport function describeNodeWithChildrenForConnectionId(\n virtualDOMElement: StaticVirtualDOMElement,\n connectionId: number,\n visibleNodesForConnection: Set<number>,\n): NodeDescription | null {\n if (!shouldShowNodeToConnectionId(virtualDOMElement, connectionId)) {\n return null;\n }\n\n let emittedTagName = virtualDOMElement.tag;\n if (emittedTagName === \"#document\") {\n emittedTagName = \"DIV\";\n }\n if (emittedTagName === \"#text\") {\n const textNode: TextNodeDescription = {\n type: \"text\",\n nodeId: virtualDOMElement.nodeId,\n text: virtualDOMElement.textContent || \"\",\n };\n visibleNodesForConnection.add(textNode.nodeId);\n return textNode;\n } else {\n const node: ElementNodeDescription = {\n type: \"element\",\n nodeId: virtualDOMElement.nodeId,\n tag: emittedTagName,\n attributes: virtualDOMElement.attributes,\n children: [],\n text: virtualDOMElement.textContent,\n };\n visibleNodesForConnection.add(node.nodeId);\n\n for (const child of virtualDOMElement.childNodes) {\n const childNodeDescription = describeNodeWithChildrenForConnectionId(\n child,\n connectionId,\n visibleNodesForConnection,\n );\n if (childNodeDescription) {\n node.children.push(childNodeDescription);\n }\n }\n return node;\n }\n}\n\nfunction removeNodeAndChildrenFromVisibleNodes(\n virtualDOMElement: StaticVirtualDOMElement,\n visibleNodesForConnection: Set<number>,\n): void {\n visibleNodesForConnection.delete(virtualDOMElement.nodeId);\n for (const child of virtualDOMElement.childNodes) {\n if (!visibleNodesForConnection.has(child.nodeId)) {\n console.error(\"Inner child of removed element was not visible\", child.nodeId);\n }\n removeNodeAndChildrenFromVisibleNodes(child, visibleNodesForConnection);\n }\n}\n\nexport function findParentNodeOfNodeId(\n virtualDOMElement: StaticVirtualDOMElement,\n targetNodeId: number,\n): StaticVirtualDOMElement | null {\n // TODO - avoid a search of the whole tree for the node's parent\n // depth-first search of the whole virtual dom structure to find the node's parent\n for (const child of virtualDOMElement.childNodes) {\n if (child.nodeId === targetNodeId) {\n return virtualDOMElement;\n } else {\n const foundParentId = findParentNodeOfNodeId(child, targetNodeId);\n if (foundParentId) {\n return foundParentId;\n }\n }\n }\n return null;\n}\n\nexport function virtualDOMDiffToVirtualDOMMutationRecord(\n virtualStructure: StaticVirtualDOMElement,\n domDiff: rfc6902.Operation,\n): Array<StaticVirtualDOMMutationRecord> {\n const pointer = rfc6902.Pointer.fromJSON(domDiff.path);\n const grandParentTokens = pointer.tokens.slice(0, pointer.tokens.length - 2);\n const lastToken = pointer.tokens[pointer.tokens.length - 1];\n const secondLastToken = pointer.tokens[pointer.tokens.length - 2];\n\n if (lastToken === \"textContent\") {\n const nodePointer = new rfc6902.Pointer(pointer.tokens.slice(0, pointer.tokens.length - 1));\n const node = nodePointer.get(virtualStructure) as StaticVirtualDOMElement;\n return [\n {\n type: \"characterData\",\n target: node,\n addedNodes: [],\n removedNodes: [],\n attributeName: null,\n previousSibling: null,\n },\n ];\n }\n\n if (secondLastToken === \"attributes\") {\n // This handles attribute additions, changes, and removals\n const nodePointer = new rfc6902.Pointer(grandParentTokens);\n const node = nodePointer.get(virtualStructure) as StaticVirtualDOMElement;\n return [\n {\n type: \"attributes\",\n target: node,\n addedNodes: [],\n removedNodes: [],\n attributeName: lastToken,\n previousSibling: null,\n },\n ];\n }\n\n // Child changes\n\n if (secondLastToken === \"childNodes\") {\n const nodePointer = new rfc6902.Pointer(grandParentTokens);\n const node = nodePointer.get(virtualStructure) as StaticVirtualDOMElement;\n\n let previousSibling: StaticVirtualDOMElement | null = null;\n if (lastToken === \"-\") {\n // Append to the end of the children\n } else {\n const index = parseInt(lastToken, 10);\n if (index === 0) {\n previousSibling = null;\n } else {\n previousSibling = node.childNodes[index - 1];\n }\n }\n const addedNodes: Array<StaticVirtualDOMElement> = [];\n const removedNodes: Array<StaticVirtualDOMElement> = [];\n switch (domDiff.op) {\n case \"add\": {\n addedNodes.push(domDiff.value);\n return [\n {\n type: \"childList\",\n target: node,\n addedNodes,\n removedNodes,\n previousSibling,\n attributeName: null,\n },\n ];\n }\n case \"remove\": {\n const removedNode = pointer.get(virtualStructure) as StaticVirtualDOMElement;\n removedNodes.push(removedNode);\n return [\n {\n type: \"childList\",\n target: node,\n addedNodes,\n removedNodes,\n previousSibling,\n attributeName: null,\n },\n ];\n }\n case \"replace\": {\n // This is a replacement of a single node\n const removedNode = pointer.get(virtualStructure) as StaticVirtualDOMElement;\n removedNodes.push(removedNode);\n addedNodes.push(domDiff.value);\n return [\n {\n type: \"childList\",\n target: node,\n addedNodes: [],\n removedNodes,\n previousSibling,\n attributeName: null,\n },\n {\n type: \"childList\",\n target: node,\n addedNodes,\n removedNodes: [],\n previousSibling,\n attributeName: null,\n },\n ];\n }\n }\n }\n\n if (domDiff.op === \"replace\" && domDiff.path === \"\") {\n const node = domDiff.value as StaticVirtualDOMElement;\n return [\n {\n type: \"snapshot\",\n target: node,\n addedNodes: [],\n removedNodes: [],\n previousSibling: null,\n attributeName: null,\n },\n ];\n }\n\n console.error(\"Unhandled JSON diff:\", JSON.stringify(domDiff, null, 2));\n throw new Error(\"Unhandled diff type\");\n}\n\nexport function calculateStaticVirtualDOMDiff(\n originalState: StaticVirtualDOMElement,\n latestState: StaticVirtualDOMElement,\n): VirtualDOMDiffStruct {\n const jsonPatchDiffs = rfc6902.createPatch(\n originalState,\n latestState,\n (a, b, ptr: rfc6902.Pointer) => {\n if (a.tag !== b.tag) {\n return [{ op: \"replace\", path: ptr.toString(), value: b }];\n }\n return;\n },\n );\n\n const nodeIdRemappings: Array<NodeMapping> = [];\n const virtualDOMDiffs: Array<rfc6902.Operation> = [];\n for (const diff of jsonPatchDiffs) {\n if (diff.op === \"replace\" && diff.path.endsWith(\"/nodeId\")) {\n const pointer = rfc6902.Pointer.fromJSON(diff.path);\n const value = pointer.get(originalState);\n nodeIdRemappings.push({\n internalNodeId: diff.value,\n clientFacingNodeId: value,\n });\n } else {\n virtualDOMDiffs.push(diff);\n }\n }\n\n return remapDuplicatedNodeIdsInOperations(\n {\n originalState,\n nodeIdRemappings,\n virtualDOMDiffs,\n },\n latestState,\n );\n}\n\nfunction getHighestNodeId(node: StaticVirtualDOMElement) {\n let highest = node.nodeId;\n for (const child of node.childNodes) {\n highest = Math.max(highest, getHighestNodeId(child));\n }\n return highest;\n}\n\nfunction getRemovedNodeIds(before: StaticVirtualDOMElement, diff: rfc6902.Operation) {\n const removedIds = new Set<number>();\n function addNode(node: StaticVirtualDOMElement) {\n removedIds.add(node.nodeId);\n for (const child of node.childNodes) {\n addNode(child);\n }\n }\n if (diff.op === \"replace\" || diff.op === \"remove\") {\n const removedNode = rfc6902.Pointer.fromJSON(diff.path).get(before);\n addNode(removedNode);\n }\n return removedIds;\n}\n\nfunction getNodeIdsFromNodeAndChildren(node: StaticVirtualDOMElement) {\n const nodeIds = new Set<number>();\n function addNode(node: StaticVirtualDOMElement) {\n nodeIds.add(node.nodeId);\n for (const child of node.childNodes) {\n addNode(child);\n }\n }\n addNode(node);\n return nodeIds;\n}\n\n// To avoid duplicate node ids at any point in the sequence of operations, apply the operations and determine if any node ids are duplicated at any point. If so, remap the node ids to be unique.\nfunction remapDuplicatedNodeIdsInOperations(\n virtualDOMDiffStruct: VirtualDOMDiffStruct,\n latestState: StaticVirtualDOMElement,\n): VirtualDOMDiffStruct {\n const { originalState, nodeIdRemappings, virtualDOMDiffs } = virtualDOMDiffStruct;\n\n const highestNodeIdAcrossStartAndEnd = Math.max(\n getHighestNodeId(originalState),\n getHighestNodeId(latestState),\n );\n let nextNodeId = highestNodeIdAcrossStartAndEnd + 1;\n\n const before = JSON.parse(JSON.stringify(originalState));\n\n function checkAndReplaceNodeIdsIfAlreadyInUse(\n node: StaticVirtualDOMElement,\n addingNodeIds: Set<number>,\n removedIds: Set<number>,\n ) {\n if (existingNodeIds.has(node.nodeId) && removedIds && !removedIds.has(node.nodeId)) {\n // This node id is already present so it must be replaced\n const newNodeId = nextNodeId++;\n nodeIdRemappings.push({\n internalNodeId: node.nodeId,\n clientFacingNodeId: newNodeId,\n });\n node.nodeId = newNodeId;\n addingNodeIds.add(newNodeId);\n } else {\n addingNodeIds.add(node.nodeId);\n }\n for (const child of node.childNodes) {\n checkAndReplaceNodeIdsIfAlreadyInUse(child, addingNodeIds, removedIds);\n }\n }\n\n const existingNodeIds = getNodeIdsFromNodeAndChildren(before);\n\n for (const diff of virtualDOMDiffs) {\n const pointer = rfc6902.Pointer.fromJSON(diff.path);\n const secondLastToken = pointer.tokens[pointer.tokens.length - 2];\n if (secondLastToken !== \"childNodes\") {\n continue;\n }\n const removedIds = getRemovedNodeIds(before, diff);\n const addingNodeIds = new Set<number>();\n if (diff.op === \"replace\" || diff.op === \"add\") {\n // The added node can use removed node ids, but it must not use any node ids that are still in use.\n checkAndReplaceNodeIdsIfAlreadyInUse(diff.value, addingNodeIds, removedIds);\n }\n removedIds.forEach((removedId) => {\n existingNodeIds.delete(removedId);\n });\n addingNodeIds.forEach((addingNodeId) => {\n existingNodeIds.add(addingNodeId);\n });\n\n const patchErrors = rfc6902.applyPatch(before, [diff]);\n if (patchErrors.length !== 1 || patchErrors[0] !== null) {\n throw new Error(\"Patch failed\");\n }\n }\n\n return virtualDOMDiffStruct;\n}\n", "import { LogMessage, StaticVirtualDOMElement } from \"@mml-io/observable-dom-common\";\n\nimport { VirtualDOMDiffStruct } from \"./common\";\nimport { NetworkedDOM, ObservableDOMFactory } from \"./NetworkedDOM\";\n\ntype LoadedState = {\n htmlContents: string;\n networkedDOM: NetworkedDOM;\n loaded: boolean;\n};\n\n// EditableNetworkedDOM wraps NetworkedDOM instances and presents them as a single document that can iterate through\n// revisions by being loaded multiple times with different contents. The connected clients receive deltas between the\n// revisions rather than a complete refresh.\nexport class EditableNetworkedDOM {\n private htmlPath: string;\n private params: object = {};\n\n private websockets = new Set<WebSocket>();\n private loadedState: LoadedState | null = null;\n\n private observableDOMFactory: ObservableDOMFactory;\n private ignoreTextNodes: boolean;\n\n private logCallback?: (message: LogMessage) => void;\n\n constructor(\n htmlPath: string,\n observableDOMFactory: ObservableDOMFactory,\n ignoreTextNodes = true,\n logCallback?: (message: LogMessage) => void,\n ) {\n this.htmlPath = htmlPath;\n this.observableDOMFactory = observableDOMFactory;\n this.ignoreTextNodes = ignoreTextNodes;\n this.logCallback = logCallback;\n }\n\n public isLoaded() {\n return this.loadedState !== null;\n }\n\n public load(htmlContents: string, params?: object) {\n if (params !== undefined) {\n this.params = params;\n }\n\n let oldInstanceRoot: StaticVirtualDOMElement | null = null;\n let existingWebsocketMap: Map<WebSocket, number> | null = null;\n if (this.loadedState) {\n const oldInstance = this.loadedState.networkedDOM;\n existingWebsocketMap = oldInstance.getWebsocketConnectionIdMap();\n oldInstance.dispose();\n oldInstanceRoot = oldInstance.getSnapshot();\n }\n this.loadedState = null;\n\n let didLoad = false;\n const networkedDOM = new NetworkedDOM(\n this.observableDOMFactory,\n this.htmlPath,\n htmlContents,\n oldInstanceRoot,\n (domDiff: VirtualDOMDiffStruct | null, networkedDOM: NetworkedDOM) => {\n didLoad = true;\n if (this.loadedState) {\n this.loadedState.loaded = true;\n }\n networkedDOM.addExistingWebsockets(\n Array.from(this.websockets),\n existingWebsocketMap,\n domDiff,\n );\n },\n this.params,\n this.ignoreTextNodes,\n this.logCallback,\n );\n this.loadedState = {\n htmlContents,\n networkedDOM,\n loaded: didLoad,\n };\n }\n\n public reload() {\n if (this.loadedState) {\n this.load(this.loadedState.htmlContents, this.params);\n } else {\n console.warn(\"EditableNetworkedDOM.reload called whilst not loaded\");\n }\n }\n\n public dispose() {\n for (const ws of this.websockets) {\n ws.close();\n }\n this.websockets.clear();\n if (this.loadedState) {\n this.loadedState.networkedDOM.dispose();\n }\n this.loadedState = null;\n }\n\n public addWebSocket(webSocket: WebSocket) {\n this.websockets.add(webSocket);\n if (this.loadedState && this.loadedState.loaded) {\n this.loadedState.networkedDOM.addWebSocket(webSocket);\n }\n }\n\n public removeWebSocket(webSocket: WebSocket) {\n this.websockets.delete(webSocket);\n if (this.loadedState && this.loadedState.loaded) {\n this.loadedState.networkedDOM.removeWebSocket(webSocket);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,qBAA2B;;;ACN3B,cAAyB;AAIlB,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB;AAI3B,SAAS,gEACd,UACA,YACA,cACA,2BACa;AACb,QAAM,oBAAoB,SAAS;AAEnC,UAAQ,SAAS,MAAM;AAAA,IACrB,KAAK,YAAY;AACf,YAAM,kBAAkB;AAAA,QACtB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,UAAI,CAAC,iBAAiB;AACpB,eAAO;AAAA,MACT;AACA,YAAM,OAAwB;AAAA,QAC5B,MAAM;AAAA,QACN,UAAU;AAAA,QACV,cAAc;AAAA,MAChB;AACA,aAAO;AAAA,IACT;AAA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O;AACL,cAAQ,KAAK,sDAAsD;AAAA,IACrE;AAAA,EACF;AAAA,EAEO,UAAU;AACf,eAAW,MAAM,KAAK,YAAY;AAChC,SAAG,MAAM;AAAA,IACX;AACA,SAAK,WAAW,MAAM;AACtB,QAAI,KAAK,aAAa;AACpB,WAAK,YAAY,aAAa,QAAQ;AAAA,IACxC;AACA,SAAK,cAAc;AAAA,EACrB;AAAA,EAEO,aAAa,WAAsB;AACxC,SAAK,WAAW,IAAI,SAAS;AAC7B,QAAI,KAAK,eAAe,KAAK,YAAY,QAAQ;AAC/C,WAAK,YAAY,aAAa,aAAa,SAAS;AAAA,IACtD;AAAA,EACF;AAAA,EAEO,gBAAgB,WAAsB;AAC3C,SAAK,WAAW,OAAO,SAAS;AAChC,QAAI,KAAK,eAAe,KAAK,YAAY,QAAQ;AAC/C,WAAK,YAAY,aAAa,gBAAgB,SAAS;AAAA,IACzD;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["node", "node", "networkedDOM"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../networked-dom-protocol/build/networked-dom-v0.1/from-client.d.ts","../../networked-dom-protocol/build/networked-dom-v0.1/from-server.d.ts","../../networked-dom-protocol/build/networked-dom-v0.1/index.d.ts","../../networked-dom-protocol/build/index.d.ts","../../observable-dom-common/build/observabledominterface.d.ts","../../observable-dom-common/build/messages.d.ts","../../observable-dom-common/build/index.d.ts","../../../node_modules/rfc6902/src/pointer.ts","../../../node_modules/rfc6902/src/util.ts","../../../node_modules/@types/deep-equal/index.d.ts","../../../node_modules/rfc6902/src/diff.ts","../../../node_modules/rfc6902/src/patch.ts","../../../node_modules/rfc6902/src/index.ts","../../../node_modules/rfc6902/build/index.d.ts","../src/common.ts","../src/diffing.ts","../src/networkeddom.ts","../src/editablenetworkeddom.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"328c09d87a15cde5936230f085c6888e6dc5f31a7c600a8a222419e28ea02812","0e902771dd21ea683172d5b5dd5fb192a166a9e3071b674695ac9013edb4b4fc","660b97032e7c3a5a094b60e3de0bf602626931fe0167dbad07e9ada9f683161e","28e083d1a14be292588f05b70cf7852deb63a3e0da35a0156bcbe361b5072562","4e9e7984ad6e180c5c3363d3478d71558d7d3949c45685951aef7e06e4d6b6a4","ffe0e53edfbab16e0c9bacf0d61b8091d2cf46fbca310d2602036793fda5a058","a63268b15ba72e389b1eaf9752ca501a2965923096ea28c2c98a4db1ec0e8a22","470bca533c6d21326973461b547470d7499ea91ca8a34c2e940ed87a81197126","de355ee45c24981723e98415c331656000b5045895e34bee0423f60eb71a7ef7","2e345cb6511f4c4c60c274df6626c94f3182939034f06cdf414bfbccc584f822","36d82d79e5c2cff1f55302638e4986abbc110fad92910c5e765d73fdc1af2ce9","267fa352bafe9b69cbc35cf110e595c7aec48b80b7bafeb53eb4a07859c509e8","259b99a5b98db5d0bdb1c9743d00283ca45b4d5c06e6ae1ce3b98634237009f6","88c62c04db59e39dd5b82ddd9cb8d0b287255e8d9604b36a4139cabd0536fb9b","e8e52e6b37129b57e7f3859acae5bd9ab0263d201e87b902385583dd6435bb61","3f95729712e84aa7410b4eac36c89907b31e043f40ec33f2561fdcb0e0db4f27","535cdda01dfba007436fa0ef506aba10b48726a37e8e2e65e0dfc289bda2e774","ad644a4792116c657e122f7017191a9e822df9c35a4f50dc711a176d83020ae1","894eeb8ce9aaa37362d97f8a0f7dbc0feb4585ccdcc99d882a80c5e8a0c8062c","587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"a7534271773a27ff7d136d550e86b41894d8090fa857ba4c02b5bb18d2eb1c8e","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","b8e431e9b9bb2dc832b23d4e3e02774e953d5537998923f215ea446169e9a61e","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"b85c02e14ecb2a873dad5a1de72319b265160ba48f1b83661aeb3bba1366c1bc","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","fc3764040518a1008dd04bdc80964591b566b896283e00df85c95851c1f46237","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","790623a47c5eda62910098884ecb154dc0e5f3a23fc36c1bfb3b5b9ed44e2c2d","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"f5490f53d40291cc8607f5463434d1ac6c5564bc4fbb03abceb03a8f6b014457","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","0cab4d7d4edc40cd3af9eea7c3ed6d1016910c0954c49c4297e479bf3822a625","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270","1fb6c5ec52332a8b531a8d7a5300ac9301f98c4fe62f68e744e0841ccba65e7e",{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","bbda6ea452a2386093a1eda18a6e26a989e98869f1b9f37e46f510a986d2e740","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"75dd741ca6a6c8d2437a6ca8349b64b816421dbf9fe82dd026afaba965576962","affectsGlobalScope":true},{"version":"8799401a7ab57764f0d464513a7fa7c72e1d70a226b172ec60fff534ea94d108","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"247aa3419c98713231952b33801d4f46563fe542e03604acd8c63ac45a32409c"],"root":[[59,63]],"options":{"allowSyntheticDefaultImports":true,"downlevelIteration":true,"jsx":2,"module":99,"noImplicitAny":true,"outDir":"./","sourceMap":true,"strictNullChecks":true,"target":2},"fileIdsList":[[110],[64,110],[67,110],[68,73,101,110],[69,80,81,88,98,109,110],[69,70,80,88,110],[71,110],[72,73,81,89,110],[73,98,106,110],[74,76,80,88,110],[75,110],[76,77,110],[80,110],[78,80,110],[80,81,82,98,109,110],[80,81,82,95,98,101,110],[110,114],[76,80,83,88,98,109,110],[80,81,83,84,88,98,106,109,110],[83,85,98,106,109,110],[64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],[80,86,110],[87,109,110],[76,80,88,98,110],[89,110],[90,110],[67,91,110],[92,108,110,114],[93,110],[94,110],[80,95,96,110],[95,97,110,112],[68,80,98,99,100,101,110],[68,98,100,110],[98,99,110],[101,110],[102,110],[98,110],[80,104,105,110],[104,105,110],[73,88,98,106,110],[107,110],[88,108,110],[68,83,94,109,110],[73,110],[98,110,111],[110,112],[110,113],[68,73,80,82,91,98,109,110,112,114],[98,110,115],[57,110],[52,53,54,110],[52,55,56,110],[52,53,55,110],[51,58,110],[48,51,58,59,110],[51,59,61,110],[61,62,110],[48,51,58,59,60,110],[47,110],[45,46,110],[48,49,50,110],[48,49,110],[48,110]],"referencedMap":[[54,1],[64,2],[65,2],[67,3],[68,4],[69,5],[70,6],[71,7],[72,8],[73,9],[74,10],[75,11],[76,12],[77,12],[79,13],[78,14],[80,13],[81,15],[82,16],[66,17],[116,1],[83,18],[84,19],[85,20],[117,21],[86,22],[87,23],[88,24],[89,25],[90,26],[91,27],[92,28],[93,29],[94,30],[95,31],[96,31],[97,32],[98,33],[100,34],[99,35],[101,36],[102,37],[103,38],[104,39],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[58,51],[55,52],[57,53],[56,54],[52,1],[53,1],[43,1],[44,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[59,55],[60,56],[62,57],[63,58],[61,59],[48,60],[45,1],[46,1],[47,61],[51,62],[50,63],[49,64]],"exportedModulesMap":[[54,1],[64,2],[65,2],[67,3],[68,4],[69,5],[70,6],[71,7],[72,8],[73,9],[74,10],[75,11],[76,12],[77,12],[79,13],[78,14],[80,13],[81,15],[82,16],[66,17],[116,1],[83,18],[84,19],[85,20],[117,21],[86,22],[87,23],[88,24],[89,25],[90,26],[91,27],[92,28],[93,29],[94,30],[95,31],[96,31],[97,32],[98,33],[100,34],[99,35],[101,36],[102,37],[103,38],[104,39],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[58,51],[55,52],[57,53],[56,54],[52,1],[53,1],[43,1],[44,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[59,55],[60,56],[62,57],[63,58],[61,59],[48,60],[45,1],[46,1],[47,61],[51,62],[50,63],[49,64]],"semanticDiagnosticsPerFile":[54,64,65,67,68,69,70,71,72,73,74,75,76,77,79,78,80,81,82,66,116,83,84,85,117,86,87,88,89,90,91,92,93,94,95,96,97,98,100,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,58,55,57,56,52,53,43,44,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,59,60,62,63,61,48,45,46,47,51,50,49],"affectedFilesPendingEmit":[59,60,62,63,61]},"version":"5.0.4"}
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../networked-dom-protocol/build/networked-dom-v0.1/from-client.d.ts","../../networked-dom-protocol/build/networked-dom-v0.1/from-server.d.ts","../../networked-dom-protocol/build/networked-dom-v0.1/index.d.ts","../../networked-dom-protocol/build/index.d.ts","../../observable-dom-common/build/ObservableDOMInterface.d.ts","../../observable-dom-common/build/messages.d.ts","../../observable-dom-common/build/index.d.ts","../../../node_modules/rfc6902/src/pointer.ts","../../../node_modules/rfc6902/src/util.ts","../../../node_modules/@types/deep-equal/index.d.ts","../../../node_modules/rfc6902/src/diff.ts","../../../node_modules/rfc6902/src/patch.ts","../../../node_modules/rfc6902/src/index.ts","../../../node_modules/rfc6902/build/index.d.ts","../src/common.ts","../src/diffing.ts","../src/NetworkedDOM.ts","../src/EditableNetworkedDOM.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"328c09d87a15cde5936230f085c6888e6dc5f31a7c600a8a222419e28ea02812","e46f9c26b401a050e372280c49fd564d27dca4ca2b0e3e8585b07578661b2279","660b97032e7c3a5a094b60e3de0bf602626931fe0167dbad07e9ada9f683161e","28e083d1a14be292588f05b70cf7852deb63a3e0da35a0156bcbe361b5072562","4e9e7984ad6e180c5c3363d3478d71558d7d3949c45685951aef7e06e4d6b6a4","ffe0e53edfbab16e0c9bacf0d61b8091d2cf46fbca310d2602036793fda5a058","a63268b15ba72e389b1eaf9752ca501a2965923096ea28c2c98a4db1ec0e8a22","470bca533c6d21326973461b547470d7499ea91ca8a34c2e940ed87a81197126","de355ee45c24981723e98415c331656000b5045895e34bee0423f60eb71a7ef7","2e345cb6511f4c4c60c274df6626c94f3182939034f06cdf414bfbccc584f822","36d82d79e5c2cff1f55302638e4986abbc110fad92910c5e765d73fdc1af2ce9","267fa352bafe9b69cbc35cf110e595c7aec48b80b7bafeb53eb4a07859c509e8","259b99a5b98db5d0bdb1c9743d00283ca45b4d5c06e6ae1ce3b98634237009f6","88c62c04db59e39dd5b82ddd9cb8d0b287255e8d9604b36a4139cabd0536fb9b","420d0b4eb59f272658fa93a3aa57cda51d0f4cea68bd0ab4f0c1134aab2c38d8","a73895b17769d005f2871b92d0a348811879d84077f3efc368149a4d06ec2145","6a0940f95baeb932cb15cac7167e0fe6a564eaeee55d65216dbdd645bf8d6ba0","ad644a4792116c657e122f7017191a9e822df9c35a4f50dc711a176d83020ae1","894eeb8ce9aaa37362d97f8a0f7dbc0feb4585ccdcc99d882a80c5e8a0c8062c","587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"a7534271773a27ff7d136d550e86b41894d8090fa857ba4c02b5bb18d2eb1c8e","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","b8e431e9b9bb2dc832b23d4e3e02774e953d5537998923f215ea446169e9a61e","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"b85c02e14ecb2a873dad5a1de72319b265160ba48f1b83661aeb3bba1366c1bc","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","fc3764040518a1008dd04bdc80964591b566b896283e00df85c95851c1f46237","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","790623a47c5eda62910098884ecb154dc0e5f3a23fc36c1bfb3b5b9ed44e2c2d","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"f5490f53d40291cc8607f5463434d1ac6c5564bc4fbb03abceb03a8f6b014457","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","0cab4d7d4edc40cd3af9eea7c3ed6d1016910c0954c49c4297e479bf3822a625","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270","1fb6c5ec52332a8b531a8d7a5300ac9301f98c4fe62f68e744e0841ccba65e7e",{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","bbda6ea452a2386093a1eda18a6e26a989e98869f1b9f37e46f510a986d2e740","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"75dd741ca6a6c8d2437a6ca8349b64b816421dbf9fe82dd026afaba965576962","affectsGlobalScope":true},{"version":"8799401a7ab57764f0d464513a7fa7c72e1d70a226b172ec60fff534ea94d108","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"247aa3419c98713231952b33801d4f46563fe542e03604acd8c63ac45a32409c"],"root":[[59,63]],"options":{"allowSyntheticDefaultImports":true,"downlevelIteration":true,"jsx":2,"module":99,"noImplicitAny":true,"outDir":"./","sourceMap":true,"strictNullChecks":true,"target":2},"fileIdsList":[[110],[64,110],[67,110],[68,73,101,110],[69,80,81,88,98,109,110],[69,70,80,88,110],[71,110],[72,73,81,89,110],[73,98,106,110],[74,76,80,88,110],[75,110],[76,77,110],[80,110],[78,80,110],[80,81,82,98,109,110],[80,81,82,95,98,101,110],[110,114],[76,80,83,88,98,109,110],[80,81,83,84,88,98,106,109,110],[83,85,98,106,109,110],[64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],[80,86,110],[87,109,110],[76,80,88,98,110],[89,110],[90,110],[67,91,110],[92,108,110,114],[93,110],[94,110],[80,95,96,110],[95,97,110,112],[68,80,98,99,100,101,110],[68,98,100,110],[98,99,110],[101,110],[102,110],[98,110],[80,104,105,110],[104,105,110],[73,88,98,106,110],[107,110],[88,108,110],[68,83,94,109,110],[73,110],[98,110,111],[110,112],[110,113],[68,73,80,82,91,98,109,110,112,114],[98,110,115],[57,110],[52,53,54,110],[52,55,56,110],[52,53,55,110],[51,59,61,110],[48,51,58,59,60,110],[51,58,110],[48,51,58,59,110],[61,62,110],[47,110],[45,46,110],[48,110],[48,49,50,110],[48,49,110]],"referencedMap":[[54,1],[64,2],[65,2],[67,3],[68,4],[69,5],[70,6],[71,7],[72,8],[73,9],[74,10],[75,11],[76,12],[77,12],[79,13],[78,14],[80,13],[81,15],[82,16],[66,17],[116,1],[83,18],[84,19],[85,20],[117,21],[86,22],[87,23],[88,24],[89,25],[90,26],[91,27],[92,28],[93,29],[94,30],[95,31],[96,31],[97,32],[98,33],[100,34],[99,35],[101,36],[102,37],[103,38],[104,39],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[58,51],[55,52],[57,53],[56,54],[52,1],[53,1],[43,1],[44,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[62,55],[61,56],[59,57],[60,58],[63,59],[48,60],[45,1],[46,1],[47,61],[49,62],[51,63],[50,64]],"exportedModulesMap":[[54,1],[64,2],[65,2],[67,3],[68,4],[69,5],[70,6],[71,7],[72,8],[73,9],[74,10],[75,11],[76,12],[77,12],[79,13],[78,14],[80,13],[81,15],[82,16],[66,17],[116,1],[83,18],[84,19],[85,20],[117,21],[86,22],[87,23],[88,24],[89,25],[90,26],[91,27],[92,28],[93,29],[94,30],[95,31],[96,31],[97,32],[98,33],[100,34],[99,35],[101,36],[102,37],[103,38],[104,39],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[58,51],[55,52],[57,53],[56,54],[52,1],[53,1],[43,1],[44,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[62,55],[61,56],[59,57],[60,58],[63,59],[48,60],[45,1],[46,1],[47,61],[49,62],[51,63],[50,64]],"semanticDiagnosticsPerFile":[54,64,65,67,68,69,70,71,72,73,74,75,76,77,79,78,80,81,82,66,116,83,84,85,117,86,87,88,89,90,91,92,93,94,95,96,97,98,100,99,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,58,55,57,56,52,53,43,44,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,62,61,59,60,63,48,45,46,47,49,51,50],"affectedFilesPendingEmit":[62,61,59,60,63]},"version":"5.0.4"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mml-io/networked-dom-document",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
5
|
"types": "./build/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"test": "jest"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@mml-io/networked-dom-protocol": "^0.
|
|
20
|
-
"@mml-io/observable-dom-common": "^0.
|
|
19
|
+
"@mml-io/networked-dom-protocol": "^0.4.0",
|
|
20
|
+
"@mml-io/observable-dom-common": "^0.4.0",
|
|
21
21
|
"rfc6902": "https://github.com/marcuslongmuir/rfc6902.git#7b81b044d7c2cd36f34f9f30d106e7f5db8a0589"
|
|
22
22
|
}
|
|
23
23
|
}
|