@vc-shell/framework 1.1.1 → 1.1.2

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.
Files changed (210) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/assets/apl-NdZ6-T1z.js +142 -0
  3. package/dist/assets/asciiarmor-CmJEbAuq.js +56 -0
  4. package/dist/assets/asn1-Ctc8K72v.js +192 -0
  5. package/dist/assets/asterisk-D6r__RMF.js +187 -0
  6. package/dist/assets/brainfuck-COwWCBpq.js +70 -0
  7. package/dist/assets/clike-C-PtfL50.js +1019 -0
  8. package/dist/assets/clojure-C2XPrGCa.js +274 -0
  9. package/dist/assets/cmake-BGrEgXCL.js +81 -0
  10. package/dist/assets/cobol-DShPmpZe.js +234 -0
  11. package/dist/assets/coffeescript-BG8vTfSz.js +329 -0
  12. package/dist/assets/commonlisp-8oE2EpEe.js +108 -0
  13. package/dist/assets/core-api-BMLS9FrT.js +8288 -0
  14. package/dist/assets/core-composables-DYxpIWyY.js +1799 -0
  15. package/dist/assets/core-constants-DiKDBbnD.js +83 -0
  16. package/dist/assets/core-directives-QhJx9kWh.js +41 -0
  17. package/dist/assets/core-interceptors-CSjUvxQ0.js +78 -0
  18. package/dist/assets/core-plugins-wv2bDZ0l.js +4919 -0
  19. package/dist/assets/core-services-CAfJRsjs.js +4 -0
  20. package/dist/assets/core-utilities-BTktq_a-.js +33 -0
  21. package/dist/assets/crystal--rIRMl16.js +419 -0
  22. package/dist/assets/css/core-directives-FL4vIIkN.css +73 -0
  23. package/dist/assets/css/fonts-M1mtyV8L.css +305 -0
  24. package/dist/assets/css/icons-css-DbCVsovz.css +41 -0
  25. package/dist/assets/css/shared-components-bnLHdCtf.css +429 -0
  26. package/dist/assets/css/shared-modules-CNOICmYQ.css +45 -0
  27. package/dist/assets/css/styles-C62nDZwV.css +4096 -0
  28. package/dist/assets/css/ui-app-Bh9hmlIB.css +1287 -0
  29. package/dist/assets/css/ui-content-B29jsmK7.css +1187 -0
  30. package/dist/assets/css/ui-controls-CRtfFczw.css +387 -0
  31. package/dist/assets/css/ui-data-CYLxfdUa.css +1555 -0
  32. package/dist/assets/css/ui-form-C3WrWfVl.css +71 -0
  33. package/dist/assets/css/ui-form-fields-DOtHhDeM.css +1360 -0
  34. package/dist/assets/css/ui-helpers-bOoNv5dS.css +37 -0
  35. package/dist/assets/css/ui-indicators-CybQnCoU.css +628 -0
  36. package/dist/assets/css/ui-layout-DyGKgizy.css +251 -0
  37. package/dist/assets/css/ui-media-TWYep8js.css +298 -0
  38. package/dist/assets/css/ui-media-advanced-BGxy3VSB.css +183 -0
  39. package/dist/assets/css/ui-navigation-DcPRn8SB.css +1693 -0
  40. package/dist/assets/css-C_ZeEwz2.js +847 -0
  41. package/dist/assets/cypher-Bayei42D.js +122 -0
  42. package/dist/assets/d-B0hhz6be.js +205 -0
  43. package/dist/assets/diff-DQutOIXs.js +30 -0
  44. package/dist/assets/dockerfile-D0MivFIF.js +199 -0
  45. package/dist/assets/dtd-C1CeYVnM.js +121 -0
  46. package/dist/assets/dylan-Dm9-uD-A.js +337 -0
  47. package/dist/assets/ebnf-jWG_1Yly.js +151 -0
  48. package/dist/assets/ecl-CgJPA6z9.js +190 -0
  49. package/dist/assets/eiffel-lj7uLahq.js +146 -0
  50. package/dist/assets/elm-Cz7o1ijk.js +230 -0
  51. package/dist/assets/erlang-CyL5QOyR.js +581 -0
  52. package/dist/assets/factor-BVWHwYpu.js +65 -0
  53. package/dist/assets/fcl-DiozYjc8.js +154 -0
  54. package/dist/assets/forth-B7vn5ze0.js +164 -0
  55. package/dist/assets/fortran-D2XNEnBT.js +172 -0
  56. package/dist/assets/gas-B_Tj57Ve.js +343 -0
  57. package/dist/assets/gherkin-CJ6Qk4EZ.js +147 -0
  58. package/dist/assets/groovy-ioGz2WSV.js +228 -0
  59. package/dist/assets/haskell-BHnm1B83.js +239 -0
  60. package/dist/assets/haxe-Bn6Yo6N3.js +490 -0
  61. package/dist/assets/http-BOd5SYCT.js +89 -0
  62. package/dist/assets/idl-FSFk8_xX.js +274 -0
  63. package/dist/assets/index--5fKpGeN.js +792 -0
  64. package/dist/assets/index-0lME64YH.js +342 -0
  65. package/dist/assets/index-B1srGfDb.js +183 -0
  66. package/dist/assets/index-B6Ip0FgO.js +437 -0
  67. package/dist/assets/index-BKF-A58l.js +106 -0
  68. package/dist/assets/index-BT8o9-M5.js +418 -0
  69. package/dist/assets/index-BmV05E5M.js +479 -0
  70. package/dist/assets/index-Bv_z_qRq.js +137 -0
  71. package/dist/assets/index-C6MavZDA.js +131 -0
  72. package/dist/assets/index-C7zlEJy8.js +338 -0
  73. package/dist/assets/index-CeeaNa4F.js +187 -0
  74. package/dist/assets/index-CtmpJVwa.js +330 -0
  75. package/dist/assets/index-CwKpgcYl.js +85 -0
  76. package/dist/assets/index-DMTL7O1s.js +627 -0
  77. package/dist/assets/index-DRUmDL0J.js +59 -0
  78. package/dist/assets/index-DgFC-M9G.js +96 -0
  79. package/dist/assets/javascript-DGrAs70C.js +922 -0
  80. package/dist/assets/jinja2-D9k5QrXv.js +171 -0
  81. package/dist/assets/julia-DM42tOPB.js +369 -0
  82. package/dist/assets/livescript-Dci8HnOi.js +259 -0
  83. package/dist/assets/lua-CByQu4v6.js +137 -0
  84. package/dist/assets/lucide-icons-af0BY3bi.js +34555 -0
  85. package/dist/assets/mathematica-Dkv0uCYF.js +153 -0
  86. package/dist/assets/mbox-CYTvs5kC.js +114 -0
  87. package/dist/assets/mirc-DpgP3GCo.js +176 -0
  88. package/dist/assets/mllike-C6tNn2Yt.js +343 -0
  89. package/dist/assets/modelica-CR6hTSce.js +192 -0
  90. package/dist/assets/mscgen-D0GXtzMS.js +149 -0
  91. package/dist/assets/mumps-Bf1EyDa6.js +129 -0
  92. package/dist/assets/nginx-By9Phklj.js +163 -0
  93. package/dist/assets/nsis-B5ggMLQ9.js +80 -0
  94. package/dist/assets/ntriples-C7VJ7pnm.js +141 -0
  95. package/dist/assets/octave-6yR_ix15.js +112 -0
  96. package/dist/assets/oz-CEUnktiQ.js +235 -0
  97. package/dist/assets/pascal-Dksf1EyF.js +124 -0
  98. package/dist/assets/perl-B99DUQQt.js +819 -0
  99. package/dist/assets/pig-DFeDRta6.js +149 -0
  100. package/dist/assets/powershell-DhwsNWMx.js +381 -0
  101. package/dist/assets/properties-o21uErwC.js +62 -0
  102. package/dist/assets/protobuf-YxlANsmD.js +54 -0
  103. package/dist/assets/pug-bUgjeODZ.js +504 -0
  104. package/dist/assets/puppet-B8WICGYE.js +205 -0
  105. package/dist/assets/python-D3FFx1Id.js +389 -0
  106. package/dist/assets/q-D2Hjhl2C.js +123 -0
  107. package/dist/assets/r-D73k5lac.js +174 -0
  108. package/dist/assets/rpm-Duv_WH0z.js +89 -0
  109. package/dist/assets/ruby-DGCVqZDt.js +287 -0
  110. package/dist/assets/sas-XjPv1Vy5.js +268 -0
  111. package/dist/assets/scheme-DeaA28vt.js +263 -0
  112. package/dist/assets/shared-components-CfAt2hC6.js +1501 -0
  113. package/dist/assets/shared-composables-v9NkNuAe.js +35 -0
  114. package/dist/assets/shared-modules-CDP-H5ZB.js +3588 -0
  115. package/dist/assets/shared-pages-BGRRA5WB.js +20 -0
  116. package/dist/assets/shell-Bx6QZTgx.js +145 -0
  117. package/dist/assets/sieve-CWCD62sW.js +178 -0
  118. package/dist/assets/simple-mode-BAO9cD7H.js +136 -0
  119. package/dist/assets/smalltalk-DSQbF4MF.js +153 -0
  120. package/dist/assets/solr-v_XRf31C.js +80 -0
  121. package/dist/assets/sparql-BrfDqf0-.js +170 -0
  122. package/dist/assets/spreadsheet-Csn84Pef.js +98 -0
  123. package/dist/assets/sql-D4utlq1l.js +480 -0
  124. package/dist/assets/stex-DBkktma-.js +246 -0
  125. package/dist/assets/stylus-ByG-Fd6f.js +750 -0
  126. package/dist/assets/swift-CHbTprt3.js +202 -0
  127. package/dist/assets/tcl-BRlMUELr.js +125 -0
  128. package/dist/assets/textile-CqfTUjd4.js +441 -0
  129. package/dist/assets/tiddlywiki-BrsoM8KB.js +278 -0
  130. package/dist/assets/tiki-D-ivWPkc.js +289 -0
  131. package/dist/assets/toml-t_IhJu83.js +75 -0
  132. package/dist/assets/troff-DckGF2AE.js +64 -0
  133. package/dist/assets/ttcn-B8TAFbRR.js +253 -0
  134. package/dist/assets/ttcn-cfg-NHh25oCM.js +197 -0
  135. package/dist/assets/turtle-D9Js0BlL.js +141 -0
  136. package/dist/assets/ui-app-D31Pr1WY.js +1993 -0
  137. package/dist/assets/ui-content-B7SxH8y9.js +52887 -0
  138. package/dist/assets/ui-controls-nmDJYLmC.js +348 -0
  139. package/dist/assets/ui-data-Ci3b1ye0.js +22901 -0
  140. package/dist/assets/ui-form-Cs5ooOo7.js +159 -0
  141. package/dist/assets/ui-form-fields-DFQi31jT.js +40575 -0
  142. package/dist/assets/ui-helpers-CF-EUlOg.js +1736 -0
  143. package/dist/assets/ui-indicators-mIQeEqha.js +199 -0
  144. package/dist/assets/ui-layout-v2XBQky3.js +320 -0
  145. package/dist/assets/ui-media-WWYrwmZw.js +1259 -0
  146. package/dist/assets/ui-media-advanced-T8ibi153.js +492 -0
  147. package/dist/assets/ui-modals-BdZXzI85.js +2 -0
  148. package/dist/assets/ui-navigation-BtHa6ovW.js +24269 -0
  149. package/dist/assets/utils-DZK5fu48.js +17216 -0
  150. package/dist/assets/vb-CbIGLrpY.js +249 -0
  151. package/dist/assets/vbscript-8ANWle9n.js +320 -0
  152. package/dist/assets/velocity-D6hz3Hzw.js +186 -0
  153. package/dist/assets/verilog-DIV442at.js +565 -0
  154. package/dist/assets/vhdl-BlTiZo_v.js +174 -0
  155. package/dist/assets/vueuse-CTQm4Zh0.js +9308 -0
  156. package/dist/assets/webidl-Cp3tcqdk.js +179 -0
  157. package/dist/assets/xquery-Dd4TBzXv.js +411 -0
  158. package/dist/assets/yacas-DQ1WucF0.js +182 -0
  159. package/dist/assets/z80-P1j44jDI.js +102 -0
  160. package/dist/framework.js +29 -0
  161. package/dist/index.css +18 -0
  162. package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +4 -4
  163. package/dist/shared/components/notifications/components/notification-container/index.d.ts +6 -6
  164. package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
  165. package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts +2 -2
  166. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
  167. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +2 -2
  168. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts +1 -1
  169. package/dist/shared/pages/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
  170. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts +1 -1
  171. package/dist/shared/pages/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
  172. package/dist/tsconfig.tsbuildinfo +1 -1
  173. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +1 -1
  174. package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
  175. package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts +2 -2
  176. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +1 -1
  177. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  178. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts +1 -1
  179. package/dist/ui/components/atoms/vc-progress/vc-progress.vue.d.ts.map +1 -1
  180. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +2 -2
  181. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +2 -2
  182. package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
  183. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +4 -4
  184. package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts.map +1 -1
  185. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts +1 -1
  186. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  187. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +1 -1
  188. package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
  189. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +3 -3
  190. package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
  191. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +1 -1
  192. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
  193. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts +1 -1
  194. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-base-button.vue.d.ts.map +1 -1
  195. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +1 -1
  196. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
  197. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts +1 -1
  198. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/_internal/vc-blade-toolbar-button/vc-blade-toolbar-circle-button.vue.d.ts.map +1 -1
  199. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +1 -1
  200. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  201. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  202. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts +1 -1
  203. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue.d.ts.map +1 -1
  204. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +3 -3
  205. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
  206. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +1 -1
  207. package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
  208. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts +1 -1
  209. package/dist/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue.d.ts.map +1 -1
  210. package/package.json +4 -4
@@ -0,0 +1,504 @@
1
+ import { javascript } from './javascript-DGrAs70C.js';
2
+
3
+ var ATTRS_NEST = {
4
+ '{': '}',
5
+ '(': ')',
6
+ '[': ']'
7
+ };
8
+
9
+ function defaultCopyState(state) {
10
+ if (typeof state != "object") return state
11
+ let newState = {};
12
+ for (let prop in state) {
13
+ let val = state[prop];
14
+ newState[prop] = val instanceof Array ? val.slice() : val;
15
+ }
16
+ return newState
17
+ }
18
+
19
+ class State {
20
+ constructor(indentUnit) {
21
+ this.indentUnit = indentUnit;
22
+
23
+ this.javaScriptLine = false;
24
+ this.javaScriptLineExcludesColon = false;
25
+
26
+ this.javaScriptArguments = false;
27
+ this.javaScriptArgumentsDepth = 0;
28
+
29
+ this.isInterpolating = false;
30
+ this.interpolationNesting = 0;
31
+
32
+ this.jsState = javascript.startState(indentUnit);
33
+
34
+ this.restOfLine = '';
35
+
36
+ this.isIncludeFiltered = false;
37
+ this.isEach = false;
38
+
39
+ this.lastTag = '';
40
+
41
+ // Attributes Mode
42
+ this.isAttrs = false;
43
+ this.attrsNest = [];
44
+ this.inAttributeName = true;
45
+ this.attributeIsType = false;
46
+ this.attrValue = '';
47
+
48
+ // Indented Mode
49
+ this.indentOf = Infinity;
50
+ this.indentToken = '';
51
+ }
52
+
53
+ copy() {
54
+ var res = new State(this.indentUnit);
55
+ res.javaScriptLine = this.javaScriptLine;
56
+ res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon;
57
+ res.javaScriptArguments = this.javaScriptArguments;
58
+ res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth;
59
+ res.isInterpolating = this.isInterpolating;
60
+ res.interpolationNesting = this.interpolationNesting;
61
+
62
+ res.jsState = (javascript.copyState || defaultCopyState)(this.jsState);
63
+
64
+ res.restOfLine = this.restOfLine;
65
+
66
+ res.isIncludeFiltered = this.isIncludeFiltered;
67
+ res.isEach = this.isEach;
68
+ res.lastTag = this.lastTag;
69
+ res.isAttrs = this.isAttrs;
70
+ res.attrsNest = this.attrsNest.slice();
71
+ res.inAttributeName = this.inAttributeName;
72
+ res.attributeIsType = this.attributeIsType;
73
+ res.attrValue = this.attrValue;
74
+ res.indentOf = this.indentOf;
75
+ res.indentToken = this.indentToken;
76
+
77
+ return res
78
+ }
79
+ }
80
+
81
+ function javaScript(stream, state) {
82
+ if (stream.sol()) {
83
+ // if javaScriptLine was set at end of line, ignore it
84
+ state.javaScriptLine = false;
85
+ state.javaScriptLineExcludesColon = false;
86
+ }
87
+ if (state.javaScriptLine) {
88
+ if (state.javaScriptLineExcludesColon && stream.peek() === ':') {
89
+ state.javaScriptLine = false;
90
+ state.javaScriptLineExcludesColon = false;
91
+ return
92
+ }
93
+ var tok = javascript.token(stream, state.jsState);
94
+ if (stream.eol()) state.javaScriptLine = false;
95
+ return tok || true
96
+ }
97
+ }
98
+ function javaScriptArguments(stream, state) {
99
+ if (state.javaScriptArguments) {
100
+ if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') {
101
+ state.javaScriptArguments = false;
102
+ return
103
+ }
104
+ if (stream.peek() === '(') {
105
+ state.javaScriptArgumentsDepth++;
106
+ } else if (stream.peek() === ')') {
107
+ state.javaScriptArgumentsDepth--;
108
+ }
109
+ if (state.javaScriptArgumentsDepth === 0) {
110
+ state.javaScriptArguments = false;
111
+ return
112
+ }
113
+
114
+ var tok = javascript.token(stream, state.jsState);
115
+ return tok || true
116
+ }
117
+ }
118
+
119
+ function yieldStatement(stream) {
120
+ if (stream.match(/^yield\b/)) {
121
+ return 'keyword'
122
+ }
123
+ }
124
+
125
+ function doctype(stream) {
126
+ if (stream.match(/^(?:doctype) *([^\n]+)?/)) return 'meta'
127
+ }
128
+
129
+ function interpolation(stream, state) {
130
+ if (stream.match('#{')) {
131
+ state.isInterpolating = true;
132
+ state.interpolationNesting = 0;
133
+ return 'punctuation'
134
+ }
135
+ }
136
+
137
+ function interpolationContinued(stream, state) {
138
+ if (state.isInterpolating) {
139
+ if (stream.peek() === '}') {
140
+ state.interpolationNesting--;
141
+ if (state.interpolationNesting < 0) {
142
+ stream.next();
143
+ state.isInterpolating = false;
144
+ return 'punctuation'
145
+ }
146
+ } else if (stream.peek() === '{') {
147
+ state.interpolationNesting++;
148
+ }
149
+ return javascript.token(stream, state.jsState) || true
150
+ }
151
+ }
152
+
153
+ function caseStatement(stream, state) {
154
+ if (stream.match(/^case\b/)) {
155
+ state.javaScriptLine = true;
156
+ return 'keyword'
157
+ }
158
+ }
159
+
160
+ function when(stream, state) {
161
+ if (stream.match(/^when\b/)) {
162
+ state.javaScriptLine = true;
163
+ state.javaScriptLineExcludesColon = true;
164
+ return 'keyword'
165
+ }
166
+ }
167
+
168
+ function defaultStatement(stream) {
169
+ if (stream.match(/^default\b/)) {
170
+ return 'keyword'
171
+ }
172
+ }
173
+
174
+ function extendsStatement(stream, state) {
175
+ if (stream.match(/^extends?\b/)) {
176
+ state.restOfLine = 'string';
177
+ return 'keyword'
178
+ }
179
+ }
180
+
181
+ function append(stream, state) {
182
+ if (stream.match(/^append\b/)) {
183
+ state.restOfLine = 'variable';
184
+ return 'keyword'
185
+ }
186
+ }
187
+ function prepend(stream, state) {
188
+ if (stream.match(/^prepend\b/)) {
189
+ state.restOfLine = 'variable';
190
+ return 'keyword'
191
+ }
192
+ }
193
+ function block(stream, state) {
194
+ if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) {
195
+ state.restOfLine = 'variable';
196
+ return 'keyword'
197
+ }
198
+ }
199
+
200
+ function include(stream, state) {
201
+ if (stream.match(/^include\b/)) {
202
+ state.restOfLine = 'string';
203
+ return 'keyword'
204
+ }
205
+ }
206
+
207
+ function includeFiltered(stream, state) {
208
+ if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) {
209
+ state.isIncludeFiltered = true;
210
+ return 'keyword'
211
+ }
212
+ }
213
+
214
+ function includeFilteredContinued(stream, state) {
215
+ if (state.isIncludeFiltered) {
216
+ var tok = filter(stream, state);
217
+ state.isIncludeFiltered = false;
218
+ state.restOfLine = 'string';
219
+ return tok
220
+ }
221
+ }
222
+
223
+ function mixin(stream, state) {
224
+ if (stream.match(/^mixin\b/)) {
225
+ state.javaScriptLine = true;
226
+ return 'keyword'
227
+ }
228
+ }
229
+
230
+ function call(stream, state) {
231
+ if (stream.match(/^\+([-\w]+)/)) {
232
+ if (!stream.match(/^\( *[-\w]+ *=/, false)) {
233
+ state.javaScriptArguments = true;
234
+ state.javaScriptArgumentsDepth = 0;
235
+ }
236
+ return 'variable'
237
+ }
238
+ if (stream.match('+#{', false)) {
239
+ stream.next();
240
+ state.mixinCallAfter = true;
241
+ return interpolation(stream, state)
242
+ }
243
+ }
244
+ function callArguments(stream, state) {
245
+ if (state.mixinCallAfter) {
246
+ state.mixinCallAfter = false;
247
+ if (!stream.match(/^\( *[-\w]+ *=/, false)) {
248
+ state.javaScriptArguments = true;
249
+ state.javaScriptArgumentsDepth = 0;
250
+ }
251
+ return true
252
+ }
253
+ }
254
+
255
+ function conditional(stream, state) {
256
+ if (stream.match(/^(if|unless|else if|else)\b/)) {
257
+ state.javaScriptLine = true;
258
+ return 'keyword'
259
+ }
260
+ }
261
+
262
+ function each(stream, state) {
263
+ if (stream.match(/^(- *)?(each|for)\b/)) {
264
+ state.isEach = true;
265
+ return 'keyword'
266
+ }
267
+ }
268
+ function eachContinued(stream, state) {
269
+ if (state.isEach) {
270
+ if (stream.match(/^ in\b/)) {
271
+ state.javaScriptLine = true;
272
+ state.isEach = false;
273
+ return 'keyword'
274
+ } else if (stream.sol() || stream.eol()) {
275
+ state.isEach = false;
276
+ } else if (stream.next()) {
277
+ while (!stream.match(/^ in\b/, false) && stream.next()) {}
278
+ return 'variable'
279
+ }
280
+ }
281
+ }
282
+
283
+ function whileStatement(stream, state) {
284
+ if (stream.match(/^while\b/)) {
285
+ state.javaScriptLine = true;
286
+ return 'keyword'
287
+ }
288
+ }
289
+
290
+ function tag(stream, state) {
291
+ var captures;
292
+ if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) {
293
+ state.lastTag = captures[1].toLowerCase();
294
+ return 'tag'
295
+ }
296
+ }
297
+
298
+ function filter(stream, state) {
299
+ if (stream.match(/^:([\w\-]+)/)) {
300
+ setStringMode(stream, state);
301
+ return 'atom'
302
+ }
303
+ }
304
+
305
+ function code(stream, state) {
306
+ if (stream.match(/^(!?=|-)/)) {
307
+ state.javaScriptLine = true;
308
+ return 'punctuation'
309
+ }
310
+ }
311
+
312
+ function id(stream) {
313
+ if (stream.match(/^#([\w-]+)/)) {
314
+ return 'builtin'
315
+ }
316
+ }
317
+
318
+ function className(stream) {
319
+ if (stream.match(/^\.([\w-]+)/)) {
320
+ return 'className'
321
+ }
322
+ }
323
+
324
+ function attrs(stream, state) {
325
+ if (stream.peek() == '(') {
326
+ stream.next();
327
+ state.isAttrs = true;
328
+ state.attrsNest = [];
329
+ state.inAttributeName = true;
330
+ state.attrValue = '';
331
+ state.attributeIsType = false;
332
+ return 'punctuation'
333
+ }
334
+ }
335
+
336
+ function attrsContinued(stream, state) {
337
+ if (state.isAttrs) {
338
+ if (ATTRS_NEST[stream.peek()]) {
339
+ state.attrsNest.push(ATTRS_NEST[stream.peek()]);
340
+ }
341
+ if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) {
342
+ state.attrsNest.pop();
343
+ } else if (stream.eat(')')) {
344
+ state.isAttrs = false;
345
+ return 'punctuation'
346
+ }
347
+ if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
348
+ if (stream.peek() === '=' || stream.peek() === '!') {
349
+ state.inAttributeName = false;
350
+ state.jsState = javascript.startState(2);
351
+ if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') {
352
+ state.attributeIsType = true;
353
+ } else {
354
+ state.attributeIsType = false;
355
+ }
356
+ }
357
+ return 'attribute'
358
+ }
359
+
360
+ var tok = javascript.token(stream, state.jsState);
361
+ if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) {
362
+ try {
363
+ Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, ''));
364
+ state.inAttributeName = true;
365
+ state.attrValue = '';
366
+ stream.backUp(stream.current().length);
367
+ return attrsContinued(stream, state)
368
+ } catch (ex) {
369
+ //not the end of an attribute
370
+ }
371
+ }
372
+ state.attrValue += stream.current();
373
+ return tok || true
374
+ }
375
+ }
376
+
377
+ function attributesBlock(stream, state) {
378
+ if (stream.match(/^&attributes\b/)) {
379
+ state.javaScriptArguments = true;
380
+ state.javaScriptArgumentsDepth = 0;
381
+ return 'keyword'
382
+ }
383
+ }
384
+
385
+ function indent(stream) {
386
+ if (stream.sol() && stream.eatSpace()) {
387
+ return 'indent'
388
+ }
389
+ }
390
+
391
+ function comment(stream, state) {
392
+ if (stream.match(/^ *\/\/(-)?([^\n]*)/)) {
393
+ state.indentOf = stream.indentation();
394
+ state.indentToken = 'comment';
395
+ return 'comment'
396
+ }
397
+ }
398
+
399
+ function colon(stream) {
400
+ if (stream.match(/^: */)) {
401
+ return 'colon'
402
+ }
403
+ }
404
+
405
+ function text(stream, state) {
406
+ if (stream.match(/^(?:\| ?| )([^\n]+)/)) {
407
+ return 'string'
408
+ }
409
+ if (stream.match(/^(<[^\n]*)/, false)) {
410
+ // html string
411
+ setStringMode(stream, state);
412
+ stream.skipToEnd();
413
+ return state.indentToken
414
+ }
415
+ }
416
+
417
+ function dot(stream, state) {
418
+ if (stream.eat('.')) {
419
+ setStringMode(stream, state);
420
+ return 'dot'
421
+ }
422
+ }
423
+
424
+ function fail(stream) {
425
+ stream.next();
426
+ return null
427
+ }
428
+
429
+
430
+ function setStringMode(stream, state) {
431
+ state.indentOf = stream.indentation();
432
+ state.indentToken = 'string';
433
+ }
434
+ function restOfLine(stream, state) {
435
+ if (stream.sol()) {
436
+ // if restOfLine was set at end of line, ignore it
437
+ state.restOfLine = '';
438
+ }
439
+ if (state.restOfLine) {
440
+ stream.skipToEnd();
441
+ var tok = state.restOfLine;
442
+ state.restOfLine = '';
443
+ return tok
444
+ }
445
+ }
446
+
447
+
448
+ function startState(indentUnit) {
449
+ return new State(indentUnit)
450
+ }
451
+ function copyState(state) {
452
+ return state.copy()
453
+ }
454
+ function nextToken(stream, state) {
455
+ var tok = restOfLine(stream, state)
456
+ || interpolationContinued(stream, state)
457
+ || includeFilteredContinued(stream, state)
458
+ || eachContinued(stream, state)
459
+ || attrsContinued(stream, state)
460
+ || javaScript(stream, state)
461
+ || javaScriptArguments(stream, state)
462
+ || callArguments(stream, state)
463
+
464
+ || yieldStatement(stream)
465
+ || doctype(stream)
466
+ || interpolation(stream, state)
467
+ || caseStatement(stream, state)
468
+ || when(stream, state)
469
+ || defaultStatement(stream)
470
+ || extendsStatement(stream, state)
471
+ || append(stream, state)
472
+ || prepend(stream, state)
473
+ || block(stream, state)
474
+ || include(stream, state)
475
+ || includeFiltered(stream, state)
476
+ || mixin(stream, state)
477
+ || call(stream, state)
478
+ || conditional(stream, state)
479
+ || each(stream, state)
480
+ || whileStatement(stream, state)
481
+ || tag(stream, state)
482
+ || filter(stream, state)
483
+ || code(stream, state)
484
+ || id(stream)
485
+ || className(stream)
486
+ || attrs(stream, state)
487
+ || attributesBlock(stream, state)
488
+ || indent(stream)
489
+ || text(stream, state)
490
+ || comment(stream, state)
491
+ || colon(stream)
492
+ || dot(stream, state)
493
+ || fail(stream);
494
+
495
+ return tok === true ? null : tok
496
+ }
497
+
498
+ const pug = {
499
+ startState: startState,
500
+ copyState: copyState,
501
+ token: nextToken
502
+ };
503
+
504
+ export { pug };
@@ -0,0 +1,205 @@
1
+ // Stores the words from the define method
2
+ var words = {};
3
+ // Taken, mostly, from the Puppet official variable standards regex
4
+ var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;
5
+
6
+ // Takes a string of words separated by spaces and adds them as
7
+ // keys with the value of the first argument 'style'
8
+ function define(style, string) {
9
+ var split = string.split(' ');
10
+ for (var i = 0; i < split.length; i++) {
11
+ words[split[i]] = style;
12
+ }
13
+ }
14
+
15
+ // Takes commonly known puppet types/words and classifies them to a style
16
+ define('keyword', 'class define site node include import inherits');
17
+ define('keyword', 'case if else in and elsif default or');
18
+ define('atom', 'false true running present absent file directory undef');
19
+ define('builtin', 'action augeas burst chain computer cron destination dport exec ' +
20
+ 'file filebucket group host icmp iniface interface jump k5login limit log_level ' +
21
+ 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' +
22
+ 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' +
23
+ 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' +
24
+ 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' +
25
+ 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' +
26
+ 'resources router schedule scheduled_task selboolean selmodule service source ' +
27
+ 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' +
28
+ 'user vlan yumrepo zfs zone zpool');
29
+
30
+ // After finding a start of a string ('|") this function attempts to find the end;
31
+ // If a variable is encountered along the way, we display it differently when it
32
+ // is encapsulated in a double-quoted string.
33
+ function tokenString(stream, state) {
34
+ var current, prev, found_var = false;
35
+ while (!stream.eol() && (current = stream.next()) != state.pending) {
36
+ if (current === '$' && prev != '\\' && state.pending == '"') {
37
+ found_var = true;
38
+ break;
39
+ }
40
+ prev = current;
41
+ }
42
+ if (found_var) {
43
+ stream.backUp(1);
44
+ }
45
+ if (current == state.pending) {
46
+ state.continueString = false;
47
+ } else {
48
+ state.continueString = true;
49
+ }
50
+ return "string";
51
+ }
52
+
53
+ // Main function
54
+ function tokenize(stream, state) {
55
+ // Matches one whole word
56
+ var word = stream.match(/[\w]+/, false);
57
+ // Matches attributes (i.e. ensure => present ; 'ensure' would be matched)
58
+ var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false);
59
+ // Matches non-builtin resource declarations
60
+ // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched)
61
+ var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false);
62
+ // Matches virtual and exported resources (i.e. @@user { ; and the like)
63
+ var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false);
64
+
65
+ // Finally advance the stream
66
+ var ch = stream.next();
67
+
68
+ // Have we found a variable?
69
+ if (ch === '$') {
70
+ if (stream.match(variable_regex)) {
71
+ // If so, and its in a string, assign it a different color
72
+ return state.continueString ? 'variableName.special' : 'variable';
73
+ }
74
+ // Otherwise return an invalid variable
75
+ return "error";
76
+ }
77
+ // Should we still be looking for the end of a string?
78
+ if (state.continueString) {
79
+ // If so, go through the loop again
80
+ stream.backUp(1);
81
+ return tokenString(stream, state);
82
+ }
83
+ // Are we in a definition (class, node, define)?
84
+ if (state.inDefinition) {
85
+ // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched)
86
+ if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) {
87
+ return 'def';
88
+ }
89
+ // Match the rest it the next time around
90
+ stream.match(/\s+{/);
91
+ state.inDefinition = false;
92
+ }
93
+ // Are we in an 'include' statement?
94
+ if (state.inInclude) {
95
+ // Match and return the included class
96
+ stream.match(/(\s+)?\S+(\s+)?/);
97
+ state.inInclude = false;
98
+ return 'def';
99
+ }
100
+ // Do we just have a function on our hands?
101
+ // In 'ensure_resource("myclass")', 'ensure_resource' is matched
102
+ if (stream.match(/(\s+)?\w+\(/)) {
103
+ stream.backUp(1);
104
+ return 'def';
105
+ }
106
+ // Have we matched the prior attribute regex?
107
+ if (attribute) {
108
+ stream.match(/(\s+)?\w+/);
109
+ return 'tag';
110
+ }
111
+ // Do we have Puppet specific words?
112
+ if (word && words.hasOwnProperty(word)) {
113
+ // Negates the initial next()
114
+ stream.backUp(1);
115
+ // rs move the stream
116
+ stream.match(/[\w]+/);
117
+ // We want to process these words differently
118
+ // do to the importance they have in Puppet
119
+ if (stream.match(/\s+\S+\s+{/, false)) {
120
+ state.inDefinition = true;
121
+ }
122
+ if (word == 'include') {
123
+ state.inInclude = true;
124
+ }
125
+ // Returns their value as state in the prior define methods
126
+ return words[word];
127
+ }
128
+ // Is there a match on a reference?
129
+ if (/(^|\s+)[A-Z][\w:_]+/.test(word)) {
130
+ // Negate the next()
131
+ stream.backUp(1);
132
+ // Match the full reference
133
+ stream.match(/(^|\s+)[A-Z][\w:_]+/);
134
+ return 'def';
135
+ }
136
+ // Have we matched the prior resource regex?
137
+ if (resource) {
138
+ stream.match(/(\s+)?[\w:_]+/);
139
+ return 'def';
140
+ }
141
+ // Have we matched the prior special_resource regex?
142
+ if (special_resource) {
143
+ stream.match(/(\s+)?[@]{1,2}/);
144
+ return 'atom';
145
+ }
146
+ // Match all the comments. All of them.
147
+ if (ch == "#") {
148
+ stream.skipToEnd();
149
+ return "comment";
150
+ }
151
+ // Have we found a string?
152
+ if (ch == "'" || ch == '"') {
153
+ // Store the type (single or double)
154
+ state.pending = ch;
155
+ // Perform the looping function to find the end
156
+ return tokenString(stream, state);
157
+ }
158
+ // Match all the brackets
159
+ if (ch == '{' || ch == '}') {
160
+ return 'bracket';
161
+ }
162
+ // Match characters that we are going to assume
163
+ // are trying to be regex
164
+ if (ch == '/') {
165
+ stream.match(/^[^\/]*\//);
166
+ return 'string.special';
167
+ }
168
+ // Match all the numbers
169
+ if (ch.match(/[0-9]/)) {
170
+ stream.eatWhile(/[0-9]+/);
171
+ return 'number';
172
+ }
173
+ // Match the '=' and '=>' operators
174
+ if (ch == '=') {
175
+ if (stream.peek() == '>') {
176
+ stream.next();
177
+ }
178
+ return "operator";
179
+ }
180
+ // Keep advancing through all the rest
181
+ stream.eatWhile(/[\w-]/);
182
+ // Return a blank line for everything else
183
+ return null;
184
+ }
185
+ // Start it all
186
+ const puppet = {
187
+ name: "puppet",
188
+
189
+ startState: function () {
190
+ var state = {};
191
+ state.inDefinition = false;
192
+ state.inInclude = false;
193
+ state.continueString = false;
194
+ state.pending = false;
195
+ return state;
196
+ },
197
+ token: function (stream, state) {
198
+ // Strip the spaces, but regex will account for them eitherway
199
+ if (stream.eatSpace()) return null;
200
+ // Go through the main process
201
+ return tokenize(stream, state);
202
+ }
203
+ };
204
+
205
+ export { puppet };