1)i=n;else if("props"===c&&"[object Object]"===Object.prototype.toString.call(i))return t(r({},a,i),null);var l=r({},a,((e={})[c]=i,e));return t(l,null)};return"__is_webscript_element"===n||("__webscript_enhancer"===n?e[n]:(-1!==n.indexOf("·")&&(n=n.replace(i,"-")),u.value="props"===n?a:a[n],c=n,u))}}});return u}({},null)}e.default=function(e,r){if(void 0===r&&(r=[]),"function"!=typeof e)throw Error("elementConstructor argument must be present and it must be a function.");if(r.length>0){for(var n,o=[],i=t(r);!(n=i()).done;)o.push(a(e,n.value));return o}return new Proxy(function(){},{get:function(r,n){var t=r[n];return void 0!==t?t:(r[n]=a(e,n),r[n])}})},e.enhanceBuilder=function(e,r){return e.__webscript_enhancer=r,e}});
2 | //# sourceMappingURL=webscript.umd.js.map
3 |
--------------------------------------------------------------------------------
/dist/webscript.umd.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"webscript.umd.js","sources":["../src/webscript.js"],"sourcesContent":["function templateValues(args) {\r\n const [strings, ...templateArgs] = args;\r\n const result = [];\r\n for (const [index, s] of strings.entries()) {\r\n if (s !== \"\") {\r\n result.push(s);\r\n }\r\n let arg = templateArgs[index];\r\n if (typeof arg !== \"undefined\") {\r\n result.push(arg);\r\n }\r\n }\r\n return result;\r\n}\r\n\r\nlet interpunct = new RegExp(\"·\", \"g\");\r\n\r\nexport const enhanceBuilder = (builder, func) => {\r\n builder.__webscript_enhancer = func;\r\n return builder;\r\n}\r\n\r\nfunction createInitialBuilder(constructor, type) {\r\n function createBuilder(props, prop) {\r\n let builder = new Proxy(() => { }, {\r\n apply(target, thisArg, children) {\r\n if (typeof target.__webscript_enhancer === \"function\") {\r\n let __webscript_enhancer = target.__webscript_enhancer;\r\n delete target.__webscript_enhancer;\r\n let result = __webscript_enhancer(builder, children);\r\n target.__webscript_enhancer = __webscript_enhancer;\r\n return result;\r\n }\r\n let [first] = children;\r\n if (Array.isArray(first) && Object.isFrozen(first)) {\r\n children = templateValues(children);\r\n }\r\n if (Array.isArray(props.children)) {\r\n props.children.push(...children)\r\n children = props.children;\r\n delete props.children;\r\n }\r\n for (let i = 0; i < children.length; i++) {\r\n let arg = children[i];\r\n if (typeof arg === \"function\" && arg.__is_webscript_element === true) {\r\n children[i] = arg();\r\n }\r\n }\r\n return constructor(type, props, ...children);\r\n },\r\n get(target, elementName) {\r\n if (typeof elementName === \"string\") {\r\n if (elementName === \"__is_webscript_element\") {\r\n return true;\r\n }\r\n else if (elementName === \"__webscript_enhancer\") {\r\n return target[elementName]\r\n }\r\n else if (elementName.indexOf(\"·\") !== -1) {\r\n elementName = elementName.replace(interpunct, \"-\");\r\n }\r\n\r\n function setPropertyValue(...args) {\r\n let [value] = args;\r\n if (typeof value === \"undefined\") {\r\n if (prop === \"props\" && Object.prototype.toString.call(value) === '[object Object]') {\r\n return createBuilder({}, null);\r\n }\r\n let newProps = { ...props };\r\n delete newProps[prop];\r\n return createBuilder(newProps, null);\r\n }\r\n else if (Array.isArray(value) && Object.isFrozen(value)) {\r\n value = templateValues(args).join(\"\");\r\n }\r\n else if (args.length > 1) {\r\n value = args;\r\n }\r\n else if (prop === \"props\" && Object.prototype.toString.call(value) === '[object Object]') {\r\n return createBuilder({ ...props, ...value }, null);\r\n }\r\n const newProps = { ...props, [prop]: value };\r\n return createBuilder(newProps, null);\r\n }\r\n if (elementName === \"props\") {\r\n setPropertyValue.value = props;\r\n }\r\n else {\r\n setPropertyValue.value = props[elementName];\r\n }\r\n prop = elementName;\r\n return setPropertyValue;\r\n }\r\n }\r\n })\r\n return builder;\r\n }\r\n return createBuilder({}, null);\r\n}\r\n\r\n\r\nfunction builders(constructor, types = []) {\r\n if (typeof constructor !== \"function\") {\r\n throw Error(\"elementConstructor argument must be present and it must be a function.\");\r\n }\r\n if (types.length > 0) {\r\n let builders = [];\r\n for (const type of types) {\r\n builders.push(createInitialBuilder(constructor, type));\r\n }\r\n return builders;\r\n }\r\n else {\r\n return new Proxy(() => { }, {\r\n get(target, prop) {\r\n const result = target[prop];\r\n if (typeof result !== \"undefined\") {\r\n return result;\r\n }\r\n target[prop] = createInitialBuilder(constructor, prop);\r\n return target[prop];\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport default builders;\r\n\r\n"],"names":["templateValues","args","strings","templateArgs","result","entries","index","s","push","arg","interpunct","RegExp","createInitialBuilder","constructor","type","createBuilder","props","prop","builder","Proxy","apply","target","thisArg","children","__webscript_enhancer","first","Array","isArray","Object","isFrozen","i","length","__is_webscript_element","get","elementName","setPropertyValue","value","prototype","toString","call","newProps","join","indexOf","replace","types","Error","builders","func"],"mappings":"usCAAA,SAASA,EAAeC,GAGtB,UAFOC,EAA4BD,KAAhBE,EAAgBF,WAC7BG,EAAS,OACUF,EAAQG,0BAAW,eAAhCC,OAAOC,OACP,KAANA,GACFH,EAAOI,KAAKD,GAEd,IAAIE,EAAMN,EAAaG,QACJ,IAARG,GACTL,EAAOI,KAAKC,GAGhB,OAAOL,EAGT,IAAIM,EAAa,IAAIC,OAAO,IAAK,KAOjC,SAASC,EAAqBC,EAAaC,GA2EzC,OA1EA,SAASC,EAAcC,EAAOC,GAC5B,IAAIC,EAAU,IAAIC,MAAM,aAAW,CACjCC,eAAMC,EAAQC,EAASC,GACrB,GAA2C,mBAAhCF,EAAOG,qBAAqC,CACrD,IAAIA,EAAuBH,EAAOG,4BAC3BH,EAAOG,qBACd,IAAIpB,EAASoB,EAAqBN,EAASK,GAE3C,OADAF,EAAOG,qBAAuBA,EACvBpB,EANsB,MAQ1BqB,EAASF,KACVG,MAAMC,QAAQF,IAAUG,OAAOC,SAASJ,KAC1CF,EAAWvB,EAAeuB,IAExBG,MAAMC,QAAQX,EAAMO,eACtBP,EAAMO,UAASf,aAAQe,GACvBA,EAAWP,EAAMO,gBACVP,EAAMO,UAEf,IAAK,IAAIO,EAAI,EAAGA,EAAIP,EAASQ,OAAQD,IAAK,CACxC,IAAIrB,EAAMc,EAASO,GACA,mBAARrB,IAAqD,IAA/BA,EAAIuB,yBACnCT,EAASO,GAAKrB,KAGlB,OAAOI,gBAAYC,EAAME,UAAUO,KAErCU,aAAIZ,EAAQa,GACV,GAA2B,iBAAhBA,EAA0B,KAW1BC,EAAT,iBAA6BlC,2BACtBmC,EAASnC,KACd,QAAqB,IAAVmC,EAAuB,CAChC,GAAa,UAATnB,GAA8D,oBAA1CW,OAAOS,UAAUC,SAASC,KAAKH,GACrD,OAAOrB,EAAc,GAAI,MAE3B,IAAIyB,OAAgBxB,GAEpB,cADOwB,EAASvB,GACTF,EAAcyB,EAAU,SAExBd,MAAMC,QAAQS,IAAUR,OAAOC,SAASO,GAC/CA,EAAQpC,EAAeC,GAAMwC,KAAK,YAE3BxC,EAAK8B,OAAS,EACrBK,EAAQnC,UAEQ,UAATgB,GAA8D,oBAA1CW,OAAOS,UAAUC,SAASC,KAAKH,GAC1D,OAAOrB,OAAmBC,EAAUoB,GAAS,MAE/C,IAAMI,OAAgBxB,UAAQC,GAAOmB,MACrC,OAAOrB,EAAcyB,EAAU,OA9BjC,MAAoB,2BAAhBN,IAGqB,yBAAhBA,EACAb,EAAOa,KAEuB,IAA9BA,EAAYQ,QAAQ,OAC3BR,EAAcA,EAAYS,QAAQjC,EAAY,MA0B9CyB,EAAiBC,MADC,UAAhBF,EACuBlB,EAGAA,EAAMkB,GAEjCjB,EAAOiB,EACAC,QAIb,OAAOjB,EAEFH,CAAc,GAAI,gBAI3B,SAAkBF,EAAa+B,GAC7B,YAD6BA,IAAAA,EAAQ,IACV,mBAAhB/B,EACT,MAAMgC,MAAM,0EAEd,GAAID,EAAMb,OAAS,EAAG,CAEpB,IADA,MAAIe,EAAW,OACIF,kBACjBE,EAAStC,KAAKI,EAAqBC,YAErC,OAAOiC,EAGP,WAAW3B,MAAM,aAAW,CAC1Bc,aAAIZ,EAAQJ,GACV,IAAMb,EAASiB,EAAOJ,GACtB,YAAsB,IAAXb,EACFA,GAETiB,EAAOJ,GAAQL,EAAqBC,EAAaI,GAC1CI,EAAOJ,yBAvGQ,SAACC,EAAS6B,GAEtC,OADA7B,EAAQM,qBAAuBuB,EACxB7B"}
--------------------------------------------------------------------------------
/docs/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/example.png
--------------------------------------------------------------------------------
/docs/favicon/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/favicon/android-chrome-192x192.png
--------------------------------------------------------------------------------
/docs/favicon/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/favicon/android-chrome-512x512.png
--------------------------------------------------------------------------------
/docs/favicon/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/favicon/apple-touch-icon.png
--------------------------------------------------------------------------------
/docs/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/docs/favicon/favicon.ico
--------------------------------------------------------------------------------
/docs/favicon/site.webmanifest:
--------------------------------------------------------------------------------
1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Webscript Documentation
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/codemirror.css:
--------------------------------------------------------------------------------
1 | /* BASICS */
2 |
3 |
4 |
5 | .CodeMirror {
6 | /* Set height, width, borders, and global font properties here */
7 | font-family: monospace;
8 | /*height: 300px;*/
9 | padding: 0.2em;
10 | border-radius: 5px;
11 | height: 100%;
12 | color: black;
13 | direction: ltr;
14 | }
15 |
16 | /* PADDING */
17 |
18 | .CodeMirror-lines {
19 | padding: 4px 0; /* Vertical padding around content */
20 | }
21 | .CodeMirror pre.CodeMirror-line,
22 | .CodeMirror pre.CodeMirror-line-like {
23 | padding: 0 4px; /* Horizontal padding of content */
24 | }
25 |
26 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
27 | background-color: white; /* The little square between H and V scrollbars */
28 | }
29 |
30 | /* GUTTER */
31 |
32 | .CodeMirror-gutters {
33 | border-right: 1px solid #ddd;
34 | background-color: #f7f7f7;
35 | white-space: nowrap;
36 | }
37 | /* .CodeMirror-linenumbers {} */
38 | .CodeMirror-linenumber {
39 | padding: 0 3px 0 5px;
40 | min-width: 20px;
41 | text-align: right;
42 | color: #999;
43 | white-space: nowrap;
44 | }
45 |
46 | .CodeMirror-guttermarker { color: black; }
47 | .CodeMirror-guttermarker-subtle { color: #999; }
48 |
49 | /* CURSOR */
50 |
51 | .CodeMirror-cursor {
52 | border-left: 1px solid black;
53 | border-right: none;
54 | width: 0;
55 | }
56 | /* Shown when moving in bi-directional text */
57 | .CodeMirror div.CodeMirror-secondarycursor {
58 | border-left: 1px solid silver;
59 | }
60 | .cm-fat-cursor .CodeMirror-cursor {
61 | width: auto;
62 | border: 0 !important;
63 | background: #7e7;
64 | }
65 | .cm-fat-cursor div.CodeMirror-cursors {
66 | z-index: 1;
67 | }
68 | .cm-fat-cursor-mark {
69 | background-color: rgba(20, 255, 20, 0.5);
70 | -webkit-animation: blink 1.06s steps(1) infinite;
71 | -moz-animation: blink 1.06s steps(1) infinite;
72 | animation: blink 1.06s steps(1) infinite;
73 | }
74 | .cm-animate-fat-cursor {
75 | width: auto;
76 | border: 0;
77 | -webkit-animation: blink 1.06s steps(1) infinite;
78 | -moz-animation: blink 1.06s steps(1) infinite;
79 | animation: blink 1.06s steps(1) infinite;
80 | background-color: #7e7;
81 | }
82 | @-moz-keyframes blink {
83 | 0% {}
84 | 50% { background-color: transparent; }
85 | 100% {}
86 | }
87 | @-webkit-keyframes blink {
88 | 0% {}
89 | 50% { background-color: transparent; }
90 | 100% {}
91 | }
92 | @keyframes blink {
93 | 0% {}
94 | 50% { background-color: transparent; }
95 | 100% {}
96 | }
97 |
98 | /* Can style cursor different in overwrite (non-insert) mode */
99 | /*
100 | .CodeMirror-overwrite .CodeMirror-cursor {}
101 | */
102 | .cm-tab { display: inline-block; text-decoration: inherit; }
103 |
104 | .CodeMirror-rulers {
105 | position: absolute;
106 | left: 0; right: 0; top: -50px; bottom: 0;
107 | overflow: hidden;
108 | }
109 | .CodeMirror-ruler {
110 | border-left: 1px solid #ccc;
111 | top: 0; bottom: 0;
112 | position: absolute;
113 | }
114 |
115 | /* DEFAULT THEME */
116 |
117 | .cm-s-default .cm-header {color: blue;}
118 | .cm-s-default .cm-quote {color: #090;}
119 | .cm-negative {color: #d44;}
120 | .cm-positive {color: #292;}
121 | .cm-header, .cm-strong {font-weight: bold;}
122 | .cm-em {font-style: italic;}
123 | .cm-link {text-decoration: underline;}
124 | .cm-strikethrough {text-decoration: line-through;}
125 |
126 | .cm-s-default .cm-keyword {color: #708;}
127 | .cm-s-default .cm-atom {color: #219;}
128 | .cm-s-default .cm-number {color: #164;}
129 | .cm-s-default .cm-def {color: #00f;}
130 |
131 |
132 |
133 | /*
134 | .cm-s-default .cm-variable,
135 | .cm-s-default .cm-punctuation,
136 | .cm-s-default .cm-property,
137 | .cm-s-default .cm-operator {}
138 | */
139 |
140 |
141 |
142 | .cm-s-default .cm-variable-2 {color: #05a;}
143 | .cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
144 | .cm-s-default .cm-comment {color: rgb(150,105,50) /*#a50;*/}
145 |
146 |
147 |
148 | /* rgb(102, 115, 241) */
149 | .cm-s-default .cm-string-2 {color: rgb(170,64,64) /*rgb(80, 90, 220)*/ /*#a22*/ /* #047481*/ /*#a11*/ /*#f50*/;}
150 | .cm-s-default .cm-meta {color: #555;}
151 | .cm-s-default .cm-qualifier {color: #555;}
152 | .cm-s-default .cm-builtin {color: #30a;}
153 | .cm-s-default .cm-bracket {color: #997;}
154 | .cm-s-default .cm-tag {color: #170;}
155 | .cm-s-default .cm-attribute {color: #00c;}
156 | .cm-s-default .cm-hr {color: #999;}
157 | .cm-s-default .cm-link {color: #00c;}
158 | .cm-s-default .cm-string {color: rgb(170,64,64)/*rgb(54, 67, 120)*/ /*black*/;/*#a11*/}
159 |
160 |
161 | /*
162 | .cm-variable { color: #170;}
163 | .cm-s-default .cm-m-javascript.cm-string {color: black;}
164 | .cm-s-default .cm-string-2 + .cm-string {color: rgb(20, 30, 80);}
165 | .cm-s-default .cm-property + .cm-string-2 {color: rgb(75, 85, 170);}
166 | .cm-s-default .cm-property { color: rgb(0,0,194);}
167 | */
168 |
169 | .cm-variable {color: #170; }
170 | .cm-s-default .cm-m-javascript.cm-string {color: rgb(20, 30, 80);}
171 | .cm-s-default .cm-variable + .cm-string-2 {color: rgb(20, 30, 80);}
172 | .cm-s-default .cm-string-2 + .cm-string-2 {color: rgb(20, 30, 80);}
173 | .cm-s-default .cm-property + .cm-string-2 {color: rgb(170,64,64);}
174 | .cm-s-default .cm-property { color: #00c;}
175 |
176 |
177 | /*
178 | .cm-variable {color: rgb(0,0,194); }
179 | .cm-s-default .cm-m-javascript.cm-string {color: rgb(20, 30, 80);}
180 | .cm-s-default .cm-string-2 + .cm-string {color: rgb(20, 30, 80);}
181 | .cm-s-default .cm-property + .cm-string-2 {color: rgb(75, 85, 170);}
182 | .cm-s-default .cm-property { color: #170;}
183 | */
184 |
185 | /*
186 |
187 |
188 | "#" ,
189 | " Get started " )),
190 |
191 | */
192 | .cm-s-default .cm-error {color: #f00;}
193 | .cm-invalidchar {color: #f00;}
194 |
195 | .CodeMirror-composing { border-bottom: 2px solid; }
196 |
197 | /* Default styles for common addons */
198 |
199 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
200 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
201 | .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
202 | .CodeMirror-activeline-background {background: #e8f2ff;}
203 |
204 | /* STOP */
205 |
206 | /* The rest of this file contains styles related to the mechanics of
207 | the editor. You probably shouldn't touch them. */
208 |
209 | .CodeMirror {
210 | position: relative;
211 | overflow: hidden;
212 | /* background: white; */
213 | }
214 |
215 | .CodeMirror-scroll {
216 | overflow: scroll !important; /* Things will break if this is overridden */
217 | /* 30px is the magic margin used to hide the element's real scrollbars */
218 | /* See overflow: hidden in .CodeMirror */
219 | margin-bottom: -30px; margin-right: -30px;
220 | padding-bottom: 30px;
221 | height: 100%;
222 | outline: none; /* Prevent dragging from highlighting the element */
223 | position: relative;
224 | }
225 | .CodeMirror-sizer {
226 | position: relative;
227 | border-right: 30px solid transparent;
228 | }
229 |
230 | /* The fake, visible scrollbars. Used to force redraw during scrolling
231 | before actual scrolling happens, thus preventing shaking and
232 | flickering artifacts. */
233 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
234 | position: absolute;
235 | z-index: 6;
236 | display: none;
237 | }
238 | .CodeMirror-vscrollbar {
239 | right: 0; top: 0;
240 | overflow-x: hidden;
241 | overflow-y: scroll;
242 | }
243 | .CodeMirror-hscrollbar {
244 | bottom: 0; left: 0;
245 | overflow-y: hidden;
246 | overflow-x: scroll;
247 | }
248 | .CodeMirror-scrollbar-filler {
249 | right: 0; bottom: 0;
250 | }
251 | .CodeMirror-gutter-filler {
252 | left: 0; bottom: 0;
253 | }
254 |
255 | .CodeMirror-gutters {
256 | position: absolute; left: 0; top: 0;
257 | min-height: 100%;
258 | z-index: 3;
259 | }
260 | .CodeMirror-gutter {
261 | white-space: normal;
262 | height: 100%;
263 | display: inline-block;
264 | vertical-align: top;
265 | margin-bottom: -30px;
266 | }
267 | .CodeMirror-gutter-wrapper {
268 | position: absolute;
269 | z-index: 4;
270 | background: none !important;
271 | border: none !important;
272 | }
273 | .CodeMirror-gutter-background {
274 | position: absolute;
275 | top: 0; bottom: 0;
276 | z-index: 4;
277 | }
278 | .CodeMirror-gutter-elt {
279 | position: absolute;
280 | cursor: default;
281 | z-index: 4;
282 | }
283 | .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
284 | .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
285 |
286 | .CodeMirror-lines {
287 | cursor: text;
288 | min-height: 1px; /* prevents collapsing before first draw */
289 | }
290 | .CodeMirror pre.CodeMirror-line,
291 | .CodeMirror pre.CodeMirror-line-like {
292 | /* Reset some styles that the rest of the page might have set */
293 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
294 | border-width: 0;
295 | background: transparent;
296 | font-family: inherit;
297 | font-size: inherit;
298 | margin: 0;
299 | white-space: pre;
300 | word-wrap: normal;
301 | line-height: inherit;
302 | color: inherit;
303 | z-index: 2;
304 | position: relative;
305 | overflow: visible;
306 | -webkit-tap-highlight-color: transparent;
307 | -webkit-font-variant-ligatures: contextual;
308 | font-variant-ligatures: contextual;
309 | }
310 | .CodeMirror-wrap pre.CodeMirror-line,
311 | .CodeMirror-wrap pre.CodeMirror-line-like {
312 | word-wrap: break-word;
313 | white-space: pre-wrap;
314 | word-break: normal;
315 | }
316 |
317 | .CodeMirror-linebackground {
318 | position: absolute;
319 | left: 0; right: 0; top: 0; bottom: 0;
320 | z-index: 0;
321 | }
322 |
323 | .CodeMirror-linewidget {
324 | position: relative;
325 | z-index: 2;
326 | padding: 0.1px; /* Force widget margins to stay inside of the container */
327 | }
328 |
329 | /*.CodeMirror-widget {}*/
330 |
331 | .CodeMirror-rtl pre { direction: rtl; }
332 |
333 | .CodeMirror-code {
334 | outline: none;
335 | }
336 |
337 | /* Force content-box sizing for the elements where we expect it */
338 | .CodeMirror-scroll,
339 | .CodeMirror-sizer,
340 | .CodeMirror-gutter,
341 | .CodeMirror-gutters,
342 | .CodeMirror-linenumber {
343 | -moz-box-sizing: content-box;
344 | box-sizing: content-box;
345 | }
346 |
347 | .CodeMirror-measure {
348 | position: absolute;
349 | width: 100%;
350 | height: 0;
351 | overflow: hidden;
352 | visibility: hidden;
353 | }
354 |
355 | .CodeMirror-cursor {
356 | position: absolute;
357 | pointer-events: none;
358 | }
359 | .CodeMirror-measure pre { position: static; }
360 |
361 | div.CodeMirror-cursors {
362 | visibility: hidden;
363 | position: relative;
364 | z-index: 3;
365 | }
366 | div.CodeMirror-dragcursors {
367 | visibility: visible;
368 | }
369 |
370 | .CodeMirror-focused div.CodeMirror-cursors {
371 | visibility: visible;
372 | }
373 |
374 | .CodeMirror-selected { background: #d9d9d9; }
375 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
376 | .CodeMirror-crosshair { cursor: crosshair; }
377 | .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
378 | .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
379 |
380 | .cm-searching {
381 | background-color: #ffa;
382 | background-color: rgba(255, 255, 0, .4);
383 | }
384 |
385 | /* Used to force a border model for a node */
386 | .cm-force-border { padding-right: .1px; }
387 |
388 | @media print {
389 | /* Hide the cursor when printing */
390 | .CodeMirror div.CodeMirror-cursors {
391 | visibility: hidden;
392 | }
393 | }
394 |
395 | /* See issue #2901 */
396 | .cm-tab-wrap-hack:after { content: ''; }
397 |
398 | /* Help users use markselection to safely style text background */
399 | span.CodeMirror-selectedtext { background: none; }
400 |
401 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/codemirrortemplate.css:
--------------------------------------------------------------------------------
1 | /* BASICS */
2 |
3 | .CodeMirror {
4 | /* Set height, width, borders, and global font properties here */
5 | font-family: monospace;
6 | height: 300px;
7 | color: black;
8 | direction: ltr;
9 | }
10 |
11 | /* PADDING */
12 |
13 | .CodeMirror-lines {
14 | padding: 4px 0; /* Vertical padding around content */
15 | }
16 | .CodeMirror pre.CodeMirror-line,
17 | .CodeMirror pre.CodeMirror-line-like {
18 | padding: 0 4px; /* Horizontal padding of content */
19 | }
20 |
21 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
22 | background-color: white; /* The little square between H and V scrollbars */
23 | }
24 |
25 | /* GUTTER */
26 |
27 | .CodeMirror-gutters {
28 | border-right: 1px solid #ddd;
29 | background-color: #f7f7f7;
30 | white-space: nowrap;
31 | }
32 | .CodeMirror-linenumbers {}
33 | .CodeMirror-linenumber {
34 | padding: 0 3px 0 5px;
35 | min-width: 20px;
36 | text-align: right;
37 | color: #999;
38 | white-space: nowrap;
39 | }
40 |
41 | .CodeMirror-guttermarker { color: black; }
42 | .CodeMirror-guttermarker-subtle { color: #999; }
43 |
44 | /* CURSOR */
45 |
46 | .CodeMirror-cursor {
47 | border-left: 1px solid black;
48 | border-right: none;
49 | width: 0;
50 | }
51 | /* Shown when moving in bi-directional text */
52 | .CodeMirror div.CodeMirror-secondarycursor {
53 | border-left: 1px solid silver;
54 | }
55 | .cm-fat-cursor .CodeMirror-cursor {
56 | width: auto;
57 | border: 0 !important;
58 | background: #7e7;
59 | }
60 | .cm-fat-cursor div.CodeMirror-cursors {
61 | z-index: 1;
62 | }
63 | .cm-fat-cursor-mark {
64 | background-color: rgba(20, 255, 20, 0.5);
65 | -webkit-animation: blink 1.06s steps(1) infinite;
66 | -moz-animation: blink 1.06s steps(1) infinite;
67 | animation: blink 1.06s steps(1) infinite;
68 | }
69 | .cm-animate-fat-cursor {
70 | width: auto;
71 | border: 0;
72 | -webkit-animation: blink 1.06s steps(1) infinite;
73 | -moz-animation: blink 1.06s steps(1) infinite;
74 | animation: blink 1.06s steps(1) infinite;
75 | background-color: #7e7;
76 | }
77 | @-moz-keyframes blink {
78 | 0% {}
79 | 50% { background-color: transparent; }
80 | 100% {}
81 | }
82 | @-webkit-keyframes blink {
83 | 0% {}
84 | 50% { background-color: transparent; }
85 | 100% {}
86 | }
87 | @keyframes blink {
88 | 0% {}
89 | 50% { background-color: transparent; }
90 | 100% {}
91 | }
92 |
93 | /* Can style cursor different in overwrite (non-insert) mode */
94 | .CodeMirror-overwrite .CodeMirror-cursor {}
95 |
96 | .cm-tab { display: inline-block; text-decoration: inherit; }
97 |
98 | .CodeMirror-rulers {
99 | position: absolute;
100 | left: 0; right: 0; top: -50px; bottom: 0;
101 | overflow: hidden;
102 | }
103 | .CodeMirror-ruler {
104 | border-left: 1px solid #ccc;
105 | top: 0; bottom: 0;
106 | position: absolute;
107 | }
108 |
109 | /* DEFAULT THEME */
110 |
111 | .cm-s-default .cm-header {color: blue;}
112 | .cm-s-default .cm-quote {color: #090;}
113 | .cm-negative {color: #d44;}
114 | .cm-positive {color: #292;}
115 | .cm-header, .cm-strong {font-weight: bold;}
116 | .cm-em {font-style: italic;}
117 | .cm-link {text-decoration: underline;}
118 | .cm-strikethrough {text-decoration: line-through;}
119 |
120 | .cm-s-default .cm-keyword {color: #708;}
121 | .cm-s-default .cm-atom {color: #219;}
122 | .cm-s-default .cm-number {color: #164;}
123 | .cm-s-default .cm-def {color: #00f;}
124 | .cm-s-default .cm-variable,
125 | .cm-s-default .cm-punctuation,
126 | .cm-s-default .cm-property,
127 | .cm-s-default .cm-operator {}
128 | .cm-s-default .cm-variable-2 {color: #05a;}
129 | .cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
130 | .cm-s-default .cm-comment {color: #a50;}
131 | .cm-s-default .cm-string {color: #a11;}
132 | .cm-s-default .cm-string-2 {color: #f50;}
133 | .cm-s-default .cm-meta {color: #555;}
134 | .cm-s-default .cm-qualifier {color: #555;}
135 | .cm-s-default .cm-builtin {color: #30a;}
136 | .cm-s-default .cm-bracket {color: #997;}
137 | .cm-s-default .cm-tag {color: #170;}
138 | .cm-s-default .cm-attribute {color: #00c;}
139 | .cm-s-default .cm-hr {color: #999;}
140 | .cm-s-default .cm-link {color: #00c;}
141 |
142 | .cm-s-default .cm-error {color: #f00;}
143 | .cm-invalidchar {color: #f00;}
144 |
145 | .CodeMirror-composing { border-bottom: 2px solid; }
146 |
147 | /* Default styles for common addons */
148 |
149 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
150 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
151 | .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
152 | .CodeMirror-activeline-background {background: #e8f2ff;}
153 |
154 | /* STOP */
155 |
156 | /* The rest of this file contains styles related to the mechanics of
157 | the editor. You probably shouldn't touch them. */
158 |
159 | .CodeMirror {
160 | position: relative;
161 | overflow: hidden;
162 | background: white;
163 | }
164 |
165 | .CodeMirror-scroll {
166 | overflow: scroll !important; /* Things will break if this is overridden */
167 | /* 30px is the magic margin used to hide the element's real scrollbars */
168 | /* See overflow: hidden in .CodeMirror */
169 | margin-bottom: -30px; margin-right: -30px;
170 | padding-bottom: 30px;
171 | height: 100%;
172 | outline: none; /* Prevent dragging from highlighting the element */
173 | position: relative;
174 | }
175 | .CodeMirror-sizer {
176 | position: relative;
177 | border-right: 30px solid transparent;
178 | }
179 |
180 | /* The fake, visible scrollbars. Used to force redraw during scrolling
181 | before actual scrolling happens, thus preventing shaking and
182 | flickering artifacts. */
183 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
184 | position: absolute;
185 | z-index: 6;
186 | display: none;
187 | }
188 | .CodeMirror-vscrollbar {
189 | right: 0; top: 0;
190 | overflow-x: hidden;
191 | overflow-y: scroll;
192 | }
193 | .CodeMirror-hscrollbar {
194 | bottom: 0; left: 0;
195 | overflow-y: hidden;
196 | overflow-x: scroll;
197 | }
198 | .CodeMirror-scrollbar-filler {
199 | right: 0; bottom: 0;
200 | }
201 | .CodeMirror-gutter-filler {
202 | left: 0; bottom: 0;
203 | }
204 |
205 | .CodeMirror-gutters {
206 | position: absolute; left: 0; top: 0;
207 | min-height: 100%;
208 | z-index: 3;
209 | }
210 | .CodeMirror-gutter {
211 | white-space: normal;
212 | height: 100%;
213 | display: inline-block;
214 | vertical-align: top;
215 | margin-bottom: -30px;
216 | }
217 | .CodeMirror-gutter-wrapper {
218 | position: absolute;
219 | z-index: 4;
220 | background: none !important;
221 | border: none !important;
222 | }
223 | .CodeMirror-gutter-background {
224 | position: absolute;
225 | top: 0; bottom: 0;
226 | z-index: 4;
227 | }
228 | .CodeMirror-gutter-elt {
229 | position: absolute;
230 | cursor: default;
231 | z-index: 4;
232 | }
233 | .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
234 | .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
235 |
236 | .CodeMirror-lines {
237 | cursor: text;
238 | min-height: 1px; /* prevents collapsing before first draw */
239 | }
240 | .CodeMirror pre.CodeMirror-line,
241 | .CodeMirror pre.CodeMirror-line-like {
242 | /* Reset some styles that the rest of the page might have set */
243 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
244 | border-width: 0;
245 | background: transparent;
246 | font-family: inherit;
247 | font-size: inherit;
248 | margin: 0;
249 | white-space: pre;
250 | word-wrap: normal;
251 | line-height: inherit;
252 | color: inherit;
253 | z-index: 2;
254 | position: relative;
255 | overflow: visible;
256 | -webkit-tap-highlight-color: transparent;
257 | -webkit-font-variant-ligatures: contextual;
258 | font-variant-ligatures: contextual;
259 | }
260 | .CodeMirror-wrap pre.CodeMirror-line,
261 | .CodeMirror-wrap pre.CodeMirror-line-like {
262 | word-wrap: break-word;
263 | white-space: pre-wrap;
264 | word-break: normal;
265 | }
266 |
267 | .CodeMirror-linebackground {
268 | position: absolute;
269 | left: 0; right: 0; top: 0; bottom: 0;
270 | z-index: 0;
271 | }
272 |
273 | .CodeMirror-linewidget {
274 | position: relative;
275 | z-index: 2;
276 | padding: 0.1px; /* Force widget margins to stay inside of the container */
277 | }
278 |
279 | .CodeMirror-widget {}
280 |
281 | .CodeMirror-rtl pre { direction: rtl; }
282 |
283 | .CodeMirror-code {
284 | outline: none;
285 | }
286 |
287 | /* Force content-box sizing for the elements where we expect it */
288 | .CodeMirror-scroll,
289 | .CodeMirror-sizer,
290 | .CodeMirror-gutter,
291 | .CodeMirror-gutters,
292 | .CodeMirror-linenumber {
293 | -moz-box-sizing: content-box;
294 | box-sizing: content-box;
295 | }
296 |
297 | .CodeMirror-measure {
298 | position: absolute;
299 | width: 100%;
300 | height: 0;
301 | overflow: hidden;
302 | visibility: hidden;
303 | }
304 |
305 | .CodeMirror-cursor {
306 | position: absolute;
307 | pointer-events: none;
308 | }
309 | .CodeMirror-measure pre { position: static; }
310 |
311 | div.CodeMirror-cursors {
312 | visibility: hidden;
313 | position: relative;
314 | z-index: 3;
315 | }
316 | div.CodeMirror-dragcursors {
317 | visibility: visible;
318 | }
319 |
320 | .CodeMirror-focused div.CodeMirror-cursors {
321 | visibility: visible;
322 | }
323 |
324 | .CodeMirror-selected { background: #d9d9d9; }
325 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
326 | .CodeMirror-crosshair { cursor: crosshair; }
327 | .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
328 | .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
329 |
330 | .cm-searching {
331 | background-color: #ffa;
332 | background-color: rgba(255, 255, 0, .4);
333 | }
334 |
335 | /* Used to force a border model for a node */
336 | .cm-force-border { padding-right: .1px; }
337 |
338 | @media print {
339 | /* Hide the cursor when printing */
340 | .CodeMirror div.CodeMirror-cursors {
341 | visibility: hidden;
342 | }
343 | }
344 |
345 | /* See issue #2901 */
346 | .cm-tab-wrap-hack:after { content: ''; }
347 |
348 | /* Help users use markselection to safely style text background */
349 | span.CodeMirror-selectedtext { background: none; }
350 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/mode/javascript/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: JavaScript mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
27 |
28 |
29 | JavaScript mode
30 |
31 |
32 |
81 |
82 |
90 |
91 |
92 | JavaScript mode supports several configuration options:
93 |
94 | json
which will set the mode to expect JSON
95 | data rather than a JavaScript program.
96 | jsonld
which will set the mode to expect
97 | JSON-LD linked data rather
98 | than a JavaScript program (demo ).
99 | typescript
which will activate additional
100 | syntax highlighting and some other things for TypeScript code
101 | (demo ).
102 | statementIndent
which (given a number) will
103 | determine the amount of indentation to use for statements
104 | continued on a new line.
105 | wordCharacters
, a regexp that indicates which
106 | characters should be considered part of an identifier.
107 | Defaults to /[\w$]/
, which does not handle
108 | non-ASCII identifiers. Can be set to something more elaborate
109 | to improve Unicode support.
110 |
111 |
112 |
113 | MIME types defined: text/javascript
, application/json
, application/ld+json
, text/typescript
, application/typescript
.
114 |
115 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/mode/javascript/json-ld.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: JSON-LD mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
27 |
28 |
29 | JSON-LD mode
30 |
31 |
32 |
61 |
62 |
70 |
71 | This is a specialization of the JavaScript mode .
72 |
73 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/mode/javascript/typescript.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: TypeScript mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
25 |
26 |
27 | TypeScript mode
28 |
29 |
30 |
52 |
53 |
60 |
61 | This is a specialization of the JavaScript mode .
62 |
63 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/mode/xml/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: XML mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
24 |
25 |
26 | XML mode
27 |
39 |
45 | The XML mode supports these configuration parameters:
46 |
47 | htmlMode (boolean)
48 | This switches the mode to parse HTML instead of XML. This
49 | means attributes do not have to be quoted, and some elements
50 | (such as br
) do not require a closing tag.
51 | matchClosing (boolean)
52 | Controls whether the mode checks that close tags match the
53 | corresponding opening tag, and highlights mismatches as errors.
54 | Defaults to true.
55 | alignCDATA (boolean)
56 | Setting this to true will force the opening tag of CDATA
57 | blocks to not be indented.
58 |
59 |
60 | MIME types defined: application/xml
, text/html
.
61 |
62 |
--------------------------------------------------------------------------------
/docs/libs/codemirror/mode/xml/test.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: https://codemirror.net/LICENSE
3 |
4 | (function() {
5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml";
6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); }
7 |
8 | MT("matching",
9 | "[tag&bracket <][tag top][tag&bracket >]",
10 | " text",
11 | " [tag&bracket <][tag inner][tag&bracket />]",
12 | "[tag&bracket ][tag top][tag&bracket >]");
13 |
14 | MT("nonmatching",
15 | "[tag&bracket <][tag top][tag&bracket >]",
16 | " [tag&bracket <][tag inner][tag&bracket />]",
17 | " [tag&bracket ][tag&error tip][tag&bracket&error >]");
18 |
19 | MT("doctype",
20 | "[meta ]",
21 | "[tag&bracket <][tag top][tag&bracket />]");
22 |
23 | MT("cdata",
24 | "[tag&bracket <][tag top][tag&bracket >]",
25 | " [atom ]",
27 | "[tag&bracket ][tag top][tag&bracket >]");
28 |
29 | // HTML tests
30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html");
31 |
32 | MT("selfclose",
33 | "[tag&bracket <][tag html][tag&bracket >]",
34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]",
35 | "[tag&bracket ][tag html][tag&bracket >]");
36 |
37 | MT("list",
38 | "[tag&bracket <][tag ol][tag&bracket >]",
39 | " [tag&bracket <][tag li][tag&bracket >]one",
40 | " [tag&bracket <][tag li][tag&bracket >]two",
41 | "[tag&bracket ][tag ol][tag&bracket >]");
42 |
43 | MT("valueless",
44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]");
45 |
46 | MT("pThenArticle",
47 | "[tag&bracket <][tag p][tag&bracket >]",
48 | " foo",
49 | "[tag&bracket <][tag article][tag&bracket >]bar");
50 |
51 | })();
52 |
--------------------------------------------------------------------------------
/docs/test.js:
--------------------------------------------------------------------------------
1 |
2 | const { elementBuilders } = window.Webscript;
3 | let { body, div, p, nav, h1, ol, li, pre, code, a } = elementBuilders;
4 |
5 | let app = div("cool man!")
6 | document.body = app;
--------------------------------------------------------------------------------
/html2webscript/favicon/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/html2webscript/favicon/android-chrome-192x192.png
--------------------------------------------------------------------------------
/html2webscript/favicon/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/html2webscript/favicon/android-chrome-512x512.png
--------------------------------------------------------------------------------
/html2webscript/favicon/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/html2webscript/favicon/apple-touch-icon.png
--------------------------------------------------------------------------------
/html2webscript/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/html2webscript/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/html2webscript/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/html2webscript/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/html2webscript/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/html2webscript/favicon/favicon.ico
--------------------------------------------------------------------------------
/html2webscript/favicon/site.webmanifest:
--------------------------------------------------------------------------------
1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
--------------------------------------------------------------------------------
/html2webscript/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Convert HTML to Webscript
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/codemirror.css:
--------------------------------------------------------------------------------
1 | /* BASICS */
2 |
3 |
4 |
5 | .CodeMirror {
6 | /* Set height, width, borders, and global font properties here */
7 | font-family: monospace;
8 | /*height: 300px;*/
9 | padding: 0.2em;
10 | border-radius: 5px;
11 | height: 100%;
12 | color: black;
13 | direction: ltr;
14 | }
15 |
16 | /* PADDING */
17 |
18 | .CodeMirror-lines {
19 | padding: 4px 0; /* Vertical padding around content */
20 | }
21 | .CodeMirror pre.CodeMirror-line,
22 | .CodeMirror pre.CodeMirror-line-like {
23 | padding: 0 4px; /* Horizontal padding of content */
24 | }
25 |
26 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
27 | background-color: white; /* The little square between H and V scrollbars */
28 | }
29 |
30 | /* GUTTER */
31 |
32 | .CodeMirror-gutters {
33 | border-right: 1px solid #ddd;
34 | background-color: #f7f7f7;
35 | white-space: nowrap;
36 | }
37 | /* .CodeMirror-linenumbers {} */
38 | .CodeMirror-linenumber {
39 | padding: 0 3px 0 5px;
40 | min-width: 20px;
41 | text-align: right;
42 | color: #999;
43 | white-space: nowrap;
44 | }
45 |
46 | .CodeMirror-guttermarker { color: black; }
47 | .CodeMirror-guttermarker-subtle { color: #999; }
48 |
49 | /* CURSOR */
50 |
51 | .CodeMirror-cursor {
52 | border-left: 1px solid black;
53 | border-right: none;
54 | width: 0;
55 | }
56 | /* Shown when moving in bi-directional text */
57 | .CodeMirror div.CodeMirror-secondarycursor {
58 | border-left: 1px solid silver;
59 | }
60 | .cm-fat-cursor .CodeMirror-cursor {
61 | width: auto;
62 | border: 0 !important;
63 | background: #7e7;
64 | }
65 | .cm-fat-cursor div.CodeMirror-cursors {
66 | z-index: 1;
67 | }
68 | .cm-fat-cursor-mark {
69 | background-color: rgba(20, 255, 20, 0.5);
70 | -webkit-animation: blink 1.06s steps(1) infinite;
71 | -moz-animation: blink 1.06s steps(1) infinite;
72 | animation: blink 1.06s steps(1) infinite;
73 | }
74 | .cm-animate-fat-cursor {
75 | width: auto;
76 | border: 0;
77 | -webkit-animation: blink 1.06s steps(1) infinite;
78 | -moz-animation: blink 1.06s steps(1) infinite;
79 | animation: blink 1.06s steps(1) infinite;
80 | background-color: #7e7;
81 | }
82 | @-moz-keyframes blink {
83 | 0% {}
84 | 50% { background-color: transparent; }
85 | 100% {}
86 | }
87 | @-webkit-keyframes blink {
88 | 0% {}
89 | 50% { background-color: transparent; }
90 | 100% {}
91 | }
92 | @keyframes blink {
93 | 0% {}
94 | 50% { background-color: transparent; }
95 | 100% {}
96 | }
97 |
98 | /* Can style cursor different in overwrite (non-insert) mode */
99 | /*
100 | .CodeMirror-overwrite .CodeMirror-cursor {}
101 | */
102 | .cm-tab { display: inline-block; text-decoration: inherit; }
103 |
104 | .CodeMirror-rulers {
105 | position: absolute;
106 | left: 0; right: 0; top: -50px; bottom: 0;
107 | overflow: hidden;
108 | }
109 | .CodeMirror-ruler {
110 | border-left: 1px solid #ccc;
111 | top: 0; bottom: 0;
112 | position: absolute;
113 | }
114 |
115 | /* DEFAULT THEME */
116 |
117 | .cm-s-default .cm-header {color: blue;}
118 | .cm-s-default .cm-quote {color: #090;}
119 | .cm-negative {color: #d44;}
120 | .cm-positive {color: #292;}
121 | .cm-header, .cm-strong {font-weight: bold;}
122 | .cm-em {font-style: italic;}
123 | .cm-link {text-decoration: underline;}
124 | .cm-strikethrough {text-decoration: line-through;}
125 |
126 | .cm-s-default .cm-keyword {color: #708;}
127 | .cm-s-default .cm-atom {color: #219;}
128 | .cm-s-default .cm-number {color: #164;}
129 | .cm-s-default .cm-def {color: #00f;}
130 |
131 |
132 |
133 | /*
134 | .cm-s-default .cm-variable,
135 | .cm-s-default .cm-punctuation,
136 | .cm-s-default .cm-property,
137 | .cm-s-default .cm-operator {}
138 | */
139 |
140 |
141 |
142 | .cm-s-default .cm-variable-2 {color: #05a;}
143 | .cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
144 | .cm-s-default .cm-comment {color: rgb(150,105,50) /*#a50;*/}
145 |
146 |
147 |
148 | /* rgb(102, 115, 241) */
149 | .cm-s-default .cm-string-2 {color: rgb(170,64,64) /*rgb(80, 90, 220)*/ /*#a22*/ /* #047481*/ /*#a11*/ /*#f50*/;}
150 | .cm-s-default .cm-meta {color: #555;}
151 | .cm-s-default .cm-qualifier {color: #555;}
152 | .cm-s-default .cm-builtin {color: #30a;}
153 | .cm-s-default .cm-bracket {color: #997;}
154 | .cm-s-default .cm-tag {color: #170;}
155 | .cm-s-default .cm-attribute {color: #00c;}
156 | .cm-s-default .cm-hr {color: #999;}
157 | .cm-s-default .cm-link {color: #00c;}
158 | .cm-s-default .cm-string {color: rgb(170,64,64)/*rgb(54, 67, 120)*/ /*black*/;/*#a11*/}
159 |
160 |
161 | /*
162 | .cm-variable { color: #170;}
163 | .cm-s-default .cm-m-javascript.cm-string {color: black;}
164 | .cm-s-default .cm-string-2 + .cm-string {color: rgb(20, 30, 80);}
165 | .cm-s-default .cm-property + .cm-string-2 {color: rgb(75, 85, 170);}
166 | .cm-s-default .cm-property { color: rgb(0,0,194);}
167 | */
168 |
169 | .cm-variable {color: #170; }
170 | .cm-s-default .cm-m-javascript.cm-string {color: rgb(20, 30, 80);}
171 | .cm-s-default .cm-variable + .cm-string-2 {color: rgb(20, 30, 80);}
172 | .cm-s-default .cm-string-2 + .cm-string-2 {color: rgb(20, 30, 80);}
173 | .cm-s-default .cm-property + .cm-string-2 {color: rgb(170,64,64);}
174 | .cm-s-default .cm-property { color: #00c;}
175 |
176 |
177 | /*
178 | .cm-variable {color: rgb(0,0,194); }
179 | .cm-s-default .cm-m-javascript.cm-string {color: rgb(20, 30, 80);}
180 | .cm-s-default .cm-string-2 + .cm-string {color: rgb(20, 30, 80);}
181 | .cm-s-default .cm-property + .cm-string-2 {color: rgb(75, 85, 170);}
182 | .cm-s-default .cm-property { color: #170;}
183 | */
184 |
185 | /*
186 |
187 |
188 | "#" ,
189 | " Get started " )),
190 |
191 | */
192 | .cm-s-default .cm-error {color: #f00;}
193 | .cm-invalidchar {color: #f00;}
194 |
195 | .CodeMirror-composing { border-bottom: 2px solid; }
196 |
197 | /* Default styles for common addons */
198 |
199 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
200 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
201 | .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
202 | .CodeMirror-activeline-background {background: #e8f2ff;}
203 |
204 | /* STOP */
205 |
206 | /* The rest of this file contains styles related to the mechanics of
207 | the editor. You probably shouldn't touch them. */
208 |
209 | .CodeMirror {
210 | position: relative;
211 | overflow: hidden;
212 | background: white;
213 | }
214 |
215 | .CodeMirror-scroll {
216 | overflow: scroll !important; /* Things will break if this is overridden */
217 | /* 30px is the magic margin used to hide the element's real scrollbars */
218 | /* See overflow: hidden in .CodeMirror */
219 | margin-bottom: -30px; margin-right: -30px;
220 | padding-bottom: 30px;
221 | height: 100%;
222 | outline: none; /* Prevent dragging from highlighting the element */
223 | position: relative;
224 | }
225 | .CodeMirror-sizer {
226 | position: relative;
227 | border-right: 30px solid transparent;
228 | }
229 |
230 | /* The fake, visible scrollbars. Used to force redraw during scrolling
231 | before actual scrolling happens, thus preventing shaking and
232 | flickering artifacts. */
233 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
234 | position: absolute;
235 | z-index: 6;
236 | display: none;
237 | }
238 | .CodeMirror-vscrollbar {
239 | right: 0; top: 0;
240 | overflow-x: hidden;
241 | overflow-y: scroll;
242 | }
243 | .CodeMirror-hscrollbar {
244 | bottom: 0; left: 0;
245 | overflow-y: hidden;
246 | overflow-x: scroll;
247 | }
248 | .CodeMirror-scrollbar-filler {
249 | right: 0; bottom: 0;
250 | }
251 | .CodeMirror-gutter-filler {
252 | left: 0; bottom: 0;
253 | }
254 |
255 | .CodeMirror-gutters {
256 | position: absolute; left: 0; top: 0;
257 | min-height: 100%;
258 | z-index: 3;
259 | }
260 | .CodeMirror-gutter {
261 | white-space: normal;
262 | height: 100%;
263 | display: inline-block;
264 | vertical-align: top;
265 | margin-bottom: -30px;
266 | }
267 | .CodeMirror-gutter-wrapper {
268 | position: absolute;
269 | z-index: 4;
270 | background: none !important;
271 | border: none !important;
272 | }
273 | .CodeMirror-gutter-background {
274 | position: absolute;
275 | top: 0; bottom: 0;
276 | z-index: 4;
277 | }
278 | .CodeMirror-gutter-elt {
279 | position: absolute;
280 | cursor: default;
281 | z-index: 4;
282 | }
283 | .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
284 | .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
285 |
286 | .CodeMirror-lines {
287 | cursor: text;
288 | min-height: 1px; /* prevents collapsing before first draw */
289 | }
290 | .CodeMirror pre.CodeMirror-line,
291 | .CodeMirror pre.CodeMirror-line-like {
292 | /* Reset some styles that the rest of the page might have set */
293 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
294 | border-width: 0;
295 | background: transparent;
296 | font-family: inherit;
297 | font-size: inherit;
298 | margin: 0;
299 | white-space: pre;
300 | word-wrap: normal;
301 | line-height: inherit;
302 | color: inherit;
303 | z-index: 2;
304 | position: relative;
305 | overflow: visible;
306 | -webkit-tap-highlight-color: transparent;
307 | -webkit-font-variant-ligatures: contextual;
308 | font-variant-ligatures: contextual;
309 | }
310 | .CodeMirror-wrap pre.CodeMirror-line,
311 | .CodeMirror-wrap pre.CodeMirror-line-like {
312 | word-wrap: break-word;
313 | white-space: pre-wrap;
314 | word-break: normal;
315 | }
316 |
317 | .CodeMirror-linebackground {
318 | position: absolute;
319 | left: 0; right: 0; top: 0; bottom: 0;
320 | z-index: 0;
321 | }
322 |
323 | .CodeMirror-linewidget {
324 | position: relative;
325 | z-index: 2;
326 | padding: 0.1px; /* Force widget margins to stay inside of the container */
327 | }
328 |
329 | /*.CodeMirror-widget {}*/
330 |
331 | .CodeMirror-rtl pre { direction: rtl; }
332 |
333 | .CodeMirror-code {
334 | outline: none;
335 | }
336 |
337 | /* Force content-box sizing for the elements where we expect it */
338 | .CodeMirror-scroll,
339 | .CodeMirror-sizer,
340 | .CodeMirror-gutter,
341 | .CodeMirror-gutters,
342 | .CodeMirror-linenumber {
343 | -moz-box-sizing: content-box;
344 | box-sizing: content-box;
345 | }
346 |
347 | .CodeMirror-measure {
348 | position: absolute;
349 | width: 100%;
350 | height: 0;
351 | overflow: hidden;
352 | visibility: hidden;
353 | }
354 |
355 | .CodeMirror-cursor {
356 | position: absolute;
357 | pointer-events: none;
358 | }
359 | .CodeMirror-measure pre { position: static; }
360 |
361 | div.CodeMirror-cursors {
362 | visibility: hidden;
363 | position: relative;
364 | z-index: 3;
365 | }
366 | div.CodeMirror-dragcursors {
367 | visibility: visible;
368 | }
369 |
370 | .CodeMirror-focused div.CodeMirror-cursors {
371 | visibility: visible;
372 | }
373 |
374 | .CodeMirror-selected { background: #d9d9d9; }
375 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
376 | .CodeMirror-crosshair { cursor: crosshair; }
377 | .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
378 | .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
379 |
380 | .cm-searching {
381 | background-color: #ffa;
382 | background-color: rgba(255, 255, 0, .4);
383 | }
384 |
385 | /* Used to force a border model for a node */
386 | .cm-force-border { padding-right: .1px; }
387 |
388 | @media print {
389 | /* Hide the cursor when printing */
390 | .CodeMirror div.CodeMirror-cursors {
391 | visibility: hidden;
392 | }
393 | }
394 |
395 | /* See issue #2901 */
396 | .cm-tab-wrap-hack:after { content: ''; }
397 |
398 | /* Help users use markselection to safely style text background */
399 | span.CodeMirror-selectedtext { background: none; }
400 |
401 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/codemirrortemplate.css:
--------------------------------------------------------------------------------
1 | /* BASICS */
2 |
3 | .CodeMirror {
4 | /* Set height, width, borders, and global font properties here */
5 | font-family: monospace;
6 | height: 300px;
7 | color: black;
8 | direction: ltr;
9 | }
10 |
11 | /* PADDING */
12 |
13 | .CodeMirror-lines {
14 | padding: 4px 0; /* Vertical padding around content */
15 | }
16 | .CodeMirror pre.CodeMirror-line,
17 | .CodeMirror pre.CodeMirror-line-like {
18 | padding: 0 4px; /* Horizontal padding of content */
19 | }
20 |
21 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
22 | background-color: white; /* The little square between H and V scrollbars */
23 | }
24 |
25 | /* GUTTER */
26 |
27 | .CodeMirror-gutters {
28 | border-right: 1px solid #ddd;
29 | background-color: #f7f7f7;
30 | white-space: nowrap;
31 | }
32 | .CodeMirror-linenumbers {}
33 | .CodeMirror-linenumber {
34 | padding: 0 3px 0 5px;
35 | min-width: 20px;
36 | text-align: right;
37 | color: #999;
38 | white-space: nowrap;
39 | }
40 |
41 | .CodeMirror-guttermarker { color: black; }
42 | .CodeMirror-guttermarker-subtle { color: #999; }
43 |
44 | /* CURSOR */
45 |
46 | .CodeMirror-cursor {
47 | border-left: 1px solid black;
48 | border-right: none;
49 | width: 0;
50 | }
51 | /* Shown when moving in bi-directional text */
52 | .CodeMirror div.CodeMirror-secondarycursor {
53 | border-left: 1px solid silver;
54 | }
55 | .cm-fat-cursor .CodeMirror-cursor {
56 | width: auto;
57 | border: 0 !important;
58 | background: #7e7;
59 | }
60 | .cm-fat-cursor div.CodeMirror-cursors {
61 | z-index: 1;
62 | }
63 | .cm-fat-cursor-mark {
64 | background-color: rgba(20, 255, 20, 0.5);
65 | -webkit-animation: blink 1.06s steps(1) infinite;
66 | -moz-animation: blink 1.06s steps(1) infinite;
67 | animation: blink 1.06s steps(1) infinite;
68 | }
69 | .cm-animate-fat-cursor {
70 | width: auto;
71 | border: 0;
72 | -webkit-animation: blink 1.06s steps(1) infinite;
73 | -moz-animation: blink 1.06s steps(1) infinite;
74 | animation: blink 1.06s steps(1) infinite;
75 | background-color: #7e7;
76 | }
77 | @-moz-keyframes blink {
78 | 0% {}
79 | 50% { background-color: transparent; }
80 | 100% {}
81 | }
82 | @-webkit-keyframes blink {
83 | 0% {}
84 | 50% { background-color: transparent; }
85 | 100% {}
86 | }
87 | @keyframes blink {
88 | 0% {}
89 | 50% { background-color: transparent; }
90 | 100% {}
91 | }
92 |
93 | /* Can style cursor different in overwrite (non-insert) mode */
94 | .CodeMirror-overwrite .CodeMirror-cursor {}
95 |
96 | .cm-tab { display: inline-block; text-decoration: inherit; }
97 |
98 | .CodeMirror-rulers {
99 | position: absolute;
100 | left: 0; right: 0; top: -50px; bottom: 0;
101 | overflow: hidden;
102 | }
103 | .CodeMirror-ruler {
104 | border-left: 1px solid #ccc;
105 | top: 0; bottom: 0;
106 | position: absolute;
107 | }
108 |
109 | /* DEFAULT THEME */
110 |
111 | .cm-s-default .cm-header {color: blue;}
112 | .cm-s-default .cm-quote {color: #090;}
113 | .cm-negative {color: #d44;}
114 | .cm-positive {color: #292;}
115 | .cm-header, .cm-strong {font-weight: bold;}
116 | .cm-em {font-style: italic;}
117 | .cm-link {text-decoration: underline;}
118 | .cm-strikethrough {text-decoration: line-through;}
119 |
120 | .cm-s-default .cm-keyword {color: #708;}
121 | .cm-s-default .cm-atom {color: #219;}
122 | .cm-s-default .cm-number {color: #164;}
123 | .cm-s-default .cm-def {color: #00f;}
124 | .cm-s-default .cm-variable,
125 | .cm-s-default .cm-punctuation,
126 | .cm-s-default .cm-property,
127 | .cm-s-default .cm-operator {}
128 | .cm-s-default .cm-variable-2 {color: #05a;}
129 | .cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
130 | .cm-s-default .cm-comment {color: #a50;}
131 | .cm-s-default .cm-string {color: #a11;}
132 | .cm-s-default .cm-string-2 {color: #f50;}
133 | .cm-s-default .cm-meta {color: #555;}
134 | .cm-s-default .cm-qualifier {color: #555;}
135 | .cm-s-default .cm-builtin {color: #30a;}
136 | .cm-s-default .cm-bracket {color: #997;}
137 | .cm-s-default .cm-tag {color: #170;}
138 | .cm-s-default .cm-attribute {color: #00c;}
139 | .cm-s-default .cm-hr {color: #999;}
140 | .cm-s-default .cm-link {color: #00c;}
141 |
142 | .cm-s-default .cm-error {color: #f00;}
143 | .cm-invalidchar {color: #f00;}
144 |
145 | .CodeMirror-composing { border-bottom: 2px solid; }
146 |
147 | /* Default styles for common addons */
148 |
149 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
150 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
151 | .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
152 | .CodeMirror-activeline-background {background: #e8f2ff;}
153 |
154 | /* STOP */
155 |
156 | /* The rest of this file contains styles related to the mechanics of
157 | the editor. You probably shouldn't touch them. */
158 |
159 | .CodeMirror {
160 | position: relative;
161 | overflow: hidden;
162 | background: white;
163 | }
164 |
165 | .CodeMirror-scroll {
166 | overflow: scroll !important; /* Things will break if this is overridden */
167 | /* 30px is the magic margin used to hide the element's real scrollbars */
168 | /* See overflow: hidden in .CodeMirror */
169 | margin-bottom: -30px; margin-right: -30px;
170 | padding-bottom: 30px;
171 | height: 100%;
172 | outline: none; /* Prevent dragging from highlighting the element */
173 | position: relative;
174 | }
175 | .CodeMirror-sizer {
176 | position: relative;
177 | border-right: 30px solid transparent;
178 | }
179 |
180 | /* The fake, visible scrollbars. Used to force redraw during scrolling
181 | before actual scrolling happens, thus preventing shaking and
182 | flickering artifacts. */
183 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
184 | position: absolute;
185 | z-index: 6;
186 | display: none;
187 | }
188 | .CodeMirror-vscrollbar {
189 | right: 0; top: 0;
190 | overflow-x: hidden;
191 | overflow-y: scroll;
192 | }
193 | .CodeMirror-hscrollbar {
194 | bottom: 0; left: 0;
195 | overflow-y: hidden;
196 | overflow-x: scroll;
197 | }
198 | .CodeMirror-scrollbar-filler {
199 | right: 0; bottom: 0;
200 | }
201 | .CodeMirror-gutter-filler {
202 | left: 0; bottom: 0;
203 | }
204 |
205 | .CodeMirror-gutters {
206 | position: absolute; left: 0; top: 0;
207 | min-height: 100%;
208 | z-index: 3;
209 | }
210 | .CodeMirror-gutter {
211 | white-space: normal;
212 | height: 100%;
213 | display: inline-block;
214 | vertical-align: top;
215 | margin-bottom: -30px;
216 | }
217 | .CodeMirror-gutter-wrapper {
218 | position: absolute;
219 | z-index: 4;
220 | background: none !important;
221 | border: none !important;
222 | }
223 | .CodeMirror-gutter-background {
224 | position: absolute;
225 | top: 0; bottom: 0;
226 | z-index: 4;
227 | }
228 | .CodeMirror-gutter-elt {
229 | position: absolute;
230 | cursor: default;
231 | z-index: 4;
232 | }
233 | .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
234 | .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
235 |
236 | .CodeMirror-lines {
237 | cursor: text;
238 | min-height: 1px; /* prevents collapsing before first draw */
239 | }
240 | .CodeMirror pre.CodeMirror-line,
241 | .CodeMirror pre.CodeMirror-line-like {
242 | /* Reset some styles that the rest of the page might have set */
243 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
244 | border-width: 0;
245 | background: transparent;
246 | font-family: inherit;
247 | font-size: inherit;
248 | margin: 0;
249 | white-space: pre;
250 | word-wrap: normal;
251 | line-height: inherit;
252 | color: inherit;
253 | z-index: 2;
254 | position: relative;
255 | overflow: visible;
256 | -webkit-tap-highlight-color: transparent;
257 | -webkit-font-variant-ligatures: contextual;
258 | font-variant-ligatures: contextual;
259 | }
260 | .CodeMirror-wrap pre.CodeMirror-line,
261 | .CodeMirror-wrap pre.CodeMirror-line-like {
262 | word-wrap: break-word;
263 | white-space: pre-wrap;
264 | word-break: normal;
265 | }
266 |
267 | .CodeMirror-linebackground {
268 | position: absolute;
269 | left: 0; right: 0; top: 0; bottom: 0;
270 | z-index: 0;
271 | }
272 |
273 | .CodeMirror-linewidget {
274 | position: relative;
275 | z-index: 2;
276 | padding: 0.1px; /* Force widget margins to stay inside of the container */
277 | }
278 |
279 | .CodeMirror-widget {}
280 |
281 | .CodeMirror-rtl pre { direction: rtl; }
282 |
283 | .CodeMirror-code {
284 | outline: none;
285 | }
286 |
287 | /* Force content-box sizing for the elements where we expect it */
288 | .CodeMirror-scroll,
289 | .CodeMirror-sizer,
290 | .CodeMirror-gutter,
291 | .CodeMirror-gutters,
292 | .CodeMirror-linenumber {
293 | -moz-box-sizing: content-box;
294 | box-sizing: content-box;
295 | }
296 |
297 | .CodeMirror-measure {
298 | position: absolute;
299 | width: 100%;
300 | height: 0;
301 | overflow: hidden;
302 | visibility: hidden;
303 | }
304 |
305 | .CodeMirror-cursor {
306 | position: absolute;
307 | pointer-events: none;
308 | }
309 | .CodeMirror-measure pre { position: static; }
310 |
311 | div.CodeMirror-cursors {
312 | visibility: hidden;
313 | position: relative;
314 | z-index: 3;
315 | }
316 | div.CodeMirror-dragcursors {
317 | visibility: visible;
318 | }
319 |
320 | .CodeMirror-focused div.CodeMirror-cursors {
321 | visibility: visible;
322 | }
323 |
324 | .CodeMirror-selected { background: #d9d9d9; }
325 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
326 | .CodeMirror-crosshair { cursor: crosshair; }
327 | .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
328 | .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
329 |
330 | .cm-searching {
331 | background-color: #ffa;
332 | background-color: rgba(255, 255, 0, .4);
333 | }
334 |
335 | /* Used to force a border model for a node */
336 | .cm-force-border { padding-right: .1px; }
337 |
338 | @media print {
339 | /* Hide the cursor when printing */
340 | .CodeMirror div.CodeMirror-cursors {
341 | visibility: hidden;
342 | }
343 | }
344 |
345 | /* See issue #2901 */
346 | .cm-tab-wrap-hack:after { content: ''; }
347 |
348 | /* Help users use markselection to safely style text background */
349 | span.CodeMirror-selectedtext { background: none; }
350 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/matchbrackets.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: https://codemirror.net/LICENSE
3 |
4 | (function(mod) {
5 | if (typeof exports == "object" && typeof module == "object") // CommonJS
6 | mod(require("../../lib/codemirror"));
7 | else if (typeof define == "function" && define.amd) // AMD
8 | define(["../../lib/codemirror"], mod);
9 | else // Plain browser env
10 | mod(CodeMirror);
11 | })(function(CodeMirror) {
12 | var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
13 | (document.documentMode == null || document.documentMode < 8);
14 |
15 | var Pos = CodeMirror.Pos;
16 |
17 | var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<", "<": ">>", ">": "<<"};
18 |
19 | function bracketRegex(config) {
20 | return config && config.bracketRegex || /[(){}[\]]/
21 | }
22 |
23 | function findMatchingBracket(cm, where, config) {
24 | var line = cm.getLineHandle(where.line), pos = where.ch - 1;
25 | var afterCursor = config && config.afterCursor
26 | if (afterCursor == null)
27 | afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
28 | var re = bracketRegex(config)
29 |
30 | // A cursor is defined as between two characters, but in in vim command mode
31 | // (i.e. not insert mode), the cursor is visually represented as a
32 | // highlighted box on top of the 2nd character. Otherwise, we allow matches
33 | // from before or after the cursor.
34 | var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||
35 | re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];
36 | if (!match) return null;
37 | var dir = match.charAt(1) == ">" ? 1 : -1;
38 | if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
39 | var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
40 |
41 | var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
42 | if (found == null) return null;
43 | return {from: Pos(where.line, pos), to: found && found.pos,
44 | match: found && found.ch == match.charAt(0), forward: dir > 0};
45 | }
46 |
47 | // bracketRegex is used to specify which type of bracket to scan
48 | // should be a regexp, e.g. /[[\]]/
49 | //
50 | // Note: If "where" is on an open bracket, then this bracket is ignored.
51 | //
52 | // Returns false when no bracket was found, null when it reached
53 | // maxScanLines and gave up
54 | function scanForBracket(cm, where, dir, style, config) {
55 | var maxScanLen = (config && config.maxScanLineLength) || 10000;
56 | var maxScanLines = (config && config.maxScanLines) || 1000;
57 |
58 | var stack = [];
59 | var re = bracketRegex(config)
60 | var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
61 | : Math.max(cm.firstLine() - 1, where.line - maxScanLines);
62 | for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
63 | var line = cm.getLine(lineNo);
64 | if (!line) continue;
65 | var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
66 | if (line.length > maxScanLen) continue;
67 | if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
68 | for (; pos != end; pos += dir) {
69 | var ch = line.charAt(pos);
70 | if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
71 | var match = matching[ch];
72 | if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
73 | else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
74 | else stack.pop();
75 | }
76 | }
77 | }
78 | return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
79 | }
80 |
81 | function matchBrackets(cm, autoclear, config) {
82 | // Disable brace matching in long lines, since it'll cause hugely slow updates
83 | var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
84 | var marks = [], ranges = cm.listSelections();
85 | for (var i = 0; i < ranges.length; i++) {
86 | var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
87 | if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
88 | var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
89 | marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
90 | if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
91 | marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
92 | }
93 | }
94 |
95 | if (marks.length) {
96 | // Kludge to work around the IE bug from issue #1193, where text
97 | // input stops going to the textare whever this fires.
98 | if (ie_lt8 && cm.state.focused) cm.focus();
99 |
100 | var clear = function() {
101 | cm.operation(function() {
102 | for (var i = 0; i < marks.length; i++) marks[i].clear();
103 | });
104 | };
105 | if (autoclear) setTimeout(clear, 800);
106 | else return clear;
107 | }
108 | }
109 |
110 | function doMatchBrackets(cm) {
111 | cm.operation(function() {
112 | if (cm.state.matchBrackets.currentlyHighlighted) {
113 | cm.state.matchBrackets.currentlyHighlighted();
114 | cm.state.matchBrackets.currentlyHighlighted = null;
115 | }
116 | cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
117 | });
118 | }
119 |
120 | CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
121 | function clear(cm) {
122 | if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
123 | cm.state.matchBrackets.currentlyHighlighted();
124 | cm.state.matchBrackets.currentlyHighlighted = null;
125 | }
126 | }
127 |
128 | if (old && old != CodeMirror.Init) {
129 | cm.off("cursorActivity", doMatchBrackets);
130 | cm.off("focus", doMatchBrackets)
131 | cm.off("blur", clear)
132 | clear(cm);
133 | }
134 | if (val) {
135 | cm.state.matchBrackets = typeof val == "object" ? val : {};
136 | cm.on("cursorActivity", doMatchBrackets);
137 | cm.on("focus", doMatchBrackets)
138 | cm.on("blur", clear)
139 | }
140 | });
141 |
142 | CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
143 | CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
144 | // Backwards-compatibility kludge
145 | if (oldConfig || typeof config == "boolean") {
146 | if (!oldConfig) {
147 | config = config ? {strict: true} : null
148 | } else {
149 | oldConfig.strict = config
150 | config = oldConfig
151 | }
152 | }
153 | return findMatchingBracket(this, pos, config)
154 | });
155 | CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
156 | return scanForBracket(this, pos, dir, style, config);
157 | });
158 | });
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/mode/javascript/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: JavaScript mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
27 |
28 |
29 | JavaScript mode
30 |
31 |
32 |
33 | // Demo code (the actual new parser character stream implementation)
34 |
35 | function StringStream(string) {
36 | this.pos = 0;
37 | this.string = string;
38 | }
39 |
40 | StringStream.prototype = {
41 | done: function() {return this.pos >= this.string.length;},
42 | peek: function() {return this.string.charAt(this.pos);},
43 | next: function() {
44 | if (this.pos < this.string.length)
45 | return this.string.charAt(this.pos++);
46 | },
47 | eat: function(match) {
48 | var ch = this.string.charAt(this.pos);
49 | if (typeof match == "string") var ok = ch == match;
50 | else var ok = ch && match.test ? match.test(ch) : match(ch);
51 | if (ok) {this.pos++; return ch;}
52 | },
53 | eatWhile: function(match) {
54 | var start = this.pos;
55 | while (this.eat(match));
56 | if (this.pos > start) return this.string.slice(start, this.pos);
57 | },
58 | backUp: function(n) {this.pos -= n;},
59 | column: function() {return this.pos;},
60 | eatSpace: function() {
61 | var start = this.pos;
62 | while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
63 | return this.pos - start;
64 | },
65 | match: function(pattern, consume, caseInsensitive) {
66 | if (typeof pattern == "string") {
67 | function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
68 | if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
69 | if (consume !== false) this.pos += str.length;
70 | return true;
71 | }
72 | }
73 | else {
74 | var match = this.string.slice(this.pos).match(pattern);
75 | if (match && consume !== false) this.pos += match[0].length;
76 | return match;
77 | }
78 | }
79 | };
80 |
81 |
82 |
90 |
91 |
92 | JavaScript mode supports several configuration options:
93 |
94 | json
which will set the mode to expect JSON
95 | data rather than a JavaScript program.
96 | jsonld
which will set the mode to expect
97 | JSON-LD linked data rather
98 | than a JavaScript program (demo ).
99 | typescript
which will activate additional
100 | syntax highlighting and some other things for TypeScript code
101 | (demo ).
102 | statementIndent
which (given a number) will
103 | determine the amount of indentation to use for statements
104 | continued on a new line.
105 | wordCharacters
, a regexp that indicates which
106 | characters should be considered part of an identifier.
107 | Defaults to /[\w$]/
, which does not handle
108 | non-ASCII identifiers. Can be set to something more elaborate
109 | to improve Unicode support.
110 |
111 |
112 |
113 | MIME types defined: text/javascript
, application/json
, application/ld+json
, text/typescript
, application/typescript
.
114 |
115 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/mode/javascript/json-ld.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: JSON-LD mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
27 |
28 |
29 | JSON-LD mode
30 |
31 |
32 |
33 | {
34 | "@context": {
35 | "name": "http://schema.org/name",
36 | "description": "http://schema.org/description",
37 | "image": {
38 | "@id": "http://schema.org/image",
39 | "@type": "@id"
40 | },
41 | "geo": "http://schema.org/geo",
42 | "latitude": {
43 | "@id": "http://schema.org/latitude",
44 | "@type": "xsd:float"
45 | },
46 | "longitude": {
47 | "@id": "http://schema.org/longitude",
48 | "@type": "xsd:float"
49 | },
50 | "xsd": "http://www.w3.org/2001/XMLSchema#"
51 | },
52 | "name": "The Empire State Building",
53 | "description": "The Empire State Building is a 102-story landmark in New York City.",
54 | "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
55 | "geo": {
56 | "latitude": "40.75",
57 | "longitude": "73.98"
58 | }
59 | }
60 |
61 |
62 |
70 |
71 | This is a specialization of the JavaScript mode .
72 |
73 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/mode/javascript/typescript.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: TypeScript mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
25 |
26 |
27 | TypeScript mode
28 |
29 |
30 |
31 | class Greeter {
32 | greeting: string;
33 | constructor (message: string) {
34 | this.greeting = message;
35 | }
36 | greet() {
37 | return "Hello, " + this.greeting;
38 | }
39 | }
40 |
41 | var greeter = new Greeter("world");
42 |
43 | var button = document.createElement('button')
44 | button.innerText = "Say Hello"
45 | button.onclick = function() {
46 | alert(greeter.greet())
47 | }
48 |
49 | document.body.appendChild(button)
50 |
51 |
52 |
53 |
60 |
61 | This is a specialization of the JavaScript mode .
62 |
63 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/mode/xml/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: XML mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
24 |
25 |
26 | XML mode
27 |
28 | <html style="color: green">
29 | <!-- this is a comment -->
30 | <head>
31 | <title>HTML Example</title>
32 | </head>
33 | <body>
34 | The indentation tries to be <em>somewhat "do what
35 | I mean"</em>... but might not match your style.
36 | </body>
37 | </html>
38 |
39 |
45 | The XML mode supports these configuration parameters:
46 |
47 | htmlMode (boolean)
48 | This switches the mode to parse HTML instead of XML. This
49 | means attributes do not have to be quoted, and some elements
50 | (such as br
) do not require a closing tag.
51 | matchClosing (boolean)
52 | Controls whether the mode checks that close tags match the
53 | corresponding opening tag, and highlights mismatches as errors.
54 | Defaults to true.
55 | alignCDATA (boolean)
56 | Setting this to true will force the opening tag of CDATA
57 | blocks to not be indented.
58 |
59 |
60 | MIME types defined: application/xml
, text/html
.
61 |
62 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/mode/xml/test.js:
--------------------------------------------------------------------------------
1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 | // Distributed under an MIT license: https://codemirror.net/LICENSE
3 |
4 | (function() {
5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml";
6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); }
7 |
8 | MT("matching",
9 | "[tag&bracket <][tag top][tag&bracket >]",
10 | " text",
11 | " [tag&bracket <][tag inner][tag&bracket />]",
12 | "[tag&bracket ][tag top][tag&bracket >]");
13 |
14 | MT("nonmatching",
15 | "[tag&bracket <][tag top][tag&bracket >]",
16 | " [tag&bracket <][tag inner][tag&bracket />]",
17 | " [tag&bracket ][tag&error tip][tag&bracket&error >]");
18 |
19 | MT("doctype",
20 | "[meta ]",
21 | "[tag&bracket <][tag top][tag&bracket />]");
22 |
23 | MT("cdata",
24 | "[tag&bracket <][tag top][tag&bracket >]",
25 | " [atom ]",
27 | "[tag&bracket ][tag top][tag&bracket >]");
28 |
29 | // HTML tests
30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html");
31 |
32 | MT("selfclose",
33 | "[tag&bracket <][tag html][tag&bracket >]",
34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]",
35 | "[tag&bracket ][tag html][tag&bracket >]");
36 |
37 | MT("list",
38 | "[tag&bracket <][tag ol][tag&bracket >]",
39 | " [tag&bracket <][tag li][tag&bracket >]one",
40 | " [tag&bracket <][tag li][tag&bracket >]two",
41 | "[tag&bracket ][tag ol][tag&bracket >]");
42 |
43 | MT("valueless",
44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]");
45 |
46 | MT("pThenArticle",
47 | "[tag&bracket <][tag p][tag&bracket >]",
48 | " foo",
49 | "[tag&bracket <][tag article][tag&bracket >]bar");
50 |
51 | })();
52 |
--------------------------------------------------------------------------------
/html2webscript/libs/codemirror/placeholder.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-undef */
2 | // CodeMirror, copyright (c) by Marijn Haverbeke and others
3 | // Distributed under an MIT license: https://codemirror.net/LICENSE
4 |
5 | (function (mod) {
6 | if (typeof exports == "object" && typeof module == "object") // CommonJS
7 | mod(require("../../lib/codemirror"));
8 | else if (typeof define == "function" && define.amd) // AMD
9 | define(["../../lib/codemirror"], mod);
10 | else // Plain browser env
11 | mod(CodeMirror);
12 | })(function (CodeMirror) {
13 | CodeMirror.defineOption("placeholder", "", function (cm, val, old) {
14 | var prev = old && old != CodeMirror.Init;
15 | if (val && !prev) {
16 | cm.on("blur", onBlur);
17 | cm.on("change", onChange);
18 | cm.on("swapDoc", onChange);
19 | onChange(cm);
20 | } else if (!val && prev) {
21 | cm.off("blur", onBlur);
22 | cm.off("change", onChange);
23 | cm.off("swapDoc", onChange);
24 | clearPlaceholder(cm);
25 | var wrapper = cm.getWrapperElement();
26 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
27 | }
28 |
29 | if (val && !cm.hasFocus()) onBlur(cm);
30 | });
31 |
32 | function clearPlaceholder(cm) {
33 | if (cm.state.placeholder) {
34 | cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
35 | cm.state.placeholder = null;
36 | }
37 | }
38 | function setPlaceholder(cm) {
39 | clearPlaceholder(cm);
40 | var elt = cm.state.placeholder = document.createElement("pre");
41 | elt.style.cssText = "height: 0; overflow: visible";
42 | elt.style.direction = cm.getOption("direction");
43 | elt.className = "CodeMirror-placeholder CodeMirror-line-like";
44 | var placeHolder = cm.getOption("placeholder")
45 | if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
46 | elt.appendChild(placeHolder)
47 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
48 | }
49 |
50 | function onBlur(cm) {
51 | if (isEmpty(cm)) setPlaceholder(cm);
52 | }
53 | function onChange(cm) {
54 | var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
55 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
56 |
57 | if (empty) setPlaceholder(cm);
58 | else clearPlaceholder(cm);
59 | }
60 |
61 | function isEmpty(cm) {
62 | return (cm.lineCount() === 1) && (cm.getLine(0) === "");
63 | }
64 | });
--------------------------------------------------------------------------------
/html2webscript/libs/prism.css:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.20.0
2 | https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+clike+javascript */
3 | /**
4 | * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
5 | * Based on https://github.com/chriskempson/tomorrow-theme
6 | * @author Rose Pritchard
7 | */
8 |
9 | code[class*="language-"],
10 | pre[class*="language-"] {
11 | color: #ccc;
12 | background: none;
13 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
14 | font-size: 1em;
15 | text-align: left;
16 | white-space: pre;
17 | word-spacing: normal;
18 | word-break: normal;
19 | word-wrap: normal;
20 | line-height: 1.5;
21 |
22 | -moz-tab-size: 4;
23 | -o-tab-size: 4;
24 | tab-size: 4;
25 |
26 | -webkit-hyphens: none;
27 | -moz-hyphens: none;
28 | -ms-hyphens: none;
29 | hyphens: none;
30 |
31 | }
32 |
33 | /* Code blocks */
34 | pre[class*="language-"] {
35 | overflow: auto;
36 | }
37 |
38 | :not(pre) > code[class*="language-"],
39 | pre[class*="language-"] {
40 | background: #2d2d2d;
41 | }
42 |
43 | /* Inline code */
44 | :not(pre) > code[class*="language-"] {
45 | padding: .1em;
46 | border-radius: .3em;
47 | white-space: normal;
48 | }
49 |
50 | .token.comment,
51 | .token.block-comment,
52 | .token.prolog,
53 | .token.doctype,
54 | .token.cdata {
55 | color: #999;
56 | }
57 |
58 | .token.punctuation {
59 | color: #ccc;
60 | }
61 |
62 | .token.tag,
63 | .token.attr-name,
64 | .token.namespace,
65 | .token.deleted {
66 | color: #e2777a;
67 | }
68 |
69 | .token.function-name {
70 | color: #6196cc;
71 | }
72 |
73 | .token.boolean,
74 | .token.number,
75 | .token.function {
76 | color: #f08d49;
77 | }
78 |
79 | .token.property,
80 | .token.class-name,
81 | .token.constant,
82 | .token.symbol {
83 | color: #f8c555;
84 | }
85 |
86 | .token.selector,
87 | .token.important,
88 | .token.atrule,
89 | .token.keyword,
90 | .token.builtin {
91 | color: #cc99cd;
92 | }
93 |
94 | .token.string,
95 | .token.char,
96 | .token.attr-value,
97 | .token.regex,
98 | .token.variable {
99 | color: #7ec699;
100 | }
101 |
102 | .token.operator,
103 | .token.entity,
104 | .token.url {
105 | color: #67cdcc;
106 | }
107 |
108 | .token.important,
109 | .token.bold {
110 | font-weight: bold;
111 | }
112 | .token.italic {
113 | font-style: italic;
114 | }
115 |
116 | .token.entity {
117 | cursor: help;
118 | }
119 |
120 | .token.inserted {
121 | color: green;
122 | }
123 |
124 |
--------------------------------------------------------------------------------
/html2webscript/libs/prism.js:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.20.0
2 | https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+clike+javascript */
3 | var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,C={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof _?new _(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/n.length)return;if(!(b instanceof _)){var x=1;if(d&&y!=t.tail.prev){g.lastIndex=k;var w=g.exec(n);if(!w)break;var A=w.index+(h&&w[1]?w[1].length:0),P=w.index+w[0].length,S=k;for(S+=y.value.length;S<=A;)y=y.next,S+=y.value.length;if(S-=y.value.length,k=S,y.value instanceof _)continue;for(var O=y;O!==t.tail&&(S"+a.content+""+a.tag+">"},!u.document)return u.addEventListener&&(C.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,r=n.code,a=n.immediateClose;u.postMessage(C.highlight(r,C.languages[t],t)),a&&u.close()},!1)),C;var e=C.util.currentScript();function t(){C.manual||C.highlightAll()}if(e&&(C.filename=e.src,e.hasAttribute("data-manual")&&(C.manual=!0)),!C.manual){var r=document.readyState;"loading"===r||"interactive"===r&&e&&e.defer?document.addEventListener("DOMContentLoaded",t):window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,16)}return C}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
4 | Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var n={"included-cdata":{pattern://i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var t={};t[a]={pattern:RegExp("(<__[^]*?>)(?:))*\\]\\]>|(?!)".replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",t)}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml;
5 | Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};
6 | Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript;
7 |
--------------------------------------------------------------------------------
/html2webscript/libs/terser/version.txt:
--------------------------------------------------------------------------------
1 | @4.7.0/dist/bundle.min.js
--------------------------------------------------------------------------------
/html2webscript/libs/viv.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 |
3 | function isObject(arg) {
4 | return Object.prototype.toString.call(arg) == "[object Object]";
5 | }
6 |
7 | // @ts-ignore
8 | // @ts-ignore
9 | // eslint-disable-next-line no-unused-vars
10 | function exists(o, prop) {
11 | return prop in o || typeof o[prop] != "undefined";
12 | }
13 |
14 |
15 | // cache function info
16 | const vivUpdateCache = new WeakMap();
17 | // implment handling null values;
18 | function addUpdateFunction(element, func) {
19 | return function update(...args) {
20 | let result = func.apply(element, args);
21 | if (Array.isArray(result)) {
22 | const childrenCache = vivUpdateCache.get(update) || new Map();
23 | const newChildrenCache = new Map();
24 | const children = Array.from(element.children);
25 | const root = document.createDocumentFragment();
26 | for (const [index, child] of result.entries()) {
27 | let childCache = null;
28 | // @ts-ignore
29 | if (child instanceof Element && child.viv.key) {
30 | // @ts-ignore
31 | newChildrenCache.set(child.viv.key, {
32 | tagName: child.tagName,
33 | position: index
34 | });
35 | // @ts-ignore
36 | childCache = childrenCache.get(child.viv.key);
37 | }
38 | if (childCache && childCache.tagName === child.tagName) {
39 | root.append(children[childCache.position]);
40 | }
41 | else {
42 | if (child instanceof Element) {
43 | root.append(child);
44 | }
45 | else if (typeof child == "string") {
46 | root.append(document.createTextNode(child));
47 | }
48 | else {
49 | root.append(document.createTextNode(String(child)));
50 | }
51 | }
52 | }
53 | while (element.firstElementChild) {
54 | element.removeChild(element.firstElementChild);
55 | }
56 | element.append(root);
57 | vivUpdateCache.set(update, newChildrenCache);
58 | }
59 | else {
60 | if (typeof result === "string") {
61 | result = document.createTextNode(result);
62 | }
63 | const cachedNode = vivUpdateCache.get(update);
64 | vivUpdateCache.set(update, result);
65 | if (!cachedNode) {
66 | element.append(result);
67 | }
68 | else {
69 | element.replaceChild(result, cachedNode);
70 | }
71 | }
72 | }
73 | }
74 |
75 |
76 | /**
77 | * @param {Element & {viv?: any}} element
78 | * @param {{ [x: string]: any; }} props
79 | */
80 | function assignProperties(element, props) {
81 | for (let key in props) {
82 | let value = props[key];
83 | if (key === "key") {
84 | element.viv.key = value;
85 | }
86 | else if (typeof value === "string") {
87 | if (key === "className") {
88 | key = "class"
89 | }
90 | element.setAttribute(key, value)
91 | }
92 | else {
93 | element[key] = value;
94 | }
95 | }
96 | }
97 |
98 |
99 |
100 | function addChild(element, child) {
101 | if (Array.isArray(child)) {
102 | for (const grandChild of child) {
103 | addChild(element, grandChild);
104 | }
105 | }
106 | else if (child instanceof Element) {
107 | element.append(child);
108 | }
109 | else if (isObject(child)) {
110 | assignProperties(element, child)
111 | }
112 | else if (typeof child == "function") {
113 | const update = addUpdateFunction(element, child)
114 | update();
115 | if (child.name) {
116 | element.viv.childFunctions[child.name] = update
117 | }
118 | else {
119 | const length = Object.keys(element.viv.childFunctions)
120 | .filter((value) => typeof value === "number").length;
121 | element.viv.childFunctions[length] = update
122 | }
123 | }
124 | else if (typeof child == "string") {
125 | element.append(document.createTextNode(child));
126 | }
127 | else if (child === null) {
128 | return;
129 | }
130 | else {
131 | element.append(document.createTextNode(String(child)));
132 | }
133 | }
134 |
135 |
136 |
137 | /**
138 | * @param {string} tagName
139 | * @param {any[]} args
140 | */
141 | export function createElement(tagName, ...args) {
142 |
143 | tagName = tagName.toLowerCase();
144 | /**
145 | * @type {Element & {viv?: any}}
146 | */
147 | const element = ["svg", "path", "title"].includes(tagName) ?
148 | document.createElementNS("http://www.w3.org/2000/svg", tagName) :
149 | document.createElement(tagName);
150 |
151 | const vivObject = Object.create(null);
152 |
153 | element.viv = vivObject;
154 | vivObject.childFunctions = {};
155 | for (const arg of args) {
156 | addChild(element, arg)
157 | }
158 | return element;
159 | }
160 |
161 | /*
162 | For attribute replace hyphins with camel case. my-option becomes myOption.
163 | Make HTML, HEAD and BODY functions automatically replace the existing ones in the document (brilliant!)
164 | Special style tag.
165 |
166 | img("something").src("something").alt("mytext")
167 |
168 | img`something`.src('interestinglinkurl').alt`how do you know?`("my text");
169 |
170 | img.src`interestinglinkurl`.alt`how do you know?`("my text");
171 |
172 | something
173 |
174 | */
175 |
176 |
177 |
178 |
179 | /*
180 |
181 | li(a.href`grey-text text-lighten-3`("#!", "Link 1")),
182 | li(a.href`grey-text text-lighten-3`("#!", "Link 2")),
183 | li(a.href`grey-text text-lighten-3`("#!", "Link 3")),
184 | li(a.href`grey-text text-lighten-3`("#!", "Link 4")))))),
185 |
186 | li(a`grey-text text-lighten-3`.href`#!`("Link 1")),
187 | li(a`grey-text text-lighten-3`.href`#!`("Link 2")),
188 | li(a`grey-text text-lighten-3`.href`#!`("Link 3")),
189 | li(a`grey-text text-lighten-3`.href`#!`("Link 4"))))))
190 |
191 | li(a`grey-text text-lighten-3`({href:"#1"}, "Link 1")),
192 | li(a`grey-text text-lighten-3`({href:"#1"}, "Link 2")),
193 | li(a`grey-text text-lighten-3`({href:"#1"}, "Link 3")),
194 | li(a`grey-text text-lighten-3`({href:"#1"}, "Link 4"))))))
195 |
196 |
Link 1
197 | Link 2
198 | Link 3
199 | Link 4
200 |
201 |
202 | Link 1
203 | Link 2
204 | Link 3
205 | Link 4
206 |
207 |
208 | li(a`grey-text text-lighten-3`.href`#!`("Link 1")),
209 | li(a`grey-text text-lighten-3`.href`#!`("Link 2")),
210 | li(a`grey-text text-lighten-3`.href`#!`("Link 3")),
211 | li(a`grey-text text-lighten-3`.href`#!`("Link 4"))))))
212 | */
213 |
214 | // img`something`.src('interestinglinkurl').alt`how do you know?`("my text");
215 |
--------------------------------------------------------------------------------
/html2webscript/test.js:
--------------------------------------------------------------------------------
1 | import { elementConstructors } from '../../src/viv.js';
2 | const { div, h1, nav, img, a, button, svg, path, main, p } = elementConstructors;
3 |
4 | div("h-screen flex overflow-hidden bg-gray-100",
5 | /* Off-canvas menu for mobile */
6 | div("md:hidden",
7 | div("fixed inset-0 flex z-40",
8 | /*
9 | Off-canvas menu overlay, show/hide based on off-canvas menu state.
10 |
11 | Entering: "transition-opacity ease-linear duration-300"
12 | From: "opacity-0"
13 | To: "opacity-100"
14 | Leaving: "transition-opacity ease-linear duration-300"
15 | From: "opacity-100"
16 | To: "opacity-0"
17 | */
18 | div("fixed inset-0",
19 | div("absolute inset-0 bg-gray-600 opacity-75")),
20 | /*
21 | Off-canvas menu, show/hide based on off-canvas menu state.
22 |
23 | Entering: "transition ease-in-out duration-300 transform"
24 | From: "-translate-x-full"
25 | To: "translate-x-0"
26 | Leaving: "transition ease-in-out duration-300 transform"
27 | From: "translate-x-0"
28 | To: "-translate-x-full"
29 | */
30 | div("relative flex-1 flex flex-col max-w-xs w-full bg-gray-800",
31 | div("absolute top-0 right-0 -mr-14 p-1",
32 | button("flex items-center justify-center h-12 w-12 rounded-full focus:outline-none focus:bg-gray-600",
33 | {"aria-label":'Close sidebar'},
34 | svg("h-6 w-6 text-white",
35 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
36 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M6 18L18 6M6 6l12 12'})))),
37 | div("flex-1 h-0 pt-5 pb-4 overflow-y-auto",
38 | div("flex-shrink-0 flex items-center px-4",
39 | img("h-8 w-auto",
40 | {"src":'/img/logos/workflow-logo-on-dark.svg', "alt":'Workflow'})),
41 | nav("mt-5 px-2",
42 | a("group flex items-center px-2 py-2 text-base leading-6 font-medium rounded-md text-white bg-gray-900 focus:outline-none focus:bg-gray-700 transition ease-in-out duration-150",
43 | {"href":'#'},
44 | svg("mr-4 h-6 w-6 text-gray-300 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
45 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
46 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M3 12l9-9 9 9M5 10v10a1 1 0 001 1h3a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1h3a1 1 0 001-1V10M9 21h6'})),
47 | ' Dashboard '),
48 | a("mt-1 group flex items-center px-2 py-2 text-base leading-6 font-medium rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
49 | {"href":'#'},
50 | svg("mr-4 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
51 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
52 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z'})),
53 | ' Team '),
54 | a("mt-1 group flex items-center px-2 py-2 text-base leading-6 font-medium rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
55 | {"href":'#'},
56 | svg("mr-4 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
57 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
58 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z'})),
59 | ' Projects '),
60 | a("mt-1 group flex items-center px-2 py-2 text-base leading-6 font-medium rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
61 | {"href":'#'},
62 | svg("mr-4 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
63 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
64 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'})),
65 | ' Calendar '),
66 | a("mt-1 group flex items-center px-2 py-2 text-base leading-6 font-medium rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
67 | {"href":'#'},
68 | svg("mr-4 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
69 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
70 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4'})),
71 | ' Documents '),
72 | a("mt-1 group flex items-center px-2 py-2 text-base leading-6 font-medium rounded-md text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
73 | {"href":'#'},
74 | svg("mr-4 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
75 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
76 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z'})),
77 | ' Reports '))),
78 | div("flex-shrink-0 flex bg-gray-700 p-4",
79 | a("flex-shrink-0 group block",
80 | {"href":'#'},
81 | div("flex items-center",
82 | div(
83 | img("inline-block h-10 w-10 rounded-full",
84 | {"src":'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', "alt":''})),
85 | div("ml-3",
86 | p("text-base leading-6 font-medium text-white",
87 | ' Tom Cook '),
88 | p("text-sm leading-5 font-medium text-gray-400 group-hover:text-gray-300 transition ease-in-out duration-150",
89 | ' View profile ')))))),
90 | div("flex-shrink-0 w-14"))),
91 | /* Static sidebar for desktop */
92 | div("hidden md:flex md:flex-shrink-0",
93 | div("flex flex-col w-64 bg-gray-800",
94 | div("h-0 flex-1 flex flex-col pt-5 pb-4 overflow-y-auto",
95 | div("flex items-center flex-shrink-0 px-4",
96 | img("h-8 w-auto",
97 | {"src":'/img/logos/workflow-logo-on-dark.svg', "alt":'Workflow'})),
98 | /* Sidebar component, swap this element with another sidebar if you like */
99 | nav("mt-5 flex-1 px-2 bg-gray-800",
100 | a("group flex items-center px-2 py-2 text-sm leading-5 font-medium text-white rounded-md bg-gray-900 focus:outline-none focus:bg-gray-700 transition ease-in-out duration-150",
101 | {"href":'#'},
102 | svg("mr-3 h-6 w-6 text-gray-300 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
103 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
104 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M3 12l9-9 9 9M5 10v10a1 1 0 001 1h3a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1h3a1 1 0 001-1V10M9 21h6'})),
105 | ' Dashboard '),
106 | a("mt-1 group flex items-center px-2 py-2 text-sm leading-5 font-medium text-gray-300 rounded-md hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
107 | {"href":'#'},
108 | svg("mr-3 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
109 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
110 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z'})),
111 | ' Team '),
112 | a("mt-1 group flex items-center px-2 py-2 text-sm leading-5 font-medium text-gray-300 rounded-md hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
113 | {"href":'#'},
114 | svg("mr-3 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
115 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
116 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z'})),
117 | ' Projects '),
118 | a("mt-1 group flex items-center px-2 py-2 text-sm leading-5 font-medium text-gray-300 rounded-md hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
119 | {"href":'#'},
120 | svg("mr-3 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
121 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
122 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'})),
123 | ' Calendar '),
124 | a("mt-1 group flex items-center px-2 py-2 text-sm leading-5 font-medium text-gray-300 rounded-md hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
125 | {"href":'#'},
126 | svg("mr-3 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
127 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
128 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4'})),
129 | ' Documents '),
130 | a("mt-1 group flex items-center px-2 py-2 text-sm leading-5 font-medium text-gray-300 rounded-md hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700 transition ease-in-out duration-150",
131 | {"href":'#'},
132 | svg("mr-3 h-6 w-6 text-gray-400 group-hover:text-gray-300 group-focus:text-gray-300 transition ease-in-out duration-150",
133 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
134 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z'})),
135 | ' Reports '))),
136 | div("flex-shrink-0 flex bg-gray-700 p-4",
137 | a("flex-shrink-0 w-full group block",
138 | {"href":'#'},
139 | div("flex items-center",
140 | div(
141 | img("inline-block h-9 w-9 rounded-full",
142 | {"src":'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', "alt":''})),
143 | div("ml-3",
144 | p("text-sm leading-5 font-medium text-white",
145 | ' Tom Cook '),
146 | p("text-xs leading-4 font-medium text-gray-300 group-hover:text-gray-200 transition ease-in-out duration-150",
147 | ' View profile '))))))),
148 | div("flex flex-col w-0 flex-1 overflow-hidden",
149 | div("md:hidden pl-1 pt-1 sm:pl-3 sm:pt-3",
150 | button("-ml-0.5 -mt-0.5 h-12 w-12 inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 focus:outline-none focus:bg-gray-200 transition ease-in-out duration-150",
151 | {"aria-label":'Open sidebar'},
152 | svg("h-6 w-6",
153 | {"stroke":'currentColor', "fill":'none', "viewBox":'0 0 24 24'},
154 | path({"stroke-linecap":'round', "stroke-linejoin":'round', "stroke-width":'2', "d":'M4 6h16M4 12h16M4 18h16'})))),
155 | main("flex-1 relative z-0 overflow-y-auto pt-2 pb-6 focus:outline-none md:py-6",
156 | {"tabindex":'0'},
157 | div("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",
158 | h1("text-2xl font-semibold text-gray-900",
159 | 'Dashboard')),
160 | div("max-w-7xl mx-auto px-4 sm:px-6 md:px-8",
161 | /* Replace with your content */
162 | div("py-4",
163 | div("border-4 border-dashed border-gray-200 rounded-lg h-96")),
164 | /* /End replace */))))
165 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webscript",
3 | "version": "0.2.1",
4 | "description": "HTML replacement. Better Javascript syntax for creating web applications.",
5 | "type": "module",
6 | "main": "dist/webscript.js",
7 | "directories": {
8 | "test": "test"
9 | },
10 | "scripts": {
11 | "build": "microbundle src/*.js"
12 | },
13 | "devDependencies": {
14 | "microbundle": "^0.12.0"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/mudgen/webscript.git"
19 | },
20 | "keywords": [
21 | "javascript",
22 | "webdev",
23 | "html",
24 | "dom"
25 | ],
26 | "author": "Nick Mudge ",
27 | "license": "MIT",
28 | "bugs": {
29 | "url": "https://github.com/mudgen/webscript/issues"
30 | },
31 | "homepage": "https://github.com/mudgen/webscript#readme"
32 | }
33 |
--------------------------------------------------------------------------------
/src/createDOMElement.js:
--------------------------------------------------------------------------------
1 | import addChild from './helpers/addChild.js';
2 |
3 | function createElement(tagName, props, ...children) {
4 | tagName = tagName.toLowerCase();
5 | const element = document.createElement(tagName);
6 | for (let key in props) {
7 | let value = props[key];
8 | if (typeof value === "string") {
9 | element.setAttribute(key, value)
10 | }
11 | else {
12 | element[key] = value;
13 | }
14 | }
15 | for (const child of children) {
16 | addChild(element, child);
17 | }
18 | return element;
19 | }
20 |
21 | export default createElement;
--------------------------------------------------------------------------------
/src/createObjectElement.js:
--------------------------------------------------------------------------------
1 | const addChild = (element, child) => {
2 | if (
3 | child === null ||
4 | typeof child === "undefined" ||
5 | element === null ||
6 | typeof element.append !== "function"
7 | ) {
8 | return;
9 | }
10 |
11 | if (Array.isArray(child)) {
12 | for (const childChild of child) {
13 | addChild(element, childChild);
14 | }
15 | return;
16 | }
17 |
18 | let value = child;
19 | if (
20 | !(
21 | typeof child === "string" ||
22 | typeof child === "boolean" ||
23 | typeof child === "object" ||
24 | typeof child === "number" ||
25 | typeof child === "bigint"
26 | )
27 | ) {
28 | value = JSON.stringify(child);
29 | }
30 |
31 | element.append(value);
32 | };
33 |
34 | const createElement = (tagName, props, ...children) => {
35 | tagName = tagName.toLowerCase();
36 |
37 | const element = { tagName };
38 | element.children = [];
39 | element.value = "";
40 | element.__isElement = true;
41 | element.append = (child) => {
42 | if (
43 | typeof child === "string" ||
44 | typeof child === "boolean" ||
45 | typeof child === "number" ||
46 | typeof child === "bigint" ||
47 | (typeof child === "object" && !child.__isElement)
48 | ) {
49 | element.value = child;
50 | return;
51 | }
52 |
53 | element.children.push(child);
54 | };
55 |
56 | for (const key in props) {
57 | const value = props[key];
58 | element[key] = value;
59 | }
60 |
61 | for (const child of children) {
62 | addChild(element, child);
63 | }
64 |
65 | return element;
66 | };
67 |
68 | export default createElement;
69 |
--------------------------------------------------------------------------------
/src/createSVGElement.js:
--------------------------------------------------------------------------------
1 | import addChild from './helpers/addChild.js';
2 |
3 | function createElement(tagName, props, ...children) {
4 | const element = document.createElementNS("http://www.w3.org/2000/svg", tagName);
5 | for (let key in props) {
6 | let value = props[key];
7 | if (typeof value === "string") {
8 | if (key.startsWith("xlink:")) {
9 | element.createAttributeNS("http://www.w3.org/1999/xlink", key, value)
10 | }
11 | else {
12 | element.setAttribute(key, value)
13 | }
14 | }
15 | else {
16 | element[key] = value;
17 | }
18 | }
19 | for (const child of children) {
20 | addChild(element, child);
21 | }
22 | return element;
23 | }
24 |
25 | export default createElement;
--------------------------------------------------------------------------------
/src/helpers/addChild.js:
--------------------------------------------------------------------------------
1 | function addChild(element, child) {
2 | if (
3 | typeof child === "number" ||
4 | typeof child === "bigint" ||
5 | child instanceof Date ||
6 | child instanceof RegExp
7 | ) {
8 | element.append(String(child));
9 | }
10 | else if (Array.isArray(child)) {
11 | for (const childChild of child) {
12 | addChild(element, childChild);
13 | }
14 | }
15 | else if (
16 | typeof child !== "undefined" &&
17 | child !== null &&
18 | typeof child !== "boolean"
19 | ) {
20 | element.append(child);
21 | }
22 | }
23 |
24 | export default addChild;
25 |
--------------------------------------------------------------------------------
/src/webscript.js:
--------------------------------------------------------------------------------
1 | function templateValues(args) {
2 | const [strings, ...templateArgs] = args;
3 | const result = [];
4 | for (const [index, s] of strings.entries()) {
5 | if (s !== "") {
6 | result.push(s);
7 | }
8 | let arg = templateArgs[index];
9 | if (typeof arg !== "undefined") {
10 | result.push(arg);
11 | }
12 | }
13 | return result;
14 | }
15 |
16 | let interpunct = new RegExp("·", "g");
17 |
18 | export const enhanceBuilder = (builder, func) => {
19 | builder.__webscript_enhancer = func;
20 | return builder;
21 | }
22 |
23 | function createInitialBuilder(constructor, type) {
24 | function createBuilder(props, prop) {
25 | let builder = new Proxy(() => { }, {
26 | apply(target, thisArg, children) {
27 | if (typeof target.__webscript_enhancer === "function") {
28 | let __webscript_enhancer = target.__webscript_enhancer;
29 | delete target.__webscript_enhancer;
30 | let result = __webscript_enhancer(builder, children);
31 | target.__webscript_enhancer = __webscript_enhancer;
32 | return result;
33 | }
34 | let [first] = children;
35 | if (Array.isArray(first) && Object.isFrozen(first)) {
36 | children = templateValues(children);
37 | }
38 | if (Array.isArray(props.children)) {
39 | props.children.push(...children)
40 | children = props.children;
41 | delete props.children;
42 | }
43 | for (let i = 0; i < children.length; i++) {
44 | let arg = children[i];
45 | if (typeof arg === "function" && arg.__is_webscript_element === true) {
46 | children[i] = arg();
47 | }
48 | }
49 | return constructor(type, props, ...children);
50 | },
51 | get(target, elementName) {
52 | if (typeof elementName === "string") {
53 | if (elementName === "__is_webscript_element") {
54 | return true;
55 | }
56 | else if (elementName === "__webscript_enhancer") {
57 | return target[elementName]
58 | }
59 | else if (elementName.indexOf("·") !== -1) {
60 | elementName = elementName.replace(interpunct, "-");
61 | }
62 |
63 | function setPropertyValue(...args) {
64 | let [value] = args;
65 | if (typeof value === "undefined") {
66 | if (prop === "props" && Object.prototype.toString.call(value) === '[object Object]') {
67 | return createBuilder({}, null);
68 | }
69 | let newProps = { ...props };
70 | delete newProps[prop];
71 | return createBuilder(newProps, null);
72 | }
73 | else if (Array.isArray(value) && Object.isFrozen(value)) {
74 | value = templateValues(args).join("");
75 | }
76 | else if (args.length > 1) {
77 | value = args;
78 | }
79 | else if (prop === "props" && Object.prototype.toString.call(value) === '[object Object]') {
80 | return createBuilder({ ...props, ...value }, null);
81 | }
82 | const newProps = { ...props, [prop]: value };
83 | return createBuilder(newProps, null);
84 | }
85 | if (elementName === "props") {
86 | setPropertyValue.value = props;
87 | }
88 | else {
89 | setPropertyValue.value = props[elementName];
90 | }
91 | prop = elementName;
92 | return setPropertyValue;
93 | }
94 | }
95 | })
96 | return builder;
97 | }
98 | return createBuilder({}, null);
99 | }
100 |
101 |
102 | function builders(constructor, types = []) {
103 | if (typeof constructor !== "function") {
104 | throw Error("elementConstructor argument must be present and it must be a function.");
105 | }
106 | if (types.length > 0) {
107 | let builders = [];
108 | for (const type of types) {
109 | builders.push(createInitialBuilder(constructor, type));
110 | }
111 | return builders;
112 | }
113 | else {
114 | return new Proxy(() => { }, {
115 | get(target, prop) {
116 | const result = target[prop];
117 | if (typeof result !== "undefined") {
118 | return result;
119 | }
120 | target[prop] = createInitialBuilder(constructor, prop);
121 | return target[prop];
122 | }
123 | });
124 | }
125 | }
126 |
127 | export default builders;
128 |
129 |
--------------------------------------------------------------------------------
/test/app.js:
--------------------------------------------------------------------------------
1 | import elementBuilders from "../src/webscript.js";
2 | import createElement from "../src/createDOMElement.js";
3 | import createObject from "../src/createObjectElement.js";
4 |
5 | (() => {
6 | const { body, div, p, span, img } = elementBuilders(createElement);
7 |
8 | let classes;
9 |
10 | const app = body.class`flex items-center justify-center h-screen`(
11 | div.class`max-w-sm rounded overflow-hidden shadow-lg`.hasImages`${true}`(
12 | img.class`w-full`.src`img/card-top.jpg`.alt`Sunset in the mountains`,
13 | div.class`px-6 py-4`(
14 | div.class`font-bold text-xl mb-2`("The Coldest Sunset"),
15 | p.class`text-gray-700 text-base`(
16 | " Lorem ipsum dolor sit amet, consectetur adipisicing ..."
17 | )
18 | ),
19 | div.class`px-6 py-4 text-sm font-semibold text-gray-700`(
20 | span.class`${(classes =
21 | "inline-block bg-gray-200 rounded-full px-3 py-1")} mr-2`(
22 | "#photography"
23 | ),
24 | span.class`${classes} mr-2`("#travel"),
25 | span.class`${classes}`("#winter")
26 | )
27 | )
28 | );
29 |
30 | document.body = app;
31 | })();
32 |
33 | (() => {
34 | const { body, div, p, span, img } = elementBuilders(createObject);
35 |
36 | let classes;
37 |
38 | const app = body.class`flex items-center justify-center h-screen`(
39 | div.class`max-w-sm rounded overflow-hidden shadow-lg`.hasImages(true)(
40 | img.class`w-full`.src`img/card-top.jpg`.alt`Sunset in the mountains`,
41 | div.class`px-6 py-4`(
42 | div.class`font-bold text-xl mb-2`("The Coldest Sunset"),
43 | p.class`text-gray-700 text-base`(
44 | " Lorem ipsum dolor sit amet, consectetur adipisicing ..."
45 | )
46 | ),
47 | div.class`px-6 py-4 text-sm font-semibold text-gray-700`(
48 | span.class`${(classes =
49 | "inline-block bg-gray-200 rounded-full px-3 py-1")} mr-2`(
50 | "#photography"
51 | ),
52 | span.class`${classes} mr-2`("#travel"),
53 | span.class`${classes}`("#winter")
54 | )
55 | )
56 | );
57 |
58 | console.log(app);
59 | })();
60 |
--------------------------------------------------------------------------------
/test/img/card-top.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mudgen/webscript/d2e31d20cf333176e5bbcfadfd2d3178b8fd866b/test/img/card-top.jpg
--------------------------------------------------------------------------------
/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Testing Webscript
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------