@themarioga/grid-editor 9.2.5 → 9.2.6

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/docs/plugins.md CHANGED
@@ -316,6 +316,10 @@ on the canvas, the plugin takes off, with **`cleanMarkup(root, liveOf)`**:
316
316
  put on the canvas - the same as your `unmark`, `onDeinit` and
317
317
  `onBeforeDeinit` do, but only to markup: listeners, observers and what you
318
318
  remember stay as they are, because the canvas is still being edited.
319
+ The copy is in an inert document of its own, not the page's, so an image
320
+ in it does not load nor run its `onerror`: `root.ownerDocument` is not
321
+ `document`. A node made with `document.createElement` and put into it is
322
+ taken in as usual.
319
323
  - `liveOf(node)` is the canvas's node a node of the copy was copied from, or
320
324
  `null` for one made on the copy. It is for state kept by node: the text
321
325
  feature reads an open editor's content through it.
package/package.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "version": "9.2.5",
35
+ "version": "9.2.6",
36
36
  "main": "dist/grideditor.js",
37
37
  "module": "dist/grideditor.esm.js",
38
38
  "types": "dist/grideditor.d.ts",
@@ -2557,13 +2557,19 @@ function build(instance, baseElem, optionsOrMethod) {
2557
2557
  * of the canvas while it is edited, and a snapshot only took them off
2558
2558
  * again. A template is the one node a shallow clone leaves empty, so
2559
2559
  * it goes whole.
2560
+ *
2561
+ * Copied into a document of its own, which is inert, as plainHtml
2562
+ * parses: a copy in the page's document starts loading an <img src>,
2563
+ * and runs its onerror, even detached - and so does markup a plugin's
2564
+ * cleanMarkup puts into the copy.
2560
2565
  */
2561
2566
  function copyCanvas() {
2562
2567
  var toLive = new Map();
2563
2568
  var toCopy = new Map();
2569
+ var inert = document.implementation.createHTMLDocument('');
2564
2570
 
2565
2571
  function copyNode(live) {
2566
- var copied = live.cloneNode(live.nodeName === 'TEMPLATE');
2572
+ var copied = inert.importNode(live, live.nodeName === 'TEMPLATE');
2567
2573
  if (live.nodeType !== 1) { return copied; }
2568
2574
 
2569
2575
  toLive.set(copied, live);