@schukai/monster 1.31.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG +11 -0
- package/README.md +55 -58
- package/example/constraints/andoperator.mjs +17 -0
- package/example/constraints/invalid.mjs +6 -0
- package/example/constraints/isarray.mjs +11 -0
- package/example/constraints/isobject.mjs +12 -0
- package/example/constraints/oroperator.mjs +15 -0
- package/example/constraints/valid.mjs +6 -0
- package/example/data/buildmap.mjs +67 -0
- package/example/data/datasource.mjs +7 -0
- package/example/data/diff.mjs +39 -0
- package/example/data/pathfinder-1.mjs +23 -0
- package/example/data/pathfinder-2.mjs +19 -0
- package/example/data/pipe.mjs +14 -0
- package/example/data/storage/restapi.mjs +11 -0
- package/example/data/transformer.mjs +9 -0
- package/example/dom/customelement.mjs +13 -0
- package/example/dom/theme.mjs +5 -0
- package/example/dom/updater.mjs +23 -0
- package/example/i18n/formatter.mjs +10 -0
- package/example/i18n/providers/fetch.mjs +5 -0
- package/example/i18n/translations.mjs +20 -0
- package/example/types/basewithoptions.mjs +10 -0
- package/example/types/is-1.mjs +5 -0
- package/example/types/is-10.mjs +6 -0
- package/example/types/is-2.mjs +4 -0
- package/example/types/is-3.mjs +4 -0
- package/example/types/is-4.mjs +5 -0
- package/example/types/is-5.mjs +4 -0
- package/example/types/is-6.mjs +4 -0
- package/example/types/is-7.mjs +4 -0
- package/example/types/is-8.mjs +4 -0
- package/example/types/is-9.mjs +6 -0
- package/example/types/noderecursiveiterator.mjs +32 -0
- package/example/types/observer.mjs +9 -0
- package/example/types/proxyobserver.mjs +25 -0
- package/example/types/queue.mjs +20 -0
- package/example/types/tokenlist-1.mjs +4 -0
- package/example/types/tokenlist-2.mjs +7 -0
- package/example/types/tokenlist-3.mjs +5 -0
- package/example/types/tokenlist-4.mjs +5 -0
- package/example/types/tokenlist-5.mjs +5 -0
- package/example/types/typeof.mjs +9 -0
- package/example/types/version-1.mjs +6 -0
- package/example/types/version-2.mjs +3 -0
- package/example/util/comparator.mjs +10 -0
- package/example/util/deadmansswitch.mjs +9 -0
- package/example/util/processing.mjs +17 -0
- package/package.json +6 -60
- package/source/{constants.js → constants.mjs} +7 -10
- package/source/constraints/{abstract.js → abstract.mjs} +8 -9
- package/source/constraints/{abstractoperator.js → abstractoperator.mjs} +11 -8
- package/source/constraints/andoperator.mjs +38 -0
- package/source/constraints/invalid.mjs +38 -0
- package/source/constraints/isarray.mjs +41 -0
- package/source/constraints/isobject.mjs +41 -0
- package/source/constraints/{namespace.js → namespace.mjs} +3 -8
- package/source/constraints/{oroperator.js → oroperator.mjs} +10 -42
- package/source/constraints/valid.mjs +38 -0
- package/source/data/{buildmap.js → buildmap.mjs} +18 -104
- package/source/data/{buildtree.js → buildtree.mjs} +11 -31
- package/source/data/datasource/{namespace.js → namespace.mjs} +1 -9
- package/source/data/datasource/restapi/namespace.mjs +8 -0
- package/source/data/datasource/restapi/{writeerror.js → writeerror.mjs} +8 -9
- package/source/data/datasource/{restapi.js → restapi.mjs} +15 -45
- package/source/data/datasource/storage/localstorage.mjs +45 -0
- package/source/data/datasource/storage/{namespace.js → namespace.mjs} +1 -9
- package/source/data/datasource/storage/sessionstorage.mjs +45 -0
- package/source/data/datasource/{storage.js → storage.mjs} +12 -35
- package/source/data/{datasource.js → datasource.mjs} +17 -45
- package/source/data/{diff.js → diff.mjs} +10 -69
- package/source/data/{extend.js → extend.mjs} +10 -28
- package/source/data/{namespace.js → namespace.mjs} +2 -8
- package/source/data/{pathfinder.js → pathfinder.mjs} +18 -77
- package/source/data/{pipe.js → pipe.mjs} +14 -46
- package/source/data/{transformer.js → transformer.mjs} +18 -43
- package/source/dom/{assembler.js → assembler.mjs} +12 -28
- package/source/dom/{attributes.js → attributes.mjs} +42 -253
- package/source/dom/{constants.js → constants.mjs} +110 -61
- package/source/dom/{customcontrol.js → customcontrol.mjs} +10 -17
- package/source/dom/{customelement.js → customelement.mjs} +28 -52
- package/source/dom/{events.js → events.mjs} +15 -64
- package/source/dom/{focusmanager.js → focusmanager.mjs} +13 -34
- package/source/dom/{locale.js → locale.mjs} +11 -26
- package/source/dom/{namespace.js → namespace.mjs} +1 -8
- package/source/dom/{ready.js → ready.mjs} +12 -30
- package/source/dom/resource/{data.js → data.mjs} +11 -31
- package/source/dom/resource/link/namespace.mjs +10 -0
- package/source/dom/resource/link/stylesheet.mjs +35 -0
- package/source/dom/resource/{link.js → link.mjs} +9 -29
- package/source/dom/resource/namespace.mjs +8 -0
- package/source/dom/resource/{script.js → script.mjs} +9 -29
- package/source/dom/{resource.js → resource.mjs} +19 -39
- package/source/dom/{resourcemanager.js → resourcemanager.mjs} +17 -35
- package/source/dom/{template.js → template.mjs} +18 -43
- package/source/dom/{theme.js → theme.mjs} +14 -36
- package/source/dom/{updater.js → updater.mjs} +34 -68
- package/source/dom/{util.js → util.mjs} +17 -66
- package/source/dom/worker/{factory.js → factory.mjs} +13 -34
- package/source/dom/worker/namespace.mjs +8 -0
- package/source/i18n/{formatter.js → formatter.mjs} +14 -45
- package/source/i18n/{locale.js → locale.mjs} +15 -30
- package/source/i18n/{namespace.js → namespace.mjs} +1 -9
- package/source/i18n/provider.mjs +40 -0
- package/source/i18n/providers/{fetch.js → fetch.mjs} +18 -43
- package/source/i18n/providers/namespace.mjs +8 -0
- package/source/i18n/{translations.js → translations.mjs} +12 -52
- package/source/logging/handler/console.mjs +50 -0
- package/source/logging/handler/namespace.mjs +6 -0
- package/source/logging/{handler.js → handler.mjs} +13 -30
- package/source/logging/logentry.mjs +51 -0
- package/source/logging/{logger.js → logger.mjs} +12 -28
- package/source/logging/{namespace.js → namespace.mjs} +1 -9
- package/source/math/{namespace.js → namespace.mjs} +1 -9
- package/source/math/{random.js → random.mjs} +8 -34
- package/source/monster.mjs +114 -0
- package/source/text/{formatter.js → formatter.mjs} +17 -33
- package/source/text/{namespace.js → namespace.mjs} +1 -9
- package/source/types/base.mjs +31 -0
- package/source/types/{basewithoptions.js → basewithoptions.mjs} +17 -46
- package/source/types/{binary.js → binary.mjs} +10 -42
- package/source/types/{dataurl.js → dataurl.mjs} +12 -46
- package/source/types/{global.js → global.mjs} +20 -12
- package/source/types/{id.js → id.mjs} +10 -27
- package/source/types/is.mjs +225 -0
- package/source/types/{mediatype.js → mediatype.mjs} +13 -29
- package/source/types/{namespace.js → namespace.mjs} +1 -8
- package/source/types/{node.js → node.mjs} +11 -28
- package/source/types/{nodelist.js → nodelist.mjs} +17 -32
- package/source/types/{noderecursiveiterator.js → noderecursiveiterator.mjs} +14 -65
- package/source/types/{observer.js → observer.mjs} +15 -42
- package/source/types/{observerlist.js → observerlist.mjs} +12 -29
- package/source/types/{proxyobserver.js → proxyobserver.mjs} +19 -62
- package/source/types/{queue.js → queue.mjs} +10 -47
- package/source/types/randomid.mjs +45 -0
- package/source/types/regex.mjs +27 -0
- package/source/types/{stack.js → stack.mjs} +8 -24
- package/source/types/{tokenlist.js → tokenlist.mjs} +20 -64
- package/source/types/typeof.mjs +37 -0
- package/source/types/{uniquequeue.js → uniquequeue.mjs} +11 -27
- package/source/types/{uuid.js → uuid.mjs} +15 -33
- package/source/types/{validate.js → validate.mjs} +38 -155
- package/source/types/{version.js → version.mjs} +19 -62
- package/source/util/{clone.js → clone.mjs} +10 -28
- package/source/util/{comparator.js → comparator.mjs} +13 -43
- package/source/util/{deadmansswitch.js → deadmansswitch.mjs} +15 -40
- package/source/util/freeze.mjs +39 -0
- package/source/util/{namespace.js → namespace.mjs} +1 -9
- package/source/util/{processing.js → processing.mjs} +13 -51
- package/source/util/{trimspaces.js → trimspaces.mjs} +14 -21
- package/test/cases/constraint/{andoperator.js → andoperator.mjs} +3 -3
- package/test/cases/constraint/{invalid.js → invalid.mjs} +1 -1
- package/test/cases/constraint/{isarray.js → isarray.mjs} +1 -1
- package/test/cases/constraint/{isobject.js → isobject.mjs} +1 -1
- package/test/cases/constraint/{oroperator.js → oroperator.mjs} +3 -3
- package/test/cases/constraint/{valid.js → valid.mjs} +1 -1
- package/test/cases/data/{buildmap.js → buildmap.mjs} +1 -1
- package/test/cases/data/{buildtree.js → buildtree.mjs} +2 -2
- package/test/cases/data/datasource/{restapi.js → restapi.mjs} +5 -5
- package/test/cases/data/datasource/storage/{localstorage.js → localstorage.mjs} +5 -5
- package/test/cases/data/datasource/storage/{sessionstorage.js → sessionstorage.mjs} +5 -5
- package/test/cases/data/{datasource.js → datasource.mjs} +1 -1
- package/test/cases/data/{diff.js → diff.mjs} +2 -2
- package/test/cases/data/{extend.js → extend.mjs} +1 -1
- package/test/cases/data/{pathfinder.js → pathfinder.mjs} +1 -1
- package/test/cases/data/{pipe.js → pipe.mjs} +19 -5
- package/test/cases/data/{transformer.js → transformer.mjs} +14 -10
- package/test/cases/dom/{assembler.js → assembler.mjs} +2 -2
- package/test/cases/dom/{attributes.js → attributes.mjs} +2 -2
- package/test/cases/dom/{customcontrol.js → customcontrol.mjs} +6 -6
- package/test/cases/dom/{customelement.js → customelement.mjs} +6 -6
- package/test/cases/dom/{events.js → events.mjs} +2 -2
- package/test/cases/dom/{focusmanager.js → focusmanager.mjs} +3 -3
- package/test/cases/dom/{locale.js → locale.mjs} +2 -2
- package/test/cases/dom/{ready.js → ready.mjs} +2 -2
- package/test/cases/dom/resource/{data.js → data.mjs} +9 -9
- package/test/cases/dom/resource/link/{stylesheet.js → stylesheet.mjs} +6 -6
- package/test/cases/dom/resource/{link.js → link.mjs} +6 -6
- package/test/cases/dom/resource/{script.js → script.mjs} +6 -6
- package/test/cases/dom/{resourcemanager.js → resourcemanager.mjs} +6 -6
- package/test/cases/dom/{template.js → template.mjs} +3 -3
- package/test/cases/dom/{theme.js → theme.mjs} +3 -3
- package/test/cases/dom/{updater.js → updater.mjs} +6 -6
- package/test/cases/dom/{util.js → util.mjs} +2 -2
- package/test/cases/dom/worker/{factory.js → factory.mjs} +4 -4
- package/test/cases/i18n/{formatter.js → formatter.mjs} +2 -2
- package/test/cases/i18n/{locale.js → locale.mjs} +1 -1
- package/test/cases/i18n/{provider.js → provider.mjs} +1 -1
- package/test/cases/i18n/providers/{fetch.js → fetch.mjs} +3 -3
- package/test/cases/i18n/{translations.js → translations.mjs} +2 -2
- package/test/cases/logging/handler/{console.js → console.mjs} +3 -3
- package/test/cases/logging/{handler.js → handler.mjs} +3 -3
- package/test/cases/logging/{logentry.js → logentry.mjs} +1 -1
- package/test/cases/logging/{logger.js → logger.mjs} +1 -1
- package/test/cases/math/random.mjs +101 -0
- package/test/cases/monster.mjs +20 -0
- package/test/cases/text/{formatter.js → formatter.mjs} +1 -1
- package/test/cases/types/{base.js → base.mjs} +1 -1
- package/test/cases/types/{basewithoptions.js → basewithoptions.mjs} +1 -1
- package/test/cases/types/{binary.js → binary.mjs} +1 -1
- package/test/cases/types/{dataurl.js → dataurl.mjs} +1 -1
- package/test/cases/types/{global.js → global.mjs} +1 -1
- package/test/cases/types/{id.js → id.mjs} +17 -6
- package/test/cases/types/{is.js → is.mjs} +20 -8
- package/test/cases/types/{mediatype.js → mediatype.mjs} +1 -1
- package/test/cases/types/{node.js → node.mjs} +3 -3
- package/test/cases/types/{nodelist.js → nodelist.mjs} +2 -2
- package/test/cases/types/{noderecursiveiterator.js → noderecursiveiterator.mjs} +3 -3
- package/test/cases/types/{observer.js → observer.mjs} +1 -1
- package/test/cases/types/{observerlist.js → observerlist.mjs} +2 -2
- package/test/cases/types/{proxyobserver.js → proxyobserver.mjs} +4 -4
- package/test/cases/types/{queue.js → queue.mjs} +1 -1
- package/test/cases/types/randomid.mjs +39 -0
- package/test/cases/types/regex.mjs +46 -0
- package/test/cases/types/{stack.js → stack.mjs} +1 -1
- package/test/cases/types/{tokenlist.js → tokenlist.mjs} +1 -1
- package/test/cases/types/{typeof.js → typeof.mjs} +3 -4
- package/test/cases/types/{uniquequeue.js → uniquequeue.mjs} +1 -1
- package/test/cases/types/{uuid.js → uuid.mjs} +30 -10
- package/test/cases/types/{validate.js → validate.mjs} +3 -4
- package/test/cases/types/{version.js → version.mjs} +1 -2
- package/test/cases/util/{clone.js → clone.mjs} +1 -1
- package/test/cases/util/{comparator.js → comparator.mjs} +1 -1
- package/test/cases/util/{deadmansswitch.js → deadmansswitch.mjs} +1 -1
- package/test/cases/util/{freeze.js → freeze.mjs} +1 -1
- package/test/cases/util/{processing.js → processing.mjs} +1 -1
- package/test/cases/util/{trimspaces.js → trimspaces.mjs} +1 -1
- package/test/util/{chai-dom.js → chai-dom.mjs} +0 -0
- package/test/util/{cleanupdom.js → cleanupdom.mjs} +0 -0
- package/test/util/{jsdom.js → jsdom.mjs} +2 -2
- package/test/util/{localstorage.js → localstorage.mjs} +0 -0
- package/test/web/import.js +77 -78
- package/test/web/prepare.js +0 -8
- package/test/web/test.html +5 -4
- package/test/web/tests.js +25731 -587
- package/dist/modules/constants.js +0 -2
- package/dist/modules/constraints/abstract.js +0 -2
- package/dist/modules/constraints/abstractoperator.js +0 -2
- package/dist/modules/constraints/andoperator.js +0 -2
- package/dist/modules/constraints/invalid.js +0 -2
- package/dist/modules/constraints/isarray.js +0 -2
- package/dist/modules/constraints/isobject.js +0 -2
- package/dist/modules/constraints/namespace.js +0 -2
- package/dist/modules/constraints/oroperator.js +0 -2
- package/dist/modules/constraints/valid.js +0 -2
- package/dist/modules/data/buildmap.js +0 -2
- package/dist/modules/data/buildtree.js +0 -2
- package/dist/modules/data/datasource/namespace.js +0 -2
- package/dist/modules/data/datasource/restapi/writeerror.js +0 -2
- package/dist/modules/data/datasource/restapi.js +0 -2
- package/dist/modules/data/datasource/storage/localstorage.js +0 -2
- package/dist/modules/data/datasource/storage/namespace.js +0 -2
- package/dist/modules/data/datasource/storage/sessionstorage.js +0 -2
- package/dist/modules/data/datasource/storage.js +0 -2
- package/dist/modules/data/datasource.js +0 -2
- package/dist/modules/data/diff.js +0 -2
- package/dist/modules/data/extend.js +0 -2
- package/dist/modules/data/namespace.js +0 -2
- package/dist/modules/data/pathfinder.js +0 -2
- package/dist/modules/data/pipe.js +0 -2
- package/dist/modules/data/transformer.js +0 -2
- package/dist/modules/dom/assembler.js +0 -2
- package/dist/modules/dom/attributes.js +0 -2
- package/dist/modules/dom/constants.js +0 -2
- package/dist/modules/dom/customcontrol.js +0 -2
- package/dist/modules/dom/customelement.js +0 -2
- package/dist/modules/dom/events.js +0 -2
- package/dist/modules/dom/focusmanager.js +0 -2
- package/dist/modules/dom/locale.js +0 -2
- package/dist/modules/dom/namespace.js +0 -2
- package/dist/modules/dom/ready.js +0 -2
- package/dist/modules/dom/resource/data.js +0 -2
- package/dist/modules/dom/resource/link/stylesheet.js +0 -2
- package/dist/modules/dom/resource/link.js +0 -2
- package/dist/modules/dom/resource/script.js +0 -2
- package/dist/modules/dom/resource.js +0 -2
- package/dist/modules/dom/resourcemanager.js +0 -2
- package/dist/modules/dom/template.js +0 -2
- package/dist/modules/dom/theme.js +0 -2
- package/dist/modules/dom/updater.js +0 -2
- package/dist/modules/dom/util.js +0 -2
- package/dist/modules/dom/worker/factory.js +0 -2
- package/dist/modules/i18n/formatter.js +0 -2
- package/dist/modules/i18n/locale.js +0 -2
- package/dist/modules/i18n/namespace.js +0 -2
- package/dist/modules/i18n/provider.js +0 -2
- package/dist/modules/i18n/providers/fetch.js +0 -2
- package/dist/modules/i18n/providers/namespace.js +0 -2
- package/dist/modules/i18n/translations.js +0 -2
- package/dist/modules/logging/handler/console.js +0 -2
- package/dist/modules/logging/handler/namespace.js +0 -2
- package/dist/modules/logging/handler.js +0 -2
- package/dist/modules/logging/logentry.js +0 -2
- package/dist/modules/logging/logger.js +0 -2
- package/dist/modules/logging/namespace.js +0 -2
- package/dist/modules/math/namespace.js +0 -2
- package/dist/modules/math/random.js +0 -2
- package/dist/modules/monster.js +0 -2
- package/dist/modules/namespace.js +0 -2
- package/dist/modules/text/formatter.js +0 -2
- package/dist/modules/text/namespace.js +0 -2
- package/dist/modules/types/base.js +0 -2
- package/dist/modules/types/basewithoptions.js +0 -2
- package/dist/modules/types/binary.js +0 -2
- package/dist/modules/types/dataurl.js +0 -2
- package/dist/modules/types/global.js +0 -2
- package/dist/modules/types/id.js +0 -2
- package/dist/modules/types/is.js +0 -2
- package/dist/modules/types/mediatype.js +0 -2
- package/dist/modules/types/namespace.js +0 -2
- package/dist/modules/types/node.js +0 -2
- package/dist/modules/types/nodelist.js +0 -2
- package/dist/modules/types/noderecursiveiterator.js +0 -2
- package/dist/modules/types/observer.js +0 -2
- package/dist/modules/types/observerlist.js +0 -2
- package/dist/modules/types/proxyobserver.js +0 -2
- package/dist/modules/types/queue.js +0 -2
- package/dist/modules/types/randomid.js +0 -2
- package/dist/modules/types/regex.js +0 -2
- package/dist/modules/types/stack.js +0 -2
- package/dist/modules/types/tokenlist.js +0 -2
- package/dist/modules/types/typeof.js +0 -2
- package/dist/modules/types/uniquequeue.js +0 -2
- package/dist/modules/types/uuid.js +0 -2
- package/dist/modules/types/validate.js +0 -2
- package/dist/modules/types/version.js +0 -2
- package/dist/modules/util/clone.js +0 -2
- package/dist/modules/util/comparator.js +0 -2
- package/dist/modules/util/deadmansswitch.js +0 -2
- package/dist/modules/util/freeze.js +0 -2
- package/dist/modules/util/namespace.js +0 -2
- package/dist/modules/util/processing.js +0 -2
- package/dist/modules/util/trimspaces.js +0 -2
- package/dist/monster.dev.js +0 -15490
- package/dist/monster.dev.js.map +0 -1
- package/dist/monster.js +0 -2
- package/source/constraints/andoperator.js +0 -71
- package/source/constraints/invalid.js +0 -63
- package/source/constraints/isarray.js +0 -71
- package/source/constraints/isobject.js +0 -72
- package/source/constraints/valid.js +0 -63
- package/source/data/datasource/storage/localstorage.js +0 -64
- package/source/data/datasource/storage/sessionstorage.js +0 -61
- package/source/dom/resource/link/stylesheet.js +0 -54
- package/source/i18n/provider.js +0 -58
- package/source/i18n/providers/namespace.js +0 -16
- package/source/logging/handler/console.js +0 -66
- package/source/logging/handler/namespace.js +0 -14
- package/source/logging/logentry.js +0 -68
- package/source/monster.js +0 -80
- package/source/namespace.js +0 -171
- package/source/types/base.js +0 -50
- package/source/types/is.js +0 -429
- package/source/types/package.d.ts +0 -1
- package/source/types/randomid.js +0 -60
- package/source/types/regex.js +0 -49
- package/source/types/typeof.js +0 -63
- package/source/util/freeze.js +0 -57
- package/test/cases/math/random.js +0 -82
- package/test/cases/monster.js +0 -23
- package/test/cases/namespace.js +0 -93
- package/test/cases/types/randomid.js +0 -24
- package/test/cases/types/regex.js +0 -32
- package/test/web/monster-dev.html +0 -22
- package/test/web/monster.html +0 -21
|
@@ -1,46 +1,32 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {extend} from "../data/extend.
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {Script} from "./resource/script.js";
|
|
8
|
+
import {extend} from "../data/extend.mjs";
|
|
9
|
+
import {BaseWithOptions} from "../types/basewithoptions.mjs";
|
|
10
|
+
import {getGlobalObject} from "../types/global.mjs";
|
|
11
|
+
import {isArray} from "../types/is.mjs";
|
|
12
|
+
import {ATTRIBUTE_HREF, ATTRIBUTE_SRC} from "./constants.mjs";
|
|
13
|
+
import {Resource} from "./resource.mjs";
|
|
14
|
+
import {Data} from "./resource/data.mjs";
|
|
15
|
+
import {Stylesheet} from "./resource/link/stylesheet.mjs";
|
|
16
|
+
import {Script} from "./resource/script.mjs";
|
|
17
17
|
|
|
18
|
+
export {ResourceManager}
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ```
|
|
23
|
-
* <script type="module">
|
|
24
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
25
|
-
* new Monster.DOM.ResourceManager()
|
|
26
|
-
* </script>
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* Alternatively, you can also integrate this function individually.
|
|
30
|
-
*
|
|
31
|
-
* ```
|
|
32
|
-
* <script type="module">
|
|
33
|
-
* import {Resource} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/resourcemanager.js';
|
|
34
|
-
* new ResourceManager()
|
|
35
|
-
* </script>
|
|
36
|
-
* ```
|
|
21
|
+
* The ResourceManager is a singleton that manages all resources.
|
|
37
22
|
*
|
|
23
|
+
* @license AGPLv3
|
|
38
24
|
* @since 1.25.0
|
|
39
25
|
* @copyright schukai GmbH
|
|
40
26
|
* @memberOf Monster.DOM
|
|
41
27
|
* @summary A Resource class
|
|
42
28
|
*/
|
|
43
|
-
class ResourceManager extends BaseWithOptions {
|
|
29
|
+
class ResourceManager extends BaseWithOptions {
|
|
44
30
|
|
|
45
31
|
/**
|
|
46
32
|
*
|
|
@@ -208,7 +194,3 @@ function addResource(type, url, options) {
|
|
|
208
194
|
(self.getOption('resources')?.[type]).push(resource);
|
|
209
195
|
return self;
|
|
210
196
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
assignToNamespace('Monster.DOM', ResourceManager);
|
|
214
|
-
export {Monster, ResourceManager}
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
import {Base} from '../types/base.
|
|
8
|
-
import {getGlobalFunction, getGlobalObject} from '../types/global.
|
|
9
|
-
import {validateInstance, validateString} from "../types/validate.
|
|
10
|
-
import {ATTRIBUTE_TEMPLATE_PREFIX} from "./constants.
|
|
11
|
-
import {getDocumentTheme} from "./theme.
|
|
7
|
+
|
|
8
|
+
import {Base} from '../types/base.mjs';
|
|
9
|
+
import {getGlobalFunction, getGlobalObject} from '../types/global.mjs';
|
|
10
|
+
import {validateInstance, validateString} from "../types/validate.mjs";
|
|
11
|
+
import {ATTRIBUTE_TEMPLATE_PREFIX} from "./constants.mjs";
|
|
12
|
+
import {getDocumentTheme} from "./theme.mjs";
|
|
13
|
+
|
|
14
|
+
export {Template}
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* ```
|
|
17
|
-
* <script type="module">
|
|
18
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
19
|
-
* new Monster.DOM.Template()
|
|
20
|
-
* </script>
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* Alternatively, you can also integrate this function individually.
|
|
24
|
-
*
|
|
25
|
-
* ```
|
|
26
|
-
* <script type="module">
|
|
27
|
-
* import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/template.js';
|
|
28
|
-
* new Template()
|
|
29
|
-
* </script>
|
|
30
|
-
* ```
|
|
17
|
+
* The template class provides methods for creating templates.
|
|
31
18
|
*
|
|
19
|
+
* @license AGPLv3
|
|
32
20
|
* @since 1.6.0
|
|
33
21
|
* @copyright schukai GmbH
|
|
34
22
|
* @memberOf Monster.DOM
|
|
@@ -86,23 +74,14 @@ class Template extends Base {
|
|
|
86
74
|
*
|
|
87
75
|
* ```
|
|
88
76
|
* <script type="module">
|
|
89
|
-
* import {
|
|
90
|
-
* Monster.DOM.findDocumentTemplate()
|
|
91
|
-
* </script>
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* Alternatively, you can also integrate this function individually.
|
|
95
|
-
*
|
|
96
|
-
* ```
|
|
97
|
-
* <script type="module">
|
|
98
|
-
* import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/template.js';
|
|
77
|
+
* import {findTemplate} from '@schukai/monster/source/dom/template.mjs';
|
|
99
78
|
* findDocumentTemplate()
|
|
100
79
|
* </script>
|
|
101
80
|
* ```
|
|
102
81
|
*
|
|
103
82
|
* @example
|
|
104
83
|
*
|
|
105
|
-
* import { findDocumentTemplate } from "https://cdn.jsdelivr.net/npm/@schukai/monster@
|
|
84
|
+
* import { findDocumentTemplate } from "https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/dom/template.mjs";
|
|
106
85
|
*
|
|
107
86
|
* const template = document.createElement("template");
|
|
108
87
|
* template.id = "myTemplate";
|
|
@@ -133,13 +112,14 @@ class Template extends Base {
|
|
|
133
112
|
* @param {string} id
|
|
134
113
|
* @param {Node} currentNode
|
|
135
114
|
* @return {Monster.DOM.Template}
|
|
115
|
+
* @license AGPLv3
|
|
136
116
|
* @since 1.7.0
|
|
137
117
|
* @copyright schukai GmbH
|
|
138
118
|
* @memberOf Monster.DOM
|
|
139
119
|
* @throws {Error} template id not found.
|
|
140
120
|
* @throws {TypeError} value is not a string
|
|
141
121
|
*/
|
|
142
|
-
function findDocumentTemplate(id, currentNode) {
|
|
122
|
+
export function findDocumentTemplate(id, currentNode) {
|
|
143
123
|
validateString(id);
|
|
144
124
|
|
|
145
125
|
const document = getGlobalObject('document');
|
|
@@ -219,8 +199,3 @@ function findDocumentTemplate(id, currentNode) {
|
|
|
219
199
|
throw new Error("template " + id + " not found.")
|
|
220
200
|
}
|
|
221
201
|
|
|
222
|
-
|
|
223
|
-
assignToNamespace('Monster.DOM', Template, findDocumentTemplate);
|
|
224
|
-
export {Monster, Template, findDocumentTemplate}
|
|
225
|
-
|
|
226
|
-
|
|
@@ -1,42 +1,22 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
|
-
import {assignToNamespace, Monster} from '../namespace.js';
|
|
7
|
-
import {Base} from '../types/base.js';
|
|
8
|
-
import {getGlobalObject} from '../types/global.js';
|
|
9
|
-
import {validateString} from "../types/validate.js";
|
|
10
|
-
import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.js";
|
|
11
7
|
|
|
8
|
+
import {Base} from '../types/base.mjs';
|
|
9
|
+
import {getGlobalObject} from '../types/global.mjs';
|
|
10
|
+
import {validateString} from "../types/validate.mjs";
|
|
11
|
+
import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.mjs";
|
|
12
|
+
|
|
13
|
+
export {Theme, getDocumentTheme}
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* ```
|
|
17
|
-
* <script type="module">
|
|
18
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
19
|
-
* console.log(new Monster.DOM.Theme())
|
|
20
|
-
* </script>
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* Alternatively, you can also integrate this function individually.
|
|
24
|
-
*
|
|
25
|
-
* ```
|
|
26
|
-
* <script type="module">
|
|
27
|
-
* import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/theme.js';
|
|
28
|
-
* console.log(new Theme())
|
|
29
|
-
* </script>
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
*
|
|
34
|
-
* import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/theme.js';
|
|
35
|
-
*
|
|
36
|
-
* const theme = getDocumentTheme();
|
|
37
|
-
* console.log(theme.getName());
|
|
38
|
-
* // ↦ monster
|
|
16
|
+
* The Theme class provides the functionality for the theme.
|
|
39
17
|
*
|
|
18
|
+
* @externalExample ../../example/dom/theme.mjs
|
|
19
|
+
* @license AGPLv3
|
|
40
20
|
* @since 1.7.0
|
|
41
21
|
* @copyright schukai GmbH
|
|
42
22
|
* @memberOf Monster.DOM
|
|
@@ -79,6 +59,7 @@ class Theme extends Base {
|
|
|
79
59
|
*
|
|
80
60
|
* @return {Theme}
|
|
81
61
|
* @memberOf Monster.DOM
|
|
62
|
+
* @license AGPLv3
|
|
82
63
|
* @since 1.7.0
|
|
83
64
|
*/
|
|
84
65
|
function getDocumentTheme() {
|
|
@@ -96,6 +77,3 @@ function getDocumentTheme() {
|
|
|
96
77
|
return new Theme(name);
|
|
97
78
|
|
|
98
79
|
}
|
|
99
|
-
|
|
100
|
-
assignToNamespace('Monster.DOM', Theme, getDocumentTheme);
|
|
101
|
-
export {Monster, Theme, getDocumentTheme}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {internalSymbol} from "../constants.
|
|
8
|
-
import {diff} from "../data/diff.
|
|
9
|
-
import {Pathfinder} from "../data/pathfinder.
|
|
10
|
-
import {Pipe} from "../data/pipe.
|
|
8
|
+
import {internalSymbol} from "../constants.mjs";
|
|
9
|
+
import {diff} from "../data/diff.mjs";
|
|
10
|
+
import {Pathfinder} from "../data/pathfinder.mjs";
|
|
11
|
+
import {Pipe} from "../data/pipe.mjs";
|
|
11
12
|
import {
|
|
12
13
|
ATTRIBUTE_ERRORMESSAGE,
|
|
13
14
|
ATTRIBUTE_UPDATER_ATTRIBUTES,
|
|
@@ -17,19 +18,20 @@ import {
|
|
|
17
18
|
ATTRIBUTE_UPDATER_REMOVE,
|
|
18
19
|
ATTRIBUTE_UPDATER_REPLACE,
|
|
19
20
|
ATTRIBUTE_UPDATER_SELECT_THIS
|
|
20
|
-
} from "../dom/constants.
|
|
21
|
-
|
|
22
|
-
import {Base} from "../types/base.
|
|
23
|
-
import {isArray, isInstance, isIterable} from "../types/is.
|
|
24
|
-
import {Observer} from "../types/observer.
|
|
25
|
-
import {ProxyObserver} from "../types/proxyobserver.
|
|
26
|
-
import {validateArray, validateInstance} from "../types/validate.
|
|
27
|
-
import {clone} from "../util/clone.
|
|
28
|
-
import {trimSpaces} from "../util/trimspaces.
|
|
29
|
-
import {findTargetElementFromEvent} from "./events.
|
|
30
|
-
import {findDocumentTemplate} from "./template.
|
|
31
|
-
import {getDocument} from "./util.
|
|
21
|
+
} from "../dom/constants.mjs";
|
|
22
|
+
|
|
23
|
+
import {Base} from "../types/base.mjs";
|
|
24
|
+
import {isArray, isInstance, isIterable} from "../types/is.mjs";
|
|
25
|
+
import {Observer} from "../types/observer.mjs";
|
|
26
|
+
import {ProxyObserver} from "../types/proxyobserver.mjs";
|
|
27
|
+
import {validateArray, validateInstance} from "../types/validate.mjs";
|
|
28
|
+
import {clone} from "../util/clone.mjs";
|
|
29
|
+
import {trimSpaces} from "../util/trimspaces.mjs";
|
|
30
|
+
import {findTargetElementFromEvent} from "./events.mjs";
|
|
31
|
+
import {findDocumentTemplate} from "./template.mjs";
|
|
32
|
+
import {getDocument} from "./util.mjs";
|
|
32
33
|
|
|
34
|
+
export {Updater}
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes.
|
|
@@ -40,50 +42,8 @@ import {getDocument} from "./util.js";
|
|
|
40
42
|
* Changes to attributes are made only when the direct values are changed. If you want to assign changes to other values
|
|
41
43
|
* as well, you have to insert the attribute `data-monster-select-this`. This should be done with care, as it can reduce performance.
|
|
42
44
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* ```
|
|
46
|
-
* <script type="module">
|
|
47
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
48
|
-
* new Monster.DOM.Updater()
|
|
49
|
-
* </script>
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* Alternatively, you can also integrate this function individually.
|
|
53
|
-
*
|
|
54
|
-
* ```
|
|
55
|
-
* <script type="module">
|
|
56
|
-
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/updater.js';
|
|
57
|
-
* new Updater()
|
|
58
|
-
* </script>
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
*
|
|
63
|
-
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/updater.js';
|
|
64
|
-
*
|
|
65
|
-
* // First we prepare the html document.
|
|
66
|
-
* // This is done here via script, but can also be inserted into the document as pure html.
|
|
67
|
-
* // To do this, simply insert the tag <h1 data-monster-replace="path:headline"></h1>.
|
|
68
|
-
* const body = document.querySelector('body');
|
|
69
|
-
* const headline = document.createElement('h1');
|
|
70
|
-
* headline.setAttribute('data-monster-replace','path:headline')
|
|
71
|
-
* body.appendChild(headline);
|
|
72
|
-
*
|
|
73
|
-
* // the data structure
|
|
74
|
-
* let obj = {
|
|
75
|
-
* headline: "Hello World",
|
|
76
|
-
* };
|
|
77
|
-
*
|
|
78
|
-
* // Now comes the real magic. we pass the updater the parent HTMLElement
|
|
79
|
-
* // and the desired data structure.
|
|
80
|
-
* const updater = new Updater(body, obj);
|
|
81
|
-
* updater.run();
|
|
82
|
-
*
|
|
83
|
-
* // Now you can change the data structure and the HTML will follow these changes.
|
|
84
|
-
* const subject = updater.getSubject();
|
|
85
|
-
* subject['headline'] = "Hello World!"
|
|
86
|
-
*
|
|
45
|
+
* @externalExample ../../example/dom/updater.mjs
|
|
46
|
+
* @license AGPLv3
|
|
87
47
|
* @since 1.8.0
|
|
88
48
|
* @copyright schukai GmbH
|
|
89
49
|
* @memberOf Monster.DOM
|
|
@@ -263,6 +223,7 @@ class Updater extends Base {
|
|
|
263
223
|
|
|
264
224
|
/**
|
|
265
225
|
* @private
|
|
226
|
+
* @license AGPLv3
|
|
266
227
|
* @since 1.9.0
|
|
267
228
|
* @return {function
|
|
268
229
|
* @this Updater
|
|
@@ -402,6 +363,7 @@ function retrieveAndSetValue(element) {
|
|
|
402
363
|
}
|
|
403
364
|
|
|
404
365
|
/**
|
|
366
|
+
* @license AGPLv3
|
|
405
367
|
* @since 1.27.0
|
|
406
368
|
* @return void
|
|
407
369
|
* @private
|
|
@@ -421,6 +383,7 @@ function retrieveFromBindings() {
|
|
|
421
383
|
|
|
422
384
|
/**
|
|
423
385
|
* @private
|
|
386
|
+
* @license AGPLv3
|
|
424
387
|
* @since 1.8.0
|
|
425
388
|
* @param {object} change
|
|
426
389
|
* @return {void}
|
|
@@ -435,6 +398,7 @@ function removeElement(change) {
|
|
|
435
398
|
|
|
436
399
|
/**
|
|
437
400
|
* @private
|
|
401
|
+
* @license AGPLv3
|
|
438
402
|
* @since 1.8.0
|
|
439
403
|
* @param {object} change
|
|
440
404
|
* @return {void}
|
|
@@ -568,6 +532,7 @@ function insertElement(change) {
|
|
|
568
532
|
/**
|
|
569
533
|
*
|
|
570
534
|
* @private
|
|
535
|
+
* @license AGPLv3
|
|
571
536
|
* @since 1.8.0
|
|
572
537
|
* @param {HTMLElement} container
|
|
573
538
|
* @param {string} key
|
|
@@ -593,6 +558,7 @@ function appendNewDocumentFragment(container, key, ref, path) {
|
|
|
593
558
|
|
|
594
559
|
/**
|
|
595
560
|
* @private
|
|
561
|
+
* @license AGPLv3
|
|
596
562
|
* @since 1.10.0
|
|
597
563
|
* @param {HTMLElement} node
|
|
598
564
|
* @param {string} key
|
|
@@ -621,6 +587,7 @@ function applyRecursive(node, key, path) {
|
|
|
621
587
|
|
|
622
588
|
/**
|
|
623
589
|
* @private
|
|
590
|
+
* @license AGPLv3
|
|
624
591
|
* @since 1.8.0
|
|
625
592
|
* @param {object} change
|
|
626
593
|
* @return {void}
|
|
@@ -647,6 +614,7 @@ function updateContent(change) {
|
|
|
647
614
|
|
|
648
615
|
/**
|
|
649
616
|
* @private
|
|
617
|
+
* @license AGPLv3
|
|
650
618
|
* @since 1.8.0
|
|
651
619
|
* @param {HTMLElement} container
|
|
652
620
|
* @param {array} parts
|
|
@@ -677,7 +645,7 @@ function runUpdateContent(container, parts, subject) {
|
|
|
677
645
|
}
|
|
678
646
|
|
|
679
647
|
/**
|
|
680
|
-
* @type {HTMLElement}
|
|
648
|
+
* @type {HTMLElement}
|
|
681
649
|
*/
|
|
682
650
|
for (const [element] of iterator.entries()) {
|
|
683
651
|
|
|
@@ -704,7 +672,7 @@ function runUpdateContent(container, parts, subject) {
|
|
|
704
672
|
while (element.firstChild) {
|
|
705
673
|
element.removeChild(element.firstChild);
|
|
706
674
|
}
|
|
707
|
-
|
|
675
|
+
|
|
708
676
|
try {
|
|
709
677
|
element.appendChild(value);
|
|
710
678
|
} catch (e) {
|
|
@@ -724,6 +692,7 @@ function runUpdateContent(container, parts, subject) {
|
|
|
724
692
|
|
|
725
693
|
/**
|
|
726
694
|
* @private
|
|
695
|
+
* @license AGPLv3
|
|
727
696
|
* @since 1.8.0
|
|
728
697
|
* @param {string} path
|
|
729
698
|
* @param {object} change
|
|
@@ -900,6 +869,3 @@ function handleInputControlAttributeUpdate(element, name, value) {
|
|
|
900
869
|
}
|
|
901
870
|
|
|
902
871
|
}
|
|
903
|
-
|
|
904
|
-
assignToNamespace('Monster.DOM', Updater);
|
|
905
|
-
export {Monster, Updater}
|
|
@@ -1,33 +1,19 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
|
-
import {assignToNamespace, Monster} from '../namespace.js';
|
|
7
|
-
import {getGlobal} from "../types/global.js";
|
|
8
|
-
import {validateString} from "../types/validate.js";
|
|
9
7
|
|
|
8
|
+
import {getGlobal} from "../types/global.mjs";
|
|
9
|
+
import {validateString} from "../types/validate.mjs";
|
|
10
|
+
|
|
11
|
+
export {getDocument, getWindow, getDocumentFragmentFromString}
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* ```
|
|
15
|
-
* <script type="module">
|
|
16
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
17
|
-
* console.log(Monster.DOM.getDocument())
|
|
18
|
-
* </script>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* Alternatively, you can also integrate this function individually.
|
|
22
|
-
*
|
|
23
|
-
* ```
|
|
24
|
-
* <script type="module">
|
|
25
|
-
* import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/util.js';
|
|
26
|
-
* console.log(getDocument())
|
|
27
|
-
* </script>
|
|
28
|
-
* ```
|
|
14
|
+
* This method fetches the document object
|
|
29
15
|
*
|
|
30
|
-
*
|
|
16
|
+
* In nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).
|
|
31
17
|
*
|
|
32
18
|
* ```
|
|
33
19
|
* import {JSDOM} from "jsdom"
|
|
@@ -55,6 +41,7 @@ import {validateString} from "../types/validate.js";
|
|
|
55
41
|
* ```
|
|
56
42
|
*
|
|
57
43
|
* @returns {object}
|
|
44
|
+
* @license AGPLv3
|
|
58
45
|
* @since 1.6.0
|
|
59
46
|
* @copyright schukai GmbH
|
|
60
47
|
* @memberOf Monster.DOM
|
|
@@ -70,25 +57,9 @@ function getDocument() {
|
|
|
70
57
|
}
|
|
71
58
|
|
|
72
59
|
/**
|
|
73
|
-
*
|
|
60
|
+
* This method fetches the window object
|
|
74
61
|
*
|
|
75
|
-
*
|
|
76
|
-
* <script type="module">
|
|
77
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
78
|
-
* console.log(Monster.DOM.getWindow())
|
|
79
|
-
* </script>
|
|
80
|
-
* ```
|
|
81
|
-
*
|
|
82
|
-
* Alternatively, you can also integrate this function individually.
|
|
83
|
-
*
|
|
84
|
-
* ```
|
|
85
|
-
* <script type="module">
|
|
86
|
-
* import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/util.js';
|
|
87
|
-
* console.log(getWindow(null))
|
|
88
|
-
* </script>
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).
|
|
62
|
+
* In nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).
|
|
92
63
|
*
|
|
93
64
|
* ```
|
|
94
65
|
* import {JSDOM} from "jsdom"
|
|
@@ -118,6 +89,7 @@ function getDocument() {
|
|
|
118
89
|
* ```
|
|
119
90
|
*
|
|
120
91
|
* @returns {object}
|
|
92
|
+
* @license AGPLv3
|
|
121
93
|
* @since 1.6.0
|
|
122
94
|
* @copyright schukai GmbH
|
|
123
95
|
* @memberOf Monster.DOM
|
|
@@ -134,27 +106,9 @@ function getWindow() {
|
|
|
134
106
|
|
|
135
107
|
|
|
136
108
|
/**
|
|
109
|
+
* This method fetches the document object
|
|
137
110
|
*
|
|
138
|
-
*
|
|
139
|
-
* this method fetches the document object
|
|
140
|
-
*
|
|
141
|
-
* ```
|
|
142
|
-
* <script type="module">
|
|
143
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
144
|
-
* console.log(Monster.DOM.getDocumentFragmentFromString())
|
|
145
|
-
* </script>
|
|
146
|
-
* ```
|
|
147
|
-
*
|
|
148
|
-
* Alternatively, you can also integrate this function individually.
|
|
149
|
-
*
|
|
150
|
-
* ```
|
|
151
|
-
* <script type="module">
|
|
152
|
-
* import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/util.js';
|
|
153
|
-
* console.log(getDocumentFragmentFromString('<div></div>'))
|
|
154
|
-
* </script>
|
|
155
|
-
* ```
|
|
156
|
-
*
|
|
157
|
-
* in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).
|
|
111
|
+
* In nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).
|
|
158
112
|
*
|
|
159
113
|
* ```
|
|
160
114
|
* import {JSDOM} from "jsdom"
|
|
@@ -182,6 +136,7 @@ function getWindow() {
|
|
|
182
136
|
* ```
|
|
183
137
|
*
|
|
184
138
|
* @returns {DocumentFragment}
|
|
139
|
+
* @license AGPLv3
|
|
185
140
|
* @since 1.6.0
|
|
186
141
|
* @copyright schukai GmbH
|
|
187
142
|
* @memberOf Monster.DOM
|
|
@@ -197,7 +152,3 @@ function getDocumentFragmentFromString(html) {
|
|
|
197
152
|
|
|
198
153
|
return template.content;
|
|
199
154
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
assignToNamespace('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString);
|
|
203
|
-
export {Monster, getWindow, getDocument, getDocumentFragmentFromString}
|
|
@@ -1,39 +1,22 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import {internalSymbol} from "../../constants.mjs";
|
|
9
|
+
import {Base} from "../../types/base.mjs";
|
|
10
|
+
import {getGlobal, getGlobalFunction} from "../../types/global.mjs";
|
|
11
|
+
import {isFunction} from "../../types/is.mjs";
|
|
12
|
+
import {validateInstance, validateString} from "../../types/validate.mjs";
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
import {assignToNamespace, Monster} from "../../namespace.js";
|
|
11
|
-
import {Base} from "../../types/base.js";
|
|
12
|
-
import {getGlobal, getGlobalFunction} from "../../types/global.js";
|
|
13
|
-
import {isFunction} from "../../types/is.js";
|
|
14
|
-
import {validateInstance, validateString} from "../../types/validate.js";
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export {Factory}
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* <script type="module">
|
|
23
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
24
|
-
* console.log(new Monster.DOM.Worker.Factory())
|
|
25
|
-
* </script>
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* Alternatively, you can also integrate this function individually.
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
* <script type="module">
|
|
32
|
-
* import {Factory} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/dom/worker/factory.js';
|
|
33
|
-
* console.log(new Factory())
|
|
34
|
-
* </script>
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
17
|
+
* A factory for creating worker instances.
|
|
18
|
+
*
|
|
19
|
+
* @license AGPLv3
|
|
37
20
|
* @since 1.25.0
|
|
38
21
|
* @copyright schukai GmbH
|
|
39
22
|
* @memberOf Monster.DOM.Worker
|
|
@@ -41,7 +24,6 @@ import {validateInstance, validateString} from "../../types/validate.js";
|
|
|
41
24
|
*/
|
|
42
25
|
class Factory extends Base {
|
|
43
26
|
|
|
44
|
-
|
|
45
27
|
/**
|
|
46
28
|
*
|
|
47
29
|
*/
|
|
@@ -129,6 +111,3 @@ class Factory extends Base {
|
|
|
129
111
|
|
|
130
112
|
|
|
131
113
|
}
|
|
132
|
-
|
|
133
|
-
assignToNamespace('Monster.DOM.Worker', Factory);
|
|
134
|
-
export {Monster, Factory}
|