tocco-admin 1.0.7 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +19 -0
- package/dist/010d0560a00a032c33da819e3c86596a.js +1 -368
- package/dist/029ed9161a8d24a9c2ba97124020989d.js +1 -9
- package/dist/02d5c4961ca855a88b1cd3e1b7fa7aa2.js +1 -113
- package/dist/03371bf1d5cbb1eab58e3a0130d1e9c2.js +1 -15001
- package/dist/03487ba89c7b63069d63c1b3802a472c.js +1 -24
- package/dist/03748243ac7148ca150ba06c2919ff81.js +1 -271
- package/dist/03980cb12dacd26148c22bb61fce440f.js +1 -9
- package/dist/03aae8272914723a7bf85b984385032c.js +1 -9
- package/dist/04770a551c5b6daa744be9b180a8d0fe.js +1 -13311
- package/dist/06d958315fc6cdbb28576b03e43203aa.js +1 -9
- package/dist/07101530302fe1d03dcd731992f7a899.js +1 -869
- package/dist/0731d7568a06d2e28351781370bc52bb.js +1 -445
- package/dist/0794fa2b9c882c72fa7d586069b61055.js +1 -3608
- package/dist/0872e65446d05c1c443180c6280b015f.js +1 -214
- package/dist/08b9f3e305b5e3e0b81f7848fa7f3b6b.js +1 -105
- package/dist/09563004132aabcfcc186943555a92a1.js +1 -263
- package/dist/0a1d9862d917663419ac2dd2e8193267.js +1 -9
- package/dist/0a858573915ab9b03fe79f98f8c51a04.js +1 -271
- package/dist/0a9cd3d62e7f1cd404606c50d9da86fb.js +1 -229
- package/dist/0beea7b55cf3b8c9f9b0bd46170bb30e.js +1 -238
- package/dist/0ec4bf56a876c2bf34ea174c584ce628.js +1 -97
- package/dist/0f418117fac55a859631143ad7d0e833.js +1 -1038
- package/dist/10132993df2cf9c9423b53a8a44379ab.js +1 -9
- package/dist/1034e3807d1bcf55cb564491950237ab.js +1 -9
- package/dist/104959bdb953a3792a203e98d2bf530f.js +1 -895
- package/dist/114c58e47951fe3f6d25f683e0cd54e7.js +1 -381
- package/dist/11b2d52156942feeb87b7c608276c49b.js +1 -119
- package/dist/11dc77ef2ea3a04834945a52f7de2072.js +1 -3208
- package/dist/12b520593765ef7e714d7fb3764633ed.js +1 -167
- package/dist/130340e2c62b9e858f186dab5f491e55.js +1 -9
- package/dist/1324f89bd8db0bae85b79b7f90f6c119.js +1 -418
- package/dist/13eda3507db9cbfb400f46b9b3ff6553.js +1 -9
- package/dist/1441681e52f3ae9ab33afbc5517359a0.js +1 -45
- package/dist/1533058f0ce13acdaa8d5bdc7d147bef.js +1 -9
- package/dist/1549fe09fd6b44aca96e2b1b7cbd93d0.js +1 -111
- package/dist/15f3800d33b854ba476c9daf1b9e0326.js +1 -9
- package/dist/16563bfaf4741097d38cc6ce3ccc1a2d.js +1 -2644
- package/dist/170487867de05784a96608617bdd544d.js +1 -9
- package/dist/179a93d3148b7edb72581279c3787d0c.js +1 -353
- package/dist/17dc98279d24649d3ca77cbce8c44e83.js +1 -9
- package/dist/1850762f1bfaf1a1044765b02b243ed4.js +1 -262
- package/dist/18cfa6de2de3832aa10439fbf963217a.js +1 -3035
- package/dist/18e63e724098792b95b076412a860636.js +1 -116
- package/dist/191feb6103c36b202bc01ba262916cdf.js +1 -9
- package/dist/19e684db1b08c82963634abc8b2c989f.js +1 -422
- package/dist/1abc9efccf77fd4527d1c2fc85d87e04.js +1 -647
- package/dist/1b15b9f88acaf59b96e59c6b5f32da12.js +1 -9
- package/dist/1b64f97eed4a3837a93f8bdd363295fb.js +1 -1873
- package/dist/1c02ec6ec024eee3ebb6b34fa8ff316f.js +1 -103
- package/dist/1c57b3481f295105588972ffa1305521.js +1 -9
- package/dist/1cc82820c232a82b5d8b6cb9e4152af3.js +1 -514
- package/dist/1cd3d09b5303cc37fa337225ed6a9132.js +1 -137
- package/dist/1e029a7f1f64457da4f54254d50ac59b.js +1 -95
- package/dist/1e26167b5f75d5b94add34f1f4d8b044.js +1 -380
- package/dist/1e4131e1241a5b81d54c7d9cb66b0e87.js +1 -254
- package/dist/1fe2d583da5f073431d81a6ea13ffc0c.js +1 -275
- package/dist/1fee62e3e043728a265935971fa26200.js +1 -981
- package/dist/211511e7b374f57ad31acaf49dbdccb1.js +1 -9
- package/dist/2183252fe9e1b88fcf2bc454d6fd9273.js +1 -115
- package/dist/222d52530e9db0a0ec565c6306c5db35.js +1 -104
- package/dist/2267d20fd89c81a461e38abecdb8fcdc.js +1 -282
- package/dist/2272c6632c52c3e402ab27b8045ab8f1.js +1 -9
- package/dist/23bb1a9f279e7a732bfd405350aab114.js +1 -9
- package/dist/23da8ba64540ff4aa68a34d3445db680.js +1 -232
- package/dist/243c0c0572ab9866e02e18821558a1c5.js +1 -89
- package/dist/244b1a234ec1728d0268214de601449d.js +1 -343
- package/dist/24a3ff38afde257888d755ece9bfd704.js +1 -9
- package/dist/25718a469574ade47e23567d8c543169.js +1 -9
- package/dist/25c99a71d30112583893bc5277402c46.js +1 -329
- package/dist/25eda4bb98e40a82cfd5b4bf9fbc06ec.js +1 -9
- package/dist/263f7107e9357b1c91997e1a21b59ff5.js +1 -2025
- package/dist/26fb247a2e0630e1f435cb4d91ec51fd.js +1 -397
- package/dist/27730a0bdc6f430cc85049a46a73a029.js +1 -9
- package/dist/27ccb71fa24357a0919a861351d5b82d.js +1 -2806
- package/dist/28474eb7ee45a125e49cc5cbe69e336f.js +1 -1193
- package/dist/28785bea435918d49b290d27bf660baa.js +1 -9
- package/dist/28acb3b48578dfd30dd555fff7c822f7.js +1 -312
- package/dist/291611f874a2bc54dbc291b52d74c512.js +1 -501
- package/dist/2b2fe1a34cdf81c656a47e493ca9d658.js +1 -257
- package/dist/2bcf741e1f2cb07989a722a6ba9c2ea7.js +1 -128
- package/dist/2d2a42eeeeec801ab35f2fff7d900e43.js +1 -330
- package/dist/2dd82c65030101b60dffccedd8741c6e.js +1 -9
- package/dist/2ddd0346681f9f12fd3a191245aa41df.js +1 -797
- package/dist/2f055ac4066041b9008dd6aebf9df34b.js +1 -9
- package/dist/2f5be3e3e9ab852d217168220854ea9b.js +1 -102
- package/dist/2f7c864f08b00c01f04ac22375f7ddd9.js +1 -520
- package/dist/2fc0239242a898632ca8aa451cb930c2.js +1 -9
- package/dist/2ff54aa3c655216f360438bc7f5b181a.js +1 -2742
- package/dist/30e80558090a09477e4466af8af4c40e.js +1 -135
- package/dist/34791bf31a4236531bc887b48f872c1c.js +1 -1090
- package/dist/34b3249d58303435b894a43d3776a5c3.js +1 -1433
- package/dist/3567d1ea443427e944a6f189a0898819.js +1 -9
- package/dist/3646668820dc96864fbed7746f805947.js +1 -452
- package/dist/36474100e81ab63c4ddbc94ab2cc8667.js +1 -799
- package/dist/365b89ceec577ebec0a39c938c2363f0.js +1 -263
- package/dist/367ad31e6d99d0021d05133b85bb9faf.js +1 -93
- package/dist/37172facd8a534a38f378ca2a9c7c11b.js +1 -9
- package/dist/37afa466cdb7fa8fc2e043164d48f29e.js +1 -13110
- package/dist/37ee3b5201ae2e2dc5dc8b1b20ad900e.js +1 -9
- package/dist/38270ad5088729f40c461c4a5a6bad5d.js +1 -248
- package/dist/3b190e5159c72fb7e27271956772bcba.js +1 -9
- package/dist/3b544bb2c5a4e7b225a4b50235a0fd6d.js +1 -9
- package/dist/3b6e7dc98c47eeafd851ca5072db4be6.js +1 -9
- package/dist/3bbf0faa999b08584dc971eab820113a.js +1 -1169
- package/dist/3c5b59a666c5d39d9ba9cc054d36a410.js +1 -9
- package/dist/3c71a5c0e85afc5486ee9ac29099843d.js +1 -230
- package/dist/3dcc18a5dee46b57ad7f85c0bee86802.js +1 -508
- package/dist/3df92508d7112d83474f31fe9590e289.js +1 -1015
- package/dist/3e277a4ce5486a806a00497aea8ecdd3.js +1 -502
- package/dist/3e3e2243675fa4fb4b320dc57daf2d4f.js +1 -346
- package/dist/3f55ba1c6515db2f98bb996c1a5bc9e3.js +1 -76
- package/dist/3f758ea78954547fed0a8d999691dd7c.js +1 -292
- package/dist/406884d5525e864955e9f5058526aa02.js +1 -101
- package/dist/40dc555a17f1c85020333a41f01dd9ba.js +1 -106
- package/dist/40e6f6cb52a24a747b1046614db3b164.js +1 -213
- package/dist/41d8a58fd52b6a06e8d3fb06cdabf67a.js +1 -989
- package/dist/42b4ce6de00994aa6bf7db7ff2f931a8.js +1 -1331
- package/dist/43a0e099f8283dc1c1c6bbd39148d98d.js +1 -867
- package/dist/440f4d477b586c7a6ba4c1c966ca79fc.js +1 -147
- package/dist/444ababf8edc26948943fbb45bd06a19.js +1 -259
- package/dist/44701e25bb6f2ab9ff18343f2357d1b0.js +1 -171
- package/dist/44ac2a2398075299754707d4bac7c276.js +1 -59
- package/dist/460c67d8fe31ef229704bd5ab6d1dd26.js +1 -942
- package/dist/4639c30a609d986a255ccc684404527e.js +1 -676
- package/dist/4700af84801dbda8a3880e3469c21130.js +1 -413
- package/dist/4736a562251eeaea46dd06892b489f35.js +1 -46
- package/dist/47541c23870e955fff15de4be490ba74.js +1 -112
- package/dist/47f0fbf038314894ac52f2d67466b5e9.js +1 -2848
- package/dist/4860a6a7c59b9ed5c779f7201dc1f591.js +1 -349
- package/dist/48e9351c5623d4da657ce7d5d0267ea6.js +1 -9
- package/dist/4a1dab236c2844d28f73c5c128afe299.js +1 -193
- package/dist/4b425eb8188febc5a89674b89a72d296.js +1 -798
- package/dist/4b61fe945e9e73aba22717e5d6f080df.js +1 -642
- package/dist/4bf3bc1fbdd26ac698fef1bdf26e3ff4.js +1 -9
- package/dist/4c2816c26725f7aae5b490142e31112f.js +1 -352
- package/dist/4ceabd28d8dc751f41002ebf2b6fed88.js +1 -539
- package/dist/4d143a2d103a9e376a9e3b55e680eef7.js +1 -310
- package/dist/4d8cb7033879cb7fcc7a43798e2bde22.js +1 -9
- package/dist/4e389cce6fb8f78845fab249bce43c0b.js +1 -9
- package/dist/4eed3725a00fc2bab78accdb014b7826.js +1 -325
- package/dist/4ef80ee74467e0297eec3cc03092da01.js +1 -9
- package/dist/506d44d8712a22011ce2bec8adbb19b2.js +1 -210
- package/dist/50c073327491a2ed3bfa2ebb466c4204.js +1 -25
- package/dist/51f903c5ce5284a63196247cffb5ca40.js +1 -9
- package/dist/5352ecd8e5f1a2637b48e18cc406edb1.js +1 -9
- package/dist/53e3600928916423671f3388e2d67844.js +1 -9
- package/dist/54b3396acd2c700969248de4b20cbf7c.js +1 -109
- package/dist/55892adefebc0d53993fb108151ed150.js +1 -207
- package/dist/57f4109bd1f06be4dc2bcb8ff7eaf1e5.js +1 -9
- package/dist/57f9654d8ecdebfb02c636e1889af2e4.js +1 -2698
- package/dist/582e24f5ba929e358fadfc7be4c18025.js +1 -9
- package/dist/58598705e7012f4ca1eb1dd21d3c59a5.js +1 -9
- package/dist/5861dfe4f2c7823623e82d0619c5bf06.js +1 -9
- package/dist/58aab872dbdb5e1607076e1935130e03.js +1 -9
- package/dist/595aef8d8b0a2017e2fc27db5703e0d1.js +1 -167
- package/dist/59cc05504a1c823b6d4796bf6b430822.js +1 -9
- package/dist/5a496ae20cc576bef1d35972548207cf.js +1 -9
- package/dist/5a67fdd5293af0a35defd2574c05cd04.js +1 -1803
- package/dist/5ada4185d70a1852b578b2063de58e37.js +1 -221
- package/dist/5b6a626249d0bc43e412fffa6a9ee177.js +1 -9
- package/dist/5bad2df0e3bfd8fdc1a332fb6276cb39.js +1 -360
- package/dist/5c53d90bf4029cfd1b6a0945d1cae142.js +1 -3550
- package/dist/5c96efcfd419a70a93c96557979bc66d.js +1 -371
- package/dist/5d3314103b00c8ea165c6f9f6757f794.js +1 -9
- package/dist/5d46734b57c7408a41473abcd515b64c.js +1 -387
- package/dist/5da9145440d57c9b84d469253e84898d.js +1 -154
- package/dist/5e37c1ef17a219449c8c6aa37a87a941.js +1 -101
- package/dist/5e3f006db26e9b277b1bdbc130611a14.js +1 -400
- package/dist/5e55b301888460bd06c8e26d1011e01a.js +1 -9
- package/dist/5e6c2744429a8fac6e536b179c1f31d0.js +1 -293
- package/dist/5ebdef8c548fca6c51280e915d6f4c3f.js +1 -168
- package/dist/5ede1aebde9d4e5f5cce2db3044495c7.js +1 -148
- package/dist/5f3ce6efab3c679ec1ad25ab0b3f6b2f.js +1 -9
- package/dist/5fb6059ab5d7abab7a74eb73028a3aeb.js +1 -361
- package/dist/5fc5c77d4df4f5d77f8530f6b23ecd1e.js +1 -135
- package/dist/5fedbf948ed123687f77167fac1faf8b.js +1 -9
- package/dist/60340be8eea1d704a17f399b3c3f9577.js +1 -200
- package/dist/621b99ed1a029c36b4e91ec35f36c344.js +1 -44
- package/dist/6292be0125d3720498496eaa7f541618.js +1 -56
- package/dist/63b15fb6fc8f897b22a4bf72b7e8452a.js +1 -57668
- package/dist/64a5f4d62507d032038dcd76d15188e1.js +1 -9
- package/dist/64c45b6610e353ba59a58afc6dd090ca.js +1 -450
- package/dist/64d6924350bd7706850cdc0dcc76ccf6.js +1 -9
- package/dist/6511453710d760c2682567b40ddb3301.js +1 -593
- package/dist/656f53e1b4c6e37a31799737faf6d639.js +1 -209
- package/dist/663234c150f2097f3812c6065491497c.js +1 -254
- package/dist/6903d8ef977a1424c4e2eb22b96feb77.js +1 -118
- package/dist/6a7bf4fb4484f6f48d8e4337f126a61d.js +1 -1246
- package/dist/6abb884bd4f1a54529c00b58c14741cc.js +1 -128
- package/dist/6bb61adbbc13088ee1c32d88b5c7e754.js +1 -1743
- package/dist/6c0a75dc5671c3f237a79f6e45b9891c.js +1 -9
- package/dist/6c67587c2093ac3a19da9f2196e040b7.js +1 -9
- package/dist/6d38cef4a006e6cfe54a6117aba7b600.js +1 -9
- package/dist/6f09754fd684f82e6c06ae526d15ac80.js +1 -740
- package/dist/6f64da239140d00b81d8b6c523e86daf.js +1 -116
- package/dist/6faa9e5f2a0122d2333fa450337a09b0.js +1 -9
- package/dist/6fd6a6ddbcbbebe735c9d21e594203ec.js +1 -145
- package/dist/6fe3f0823e345813c2084b243cb6650b.js +1 -6198
- package/dist/70074e0c785c9a808dea76c7c7d17af3.js +1 -9
- package/dist/70286c33cab463fd576766adecd2d5d9.js +1 -9
- package/dist/707fa1de4d2096da1951c4bc9d21cb6d.js +1 -75
- package/dist/7080d2a1db1608264a6d9d9fbaf2cce8.js +1 -9
- package/dist/716879b6ef8945d579595d88534ae402.js +1 -417
- package/dist/725da29f1643c2263a437c08a1454aea.js +1 -9
- package/dist/73c78b067c792ea8c737746e4671d3e0.js +1 -120
- package/dist/740f4264cd757fcf28331fd30daf295e.js +1 -18
- package/dist/7493f0c3c9bf268d6ad785019d993dd7.js +1 -150
- package/dist/74fa46809aba9625071aa51bc0a71561.js +1 -122
- package/dist/755114145e5b97e5571a160a39e716db.js +1 -9
- package/dist/75bffda9455d77087f34708ac4e85371.js +1 -2640
- package/dist/75d2dae20d7bac5ecfa9dafc48ec04eb.js +1 -277
- package/dist/760eb6458a048f3cba7bc3ae52ef2ba4.js +1 -137
- package/dist/7735af777659608bcd8cd6525e3bbe58.js +1 -135
- package/dist/77aaca51c1c32acaf32656d45f4dc017.js +1 -9
- package/dist/77dd68f6396b8ab4ce2c238d6ddb5354.js +1 -331
- package/dist/788819e459cdd8c4c1ef565fd303f519.js +1 -113
- package/dist/7a9a1dced0e327dc9cb1728bef25641d.js +1 -114
- package/dist/7bd84be066027e61c84c9c2aa9543c2a.js +1 -888
- package/dist/7c1cd1223bd45600763f8c152ad167d5.js +1 -873
- package/dist/7c27341a2599ffb713c8fb7beced7601.js +1 -306
- package/dist/7c317e61789b17749dfe6ea294c89b6b.js +1 -193
- package/dist/7c9c55eb1a1e5c1dfd63631511d9a1f0.js +1 -720
- package/dist/7dead8e2fcacc316bbfa632cd9f1c9bb.js +1 -163
- package/dist/7e4099fc2d04c7c1cf96892b962ba4ec.js +1 -9
- package/dist/7ef082035f74b3d7324f95a7498ea656.js +1 -2632
- package/dist/7f12d133c88ce53d0837a6c4c0287a37.js +1 -360
- package/dist/7f407a1006eb830d6f0aaad96c133d26.js +1 -430
- package/dist/805cb6232d7a9fa46025d48a43622ecf.js +1 -9
- package/dist/80a171b7595d1161735e23dec8efddd6.js +1 -363
- package/dist/82fed7ec74be91e0db61c500d9c6d7ee.js +1 -303
- package/dist/83387cb17a7680f59240e7b399e3ac2b.js +1 -9
- package/dist/8361542d34c46713c9aff6c4ce65a9a3.js +1 -2693
- package/dist/85a977f41a907dba8c672f9bf4943da0.js +1 -3028
- package/dist/866bf6ca5057dcb24503761af061d486.js +1 -478
- package/dist/870184211838006214be1c23c98672fc.js +1 -17
- package/dist/8707a7b49421dbbb842506674ff87fa3.js +1 -59
- package/dist/875e553a27bee88a73df34a90b3058e4.js +1 -2564
- package/dist/8772719d0f76ecabded160e32dc5eb77.js +1 -503
- package/dist/87932c8321c9985ed3b6979e86d2a50e.js +1 -96
- package/dist/87d6bf8becf2d5ebe2f71fda95a313ea.js +1 -83
- package/dist/88bbfb9fdb8730ffc23f546b42d8d620.js +1 -395
- package/dist/88e2feda80ac8cfb28f1dc0ec833b40d.js +1 -9
- package/dist/894720f1519e5eb34e1b4f33fca7a9dd.js +1 -185
- package/dist/894edcaf39c3c95818e3949d737ed459.js +1 -9
- package/dist/89d3c35a5ef97a600927b477a9ba06b4.js +1 -414
- package/dist/8ba6618773c9d8d0b4f6ecb785651e2c.js +1 -121
- package/dist/8bf75743fb14fea7cf02a5da1bda79d4.js +1 -73
- package/dist/8cb83aa3fea85e950c29450b8237fb72.js +1 -14
- package/dist/8d9bb1799d9b98db107e84f10132e17f.js +1 -9
- package/dist/8ed58ed9c7e1cb1ae1f2830d29011ffb.js +1 -9
- package/dist/909adc4a16e0f97d869e3dd16d561430.js +1 -122
- package/dist/90bafd962205e96c3285d27cbf95c55c.js +1 -68
- package/dist/91bd2b106800bd7812e2ab5a5fea985b.js +1 -110
- package/dist/92f4aab5c66f6269c7054c8fbcb3de13.js +1 -9
- package/dist/957970f69802c38a9092b9b6264cc1b9.js +1 -112
- package/dist/9600fed6a4508afbbcd2c75923d953c3.js +1 -125
- package/dist/962969a46fefcace3305abd4d6e14a2e.js +1 -9
- package/dist/964646d64dd3196a9c27fe302511414a.js +1 -10922
- package/dist/9671c350e11f1569edb5066cbfeb3334.js +1 -98
- package/dist/9696a4229fb787eeb25b26f1274b75ee.js +1 -9
- package/dist/97e72973d750ecb3bc2e75b75bf63c5b.js +1 -9000
- package/dist/9807cf1e443a7440371904b6525f37eb.js +1 -9
- package/dist/985d6749688c18f94994794f88492444.js +1 -278
- package/dist/99ade8b6895e3a1c3d6eb70583cb924e.js +1 -115
- package/dist/9b1fd9cf4206cc32e84150c49707d811.js +1 -9
- package/dist/9b8e2282f60f104ff3ace5b905af4d62.js +1 -64
- package/dist/9ff6d4a6592c0cb7d0b939113c3a6b31.js +1 -95
- package/dist/a164d0e40c4dfa485dcf8e6d5258d767.js +1 -122
- package/dist/a1c8660c5bcc6b6a43a7fb3c351174d9.js +1 -9
- package/dist/a2a705f6bc3a6827d6c94c5978aec36d.js +1 -243
- package/dist/a2c0fcb443c396b30a11fc1682a29c13.js +1 -115
- package/dist/a4306aa43824ec1a4ee422b59a851e6f.js +1 -2622
- package/dist/a4bedde07e392f8ebf64341b61f75df2.js +1 -9
- package/dist/a533e643002830be2da76c9527265860.js +1 -9
- package/dist/a5d364d12a8f7691339c497b2e725bcf.js +1 -145
- package/dist/a7824ec1ab22aeb22bb35ab8bf1ddc4a.js +1 -715
- package/dist/a934b622dd8bdcdcdc1dde985a07ac14.js +1 -36
- package/dist/a98ead014d010899b35ee25c7c225542.js +1 -411
- package/dist/aa0eee504d52a12d3a30bbd523afcc34.js +1 -9
- package/dist/aa5623ec68d23fedb9c9c115c7d99063.js +1 -9
- package/dist/aaddd877950d1e3bf1b3ef0fc0ff596e.js +1 -449
- package/dist/aaf5c3a4f1a188fd051577cea7b87209.js +1 -457
- package/dist/ab4b314445b23359319c14cce9a0e321.js +1 -3687
- package/dist/abb40a9a6ef0b2fe14c66dcadc9857a2.js +1 -248
- package/dist/ad215d7ba317c941cdcc96ae78e86666.js +1 -67
- package/dist/adc5e81257ed3f8d70d03cf79150eec1.js +1 -320
- package/dist/aedbf3a3ece39aab8c9f3b3a3779e79b.js +1 -115
- package/dist/af959c2a870f08dd8abccae97c9b9bae.js +1 -35
- package/dist/b0071564b0854c39e3de8b99d66e4dfd.js +1 -298
- package/dist/b02d982ccb1011197a5a24800b178a0a.js +1 -9
- package/dist/b0803f33b602bd3b26be70f259e38cee.js +1 -102
- package/dist/b1170472ae4b50e3b0070eb991e502fe.js +1 -9
- package/dist/b1ac30076824f72cdff7ea29ae0b6801.js +1 -489
- package/dist/b1f3f77a9279cdb38846ebe13c3438bc.js +1 -9
- package/dist/b20056c149af6b50c851ecfff90e0ccb.js +1 -2792
- package/dist/b20cd9acf45420fcacfd923754185663.js +1 -9
- package/dist/b25188cf2652d63136d5e54c38abf84e.js +1 -500
- package/dist/b2742fab9568b63c2274698af5d381fc.js +1 -135
- package/dist/b2ff96fbe6501ff45c37491b94c96c5f.js +1 -315
- package/dist/b33ef9b4202539d3690251cb8213a034.js +1 -9
- package/dist/b3bb2c8deddd8c2afcf73f6f5d711596.js +1 -61
- package/dist/b402b938ca2da72e0984a1360eda5897.js +1 -40
- package/dist/b460e24d77f9c0d8b21e65d899840adb.js +1 -363
- package/dist/b6a6a4adaab4f09a7835ff64a5096198.js +1 -80
- package/dist/b6df2278bd475169749bab512944b7ec.js +1 -207
- package/dist/b7b7be8216519adf62d75f123f9c6423.js +1 -1470
- package/dist/b808fb222140a85b23ebbe0fffa906d9.js +1 -9
- package/dist/b8197742452dd2e77090dde34cb2dc4d.js +1 -4105
- package/dist/b881dca9d9a80f61d87374b4bd5a2dd5.js +1 -9
- package/dist/b98206b2175363f1150c074608603942.js +1 -592
- package/dist/ba6b8b3e06cd9d0aee9c69278ee84647.js +1 -9
- package/dist/baa5bf4cfefed057a4657a1b02cfa114.js +1 -32
- package/dist/bb4d542cb170b3f7b27a42c69262975b.js +1 -1421
- package/dist/bb5bab7a675544fe31ddb7f4a77dffb9.js +1 -9
- package/dist/bc0551f89df16ee262a67c0431544a9e.js +1 -128
- package/dist/c0736a7477d7aac4c669bb94ccae25d9.js +1 -381
- package/dist/c0780e66c6b1ade0fa22283ce1f9c402.js +1 -1582
- package/dist/c1bc72d79cc6161590fc01c6b139fccd.js +1 -296
- package/dist/c32ec7d45ccd947b98fe458a8ca1405b.js +1 -412
- package/dist/c40023acde0f3d5f4806f5fccbb4284b.js +1 -160
- package/dist/c45445ab45defa960329c6f8e6224e57.js +1 -317
- package/dist/c51840077c684be0e7e13339f85cd4a9.js +1 -9
- package/dist/c530988d2b1966fd10a4d99fa3877e1b.js +1 -9
- package/dist/c631c95d9019218dfd22d028f215e1d1.js +1 -312
- package/dist/c728b4ef87cfd5f561d1601f0867c39d.js +1 -2509
- package/dist/c733414555a126e689832ffb55cc203f.js +1 -820
- package/dist/c797511423f91a877e7fdffa74d015cb.js +1 -914
- package/dist/c7ca9dccbac3af7ebc82b271dd2aa570.js +1 -400
- package/dist/c80e89199aef31e48addb2b35ea96365.js +1 -9
- package/dist/cb4175466ea600940f2927fa03a217e8.js +1 -472
- package/dist/cb652f200fc3dd740b2e7f678a9272ea.js +1 -9
- package/dist/cbdbd623038183a8c068dd24ecd90682.js +1 -9
- package/dist/cbdc4ca43a8c940a6c3f59a8b6f17df5.js +1 -9
- package/dist/ccde58de5468dd353dbee74d631ebdf0.js +1 -34
- package/dist/cd358d9acaaa7049d85b15ac766fc314.js +1 -311
- package/dist/cd9a17f94a922c7c88000b1b3cdd67df.js +1 -9
- package/dist/cda6c5c52fa5d595982da0fac9da25a5.js +1 -984
- package/dist/cf188b3f83735389d47bb12fc9f7069a.js +1 -9
- package/dist/cf3f6b1c74c72cb5d02870022dbc9f94.js +1 -9
- package/dist/cf90a39d245bf7e6c1b41c7a9a28f0a1.js +1 -681
- package/dist/chunk-207.20687707ce30d15f4eeb.js +2 -0
- package/dist/chunk-207.20687707ce30d15f4eeb.js.map +1 -0
- package/dist/chunk-404.9a698fdc051c69bf1ffa.js +2 -0
- package/dist/chunk-404.9a698fdc051c69bf1ffa.js.map +1 -0
- package/dist/chunk-actions.9378c1cdcd478a824cb8.js +2 -0
- package/dist/chunk-actions.9378c1cdcd478a824cb8.js.map +1 -0
- package/dist/chunk-code-editor.4932fdbfef27989069a5.js +2 -0
- package/dist/chunk-code-editor.4932fdbfef27989069a5.js.map +1 -0
- package/dist/{chunk-docs-actions.8a808416a2d69710472e.js → chunk-docs-actions.9c46b27e36cc37c3782e.js} +2 -2
- package/dist/chunk-docs-actions.9c46b27e36cc37c3782e.js.map +1 -0
- package/dist/chunk-vendor-icons.b0dcd1c0c79fe5b28fc5.js +1 -0
- package/dist/d04707d65591e86810ebc56d48b10810.js +1 -296
- package/dist/d1a58542777d072396d7cee5487304f9.js +1 -141
- package/dist/d1efdca26800423a363b769b1834cfcf.js +1 -223
- package/dist/d2a00e1726c71ca10fbaf4b9c4374458.js +1 -1003
- package/dist/d2fe7592ff2fdda099b2b6355abe8c06.js +1 -5240
- package/dist/d30fa4070abd6929228505790744e180.js +1 -279
- package/dist/d43ad5f9bad9a042b49b2592c7639c28.js +1 -9
- package/dist/d542dda7308361c34af2afb9b70d755a.js +1 -9
- package/dist/d5a6140d581e5c4eb200259ce372f40b.js +1 -9
- package/dist/d5f79987405c2169278f8de37bcc9d05.js +1 -9
- package/dist/d78d3b050ea95b068380d975fd413fd7.js +1 -9
- package/dist/d79b3962938d65fb85c6f844e86d92d9.js +1 -172
- package/dist/d7b57d5ebdcade0ce5e047509e06861a.js +1 -580
- package/dist/d7d616d4aa8fd3f51d681242853dcde9.js +1 -9
- package/dist/d83f2acd25388452582e5a4c727255b0.js +1 -174
- package/dist/da1c1b1569c4d5872c9a18c29f0b5c90.js +1 -3088
- package/dist/da55f4fe3daed3f79fc4565668ecf7dd.js +1 -97
- package/dist/db8ca5cfb6fe4aaef215f116f6991784.js +1 -9
- package/dist/dbc87324ecf271d088a2ab0823de9c5d.js +1 -75
- package/dist/dbd05051a3ecf6b10e2f7b8904153f2d.js +1 -3194
- package/dist/dc1eb6c1c92d7067c72b82b2833a7d2c.js +1 -2595
- package/dist/dcb197c0214e800da9d9436dfc9437d6.js +1 -162
- package/dist/ddbc961769cd2ff4d4a7a136168ebf4c.js +1 -9
- package/dist/de0fd4fd7c2d7a4887cbc99eed91f797.js +1 -9
- package/dist/df37029cdf8359ecac0aebdf4f257d03.js +1 -386
- package/dist/df5710d97a899b672060afaa8c4891c2.js +1 -316
- package/dist/dfb7dd1fab06b2403f76c23f80b15738.js +1 -1718
- package/dist/e07a0b284934d3a0e8c02c508edc9df1.js +1 -115
- package/dist/e0adad8a8579bf99f3e22f7c214a5c64.js +1 -9
- package/dist/e0e32c3798e8895695ce5b372a0c989f.js +1 -2166
- package/dist/e2b38a8393be2cf23f3894ace3efb1c3.js +1 -9
- package/dist/e3ba4b654313ae98884a6c9044197e09.js +1 -103
- package/dist/e4565878df49fd4ce3edd3f1022c1695.js +1 -244
- package/dist/e4917fa7632b01d28e99304d32d989f7.js +1 -9
- package/dist/e4968d8264b40c14f123f28419eb456d.js +1 -23
- package/dist/e6070e43daf8a9e5f13f515a5a03e66c.js +1 -498
- package/dist/e61779df91186b23e7adf2d1968b2708.js +1 -9
- package/dist/e6ad50b520736b595970c9e07029c3f1.js +1 -9
- package/dist/e6cf8898b285b71e2abe832717ac7060.js +1 -153
- package/dist/e6fae0b04a3000a57f22bb25325c8afe.js +1 -2635
- package/dist/e6fb5287a46e030336c006e3f50ade3a.js +1 -529
- package/dist/e7e1a807af3160b342e0a3550cf8f7c5.js +1 -9
- package/dist/e874d975c9128dc6eb9a513d088bed9f.js +1 -9
- package/dist/e8fa659263d5ca9e0d1be69c048133a8.js +1 -297
- package/dist/e97cfa120fde26da0359ca29afaf3171.js +1 -43
- package/dist/eaa55a522fb2cb2f0287711f42344984.js +1 -9
- package/dist/eba5ee3fb1f3e92af88c69e50b2a8fd1.js +1 -102
- package/dist/ec2d138afc9cc9e81c4c6ef36ed55228.js +1 -103
- package/dist/ec32839f8f3353e66b85450525fa3114.js +1 -2808
- package/dist/ecd02712f5a40fcdaa3bfa8190470024.js +1 -2596
- package/dist/ecd37b343c4dcc8dac849b1c680dcbef.js +1 -1010
- package/dist/ecdb4966f685f3e44b1f28fae46827a3.js +1 -9
- package/dist/ee694c1bcbdc9439e50f816c39fd1023.js +1 -2875
- package/dist/efc14cdf19554635e477781704353ec2.js +1 -9
- package/dist/f0548260c0ac6b0e7cdb8909df1a5333.js +1 -421
- package/dist/f0878cc386a608146dbc8fb3b6745c42.js +1 -422
- package/dist/f326f2f263b1498fedbe1d07d7254d10.js +1 -9
- package/dist/f3c7b9d832aa442df3d140f7697b4f62.js +1 -98
- package/dist/f42342b39da2c42adc65ebcf52839f90.js +1 -102
- package/dist/f4c53706e1721b08e8b2f650c8bd35c4.js +1 -166
- package/dist/f582d9feb91d31036d3dae4cdaea865f.js +1 -3533
- package/dist/f5bea0e1099339b99b21ee2d3c0fc489.js +1 -23
- package/dist/f7186078e00d958aa2b316483dfc7e1c.js +1 -1715
- package/dist/f79630d85284a7f6dadc25c1d256af0a.js +1 -33
- package/dist/f80efec9a63094f19edae0480a0f2cd8.js +1 -635
- package/dist/f90003058d7087f15baa27b80bf08c1d.js +1 -839
- package/dist/f980fd09c34c277299e2d3f83aebdba5.js +1 -102
- package/dist/fb59a7c154104a421146ab9e5bd71540.js +1 -462
- package/dist/fd40b62490e412d27bc67e660aacae19.js +1 -430
- package/dist/fd5bc50b18c9f46380cbe5ec1ac2127b.js +1 -9
- package/dist/fd5e2efd3b2d047abe8473f99c650a35.js +1 -677
- package/dist/fdf4d851b44839d8fdfa77b3419bce19.js +1 -204
- package/dist/ffd3b83e8b5878f4785591ff54b1dfff.js +1 -9
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/dist/chunk-207.a88d16e56962fd4d2978.js +0 -2
- package/dist/chunk-207.a88d16e56962fd4d2978.js.map +0 -1
- package/dist/chunk-404.0ea933a6d9513f2665cf.js +0 -2
- package/dist/chunk-404.0ea933a6d9513f2665cf.js.map +0 -1
- package/dist/chunk-actions.1ad5d759ef5d8509c532.js +0 -2
- package/dist/chunk-actions.1ad5d759ef5d8509c532.js.map +0 -1
- package/dist/chunk-code-editor.c86cda6aae761ec82d57.js +0 -2
- package/dist/chunk-code-editor.c86cda6aae761ec82d57.js.map +0 -1
- package/dist/chunk-docs-actions.8a808416a2d69710472e.js.map +0 -1
- package/dist/chunk-vendor-icons.7f0d1996a77d090b3d9c.js +0 -1
|
@@ -1,1331 +1 @@
|
|
|
1
|
-
ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"], function(require, exports, module) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var dom = require("./lib/dom");
|
|
4
|
-
var oop = require("./lib/oop");
|
|
5
|
-
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|
6
|
-
var lang = require("./lib/lang");
|
|
7
|
-
var Range = require("./range").Range;
|
|
8
|
-
var RangeList = require("./range_list").RangeList;
|
|
9
|
-
var HashHandler = require("./keyboard/hash_handler").HashHandler;
|
|
10
|
-
var Tokenizer = require("./tokenizer").Tokenizer;
|
|
11
|
-
var clipboard = require("./clipboard");
|
|
12
|
-
|
|
13
|
-
var VARIABLES = {
|
|
14
|
-
CURRENT_WORD: function(editor) {
|
|
15
|
-
return editor.session.getTextRange(editor.session.getWordRange());
|
|
16
|
-
},
|
|
17
|
-
SELECTION: function(editor, name, indentation) {
|
|
18
|
-
var text = editor.session.getTextRange();
|
|
19
|
-
if (indentation)
|
|
20
|
-
return text.replace(/\n\r?([ \t]*\S)/g, "\n" + indentation + "$1");
|
|
21
|
-
return text;
|
|
22
|
-
},
|
|
23
|
-
CURRENT_LINE: function(editor) {
|
|
24
|
-
return editor.session.getLine(editor.getCursorPosition().row);
|
|
25
|
-
},
|
|
26
|
-
PREV_LINE: function(editor) {
|
|
27
|
-
return editor.session.getLine(editor.getCursorPosition().row - 1);
|
|
28
|
-
},
|
|
29
|
-
LINE_INDEX: function(editor) {
|
|
30
|
-
return editor.getCursorPosition().row;
|
|
31
|
-
},
|
|
32
|
-
LINE_NUMBER: function(editor) {
|
|
33
|
-
return editor.getCursorPosition().row + 1;
|
|
34
|
-
},
|
|
35
|
-
SOFT_TABS: function(editor) {
|
|
36
|
-
return editor.session.getUseSoftTabs() ? "YES" : "NO";
|
|
37
|
-
},
|
|
38
|
-
TAB_SIZE: function(editor) {
|
|
39
|
-
return editor.session.getTabSize();
|
|
40
|
-
},
|
|
41
|
-
CLIPBOARD: function(editor) {
|
|
42
|
-
return clipboard.getText && clipboard.getText();
|
|
43
|
-
},
|
|
44
|
-
FILENAME: function(editor) {
|
|
45
|
-
return /[^/\\]*$/.exec(this.FILEPATH(editor))[0];
|
|
46
|
-
},
|
|
47
|
-
FILENAME_BASE: function(editor) {
|
|
48
|
-
return /[^/\\]*$/.exec(this.FILEPATH(editor))[0].replace(/\.[^.]*$/, "");
|
|
49
|
-
},
|
|
50
|
-
DIRECTORY: function(editor) {
|
|
51
|
-
return this.FILEPATH(editor).replace(/[^/\\]*$/, "");
|
|
52
|
-
},
|
|
53
|
-
FILEPATH: function(editor) { return "/not implemented.txt"; },
|
|
54
|
-
WORKSPACE_NAME: function() { return "Unknown"; },
|
|
55
|
-
FULLNAME: function() { return "Unknown"; },
|
|
56
|
-
BLOCK_COMMENT_START: function(editor) {
|
|
57
|
-
var mode = editor.session.$mode || {};
|
|
58
|
-
return mode.blockComment && mode.blockComment.start || "";
|
|
59
|
-
},
|
|
60
|
-
BLOCK_COMMENT_END: function(editor) {
|
|
61
|
-
var mode = editor.session.$mode || {};
|
|
62
|
-
return mode.blockComment && mode.blockComment.end || "";
|
|
63
|
-
},
|
|
64
|
-
LINE_COMMENT: function(editor) {
|
|
65
|
-
var mode = editor.session.$mode || {};
|
|
66
|
-
return mode.lineCommentStart || "";
|
|
67
|
-
},
|
|
68
|
-
CURRENT_YEAR: date.bind(null, {year: "numeric"}),
|
|
69
|
-
CURRENT_YEAR_SHORT: date.bind(null, {year: "2-digit"}),
|
|
70
|
-
CURRENT_MONTH: date.bind(null, {month: "numeric"}),
|
|
71
|
-
CURRENT_MONTH_NAME: date.bind(null, {month: "long"}),
|
|
72
|
-
CURRENT_MONTH_NAME_SHORT: date.bind(null, {month: "short"}),
|
|
73
|
-
CURRENT_DATE: date.bind(null, {day: "2-digit"}),
|
|
74
|
-
CURRENT_DAY_NAME: date.bind(null, {weekday: "long"}),
|
|
75
|
-
CURRENT_DAY_NAME_SHORT: date.bind(null, {weekday: "short"}),
|
|
76
|
-
CURRENT_HOUR: date.bind(null, {hour: "2-digit", hour12: false}),
|
|
77
|
-
CURRENT_MINUTE: date.bind(null, {minute: "2-digit"}),
|
|
78
|
-
CURRENT_SECOND: date.bind(null, {second: "2-digit"})
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
VARIABLES.SELECTED_TEXT = VARIABLES.SELECTION;
|
|
82
|
-
|
|
83
|
-
function date(dateFormat) {
|
|
84
|
-
var str = new Date().toLocaleString("en-us", dateFormat);
|
|
85
|
-
return str.length == 1 ? "0" + str : str;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
var SnippetManager = function() {
|
|
89
|
-
this.snippetMap = {};
|
|
90
|
-
this.snippetNameMap = {};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
(function() {
|
|
94
|
-
oop.implement(this, EventEmitter);
|
|
95
|
-
|
|
96
|
-
this.getTokenizer = function() {
|
|
97
|
-
return SnippetManager.$tokenizer || this.createTokenizer();
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
this.createTokenizer = function() {
|
|
101
|
-
function TabstopToken(str) {
|
|
102
|
-
str = str.substr(1);
|
|
103
|
-
if (/^\d+$/.test(str))
|
|
104
|
-
return [{tabstopId: parseInt(str, 10)}];
|
|
105
|
-
return [{text: str}];
|
|
106
|
-
}
|
|
107
|
-
function escape(ch) {
|
|
108
|
-
return "(?:[^\\\\" + ch + "]|\\\\.)";
|
|
109
|
-
}
|
|
110
|
-
var formatMatcher = {
|
|
111
|
-
regex: "/(" + escape("/") + "+)/",
|
|
112
|
-
onMatch: function(val, state, stack) {
|
|
113
|
-
var ts = stack[0];
|
|
114
|
-
ts.fmtString = true;
|
|
115
|
-
ts.guard = val.slice(1, -1);
|
|
116
|
-
ts.flag = "";
|
|
117
|
-
return "";
|
|
118
|
-
},
|
|
119
|
-
next: "formatString"
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
SnippetManager.$tokenizer = new Tokenizer({
|
|
123
|
-
start: [
|
|
124
|
-
{regex: /\\./, onMatch: function(val, state, stack) {
|
|
125
|
-
var ch = val[1];
|
|
126
|
-
if (ch == "}" && stack.length) {
|
|
127
|
-
val = ch;
|
|
128
|
-
} else if ("`$\\".indexOf(ch) != -1) {
|
|
129
|
-
val = ch;
|
|
130
|
-
}
|
|
131
|
-
return [val];
|
|
132
|
-
}},
|
|
133
|
-
{regex: /}/, onMatch: function(val, state, stack) {
|
|
134
|
-
return [stack.length ? stack.shift() : val];
|
|
135
|
-
}},
|
|
136
|
-
{regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken},
|
|
137
|
-
{regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) {
|
|
138
|
-
var t = TabstopToken(str.substr(1));
|
|
139
|
-
stack.unshift(t[0]);
|
|
140
|
-
return t;
|
|
141
|
-
}, next: "snippetVar"},
|
|
142
|
-
{regex: /\n/, token: "newline", merge: false}
|
|
143
|
-
],
|
|
144
|
-
snippetVar: [
|
|
145
|
-
{regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) {
|
|
146
|
-
var choices = val.slice(1, -1).replace(/\\[,|\\]|,/g, function(operator) {
|
|
147
|
-
return operator.length == 2 ? operator[1] : "\x00";
|
|
148
|
-
}).split("\x00").map(function(value){
|
|
149
|
-
return {value: value};
|
|
150
|
-
});
|
|
151
|
-
stack[0].choices = choices;
|
|
152
|
-
return [choices[0]];
|
|
153
|
-
}, next: "start"},
|
|
154
|
-
formatMatcher,
|
|
155
|
-
{regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"}
|
|
156
|
-
],
|
|
157
|
-
formatString: [
|
|
158
|
-
{regex: /:/, onMatch: function(val, state, stack) {
|
|
159
|
-
if (stack.length && stack[0].expectElse) {
|
|
160
|
-
stack[0].expectElse = false;
|
|
161
|
-
stack[0].ifEnd = {elseEnd: stack[0]};
|
|
162
|
-
return [stack[0].ifEnd];
|
|
163
|
-
}
|
|
164
|
-
return ":";
|
|
165
|
-
}},
|
|
166
|
-
{regex: /\\./, onMatch: function(val, state, stack) {
|
|
167
|
-
var ch = val[1];
|
|
168
|
-
if (ch == "}" && stack.length)
|
|
169
|
-
val = ch;
|
|
170
|
-
else if ("`$\\".indexOf(ch) != -1)
|
|
171
|
-
val = ch;
|
|
172
|
-
else if (ch == "n")
|
|
173
|
-
val = "\n";
|
|
174
|
-
else if (ch == "t")
|
|
175
|
-
val = "\t";
|
|
176
|
-
else if ("ulULE".indexOf(ch) != -1)
|
|
177
|
-
val = {changeCase: ch, local: ch > "a"};
|
|
178
|
-
return [val];
|
|
179
|
-
}},
|
|
180
|
-
{regex: "/\\w*}", onMatch: function(val, state, stack) {
|
|
181
|
-
var next = stack.shift();
|
|
182
|
-
if (next)
|
|
183
|
-
next.flag = val.slice(1, -1);
|
|
184
|
-
this.next = next && next.tabstopId ? "start" : "";
|
|
185
|
-
return [next || val];
|
|
186
|
-
}, next: "start"},
|
|
187
|
-
{regex: /\$(?:\d+|\w+)/, onMatch: function(val, state, stack) {
|
|
188
|
-
return [{text: val.slice(1)}];
|
|
189
|
-
}},
|
|
190
|
-
{regex: /\${\w+/, onMatch: function(val, state, stack) {
|
|
191
|
-
var token = {text: val.slice(2)};
|
|
192
|
-
stack.unshift(token);
|
|
193
|
-
return [token];
|
|
194
|
-
}, next: "formatStringVar"},
|
|
195
|
-
{regex: /\n/, token: "newline", merge: false},
|
|
196
|
-
{regex: /}/, onMatch: function(val, state, stack) {
|
|
197
|
-
var next = stack.shift();
|
|
198
|
-
this.next = next && next.tabstopId ? "start" : "";
|
|
199
|
-
return [next || val];
|
|
200
|
-
}, next: "start"}
|
|
201
|
-
],
|
|
202
|
-
formatStringVar: [
|
|
203
|
-
{regex: /:\/\w+}/, onMatch: function(val, state, stack) {
|
|
204
|
-
var ts = stack[0];
|
|
205
|
-
ts.formatFunction = val.slice(2, -1);
|
|
206
|
-
return [stack.shift()];
|
|
207
|
-
}, next: "formatString"},
|
|
208
|
-
formatMatcher,
|
|
209
|
-
{regex: /:[\?\-+]?/, onMatch: function(val, state, stack) {
|
|
210
|
-
if (val[1] == "+")
|
|
211
|
-
stack[0].ifEnd = stack[0];
|
|
212
|
-
if (val[1] == "?")
|
|
213
|
-
stack[0].expectElse = true;
|
|
214
|
-
}, next: "formatString"},
|
|
215
|
-
{regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString"}
|
|
216
|
-
]
|
|
217
|
-
});
|
|
218
|
-
return SnippetManager.$tokenizer;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
this.tokenizeTmSnippet = function(str, startState) {
|
|
222
|
-
return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) {
|
|
223
|
-
return x.value || x;
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
this.getVariableValue = function(editor, name, indentation) {
|
|
228
|
-
if (/^\d+$/.test(name))
|
|
229
|
-
return (this.variables.__ || {})[name] || "";
|
|
230
|
-
if (/^[A-Z]\d+$/.test(name))
|
|
231
|
-
return (this.variables[name[0] + "__"] || {})[name.substr(1)] || "";
|
|
232
|
-
|
|
233
|
-
name = name.replace(/^TM_/, "");
|
|
234
|
-
if (!this.variables.hasOwnProperty(name))
|
|
235
|
-
return "";
|
|
236
|
-
var value = this.variables[name];
|
|
237
|
-
if (typeof value == "function")
|
|
238
|
-
value = this.variables[name](editor, name, indentation);
|
|
239
|
-
return value == null ? "" : value;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
this.variables = VARIABLES;
|
|
243
|
-
this.tmStrFormat = function(str, ch, editor) {
|
|
244
|
-
if (!ch.fmt) return str;
|
|
245
|
-
var flag = ch.flag || "";
|
|
246
|
-
var re = ch.guard;
|
|
247
|
-
re = new RegExp(re, flag.replace(/[^gim]/g, ""));
|
|
248
|
-
var fmtTokens = typeof ch.fmt == "string" ? this.tokenizeTmSnippet(ch.fmt, "formatString") : ch.fmt;
|
|
249
|
-
var _self = this;
|
|
250
|
-
var formatted = str.replace(re, function() {
|
|
251
|
-
var oldArgs = _self.variables.__;
|
|
252
|
-
_self.variables.__ = [].slice.call(arguments);
|
|
253
|
-
var fmtParts = _self.resolveVariables(fmtTokens, editor);
|
|
254
|
-
var gChangeCase = "E";
|
|
255
|
-
for (var i = 0; i < fmtParts.length; i++) {
|
|
256
|
-
var ch = fmtParts[i];
|
|
257
|
-
if (typeof ch == "object") {
|
|
258
|
-
fmtParts[i] = "";
|
|
259
|
-
if (ch.changeCase && ch.local) {
|
|
260
|
-
var next = fmtParts[i + 1];
|
|
261
|
-
if (next && typeof next == "string") {
|
|
262
|
-
if (ch.changeCase == "u")
|
|
263
|
-
fmtParts[i] = next[0].toUpperCase();
|
|
264
|
-
else
|
|
265
|
-
fmtParts[i] = next[0].toLowerCase();
|
|
266
|
-
fmtParts[i + 1] = next.substr(1);
|
|
267
|
-
}
|
|
268
|
-
} else if (ch.changeCase) {
|
|
269
|
-
gChangeCase = ch.changeCase;
|
|
270
|
-
}
|
|
271
|
-
} else if (gChangeCase == "U") {
|
|
272
|
-
fmtParts[i] = ch.toUpperCase();
|
|
273
|
-
} else if (gChangeCase == "L") {
|
|
274
|
-
fmtParts[i] = ch.toLowerCase();
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
_self.variables.__ = oldArgs;
|
|
278
|
-
return fmtParts.join("");
|
|
279
|
-
});
|
|
280
|
-
return formatted;
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
this.tmFormatFunction = function(str, ch, editor) {
|
|
284
|
-
if (ch.formatFunction == "upcase")
|
|
285
|
-
return str.toUpperCase();
|
|
286
|
-
if (ch.formatFunction == "downcase")
|
|
287
|
-
return str.toLowerCase();
|
|
288
|
-
return str;
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
this.resolveVariables = function(snippet, editor) {
|
|
292
|
-
var result = [];
|
|
293
|
-
var indentation = "";
|
|
294
|
-
var afterNewLine = true;
|
|
295
|
-
for (var i = 0; i < snippet.length; i++) {
|
|
296
|
-
var ch = snippet[i];
|
|
297
|
-
if (typeof ch == "string") {
|
|
298
|
-
result.push(ch);
|
|
299
|
-
if (ch == "\n") {
|
|
300
|
-
afterNewLine = true;
|
|
301
|
-
indentation = "";
|
|
302
|
-
}
|
|
303
|
-
else if (afterNewLine) {
|
|
304
|
-
indentation = /^\t*/.exec(ch)[0];
|
|
305
|
-
afterNewLine = /\S/.test(ch);
|
|
306
|
-
}
|
|
307
|
-
continue;
|
|
308
|
-
}
|
|
309
|
-
if (!ch) continue;
|
|
310
|
-
afterNewLine = false;
|
|
311
|
-
|
|
312
|
-
if (ch.fmtString) {
|
|
313
|
-
var j = snippet.indexOf(ch, i + 1);
|
|
314
|
-
if (j == -1) j = snippet.length;
|
|
315
|
-
ch.fmt = snippet.slice(i + 1, j);
|
|
316
|
-
i = j;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
if (ch.text) {
|
|
320
|
-
var value = this.getVariableValue(editor, ch.text, indentation) + "";
|
|
321
|
-
if (ch.fmtString)
|
|
322
|
-
value = this.tmStrFormat(value, ch, editor);
|
|
323
|
-
if (ch.formatFunction)
|
|
324
|
-
value = this.tmFormatFunction(value, ch, editor);
|
|
325
|
-
|
|
326
|
-
if (value && !ch.ifEnd) {
|
|
327
|
-
result.push(value);
|
|
328
|
-
gotoNext(ch);
|
|
329
|
-
} else if (!value && ch.ifEnd) {
|
|
330
|
-
gotoNext(ch.ifEnd);
|
|
331
|
-
}
|
|
332
|
-
} else if (ch.elseEnd) {
|
|
333
|
-
gotoNext(ch.elseEnd);
|
|
334
|
-
} else if (ch.tabstopId != null) {
|
|
335
|
-
result.push(ch);
|
|
336
|
-
} else if (ch.changeCase != null) {
|
|
337
|
-
result.push(ch);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
function gotoNext(ch) {
|
|
341
|
-
var i1 = snippet.indexOf(ch, i + 1);
|
|
342
|
-
if (i1 != -1)
|
|
343
|
-
i = i1;
|
|
344
|
-
}
|
|
345
|
-
return result;
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
this.insertSnippetForSelection = function(editor, snippetText) {
|
|
349
|
-
var cursor = editor.getCursorPosition();
|
|
350
|
-
var line = editor.session.getLine(cursor.row);
|
|
351
|
-
var tabString = editor.session.getTabString();
|
|
352
|
-
var indentString = line.match(/^\s*/)[0];
|
|
353
|
-
|
|
354
|
-
if (cursor.column < indentString.length)
|
|
355
|
-
indentString = indentString.slice(0, cursor.column);
|
|
356
|
-
|
|
357
|
-
snippetText = snippetText.replace(/\r/g, "");
|
|
358
|
-
var tokens = this.tokenizeTmSnippet(snippetText);
|
|
359
|
-
tokens = this.resolveVariables(tokens, editor);
|
|
360
|
-
tokens = tokens.map(function(x) {
|
|
361
|
-
if (x == "\n")
|
|
362
|
-
return x + indentString;
|
|
363
|
-
if (typeof x == "string")
|
|
364
|
-
return x.replace(/\t/g, tabString);
|
|
365
|
-
return x;
|
|
366
|
-
});
|
|
367
|
-
var tabstops = [];
|
|
368
|
-
tokens.forEach(function(p, i) {
|
|
369
|
-
if (typeof p != "object")
|
|
370
|
-
return;
|
|
371
|
-
var id = p.tabstopId;
|
|
372
|
-
var ts = tabstops[id];
|
|
373
|
-
if (!ts) {
|
|
374
|
-
ts = tabstops[id] = [];
|
|
375
|
-
ts.index = id;
|
|
376
|
-
ts.value = "";
|
|
377
|
-
ts.parents = {};
|
|
378
|
-
}
|
|
379
|
-
if (ts.indexOf(p) !== -1)
|
|
380
|
-
return;
|
|
381
|
-
if (p.choices && !ts.choices)
|
|
382
|
-
ts.choices = p.choices;
|
|
383
|
-
ts.push(p);
|
|
384
|
-
var i1 = tokens.indexOf(p, i + 1);
|
|
385
|
-
if (i1 === -1)
|
|
386
|
-
return;
|
|
387
|
-
|
|
388
|
-
var value = tokens.slice(i + 1, i1);
|
|
389
|
-
var isNested = value.some(function(t) {return typeof t === "object";});
|
|
390
|
-
if (isNested && !ts.value) {
|
|
391
|
-
ts.value = value;
|
|
392
|
-
} else if (value.length && (!ts.value || typeof ts.value !== "string")) {
|
|
393
|
-
ts.value = value.join("");
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
tabstops.forEach(function(ts) {ts.length = 0;});
|
|
397
|
-
var expanding = {};
|
|
398
|
-
function copyValue(val) {
|
|
399
|
-
var copy = [];
|
|
400
|
-
for (var i = 0; i < val.length; i++) {
|
|
401
|
-
var p = val[i];
|
|
402
|
-
if (typeof p == "object") {
|
|
403
|
-
if (expanding[p.tabstopId])
|
|
404
|
-
continue;
|
|
405
|
-
var j = val.lastIndexOf(p, i - 1);
|
|
406
|
-
p = copy[j] || {tabstopId: p.tabstopId};
|
|
407
|
-
}
|
|
408
|
-
copy[i] = p;
|
|
409
|
-
}
|
|
410
|
-
return copy;
|
|
411
|
-
}
|
|
412
|
-
for (var i = 0; i < tokens.length; i++) {
|
|
413
|
-
var p = tokens[i];
|
|
414
|
-
if (typeof p != "object")
|
|
415
|
-
continue;
|
|
416
|
-
var id = p.tabstopId;
|
|
417
|
-
var ts = tabstops[id];
|
|
418
|
-
var i1 = tokens.indexOf(p, i + 1);
|
|
419
|
-
if (expanding[id]) {
|
|
420
|
-
if (expanding[id] === p) {
|
|
421
|
-
delete expanding[id];
|
|
422
|
-
Object.keys(expanding).forEach(function(parentId) {
|
|
423
|
-
ts.parents[parentId] = true;
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
continue;
|
|
427
|
-
}
|
|
428
|
-
expanding[id] = p;
|
|
429
|
-
var value = ts.value;
|
|
430
|
-
if (typeof value !== "string")
|
|
431
|
-
value = copyValue(value);
|
|
432
|
-
else if (p.fmt)
|
|
433
|
-
value = this.tmStrFormat(value, p, editor);
|
|
434
|
-
tokens.splice.apply(tokens, [i + 1, Math.max(0, i1 - i)].concat(value, p));
|
|
435
|
-
|
|
436
|
-
if (ts.indexOf(p) === -1)
|
|
437
|
-
ts.push(p);
|
|
438
|
-
}
|
|
439
|
-
var row = 0, column = 0;
|
|
440
|
-
var text = "";
|
|
441
|
-
tokens.forEach(function(t) {
|
|
442
|
-
if (typeof t === "string") {
|
|
443
|
-
var lines = t.split("\n");
|
|
444
|
-
if (lines.length > 1){
|
|
445
|
-
column = lines[lines.length - 1].length;
|
|
446
|
-
row += lines.length - 1;
|
|
447
|
-
} else
|
|
448
|
-
column += t.length;
|
|
449
|
-
text += t;
|
|
450
|
-
} else if (t) {
|
|
451
|
-
if (!t.start)
|
|
452
|
-
t.start = {row: row, column: column};
|
|
453
|
-
else
|
|
454
|
-
t.end = {row: row, column: column};
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
var range = editor.getSelectionRange();
|
|
458
|
-
var end = editor.session.replace(range, text);
|
|
459
|
-
|
|
460
|
-
var tabstopManager = new TabstopManager(editor);
|
|
461
|
-
var selectionId = editor.inVirtualSelectionMode && editor.selection.index;
|
|
462
|
-
tabstopManager.addTabstops(tabstops, range.start, end, selectionId);
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
this.insertSnippet = function(editor, snippetText) {
|
|
466
|
-
var self = this;
|
|
467
|
-
if (editor.inVirtualSelectionMode)
|
|
468
|
-
return self.insertSnippetForSelection(editor, snippetText);
|
|
469
|
-
|
|
470
|
-
editor.forEachSelection(function() {
|
|
471
|
-
self.insertSnippetForSelection(editor, snippetText);
|
|
472
|
-
}, null, {keepOrder: true});
|
|
473
|
-
|
|
474
|
-
if (editor.tabstopManager)
|
|
475
|
-
editor.tabstopManager.tabNext();
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
this.$getScope = function(editor) {
|
|
479
|
-
var scope = editor.session.$mode.$id || "";
|
|
480
|
-
scope = scope.split("/").pop();
|
|
481
|
-
if (scope === "html" || scope === "php") {
|
|
482
|
-
if (scope === "php" && !editor.session.$mode.inlinePhp)
|
|
483
|
-
scope = "html";
|
|
484
|
-
var c = editor.getCursorPosition();
|
|
485
|
-
var state = editor.session.getState(c.row);
|
|
486
|
-
if (typeof state === "object") {
|
|
487
|
-
state = state[0];
|
|
488
|
-
}
|
|
489
|
-
if (state.substring) {
|
|
490
|
-
if (state.substring(0, 3) == "js-")
|
|
491
|
-
scope = "javascript";
|
|
492
|
-
else if (state.substring(0, 4) == "css-")
|
|
493
|
-
scope = "css";
|
|
494
|
-
else if (state.substring(0, 4) == "php-")
|
|
495
|
-
scope = "php";
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
return scope;
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
this.getActiveScopes = function(editor) {
|
|
503
|
-
var scope = this.$getScope(editor);
|
|
504
|
-
var scopes = [scope];
|
|
505
|
-
var snippetMap = this.snippetMap;
|
|
506
|
-
if (snippetMap[scope] && snippetMap[scope].includeScopes) {
|
|
507
|
-
scopes.push.apply(scopes, snippetMap[scope].includeScopes);
|
|
508
|
-
}
|
|
509
|
-
scopes.push("_");
|
|
510
|
-
return scopes;
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
this.expandWithTab = function(editor, options) {
|
|
514
|
-
var self = this;
|
|
515
|
-
var result = editor.forEachSelection(function() {
|
|
516
|
-
return self.expandSnippetForSelection(editor, options);
|
|
517
|
-
}, null, {keepOrder: true});
|
|
518
|
-
if (result && editor.tabstopManager)
|
|
519
|
-
editor.tabstopManager.tabNext();
|
|
520
|
-
return result;
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
this.expandSnippetForSelection = function(editor, options) {
|
|
524
|
-
var cursor = editor.getCursorPosition();
|
|
525
|
-
var line = editor.session.getLine(cursor.row);
|
|
526
|
-
var before = line.substring(0, cursor.column);
|
|
527
|
-
var after = line.substr(cursor.column);
|
|
528
|
-
|
|
529
|
-
var snippetMap = this.snippetMap;
|
|
530
|
-
var snippet;
|
|
531
|
-
this.getActiveScopes(editor).some(function(scope) {
|
|
532
|
-
var snippets = snippetMap[scope];
|
|
533
|
-
if (snippets)
|
|
534
|
-
snippet = this.findMatchingSnippet(snippets, before, after);
|
|
535
|
-
return !!snippet;
|
|
536
|
-
}, this);
|
|
537
|
-
if (!snippet)
|
|
538
|
-
return false;
|
|
539
|
-
if (options && options.dryRun)
|
|
540
|
-
return true;
|
|
541
|
-
editor.session.doc.removeInLine(cursor.row,
|
|
542
|
-
cursor.column - snippet.replaceBefore.length,
|
|
543
|
-
cursor.column + snippet.replaceAfter.length
|
|
544
|
-
);
|
|
545
|
-
|
|
546
|
-
this.variables.M__ = snippet.matchBefore;
|
|
547
|
-
this.variables.T__ = snippet.matchAfter;
|
|
548
|
-
this.insertSnippetForSelection(editor, snippet.content);
|
|
549
|
-
|
|
550
|
-
this.variables.M__ = this.variables.T__ = null;
|
|
551
|
-
return true;
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
this.findMatchingSnippet = function(snippetList, before, after) {
|
|
555
|
-
for (var i = snippetList.length; i--;) {
|
|
556
|
-
var s = snippetList[i];
|
|
557
|
-
if (s.startRe && !s.startRe.test(before))
|
|
558
|
-
continue;
|
|
559
|
-
if (s.endRe && !s.endRe.test(after))
|
|
560
|
-
continue;
|
|
561
|
-
if (!s.startRe && !s.endRe)
|
|
562
|
-
continue;
|
|
563
|
-
|
|
564
|
-
s.matchBefore = s.startRe ? s.startRe.exec(before) : [""];
|
|
565
|
-
s.matchAfter = s.endRe ? s.endRe.exec(after) : [""];
|
|
566
|
-
s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : "";
|
|
567
|
-
s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : "";
|
|
568
|
-
return s;
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
this.snippetMap = {};
|
|
573
|
-
this.snippetNameMap = {};
|
|
574
|
-
this.register = function(snippets, scope) {
|
|
575
|
-
var snippetMap = this.snippetMap;
|
|
576
|
-
var snippetNameMap = this.snippetNameMap;
|
|
577
|
-
var self = this;
|
|
578
|
-
|
|
579
|
-
if (!snippets)
|
|
580
|
-
snippets = [];
|
|
581
|
-
|
|
582
|
-
function wrapRegexp(src) {
|
|
583
|
-
if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src))
|
|
584
|
-
src = "(?:" + src + ")";
|
|
585
|
-
|
|
586
|
-
return src || "";
|
|
587
|
-
}
|
|
588
|
-
function guardedRegexp(re, guard, opening) {
|
|
589
|
-
re = wrapRegexp(re);
|
|
590
|
-
guard = wrapRegexp(guard);
|
|
591
|
-
if (opening) {
|
|
592
|
-
re = guard + re;
|
|
593
|
-
if (re && re[re.length - 1] != "$")
|
|
594
|
-
re = re + "$";
|
|
595
|
-
} else {
|
|
596
|
-
re = re + guard;
|
|
597
|
-
if (re && re[0] != "^")
|
|
598
|
-
re = "^" + re;
|
|
599
|
-
}
|
|
600
|
-
return new RegExp(re);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
function addSnippet(s) {
|
|
604
|
-
if (!s.scope)
|
|
605
|
-
s.scope = scope || "_";
|
|
606
|
-
scope = s.scope;
|
|
607
|
-
if (!snippetMap[scope]) {
|
|
608
|
-
snippetMap[scope] = [];
|
|
609
|
-
snippetNameMap[scope] = {};
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
var map = snippetNameMap[scope];
|
|
613
|
-
if (s.name) {
|
|
614
|
-
var old = map[s.name];
|
|
615
|
-
if (old)
|
|
616
|
-
self.unregister(old);
|
|
617
|
-
map[s.name] = s;
|
|
618
|
-
}
|
|
619
|
-
snippetMap[scope].push(s);
|
|
620
|
-
|
|
621
|
-
if (s.prefix)
|
|
622
|
-
s.tabTrigger = s.prefix;
|
|
623
|
-
|
|
624
|
-
if (!s.content && s.body)
|
|
625
|
-
s.content = Array.isArray(s.body) ? s.body.join("\n") : s.body;
|
|
626
|
-
|
|
627
|
-
if (s.tabTrigger && !s.trigger) {
|
|
628
|
-
if (!s.guard && /^\w/.test(s.tabTrigger))
|
|
629
|
-
s.guard = "\\b";
|
|
630
|
-
s.trigger = lang.escapeRegExp(s.tabTrigger);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard)
|
|
634
|
-
return;
|
|
635
|
-
|
|
636
|
-
s.startRe = guardedRegexp(s.trigger, s.guard, true);
|
|
637
|
-
s.triggerRe = new RegExp(s.trigger);
|
|
638
|
-
|
|
639
|
-
s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true);
|
|
640
|
-
s.endTriggerRe = new RegExp(s.endTrigger);
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
if (Array.isArray(snippets)) {
|
|
644
|
-
snippets.forEach(addSnippet);
|
|
645
|
-
} else {
|
|
646
|
-
Object.keys(snippets).forEach(function(key) {
|
|
647
|
-
addSnippet(snippets[key]);
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
this._signal("registerSnippets", {scope: scope});
|
|
652
|
-
};
|
|
653
|
-
this.unregister = function(snippets, scope) {
|
|
654
|
-
var snippetMap = this.snippetMap;
|
|
655
|
-
var snippetNameMap = this.snippetNameMap;
|
|
656
|
-
|
|
657
|
-
function removeSnippet(s) {
|
|
658
|
-
var nameMap = snippetNameMap[s.scope||scope];
|
|
659
|
-
if (nameMap && nameMap[s.name]) {
|
|
660
|
-
delete nameMap[s.name];
|
|
661
|
-
var map = snippetMap[s.scope||scope];
|
|
662
|
-
var i = map && map.indexOf(s);
|
|
663
|
-
if (i >= 0)
|
|
664
|
-
map.splice(i, 1);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
if (snippets.content)
|
|
668
|
-
removeSnippet(snippets);
|
|
669
|
-
else if (Array.isArray(snippets))
|
|
670
|
-
snippets.forEach(removeSnippet);
|
|
671
|
-
};
|
|
672
|
-
this.parseSnippetFile = function(str) {
|
|
673
|
-
str = str.replace(/\r/g, "");
|
|
674
|
-
var list = [], snippet = {};
|
|
675
|
-
var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;
|
|
676
|
-
var m;
|
|
677
|
-
while (m = re.exec(str)) {
|
|
678
|
-
if (m[1]) {
|
|
679
|
-
try {
|
|
680
|
-
snippet = JSON.parse(m[1]);
|
|
681
|
-
list.push(snippet);
|
|
682
|
-
} catch (e) {}
|
|
683
|
-
} if (m[4]) {
|
|
684
|
-
snippet.content = m[4].replace(/^\t/gm, "");
|
|
685
|
-
list.push(snippet);
|
|
686
|
-
snippet = {};
|
|
687
|
-
} else {
|
|
688
|
-
var key = m[2], val = m[3];
|
|
689
|
-
if (key == "regex") {
|
|
690
|
-
var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g;
|
|
691
|
-
snippet.guard = guardRe.exec(val)[1];
|
|
692
|
-
snippet.trigger = guardRe.exec(val)[1];
|
|
693
|
-
snippet.endTrigger = guardRe.exec(val)[1];
|
|
694
|
-
snippet.endGuard = guardRe.exec(val)[1];
|
|
695
|
-
} else if (key == "snippet") {
|
|
696
|
-
snippet.tabTrigger = val.match(/^\S*/)[0];
|
|
697
|
-
if (!snippet.name)
|
|
698
|
-
snippet.name = val;
|
|
699
|
-
} else if (key) {
|
|
700
|
-
snippet[key] = val;
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
return list;
|
|
705
|
-
};
|
|
706
|
-
this.getSnippetByName = function(name, editor) {
|
|
707
|
-
var snippetMap = this.snippetNameMap;
|
|
708
|
-
var snippet;
|
|
709
|
-
this.getActiveScopes(editor).some(function(scope) {
|
|
710
|
-
var snippets = snippetMap[scope];
|
|
711
|
-
if (snippets)
|
|
712
|
-
snippet = snippets[name];
|
|
713
|
-
return !!snippet;
|
|
714
|
-
}, this);
|
|
715
|
-
return snippet;
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
}).call(SnippetManager.prototype);
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
var TabstopManager = function(editor) {
|
|
722
|
-
if (editor.tabstopManager)
|
|
723
|
-
return editor.tabstopManager;
|
|
724
|
-
editor.tabstopManager = this;
|
|
725
|
-
this.$onChange = this.onChange.bind(this);
|
|
726
|
-
this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule;
|
|
727
|
-
this.$onChangeSession = this.onChangeSession.bind(this);
|
|
728
|
-
this.$onAfterExec = this.onAfterExec.bind(this);
|
|
729
|
-
this.attach(editor);
|
|
730
|
-
};
|
|
731
|
-
(function() {
|
|
732
|
-
this.attach = function(editor) {
|
|
733
|
-
this.index = 0;
|
|
734
|
-
this.ranges = [];
|
|
735
|
-
this.tabstops = [];
|
|
736
|
-
this.$openTabstops = null;
|
|
737
|
-
this.selectedTabstop = null;
|
|
738
|
-
|
|
739
|
-
this.editor = editor;
|
|
740
|
-
this.editor.on("change", this.$onChange);
|
|
741
|
-
this.editor.on("changeSelection", this.$onChangeSelection);
|
|
742
|
-
this.editor.on("changeSession", this.$onChangeSession);
|
|
743
|
-
this.editor.commands.on("afterExec", this.$onAfterExec);
|
|
744
|
-
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
|
745
|
-
};
|
|
746
|
-
this.detach = function() {
|
|
747
|
-
this.tabstops.forEach(this.removeTabstopMarkers, this);
|
|
748
|
-
this.ranges = null;
|
|
749
|
-
this.tabstops = null;
|
|
750
|
-
this.selectedTabstop = null;
|
|
751
|
-
this.editor.removeListener("change", this.$onChange);
|
|
752
|
-
this.editor.removeListener("changeSelection", this.$onChangeSelection);
|
|
753
|
-
this.editor.removeListener("changeSession", this.$onChangeSession);
|
|
754
|
-
this.editor.commands.removeListener("afterExec", this.$onAfterExec);
|
|
755
|
-
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
|
756
|
-
this.editor.tabstopManager = null;
|
|
757
|
-
this.editor = null;
|
|
758
|
-
};
|
|
759
|
-
|
|
760
|
-
this.onChange = function(delta) {
|
|
761
|
-
var isRemove = delta.action[0] == "r";
|
|
762
|
-
var selectedTabstop = this.selectedTabstop || {};
|
|
763
|
-
var parents = selectedTabstop.parents || {};
|
|
764
|
-
var tabstops = (this.tabstops || []).slice();
|
|
765
|
-
for (var i = 0; i < tabstops.length; i++) {
|
|
766
|
-
var ts = tabstops[i];
|
|
767
|
-
var active = ts == selectedTabstop || parents[ts.index];
|
|
768
|
-
ts.rangeList.$bias = active ? 0 : 1;
|
|
769
|
-
|
|
770
|
-
if (delta.action == "remove" && ts !== selectedTabstop) {
|
|
771
|
-
var parentActive = ts.parents && ts.parents[selectedTabstop.index];
|
|
772
|
-
var startIndex = ts.rangeList.pointIndex(delta.start, parentActive);
|
|
773
|
-
startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1;
|
|
774
|
-
var endIndex = ts.rangeList.pointIndex(delta.end, parentActive);
|
|
775
|
-
endIndex = endIndex < 0 ? -endIndex - 1 : endIndex - 1;
|
|
776
|
-
var toRemove = ts.rangeList.ranges.slice(startIndex, endIndex);
|
|
777
|
-
for (var j = 0; j < toRemove.length; j++)
|
|
778
|
-
this.removeRange(toRemove[j]);
|
|
779
|
-
}
|
|
780
|
-
ts.rangeList.$onChange(delta);
|
|
781
|
-
}
|
|
782
|
-
var session = this.editor.session;
|
|
783
|
-
if (!this.$inChange && isRemove && session.getLength() == 1 && !session.getValue())
|
|
784
|
-
this.detach();
|
|
785
|
-
};
|
|
786
|
-
this.updateLinkedFields = function() {
|
|
787
|
-
var ts = this.selectedTabstop;
|
|
788
|
-
if (!ts || !ts.hasLinkedRanges || !ts.firstNonLinked)
|
|
789
|
-
return;
|
|
790
|
-
this.$inChange = true;
|
|
791
|
-
var session = this.editor.session;
|
|
792
|
-
var text = session.getTextRange(ts.firstNonLinked);
|
|
793
|
-
for (var i = 0; i < ts.length; i++) {
|
|
794
|
-
var range = ts[i];
|
|
795
|
-
if (!range.linked)
|
|
796
|
-
continue;
|
|
797
|
-
var original = range.original;
|
|
798
|
-
var fmt = exports.snippetManager.tmStrFormat(text, original, this.editor);
|
|
799
|
-
session.replace(range, fmt);
|
|
800
|
-
}
|
|
801
|
-
this.$inChange = false;
|
|
802
|
-
};
|
|
803
|
-
this.onAfterExec = function(e) {
|
|
804
|
-
if (e.command && !e.command.readOnly)
|
|
805
|
-
this.updateLinkedFields();
|
|
806
|
-
};
|
|
807
|
-
this.onChangeSelection = function() {
|
|
808
|
-
if (!this.editor)
|
|
809
|
-
return;
|
|
810
|
-
var lead = this.editor.selection.lead;
|
|
811
|
-
var anchor = this.editor.selection.anchor;
|
|
812
|
-
var isEmpty = this.editor.selection.isEmpty();
|
|
813
|
-
for (var i = 0; i < this.ranges.length; i++) {
|
|
814
|
-
if (this.ranges[i].linked)
|
|
815
|
-
continue;
|
|
816
|
-
var containsLead = this.ranges[i].contains(lead.row, lead.column);
|
|
817
|
-
var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column);
|
|
818
|
-
if (containsLead && containsAnchor)
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
this.detach();
|
|
822
|
-
};
|
|
823
|
-
this.onChangeSession = function() {
|
|
824
|
-
this.detach();
|
|
825
|
-
};
|
|
826
|
-
this.tabNext = function(dir) {
|
|
827
|
-
var max = this.tabstops.length;
|
|
828
|
-
var index = this.index + (dir || 1);
|
|
829
|
-
index = Math.min(Math.max(index, 1), max);
|
|
830
|
-
if (index == max)
|
|
831
|
-
index = 0;
|
|
832
|
-
this.selectTabstop(index);
|
|
833
|
-
if (index === 0)
|
|
834
|
-
this.detach();
|
|
835
|
-
};
|
|
836
|
-
this.selectTabstop = function(index) {
|
|
837
|
-
this.$openTabstops = null;
|
|
838
|
-
var ts = this.tabstops[this.index];
|
|
839
|
-
if (ts)
|
|
840
|
-
this.addTabstopMarkers(ts);
|
|
841
|
-
this.index = index;
|
|
842
|
-
ts = this.tabstops[this.index];
|
|
843
|
-
if (!ts || !ts.length)
|
|
844
|
-
return;
|
|
845
|
-
|
|
846
|
-
this.selectedTabstop = ts;
|
|
847
|
-
var range = ts.firstNonLinked || ts;
|
|
848
|
-
if (ts.choices) range.cursor = range.start;
|
|
849
|
-
if (!this.editor.inVirtualSelectionMode) {
|
|
850
|
-
var sel = this.editor.multiSelect;
|
|
851
|
-
sel.toSingleRange(range);
|
|
852
|
-
for (var i = 0; i < ts.length; i++) {
|
|
853
|
-
if (ts.hasLinkedRanges && ts[i].linked)
|
|
854
|
-
continue;
|
|
855
|
-
sel.addRange(ts[i].clone(), true);
|
|
856
|
-
}
|
|
857
|
-
} else {
|
|
858
|
-
this.editor.selection.fromOrientedRange(range);
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
|
862
|
-
if (this.selectedTabstop && this.selectedTabstop.choices)
|
|
863
|
-
this.editor.execCommand("startAutocomplete", {matches: this.selectedTabstop.choices});
|
|
864
|
-
};
|
|
865
|
-
this.addTabstops = function(tabstops, start, end) {
|
|
866
|
-
var useLink = this.useLink || !this.editor.getOption("enableMultiselect");
|
|
867
|
-
|
|
868
|
-
if (!this.$openTabstops)
|
|
869
|
-
this.$openTabstops = [];
|
|
870
|
-
if (!tabstops[0]) {
|
|
871
|
-
var p = Range.fromPoints(end, end);
|
|
872
|
-
moveRelative(p.start, start);
|
|
873
|
-
moveRelative(p.end, start);
|
|
874
|
-
tabstops[0] = [p];
|
|
875
|
-
tabstops[0].index = 0;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
var i = this.index;
|
|
879
|
-
var arg = [i + 1, 0];
|
|
880
|
-
var ranges = this.ranges;
|
|
881
|
-
tabstops.forEach(function(ts, index) {
|
|
882
|
-
var dest = this.$openTabstops[index] || ts;
|
|
883
|
-
|
|
884
|
-
for (var i = 0; i < ts.length; i++) {
|
|
885
|
-
var p = ts[i];
|
|
886
|
-
var range = Range.fromPoints(p.start, p.end || p.start);
|
|
887
|
-
movePoint(range.start, start);
|
|
888
|
-
movePoint(range.end, start);
|
|
889
|
-
range.original = p;
|
|
890
|
-
range.tabstop = dest;
|
|
891
|
-
ranges.push(range);
|
|
892
|
-
if (dest != ts)
|
|
893
|
-
dest.unshift(range);
|
|
894
|
-
else
|
|
895
|
-
dest[i] = range;
|
|
896
|
-
if (p.fmtString || (dest.firstNonLinked && useLink)) {
|
|
897
|
-
range.linked = true;
|
|
898
|
-
dest.hasLinkedRanges = true;
|
|
899
|
-
} else if (!dest.firstNonLinked)
|
|
900
|
-
dest.firstNonLinked = range;
|
|
901
|
-
}
|
|
902
|
-
if (!dest.firstNonLinked)
|
|
903
|
-
dest.hasLinkedRanges = false;
|
|
904
|
-
if (dest === ts) {
|
|
905
|
-
arg.push(dest);
|
|
906
|
-
this.$openTabstops[index] = dest;
|
|
907
|
-
}
|
|
908
|
-
this.addTabstopMarkers(dest);
|
|
909
|
-
dest.rangeList = dest.rangeList || new RangeList();
|
|
910
|
-
dest.rangeList.$bias = 0;
|
|
911
|
-
dest.rangeList.addList(dest);
|
|
912
|
-
}, this);
|
|
913
|
-
|
|
914
|
-
if (arg.length > 2) {
|
|
915
|
-
if (this.tabstops.length)
|
|
916
|
-
arg.push(arg.splice(2, 1)[0]);
|
|
917
|
-
this.tabstops.splice.apply(this.tabstops, arg);
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
this.addTabstopMarkers = function(ts) {
|
|
922
|
-
var session = this.editor.session;
|
|
923
|
-
ts.forEach(function(range) {
|
|
924
|
-
if (!range.markerId)
|
|
925
|
-
range.markerId = session.addMarker(range, "ace_snippet-marker", "text");
|
|
926
|
-
});
|
|
927
|
-
};
|
|
928
|
-
this.removeTabstopMarkers = function(ts) {
|
|
929
|
-
var session = this.editor.session;
|
|
930
|
-
ts.forEach(function(range) {
|
|
931
|
-
session.removeMarker(range.markerId);
|
|
932
|
-
range.markerId = null;
|
|
933
|
-
});
|
|
934
|
-
};
|
|
935
|
-
this.removeRange = function(range) {
|
|
936
|
-
var i = range.tabstop.indexOf(range);
|
|
937
|
-
if (i != -1) range.tabstop.splice(i, 1);
|
|
938
|
-
i = this.ranges.indexOf(range);
|
|
939
|
-
if (i != -1) this.ranges.splice(i, 1);
|
|
940
|
-
i = range.tabstop.rangeList.ranges.indexOf(range);
|
|
941
|
-
if (i != -1) range.tabstop.splice(i, 1);
|
|
942
|
-
this.editor.session.removeMarker(range.markerId);
|
|
943
|
-
if (!range.tabstop.length) {
|
|
944
|
-
i = this.tabstops.indexOf(range.tabstop);
|
|
945
|
-
if (i != -1)
|
|
946
|
-
this.tabstops.splice(i, 1);
|
|
947
|
-
if (!this.tabstops.length)
|
|
948
|
-
this.detach();
|
|
949
|
-
}
|
|
950
|
-
};
|
|
951
|
-
|
|
952
|
-
this.keyboardHandler = new HashHandler();
|
|
953
|
-
this.keyboardHandler.bindKeys({
|
|
954
|
-
"Tab": function(editor) {
|
|
955
|
-
if (exports.snippetManager && exports.snippetManager.expandWithTab(editor))
|
|
956
|
-
return;
|
|
957
|
-
editor.tabstopManager.tabNext(1);
|
|
958
|
-
editor.renderer.scrollCursorIntoView();
|
|
959
|
-
},
|
|
960
|
-
"Shift-Tab": function(editor) {
|
|
961
|
-
editor.tabstopManager.tabNext(-1);
|
|
962
|
-
editor.renderer.scrollCursorIntoView();
|
|
963
|
-
},
|
|
964
|
-
"Esc": function(editor) {
|
|
965
|
-
editor.tabstopManager.detach();
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
}).call(TabstopManager.prototype);
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
var movePoint = function(point, diff) {
|
|
973
|
-
if (point.row == 0)
|
|
974
|
-
point.column += diff.column;
|
|
975
|
-
point.row += diff.row;
|
|
976
|
-
};
|
|
977
|
-
|
|
978
|
-
var moveRelative = function(point, start) {
|
|
979
|
-
if (point.row == start.row)
|
|
980
|
-
point.column -= start.column;
|
|
981
|
-
point.row -= start.row;
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
dom.importCssString("\
|
|
986
|
-
.ace_snippet-marker {\
|
|
987
|
-
-moz-box-sizing: border-box;\
|
|
988
|
-
box-sizing: border-box;\
|
|
989
|
-
background: rgba(194, 193, 208, 0.09);\
|
|
990
|
-
border: 1px dotted rgba(211, 208, 235, 0.62);\
|
|
991
|
-
position: absolute;\
|
|
992
|
-
}", "snippets.css", false);
|
|
993
|
-
|
|
994
|
-
exports.snippetManager = new SnippetManager();
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
var Editor = require("./editor").Editor;
|
|
998
|
-
(function() {
|
|
999
|
-
this.insertSnippet = function(content, options) {
|
|
1000
|
-
return exports.snippetManager.insertSnippet(this, content, options);
|
|
1001
|
-
};
|
|
1002
|
-
this.expandSnippet = function(options) {
|
|
1003
|
-
return exports.snippetManager.expandWithTab(this, options);
|
|
1004
|
-
};
|
|
1005
|
-
}).call(Editor.prototype);
|
|
1006
|
-
|
|
1007
|
-
});
|
|
1008
|
-
|
|
1009
|
-
ace.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) {
|
|
1010
|
-
"use strict";
|
|
1011
|
-
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
|
1012
|
-
var Editor = require("../editor").Editor;
|
|
1013
|
-
var snippetManager = require("../snippets").snippetManager;
|
|
1014
|
-
var Range = require("../range").Range;
|
|
1015
|
-
var config = require("../config");
|
|
1016
|
-
var emmet, emmetPath;
|
|
1017
|
-
function AceEmmetEditor() {}
|
|
1018
|
-
|
|
1019
|
-
AceEmmetEditor.prototype = {
|
|
1020
|
-
setupContext: function(editor) {
|
|
1021
|
-
this.ace = editor;
|
|
1022
|
-
this.indentation = editor.session.getTabString();
|
|
1023
|
-
if (!emmet)
|
|
1024
|
-
emmet = window.emmet;
|
|
1025
|
-
var resources = emmet.resources || emmet.require("resources");
|
|
1026
|
-
resources.setVariable("indentation", this.indentation);
|
|
1027
|
-
this.$syntax = null;
|
|
1028
|
-
this.$syntax = this.getSyntax();
|
|
1029
|
-
},
|
|
1030
|
-
getSelectionRange: function() {
|
|
1031
|
-
var range = this.ace.getSelectionRange();
|
|
1032
|
-
var doc = this.ace.session.doc;
|
|
1033
|
-
return {
|
|
1034
|
-
start: doc.positionToIndex(range.start),
|
|
1035
|
-
end: doc.positionToIndex(range.end)
|
|
1036
|
-
};
|
|
1037
|
-
},
|
|
1038
|
-
createSelection: function(start, end) {
|
|
1039
|
-
var doc = this.ace.session.doc;
|
|
1040
|
-
this.ace.selection.setRange({
|
|
1041
|
-
start: doc.indexToPosition(start),
|
|
1042
|
-
end: doc.indexToPosition(end)
|
|
1043
|
-
});
|
|
1044
|
-
},
|
|
1045
|
-
getCurrentLineRange: function() {
|
|
1046
|
-
var ace = this.ace;
|
|
1047
|
-
var row = ace.getCursorPosition().row;
|
|
1048
|
-
var lineLength = ace.session.getLine(row).length;
|
|
1049
|
-
var index = ace.session.doc.positionToIndex({row: row, column: 0});
|
|
1050
|
-
return {
|
|
1051
|
-
start: index,
|
|
1052
|
-
end: index + lineLength
|
|
1053
|
-
};
|
|
1054
|
-
},
|
|
1055
|
-
getCaretPos: function(){
|
|
1056
|
-
var pos = this.ace.getCursorPosition();
|
|
1057
|
-
return this.ace.session.doc.positionToIndex(pos);
|
|
1058
|
-
},
|
|
1059
|
-
setCaretPos: function(index){
|
|
1060
|
-
var pos = this.ace.session.doc.indexToPosition(index);
|
|
1061
|
-
this.ace.selection.moveToPosition(pos);
|
|
1062
|
-
},
|
|
1063
|
-
getCurrentLine: function() {
|
|
1064
|
-
var row = this.ace.getCursorPosition().row;
|
|
1065
|
-
return this.ace.session.getLine(row);
|
|
1066
|
-
},
|
|
1067
|
-
replaceContent: function(value, start, end, noIndent) {
|
|
1068
|
-
if (end == null)
|
|
1069
|
-
end = start == null ? this.getContent().length : start;
|
|
1070
|
-
if (start == null)
|
|
1071
|
-
start = 0;
|
|
1072
|
-
|
|
1073
|
-
var editor = this.ace;
|
|
1074
|
-
var doc = editor.session.doc;
|
|
1075
|
-
var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end));
|
|
1076
|
-
editor.session.remove(range);
|
|
1077
|
-
|
|
1078
|
-
range.end = range.start;
|
|
1079
|
-
|
|
1080
|
-
value = this.$updateTabstops(value);
|
|
1081
|
-
snippetManager.insertSnippet(editor, value);
|
|
1082
|
-
},
|
|
1083
|
-
getContent: function(){
|
|
1084
|
-
return this.ace.getValue();
|
|
1085
|
-
},
|
|
1086
|
-
getSyntax: function() {
|
|
1087
|
-
if (this.$syntax)
|
|
1088
|
-
return this.$syntax;
|
|
1089
|
-
var syntax = this.ace.session.$modeId.split("/").pop();
|
|
1090
|
-
if (syntax == "html" || syntax == "php") {
|
|
1091
|
-
var cursor = this.ace.getCursorPosition();
|
|
1092
|
-
var state = this.ace.session.getState(cursor.row);
|
|
1093
|
-
if (typeof state != "string")
|
|
1094
|
-
state = state[0];
|
|
1095
|
-
if (state) {
|
|
1096
|
-
state = state.split("-");
|
|
1097
|
-
if (state.length > 1)
|
|
1098
|
-
syntax = state[0];
|
|
1099
|
-
else if (syntax == "php")
|
|
1100
|
-
syntax = "html";
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
return syntax;
|
|
1104
|
-
},
|
|
1105
|
-
getProfileName: function() {
|
|
1106
|
-
var resources = emmet.resources || emmet.require("resources");
|
|
1107
|
-
switch (this.getSyntax()) {
|
|
1108
|
-
case "css": return "css";
|
|
1109
|
-
case "xml":
|
|
1110
|
-
case "xsl":
|
|
1111
|
-
return "xml";
|
|
1112
|
-
case "html":
|
|
1113
|
-
var profile = resources.getVariable("profile");
|
|
1114
|
-
if (!profile)
|
|
1115
|
-
profile = this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i) != -1 ? "xhtml": "html";
|
|
1116
|
-
return profile;
|
|
1117
|
-
default:
|
|
1118
|
-
var mode = this.ace.session.$mode;
|
|
1119
|
-
return mode.emmetConfig && mode.emmetConfig.profile || "xhtml";
|
|
1120
|
-
}
|
|
1121
|
-
},
|
|
1122
|
-
prompt: function(title) {
|
|
1123
|
-
return prompt(title); // eslint-disable-line no-alert
|
|
1124
|
-
},
|
|
1125
|
-
getSelection: function() {
|
|
1126
|
-
return this.ace.session.getTextRange();
|
|
1127
|
-
},
|
|
1128
|
-
getFilePath: function() {
|
|
1129
|
-
return "";
|
|
1130
|
-
},
|
|
1131
|
-
$updateTabstops: function(value) {
|
|
1132
|
-
var base = 1000;
|
|
1133
|
-
var zeroBase = 0;
|
|
1134
|
-
var lastZero = null;
|
|
1135
|
-
var ts = emmet.tabStops || emmet.require('tabStops');
|
|
1136
|
-
var resources = emmet.resources || emmet.require("resources");
|
|
1137
|
-
var settings = resources.getVocabulary("user");
|
|
1138
|
-
var tabstopOptions = {
|
|
1139
|
-
tabstop: function(data) {
|
|
1140
|
-
var group = parseInt(data.group, 10);
|
|
1141
|
-
var isZero = group === 0;
|
|
1142
|
-
if (isZero)
|
|
1143
|
-
group = ++zeroBase;
|
|
1144
|
-
else
|
|
1145
|
-
group += base;
|
|
1146
|
-
|
|
1147
|
-
var placeholder = data.placeholder;
|
|
1148
|
-
if (placeholder) {
|
|
1149
|
-
placeholder = ts.processText(placeholder, tabstopOptions);
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}';
|
|
1153
|
-
|
|
1154
|
-
if (isZero) {
|
|
1155
|
-
lastZero = [data.start, result];
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
return result;
|
|
1159
|
-
},
|
|
1160
|
-
escape: function(ch) {
|
|
1161
|
-
if (ch == '$') return '\\$';
|
|
1162
|
-
if (ch == '\\') return '\\\\';
|
|
1163
|
-
return ch;
|
|
1164
|
-
}
|
|
1165
|
-
};
|
|
1166
|
-
|
|
1167
|
-
value = ts.processText(value, tabstopOptions);
|
|
1168
|
-
|
|
1169
|
-
if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) {
|
|
1170
|
-
value += '${0}';
|
|
1171
|
-
} else if (lastZero) {
|
|
1172
|
-
var common = emmet.utils ? emmet.utils.common : emmet.require('utils');
|
|
1173
|
-
value = common.replaceSubstring(value, '${0}', lastZero[0], lastZero[1]);
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
return value;
|
|
1177
|
-
}
|
|
1178
|
-
};
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
var keymap = {
|
|
1182
|
-
expand_abbreviation: {"mac": "ctrl+alt+e", "win": "alt+e"},
|
|
1183
|
-
match_pair_outward: {"mac": "ctrl+d", "win": "ctrl+,"},
|
|
1184
|
-
match_pair_inward: {"mac": "ctrl+j", "win": "ctrl+shift+0"},
|
|
1185
|
-
matching_pair: {"mac": "ctrl+alt+j", "win": "alt+j"},
|
|
1186
|
-
next_edit_point: "alt+right",
|
|
1187
|
-
prev_edit_point: "alt+left",
|
|
1188
|
-
toggle_comment: {"mac": "command+/", "win": "ctrl+/"},
|
|
1189
|
-
split_join_tag: {"mac": "shift+command+'", "win": "shift+ctrl+`"},
|
|
1190
|
-
remove_tag: {"mac": "command+'", "win": "shift+ctrl+;"},
|
|
1191
|
-
evaluate_math_expression: {"mac": "shift+command+y", "win": "shift+ctrl+y"},
|
|
1192
|
-
increment_number_by_1: "ctrl+up",
|
|
1193
|
-
decrement_number_by_1: "ctrl+down",
|
|
1194
|
-
increment_number_by_01: "alt+up",
|
|
1195
|
-
decrement_number_by_01: "alt+down",
|
|
1196
|
-
increment_number_by_10: {"mac": "alt+command+up", "win": "shift+alt+up"},
|
|
1197
|
-
decrement_number_by_10: {"mac": "alt+command+down", "win": "shift+alt+down"},
|
|
1198
|
-
select_next_item: {"mac": "shift+command+.", "win": "shift+ctrl+."},
|
|
1199
|
-
select_previous_item: {"mac": "shift+command+,", "win": "shift+ctrl+,"},
|
|
1200
|
-
reflect_css_value: {"mac": "shift+command+r", "win": "shift+ctrl+r"},
|
|
1201
|
-
|
|
1202
|
-
encode_decode_data_url: {"mac": "shift+ctrl+d", "win": "ctrl+'"},
|
|
1203
|
-
expand_abbreviation_with_tab: "Tab",
|
|
1204
|
-
wrap_with_abbreviation: {"mac": "shift+ctrl+a", "win": "shift+ctrl+a"}
|
|
1205
|
-
};
|
|
1206
|
-
|
|
1207
|
-
var editorProxy = new AceEmmetEditor();
|
|
1208
|
-
exports.commands = new HashHandler();
|
|
1209
|
-
exports.runEmmetCommand = function runEmmetCommand(editor) {
|
|
1210
|
-
if (this.action == "expand_abbreviation_with_tab") {
|
|
1211
|
-
if (!editor.selection.isEmpty())
|
|
1212
|
-
return false;
|
|
1213
|
-
var pos = editor.selection.lead;
|
|
1214
|
-
var token = editor.session.getTokenAt(pos.row, pos.column);
|
|
1215
|
-
if (token && /\btag\b/.test(token.type))
|
|
1216
|
-
return false;
|
|
1217
|
-
}
|
|
1218
|
-
try {
|
|
1219
|
-
editorProxy.setupContext(editor);
|
|
1220
|
-
var actions = emmet.actions || emmet.require("actions");
|
|
1221
|
-
|
|
1222
|
-
if (this.action == "wrap_with_abbreviation") {
|
|
1223
|
-
return setTimeout(function() {
|
|
1224
|
-
actions.run("wrap_with_abbreviation", editorProxy);
|
|
1225
|
-
}, 0);
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
var result = actions.run(this.action, editorProxy);
|
|
1229
|
-
} catch(e) {
|
|
1230
|
-
if (!emmet) {
|
|
1231
|
-
var loading = exports.load(runEmmetCommand.bind(this, editor));
|
|
1232
|
-
if (this.action == "expand_abbreviation_with_tab")
|
|
1233
|
-
return false;
|
|
1234
|
-
return loading;
|
|
1235
|
-
}
|
|
1236
|
-
editor._signal("changeStatus", typeof e == "string" ? e : e.message);
|
|
1237
|
-
config.warn(e);
|
|
1238
|
-
result = false;
|
|
1239
|
-
}
|
|
1240
|
-
return result;
|
|
1241
|
-
};
|
|
1242
|
-
|
|
1243
|
-
for (var command in keymap) {
|
|
1244
|
-
exports.commands.addCommand({
|
|
1245
|
-
name: "emmet:" + command,
|
|
1246
|
-
action: command,
|
|
1247
|
-
bindKey: keymap[command],
|
|
1248
|
-
exec: exports.runEmmetCommand,
|
|
1249
|
-
multiSelectAction: "forEach"
|
|
1250
|
-
});
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
exports.updateCommands = function(editor, enabled) {
|
|
1254
|
-
if (enabled) {
|
|
1255
|
-
editor.keyBinding.addKeyboardHandler(exports.commands);
|
|
1256
|
-
} else {
|
|
1257
|
-
editor.keyBinding.removeKeyboardHandler(exports.commands);
|
|
1258
|
-
}
|
|
1259
|
-
};
|
|
1260
|
-
|
|
1261
|
-
exports.isSupportedMode = function(mode) {
|
|
1262
|
-
if (!mode) return false;
|
|
1263
|
-
if (mode.emmetConfig) return true;
|
|
1264
|
-
var id = mode.$id || mode;
|
|
1265
|
-
return /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(id);
|
|
1266
|
-
};
|
|
1267
|
-
|
|
1268
|
-
exports.isAvailable = function(editor, command) {
|
|
1269
|
-
if (/(evaluate_math_expression|expand_abbreviation)$/.test(command))
|
|
1270
|
-
return true;
|
|
1271
|
-
var mode = editor.session.$mode;
|
|
1272
|
-
var isSupported = exports.isSupportedMode(mode);
|
|
1273
|
-
if (isSupported && mode.$modes) {
|
|
1274
|
-
try {
|
|
1275
|
-
editorProxy.setupContext(editor);
|
|
1276
|
-
if (/js|php/.test(editorProxy.getSyntax()))
|
|
1277
|
-
isSupported = false;
|
|
1278
|
-
} catch(e) {}
|
|
1279
|
-
}
|
|
1280
|
-
return isSupported;
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
|
-
var onChangeMode = function(e, target) {
|
|
1284
|
-
var editor = target;
|
|
1285
|
-
if (!editor)
|
|
1286
|
-
return;
|
|
1287
|
-
var enabled = exports.isSupportedMode(editor.session.$mode);
|
|
1288
|
-
if (e.enableEmmet === false)
|
|
1289
|
-
enabled = false;
|
|
1290
|
-
if (enabled)
|
|
1291
|
-
exports.load();
|
|
1292
|
-
exports.updateCommands(editor, enabled);
|
|
1293
|
-
};
|
|
1294
|
-
|
|
1295
|
-
exports.load = function(cb) {
|
|
1296
|
-
if (typeof emmetPath !== "string") {
|
|
1297
|
-
config.warn("script for emmet-core is not loaded");
|
|
1298
|
-
return false;
|
|
1299
|
-
}
|
|
1300
|
-
config.loadModule(emmetPath, function() {
|
|
1301
|
-
emmetPath = null;
|
|
1302
|
-
cb && cb();
|
|
1303
|
-
});
|
|
1304
|
-
return true;
|
|
1305
|
-
};
|
|
1306
|
-
|
|
1307
|
-
exports.AceEmmetEditor = AceEmmetEditor;
|
|
1308
|
-
config.defineOptions(Editor.prototype, "editor", {
|
|
1309
|
-
enableEmmet: {
|
|
1310
|
-
set: function(val) {
|
|
1311
|
-
this[val ? "on" : "removeListener"]("changeMode", onChangeMode);
|
|
1312
|
-
onChangeMode({enableEmmet: !!val}, this);
|
|
1313
|
-
},
|
|
1314
|
-
value: true
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
|
|
1318
|
-
exports.setCore = function(e) {
|
|
1319
|
-
if (typeof e == "string")
|
|
1320
|
-
emmetPath = e;
|
|
1321
|
-
else
|
|
1322
|
-
emmet = e;
|
|
1323
|
-
};
|
|
1324
|
-
}); (function() {
|
|
1325
|
-
ace.require(["ace/ext/emmet"], function(m) {
|
|
1326
|
-
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
1327
|
-
module.exports = m;
|
|
1328
|
-
}
|
|
1329
|
-
});
|
|
1330
|
-
})();
|
|
1331
|
-
|
|
1
|
+
ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,n){"use strict";var i=e("./lib/dom"),r=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,a=e("./lib/lang"),o=e("./range").Range,c=e("./range_list").RangeList,h=e("./keyboard/hash_handler").HashHandler,l=e("./tokenizer").Tokenizer,u=e("./clipboard"),p={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var i=e.session.getTextRange();return n?i.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):i},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return u.getText&&u.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:d.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:d.bind(null,{year:"2-digit"}),CURRENT_MONTH:d.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:d.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:d.bind(null,{month:"short"}),CURRENT_DATE:d.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:d.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:d.bind(null,{weekday:"short"}),CURRENT_HOUR:d.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:d.bind(null,{minute:"2-digit"}),CURRENT_SECOND:d.bind(null,{second:"2-digit"})};function d(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}p.SELECTED_TEXT=p.SELECTION;var g=function(){this.snippetMap={},this.snippetNameMap={}};(function(){r.implement(this,s),this.getTokenizer=function(){return g.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(e,t,n){var i=n[0];return i.fmtString=!0,i.guard=e.slice(1,-1),i.flag="",""},next:"formatString"};return g.$tokenizer=new l({start:[{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return("}"==i&&n.length||-1!="`$\\".indexOf(i))&&(e=i),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,i){var r=e(t.substr(1));return i.unshift(r[0]),r},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){var i=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}}));return n[0].choices=i,[i[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length||-1!="`$\\".indexOf(i)?e=i:"n"==i?e="\n":"t"==i?e="\t":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:i>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var i=n.shift();return i&&(i.flag=e.slice(1,-1)),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var i={text:e.slice(2)};return n.unshift(i),[i]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var i=n.shift();return this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]})},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var i=this.variables[t];return"function"==typeof i&&(i=this.variables[t](e,t,n)),null==i?"":i},this.variables=p,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var i=t.flag||"",r=t.guard;r=new RegExp(r,i.replace(/[^gim]/g,""));var s="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,a=this;return e.replace(r,(function(){var e=a.variables.__;a.variables.__=[].slice.call(arguments);for(var t=a.resolveVariables(s,n),i="E",r=0;r<t.length;r++){var o=t[r];if("object"==typeof o)if(t[r]="",o.changeCase&&o.local){var c=t[r+1];c&&"string"==typeof c&&("u"==o.changeCase?t[r]=c[0].toUpperCase():t[r]=c[0].toLowerCase(),t[r+1]=c.substr(1))}else o.changeCase&&(i=o.changeCase);else"U"==i?t[r]=o.toUpperCase():"L"==i&&(t[r]=o.toLowerCase())}return a.variables.__=e,t.join("")}))},this.tmFormatFunction=function(e,t,n){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},this.resolveVariables=function(e,t){for(var n=[],i="",r=!0,s=0;s<e.length;s++){var a=e[s];if("string"!=typeof a){if(a){if(r=!1,a.fmtString){var o=e.indexOf(a,s+1);-1==o&&(o=e.length),a.fmt=e.slice(s+1,o),s=o}if(a.text){var c=this.getVariableValue(t,a.text,i)+"";a.fmtString&&(c=this.tmStrFormat(c,a,t)),a.formatFunction&&(c=this.tmFormatFunction(c,a,t)),c&&!a.ifEnd?(n.push(c),h(a)):!c&&a.ifEnd&&h(a.ifEnd)}else a.elseEnd?h(a.elseEnd):(null!=a.tabstopId||null!=a.changeCase)&&n.push(a)}}else n.push(a),"\n"==a?(r=!0,i=""):r&&(i=/^\t*/.exec(a)[0],r=/\S/.test(a))}function h(t){var n=e.indexOf(t,s+1);-1!=n&&(s=n)}return n},this.insertSnippetForSelection=function(e,t){var n=e.getCursorPosition(),i=e.session.getLine(n.row),r=e.session.getTabString(),s=i.match(/^\s*/)[0];n.column<s.length&&(s=s.slice(0,n.column)),t=t.replace(/\r/g,"");var a=this.tokenizeTmSnippet(t);a=(a=this.resolveVariables(a,e)).map((function(e){return"\n"==e?e+s:"string"==typeof e?e.replace(/\t/g,r):e}));var o=[];a.forEach((function(e,t){if("object"==typeof e){var n=e.tabstopId,i=o[n];if(i||((i=o[n]=[]).index=n,i.value="",i.parents={}),-1===i.indexOf(e)){e.choices&&!i.choices&&(i.choices=e.choices),i.push(e);var r=a.indexOf(e,t+1);if(-1!==r){var s=a.slice(t+1,r);s.some((function(e){return"object"==typeof e}))&&!i.value?i.value=s:!s.length||i.value&&"string"==typeof i.value||(i.value=s.join(""))}}}})),o.forEach((function(e){e.length=0}));var c={};function h(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if("object"==typeof i){if(c[i.tabstopId])continue;i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}for(var l=0;l<a.length;l++){var u=a[l];if("object"==typeof u){var p=u.tabstopId,d=o[p],g=a.indexOf(u,l+1);if(c[p])c[p]===u&&(delete c[p],Object.keys(c).forEach((function(e){d.parents[e]=!0})));else{c[p]=u;var m=d.value;"string"!=typeof m?m=h(m):u.fmt&&(m=this.tmStrFormat(m,u,e)),a.splice.apply(a,[l+1,Math.max(0,g-l)].concat(m,u)),-1===d.indexOf(u)&&d.push(u)}}}var b=0,v=0,x="";a.forEach((function(e){if("string"==typeof e){var t=e.split("\n");t.length>1?(v=t[t.length-1].length,b+=t.length-1):v+=e.length,x+=e}else e&&(e.start?e.end={row:b,column:v}:e.start={row:b,column:v})}));var _=e.getSelectionRange(),T=e.session.replace(_,x),S=new f(e),E=e.inVirtualSelectionMode&&e.selection.index;S.addTabstops(o,_.start,T,E)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection((function(){n.insertSnippetForSelection(e,t)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"!==t||e.session.$mode.inlinePhp||(t="html");var n=e.getCursorPosition(),i=e.session.getState(n.row);"object"==typeof i&&(i=i[0]),i.substring&&("js-"==i.substring(0,3)?t="javascript":"css-"==i.substring(0,4)?t="css":"php-"==i.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],i=this.snippetMap;return i[t]&&i[t].includeScopes&&n.push.apply(n,i[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,i=e.forEachSelection((function(){return n.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},this.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),r=e.session.getLine(i.row),s=r.substring(0,i.column),a=r.substr(i.column),o=this.snippetMap;return this.getActiveScopes(e).some((function(e){var t=o[e];return t&&(n=this.findMatchingSnippet(t,s,a)),!!n}),this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},this.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var r=e[i];if((!r.startRe||r.startRe.test(t))&&((!r.endRe||r.endRe.test(n))&&(r.startRe||r.endRe)))return r.matchBefore=r.startRe?r.startRe.exec(t):[""],r.matchAfter=r.endRe?r.endRe.exec(n):[""],r.replaceBefore=r.triggerRe?r.triggerRe.exec(t)[0]:"",r.replaceAfter=r.endTriggerRe?r.endTriggerRe.exec(n)[0]:"",r}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){var n=this.snippetMap,i=this.snippetNameMap,r=this;function s(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function o(e,t,n){return e=s(e),t=s(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function c(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],i[t]={});var s=i[t];if(e.name){var c=s[e.name];c&&r.unregister(c),s[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=a.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=o(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=o(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}e||(e=[]),Array.isArray(e)?e.forEach(c):Object.keys(e).forEach((function(t){c(e[t])})),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){var n=this.snippetMap,i=this.snippetNameMap;function r(e){var r=i[e.scope||t];if(r&&r[e.name]){delete r[e.name];var s=n[e.scope||t],a=s&&s.indexOf(e);a>=0&&s.splice(a,1)}}e.content?r(e):Array.isArray(e)&&e.forEach(r)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],i={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=r.exec(e);){if(t[1])try{i=JSON.parse(t[1]),n.push(i)}catch(e){}if(t[4])i.content=t[4].replace(/^\t/gm,""),n.push(i),i={};else{var s=t[2],a=t[3];if("regex"==s){var o=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=o.exec(a)[1],i.trigger=o.exec(a)[1],i.endTrigger=o.exec(a)[1],i.endGuard=o.exec(a)[1]}else"snippet"==s?(i.tabTrigger=a.match(/^\S*/)[0],i.name||(i.name=a)):s&&(i[s]=a)}}return n},this.getSnippetByName=function(e,t){var n,i=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){var r=i[t];return r&&(n=r[e]),!!n}),this),n}}).call(g.prototype);var f=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=a.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){for(var t="r"==e.action[0],n=this.selectedTabstop||{},i=n.parents||{},r=(this.tabstops||[]).slice(),s=0;s<r.length;s++){var a=r[s],o=a==n||i[a.index];if(a.rangeList.$bias=o?0:1,"remove"==e.action&&a!==n){var c=a.parents&&a.parents[n.index],h=a.rangeList.pointIndex(e.start,c);h=h<0?-h-1:h+1;var l=a.rangeList.pointIndex(e.end,c);l=l<0?-l-1:l-1;for(var u=a.rangeList.ranges.slice(h,l),p=0;p<u.length;p++)this.removeRange(u[p])}a.rangeList.$onChange(e)}var d=this.editor.session;this.$inChange||!t||1!=d.getLength()||d.getValue()||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var n=this.editor.session,i=n.getTextRange(e.firstNonLinked),r=0;r<e.length;r++){var s=e[r];if(s.linked){var a=s.original,o=t.snippetManager.tmStrFormat(i,a,this.editor);n.replace(s,o)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var r=this.ranges[i].contains(e.row,e.column),s=n||this.ranges[i].contains(t.row,t.column);if(r&&s)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);(n=Math.min(Math.max(n,1),t))==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){this.selectedTabstop=t;var n=t.firstNonLinked||t;if(t.choices&&(n.cursor=n.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(n);else{var i=this.editor.multiSelect;i.toSingleRange(n);for(var r=0;r<t.length;r++)t.hasLinkedRanges&&t[r].linked||i.addRange(t[r].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},this.addTabstops=function(e,t,n){var i=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var r=o.fromPoints(n,n);b(r.start,t),b(r.end,t),e[0]=[r],e[0].index=0}var s=[this.index+1,0],a=this.ranges;e.forEach((function(e,n){for(var r=this.$openTabstops[n]||e,h=0;h<e.length;h++){var l=e[h],u=o.fromPoints(l.start,l.end||l.start);m(u.start,t),m(u.end,t),u.original=l,u.tabstop=r,a.push(u),r!=e?r.unshift(u):r[h]=u,l.fmtString||r.firstNonLinked&&i?(u.linked=!0,r.hasLinkedRanges=!0):r.firstNonLinked||(r.firstNonLinked=u)}r.firstNonLinked||(r.hasLinkedRanges=!1),r===e&&(s.push(r),this.$openTabstops[n]=r),this.addTabstopMarkers(r),r.rangeList=r.rangeList||new c,r.rangeList.$bias=0,r.rangeList.addList(r)}),this),s.length>2&&(this.tabstops.length&&s.push(s.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,s))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},this.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new h,this.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(f.prototype);var m=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},b=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};i.importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}","snippets.css",!1),t.snippetManager=new g;var v=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(v.prototype)})),ace.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(e,t,n){"use strict";var i,r,s=e("../keyboard/hash_handler").HashHandler,a=e("../editor").Editor,o=e("../snippets").snippetManager,c=e("../range").Range,h=e("../config");function l(){}l.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),i||(i=window.emmet),(i.resources||i.require("resources")).setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange(),t=this.ace.session.doc;return{start:t.positionToIndex(e.start),end:t.positionToIndex(e.end)}},createSelection:function(e,t){var n=this.ace.session.doc;this.ace.selection.setRange({start:n.indexToPosition(e),end:n.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace,t=e.getCursorPosition().row,n=e.session.getLine(t).length,i=e.session.doc.positionToIndex({row:t,column:0});return{start:i,end:i+n}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.session.doc.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.session.doc.indexToPosition(e);this.ace.selection.moveToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,i){null==n&&(n=null==t?this.getContent().length:t),null==t&&(t=0);var r=this.ace,s=r.session.doc,a=c.fromPoints(s.indexToPosition(t),s.indexToPosition(n));r.session.remove(a),a.end=a.start,e=this.$updateTabstops(e),o.insertSnippet(r,e)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if("html"==e||"php"==e){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);"string"!=typeof n&&(n=n[0]),n&&((n=n.split("-")).length>1?e=n[0]:"php"==e&&(e="html"))}return e},getProfileName:function(){var e=i.resources||i.require("resources");switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var t=e.getVariable("profile");return t||(t=-1!=this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i)?"xhtml":"html"),t;default:var n=this.ace.session.$mode;return n.emmetConfig&&n.emmetConfig.profile||"xhtml"}},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""},$updateTabstops:function(e){var t=0,n=null,r=i.tabStops||i.require("tabStops"),s=(i.resources||i.require("resources")).getVocabulary("user"),a={tabstop:function(e){var i=parseInt(e.group,10),s=0===i;s?i=++t:i+=1e3;var o=e.placeholder;o&&(o=r.processText(o,a));var c="${"+i+(o?":"+o:"")+"}";return s&&(n=[e.start,c]),c},escape:function(e){return"$"==e?"\\$":"\\"==e?"\\\\":e}};if(e=r.processText(e,a),s.variables.insert_final_tabstop&&!/\$\{0\}$/.test(e))e+="${0}";else if(n){e=(i.utils?i.utils.common:i.require("utils")).replaceSubstring(e,"${0}",n[0],n[1])}return e}};var u={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"}},p=new l;for(var d in t.commands=new s,t.runEmmetCommand=function e(n){if("expand_abbreviation_with_tab"==this.action){if(!n.selection.isEmpty())return!1;var r=n.selection.lead,s=n.session.getTokenAt(r.row,r.column);if(s&&/\btag\b/.test(s.type))return!1}try{p.setupContext(n);var a=i.actions||i.require("actions");if("wrap_with_abbreviation"==this.action)return setTimeout((function(){a.run("wrap_with_abbreviation",p)}),0);var o=a.run(this.action,p)}catch(r){if(!i){var c=t.load(e.bind(this,n));return"expand_abbreviation_with_tab"!=this.action&&c}n._signal("changeStatus","string"==typeof r?r:r.message),h.warn(r),o=!1}return o},u)t.commands.addCommand({name:"emmet:"+d,action:d,bindKey:u[d],exec:t.runEmmetCommand,multiSelectAction:"forEach"});t.updateCommands=function(e,n){n?e.keyBinding.addKeyboardHandler(t.commands):e.keyBinding.removeKeyboardHandler(t.commands)},t.isSupportedMode=function(e){if(!e)return!1;if(e.emmetConfig)return!0;var t=e.$id||e;return/css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(t)},t.isAvailable=function(e,n){if(/(evaluate_math_expression|expand_abbreviation)$/.test(n))return!0;var i=e.session.$mode,r=t.isSupportedMode(i);if(r&&i.$modes)try{p.setupContext(e),/js|php/.test(p.getSyntax())&&(r=!1)}catch(e){}return r};var g=function(e,n){var i=n;if(i){var r=t.isSupportedMode(i.session.$mode);!1===e.enableEmmet&&(r=!1),r&&t.load(),t.updateCommands(i,r)}};t.load=function(e){return"string"!=typeof r?(h.warn("script for emmet-core is not loaded"),!1):(h.loadModule(r,(function(){r=null,e&&e()})),!0)},t.AceEmmetEditor=l,h.defineOptions(a.prototype,"editor",{enableEmmet:{set:function(e){this[e?"on":"removeListener"]("changeMode",g),g({enableEmmet:!!e},this)},value:!0}}),t.setCore=function(e){"string"==typeof e?r=e:i=e}})),ace.require(["ace/ext/emmet"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));
|