@kamen/create-webapp 1.0.45 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,6 +42,34 @@ const data = Array
42
42
  console.dir(data);
43
43
  ```
44
44
 
45
+ ### Dynamic import from CDN
46
+
47
+ ```js
48
+ const {
49
+ createRandomFromList
50
+ } = await import('https://esm.run/@kamen/create-webapp');
51
+
52
+ function createAlphabet() {
53
+ const baseChar = 'a';
54
+ const lowerCode = baseChar.charCodeAt();
55
+ const upperCode = baseChar.toUpperCase().charCodeAt();
56
+ const length = 'z'.charCodeAt() - lowerCode + 1;
57
+ return Array
58
+ .from({length}, (_, index) => [
59
+ String.fromCharCode(lowerCode + index),
60
+ String.fromCharCode(upperCode + index)
61
+ ])
62
+ .flat();
63
+ }
64
+
65
+ const identHandler = createRandomFromList(createAlphabet());
66
+ const identFormatHandler = () => Array
67
+ .from({length: 1 << 5}, identHandler)
68
+ .join('');
69
+
70
+ console.log(identFormatHandler());
71
+ ```
72
+
45
73
  ### Advanced example
46
74
 
47
75
  [SVG Path Generative Art](https://codepen.io/L1feF0rm/pen/GRzGxdb)
package/css/reset.css CHANGED
@@ -35,6 +35,5 @@ picture,
35
35
  svg,
36
36
  video {
37
37
  display: block;
38
- vertical-align: middle;
39
38
  max-width: 100%;
40
39
  }
package/index.js CHANGED
@@ -265,6 +265,26 @@ export function findVue(version = 2, root = document, hook = '__VUE_DEVTOOLS_GLO
265
265
  return 'Vue mountpoint not found';
266
266
  }
267
267
 
268
+ export class DOMUtils {
269
+ static namespaces = class {
270
+ static HTML = 'http://www.w3.org/1999/xhtml';
271
+ static MathML = 'http://www.w3.org/1998/Math/MathML';
272
+ static SVG = 'http://www.w3.org/2000/svg';
273
+ };
274
+
275
+ static createHTMLElement(tag = '') {
276
+ return document.createElementNS(this.namespaces.HTML, tag);
277
+ }
278
+
279
+ static createMathMLElement(tag = '') {
280
+ return document.createElementNS(this.namespaces.MathML, tag);
281
+ }
282
+
283
+ static createSVGElement(tag = '') {
284
+ return document.createElementNS(this.namespaces.SVG, tag);
285
+ }
286
+ }
287
+
268
288
  /**
269
289
  * URL wrapper implementing builder pattern
270
290
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kamen/create-webapp",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "npm init @kamen/webapp",
5
5
  "keywords": [
6
6
  "init",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "author": {
22
22
  "name": "Kamen Balabanov",
23
- "email": "kbalabanov@gmail.com"
23
+ "email": "k.balabanov@gmail.com"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",