Skip to content

Commit

Permalink
package 06.01.25
Browse files Browse the repository at this point in the history
  • Loading branch information
nlujjawal committed Jan 6, 2025
1 parent da6219a commit 54bbe25
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 319 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.37.2](https://github.com/ajaxorg/ace/compare/v1.37.1...v1.37.2) (2025-01-06)


### Bug Fixes

* fix return type of supportsFile modelist ([#5705](https://github.com/ajaxorg/ace/issues/5705)) ([de21d50](https://github.com/ajaxorg/ace/commit/de21d50656bd874e1626265b8853923cb8da7c8b))

### [1.37.1](https://github.com/ajaxorg/ace/compare/v1.37.0...v1.37.1) (2024-12-20)


Expand Down
2 changes: 1 addition & 1 deletion ace.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ declare module "ace-builds" {
import { Range } from "ace-builds-internal/range";
import { UndoManager } from "ace-builds-internal/undomanager";
import { VirtualRenderer as Renderer } from "ace-builds-internal/virtual_renderer";
export var version: "1.37.1";
export var version: "1.37.2";
export { Range, Editor, EditSession, UndoManager, Renderer as VirtualRenderer };
}

Expand Down
2 changes: 1 addition & 1 deletion demo/emmet.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<pre id="editor"></pre>

<!-- load emmet code and snippets compiled for browser -->
<script src="https://cloud9ide.github.io/emmet-core/emmet.js"></script>
<!-- <script src="..."></script> -->

<!-- load ace -->
<script src="../src/ace.js"></script>
Expand Down
311 changes: 1 addition & 310 deletions demo/kitchen-sink/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6595,308 +6595,6 @@ exports.StatusBar = StatusBar;

});

define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","ace/config","resources","resources","tabStops","resources","utils","actions"], function(require, exports, module){"use strict";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var Editor = require("../editor").Editor;
var snippetManager = require("../snippets").snippetManager;
var Range = require("../range").Range;
var config = require("../config");
var emmet, emmetPath;
var AceEmmetEditor = /** @class */ (function () {
function AceEmmetEditor() {
}
AceEmmetEditor.prototype.setupContext = function (editor) {
this.ace = editor;
this.indentation = editor.session.getTabString();
if (!emmet)
emmet = window["emmet"];
var resources = emmet.resources || emmet.require("resources");
resources.setVariable("indentation", this.indentation);
this.$syntax = null;
this.$syntax = this.getSyntax();
};
AceEmmetEditor.prototype.getSelectionRange = function () {
var range = this.ace.getSelectionRange();
var doc = this.ace.session.doc;
return {
start: doc.positionToIndex(range.start),
end: doc.positionToIndex(range.end)
};
};
AceEmmetEditor.prototype.createSelection = function (start, end) {
var doc = this.ace.session.doc;
this.ace.selection.setRange({
start: doc.indexToPosition(start),
end: doc.indexToPosition(end)
});
};
AceEmmetEditor.prototype.getCurrentLineRange = function () {
var ace = this.ace;
var row = ace.getCursorPosition().row;
var lineLength = ace.session.getLine(row).length;
var index = ace.session.doc.positionToIndex({ row: row, column: 0 });
return {
start: index,
end: index + lineLength
};
};
AceEmmetEditor.prototype.getCaretPos = function () {
var pos = this.ace.getCursorPosition();
return this.ace.session.doc.positionToIndex(pos);
};
AceEmmetEditor.prototype.setCaretPos = function (index) {
var pos = this.ace.session.doc.indexToPosition(index);
this.ace.selection.moveToPosition(pos);
};
AceEmmetEditor.prototype.getCurrentLine = function () {
var row = this.ace.getCursorPosition().row;
return this.ace.session.getLine(row);
};
AceEmmetEditor.prototype.replaceContent = function (value, start, end, noIndent) {
if (end == null)
end = start == null ? this.getContent().length : start;
if (start == null)
start = 0;
var editor = this.ace;
var doc = editor.session.doc;
var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end));
editor.session.remove(range);
range.end = range.start;
value = this.$updateTabstops(value);
snippetManager.insertSnippet(editor, value);
};
AceEmmetEditor.prototype.getContent = function () {
return this.ace.getValue();
};
AceEmmetEditor.prototype.getSyntax = function () {
if (this.$syntax)
return this.$syntax;
var syntax = this.ace.session.$modeId.split("/").pop();
if (syntax == "html" || syntax == "php") {
var cursor = this.ace.getCursorPosition();
var state = this.ace.session.getState(cursor.row);
if (typeof state != "string")
state = state[0];
if (state) {
state = state.split("-");
if (state.length > 1)
syntax = state[0];
else if (syntax == "php")
syntax = "html";
}
}
return syntax;
};
AceEmmetEditor.prototype.getProfileName = function () {
var resources = emmet.resources || emmet.require("resources");
switch (this.getSyntax()) {
case "css": return "css";
case "xml":
case "xsl":
return "xml";
case "html":
var profile = resources.getVariable("profile");
if (!profile)
profile = this.ace.session.getLines(0, 2).join("").search(/<!DOCTYPE[^>]+XHTML/i) != -1 ? "xhtml" : "html";
return profile;
default:
var mode = this.ace.session.$mode;
return mode.emmetConfig && mode.emmetConfig.profile || "xhtml";
}
};
AceEmmetEditor.prototype.prompt = function (title) {
return prompt(title); // eslint-disable-line no-alert
};
AceEmmetEditor.prototype.getSelection = function () {
return this.ace.session.getTextRange();
};
AceEmmetEditor.prototype.getFilePath = function () {
return "";
};
AceEmmetEditor.prototype.$updateTabstops = function (value) {
var base = 1000;
var zeroBase = 0;
var lastZero = null;
var ts = emmet.tabStops || emmet.require('tabStops');
var resources = emmet.resources || emmet.require("resources");
var settings = resources.getVocabulary("user");
var tabstopOptions = {
tabstop: function (data) {
var group = parseInt(data.group, 10);
var isZero = group === 0;
if (isZero)
group = ++zeroBase;
else
group += base;
var placeholder = data.placeholder;
if (placeholder) {
placeholder = ts.processText(placeholder, tabstopOptions);
}
var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}';
if (isZero) {
lastZero = [data.start, result];
}
return result;
},
escape: function (ch) {
if (ch == '$')
return '\\$';
if (ch == '\\')
return '\\\\';
return ch;
}
};
value = ts.processText(value, tabstopOptions);
if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) {
value += '${0}';
}
else if (lastZero) {
var common = emmet.utils ? emmet.utils.common : emmet.require('utils');
value = common.replaceSubstring(value, '${0}', lastZero[0], lastZero[1]);
}
return value;
};
return AceEmmetEditor;
}());
var keymap = {
expand_abbreviation: { "mac": "ctrl+alt+e", "win": "alt+e" },
match_pair_outward: { "mac": "ctrl+d", "win": "ctrl+," },
match_pair_inward: { "mac": "ctrl+j", "win": "ctrl+shift+0" },
matching_pair: { "mac": "ctrl+alt+j", "win": "alt+j" },
next_edit_point: "alt+right",
prev_edit_point: "alt+left",
toggle_comment: { "mac": "command+/", "win": "ctrl+/" },
split_join_tag: { "mac": "shift+command+'", "win": "shift+ctrl+`" },
remove_tag: { "mac": "command+'", "win": "shift+ctrl+;" },
evaluate_math_expression: { "mac": "shift+command+y", "win": "shift+ctrl+y" },
increment_number_by_1: "ctrl+up",
decrement_number_by_1: "ctrl+down",
increment_number_by_01: "alt+up",
decrement_number_by_01: "alt+down",
increment_number_by_10: { "mac": "alt+command+up", "win": "shift+alt+up" },
decrement_number_by_10: { "mac": "alt+command+down", "win": "shift+alt+down" },
select_next_item: { "mac": "shift+command+.", "win": "shift+ctrl+." },
select_previous_item: { "mac": "shift+command+,", "win": "shift+ctrl+," },
reflect_css_value: { "mac": "shift+command+r", "win": "shift+ctrl+r" },
encode_decode_data_url: { "mac": "shift+ctrl+d", "win": "ctrl+'" },
expand_abbreviation_with_tab: "Tab",
wrap_with_abbreviation: { "mac": "shift+ctrl+a", "win": "shift+ctrl+a" }
};
var editorProxy = new AceEmmetEditor();
exports.commands = new HashHandler();
exports.runEmmetCommand = function runEmmetCommand(editor) {
if (this.action == "expand_abbreviation_with_tab") {
if (!editor.selection.isEmpty())
return false;
var pos = editor.selection.lead;
var token = editor.session.getTokenAt(pos.row, pos.column);
if (token && /\btag\b/.test(token.type))
return false;
}
try {
editorProxy.setupContext(editor);
var actions = emmet.actions || emmet.require("actions");
if (this.action == "wrap_with_abbreviation") {
return setTimeout(function () {
actions.run("wrap_with_abbreviation", editorProxy);
}, 0);
}
var result = actions.run(this.action, editorProxy);
}
catch (e) {
if (!emmet) {
var loading = exports.load(runEmmetCommand.bind(this, editor));
if (this.action == "expand_abbreviation_with_tab")
return false;
return loading;
}
editor._signal("changeStatus", typeof e == "string" ? e : e.message);
config.warn(e);
result = false;
}
return result;
};
for (var command in keymap) {
exports.commands.addCommand({
name: "emmet:" + command,
action: command,
bindKey: keymap[command],
exec: exports.runEmmetCommand,
multiSelectAction: "forEach"
});
}
exports.updateCommands = function (editor, enabled) {
if (enabled) {
editor.keyBinding.addKeyboardHandler(exports.commands);
}
else {
editor.keyBinding.removeKeyboardHandler(exports.commands);
}
};
exports.isSupportedMode = function (mode) {
if (!mode)
return false;
if (mode.emmetConfig)
return true;
var id = mode.$id || mode;
return /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(id);
};
exports.isAvailable = function (editor, command) {
if (/(evaluate_math_expression|expand_abbreviation)$/.test(command))
return true;
var mode = editor.session.$mode;
var isSupported = exports.isSupportedMode(mode);
if (isSupported && mode.$modes) {
try {
editorProxy.setupContext(editor);
if (/js|php/.test(editorProxy.getSyntax()))
isSupported = false;
}
catch (e) { }
}
return isSupported;
};
var onChangeMode = function (e, target) {
var editor = target;
if (!editor)
return;
var enabled = exports.isSupportedMode(editor.session.$mode);
if (e.enableEmmet === false)
enabled = false;
if (enabled)
exports.load();
exports.updateCommands(editor, enabled);
};
exports.load = function (cb) {
if (typeof emmetPath !== "string") {
config.warn("script for emmet-core is not loaded");
return false;
}
config.loadModule(emmetPath, function () {
emmetPath = null;
cb && cb();
});
return true;
};
exports.AceEmmetEditor = AceEmmetEditor;
config.defineOptions(Editor.prototype, "editor", {
enableEmmet: {
set: function (val) {
this[val ? "on" : "removeListener"]("changeMode", onChangeMode);
onChangeMode({ enableEmmet: !!val }, this);
},
value: true
}
});
exports.setCore = function (e) {
if (typeof e == "string")
emmetPath = e;
else
emmet = e;
};

});

define("ace/autocomplete/text_completer",["require","exports","module","ace/range"], function(require, exports, module){var Range = require("../range").Range;
var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;
function getWordIndex(doc, pos) {
Expand Down Expand Up @@ -8271,7 +7969,7 @@ exports.commands = [{

});

define("kitchen-sink/demo",["require","exports","module","ace/ext/rtl","ace/multi_select","kitchen-sink/inline_editor","kitchen-sink/dev_util","kitchen-sink/file_drop","ace/config","ace/lib/dom","ace/lib/net","ace/lib/lang","ace/lib/event","ace/theme/textmate","ace/edit_session","ace/undomanager","ace/keyboard/hash_handler","ace/virtual_renderer","ace/editor","ace/range","ace/ext/whitespace","kitchen-sink/doclist","kitchen-sink/layout","kitchen-sink/util","ace/ext/elastic_tabstops_lite","ace/incremental_search","kitchen-sink/token_tooltip","ace/config","ace/config","ace/tooltip","ace/marker_group","ace/worker/worker_client","ace/split","ace/ext/options","ace/autocomplete","ace/ext/statusbar","ace/ext/emmet","ace/placeholder","ace/snippets","ace/ext/language_tools","ace/ext/inline_autocomplete","ace/ext/beautify","ace/keyboard/keybinding","ace/commands/command_manager"], function(require, exports, module) {"use strict";
define("kitchen-sink/demo",["require","exports","module","ace/ext/rtl","ace/multi_select","kitchen-sink/inline_editor","kitchen-sink/dev_util","kitchen-sink/file_drop","ace/config","ace/lib/dom","ace/lib/net","ace/lib/lang","ace/lib/event","ace/theme/textmate","ace/edit_session","ace/undomanager","ace/keyboard/hash_handler","ace/virtual_renderer","ace/editor","ace/range","ace/ext/whitespace","kitchen-sink/doclist","kitchen-sink/layout","kitchen-sink/util","ace/ext/elastic_tabstops_lite","ace/incremental_search","kitchen-sink/token_tooltip","ace/config","ace/config","ace/tooltip","ace/marker_group","ace/worker/worker_client","ace/split","ace/ext/options","ace/autocomplete","ace/ext/statusbar","ace/placeholder","ace/snippets","ace/ext/language_tools","ace/ext/inline_autocomplete","ace/ext/beautify","ace/keyboard/keybinding","ace/commands/command_manager"], function(require, exports, module) {"use strict";

require("ace/ext/rtl");

Expand Down Expand Up @@ -8749,13 +8447,6 @@ function synchroniseScrolling() {
var StatusBar = require("ace/ext/statusbar").StatusBar;
new StatusBar(env.editor, cmdLine.container);


var Emmet = require("ace/ext/emmet");
net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
Emmet.setCore(window.emmet);
env.editor.setOption("enableEmmet", true);
});

require("ace/placeholder").PlaceHolder;

var snippetManager = require("ace/snippets").snippetManager;
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.37.1",
"version": "1.37.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/ace.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-noconflict/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ var reportErrorIfPathIsNotConfigured = function () {
reportErrorIfPathIsNotConfigured = function () { };
}
};
exports.version = "1.37.1";
exports.version = "1.37.2";

});

Expand Down
2 changes: 1 addition & 1 deletion src/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ var reportErrorIfPathIsNotConfigured = function () {
reportErrorIfPathIsNotConfigured = function () { };
}
};
exports.version = "1.37.1";
exports.version = "1.37.2";

});

Expand Down
2 changes: 1 addition & 1 deletion types/ace-ext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ declare module "ace-builds/src-noconflict/ext-modelist" {
mode: string;
extensions: string;
extRe: RegExp;
supportsFile(filename: string): RegExpMatchArray;
supportsFile(filename: string): RegExpMatchArray | null;
}
}
declare module "ace-builds/src-noconflict/ext-themelist" {
Expand Down
Loading

0 comments on commit 54bbe25

Please sign in to comment.