Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeMirror 5.62.2 #10003

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ResourceManagementOptionsConfiguration : IConfigureOptions<Resource

private const string cloudflareUrl = "https://cdnjs.cloudflare.com/ajax/libs/";
// Versions
private const string codeMirrorVersion = "5.62.0";
private const string codeMirrorVersion = "5.62.2";
private const string monacoEditorVersion = "0.25.2";
// URLs
private const string codeMirrorUrl = cloudflareUrl + "codemirror/" + codeMirrorVersion + "/";
Expand Down Expand Up @@ -227,7 +227,7 @@ ResourceManifest BuildManifest()
.DefineScript("codemirror")
.SetUrl("~/OrchardCore.Resources/Scripts/codemirror/codemirror.min.js", "~/OrchardCore.Resources/Scripts/codemirror/codemirror.js")
.SetCdn(codeMirrorUrl + "codemirror.min.js", codeMirrorUrl + "codemirror.js")
.SetCdnIntegrity("sha384-dyKmF6f8HxufZVfnbOXHDghtE7ukP8KKL8qVw1QvqY/8MFVkAla7N2h6oCNqMDlz", "sha384-IF7UVTFIt3bK395JQx3Bbtic2AmtV9x1qakA7EwqkUw0FHex0VkK6Xw8Xcb9xzPc")
.SetCdnIntegrity("sha384-rzcLytDyan25531bcpTEaKPpozaQYGnFzr0JIOraZeKDsrKPkwrfBVrJ9fCLgbpJ", "sha384-ULdIy0tCFbR+CuSTv6S3zd2j98/10qEYGhXB3BSjn5fIPt70/P0B5PpkfzB/w0P5")
.SetVersion(codeMirrorVersion);

manifest
Expand Down Expand Up @@ -276,7 +276,7 @@ ResourceManifest BuildManifest()
.DefineScript("codemirror-addon-hint-show-hint")
.SetUrl("~/OrchardCore.Resources/Scripts/codemirror/addon/hint/show-hint.min.js", "~/OrchardCore.Resources/Scripts/codemirror/addon/hint/show-hint.js")
.SetCdn(codeMirrorUrl + "addon/hint/show-hint.min.js", codeMirrorUrl + "addon/hint/show-hint.js")
.SetCdnIntegrity("sha384-YHH6Bxz1jzwAQrWOInRPW4vkcNnaVxXh1a5tqaGf2gfLWcGWtIt8EhrTBaBn132Z", "sha384-StteqlqIF6JtTFDhoXRxcjLviwjhIW+zvD9lT8HskscpZF/0fc6EmmDfauesTebF")
.SetCdnIntegrity("sha384-pFJF3GAZ6kaXHIeHTe2ecWeeBzFVuVF2QXccnazviREKim+uL3lm/voyytwY71bQ", "sha384-RzmY798hMmzDwNL4d5ZkSaygnsA6Rq2ROY7awxW1t9NV+8XPpnXivbcD+EI1r2Ij")
.SetVersion(codeMirrorVersion);

manifest
Expand Down
14 changes: 7 additions & 7 deletions src/OrchardCore.Modules/OrchardCore.Resources/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"bootstrap-scss": "5.0.2",
"bootstrap-select": "1.13.18",
"bootstrap-slider": "11.0.2",
"codemirror": "5.62.0",
"codemirror": "5.62.2",
"jquery": "3.6.0",
"jquery-resizable-dom": "0.35.0",
"jquery.easing": "1.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
}

function Widget(completion, data) {
this.id = "cm-complete-" + Math.floor(Math.random(1e6));
this.completion = completion;
this.data = data;
this.picked = false;
Expand All @@ -255,6 +256,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
var ownerDocument = cm.getInputField().ownerDocument;
var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;
var hints = this.hints = ownerDocument.createElement("ul");
hints.setAttribute("role", "listbox");
hints.setAttribute("aria-expanded", "true");
hints.id = this.id;
var theme = completion.cm.options.theme;
hints.className = "CodeMirror-hints " + theme;
this.selectedHint = data.selectedHint || 0;
Expand All @@ -266,6 +270,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
if (cur.className != null) className = cur.className + " " + className;
elt.className = className;
if (i == this.selectedHint) elt.setAttribute("aria-selected", "true");
elt.id = this.id + "-" + i;
elt.setAttribute("role", "option");
if (cur.render) cur.render(elt, data, cur);else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));
elt.hintId = i;
}
Expand Down Expand Up @@ -294,6 +301,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);
var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);
container.appendChild(hints);
cm.getInputField().setAttribute("aria-autocomplete", "list");
cm.getInputField().setAttribute("aria-owns", this.id);
cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint);
var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();
var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false; // Compute in the timeout to avoid reflow on init

Expand Down Expand Up @@ -420,6 +430,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
this.completion.widget = null;
if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);
var input = this.completion.cm.getInputField();
input.removeAttribute("aria-activedescendant");
input.removeAttribute("aria-owns");
var cm = this.completion.cm;

if (this.completion.options.closeOnUnfocus) {
Expand All @@ -446,9 +459,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
if (i >= this.data.list.length) i = avoidWrap ? this.data.list.length - 1 : 0;else if (i < 0) i = avoidWrap ? 0 : this.data.list.length - 1;
if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint];
if (node) node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");

if (node) {
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
node.removeAttribute("aria-selected");
}

node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
node.setAttribute("aria-selected", "true");
this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id);
this.scrollToActive();
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
},
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14669,6 +14669,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi

CodeMirror.fromTextArea = fromTextArea;
addLegacyProps(CodeMirror);
CodeMirror.version = "5.62.0";
CodeMirror.version = "5.62.2";
return CodeMirror;
});

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/docs/reference/modules/Resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ The `OrchardCore.Resources` module provides some commonly used ones:
| bootstrap-select | Style | 1.13.18 | - |
| bootstrap-slider | Script | 11.0.2 | - |
| bootstrap-slider | Style | 11.0.2 | - |
| codemirror | Script | 5.62.0 | - |
| codemirror | Style | 5.62.0 | - |
| codemirror | Script | 5.62.2 | - |
| codemirror | Style | 5.62.2 | - |
| font-awesome | Style | 5.15.3 | - |
| font-awesome | Script | 5.15.3 | - |
| font-awesome-v4-shims | Script | 5.15.3 | - |
Expand Down
2 changes: 1 addition & 1 deletion src/docs/resources/libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The below table lists the different libraries used as Resources:
| [Bootstrap](https://github.com/twbs/bootstrap) | HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web. | 5.0.2 | [MIT](https://github.com/twbs/bootstrap/blob/main/LICENSE) |
| [bootstrap-select](https://github.com/snapappointments/bootstrap-select) | jQuery plugin for select elements. | 1.3.18 | [MIT](https://github.com/snapappointments/bootstrap-select/blob/v1.14-dev/LICENSE) |
| [bootstrap-slider](https://github.com/seiyria/bootstrap-slider) | Slider control for Bootstrap. | 11.0.2 | [MIT](https://github.com/seiyria/bootstrap-slider/blob/master/LICENSE.md) |
| [Code Mirror](https://github.com/codemirror/CodeMirror) | In-browser code editor. | 5.62.0 | [MIT](https://github.com/codemirror/CodeMirror/blob/master/LICENSE) |
| [Code Mirror](https://github.com/codemirror/CodeMirror) | In-browser code editor. | 5.62.2 | [MIT](https://github.com/codemirror/CodeMirror/blob/master/LICENSE) |
| [Font Awesome](https://github.com/FortAwesome/Font-Awesome) | The iconic SVG, font, and CSS toolkit. | 5.15.3 | [Font Awesome Free License](https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt) |
| [jQuery](https://github.com/jquery/jquery) | jQuery JavaScript Library. | 3.6.0 | [MIT](https://github.com/jquery/jquery/blob/master/LICENSE.txt) |
| [jQuery UI](https://github.com/jquery/jquery-ui) | jQuery user interface library. | 1.12.1 | [MIT](https://github.com/jquery/jquery-ui/blob/master/LICENSE.txt) |
Expand Down