Skip to content

Commit

Permalink
package 15.11.23
Browse files Browse the repository at this point in the history
  • Loading branch information
akoreman committed Nov 15, 2023
1 parent 1ac1817 commit 89f8b8c
Show file tree
Hide file tree
Showing 28 changed files with 226 additions and 112 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.31.2](https://github.com/ajaxorg/ace/compare/v1.31.1...v1.31.2) (2023-11-15)


### Bug Fixes

* inline preview with loading state ([05db94f](https://github.com/ajaxorg/ace/commit/05db94f53774f64318de757347f7217043744fe6))

### [1.31.1](https://github.com/ajaxorg/ace/compare/v1.31.0...v1.31.1) (2023-10-30)


Expand Down
1 change: 1 addition & 0 deletions ace.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ export namespace Ace {
setSelectOnHover?: Boolean;
stickySelectionDelay?: Number;
ignoreCaption?: Boolean;
showLoadingState?: Boolean;
emptyMessage?(prefix: String): String;
getPopup(): AcePopup;
showPopup(editor: Editor, options: CompletionOptions): void;
Expand Down
40 changes: 27 additions & 13 deletions demo/kitchen-sink/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5725,6 +5725,7 @@ var Autocomplete = /** @class */ (function () {
this.keyboardHandler.bindKeys(this.commands);
this.parentNode = null;
this.setSelectOnHover = false;
this.showLoadingState = false;
this.stickySelectionDelay = 500;
this.blurListener = this.blurListener.bind(this);
this.changeListener = this.changeListener.bind(this);
Expand All @@ -5742,15 +5743,21 @@ var Autocomplete = /** @class */ (function () {
var initialPosition = this.completionProvider && this.completionProvider.initialPosition;
if (this.autoShown || (this.popup && this.popup.isOpen) || !initialPosition)
return;
var completionsForEmpty = [{
caption: config.nls("Loading..."),
value: ""
}];
this.completions = new FilteredList(completionsForEmpty);
this.completions = new FilteredList(Autocomplete.completionsForLoading);
this.openPopup(this.editor, initialPosition.prefix, false);
this.popup.renderer.setStyle("ace_loading", true);
}.bind(this), this.stickySelectionDelay);
}
Object.defineProperty(Autocomplete, "completionsForLoading", {
get: function () {
return [{
caption: config.nls("Loading..."),
value: ""
}];
},
enumerable: false,
configurable: true
});
Autocomplete.prototype.$init = function () {
this.popup = new AcePopup(this.parentNode || document.body || document.documentElement);
this.popup.on("click", function (e) {
Expand Down Expand Up @@ -5867,7 +5874,8 @@ var Autocomplete = /** @class */ (function () {
this.$initInline();
this.popup.autoSelect = this.autoSelect;
this.popup.setSelectOnHover(this.setSelectOnHover);
var previousSelectedItem = this.popup.data[this.popup.getRow()];
var oldRow = this.popup.getRow();
var previousSelectedItem = this.popup.data[oldRow];
this.popup.setData(this.completions.filtered, this.completions.filterText);
if (this.editor.textInput.setAriaOptions) {
this.editor.textInput.setAriaOptions({
Expand All @@ -5876,11 +5884,14 @@ var Autocomplete = /** @class */ (function () {
});
}
editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
var newRow = this.popup.data.indexOf(previousSelectedItem);
if (newRow && this.stickySelection)
this.popup.setRow(this.autoSelect ? newRow : -1);
else
this.popup.setRow(this.autoSelect ? 0 : -1);
var newRow;
if (this.stickySelection)
newRow = this.popup.data.indexOf(previousSelectedItem);
if (!newRow || newRow === -1)
newRow = 0;
this.popup.setRow(this.autoSelect ? newRow : -1);
if (newRow === oldRow && previousSelectedItem !== this.completions.filtered[newRow])
this.$onPopupChange();
if (!keepPopupPosition) {
this.popup.setTheme(editor.getTheme());
this.popup.setFontSize(editor.getFontSize());
Expand Down Expand Up @@ -6039,6 +6050,7 @@ var Autocomplete = /** @class */ (function () {
}];
this.completions = new FilteredList(completionsForEmpty);
this.openPopup(this.editor, prefix, keepPopupPosition);
this.popup.renderer.setStyle("ace_loading", false);
return;
}
return this.detach();
Expand All @@ -6048,11 +6060,13 @@ var Autocomplete = /** @class */ (function () {
if (this.autoInsert && !this.autoShown && filtered.length == 1)
return this.insertMatch(filtered[0]);
}
this.completions = completions;
this.completions = !finished && this.showLoadingState ?
new FilteredList(Autocomplete.completionsForLoading.concat(filtered), completions.filterText) :
completions;
this.openPopup(this.editor, prefix, keepPopupPosition);
this.popup.renderer.setStyle("ace_loading", !finished);
}.bind(this));
if (!this.autoShown && !(this.popup && this.popup.isOpen)) {
if (this.showLoadingState && !this.autoShown && !(this.popup && this.popup.isOpen)) {
this.$firstOpenTimer.delay(this.stickySelectionDelay / 2);
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ace-builds",
"main": "./src-noconflict/ace.js",
"typings": "ace.d.ts",
"version": "1.31.1",
"version": "1.31.2",
"description": "Ace (Ajax.org Cloud9 Editor)",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion src-min-noconflict/ace.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min-noconflict/ext-inline_autocomplete.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min-noconflict/ext-language_tools.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min-noconflict/ext-prompt.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min-noconflict/mode-prql.js

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

2 changes: 1 addition & 1 deletion src-min-noconflict/worker-xml.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/ace.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/ext-inline_autocomplete.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/ext-language_tools.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-min/ext-prompt.js

Large diffs are not rendered by default.

0 comments on commit 89f8b8c

Please sign in to comment.