@pronto-tools-and-more/files 10.57.0 → 11.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/files/assets/live-reload.js +13 -0
- package/package.json +1 -1
@@ -192,11 +192,24 @@ const updateViews = () => {
|
|
192
192
|
document.body.append(currentFrame);
|
193
193
|
};
|
194
194
|
|
195
|
+
const incrementalUpdate = (changes) => {
|
196
|
+
const pidKey = `data-prid`;
|
197
|
+
for (const change of changes) {
|
198
|
+
if (change.type === "text-change") {
|
199
|
+
const $Node = document.querySelector(`[${pidKey}="${change.ref}"]`);
|
200
|
+
if ($Node) {
|
201
|
+
$Node.textContent = change.newText;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
}
|
205
|
+
};
|
206
|
+
|
195
207
|
const commandMap = {
|
196
208
|
reload,
|
197
209
|
updateCss,
|
198
210
|
updateCssError,
|
199
211
|
updateViews,
|
212
|
+
incrementalUpdate,
|
200
213
|
};
|
201
214
|
|
202
215
|
const getCommand = (method) => {
|