Skip to content

Commit

Permalink
Merge branch 'master' into text-completer-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Jul 12, 2023
2 parents 2450d72 + 31bbd6a commit 30979cb
Show file tree
Hide file tree
Showing 27 changed files with 229 additions and 121 deletions.
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/add-to-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: "🌐 Add a project to the list of project using Ace on its website."
description: Add a project to the list of projects using Ace, displayed on the website.
title: "Add project (project name) to the list of projects using Ace on its website"
labels: [website, needs-triage]
assignees: []
body:
- type: markdown
attributes:
value: |
The fastest way to get your project to be displayed on the website is to create a PR.
Examples: https://github.com/ajaxorg/ace/pull/5014, https://github.com/ajaxorg/ace/pull/5222.
If for any reason creating a PR is not an option for you, please proceed with filling out this issue. Thanks!
- type: input
id: name
attributes:
label: Project name
description: A name of the project to be used on Ace website.
validations:
required: true
- type: input
id: project-link
attributes:
label: Project link
description: A link to the project's website.
validations:
required: true
- type: input
id: logo-link
attributes:
label: Logo link
description: |
A link to the logo image to be used on the website for the project. If not provided, only the name of the project will be displayed.
By submitting this link, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
validations:
required: false
- type: textarea
id: info
attributes:
label: Additional information
description: Any additional information you would like to share.
validations:
required: false
- type: checkboxes
id: ack
attributes:
label: Acknowledgements
options:
- label: I may be able to implement this request.
required: false
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.23.4](https://github.com/ajaxorg/ace/compare/v1.23.3...v1.23.4) (2023-07-12)


### Bug Fixes

* filterText triggered selection range removal when completions range was present ([#5249](https://github.com/ajaxorg/ace/issues/5249)) ([b586e4d](https://github.com/ajaxorg/ace/commit/b586e4d574bf780fc38f1ac0d034276272b36ad3))

### [1.23.3](https://github.com/ajaxorg/ace/compare/v1.23.2...v1.23.3) (2023-07-10)


### Bug Fixes

* android bug when deleting multiple lines ([#5248](https://github.com/ajaxorg/ace/issues/5248)) ([bd066ff](https://github.com/ajaxorg/ace/commit/bd066ffef88ca74f5ac32349d3e868cfa875a47b)), closes [#5087](https://github.com/ajaxorg/ace/issues/5087)
* update jshint version to 2.13.6; change esversion to target ECMAScript 11 ([#5243](https://github.com/ajaxorg/ace/issues/5243)) ([301aee9](https://github.com/ajaxorg/ace/commit/301aee91b5974d9fb31d646466ed301c5c3b8249))

### [1.23.2](https://github.com/ajaxorg/ace/compare/v1.23.1...v1.23.2) (2023-07-07)


### Bug Fixes

* **autocomplete:** fix a11y violations ([#5241](https://github.com/ajaxorg/ace/issues/5241)) ([decb615](https://github.com/ajaxorg/ace/commit/decb6154198105289170303b7434c524eaf9fda8))
* bug in guttertooltip when `tooltipsFollowsMouse` set to false ([#5217](https://github.com/ajaxorg/ace/issues/5217)) ([67d318e](https://github.com/ajaxorg/ace/commit/67d318ed25d5b45789462850e6b96aac2931591f))
* typo in function name ([#5229](https://github.com/ajaxorg/ace/issues/5229)) ([6e99055](https://github.com/ajaxorg/ace/commit/6e99055c46f443271161e40fe15372d1d8ae9f42))

### [1.23.1](https://github.com/ajaxorg/ace/compare/v1.23.0...v1.23.1) (2023-06-27)

## [1.23.0](https://github.com/ajaxorg/ace/compare/v1.22.1...v1.23.0) (2023-06-21)


Expand Down
3 changes: 2 additions & 1 deletion Makefile.dryice.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function buildTypes() {

var pathModules = [
"declare module 'ace-builds/webpack-resolver';",
"declare module 'ace-builds/esm-resolver';",
"declare module 'ace-builds/src-noconflict/ace';"
].concat(paths.map(function(path) {
if (moduleNameRegex.test(path)) {
Expand Down Expand Up @@ -294,7 +295,7 @@ function jsFileList(path, filter) {
filter = /_test/;

return fs.readdirSync(path).map(function(x) {
if (x.slice(-3) == ".js" && !filter.test(x) && !/\s|BASE|(\b|_)dummy(\b|_)|\.css\.js$/.test(x))
if (x.slice(-3) == ".js" && !filter.test(x) && !/\s|BASE|(\b|_)dummy(\b|_)|[\-\.]css\.js$/.test(x))
return x.slice(0, -3);
}).filter(Boolean);
}
Expand Down
2 changes: 1 addition & 1 deletion build
Submodule build updated 272 files
16 changes: 12 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1135,20 +1135,28 @@ <h1>Projects Using Ace</h1>
<div class="text-logo">trinket</div>
<a href="https://trinket.io/">trinket</a>
</li>
<li>
<li>
<a href="https://goonlinetools.com/">GoOnlineTools</a>
</li>
<li>
<li>
<img lazy-src="https://sqlize.online/favicons/sqlize/android-chrome-192x192.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://sqlize.online/">SQLize.online</a>
</li>
<li>
<li>
<img lazy-src="https://phpize.online/favicons/phpize/android-chrome-192x192.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://phpize.online/">PHPize.online</a>
</li>
<li>
<div class="text-logo">Domoticz</div>
<a href="https://www.domoticz.com/">Domoticz</a>
</li>
<li>
<img lazy-src="https://nixx.dev/static/hotlink-ok/logo-alt.png" style="width: 72px; left: 15px; top: 0px;">
<a href="https://nixx.dev">Nixx Web Tools</a>
</li>
<li id="add_your_site">
<p>+</p>
<a href="mailto:[email protected]?subject=Put%20me%20on%20the%20Ace%20site!&body=Please include a link to a logo hosted on your site!">Your Site Here</a>
<a href="https://github.com/ajaxorg/ace/issues/new?assignees=&labels=website%2Cneeds-triage&projects=&template=add-to-website.yml&title=Add+project+%28project+name%29+to+the+list+of+projects+using+Ace+on+its+website">Your Site Here</a>
</li>
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/ace/loader_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var global = (function() {

module.exports = function(ace) {
config.init = init;
config.$require = require;

/**
* Provides access to require in packed noconflict mode
Expand Down
12 changes: 6 additions & 6 deletions lib/ace/mode/javascript/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2392,13 +2392,13 @@ module.exports = slice;
exports.noConflict = function () { global._ = current; return exports; };
}()));
}(this, (function () {
// Underscore.js 1.13.4
// Underscore.js 1.13.6
// https://underscorejs.org
// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.

// Current version.
var VERSION = '1.13.4';
var VERSION = '1.13.6';

// Establish the root object, `window` (`self`) in the browser, `global`
// on the server, or `this` in some virtual machines. We use `self`
Expand Down Expand Up @@ -4461,7 +4461,7 @@ module.exports = slice;
/*exported console */

var _ = _dereq_("underscore");
_.clone = _dereq_("lodash.clone");
_.clone = _dereq_("lodash.clone");
var events = _dereq_("events");
var vars = _dereq_("./vars.js");
var messages = _dereq_("./messages.js");
Expand Down Expand Up @@ -8930,7 +8930,7 @@ var JSHINT = (function() {
var id = state.tokens.prev;
value = expression(context, 10);
if (value) {
if (value.identifier && value.value === "undefined") {
if (!isConst && value.identifier && value.value === "undefined") {
warning("W080", id, id.value);
}
if (!lone) {
Expand Down Expand Up @@ -13527,7 +13527,7 @@ var errors = {

// Constants
E011: "'{a}' has already been declared.",
E012: "const '{a}' is initialized to 'undefined'.",
E012: "Missing initializer for constant '{a}'.",
E013: "Attempting to override '{a}' which is a constant.",

// Regular expressions
Expand Down Expand Up @@ -15122,7 +15122,7 @@ exports.regexpDot = /(^|[^\\])(\\\\)*\./;
*/

var _ = _dereq_("underscore");
_.slice = _dereq_("lodash.slice");
_.slice = _dereq_("lodash.slice");
var events = _dereq_("events");

// Used to denote membership in lookup tables (a primitive value such as `true`
Expand Down
2 changes: 1 addition & 1 deletion lib/ace/mode/javascript_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ oop.inherits(JavaScriptWorker, Mirror);
this.options = options || {
// undef: true,
// unused: true,
esnext: true,
esversion: 11,
moz: true,
devel: true,
browser: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ace-code",
"description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE",
"version": "1.23.0",
"version": "1.23.4",
"homepage": "http://github.com/ajaxorg/ace",
"engines": {
"node": ">= 0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class CompletionProvider {
// TODO add support for options.deleteSuffix
if (!this.completions)
return false;
if (this.completions.filterText) {
if (this.completions.filterText && !data.range) {
var ranges;
if (editor.selection.getAllRanges) {
ranges = editor.selection.getAllRanges();
Expand Down
9 changes: 5 additions & 4 deletions src/autocomplete/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ class AcePopup {
popup.renderer.setStyle("ace_autocomplete");

// Set aria attributes for the popup
popup.renderer.container.setAttribute("role", "listbox");
popup.renderer.container.setAttribute("aria-label", nls("Autocomplete suggestions"));
popup.renderer.$textLayer.element.setAttribute("role", "listbox");
popup.renderer.$textLayer.element.setAttribute("aria-label", nls("Autocomplete suggestions"));
popup.renderer.textarea.setAttribute("aria-hidden", "true");

popup.setOption("displayIndentGuides", false);
popup.setOption("dragDelay", 150);
Expand Down Expand Up @@ -133,12 +134,12 @@ class AcePopup {
dom.addCssClass(selected, "ace_selected");
var ariaId = getAriaId(row);
selected.id = ariaId;
popup.renderer.container.setAttribute("aria-activedescendant", ariaId);
t.element.setAttribute("aria-activedescendant", ariaId);
el.setAttribute("aria-activedescendant", ariaId);
selected.setAttribute("role", "option");
selected.setAttribute("aria-label", popup.getData(row).value);
selected.setAttribute("aria-setsize", popup.data.length);
selected.setAttribute("aria-posinset", row);
selected.setAttribute("aria-posinset", row+1);
selected.setAttribute("aria-describedby", "doc-tooltip");
}
});
Expand Down
60 changes: 45 additions & 15 deletions src/autocomplete_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ function initEditor(value) {
return editor;
}

function afterRenderCheck(popup, callback) {
popup.renderer.on("afterRender", function wait() {
popup.renderer.off("afterRender", wait);
callback();
});
}

module.exports = {
tearDown: function() {
if (editor) {
Expand All @@ -48,16 +55,16 @@ module.exports = {
assert.ok(!editor.container.querySelector("style"));

sendKey("a");
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="arraysort" aria-setsize="2" aria-posinset="0" aria-describedby="doc-tooltip"><s "ace_completion-highlight">a</s><s "ace_">rraysort</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d><d "ace_line"><s "ace_completion-highlight">a</s><s "ace_">looooooooooooooooooooooooooooong_word</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="arraysort" aria-setsize="2" aria-posinset="1" aria-describedby="doc-tooltip"><s "ace_completion-highlight">a</s><s "ace_">rraysort</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d><d "ace_line"><s "ace_completion-highlight">a</s><s "ace_">looooooooooooooooooooooooooooong_word</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
sendKey("rr");
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="arraysort" aria-setsize="1" aria-posinset="0" aria-describedby="doc-tooltip"><s "ace_completion-highlight">arr</s><s "ace_">aysort</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="arraysort" aria-setsize="1" aria-posinset="1" aria-describedby="doc-tooltip"><s "ace_completion-highlight">arr</s><s "ace_">aysort</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
sendKey("r");
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="arraysort" aria-setsize="1" aria-posinset="0" aria-describedby="doc-tooltip"><s "ace_completion-highlight">arr</s><s "ace_">ayso</s><s "ace_completion-highlight">r</s><s "ace_">t</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="arraysort" aria-setsize="1" aria-posinset="1" aria-describedby="doc-tooltip"><s "ace_completion-highlight">arr</s><s "ace_">ayso</s><s "ace_completion-highlight">r</s><s "ace_">t</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {

sendKey("Return");
assert.equal(editor.getValue(), "arraysort\narraysort alooooooooooooooooooooooooooooong_word");
editor.execCommand("insertstring", " looooooooooooooooooooooooooooong_");
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="alooooooooooooooooooooooooooooong_word" aria-setsize="1" aria-posinset="0" aria-describedby="doc-tooltip"><s "ace_">a</s><s "ace_completion-highlight">looooooooooooooooooooooooooooong_</s><s "ace_">word</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
checkInnerHTML('<d "ace_line ace_selected" id="suggest-aria-id:0" role="option" aria-label="alooooooooooooooooooooooooooooong_word" aria-setsize="1" aria-posinset="1" aria-describedby="doc-tooltip"><s "ace_">a</s><s "ace_completion-highlight">looooooooooooooooooooooooooooong_</s><s "ace_">word</s><s "ace_completion-spacer"> </s><s "ace_completion-meta">local</s></d>', function() {
sendKey("Return");
editor.destroy();
editor.container.remove();
Expand Down Expand Up @@ -95,7 +102,7 @@ module.exports = {
snippet: "will: $1",
meta: "snippet",
command: "startAutocomplete",
range: new Range(0, 4, 0, 6)
range: new Range(0, 4, 0, 7)
}, {
caption: "here",
value: "-here",
Expand All @@ -110,27 +117,50 @@ module.exports = {
editor.moveCursorTo(0, 6);
sendKey("w");
var popup = editor.completer.popup;
check(function () {
afterRenderCheck(popup, function () {
assert.equal(popup.data.length, 1);
editor.onCommandKey(null, 0, 13);
assert.equal(popup.data.length, 2);
assert.equal(editor.getValue(), "goodwill: ");
check(function () {
afterRenderCheck(popup, function () {
editor.onCommandKey(null, 0, 13);
assert.equal(editor.getValue(), "goodwill-here");
editor.destroy();
editor.container.remove();
done();
});
});

function check(callback) {
popup = editor.completer.popup;
popup.renderer.on("afterRender", function wait() {
popup.renderer.off("afterRender", wait);
callback();
});
}
},
"test: filterText does not trigger selection range removal when completions range is present": function (done) {
var editor = initEditor("{}");
editor.completers = [
{
getCompletions: function (editor, session, pos, prefix, callback) {
var completions = [
{
caption: "apple",
snippet: "apple: $1",
meta: "snippet",
range: new Range(0, 1, 0, 2)
}, {
caption: "pineapple",
value: "pineapple",
range: new Range(0, 1, 0, 2)
}
];
callback(null, completions);
}
}
];
editor.moveCursorTo(0, 1);
sendKey("a");
var popup = editor.completer.popup;
afterRenderCheck(popup, function () {
assert.equal(popup.data.length, 2);
editor.onCommandKey(null, 0, 13);
assert.equal(editor.getValue(), "{apple: }");
done();
});
},
"test: different completers tooltips": function (done) {
var editor = initEditor("");
Expand Down
Loading

0 comments on commit 30979cb

Please sign in to comment.