Skip to content

Commit

Permalink
package 11.12.23
Browse files Browse the repository at this point in the history
  • Loading branch information
akoreman committed Dec 11, 2023
1 parent f336306 commit e515d12
Show file tree
Hide file tree
Showing 324 changed files with 3,360 additions and 3,330 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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.32.1](https://github.com/ajaxorg/ace/compare/v1.32.0...v1.32.1) (2023-12-11)


### Bug Fixes

* don't show loading state when empty completer array is provided ([7a8a929](https://github.com/ajaxorg/ace/commit/7a8a92933b3fde75907612d106643d28efa2d776))
* prevent browser scroll while scrolling over the tooltip ([#5414](https://github.com/ajaxorg/ace/issues/5414)) ([c6475c0](https://github.com/ajaxorg/ace/commit/c6475c00bcfa49dde37ef9de06ebba82ba5ba15d))
* switch aria-selected to aria-current for webkit ([#5416](https://github.com/ajaxorg/ace/issues/5416)) ([bf1a4ea](https://github.com/ajaxorg/ace/commit/bf1a4ea607ed09b5a299390dd2daa5c1d0019e00)), closes [#5403](https://github.com/ajaxorg/ace/issues/5403)
* yaml worker errors at undefined row/column ([06cc12a](https://github.com/ajaxorg/ace/commit/06cc12aad98176d931a1c1cf9a701f4ac0c33de5))

## [1.32.0](https://github.com/ajaxorg/ace/compare/v1.31.2...v1.32.0) (2023-11-30)


Expand Down
1 change: 1 addition & 0 deletions css/ace.css
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ letter-spacing: normal;
pointer-events: none;
overflow: auto;
max-width: min(60em, 66vw);
overscroll-behavior: contain;
}
.ace_tooltip pre {
white-space: pre-wrap;
Expand Down
85 changes: 52 additions & 33 deletions demo/kitchen-sink/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3546,7 +3546,8 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
var Editor = require("./editor").Editor;
var Renderer = require("./virtual_renderer").VirtualRenderer;
var EditSession = require("./edit_session").EditSession;
var Split = function (container, theme, splits) {
var Split;
Split = function (container, theme, splits) {
this.BELOW = 1;
this.BESIDE = 0;
this.$container = container;
Expand Down Expand Up @@ -4227,6 +4228,9 @@ var userAgent = require("./../lib/useragent");
var getAriaId = function (index) {
return "suggest-aria-id:".concat(index);
};
var popupAriaRole = userAgent.isSafari ? "menu" : "listbox";
var optionAriaRole = userAgent.isSafari ? "menuitem" : "option";
var ariaActiveState = userAgent.isSafari ? "aria-current" : "aria-selected";
var $singleLineEditor = function (el) {
var renderer = new Renderer(el);
renderer.$maxLines = 4;
Expand All @@ -4242,14 +4246,14 @@ var $singleLineEditor = function (el) {
var AcePopup = /** @class */ (function () {
function AcePopup(parentNode) {
var el = dom.createElement("div");
var popup = new $singleLineEditor(el);
var popup = $singleLineEditor(el);
if (parentNode) {
parentNode.appendChild(el);
}
el.style.display = "none";
popup.renderer.content.style.cursor = "default";
popup.renderer.setStyle("ace_autocomplete");
popup.renderer.$textLayer.element.setAttribute("role", userAgent.isSafari ? "menu" : "listbox");
popup.renderer.$textLayer.element.setAttribute("role", popupAriaRole);
popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("Autocomplete suggestions"));
popup.renderer.$textLayer.element.setAttribute("aria-label", nls("Autocomplete suggestions"));
popup.renderer.textarea.setAttribute("aria-hidden", "true");
Expand All @@ -4259,7 +4263,7 @@ var AcePopup = /** @class */ (function () {
popup.focus = noop;
popup.$isFocused = true;
popup.renderer.$cursorLayer.restartTimer = noop;
popup.renderer.$cursorLayer.element.style.opacity = 0;
popup.renderer.$cursorLayer.element.style.opacity = "0";
popup.renderer.$maxLines = 8;
popup.renderer.$keepTextAreaAtCursor = false;
popup.setHighlightActiveLine(false);
Expand Down Expand Up @@ -4320,7 +4324,7 @@ var AcePopup = /** @class */ (function () {
if (selected !== t.selectedNode && t.selectedNode) {
dom.removeCssClass(t.selectedNode, "ace_selected");
el.removeAttribute("aria-activedescendant");
selected.removeAttribute("aria-selected");
selected.removeAttribute(ariaActiveState);
t.selectedNode.removeAttribute("id");
}
t.selectedNode = selected;
Expand All @@ -4330,13 +4334,13 @@ var AcePopup = /** @class */ (function () {
selected.id = ariaId;
t.element.setAttribute("aria-activedescendant", ariaId);
el.setAttribute("aria-activedescendant", ariaId);
selected.setAttribute("role", userAgent.isSafari ? "menuitem" : "option");
selected.setAttribute("role", optionAriaRole);
selected.setAttribute("aria-roledescription", nls("item"));
selected.setAttribute("aria-label", popup.getData(row).value);
selected.setAttribute("aria-setsize", popup.data.length);
selected.setAttribute("aria-posinset", row + 1);
selected.setAttribute("aria-describedby", "doc-tooltip");
selected.setAttribute("aria-selected", "true");
selected.setAttribute(ariaActiveState, "true");
}
});
var hideHoverMarker = function () { setHoverMarker(-1); };
Expand Down Expand Up @@ -4650,7 +4654,7 @@ var SnippetManager = /** @class */ (function () {
this.variables = VARIABLES;
}
SnippetManager.prototype.getTokenizer = function () {
return SnippetManager.$tokenizer || this.createTokenizer();
return SnippetManager["$tokenizer"] || this.createTokenizer();
};
SnippetManager.prototype.createTokenizer = function () {
function TabstopToken(str) {
Expand All @@ -4673,7 +4677,7 @@ var SnippetManager = /** @class */ (function () {
},
next: "formatString"
};
SnippetManager.$tokenizer = new Tokenizer({
SnippetManager["$tokenizer"] = new Tokenizer({
start: [
{ regex: /\\./, onMatch: function (val, state, stack) {
var ch = val[1];
Expand Down Expand Up @@ -4770,7 +4774,7 @@ var SnippetManager = /** @class */ (function () {
{ regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString" }
]
});
return SnippetManager.$tokenizer;
return SnippetManager["$tokenizer"];
};
SnippetManager.prototype.tokenizeTmSnippet = function (str, startState) {
return this.getTokenizer().getLineTokens(str, startState).tokens.map(function (x) {
Expand Down Expand Up @@ -5092,7 +5096,7 @@ var SnippetManager = /** @class */ (function () {
};
SnippetManager.prototype.parseSnippetFile = function (str) {
str = str.replace(/\r/g, "");
var list = [], snippet = {};
var list = [], /**@type{Snippet}*/ snippet = {};
var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;
var m;
while (m = re.exec(str)) {
Expand Down Expand Up @@ -5537,8 +5541,8 @@ var AceInlineScreenReader = /** @class */ (function () {
this.editor.container.appendChild(this.screenReaderDiv);
}
AceInlineScreenReader.prototype.setScreenReaderContent = function (content) {
if (!this.popup && this.editor.completer && this.editor.completer.popup) {
this.popup = this.editor.completer.popup;
if (!this.popup && this.editor.completer && /**@type{import("../autocomplete").Autocomplete}*/ (this.editor.completer).popup) {
this.popup = /**@type{import("../autocomplete").Autocomplete}*/ (this.editor.completer).popup;
this.popup.renderer.on("afterRender", function () {
var row = this.popup.getRow();
var t = this.popup.renderer.$textLayer;
Expand Down Expand Up @@ -5707,7 +5711,7 @@ exports.triggerAutocomplete = function (editor) {

});

define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event"], function(require, exports, module){"use strict";
define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"], function(require, exports, module){"use strict";
var HashHandler = require("./keyboard/hash_handler").HashHandler;
var AcePopup = require("./autocomplete/popup").AcePopup;
var AceInline = require("./autocomplete/inline").AceInline;
Expand All @@ -5718,6 +5722,7 @@ var dom = require("./lib/dom");
var snippetManager = require("./snippets").snippetManager;
var config = require("./config");
var event = require("./lib/event");
var preventParentScroll = require("./lib/scroll").preventParentScroll;
var destroyCompleter = function (e, editor) {
editor.completer && editor.completer.destroy();
};
Expand Down Expand Up @@ -5748,9 +5753,9 @@ var Autocomplete = /** @class */ (function () {
this.stickySelectionTimer = lang.delayedCall(function () {
this.stickySelection = true;
}.bind(this), this.stickySelectionDelay);
this.$firstOpenTimer = lang.delayedCall(function () {
this.$firstOpenTimer = lang.delayedCall(/**@this{Autocomplete}*/ function () {
var initialPosition = this.completionProvider && this.completionProvider.initialPosition;
if (this.autoShown || (this.popup && this.popup.isOpen) || !initialPosition)
if (this.autoShown || (this.popup && this.popup.isOpen) || !initialPosition || this.editor.completers.length === 0)
return;
this.completions = new FilteredList(Autocomplete.completionsForLoading);
this.openPopup(this.editor, initialPosition.prefix, false);
Expand Down Expand Up @@ -6076,7 +6081,8 @@ var Autocomplete = /** @class */ (function () {
this.getCompletionProvider({
prefix: prefix,
pos: pos
}).provideCompletions(this.editor, completionOptions, function (err, completions, finished) {
}).provideCompletions(this.editor, completionOptions,
function (err, completions, finished) {
var filtered = completions.filtered;
var prefix = util.getCompletionPrefix(this.editor);
this.$firstOpenTimer.cancel();
Expand All @@ -6089,15 +6095,17 @@ var Autocomplete = /** @class */ (function () {
var completionsForEmpty = [{
caption: emptyMessage,
value: ""
}];
}
];
this.completions = new FilteredList(completionsForEmpty);
this.openPopup(this.editor, prefix, keepPopupPosition);
this.popup.renderer.setStyle("ace_loading", false);
return;
}
return this.detach();
}
if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet)
if (filtered.length == 1 && filtered[0].value == prefix
&& !filtered[0].snippet)
return this.detach();
if (this.autoInsert && !this.autoShown && filtered.length == 1)
return this.insertMatch(filtered[0]);
Expand Down Expand Up @@ -6141,14 +6149,15 @@ var Autocomplete = /** @class */ (function () {
Autocomplete.prototype.showDocTooltip = function (item) {
if (!this.tooltipNode) {
this.tooltipNode = dom.createElement("div");
this.tooltipNode.style.margin = 0;
this.tooltipNode.style.margin = "0";
this.tooltipNode.style.pointerEvents = "auto";
this.tooltipNode.style.overscrollBehavior = "contain";
this.tooltipNode.tabIndex = -1;
this.tooltipNode.onblur = this.blurListener.bind(this);
this.tooltipNode.onclick = this.onTooltipClick.bind(this);
this.tooltipNode.id = "doc-tooltip";
this.tooltipNode.setAttribute("role", "tooltip");
this.tooltipNode.addEventListener("wheel", event.stopPropagation);
this.tooltipNode.addEventListener("wheel", preventParentScroll);
}
var theme = this.editor.renderer.theme;
this.tooltipNode.className = "ace_tooltip ace_doc-tooltip " +
Expand Down Expand Up @@ -6257,9 +6266,9 @@ Autocomplete.for = function (editor) {
editor.completer = null;
}
if (config.get("sharedPopups")) {
if (!Autocomplete.$sharedInstance)
Autocomplete.$sharedInstance = new Autocomplete();
editor.completer = Autocomplete.$sharedInstance;
if (!Autocomplete["$sharedInstance"])
Autocomplete["$sharedInstance"] = new Autocomplete();
editor.completer = Autocomplete["$sharedInstance"];
}
else {
editor.completer = new Autocomplete();
Expand Down Expand Up @@ -6553,7 +6562,7 @@ var AceEmmetEditor = /** @class */ (function () {
this.ace = editor;
this.indentation = editor.session.getTabString();
if (!emmet)
emmet = window.emmet;
emmet = window["emmet"];
var resources = emmet.resources || emmet.require("resources");
resources.setVariable("indentation", this.indentation);
this.$syntax = null;
Expand Down Expand Up @@ -7174,7 +7183,8 @@ var CommandBarTooltip = /** @class */ (function () {
if (!registerForMainTooltip && !this.elements[MORE_OPTIONS_BUTTON_ID]) {
this.$createCommand(MORE_OPTIONS_BUTTON_ID, {
name: "···",
exec: function () {
exec:
function () {
this.$shouldHideMoreOptions = false;
this.$setMoreOptionsVisibility(!this.isMoreOptionsShown());
}.bind(this),
Expand Down Expand Up @@ -7358,7 +7368,8 @@ var CommandBarTooltip = /** @class */ (function () {
}
dom.buildDom(['div', { class: [BUTTON_CLASS_NAME, command.cssClass || ""].join(" "), ref: id }, buttonNode], parentEl, this.elements);
this.commands[id] = command;
var eventListener = function (e) {
var eventListener =
function (e) {
if (this.editor) {
this.editor.focus();
}
Expand Down Expand Up @@ -7721,7 +7732,8 @@ var InlineAutocomplete = /** @class */ (function () {
prefix: prefix,
base: this.base,
pos: pos
}).provideCompletions(this.editor, options, function (err, completions, finished) {
}).provideCompletions(this.editor, options,
function (err, completions, finished) {
var filtered = completions.filtered;
var prefix = util.getCompletionPrefix(this.editor);
if (finished) {
Expand Down Expand Up @@ -7768,6 +7780,8 @@ var InlineAutocomplete = /** @class */ (function () {
}
this.inlineTooltip = this.editor = this.inlineRenderer = null;
};
InlineAutocomplete.prototype.updateDocTooltip = function () {
};
return InlineAutocomplete;
}());
InlineAutocomplete.prototype.commands = {
Expand All @@ -7789,7 +7803,7 @@ InlineAutocomplete.prototype.commands = {
bindKey: { win: "Tab|Ctrl-Right", mac: "Tab|Cmd-Right" },
name: "Accept",
exec: function (editor) {
return editor.completer.insertMatch();
return /**@type{InlineAutocomplete}*/ (editor.completer).insertMatch();
}
},
"Close": {
Expand Down Expand Up @@ -7838,25 +7852,30 @@ require("../config").defineOptions(Editor.prototype, "editor", {
});
InlineAutocomplete.createInlineTooltip = function (parentEl) {
var inlineTooltip = new CommandBarTooltip(parentEl);
inlineTooltip.registerCommand("Previous", Object.assign({}, InlineAutocomplete.prototype.commands["Previous"], {
inlineTooltip.registerCommand("Previous",
Object.assign({}, InlineAutocomplete.prototype.commands["Previous"], {
enabled: true,
type: "button",
iconCssClass: "ace_arrow_rotated"
}));
inlineTooltip.registerCommand("Position", {
enabled: false,
getValue: function (editor) {
return editor ? [editor.completer.getIndex() + 1, editor.completer.getLength()].join("/") : "";
return editor ? [
(editor.completer).getIndex() + 1, /**@type{InlineAutocomplete}*/ (editor.completer).getLength()
].join("/") : "";
},
type: "text",
cssClass: "completion_position"
});
inlineTooltip.registerCommand("Next", Object.assign({}, InlineAutocomplete.prototype.commands["Next"], {
inlineTooltip.registerCommand("Next",
Object.assign({}, InlineAutocomplete.prototype.commands["Next"], {
enabled: true,
type: "button",
iconCssClass: "ace_arrow"
}));
inlineTooltip.registerCommand("Accept", Object.assign({}, InlineAutocomplete.prototype.commands["Accept"], {
inlineTooltip.registerCommand("Accept",
Object.assign({}, InlineAutocomplete.prototype.commands["Accept"], {
enabled: function (editor) {
return !!editor && editor.completer.getIndex() >= 0;
},
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.32.0",
"version": "1.32.1",
"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.

Loading

0 comments on commit e515d12

Please sign in to comment.