@convergence/ace-collab-ext
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -8,4 +8,2 @@ "use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -112,3 +110,3 @@ | ||
* Sets the location of the cursor marker. | ||
* @param position The row / column coordinate of the cursor marker. | ||
* @param position The position of cursor marker. | ||
*/ | ||
@@ -188,7 +186,5 @@ | ||
value: function _convertPosition(position) { | ||
var type = _typeof(position); | ||
if (position === null) { | ||
return null; | ||
} else if (type === "number") { | ||
} else if (typeof position === "number") { | ||
return this._session.getDocument().indexToPosition(position, 0); | ||
@@ -195,0 +191,0 @@ } else if (typeof position.row === "number" && typeof position.column === "number") { |
@@ -60,3 +60,3 @@ "use strict"; | ||
* @param position | ||
* A 2D-position indicating the location of the cusror in row column format e.g. {row: 0, column: 10} | ||
* A 2-d position or linear index indicating the location of the cursor. | ||
*/ | ||
@@ -83,3 +83,3 @@ | ||
* @param position | ||
* A 2-d position indicating the location of the cusror in row column format e.g. {row: 0, column: 10} | ||
* A 2-d position or linear index indicating the location of the cursor. | ||
*/ | ||
@@ -86,0 +86,0 @@ |
{ | ||
"name": "@convergence/ace-collab-ext", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"title": "Ace Editor Collaborative Extensions", | ||
@@ -51,2 +51,3 @@ "description": "Collaborative Extensions for the Ace Editor", | ||
"gulp-header": "1.8.8", | ||
"gulp-insert": "^0.5.0", | ||
"gulp-rename": "1.2.2", | ||
@@ -56,5 +57,4 @@ "gulp-sourcemaps": "1.6.0", | ||
"gulp-uglify": "2.0.0", | ||
"mkdirp": "0.5.1", | ||
"ts-loader": "4.2.0", | ||
"tslint": "5.9.1", | ||
"ts-loader": "4.2.0", | ||
"typescript": "2.8.3", | ||
@@ -61,0 +61,0 @@ "webpack": "4.6.0", |
@@ -21,3 +21,3 @@ import * as ace from "brace"; | ||
*/ | ||
constructor(session: ace.IEditSession, cursorId: string, label: string, color: string, position: ace.Position); | ||
constructor(session: ace.IEditSession, cursorId: string, label: string, color: string, position: number | ace.Position); | ||
/** | ||
@@ -34,5 +34,5 @@ * Called by Ace to update the rendering of the marker. | ||
* Sets the location of the cursor marker. | ||
* @param position The row / column coordinate of the cursor marker. | ||
* @param position The position of cursor marker. | ||
*/ | ||
setPosition(position: ace.Position): void; | ||
setPosition(position: number | ace.Position): void; | ||
/** | ||
@@ -39,0 +39,0 @@ * Sets the marker to visible / invisible. |
@@ -29,5 +29,5 @@ import * as ace from "brace"; | ||
* @param position | ||
* A 2D-position indicating the location of the cusror in row column format e.g. {row: 0, column: 10} | ||
* A 2-d position or linear index indicating the location of the cursor. | ||
*/ | ||
addCursor(id: string, label: string, color: string, position: ace.Position): void; | ||
addCursor(id: string, label: string, color: string, position: number | ace.Position): void; | ||
/** | ||
@@ -39,5 +39,5 @@ * Updates the selection for a particular user. | ||
* @param position | ||
* A 2-d position indicating the location of the cusror in row column format e.g. {row: 0, column: 10} | ||
* A 2-d position or linear index indicating the location of the cursor. | ||
*/ | ||
setCursor(id: string, position: ace.Position): void; | ||
setCursor(id: string, position: number | ace.Position): void; | ||
/** | ||
@@ -44,0 +44,0 @@ * Clears the cursor (but does not remove it) for the specified user. |
@@ -6,1 +6,3 @@ export * from "./AceMultiSelectionManager"; | ||
export * from "./AceViewportUtil"; | ||
export as namespace AceCollabExt; |
/**! | ||
© 2016-2018 Convergence Labs, Inc. | ||
@version 0.2.0 | ||
@version 0.2.1 | ||
@license MIT | ||
@@ -390,3 +390,3 @@ */ | ||
* Sets the location of the cursor marker. | ||
* @param position The row / column coordinate of the cursor marker. | ||
* @param position The position of cursor marker. | ||
*/ | ||
@@ -442,7 +442,6 @@ AceCursorMarker.prototype.setPosition = function (position) { | ||
AceCursorMarker.prototype._convertPosition = function (position) { | ||
var type = typeof position; | ||
if (position === null) { | ||
return null; | ||
} | ||
else if (type === "number") { | ||
else if (typeof position === "number") { | ||
return this._session.getDocument().indexToPosition(position, 0); | ||
@@ -496,3 +495,3 @@ } | ||
* @param position | ||
* A 2D-position indicating the location of the cusror in row column format e.g. {row: 0, column: 10} | ||
* A 2-d position or linear index indicating the location of the cursor. | ||
*/ | ||
@@ -513,3 +512,3 @@ AceMultiCursorManager.prototype.addCursor = function (id, label, color, position) { | ||
* @param position | ||
* A 2-d position indicating the location of the cusror in row column format e.g. {row: 0, column: 10} | ||
* A 2-d position or linear index indicating the location of the cursor. | ||
*/ | ||
@@ -516,0 +515,0 @@ AceMultiCursorManager.prototype.setCursor = function (id, position) { |
/**! | ||
© 2016-2018 Convergence Labs, Inc. | ||
@version 0.2.0 | ||
@version 0.2.1 | ||
@license MIT | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("ace")):"function"==typeof define&&define.amd?define("AceCollabExt",["ace"],e):"object"==typeof exports?exports.AceCollabExt=e(require("ace")):t.AceCollabExt=e(t.ace)}(window,function(t){return function(t){function e(i){if(o[i])return o[i].exports;var r=o[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,i){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:i})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=9)}([function(t,e,o){"use strict";e.__esModule=!0;var i=function(){function t(){}return t.getVisibleIndexRange=function(t){var e=t.getFirstVisibleRow(),o=t.getLastVisibleRow();t.isRowFullyVisible(e)||e++,t.isRowFullyVisible(o)||o--;var i=t.getSession().getDocument().positionToIndex({row:e,column:0},0),r=t.getSession().getDocument().positionToIndex({row:o,column:0},0);return{start:i,end:r}},t.indicesToRows=function(t,e,o){var i=t.getSession().getDocument().indexToPosition(e,0).row,r=t.getSession().getDocument().indexToPosition(o,0).row;return{start:i,end:r}},t}();e.AceViewportUtil=i},function(t,e,o){"use strict";function i(t){return void 0!==t&&null!==t}e.__esModule=!0;var r=function(){function t(t,e,o,i,r){var n=this;this._label=t,this._color=e,this._viewRows=o,this._cursorRow=i,this._editor=r,this._docLineCount=r.getSession().getLength(),this._editorListener=function(){var t=n._editor.getSession().getLength();t!==n._docLineCount&&(n._docLineCount=t,n.update())},this._editor.on("change",this._editorListener),this._scrollElement=document.createElement("div"),this._scrollElement.className="ace-radar-view-scroll-indicator",this._scrollElement.style.borderColor=this._color,this._scrollElement.style.background=this._color,this._scrollElement.title=this._label,this._scrollElement.addEventListener("click",function(){var t=(n._viewRows.end-n._viewRows.start)/2+n._viewRows.start;n._editor.scrollToLine(t,!0,!1,function(){})},!1),this._cursorElement=document.createElement("div"),this._cursorElement.className="ace-radar-view-cursor-indicator",this._cursorElement.style.background=this._color,this._cursorElement.title=this._label,this._cursorElement.addEventListener("click",function(){n._editor.scrollToLine(n._cursorRow,!0,!1,function(){})},!1),this._wrapper=document.createElement("div"),this._wrapper.className="ace-radar-view-wrapper",this._wrapper.style.display="none",this._wrapper.appendChild(this._scrollElement),this._wrapper.appendChild(this._cursorElement)}return t.prototype.element=function(){return this._wrapper},t.prototype.setCursorRow=function(t){this._cursorRow=t,this.update()},t.prototype.setViewRows=function(t){this._viewRows=t,this.update()},t.prototype.update=function(){if(i(this._viewRows)||i(this._cursorRow)){this._wrapper.style.display=null;var t=this._docLineCount-1;if(i(this._viewRows)){var e=Math.min(t,this._viewRows.start)/t*100,o=100-Math.min(t,this._viewRows.end)/t*100;this._scrollElement.style.top=e+"%",this._scrollElement.style.bottom=o+"%",this._scrollElement.style.display=null}else this._scrollElement.style.display="none";if(i(this._cursorRow)){var r=Math.min(this._cursorRow,t)/t,n=(this._wrapper.offsetHeight-this._cursorElement.offsetHeight)/this._wrapper.offsetHeight,s=r*n*100;this._cursorElement.style.top=s+"%",this._cursorElement.style.display=null}else this._cursorElement.style.display="none"}else this._wrapper.style.display="none"},t.prototype.dispose=function(){this._wrapper.parentNode.removeChild(this._wrapper),this._editor.off("change",this._editorListener)},t}();e.AceRadarViewIndicator=r},function(t,e,o){"use strict";e.__esModule=!0;var i=o(1),r=function(){function t(t,e){this._container=null,"string"==typeof t?this._container=document.getElementById(t):this._container=t,this._container.style.position="relative",this._views={},this._editor=e}return t.prototype.addView=function(t,e,o,r,n){var s=new i.AceRadarViewIndicator(e,o,r,n,this._editor);this._container.appendChild(s.element()),s.update(),this._views[t]=s},t.prototype.hasView=function(t){return void 0!==this._views[t]},t.prototype.setViewRows=function(t,e){var o=this._views[t];o.setViewRows(e)},t.prototype.setCursorRow=function(t,e){var o=this._views[t];o.setCursorRow(e)},t.prototype.removeView=function(t){var e=this._views[t];e.dispose(),delete this._views[t]},t}();e.AceRadarView=r},function(e,o){e.exports=t},function(t,e,o){"use strict";e.__esModule=!0;var i,r=o(3);i=void 0!==r.acequire?r.acequire("ace/range").Range:r.require("ace/range").Range;var n=function(){function t(){}return t.rangeToJson=function(t){return{start:{row:t.start.row,column:t.start.column},end:{row:t.end.row,column:t.end.column}}},t.jsonToRange=function(t){return new i(t.start.row,t.start.column,t.end.row,t.end.column)},t.rangesToJson=function(e){return e.map(function(e){return t.rangeToJson(e)})},t.jsonToRanges=function(e){return e.map(function(e){return t.jsonToRange(e)})},t.toJson=function(e){return Array.isArray(e)?t.rangesToJson(e):t.rangeToJson(e)},t.fromJson=function(e){return Array.isArray(e)?t.jsonToRanges(e):t.jsonToRange(e)},t}();e.AceRangeUtil=n},function(t,e,o){"use strict";e.__esModule=!0;var i=function(){function t(t,e,o,i,r){this._session=t,this._label=o,this._color=i,this._position=r?this._convertPosition(r):null,this._cursorId=e,this._id=null,this._visible=!1}return t.prototype.update=function(t,e,o,i){if(null!==this._position){var r=this._session.documentToScreenPosition(this._position.row,this._position.column),n=e.$getTop(r.row,i),s=e.$padding+r.column*i.characterWidth,c=i.lineHeight;t.push('<div class="ace-multi-cursor ace_start" style="',"height: "+(c-3)+"px;","width: 2px;","top: "+(n+2)+"px;","left: "+s+"px;","background-color: "+this._color+";",'"></div>'),t.push('<div class="ace-multi-cursor ace_start" style="',"height: 5px;","width: 6px;","top: "+(n-2)+"px;","left: "+(s-2)+"px;","background-color: "+this._color+";",'"></div>')}},t.prototype.setPosition=function(t){this._position=this._convertPosition(t),this._forceSessionUpdate()},t.prototype.setVisible=function(t){var e=this._visible;this._visible=t,e!==this._visible&&this._forceSessionUpdate()},t.prototype.isVisible=function(){return this._visible},t.prototype.cursorId=function(){return this._cursorId},t.prototype.markerId=function(){return this._id},t.prototype.getLabel=function(){return this._label},t.prototype._forceSessionUpdate=function(){this._session._signal("changeFrontMarker")},t.prototype._convertPosition=function(t){var e=typeof t;if(null===t)return null;if("number"===e)return this._session.getDocument().indexToPosition(t,0);if("number"==typeof t.row&&"number"==typeof t.column)return t;throw new Error("Invalid position: "+t)},t}();e.AceCursorMarker=i},function(t,e,o){"use strict";e.__esModule=!0;var i=o(5),r=function(){function t(t){this._cursors={},this._session=t}return t.prototype.addCursor=function(t,e,o,r){if(void 0!==this._cursors[t])throw new Error("Cursor with id already defined: "+t);var n=new i.AceCursorMarker(this._session,t,e,o,r);this._cursors[t]=n,this._session.addDynamicMarker(n,!0)},t.prototype.setCursor=function(t,e){var o=this._getCursor(t);o.setPosition(e)},t.prototype.clearCursor=function(t){var e=this._getCursor(t);e.setPosition(null)},t.prototype.removeCursor=function(t){var e=this._cursors[t];if(void 0===e)throw new Error("Cursor not found: "+t);this._session.removeMarker(e.id),delete this._cursors[t]},t.prototype.removeAll=function(){var t=this;Object.getOwnPropertyNames(this._cursors).forEach(function(e){t.removeCursor(t._cursors[e].cursorId())})},t.prototype._getCursor=function(t){var e=this._cursors[t];if(void 0===e)throw new Error("Cursor not found: "+t);return e},t}();e.AceMultiCursorManager=r},function(t,e,o){"use strict";e.__esModule=!0;var i=function(){function t(t,e,o,i,r){this._session=t,this._label=o,this._color=i,this._ranges=r||[],this._selectionId=e,this._id=null}return t.prototype.update=function(t,e,o,i){var r=this;this._ranges.forEach(function(n){r._renderRange(t,e,o,i,n)})},t.prototype.setSelection=function(t){void 0===t||null===t?this._ranges=[]:t instanceof Array?this._ranges=t:this._ranges=[t],this._forceSessionUpdate()},t.prototype.selectionId=function(){return this._selectionId},t.prototype.markerId=function(){return this._id},t.prototype._renderRange=function(t,e,o,i,r){var n=r.toScreenRange(o),s=i.lineHeight,c=e.$getTop(n.start.row,i),u=0,l=0,a=e.$padding+n.start.column*i.characterWidth;if(n.isMultiLine()){if(this._renderLine(t,{height:s,right:l,top:c,left:a}),c=e.$getTop(r.end.row,i),u=n.end.column*i.characterWidth,this._renderLine(t,{height:s,width:u,top:c,left:e.$padding}),s=(r.end.row-r.start.row-1)*i.lineHeight,s<0)return;c=e.$getTop(r.start.row+1,i),this._renderLine(t,{height:s,right:l,top:c,left:e.$padding})}else u=(r.end.column-r.start.column)*i.characterWidth,this._renderLine(t,{height:s,width:u,top:c,left:a})},t.prototype._renderLine=function(t,e){t.push('<div title="'+this._label+'" class="ace-multi-selection" style="'),"number"==typeof e.height&&t.push(" height: "+e.height+"px;"),"number"==typeof e.width&&t.push(" width: "+e.width+"px;"),"number"==typeof e.top&&t.push(" top: "+e.top+"px;"),"number"==typeof e.left&&t.push(" left: "+e.left+"px;"),"number"==typeof e.bottom&&t.push(" bottom: "+e.bottom+"px;"),"number"==typeof e.right&&t.push(" right: "+e.right+"px;"),t.push("background-color: "+this._color+'">'),t.push("</div>")},t.prototype._forceSessionUpdate=function(){this._session._signal("changeBackMarker")},t}();e.AceSelectionMarker=i},function(t,e,o){"use strict";e.__esModule=!0;var i=o(7),r=function(){function t(t){this._selections={},this._session=t}return t.prototype.addSelection=function(t,e,o,r){if(void 0!==this._selections[t])throw new Error("Selection with id already defined: "+t);var n=new i.AceSelectionMarker(this._session,t,e,o,r);this._selections[t]=n,this._session.addDynamicMarker(n,!1)},t.prototype.setSelection=function(t,e){var o=this._getSelection(t);o.setSelection(e)},t.prototype.clearSelection=function(t){var e=this._getSelection(t);e.setSelection(null)},t.prototype.removeSelection=function(t){var e=this._selections[t];if(void 0===e)throw new Error("Selection not found: "+t);this._session.removeMarker(e.id),delete this._selections[t]},t.prototype.removeAll=function(){var t=this;Object.getOwnPropertyNames(this._selections).forEach(function(e){t.removeSelection(t._selections[e].selectionId())})},t.prototype._getSelection=function(t){var e=this._selections[t];if(void 0===e)throw new Error("Selection not found: "+t);return e},t}();e.AceMultiSelectionManager=r},function(t,e,o){"use strict";function i(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}e.__esModule=!0,i(o(8)),i(o(6)),i(o(4)),i(o(2)),i(o(0))}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("ace")):"function"==typeof define&&define.amd?define("AceCollabExt",["ace"],e):"object"==typeof exports?exports.AceCollabExt=e(require("ace")):t.AceCollabExt=e(t.ace)}(window,function(t){return function(t){function e(i){if(o[i])return o[i].exports;var r=o[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,i){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:i})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=9)}([function(t,e,o){"use strict";e.__esModule=!0;var i=function(){function t(){}return t.getVisibleIndexRange=function(t){var e=t.getFirstVisibleRow(),o=t.getLastVisibleRow();t.isRowFullyVisible(e)||e++,t.isRowFullyVisible(o)||o--;var i=t.getSession().getDocument().positionToIndex({row:e,column:0},0),r=t.getSession().getDocument().positionToIndex({row:o,column:0},0);return{start:i,end:r}},t.indicesToRows=function(t,e,o){var i=t.getSession().getDocument().indexToPosition(e,0).row,r=t.getSession().getDocument().indexToPosition(o,0).row;return{start:i,end:r}},t}();e.AceViewportUtil=i},function(t,e,o){"use strict";function i(t){return void 0!==t&&null!==t}e.__esModule=!0;var r=function(){function t(t,e,o,i,r){var n=this;this._label=t,this._color=e,this._viewRows=o,this._cursorRow=i,this._editor=r,this._docLineCount=r.getSession().getLength(),this._editorListener=function(){var t=n._editor.getSession().getLength();t!==n._docLineCount&&(n._docLineCount=t,n.update())},this._editor.on("change",this._editorListener),this._scrollElement=document.createElement("div"),this._scrollElement.className="ace-radar-view-scroll-indicator",this._scrollElement.style.borderColor=this._color,this._scrollElement.style.background=this._color,this._scrollElement.title=this._label,this._scrollElement.addEventListener("click",function(){var t=(n._viewRows.end-n._viewRows.start)/2+n._viewRows.start;n._editor.scrollToLine(t,!0,!1,function(){})},!1),this._cursorElement=document.createElement("div"),this._cursorElement.className="ace-radar-view-cursor-indicator",this._cursorElement.style.background=this._color,this._cursorElement.title=this._label,this._cursorElement.addEventListener("click",function(){n._editor.scrollToLine(n._cursorRow,!0,!1,function(){})},!1),this._wrapper=document.createElement("div"),this._wrapper.className="ace-radar-view-wrapper",this._wrapper.style.display="none",this._wrapper.appendChild(this._scrollElement),this._wrapper.appendChild(this._cursorElement)}return t.prototype.element=function(){return this._wrapper},t.prototype.setCursorRow=function(t){this._cursorRow=t,this.update()},t.prototype.setViewRows=function(t){this._viewRows=t,this.update()},t.prototype.update=function(){if(i(this._viewRows)||i(this._cursorRow)){this._wrapper.style.display=null;var t=this._docLineCount-1;if(i(this._viewRows)){var e=Math.min(t,this._viewRows.start)/t*100,o=100-Math.min(t,this._viewRows.end)/t*100;this._scrollElement.style.top=e+"%",this._scrollElement.style.bottom=o+"%",this._scrollElement.style.display=null}else this._scrollElement.style.display="none";if(i(this._cursorRow)){var r=Math.min(this._cursorRow,t)/t,n=(this._wrapper.offsetHeight-this._cursorElement.offsetHeight)/this._wrapper.offsetHeight,s=r*n*100;this._cursorElement.style.top=s+"%",this._cursorElement.style.display=null}else this._cursorElement.style.display="none"}else this._wrapper.style.display="none"},t.prototype.dispose=function(){this._wrapper.parentNode.removeChild(this._wrapper),this._editor.off("change",this._editorListener)},t}();e.AceRadarViewIndicator=r},function(t,e,o){"use strict";e.__esModule=!0;var i=o(1),r=function(){function t(t,e){this._container=null,"string"==typeof t?this._container=document.getElementById(t):this._container=t,this._container.style.position="relative",this._views={},this._editor=e}return t.prototype.addView=function(t,e,o,r,n){var s=new i.AceRadarViewIndicator(e,o,r,n,this._editor);this._container.appendChild(s.element()),s.update(),this._views[t]=s},t.prototype.hasView=function(t){return void 0!==this._views[t]},t.prototype.setViewRows=function(t,e){var o=this._views[t];o.setViewRows(e)},t.prototype.setCursorRow=function(t,e){var o=this._views[t];o.setCursorRow(e)},t.prototype.removeView=function(t){var e=this._views[t];e.dispose(),delete this._views[t]},t}();e.AceRadarView=r},function(e,o){e.exports=t},function(t,e,o){"use strict";e.__esModule=!0;var i,r=o(3);i=void 0!==r.acequire?r.acequire("ace/range").Range:r.require("ace/range").Range;var n=function(){function t(){}return t.rangeToJson=function(t){return{start:{row:t.start.row,column:t.start.column},end:{row:t.end.row,column:t.end.column}}},t.jsonToRange=function(t){return new i(t.start.row,t.start.column,t.end.row,t.end.column)},t.rangesToJson=function(e){return e.map(function(e){return t.rangeToJson(e)})},t.jsonToRanges=function(e){return e.map(function(e){return t.jsonToRange(e)})},t.toJson=function(e){return Array.isArray(e)?t.rangesToJson(e):t.rangeToJson(e)},t.fromJson=function(e){return Array.isArray(e)?t.jsonToRanges(e):t.jsonToRange(e)},t}();e.AceRangeUtil=n},function(t,e,o){"use strict";e.__esModule=!0;var i=function(){function t(t,e,o,i,r){this._session=t,this._label=o,this._color=i,this._position=r?this._convertPosition(r):null,this._cursorId=e,this._id=null,this._visible=!1}return t.prototype.update=function(t,e,o,i){if(null!==this._position){var r=this._session.documentToScreenPosition(this._position.row,this._position.column),n=e.$getTop(r.row,i),s=e.$padding+r.column*i.characterWidth,c=i.lineHeight;t.push('<div class="ace-multi-cursor ace_start" style="',"height: "+(c-3)+"px;","width: 2px;","top: "+(n+2)+"px;","left: "+s+"px;","background-color: "+this._color+";",'"></div>'),t.push('<div class="ace-multi-cursor ace_start" style="',"height: 5px;","width: 6px;","top: "+(n-2)+"px;","left: "+(s-2)+"px;","background-color: "+this._color+";",'"></div>')}},t.prototype.setPosition=function(t){this._position=this._convertPosition(t),this._forceSessionUpdate()},t.prototype.setVisible=function(t){var e=this._visible;this._visible=t,e!==this._visible&&this._forceSessionUpdate()},t.prototype.isVisible=function(){return this._visible},t.prototype.cursorId=function(){return this._cursorId},t.prototype.markerId=function(){return this._id},t.prototype.getLabel=function(){return this._label},t.prototype._forceSessionUpdate=function(){this._session._signal("changeFrontMarker")},t.prototype._convertPosition=function(t){if(null===t)return null;if("number"==typeof t)return this._session.getDocument().indexToPosition(t,0);if("number"==typeof t.row&&"number"==typeof t.column)return t;throw new Error("Invalid position: "+t)},t}();e.AceCursorMarker=i},function(t,e,o){"use strict";e.__esModule=!0;var i=o(5),r=function(){function t(t){this._cursors={},this._session=t}return t.prototype.addCursor=function(t,e,o,r){if(void 0!==this._cursors[t])throw new Error("Cursor with id already defined: "+t);var n=new i.AceCursorMarker(this._session,t,e,o,r);this._cursors[t]=n,this._session.addDynamicMarker(n,!0)},t.prototype.setCursor=function(t,e){var o=this._getCursor(t);o.setPosition(e)},t.prototype.clearCursor=function(t){var e=this._getCursor(t);e.setPosition(null)},t.prototype.removeCursor=function(t){var e=this._cursors[t];if(void 0===e)throw new Error("Cursor not found: "+t);this._session.removeMarker(e.id),delete this._cursors[t]},t.prototype.removeAll=function(){var t=this;Object.getOwnPropertyNames(this._cursors).forEach(function(e){t.removeCursor(t._cursors[e].cursorId())})},t.prototype._getCursor=function(t){var e=this._cursors[t];if(void 0===e)throw new Error("Cursor not found: "+t);return e},t}();e.AceMultiCursorManager=r},function(t,e,o){"use strict";e.__esModule=!0;var i=function(){function t(t,e,o,i,r){this._session=t,this._label=o,this._color=i,this._ranges=r||[],this._selectionId=e,this._id=null}return t.prototype.update=function(t,e,o,i){var r=this;this._ranges.forEach(function(n){r._renderRange(t,e,o,i,n)})},t.prototype.setSelection=function(t){void 0===t||null===t?this._ranges=[]:t instanceof Array?this._ranges=t:this._ranges=[t],this._forceSessionUpdate()},t.prototype.selectionId=function(){return this._selectionId},t.prototype.markerId=function(){return this._id},t.prototype._renderRange=function(t,e,o,i,r){var n=r.toScreenRange(o),s=i.lineHeight,c=e.$getTop(n.start.row,i),u=0,l=0,a=e.$padding+n.start.column*i.characterWidth;if(n.isMultiLine()){if(this._renderLine(t,{height:s,right:l,top:c,left:a}),c=e.$getTop(r.end.row,i),u=n.end.column*i.characterWidth,this._renderLine(t,{height:s,width:u,top:c,left:e.$padding}),s=(r.end.row-r.start.row-1)*i.lineHeight,s<0)return;c=e.$getTop(r.start.row+1,i),this._renderLine(t,{height:s,right:l,top:c,left:e.$padding})}else u=(r.end.column-r.start.column)*i.characterWidth,this._renderLine(t,{height:s,width:u,top:c,left:a})},t.prototype._renderLine=function(t,e){t.push('<div title="'+this._label+'" class="ace-multi-selection" style="'),"number"==typeof e.height&&t.push(" height: "+e.height+"px;"),"number"==typeof e.width&&t.push(" width: "+e.width+"px;"),"number"==typeof e.top&&t.push(" top: "+e.top+"px;"),"number"==typeof e.left&&t.push(" left: "+e.left+"px;"),"number"==typeof e.bottom&&t.push(" bottom: "+e.bottom+"px;"),"number"==typeof e.right&&t.push(" right: "+e.right+"px;"),t.push("background-color: "+this._color+'">'),t.push("</div>")},t.prototype._forceSessionUpdate=function(){this._session._signal("changeBackMarker")},t}();e.AceSelectionMarker=i},function(t,e,o){"use strict";e.__esModule=!0;var i=o(7),r=function(){function t(t){this._selections={},this._session=t}return t.prototype.addSelection=function(t,e,o,r){if(void 0!==this._selections[t])throw new Error("Selection with id already defined: "+t);var n=new i.AceSelectionMarker(this._session,t,e,o,r);this._selections[t]=n,this._session.addDynamicMarker(n,!1)},t.prototype.setSelection=function(t,e){var o=this._getSelection(t);o.setSelection(e)},t.prototype.clearSelection=function(t){var e=this._getSelection(t);e.setSelection(null)},t.prototype.removeSelection=function(t){var e=this._selections[t];if(void 0===e)throw new Error("Selection not found: "+t);this._session.removeMarker(e.id),delete this._selections[t]},t.prototype.removeAll=function(){var t=this;Object.getOwnPropertyNames(this._selections).forEach(function(e){t.removeSelection(t._selections[e].selectionId())})},t.prototype._getSelection=function(t){var e=this._selections[t];if(void 0===e)throw new Error("Selection not found: "+t);return e},t}();e.AceMultiSelectionManager=r},function(t,e,o){"use strict";function i(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}e.__esModule=!0,i(o(8)),i(o(6)),i(o(4)),i(o(2)),i(o(0))}])}); | ||
//# sourceMappingURL=ace-collab-ext.min.js.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
136500
2150