@schukai/monster 1.13.0 → 1.15.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG +46 -1
- package/README.md +5 -5
- package/dist/modules/constants.js +2 -2
- package/dist/modules/constraints/abstract.js +2 -2
- package/dist/modules/constraints/abstractoperator.js +2 -2
- package/dist/modules/constraints/andoperator.js +2 -2
- package/dist/modules/constraints/invalid.js +2 -2
- package/dist/modules/constraints/isarray.js +2 -2
- package/dist/modules/constraints/isobject.js +2 -2
- package/dist/modules/constraints/namespace.js +1 -1
- package/dist/modules/constraints/oroperator.js +2 -2
- package/dist/modules/constraints/valid.js +2 -2
- package/dist/modules/data/buildmap.js +2 -2
- package/dist/modules/data/diff.js +2 -2
- package/dist/modules/data/extend.js +2 -2
- package/dist/modules/data/namespace.js +1 -1
- package/dist/modules/data/pathfinder.js +2 -2
- package/dist/modules/data/pipe.js +2 -2
- package/dist/modules/data/transformer.js +2 -2
- package/dist/modules/dom/assembler.js +2 -2
- package/dist/modules/dom/attributes.js +2 -2
- package/dist/modules/dom/constants.js +2 -2
- package/dist/modules/dom/customcontrol.js +2 -0
- package/dist/modules/dom/customelement.js +2 -2
- package/dist/modules/dom/events.js +2 -2
- package/dist/modules/dom/locale.js +2 -2
- package/dist/modules/dom/namespace.js +1 -1
- package/dist/modules/dom/template.js +2 -2
- package/dist/modules/dom/theme.js +2 -2
- package/dist/modules/dom/updater.js +2 -2
- package/dist/modules/dom/util.js +2 -2
- package/dist/modules/i18n/locale.js +2 -2
- package/dist/modules/i18n/namespace.js +1 -1
- package/dist/modules/i18n/provider.js +2 -2
- package/dist/modules/i18n/providers/fetch.js +2 -2
- package/dist/modules/i18n/providers/namespace.js +1 -1
- package/dist/modules/i18n/translations.js +2 -2
- package/dist/modules/logging/handler/console.js +2 -2
- package/dist/modules/logging/handler/namespace.js +1 -1
- package/dist/modules/logging/handler.js +2 -2
- package/dist/modules/logging/logentry.js +2 -2
- package/dist/modules/logging/logger.js +2 -2
- package/dist/modules/logging/namespace.js +1 -1
- package/dist/modules/math/namespace.js +1 -1
- package/dist/modules/math/random.js +2 -2
- package/dist/modules/monster.js +2 -2
- package/dist/modules/namespace.js +2 -2
- package/dist/modules/text/formatter.js +2 -2
- package/dist/modules/text/namespace.js +1 -1
- package/dist/modules/types/base.js +2 -2
- package/dist/modules/types/basewithoptions.js +2 -2
- package/dist/modules/types/global.js +2 -2
- package/dist/modules/types/id.js +2 -2
- package/dist/modules/types/is.js +2 -2
- package/dist/modules/types/namespace.js +1 -1
- package/dist/modules/types/observer.js +2 -2
- package/dist/modules/types/observerlist.js +2 -2
- package/dist/modules/types/proxyobserver.js +2 -2
- package/dist/modules/types/queue.js +2 -2
- package/dist/modules/types/randomid.js +2 -2
- package/dist/modules/types/stack.js +2 -2
- package/dist/modules/types/tokenlist.js +2 -2
- package/dist/modules/types/typeof.js +2 -2
- package/dist/modules/types/uniquequeue.js +2 -2
- package/dist/modules/types/validate.js +2 -2
- package/dist/modules/types/version.js +2 -2
- package/dist/modules/util/clone.js +2 -2
- package/dist/modules/util/comparator.js +2 -2
- package/dist/modules/util/freeze.js +2 -2
- package/dist/modules/util/namespace.js +1 -1
- package/dist/monster.dev.js +8622 -7709
- package/dist/monster.dev.js.map +1 -1
- package/dist/monster.js +2 -9
- package/package.json +1 -1
- package/source/constants.js +7 -6
- package/source/constraints/abstract.js +2 -2
- package/source/constraints/abstractoperator.js +4 -4
- package/source/constraints/andoperator.js +8 -8
- package/source/constraints/invalid.js +6 -6
- package/source/constraints/isarray.js +7 -7
- package/source/constraints/isobject.js +7 -7
- package/source/constraints/namespace.js +2 -2
- package/source/constraints/oroperator.js +8 -8
- package/source/constraints/valid.js +7 -7
- package/source/data/buildmap.js +15 -15
- package/source/data/diff.js +9 -9
- package/source/data/extend.js +55 -13
- package/source/data/namespace.js +2 -2
- package/source/data/pathfinder.js +13 -14
- package/source/data/pipe.js +8 -8
- package/source/data/transformer.js +11 -11
- package/source/dom/assembler.js +7 -7
- package/source/dom/attributes.js +89 -46
- package/source/dom/constants.js +9 -2
- package/source/dom/customcontrol.js +299 -0
- package/source/dom/customelement.js +181 -66
- package/source/dom/events.js +58 -8
- package/source/dom/locale.js +5 -5
- package/source/dom/namespace.js +2 -2
- package/source/dom/template.js +24 -19
- package/source/dom/theme.js +8 -9
- package/source/dom/updater.js +46 -24
- package/source/dom/util.js +10 -10
- package/source/i18n/locale.js +7 -7
- package/source/i18n/namespace.js +1 -1
- package/source/i18n/provider.js +6 -6
- package/source/i18n/providers/fetch.js +10 -10
- package/source/i18n/translations.js +5 -5
- package/source/logging/handler/console.js +5 -5
- package/source/logging/handler/namespace.js +1 -1
- package/source/logging/handler.js +8 -8
- package/source/logging/logentry.js +5 -5
- package/source/logging/logger.js +5 -5
- package/source/logging/namespace.js +2 -2
- package/source/math/namespace.js +2 -2
- package/source/math/random.js +5 -5
- package/source/monster.js +48 -44
- package/source/namespace.js +2 -2
- package/source/text/formatter.js +6 -7
- package/source/text/namespace.js +1 -1
- package/source/types/base.js +4 -5
- package/source/types/basewithoptions.js +10 -9
- package/source/types/global.js +7 -7
- package/source/types/id.js +7 -7
- package/source/types/is.js +22 -22
- package/source/types/namespace.js +2 -2
- package/source/types/observer.js +7 -7
- package/source/types/observerlist.js +4 -4
- package/source/types/proxyobserver.js +32 -26
- package/source/types/queue.js +13 -7
- package/source/types/randomid.js +6 -6
- package/source/types/stack.js +11 -4
- package/source/types/tokenlist.js +9 -9
- package/source/types/typeof.js +5 -5
- package/source/types/uniquequeue.js +14 -7
- package/source/types/validate.js +27 -27
- package/source/types/version.js +9 -9
- package/source/util/clone.js +6 -6
- package/source/util/comparator.js +7 -7
- package/source/util/freeze.js +7 -7
- package/source/util/namespace.js +2 -2
- package/test/cases/data/extend.js +66 -13
- package/test/cases/dom/attributes.js +56 -1
- package/test/cases/dom/customcontrol.js +264 -0
- package/test/cases/dom/customelement.js +112 -51
- package/test/cases/dom/events.js +32 -14
- package/test/cases/dom/template.js +40 -1
- package/test/cases/monster.js +1 -1
- package/test/cases/types/proxyobserver.js +9 -0
- package/test/util/jsdom.js +3 -0
- package/test/web/import.js +1 -0
- package/test/web/monster-dev.html +3 -3
- package/test/web/monster.html +2 -2
- package/test/web/test.html +3 -3
- package/test/web/tests.js +3 -3
@@ -1,24 +1,24 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
import {PROPERTY_KEY_INTERNALDATA} from "../../constants.js";
|
4
|
+
import {extend} from "../../data/extend.js";
|
3
5
|
/**
|
4
6
|
* @author schukai GmbH
|
5
7
|
*/
|
6
|
-
|
8
|
+
import {assignToNamespace, Monster} from '../../namespace.js';
|
7
9
|
import {Formatter} from "../../text/formatter.js";
|
8
|
-
import {Monster} from "../../types/base.js";
|
9
10
|
import {getGlobalFunction} from "../../types/global.js";
|
10
|
-
import {
|
11
|
-
import {
|
11
|
+
import {isInstance, isString} from "../../types/is.js";
|
12
|
+
import {validateObject, validateString} from "../../types/validate.js";
|
12
13
|
import {parseLocale} from "../locale.js";
|
13
14
|
import {Provider} from "../provider.js";
|
14
|
-
import {PROPERTY_KEY_OPTIONS} from "../../constants.js";
|
15
15
|
import {Translations} from "../translations.js";
|
16
16
|
|
17
17
|
/**
|
18
18
|
* @private
|
19
19
|
* @type {symbol}
|
20
20
|
*/
|
21
|
-
const optionsSymbol = Symbol.for(
|
21
|
+
const optionsSymbol = Symbol.for(PROPERTY_KEY_INTERNALDATA);
|
22
22
|
|
23
23
|
/**
|
24
24
|
* The fetch provider retrieves a JSON file from the given URL and returns a translation object.
|
@@ -27,7 +27,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
|
|
27
27
|
*
|
28
28
|
* ```
|
29
29
|
* <script type="module">
|
30
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
30
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/i18n/providers/fetch.js';
|
31
31
|
* console.log(new Monster.I18n.Providers.Fetch())
|
32
32
|
* </script>
|
33
33
|
* ```
|
@@ -36,7 +36,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
|
|
36
36
|
*
|
37
37
|
* ```
|
38
38
|
* <script type="module">
|
39
|
-
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
39
|
+
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/i18n/providers/fetch.js';
|
40
40
|
* console.log(new Fetch())
|
41
41
|
* </script>
|
42
42
|
* ```
|
@@ -69,7 +69,7 @@ class Fetch extends Provider {
|
|
69
69
|
validateString(url);
|
70
70
|
|
71
71
|
this.url = url;
|
72
|
-
this[optionsSymbol] =
|
72
|
+
this[optionsSymbol] = extend({}, super.defaults, this.defaults, validateObject(options));
|
73
73
|
|
74
74
|
}
|
75
75
|
|
@@ -117,5 +117,5 @@ class Fetch extends Provider {
|
|
117
117
|
}
|
118
118
|
|
119
119
|
|
120
|
-
|
120
|
+
assignToNamespace('Monster.I18n.Providers', Fetch);
|
121
121
|
export {Monster, Fetch}
|
@@ -3,8 +3,8 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
|
7
|
-
import {
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
|
+
import {Base} from "../types/base.js";
|
8
8
|
import {isObject, isString} from "../types/is.js";
|
9
9
|
import {validateInstance, validateInteger, validateObject, validateString} from "../types/validate.js";
|
10
10
|
import {Locale, parseLocale} from "./locale.js";
|
@@ -17,7 +17,7 @@ import {Locale, parseLocale} from "./locale.js";
|
|
17
17
|
*
|
18
18
|
* ```
|
19
19
|
* <script type="module">
|
20
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
20
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/i18n/translations.js';
|
21
21
|
* console.log(new Monster.I18n.Translations())
|
22
22
|
* </script>
|
23
23
|
* ```
|
@@ -26,7 +26,7 @@ import {Locale, parseLocale} from "./locale.js";
|
|
26
26
|
*
|
27
27
|
* ```
|
28
28
|
* <script type="module">
|
29
|
-
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
29
|
+
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/i18n/translations.js';
|
30
30
|
* console.log(new Translations())
|
31
31
|
* </script>
|
32
32
|
* ```
|
@@ -205,5 +205,5 @@ class Translations extends Base {
|
|
205
205
|
}
|
206
206
|
|
207
207
|
|
208
|
-
|
208
|
+
assignToNamespace('Monster.I18n', Translations);
|
209
209
|
export {Monster, Translations}
|
@@ -4,16 +4,16 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {Monster} from '../../namespace.js';
|
8
|
-
import {Base} from '../../types/base.js';
|
9
7
|
import {Handler} from '../../logging/handler.js';
|
8
|
+
import {Base} from '../../types/base.js';
|
9
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
10
10
|
|
11
11
|
/**
|
12
12
|
* you can call the method via the monster namespace `new Monster.Logging.Handler.ConsoleHandler()`.
|
13
13
|
*
|
14
14
|
* ```
|
15
15
|
* <script type="module">
|
16
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
16
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/handler/console.js';
|
17
17
|
* console.log(new Monster.Logging.Handler.ConsoleHandler())
|
18
18
|
* </script>
|
19
19
|
* ```
|
@@ -22,7 +22,7 @@ import {Handler} from '../../logging/handler.js';
|
|
22
22
|
*
|
23
23
|
* ```
|
24
24
|
* <script type="module">
|
25
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
25
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/handler/console.js';
|
26
26
|
* console.log(new ConsoleHandler())
|
27
27
|
* </script>
|
28
28
|
* ```
|
@@ -38,5 +38,5 @@ class ConsoleHandler extends Base {
|
|
38
38
|
}
|
39
39
|
|
40
40
|
|
41
|
-
|
41
|
+
assignToNamespace('Monster.Logging', ConsoleHandler);
|
42
42
|
export {Monster, Handler};
|
@@ -4,18 +4,18 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {Monster} from '../namespace.js';
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
8
|
import {Base} from '../types/base.js';
|
9
|
-
import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js";
|
10
|
-
import {LogEntry} from "./logentry.js";
|
11
9
|
import {validateInstance, validateInteger} from "../types/validate.js";
|
10
|
+
import {LogEntry} from "./logentry.js";
|
11
|
+
import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js";
|
12
12
|
|
13
13
|
/**
|
14
14
|
* you can call the method via the monster namespace `new Monster.Logging.Handler()`.
|
15
15
|
*
|
16
16
|
* ```
|
17
17
|
* <script type="module">
|
18
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
18
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/handler.js';
|
19
19
|
* console.log(new Monster.Logging.Handler())
|
20
20
|
* </script>
|
21
21
|
* ```
|
@@ -24,7 +24,7 @@ import {validateInstance, validateInteger} from "../types/validate.js";
|
|
24
24
|
*
|
25
25
|
* ```
|
26
26
|
* <script type="module">
|
27
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
27
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/handler.js';
|
28
28
|
* console.log(new Handler())
|
29
29
|
* </script>
|
30
30
|
* ```
|
@@ -39,8 +39,8 @@ class Handler extends Base {
|
|
39
39
|
|
40
40
|
/**
|
41
41
|
* Loglevel
|
42
|
-
*
|
43
|
-
* @type {integer}
|
42
|
+
*
|
43
|
+
* @type {integer}
|
44
44
|
*/
|
45
45
|
this.loglevel = OFF;
|
46
46
|
}
|
@@ -180,5 +180,5 @@ class Handler extends Base {
|
|
180
180
|
}
|
181
181
|
|
182
182
|
|
183
|
-
|
183
|
+
assignToNamespace('Monster.Logging', Handler);
|
184
184
|
export {Monster, Handler};
|
@@ -4,9 +4,9 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {Monster} from '../namespace.js';
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
|
+
import {Base} from '../types/base.js';
|
8
9
|
import {validateInteger} from '../types/validate.js';
|
9
|
-
import {Base} from '../types/base.js';
|
10
10
|
|
11
11
|
|
12
12
|
/**
|
@@ -14,7 +14,7 @@ import {Base} from '../types/base.js';
|
|
14
14
|
*
|
15
15
|
* ```
|
16
16
|
* <script type="module">
|
17
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
17
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/logentry.js';
|
18
18
|
* console.log(new Monster.Logging.LogEntry())
|
19
19
|
* </script>
|
20
20
|
* ```
|
@@ -23,7 +23,7 @@ import {Base} from '../types/base.js';
|
|
23
23
|
*
|
24
24
|
* ```
|
25
25
|
* <script type="module">
|
26
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
26
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/logentry.js';
|
27
27
|
* console.log(new LogEntry())
|
28
28
|
* </script>
|
29
29
|
* ```
|
@@ -64,5 +64,5 @@ class LogEntry extends Base {
|
|
64
64
|
|
65
65
|
}
|
66
66
|
|
67
|
-
|
67
|
+
assignToNamespace('Monster.Logging', LogEntry);
|
68
68
|
export {Monster, LogEntry}
|
package/source/logging/logger.js
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {Monster} from '../namespace.js';
|
8
|
-
import {validateInteger, validateObject, validateString} from '../types/validate.js';
|
9
7
|
import {Handler} from '../logging/handler.js';
|
10
8
|
import {LogEntry} from '../logging/logentry.js';
|
9
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
11
10
|
import {Base} from '../types/base.js';
|
11
|
+
import {validateInteger, validateObject, validateString} from '../types/validate.js';
|
12
12
|
|
13
13
|
|
14
14
|
/**
|
@@ -65,7 +65,7 @@ const OFF = 0;
|
|
65
65
|
*
|
66
66
|
* ```
|
67
67
|
* <script type="module">
|
68
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
68
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/logger.js';
|
69
69
|
* console.log(new Monster.Logging.Logger())
|
70
70
|
* </script>
|
71
71
|
* ```
|
@@ -74,7 +74,7 @@ const OFF = 0;
|
|
74
74
|
*
|
75
75
|
* ```
|
76
76
|
* <script type="module">
|
77
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
77
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/logging/logger.js';
|
78
78
|
* console.log(new Logger())
|
79
79
|
* </script>
|
80
80
|
* ```
|
@@ -256,7 +256,7 @@ class Logger extends Base {
|
|
256
256
|
|
257
257
|
}
|
258
258
|
|
259
|
-
|
259
|
+
assignToNamespace('Monster.Logging', Logger);
|
260
260
|
export {Monster, Logger, ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF};
|
261
261
|
|
262
262
|
|
package/source/math/namespace.js
CHANGED
package/source/math/random.js
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
|
8
|
-
import {
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
|
+
import {getGlobal} from '../types/global.js';
|
9
9
|
|
10
10
|
|
11
11
|
/**
|
@@ -15,7 +15,7 @@ import {Monster, getGlobal} from '../types/global.js';
|
|
15
15
|
*
|
16
16
|
* ```
|
17
17
|
* <script type="module">
|
18
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
18
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/math/random.js';
|
19
19
|
* console.log(Monster.Math.random(1,10)) // ↦ 5
|
20
20
|
* </script>
|
21
21
|
* ```
|
@@ -24,7 +24,7 @@ import {Monster, getGlobal} from '../types/global.js';
|
|
24
24
|
*
|
25
25
|
* ```
|
26
26
|
* <script type="module">
|
27
|
-
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
27
|
+
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/math/random.js';
|
28
28
|
* console.log(random(1,10)) // ↦ 5
|
29
29
|
* </script>
|
30
30
|
* ```
|
@@ -120,7 +120,7 @@ function create(min, max) {
|
|
120
120
|
|
121
121
|
}
|
122
122
|
|
123
|
-
|
123
|
+
assignToNamespace('Monster.Math', random);
|
124
124
|
export {Monster, random}
|
125
125
|
|
126
126
|
|
package/source/monster.js
CHANGED
@@ -7,61 +7,65 @@
|
|
7
7
|
|
8
8
|
'use strict';
|
9
9
|
|
10
|
-
import
|
10
|
+
import './constants.js';
|
11
|
+
import './constraints/abstract.js';
|
12
|
+
import './constraints/abstractoperator.js';
|
13
|
+
import './constraints/andoperator.js';
|
14
|
+
import './constraints/invalid.js';
|
15
|
+
import './constraints/isarray.js';
|
11
16
|
|
17
|
+
// find packages/monster/source/ -type f -name "*.js" -not -name "*namespace*" -not -iname "monster.js"
|
18
|
+
import './constraints/isobject.js';
|
19
|
+
import './constraints/oroperator.js';
|
20
|
+
import './constraints/valid.js';
|
21
|
+
import './data/buildmap.js';
|
22
|
+
import './data/diff.js';
|
23
|
+
import './data/extend.js';
|
24
|
+
import './data/pathfinder.js';
|
25
|
+
import './data/pipe.js';
|
26
|
+
import './data/transformer.js';
|
27
|
+
import './dom/assembler.js';
|
28
|
+
import './dom/attributes.js';
|
29
|
+
import './dom/constants.js';
|
30
|
+
import './dom/customcontrol.js';
|
31
|
+
import './dom/customelement.js';
|
32
|
+
import './dom/events.js';
|
33
|
+
import './dom/locale.js';
|
34
|
+
import './dom/template.js';
|
35
|
+
import './dom/theme.js';
|
36
|
+
import './dom/updater.js';
|
37
|
+
import './dom/util.js';
|
38
|
+
import './i18n/locale.js';
|
39
|
+
import './i18n/provider.js';
|
40
|
+
import './i18n/providers/fetch.js';
|
41
|
+
import './i18n/translations.js';
|
42
|
+
import './logging/handler.js';
|
43
|
+
import './logging/handler/console.js';
|
44
|
+
import './logging/logentry.js';
|
45
|
+
import './logging/logger.js';
|
46
|
+
import './math/random.js';
|
47
|
+
import {Monster} from './namespace.js';
|
48
|
+
import './text/formatter.js';
|
12
49
|
import './types/base.js';
|
13
|
-
import './types/
|
14
|
-
import './types/observer.js';
|
50
|
+
import './types/basewithoptions.js';
|
15
51
|
import './types/global.js';
|
16
|
-
import './types/
|
52
|
+
import './types/id.js';
|
17
53
|
import './types/is.js';
|
54
|
+
import './types/observer.js';
|
55
|
+
import './types/observerlist.js';
|
18
56
|
import './types/proxyobserver.js';
|
19
|
-
import './types/
|
57
|
+
import './types/queue.js';
|
58
|
+
import './types/randomid.js';
|
59
|
+
import './types/stack.js';
|
20
60
|
import './types/tokenlist.js';
|
21
61
|
import './types/typeof.js';
|
22
|
-
import './types/
|
23
|
-
import './types/id.js';
|
24
|
-
import './types/randomid.js';
|
62
|
+
import './types/uniquequeue.js';
|
25
63
|
import './types/validate.js';
|
26
|
-
import './types/
|
27
|
-
import './constraints/isobject.js';
|
28
|
-
import './constraints/valid.js';
|
29
|
-
import './constraints/invalid.js';
|
30
|
-
import './constraints/abstractoperator.js';
|
31
|
-
import './constraints/oroperator.js';
|
32
|
-
import './constraints/andoperator.js';
|
33
|
-
import './constraints/abstract.js';
|
34
|
-
import './constraints/isarray.js';
|
35
|
-
import './logging/logger.js';
|
36
|
-
import './logging/handler.js';
|
37
|
-
import './logging/logentry.js';
|
38
|
-
import './logging/handler/console.js';
|
39
|
-
import './dom/updater.js';
|
40
|
-
import './dom/attributes.js';
|
41
|
-
import './dom/template.js';
|
42
|
-
import './dom/util.js';
|
43
|
-
import './dom/constants.js';
|
44
|
-
import './dom/assembler.js';
|
45
|
-
import './dom/theme.js';
|
46
|
-
import './dom/events.js';
|
47
|
-
import './dom/customelement.js';
|
48
|
-
import './util/comparator.js';
|
64
|
+
import './types/version.js';
|
49
65
|
import './util/clone.js';
|
66
|
+
import './util/comparator.js';
|
50
67
|
import './util/freeze.js';
|
51
|
-
import './data/pathfinder.js';
|
52
|
-
import './data/pipe.js';
|
53
|
-
import './data/extend.js';
|
54
|
-
import './data/diff.js';
|
55
|
-
import './data/buildmap.js';
|
56
|
-
import './data/transformer.js';
|
57
|
-
import './math/random.js';
|
58
|
-
import './text/formatter.js';
|
59
|
-
import './i18n/locale.js';
|
60
|
-
import './i18n/provider.js';
|
61
|
-
import './i18n/translations.js';
|
62
|
-
import './i18n/providers/fetch.js';
|
63
68
|
|
64
|
-
Monster.Util.deepFreeze(Monster);
|
65
69
|
|
66
70
|
let rootName
|
67
71
|
try {
|
package/source/namespace.js
CHANGED
@@ -65,7 +65,7 @@ export const Monster = new Namespace("Monster");
|
|
65
65
|
*
|
66
66
|
* ```
|
67
67
|
* <script type="module">
|
68
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
68
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/namespace.js';
|
69
69
|
* function hello() {
|
70
70
|
* console.log('Hello World!');
|
71
71
|
* }
|
@@ -166,5 +166,5 @@ function namespaceFor(parts) {
|
|
166
166
|
}
|
167
167
|
|
168
168
|
|
169
|
-
assignToNamespace('Monster', assignToNamespace);
|
169
|
+
assignToNamespace('Monster', assignToNamespace, Namespace);
|
170
170
|
export {assignToNamespace}
|
package/source/text/formatter.js
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
import {Pipe} from "../data/pipe.js";
|
3
4
|
/**
|
4
5
|
* @author schukai GmbH
|
5
6
|
*/
|
6
|
-
|
7
|
-
import {Pipe} from "../data/pipe.js";
|
8
|
-
import {Monster} from '../namespace.js';
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
9
8
|
import {Base} from "../types/base.js";
|
10
9
|
import {validateObject, validateString} from "../types/validate.js";
|
11
10
|
|
@@ -19,7 +18,7 @@ import {validateObject, validateString} from "../types/validate.js";
|
|
19
18
|
*
|
20
19
|
* ```
|
21
20
|
* <script type="module">
|
22
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
21
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/text/formatter.js';
|
23
22
|
* console.log(new Monster.Text.Formatter())
|
24
23
|
* </script>
|
25
24
|
* ```
|
@@ -28,7 +27,7 @@ import {validateObject, validateString} from "../types/validate.js";
|
|
28
27
|
*
|
29
28
|
* ```
|
30
29
|
* <script type="module">
|
31
|
-
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
30
|
+
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/text/formatter.js';
|
32
31
|
* console.log(new Formatter())
|
33
32
|
* </script>
|
34
33
|
* ```
|
@@ -129,7 +128,7 @@ function tokenizer(text) {
|
|
129
128
|
text = text.substring(startIndex)
|
130
129
|
}
|
131
130
|
|
132
|
-
let endIndex = text.substring(self.openMarker.length).indexOf(self.closeMarker)+self.openMarker.length;
|
131
|
+
let endIndex = text.substring(self.openMarker.length).indexOf(self.closeMarker) + self.openMarker.length;
|
133
132
|
|
134
133
|
if (endIndex === -1) {
|
135
134
|
throw new Error("syntax error in formatter template")
|
@@ -147,5 +146,5 @@ function tokenizer(text) {
|
|
147
146
|
return formatted.join('');
|
148
147
|
}
|
149
148
|
|
150
|
-
|
149
|
+
assignToNamespace('Monster.Text', Formatter);
|
151
150
|
export {Monster, Formatter}
|
package/source/text/namespace.js
CHANGED
package/source/types/base.js
CHANGED
@@ -4,8 +4,7 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {Monster} from '../namespace.js';
|
8
|
-
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
9
8
|
|
10
9
|
/**
|
11
10
|
* This is the base class from which all monster classes are derived.
|
@@ -14,7 +13,7 @@ import {Monster} from '../namespace.js';
|
|
14
13
|
*
|
15
14
|
* ```
|
16
15
|
* <script type="module">
|
17
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
16
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/base.js';
|
18
17
|
* console.log(new Monster.Types.Base())
|
19
18
|
* </script>
|
20
19
|
* ```
|
@@ -23,7 +22,7 @@ import {Monster} from '../namespace.js';
|
|
23
22
|
*
|
24
23
|
* ```
|
25
24
|
* <script type="module">
|
26
|
-
* import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
25
|
+
* import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/base.js';
|
27
26
|
* console.log(new Base())
|
28
27
|
* </script>
|
29
28
|
* ```
|
@@ -47,5 +46,5 @@ class Base extends Object {
|
|
47
46
|
|
48
47
|
}
|
49
48
|
|
50
|
-
|
49
|
+
assignToNamespace('Monster.Types', Base);
|
51
50
|
export {Monster, Base}
|
@@ -1,19 +1,20 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
import {PROPERTY_KEY_INTERNALDATA} from "../constants.js";
|
4
|
+
import {extend} from "../data/extend.js";
|
5
|
+
import {Pathfinder} from "../data/pathfinder.js";
|
3
6
|
/**
|
4
7
|
* @author schukai GmbH
|
5
8
|
*/
|
6
|
-
|
7
|
-
import {Monster, Pathfinder} from "../data/pathfinder.js";
|
9
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
10
|
import {Base} from "./base.js";
|
9
11
|
import {validateObject} from "./validate.js";
|
10
|
-
import {PROPERTY_KEY_OPTIONS} from "../constants.js";
|
11
12
|
|
12
13
|
/**
|
13
14
|
* @private
|
14
15
|
* @type {symbol}
|
15
16
|
*/
|
16
|
-
const optionsSymbol = Symbol.for(
|
17
|
+
const optionsSymbol = Symbol.for(PROPERTY_KEY_INTERNALDATA);
|
17
18
|
|
18
19
|
/**
|
19
20
|
* This is the base class with options from which some monster classes are derived.
|
@@ -22,7 +23,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
|
|
22
23
|
*
|
23
24
|
* ```
|
24
25
|
* <script type="module">
|
25
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
26
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/basewithoptions.js';
|
26
27
|
* console.log(new Monster.Types.BaseWithOptions())
|
27
28
|
* </script>
|
28
29
|
* ```
|
@@ -31,7 +32,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
|
|
31
32
|
*
|
32
33
|
* ```
|
33
34
|
* <script type="module">
|
34
|
-
* import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
35
|
+
* import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/basewithoptions.js';
|
35
36
|
* console.log(new BaseWithOptions())
|
36
37
|
* </script>
|
37
38
|
* ```
|
@@ -55,13 +56,13 @@ class BaseWithOptions extends Base {
|
|
55
56
|
options = {};
|
56
57
|
}
|
57
58
|
|
58
|
-
this[optionsSymbol] =
|
59
|
+
this[optionsSymbol] = extend({}, this.defaults, validateObject(options));
|
59
60
|
|
60
61
|
}
|
61
62
|
|
62
63
|
/**
|
63
64
|
* can be overridden by child class values
|
64
|
-
*
|
65
|
+
*
|
65
66
|
* @return {object}
|
66
67
|
*/
|
67
68
|
get defaults() {
|
@@ -92,5 +93,5 @@ class BaseWithOptions extends Base {
|
|
92
93
|
|
93
94
|
}
|
94
95
|
|
95
|
-
|
96
|
+
assignToNamespace('Monster.Types', BaseWithOptions);
|
96
97
|
export {Monster, BaseWithOptions}
|