@@ -6595,308 +6595,6 @@ exports.StatusBar = StatusBar;
6595
6595
6596
6596
} ) ;
6597
6597
6598
- 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" ;
6599
- var HashHandler = require ( "../keyboard/hash_handler" ) . HashHandler ;
6600
- var Editor = require ( "../editor" ) . Editor ;
6601
- var snippetManager = require ( "../snippets" ) . snippetManager ;
6602
- var Range = require ( "../range" ) . Range ;
6603
- var config = require ( "../config" ) ;
6604
- var emmet , emmetPath ;
6605
- var AceEmmetEditor = /** @class */ ( function ( ) {
6606
- function AceEmmetEditor ( ) {
6607
- }
6608
- AceEmmetEditor . prototype . setupContext = function ( editor ) {
6609
- this . ace = editor ;
6610
- this . indentation = editor . session . getTabString ( ) ;
6611
- if ( ! emmet )
6612
- emmet = window [ "emmet" ] ;
6613
- var resources = emmet . resources || emmet . require ( "resources" ) ;
6614
- resources . setVariable ( "indentation" , this . indentation ) ;
6615
- this . $syntax = null ;
6616
- this . $syntax = this . getSyntax ( ) ;
6617
- } ;
6618
- AceEmmetEditor . prototype . getSelectionRange = function ( ) {
6619
- var range = this . ace . getSelectionRange ( ) ;
6620
- var doc = this . ace . session . doc ;
6621
- return {
6622
- start : doc . positionToIndex ( range . start ) ,
6623
- end : doc . positionToIndex ( range . end )
6624
- } ;
6625
- } ;
6626
- AceEmmetEditor . prototype . createSelection = function ( start , end ) {
6627
- var doc = this . ace . session . doc ;
6628
- this . ace . selection . setRange ( {
6629
- start : doc . indexToPosition ( start ) ,
6630
- end : doc . indexToPosition ( end )
6631
- } ) ;
6632
- } ;
6633
- AceEmmetEditor . prototype . getCurrentLineRange = function ( ) {
6634
- var ace = this . ace ;
6635
- var row = ace . getCursorPosition ( ) . row ;
6636
- var lineLength = ace . session . getLine ( row ) . length ;
6637
- var index = ace . session . doc . positionToIndex ( { row : row , column : 0 } ) ;
6638
- return {
6639
- start : index ,
6640
- end : index + lineLength
6641
- } ;
6642
- } ;
6643
- AceEmmetEditor . prototype . getCaretPos = function ( ) {
6644
- var pos = this . ace . getCursorPosition ( ) ;
6645
- return this . ace . session . doc . positionToIndex ( pos ) ;
6646
- } ;
6647
- AceEmmetEditor . prototype . setCaretPos = function ( index ) {
6648
- var pos = this . ace . session . doc . indexToPosition ( index ) ;
6649
- this . ace . selection . moveToPosition ( pos ) ;
6650
- } ;
6651
- AceEmmetEditor . prototype . getCurrentLine = function ( ) {
6652
- var row = this . ace . getCursorPosition ( ) . row ;
6653
- return this . ace . session . getLine ( row ) ;
6654
- } ;
6655
- AceEmmetEditor . prototype . replaceContent = function ( value , start , end , noIndent ) {
6656
- if ( end == null )
6657
- end = start == null ? this . getContent ( ) . length : start ;
6658
- if ( start == null )
6659
- start = 0 ;
6660
- var editor = this . ace ;
6661
- var doc = editor . session . doc ;
6662
- var range = Range . fromPoints ( doc . indexToPosition ( start ) , doc . indexToPosition ( end ) ) ;
6663
- editor . session . remove ( range ) ;
6664
- range . end = range . start ;
6665
- value = this . $updateTabstops ( value ) ;
6666
- snippetManager . insertSnippet ( editor , value ) ;
6667
- } ;
6668
- AceEmmetEditor . prototype . getContent = function ( ) {
6669
- return this . ace . getValue ( ) ;
6670
- } ;
6671
- AceEmmetEditor . prototype . getSyntax = function ( ) {
6672
- if ( this . $syntax )
6673
- return this . $syntax ;
6674
- var syntax = this . ace . session . $modeId . split ( "/" ) . pop ( ) ;
6675
- if ( syntax == "html" || syntax == "php" ) {
6676
- var cursor = this . ace . getCursorPosition ( ) ;
6677
- var state = this . ace . session . getState ( cursor . row ) ;
6678
- if ( typeof state != "string" )
6679
- state = state [ 0 ] ;
6680
- if ( state ) {
6681
- state = state . split ( "-" ) ;
6682
- if ( state . length > 1 )
6683
- syntax = state [ 0 ] ;
6684
- else if ( syntax == "php" )
6685
- syntax = "html" ;
6686
- }
6687
- }
6688
- return syntax ;
6689
- } ;
6690
- AceEmmetEditor . prototype . getProfileName = function ( ) {
6691
- var resources = emmet . resources || emmet . require ( "resources" ) ;
6692
- switch ( this . getSyntax ( ) ) {
6693
- case "css" : return "css" ;
6694
- case "xml" :
6695
- case "xsl" :
6696
- return "xml" ;
6697
- case "html" :
6698
- var profile = resources . getVariable ( "profile" ) ;
6699
- if ( ! profile )
6700
- profile = this . ace . session . getLines ( 0 , 2 ) . join ( "" ) . search ( / < ! D O C T Y P E [ ^ > ] + X H T M L / i) != - 1 ? "xhtml" : "html" ;
6701
- return profile ;
6702
- default :
6703
- var mode = this . ace . session . $mode ;
6704
- return mode . emmetConfig && mode . emmetConfig . profile || "xhtml" ;
6705
- }
6706
- } ;
6707
- AceEmmetEditor . prototype . prompt = function ( title ) {
6708
- return prompt ( title ) ; // eslint-disable-line no-alert
6709
- } ;
6710
- AceEmmetEditor . prototype . getSelection = function ( ) {
6711
- return this . ace . session . getTextRange ( ) ;
6712
- } ;
6713
- AceEmmetEditor . prototype . getFilePath = function ( ) {
6714
- return "" ;
6715
- } ;
6716
- AceEmmetEditor . prototype . $updateTabstops = function ( value ) {
6717
- var base = 1000 ;
6718
- var zeroBase = 0 ;
6719
- var lastZero = null ;
6720
- var ts = emmet . tabStops || emmet . require ( 'tabStops' ) ;
6721
- var resources = emmet . resources || emmet . require ( "resources" ) ;
6722
- var settings = resources . getVocabulary ( "user" ) ;
6723
- var tabstopOptions = {
6724
- tabstop : function ( data ) {
6725
- var group = parseInt ( data . group , 10 ) ;
6726
- var isZero = group === 0 ;
6727
- if ( isZero )
6728
- group = ++ zeroBase ;
6729
- else
6730
- group += base ;
6731
- var placeholder = data . placeholder ;
6732
- if ( placeholder ) {
6733
- placeholder = ts . processText ( placeholder , tabstopOptions ) ;
6734
- }
6735
- var result = '${' + group + ( placeholder ? ':' + placeholder : '' ) + '}' ;
6736
- if ( isZero ) {
6737
- lastZero = [ data . start , result ] ;
6738
- }
6739
- return result ;
6740
- } ,
6741
- escape : function ( ch ) {
6742
- if ( ch == '$' )
6743
- return '\\$' ;
6744
- if ( ch == '\\' )
6745
- return '\\\\' ;
6746
- return ch ;
6747
- }
6748
- } ;
6749
- value = ts . processText ( value , tabstopOptions ) ;
6750
- if ( settings . variables [ 'insert_final_tabstop' ] && ! / \$ \{ 0 \} $ / . test ( value ) ) {
6751
- value += '${0}' ;
6752
- }
6753
- else if ( lastZero ) {
6754
- var common = emmet . utils ? emmet . utils . common : emmet . require ( 'utils' ) ;
6755
- value = common . replaceSubstring ( value , '${0}' , lastZero [ 0 ] , lastZero [ 1 ] ) ;
6756
- }
6757
- return value ;
6758
- } ;
6759
- return AceEmmetEditor ;
6760
- } ( ) ) ;
6761
- var keymap = {
6762
- expand_abbreviation : { "mac" : "ctrl+alt+e" , "win" : "alt+e" } ,
6763
- match_pair_outward : { "mac" : "ctrl+d" , "win" : "ctrl+," } ,
6764
- match_pair_inward : { "mac" : "ctrl+j" , "win" : "ctrl+shift+0" } ,
6765
- matching_pair : { "mac" : "ctrl+alt+j" , "win" : "alt+j" } ,
6766
- next_edit_point : "alt+right" ,
6767
- prev_edit_point : "alt+left" ,
6768
- toggle_comment : { "mac" : "command+/" , "win" : "ctrl+/" } ,
6769
- split_join_tag : { "mac" : "shift+command+'" , "win" : "shift+ctrl+`" } ,
6770
- remove_tag : { "mac" : "command+'" , "win" : "shift+ctrl+;" } ,
6771
- evaluate_math_expression : { "mac" : "shift+command+y" , "win" : "shift+ctrl+y" } ,
6772
- increment_number_by_1 : "ctrl+up" ,
6773
- decrement_number_by_1 : "ctrl+down" ,
6774
- increment_number_by_01 : "alt+up" ,
6775
- decrement_number_by_01 : "alt+down" ,
6776
- increment_number_by_10 : { "mac" : "alt+command+up" , "win" : "shift+alt+up" } ,
6777
- decrement_number_by_10 : { "mac" : "alt+command+down" , "win" : "shift+alt+down" } ,
6778
- select_next_item : { "mac" : "shift+command+." , "win" : "shift+ctrl+." } ,
6779
- select_previous_item : { "mac" : "shift+command+," , "win" : "shift+ctrl+," } ,
6780
- reflect_css_value : { "mac" : "shift+command+r" , "win" : "shift+ctrl+r" } ,
6781
- encode_decode_data_url : { "mac" : "shift+ctrl+d" , "win" : "ctrl+'" } ,
6782
- expand_abbreviation_with_tab : "Tab" ,
6783
- wrap_with_abbreviation : { "mac" : "shift+ctrl+a" , "win" : "shift+ctrl+a" }
6784
- } ;
6785
- var editorProxy = new AceEmmetEditor ( ) ;
6786
- exports . commands = new HashHandler ( ) ;
6787
- exports . runEmmetCommand = function runEmmetCommand ( editor ) {
6788
- if ( this . action == "expand_abbreviation_with_tab" ) {
6789
- if ( ! editor . selection . isEmpty ( ) )
6790
- return false ;
6791
- var pos = editor . selection . lead ;
6792
- var token = editor . session . getTokenAt ( pos . row , pos . column ) ;
6793
- if ( token && / \b t a g \b / . test ( token . type ) )
6794
- return false ;
6795
- }
6796
- try {
6797
- editorProxy . setupContext ( editor ) ;
6798
- var actions = emmet . actions || emmet . require ( "actions" ) ;
6799
- if ( this . action == "wrap_with_abbreviation" ) {
6800
- return setTimeout ( function ( ) {
6801
- actions . run ( "wrap_with_abbreviation" , editorProxy ) ;
6802
- } , 0 ) ;
6803
- }
6804
- var result = actions . run ( this . action , editorProxy ) ;
6805
- }
6806
- catch ( e ) {
6807
- if ( ! emmet ) {
6808
- var loading = exports . load ( runEmmetCommand . bind ( this , editor ) ) ;
6809
- if ( this . action == "expand_abbreviation_with_tab" )
6810
- return false ;
6811
- return loading ;
6812
- }
6813
- editor . _signal ( "changeStatus" , typeof e == "string" ? e : e . message ) ;
6814
- config . warn ( e ) ;
6815
- result = false ;
6816
- }
6817
- return result ;
6818
- } ;
6819
- for ( var command in keymap ) {
6820
- exports . commands . addCommand ( {
6821
- name : "emmet:" + command ,
6822
- action : command ,
6823
- bindKey : keymap [ command ] ,
6824
- exec : exports . runEmmetCommand ,
6825
- multiSelectAction : "forEach"
6826
- } ) ;
6827
- }
6828
- exports . updateCommands = function ( editor , enabled ) {
6829
- if ( enabled ) {
6830
- editor . keyBinding . addKeyboardHandler ( exports . commands ) ;
6831
- }
6832
- else {
6833
- editor . keyBinding . removeKeyboardHandler ( exports . commands ) ;
6834
- }
6835
- } ;
6836
- exports . isSupportedMode = function ( mode ) {
6837
- if ( ! mode )
6838
- return false ;
6839
- if ( mode . emmetConfig )
6840
- return true ;
6841
- var id = mode . $id || mode ;
6842
- return / c s s | l e s s | s c s s | s a s s | s t y l u s | h t m l | p h p | t w i g | e j s | h a n d l e b a r s / . test ( id ) ;
6843
- } ;
6844
- exports . isAvailable = function ( editor , command ) {
6845
- if ( / ( e v a l u a t e _ m a t h _ e x p r e s s i o n | e x p a n d _ a b b r e v i a t i o n ) $ / . test ( command ) )
6846
- return true ;
6847
- var mode = editor . session . $mode ;
6848
- var isSupported = exports . isSupportedMode ( mode ) ;
6849
- if ( isSupported && mode . $modes ) {
6850
- try {
6851
- editorProxy . setupContext ( editor ) ;
6852
- if ( / j s | p h p / . test ( editorProxy . getSyntax ( ) ) )
6853
- isSupported = false ;
6854
- }
6855
- catch ( e ) { }
6856
- }
6857
- return isSupported ;
6858
- } ;
6859
- var onChangeMode = function ( e , target ) {
6860
- var editor = target ;
6861
- if ( ! editor )
6862
- return ;
6863
- var enabled = exports . isSupportedMode ( editor . session . $mode ) ;
6864
- if ( e . enableEmmet === false )
6865
- enabled = false ;
6866
- if ( enabled )
6867
- exports . load ( ) ;
6868
- exports . updateCommands ( editor , enabled ) ;
6869
- } ;
6870
- exports . load = function ( cb ) {
6871
- if ( typeof emmetPath !== "string" ) {
6872
- config . warn ( "script for emmet-core is not loaded" ) ;
6873
- return false ;
6874
- }
6875
- config . loadModule ( emmetPath , function ( ) {
6876
- emmetPath = null ;
6877
- cb && cb ( ) ;
6878
- } ) ;
6879
- return true ;
6880
- } ;
6881
- exports . AceEmmetEditor = AceEmmetEditor ;
6882
- config . defineOptions ( Editor . prototype , "editor" , {
6883
- enableEmmet : {
6884
- set : function ( val ) {
6885
- this [ val ? "on" : "removeListener" ] ( "changeMode" , onChangeMode ) ;
6886
- onChangeMode ( { enableEmmet : ! ! val } , this ) ;
6887
- } ,
6888
- value : true
6889
- }
6890
- } ) ;
6891
- exports . setCore = function ( e ) {
6892
- if ( typeof e == "string" )
6893
- emmetPath = e ;
6894
- else
6895
- emmet = e ;
6896
- } ;
6897
-
6898
- } ) ;
6899
-
6900
6598
define ( "ace/autocomplete/text_completer" , [ "require" , "exports" , "module" , "ace/range" ] , function ( require , exports , module ) { var Range = require ( "../range" ) . Range ;
6901
6599
var splitRegex = / [ ^ a - z A - Z _ 0 - 9 \$ \- \u00C0 - \u1FFF \u2C00 - \uD7FF \w ] + / ;
6902
6600
function getWordIndex ( doc , pos ) {
@@ -8271,7 +7969,7 @@ exports.commands = [{
8271
7969
8272
7970
} ) ;
8273
7971
8274
- 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" ;
7972
+ 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" ;
8275
7973
8276
7974
require ( "ace/ext/rtl" ) ;
8277
7975
@@ -8749,13 +8447,6 @@ function synchroniseScrolling() {
8749
8447
var StatusBar = require ( "ace/ext/statusbar" ) . StatusBar ;
8750
8448
new StatusBar ( env . editor , cmdLine . container ) ;
8751
8449
8752
-
8753
- var Emmet = require ( "ace/ext/emmet" ) ;
8754
- net . loadScript ( "https://cloud9ide.github.io/emmet-core/emmet.js" , function ( ) {
8755
- Emmet . setCore ( window . emmet ) ;
8756
- env . editor . setOption ( "enableEmmet" , true ) ;
8757
- } ) ;
8758
-
8759
8450
require ( "ace/placeholder" ) . PlaceHolder ;
8760
8451
8761
8452
var snippetManager = require ( "ace/snippets" ) . snippetManager ;
0 commit comments