avo 3.17.8 → 3.17.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e776b4d3c05d50eb82a2f18d433fba1f0eb772708aa1454f5261acf02c40e90
4
- data.tar.gz: 286dc3f948587185ea5120d4644d050142c7a3623e907329b8d7e1cec5df72dd
3
+ metadata.gz: ef06e5bc942d9cf211e9938c407b4a81242f57a47cfe96748718f16d2e26452a
4
+ data.tar.gz: 020d2796021e553db9e2e2fb251b9c27c0d2193d231812473de849418ae3c45a
5
5
  SHA512:
6
- metadata.gz: 67ee9428d2759f669805fc3b3f4a5f5472f6f8ddbbc8a9e22982854f41dd78d4a5a5528d3f385fd9b1a23195fae936bd96af883b12039cff68e6ab309ef6760d
7
- data.tar.gz: 96cb89c794b12fd7a327f79ffd13a7ab7bab2a92d75d934324a4022fb772d160049ccaa9ed56ddcf6b29f69a43a85c401e8682d255cc0a73418be9361e09766e
6
+ metadata.gz: 5ddbe6d5197382685b2f2303031ade1668c2e331110c611ba1ea0435b65f32ac4af5b8fbe0d37caabf7244f8cde73e297870e9755039b81b31221034198a90ca
7
+ data.tar.gz: 28da089fd26b1ab19a9aaf19ddd055a618d8341284b89dadc49fa7d66c6e1fa3ff1d820af4584374ece207616a05e150fe28c3702401f7b71b64b38e5245633f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (3.17.8)
4
+ avo (3.17.9)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -1,7 +1,7 @@
1
1
  @charset "UTF-8";
2
2
 
3
3
  /**
4
- * easymde v2.18.0
4
+ * easymde v2.19.0
5
5
  * Copyright Jeroen Akkerman
6
6
  * @link https://github.com/ionaru/easy-markdown-editor
7
7
  * @license MIT
@@ -43915,10 +43915,11 @@
43915
43915
  }
43916
43916
  } while (child = child.parentNode);
43917
43917
  }
43918
- function activeElt(doc5) {
43918
+ function activeElt(rootNode2) {
43919
+ var doc5 = rootNode2.ownerDocument || rootNode2;
43919
43920
  var activeElement;
43920
43921
  try {
43921
- activeElement = doc5.activeElement;
43922
+ activeElement = rootNode2.activeElement;
43922
43923
  } catch (e5) {
43923
43924
  activeElement = doc5.body || null;
43924
43925
  }
@@ -43961,6 +43962,12 @@
43961
43962
  function doc4(cm) {
43962
43963
  return cm.display.wrapper.ownerDocument;
43963
43964
  }
43965
+ function root(cm) {
43966
+ return rootNode(cm.display.wrapper);
43967
+ }
43968
+ function rootNode(element) {
43969
+ return element.getRootNode ? element.getRootNode() : element.ownerDocument;
43970
+ }
43964
43971
  function win(cm) {
43965
43972
  return doc4(cm).defaultView;
43966
43973
  }
@@ -47904,7 +47911,7 @@
47904
47911
  }
47905
47912
  cm.display.maxLineChanged = false;
47906
47913
  }
47907
- var takeFocus = op.focus && op.focus == activeElt(doc4(cm));
47914
+ var takeFocus = op.focus && op.focus == activeElt(root(cm));
47908
47915
  if (op.preparedSelection) {
47909
47916
  cm.display.input.showSelection(op.preparedSelection, takeFocus);
47910
47917
  }
@@ -48118,7 +48125,7 @@
48118
48125
  if (cm.hasFocus()) {
48119
48126
  return null;
48120
48127
  }
48121
- var active = activeElt(doc4(cm));
48128
+ var active = activeElt(root(cm));
48122
48129
  if (!active || !contains2(cm.display.lineDiv, active)) {
48123
48130
  return null;
48124
48131
  }
@@ -48135,7 +48142,7 @@
48135
48142
  return result;
48136
48143
  }
48137
48144
  function restoreSelection(snapshot) {
48138
- if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) {
48145
+ if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) {
48139
48146
  return;
48140
48147
  }
48141
48148
  snapshot.activeElt.focus();
@@ -51636,7 +51643,7 @@
51636
51643
  if (e5.target && e5.target != cm.display.input.getField()) {
51637
51644
  return;
51638
51645
  }
51639
- cm.curOp.focus = activeElt(doc4(cm));
51646
+ cm.curOp.focus = activeElt(root(cm));
51640
51647
  if (signalDOMEvent(cm, e5)) {
51641
51648
  return;
51642
51649
  }
@@ -51826,7 +51833,7 @@
51826
51833
  if (ie4) {
51827
51834
  setTimeout(bind4(ensureFocus, cm), 0);
51828
51835
  } else {
51829
- cm.curOp.focus = activeElt(doc4(cm));
51836
+ cm.curOp.focus = activeElt(root(cm));
51830
51837
  }
51831
51838
  var behavior = configureMouse(cm, repeat, event);
51832
51839
  var sel = cm.doc.sel, contained;
@@ -51909,19 +51916,19 @@
51909
51916
  if (ie4) {
51910
51917
  delayBlurEvent(cm);
51911
51918
  }
51912
- var display = cm.display, doc$1 = cm.doc;
51919
+ var display = cm.display, doc5 = cm.doc;
51913
51920
  e_preventDefault(event);
51914
- var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges;
51921
+ var ourRange, ourIndex, startSel = doc5.sel, ranges = startSel.ranges;
51915
51922
  if (behavior.addNew && !behavior.extend) {
51916
- ourIndex = doc$1.sel.contains(start4);
51923
+ ourIndex = doc5.sel.contains(start4);
51917
51924
  if (ourIndex > -1) {
51918
51925
  ourRange = ranges[ourIndex];
51919
51926
  } else {
51920
51927
  ourRange = new Range(start4, start4);
51921
51928
  }
51922
51929
  } else {
51923
- ourRange = doc$1.sel.primary();
51924
- ourIndex = doc$1.sel.primIndex;
51930
+ ourRange = doc5.sel.primary();
51931
+ ourIndex = doc5.sel.primIndex;
51925
51932
  }
51926
51933
  if (behavior.unit == "rectangle") {
51927
51934
  if (!behavior.addNew) {
@@ -51939,24 +51946,24 @@
51939
51946
  }
51940
51947
  if (!behavior.addNew) {
51941
51948
  ourIndex = 0;
51942
- setSelection(doc$1, new Selection2([ourRange], 0), sel_mouse);
51943
- startSel = doc$1.sel;
51949
+ setSelection(doc5, new Selection2([ourRange], 0), sel_mouse);
51950
+ startSel = doc5.sel;
51944
51951
  } else if (ourIndex == -1) {
51945
51952
  ourIndex = ranges.length;
51946
51953
  setSelection(
51947
- doc$1,
51954
+ doc5,
51948
51955
  normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
51949
51956
  { scroll: false, origin: "*mouse" }
51950
51957
  );
51951
51958
  } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
51952
51959
  setSelection(
51953
- doc$1,
51960
+ doc5,
51954
51961
  normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
51955
51962
  { scroll: false, origin: "*mouse" }
51956
51963
  );
51957
- startSel = doc$1.sel;
51964
+ startSel = doc5.sel;
51958
51965
  } else {
51959
- replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse);
51966
+ replaceOneSelection(doc5, ourIndex, ourRange, sel_mouse);
51960
51967
  }
51961
51968
  var lastPos = start4;
51962
51969
  function extendTo(pos) {
@@ -51966,11 +51973,11 @@
51966
51973
  lastPos = pos;
51967
51974
  if (behavior.unit == "rectangle") {
51968
51975
  var ranges2 = [], tabSize = cm.options.tabSize;
51969
- var startCol = countColumn(getLine(doc$1, start4.line).text, start4.ch, tabSize);
51970
- var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize);
51976
+ var startCol = countColumn(getLine(doc5, start4.line).text, start4.ch, tabSize);
51977
+ var posCol = countColumn(getLine(doc5, pos.line).text, pos.ch, tabSize);
51971
51978
  var left2 = Math.min(startCol, posCol), right2 = Math.max(startCol, posCol);
51972
51979
  for (var line = Math.min(start4.line, pos.line), end2 = Math.min(cm.lastLine(), Math.max(start4.line, pos.line)); line <= end2; line++) {
51973
- var text2 = getLine(doc$1, line).text, leftPos = findColumn(text2, left2, tabSize);
51980
+ var text2 = getLine(doc5, line).text, leftPos = findColumn(text2, left2, tabSize);
51974
51981
  if (left2 == right2) {
51975
51982
  ranges2.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));
51976
51983
  } else if (text2.length > leftPos) {
@@ -51981,7 +51988,7 @@
51981
51988
  ranges2.push(new Range(start4, start4));
51982
51989
  }
51983
51990
  setSelection(
51984
- doc$1,
51991
+ doc5,
51985
51992
  normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges2), ourIndex),
51986
51993
  { origin: "*mouse", scroll: false }
51987
51994
  );
@@ -51998,8 +52005,8 @@
51998
52005
  anchor = maxPos(oldRange.to(), range5.head);
51999
52006
  }
52000
52007
  var ranges$1 = startSel.ranges.slice(0);
52001
- ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head));
52002
- setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
52008
+ ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc5, anchor), head));
52009
+ setSelection(doc5, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
52003
52010
  }
52004
52011
  }
52005
52012
  var editorSize = display.wrapper.getBoundingClientRect();
@@ -52011,9 +52018,9 @@
52011
52018
  return;
52012
52019
  }
52013
52020
  if (cmp2(cur, lastPos) != 0) {
52014
- cm.curOp.focus = activeElt(doc4(cm));
52021
+ cm.curOp.focus = activeElt(root(cm));
52015
52022
  extendTo(cur);
52016
- var visible = visibleLines(display, doc$1);
52023
+ var visible = visibleLines(display, doc5);
52017
52024
  if (cur.line >= visible.to || cur.line < visible.from) {
52018
52025
  setTimeout(operation(cm, function() {
52019
52026
  if (counter == curCount) {
@@ -52043,7 +52050,7 @@
52043
52050
  }
52044
52051
  off2(display.wrapper.ownerDocument, "mousemove", move);
52045
52052
  off2(display.wrapper.ownerDocument, "mouseup", up);
52046
- doc$1.history.lastSelOrigin = null;
52053
+ doc5.history.lastSelOrigin = null;
52047
52054
  }
52048
52055
  var move = operation(cm, function(e5) {
52049
52056
  if (e5.buttons === 0 || !e_button(e5)) {
@@ -53186,7 +53193,7 @@
53186
53193
  signal(this, "overwriteToggle", this, this.state.overwrite);
53187
53194
  },
53188
53195
  hasFocus: function() {
53189
- return this.display.input.getField() == activeElt(doc4(this));
53196
+ return this.display.input.getField() == activeElt(root(this));
53190
53197
  },
53191
53198
  isReadOnly: function() {
53192
53199
  return !!(this.options.readOnly || this.doc.cantEdit);
@@ -53512,7 +53519,7 @@
53512
53519
  disableBrowserMagic(te2);
53513
53520
  cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
53514
53521
  te2.value = lastCopied.text.join("\n");
53515
- var hadFocus = activeElt(div2.ownerDocument);
53522
+ var hadFocus = activeElt(rootNode(div2));
53516
53523
  selectInput(te2);
53517
53524
  setTimeout(function() {
53518
53525
  cm.display.lineSpace.removeChild(kludge);
@@ -53534,7 +53541,7 @@
53534
53541
  };
53535
53542
  ContentEditableInput.prototype.prepareSelection = function() {
53536
53543
  var result = prepareSelection(this.cm, false);
53537
- result.focus = activeElt(this.div.ownerDocument) == this.div;
53544
+ result.focus = activeElt(rootNode(this.div)) == this.div;
53538
53545
  return result;
53539
53546
  };
53540
53547
  ContentEditableInput.prototype.showSelection = function(info, takeFocus) {
@@ -53630,7 +53637,7 @@
53630
53637
  };
53631
53638
  ContentEditableInput.prototype.focus = function() {
53632
53639
  if (this.cm.options.readOnly != "nocursor") {
53633
- if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div) {
53640
+ if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div) {
53634
53641
  this.showSelection(this.prepareSelection(), true);
53635
53642
  }
53636
53643
  this.div.focus();
@@ -54185,7 +54192,7 @@
54185
54192
  return false;
54186
54193
  };
54187
54194
  TextareaInput.prototype.focus = function() {
54188
- if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) {
54195
+ if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {
54189
54196
  try {
54190
54197
  this.textarea.focus();
54191
54198
  } catch (e5) {
@@ -54396,7 +54403,7 @@
54396
54403
  options.placeholder = textarea.placeholder;
54397
54404
  }
54398
54405
  if (options.autofocus == null) {
54399
- var hasFocus = activeElt(textarea.ownerDocument);
54406
+ var hasFocus = activeElt(rootNode(textarea));
54400
54407
  options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body;
54401
54408
  }
54402
54409
  function save2() {
@@ -54524,7 +54531,7 @@
54524
54531
  };
54525
54532
  CodeMirror3.fromTextArea = fromTextArea;
54526
54533
  addLegacyProps(CodeMirror3);
54527
- CodeMirror3.version = "5.65.13";
54534
+ CodeMirror3.version = "5.65.18";
54528
54535
  return CodeMirror3;
54529
54536
  });
54530
54537
  }
@@ -61257,6 +61264,7 @@
61257
61264
  options.imagePathAbsolute = options.imagePathAbsolute || false;
61258
61265
  options.imageCSRFName = options.imageCSRFName || "csrfmiddlewaretoken";
61259
61266
  options.imageCSRFHeader = options.imageCSRFHeader || false;
61267
+ options.imageInputName = options.imageInputName || "image";
61260
61268
  if (options.autosave != void 0 && options.autosave.unique_id != void 0 && options.autosave.unique_id != "")
61261
61269
  options.autosave.uniqueId = options.autosave.unique_id;
61262
61270
  if (options.overlayMode && options.overlayMode.combine === void 0) {
@@ -61513,8 +61521,9 @@
61513
61521
  }
61514
61522
  var _vm = this;
61515
61523
  function assignImageBlockAttributes(parentEl2, img) {
61516
- parentEl2.setAttribute("data-img-src", img.url);
61517
- parentEl2.setAttribute("style", "--bg-image:url(" + img.url + ");--width:" + img.naturalWidth + "px;--height:" + calcHeight(img.naturalWidth, img.naturalHeight));
61524
+ var url = new URL(img.url, document.baseURI).href;
61525
+ parentEl2.setAttribute("data-img-src", url);
61526
+ parentEl2.setAttribute("style", "--bg-image:url(" + url + ");--width:" + img.naturalWidth + "px;--height:" + calcHeight(img.naturalWidth, img.naturalHeight));
61518
61527
  _vm.codemirror.setSize();
61519
61528
  }
61520
61529
  function handleImages() {
@@ -61527,7 +61536,7 @@
61527
61536
  return;
61528
61537
  }
61529
61538
  if (!parentEl2.hasAttribute("data-img-src")) {
61530
- var srcAttr = parentEl2.innerText.match("\\((.*)\\)");
61539
+ var srcAttr = parentEl2.innerText.match(/!\[.*?\]\((.*?)\)/);
61531
61540
  if (!window.EMDEimagesCache) {
61532
61541
  window.EMDEimagesCache = {};
61533
61542
  }
@@ -61540,6 +61549,7 @@
61540
61549
  }
61541
61550
  }
61542
61551
  if (!window.EMDEimagesCache[keySrc]) {
61552
+ window.EMDEimagesCache[keySrc] = {};
61543
61553
  var img = document.createElement("img");
61544
61554
  img.onload = function() {
61545
61555
  window.EMDEimagesCache[keySrc] = {
@@ -61846,7 +61856,7 @@
61846
61856
  imageInput.className = "imageInput";
61847
61857
  imageInput.type = "file";
61848
61858
  imageInput.multiple = true;
61849
- imageInput.name = "image";
61859
+ imageInput.name = self2.options.imageInputName;
61850
61860
  imageInput.accept = self2.options.imageAccept;
61851
61861
  imageInput.style.display = "none";
61852
61862
  imageInput.style.opacity = 0;