Skip to content
Snippets Groups Projects
Verified Commit 11736bbc authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent c2f78863
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 277 deletions
// In the example the user can use his own template by creating a template in the DOM with the ID `my-custom-element`.
// You can also specify a theme (for example `mytheme`), then it will search for the ID `my-custom-element-mytheme` and
// if not available for the ID `my-custom-element`.
class MyCustomElement extends CustomElement {
static getTag() {
return "my-custom-element"
}
}
// ↦ <my-custom-element></my-custom-element>
\ No newline at end of file
import {getDocumentTheme} from '@schukai/monster/source/dom/theme.mjs';
const theme = getDocumentTheme();
console.log(theme.getName());
// ↦ monster
\ No newline at end of file
......@@ -15,13 +15,6 @@ export {diff}
*
* The operator `add` means that something has been added to the second object. `delete` means that something has been deleted from the second object compared to the first object.
*
* ```
* <script type="module">
* import {Diff} from '@schukai/monster/source/data/diff.mjs';
* Diff(a, b)
* </script>
* ```
*
* @externalExample ../../example/data/diff.mjs
* @param {*} first
* @param {*} second
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from '../types/base.mjs';
import {getGlobalFunction} from "../types/global.mjs";
import {ProxyObserver} from "../types/proxyobserver.mjs";
......@@ -26,13 +23,6 @@ const ATTRIBUTEPREFIX = "data-monster-";
/**
* Assembler class
*
* ```
* <script type="module">
* import {Assembler} from '@schukai/monster/source/dom/assembler.mjs';
* console.log(new Assembler())
* </script>
* ```
*
* @license AGPLv3
* @since 1.6.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,8 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {getGlobalFunction} from "../types/global.mjs";
import {TokenList} from "../types/tokenlist.mjs";
import {validateInstance, validateString, validateSymbol} from "../types/validate.mjs";
......@@ -36,13 +32,6 @@ export {
* if a node is specified without a object link, a recursive search upwards is performed until the corresponding
* object link is found, or undefined is returned.
*
* ```
* <script type="module">
* import {getUpdaterFromNode} from '@schukai/monster/source/dom/updater.mjs';
* console.log(findClosestObjectLink())
* </script>
* ```
*
* @param {HTMLElement} element
* @return {HTMLElement|undefined}
* @license AGPLv3
......@@ -58,13 +47,6 @@ function findClosestObjectLink(element) {
/**
* Adds a class attribute to an element.
*
* ```
* <script type="module">
* import {addToObjectLink} from '@schukai/monster/source/dom/attributes.mjs';
* addToObjectLink();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -92,13 +74,6 @@ function addToObjectLink(element, symbol, object) {
/**
* Removes an object from an element
*
* ```
* <script type="module">
* import {removeObjectLink} from '@schukai/monster/source/dom/attributes.mjs';
* removeObjectLink();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -126,13 +101,6 @@ function removeObjectLink(element, symbol) {
/**
* Checks if an element has an object link
*
* ```
* <script type="module">
* import {hasObjectLink} from '@schukai/monster/source/dom/attributes.mjs';
* hasObjectLink();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -162,13 +130,6 @@ function hasObjectLink(element, symbol) {
*
* With the method {@see {@link addToObjectLink}} the objects can be added.
*
* ```
* <script type="module">
* import {getLinkedObjects} from '@schukai/monster/source/dom/attributes.mjs';
* getLinkedObjects();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -197,13 +158,6 @@ function getLinkedObjects(element, symbol) {
*
* Tokens are always separated by a space.
*
* ```
* <script type="module">
* import {toggleAttributeToken} from '@schukai/monster/source/dom/attributes.mjs';
* toggleAttributeToken();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -231,13 +185,6 @@ function toggleAttributeToken(element, key, token) {
/**
* This method can be used to add a token to an attribute. Tokens are always separated by a space.
*
* ```
* <script type="module">
* import {addAttributeToken} from '@schukai/monster/source/dom/attributes.mjs';
* addAttributeToken();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -267,13 +214,6 @@ function addAttributeToken(element, key, token) {
*
* Tokens are always separated by a space.
*
* ```
* <script type="module">
* import {removeAttributeToken} from '@schukai/monster/source/dom/attributes.mjs';
* removeAttributeToken();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -302,13 +242,6 @@ function removeAttributeToken(element, key, token) {
*
* Tokens are always separated by a space.
*
* ```
* <script type="module">
* import {containsAttributeToken} from '@schukai/monster/source/dom/attributes.mjs';
* containsAttributeToken();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -334,13 +267,6 @@ function containsAttributeToken(element, key, token) {
/**
* Tokens are always separated by a space.
*
* ```
* <script type="module">
* import {replaceAttributeToken} from '@schukai/monster/source/dom/attributes.mjs';
* replaceAttributeToken();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -369,13 +295,6 @@ function replaceAttributeToken(element, key, from, to) {
/**
* Tokens are always separated by a space.
*
* ```
* <script type="module">
* import {clearAttributeTokens} from '@schukai/monster/source/dom/attributes.mjs';
* clearAttributeTokens();
* </script>
* ```
*
* @license AGPLv3
* @since 1.9.0
* @copyright schukai GmbH
......@@ -416,13 +335,6 @@ function clearAttributeTokens(element, key) {
* findClosestByAttribute(document.getElementById('1'),'data-my-attribute', '2'); // ↦ node with id 2
* ```
*
* ```
* <script type="module">
* import {findClosestByAttribute} from '@schukai/monster/source/dom/attributes.mjs';
* findClosestByAttribute();
* </script>
* ```
*
* @license AGPLv3
* @since 1.14.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......
import {extend} from "../data/extend.mjs";
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -8,7 +5,7 @@ import {extend} from "../data/extend.mjs";
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {extend} from "../data/extend.mjs";
import {ATTRIBUTE_VALUE} from "./constants.mjs";
import {CustomElement, attributeObserverSymbol} from "./customelement.mjs";
......@@ -33,13 +30,6 @@ const attachedInternalSymbol = Symbol('attachedInternal');
*
* You can create the object via the function `document.createElement()`.
*
* ```
* <script type="module">
* import {CustomControl} from '@schukai/monster/source//monster.mjs';
* document.createElement('monster-')
* </script>
* ```
*
* @startuml customcontrol-class.png
* skinparam monochrome true
* skinparam shadowing false
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalSymbol} from "../constants.mjs";
import {extend} from "../data/extend.mjs";
import {Pathfinder} from "../data/pathfinder.mjs";
......@@ -106,12 +103,6 @@ const attributeObserverSymbol = Symbol('attributeObserver');
*
* You can create the object via the function `document.createElement()`.
*
* ```
* <script type="module">
* import {Monster} from '@schukai/monster/source//monster.mjs';
* document.createElement('monster-')
* </script>
* ```
*
* ## Interaction
*
......@@ -177,22 +168,7 @@ const attributeObserverSymbol = Symbol('attributeObserver');
* }
* ```
*
* @example
*
* // In the example the the user can use his own template by creating a template in the DOM with the ID `my-custom-element`.
* // You can also specify a theme (for example `mytheme`), then it will search for the ID `my-custom-element-mytheme` and
* // if not available for the ID `my-custom-element`.
*
* class MyCustomElement extends CustomElement {
*
* static getTag() {
* return "my-custom-element"
* }
*
* }
*
* // ↦ <my-custom-element></my-custom-element>
*
* @externalExample ../../example/dom/theme.mjs
* @see https://github.com/WICG/webcomponents
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements
* @license AGPLv3
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -8,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {isArray, isObject} from "../types/is.mjs";
import {validateInstance, validateString} from "../types/validate.mjs";
import {getDocument} from "./util.mjs";
......@@ -18,13 +14,6 @@ export {fireEvent, fireCustomEvent, findTargetElementFromEvent}
/**
* The function sends an event
*
* ```
* <script type="module">
* import {fireEvent} from '@schukai/monster/source/dom/events.mjs';
* fireEvent()
* </script>
* ```
*
* @param {HTMLElement|HTMLCollection|NodeList} element
* @param {string} type
* @return {void}
......@@ -66,13 +55,6 @@ function fireEvent(element, type) {
/**
* You can call the function via the monster namespace `new Monster.DOM.fireCustomEvent()`.
*
* ```
* <script type="module">
* import {fireCustomEvent} from '@schukai/monster/source/dom/events.mjs';
* fireCustomEvent()
* </script>
* ```
*
* @param {HTMLElement|HTMLCollection|NodeList} element
* @param {string} type
* @return {void}
......@@ -116,13 +98,6 @@ function fireCustomEvent(element, type, detail) {
* up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null,
* is specified, only the attribute is searched.
*
* ```
* <script type="module">
* import {findTargetElementFromEvent} from '@schukai/monster/source/dom/events.mjs';
* findTargetElementFromEvent()
* </script>
* ```
*
* @license AGPLv3
* @since 1.14.0
* @param {Event} event
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -8,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {extend} from "../data/extend.mjs";
import {BaseWithOptions} from "../types/basewithoptions.mjs";
import {getGlobalObject} from "../types/global.mjs";
......@@ -41,13 +37,6 @@ const stackSymbol = Symbol('stack');
/**
* With the focusmanager the focus can be stored in a document, recalled and moved.
*
* ```
* <script type="module">
* import {FocusManager} from '@schukai/monster/source/dom/focusmanager.mjs';
* new FocusManager()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {parseLocale} from "../i18n/locale.mjs";
import {getDocument} from "./util.mjs";
......@@ -30,13 +27,6 @@ const DEFAULT_LANGUAGE = 'en';
*
* You can call the function via the monster namespace `new Monster.DOM.getLocaleOfDocument()`.
*
* ```
* <script type="module">
* import {getLocaleOfDocument} from '@schukai/monster/source/dom/locale.mjs';
* new getLocaleOfDocument()
* </script>
* ```
*
* @license AGPLv3
* @since 1.13.0
* @copyright schukai GmbH
......
/**
* In this namespace you will find classes and methods for handling the DOM.
*
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -8,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {getDocument, getWindow} from "./util.mjs";
export {domReady, windowReady}
......@@ -19,15 +15,6 @@ export {domReady, windowReady}
* The DOMContentLoaded event is fired when the original HTML document is fully loaded and parsed
* without waiting for stylesheets, images, and subframes to finish loading.
*
* ```
* <script type="module">
* import {domReady} from '@schukai/monster/source/dom/ready.mjs';
* domReady().then(()=>{
* // ...
* })
* </script>
* ```
*
* @license AGPLv3
* @since 1.31.0
* @memberOf Monster.DOM
......@@ -55,15 +42,6 @@ const domReady = new Promise(resolve => {
* assets, and images. Unlike DOMContentLoaded, which fires as soon as the DOM of the page is loaded,
* without waiting for the resources to finish loading.
*
* ```
* <script type="module">
* import {windowReady} from '@schukai/monster/source/dom/ready.mjs';
* windowReady().then(()=>{
* // ...
* })
* </script>
* ```
*
* @license AGPLv3
* @since 1.31.0
* @memberOf Monster.DOM
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalStateSymbol, internalSymbol,} from "../constants.mjs";
import {extend} from "../data/extend.mjs";
import {BaseWithOptions} from "../types/basewithoptions.mjs";
......@@ -47,13 +44,6 @@ const referenceSymbol = Symbol('reference');
/**
* This class is the base class for all resources to be loaded.
*
* ```
* <script type="module">
* import {Resource} from '@schukai/monster/source/dom/resource.mjs';
* new Resource()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalStateSymbol} from "../../constants.mjs";
import {extend} from "../../data/extend.mjs";
import {getGlobalFunction} from "../../types/global.mjs";
......@@ -27,13 +24,6 @@ export {Data}
/**
* This class is used by the resource manager to embed data.
*
* ```
* <script type="module">
* import {Data} from '@schukai/monster/source/dom/resource/data.mjs';
* new Data()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {extend} from "../../data/extend.mjs";
import {
ATTRIBUTE_CLASS,
......@@ -24,13 +21,6 @@ export {Link}
/**
* This class is used by the resource manager to embed external resources.
*
* ```
* <script type="module">
* import {Link} from '@schukai/monster/source/dom/resource/link.mjs';
* new Link()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {extend} from "../../../data/extend.mjs";
import {Link} from "../link.mjs";
......@@ -16,13 +13,6 @@ export {Stylesheet}
/**
* This class is used by the resource manager to embed external resources.
*
* ```
* <script type="module">
* import {Style} from '@schukai/monster/source/dom/resource/link/stylesheet.mjs';
* new Stylesheet()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
/**
* In this namespace you will find classes and methods for handling resources.
*
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {extend} from "../../data/extend.mjs";
import {
ATTRIBUTE_CLASS,
......@@ -25,13 +22,6 @@ export {Script}
/**
* This class is used by the resource manager to embed scripts.
*
* ```
* <script type="module">
* import {Script} from '@schukai/monster/source/dom/resource/script.mjs';
* new Script()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
/**
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
......@@ -7,7 +5,6 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {extend} from "../data/extend.mjs";
import {BaseWithOptions} from "../types/basewithoptions.mjs";
import {getGlobalObject} from "../types/global.mjs";
......@@ -23,13 +20,6 @@ export {ResourceManager}
/**
* The ResourceManager is a singleton that manages all resources.
*
* ```
* <script type="module">
* import {Resource} from '@schukai/monster/source/dom/resourcemanager.mjs';
* new ResourceManager()
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment