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

chore: commit save point

parent fcc71af1
No related branches found
No related tags found
No related merge requests found
Showing
with 98 additions and 25 deletions
'use strict';
/**
* In this namespace you will find classes and methods for links
*
* @namespace Monster.DOM.Resource.Link
* @memberOf Monster
* @author schukai GmbH
*/
const ns = {};
\ No newline at end of file
...@@ -8,6 +8,7 @@ import {extend} from "../../../data/extend.js"; ...@@ -8,6 +8,7 @@ import {extend} from "../../../data/extend.js";
import {assignToNamespace, Monster} from "../../../namespace.js"; import {assignToNamespace, Monster} from "../../../namespace.js";
import {Link} from "../link.js"; import {Link} from "../link.js";
export {Stylesheet}
/** /**
* This class is used by the resource manager to embed external resources. * This class is used by the resource manager to embed external resources.
...@@ -25,7 +26,7 @@ import {Link} from "../link.js"; ...@@ -25,7 +26,7 @@ import {Link} from "../link.js";
* @summary A Resource class * @summary A Resource class
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
*/ */
export class Stylesheet extends Link { class Stylesheet extends Link {
/** /**
* @property {string} rel {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-rel} * @property {string} rel {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-rel}
......
'use strict';
/**
* In this namespace you will find classes and methods for handling resources.
*
* @namespace Monster.DOM.Resource
* @memberOf Monster
* @author schukai GmbH
*/
const ns = {};
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
} from "../constants.js"; } from "../constants.js";
import {KEY_DOCUMENT, referenceSymbol, Resource} from "../resource.js"; import {KEY_DOCUMENT, referenceSymbol, Resource} from "../resource.js";
export {Script}
/** /**
* This class is used by the resource manager to embed scripts. * This class is used by the resource manager to embed scripts.
...@@ -33,7 +34,7 @@ import {KEY_DOCUMENT, referenceSymbol, Resource} from "../resource.js"; ...@@ -33,7 +34,7 @@ import {KEY_DOCUMENT, referenceSymbol, Resource} from "../resource.js";
* @memberOf Monster.DOM.Resource * @memberOf Monster.DOM.Resource
* @summary A Resource class * @summary A Resource class
*/ */
export class Script extends Resource { class Script extends Resource {
/** /**
* @property {boolean} async=true {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async} * @property {boolean} async=true {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async}
......
...@@ -15,6 +15,7 @@ import {Data} from "./resource/data.js"; ...@@ -15,6 +15,7 @@ import {Data} from "./resource/data.js";
import {Stylesheet} from "./resource/link/stylesheet.js"; import {Stylesheet} from "./resource/link/stylesheet.js";
import {Script} from "./resource/script.js"; import {Script} from "./resource/script.js";
export {ResourceManager}
/** /**
* The ResourceManager is a singleton that manages all resources. * The ResourceManager is a singleton that manages all resources.
...@@ -31,7 +32,7 @@ import {Script} from "./resource/script.js"; ...@@ -31,7 +32,7 @@ import {Script} from "./resource/script.js";
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @summary A Resource class * @summary A Resource class
*/ */
export class ResourceManager extends BaseWithOptions { class ResourceManager extends BaseWithOptions {
/** /**
* *
......
...@@ -10,6 +10,8 @@ import {validateInstance, validateString} from "../types/validate.js"; ...@@ -10,6 +10,8 @@ import {validateInstance, validateString} from "../types/validate.js";
import {ATTRIBUTE_TEMPLATE_PREFIX} from "./constants.js"; import {ATTRIBUTE_TEMPLATE_PREFIX} from "./constants.js";
import {getDocumentTheme} from "./theme.js"; import {getDocumentTheme} from "./theme.js";
export {Template}
/** /**
* The template class provides methods for creating templates. * The template class provides methods for creating templates.
* *
...@@ -25,7 +27,7 @@ import {getDocumentTheme} from "./theme.js"; ...@@ -25,7 +27,7 @@ import {getDocumentTheme} from "./theme.js";
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @summary A template class * @summary A template class
*/ */
export class Template extends Base { class Template extends Base {
/** /**
* *
* @param {HTMLTemplateElement} template * @param {HTMLTemplateElement} template
......
...@@ -9,6 +9,7 @@ import {getGlobalObject} from '../types/global.js'; ...@@ -9,6 +9,7 @@ import {getGlobalObject} from '../types/global.js';
import {validateString} from "../types/validate.js"; import {validateString} from "../types/validate.js";
import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.js"; import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.js";
export {Theme, getDocumentTheme}
/** /**
* The Theme class provides the functionality for the theme. * The Theme class provides the functionality for the theme.
...@@ -33,7 +34,7 @@ import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.js"; ...@@ -33,7 +34,7 @@ import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.js";
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @summary A theme class * @summary A theme class
*/ */
export class Theme extends Base { class Theme extends Base {
/** /**
* *
...@@ -72,7 +73,7 @@ export class Theme extends Base { ...@@ -72,7 +73,7 @@ export class Theme extends Base {
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @since 1.7.0 * @since 1.7.0
*/ */
export function getDocumentTheme() { function getDocumentTheme() {
let document = getGlobalObject('document'); let document = getGlobalObject('document');
let name = DEFAULT_THEME; let name = DEFAULT_THEME;
......
...@@ -30,6 +30,7 @@ import {findTargetElementFromEvent} from "./events.js"; ...@@ -30,6 +30,7 @@ import {findTargetElementFromEvent} from "./events.js";
import {findDocumentTemplate} from "./template.js"; import {findDocumentTemplate} from "./template.js";
import {getDocument} from "./util.js"; import {getDocument} from "./util.js";
export {Updater}
/** /**
* The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes. * The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes.
...@@ -84,7 +85,7 @@ import {getDocument} from "./util.js"; ...@@ -84,7 +85,7 @@ import {getDocument} from "./util.js";
* @throws {TypeError} value is not an instance of HTMLElement * @throws {TypeError} value is not an instance of HTMLElement
* @summary The updater class connects an object with the dom * @summary The updater class connects an object with the dom
*/ */
export class Updater extends Base { class Updater extends Base {
/** /**
* @since 1.8.0 * @since 1.8.0
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
import {getGlobal} from "../types/global.js"; import {getGlobal} from "../types/global.js";
import {validateString} from "../types/validate.js"; import {validateString} from "../types/validate.js";
export {getDocument, getWindow, getDocumentFragmentFromString}
/** /**
* this method fetches the document object * this method fetches the document object
* *
...@@ -50,7 +52,7 @@ import {validateString} from "../types/validate.js"; ...@@ -50,7 +52,7 @@ import {validateString} from "../types/validate.js";
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @throws {Error} not supported environment * @throws {Error} not supported environment
*/ */
export function getDocument() { function getDocument() {
let document = getGlobal()?.['document']; let document = getGlobal()?.['document'];
if (typeof document !== 'object') { if (typeof document !== 'object') {
throw new Error("not supported environment") throw new Error("not supported environment")
...@@ -104,7 +106,7 @@ export function getDocument() { ...@@ -104,7 +106,7 @@ export function getDocument() {
* @memberOf Monster.DOM * @memberOf Monster.DOM
* @throws {Error} not supported environment * @throws {Error} not supported environment
*/ */
export function getWindow() { function getWindow() {
let window = getGlobal()?.['window']; let window = getGlobal()?.['window'];
if (typeof window !== 'object') { if (typeof window !== 'object') {
throw new Error("not supported environment") throw new Error("not supported environment")
...@@ -158,7 +160,7 @@ export function getWindow() { ...@@ -158,7 +160,7 @@ export function getWindow() {
* @throws {Error} not supported environment * @throws {Error} not supported environment
* @throws {TypeError} value is not a string * @throws {TypeError} value is not a string
*/ */
export function getDocumentFragmentFromString(html) { function getDocumentFragmentFromString(html) {
validateString(html); validateString(html);
const document = getDocument(); const document = getDocument();
......
...@@ -13,6 +13,8 @@ import {getGlobal, getGlobalFunction} from "../../types/global.js"; ...@@ -13,6 +13,8 @@ import {getGlobal, getGlobalFunction} from "../../types/global.js";
import {isFunction} from "../../types/is.js"; import {isFunction} from "../../types/is.js";
import {validateInstance, validateString} from "../../types/validate.js"; import {validateInstance, validateString} from "../../types/validate.js";
export {Factory}
/** /**
* A factory for creating worker instances. * A factory for creating worker instances.
* *
...@@ -28,7 +30,7 @@ import {validateInstance, validateString} from "../../types/validate.js"; ...@@ -28,7 +30,7 @@ import {validateInstance, validateString} from "../../types/validate.js";
* @memberOf Monster.DOM.Worker * @memberOf Monster.DOM.Worker
* @summary A small factory to create worker * @summary A small factory to create worker
*/ */
export class Factory extends Base { class Factory extends Base {
/** /**
......
'use strict';
/**
* In this namespace you will find classes and methods for handling the DOM.
*
* @namespace Monster.DOM.Worker
* @memberOf Monster
* @author schukai GmbH
*/
const ns = {};
\ No newline at end of file
...@@ -12,6 +12,8 @@ import {Formatter as TextFormatter} from "../text/formatter.js"; ...@@ -12,6 +12,8 @@ import {Formatter as TextFormatter} from "../text/formatter.js";
import {validateInstance, validateString} from "../types/validate.js"; import {validateInstance, validateString} from "../types/validate.js";
import {Translations} from "./translations.js"; import {Translations} from "./translations.js";
export {Formatter}
/** /**
* @private * @private
* @type {symbol} * @type {symbol}
...@@ -45,7 +47,7 @@ const internalTranslationSymbol = Symbol('internalTranslation') ...@@ -45,7 +47,7 @@ const internalTranslationSymbol = Symbol('internalTranslation')
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.I18n * @memberOf Monster.I18n
*/ */
export class Formatter extends TextFormatter { class Formatter extends TextFormatter {
/** /**
* Default values for the markers are `${` and `}` * Default values for the markers are `${` and `}`
......
...@@ -8,6 +8,8 @@ import {Base} from "../types/base.js"; ...@@ -8,6 +8,8 @@ import {Base} from "../types/base.js";
import {validateString} from "../types/validate.js"; import {validateString} from "../types/validate.js";
import {clone} from "../util/clone.js"; import {clone} from "../util/clone.js";
export {Locale, parseLocale}
/** /**
* @memberOf Monster.I18n * @memberOf Monster.I18n
* @type {symbol} * @type {symbol}
...@@ -66,7 +68,7 @@ const localeStringSymbol = Symbol('localeString'); ...@@ -66,7 +68,7 @@ const localeStringSymbol = Symbol('localeString');
* @memberOf Monster.I18n * @memberOf Monster.I18n
* @see https://datatracker.ietf.org/doc/html/rfc3066 * @see https://datatracker.ietf.org/doc/html/rfc3066
*/ */
export class Locale extends Base { class Locale extends Base {
/** /**
* @param {string} language * @param {string} language
...@@ -264,7 +266,7 @@ export class Locale extends Base { ...@@ -264,7 +266,7 @@ export class Locale extends Base {
* @throws {TypeError} value is not a string * @throws {TypeError} value is not a string
* @throws {Error} unsupported locale * @throws {Error} unsupported locale
*/ */
export function parseLocale(locale) { function parseLocale(locale) {
locale = validateString(locale).replace(/_/g, "-"); locale = validateString(locale).replace(/_/g, "-");
......
'use strict';
/**
* In this namespace you will find classes and methods for handling locale and localized texts.
*
* @namespace Monster.I18n
* @memberOf Monster
* @author schukai GmbH
*/
const ns = {};
\ No newline at end of file
...@@ -8,6 +8,8 @@ import {BaseWithOptions} from "../types/basewithoptions.js"; ...@@ -8,6 +8,8 @@ import {BaseWithOptions} from "../types/basewithoptions.js";
import {Locale} from "./locale.js" import {Locale} from "./locale.js"
import {Translations} from "./translations.js" import {Translations} from "./translations.js"
export {Provider}
/** /**
* A provider makes a translation object available. * A provider makes a translation object available.
* *
...@@ -23,7 +25,7 @@ import {Translations} from "./translations.js" ...@@ -23,7 +25,7 @@ import {Translations} from "./translations.js"
* @memberOf Monster.I18n * @memberOf Monster.I18n
* @see {@link https://datatracker.ietf.org/doc/html/rfc3066} * @see {@link https://datatracker.ietf.org/doc/html/rfc3066}
*/ */
export class Provider extends BaseWithOptions { class Provider extends BaseWithOptions {
/** /**
* @param {Locale|string} locale * @param {Locale|string} locale
......
...@@ -15,6 +15,8 @@ import {parseLocale} from "../locale.js"; ...@@ -15,6 +15,8 @@ import {parseLocale} from "../locale.js";
import {Provider} from "../provider.js"; import {Provider} from "../provider.js";
import {Translations} from "../translations.js"; import {Translations} from "../translations.js";
export {Fetch}
/** /**
* The fetch provider retrieves a JSON file from the given URL and returns a translation object. * The fetch provider retrieves a JSON file from the given URL and returns a translation object.
* *
...@@ -39,7 +41,7 @@ import {Translations} from "../translations.js"; ...@@ -39,7 +41,7 @@ import {Translations} from "../translations.js";
* @see {@link https://datatracker.ietf.org/doc/html/rfc3066} * @see {@link https://datatracker.ietf.org/doc/html/rfc3066}
* @tutorial i18n-locale-and-formatter * @tutorial i18n-locale-and-formatter
*/ */
export class Fetch extends Provider { class Fetch extends Provider {
/** /**
* As options the key `fetch` can be passed. This config object is passed to the fetch method as init. * As options the key `fetch` can be passed. This config object is passed to the fetch method as init.
......
'use strict';
/**
* In this namespace you will find classes and methods for handling locale and localized texts.
*
* @namespace Monster.I18n.Providers
* @memberOf Monster
* @author schukai GmbH
*/
const ns = {};
...@@ -9,6 +9,7 @@ import {isObject, isString} from "../types/is.js"; ...@@ -9,6 +9,7 @@ import {isObject, isString} from "../types/is.js";
import {validateInstance, validateInteger, validateObject, validateString} from "../types/validate.js"; import {validateInstance, validateInteger, validateObject, validateString} from "../types/validate.js";
import {Locale, parseLocale} from "./locale.js"; import {Locale, parseLocale} from "./locale.js";
export {Translations}
/** /**
* With this class you can manage translations and access the keys. * With this class you can manage translations and access the keys.
...@@ -48,7 +49,7 @@ import {Locale, parseLocale} from "./locale.js"; ...@@ -48,7 +49,7 @@ import {Locale, parseLocale} from "./locale.js";
* @memberOf Monster.I18n * @memberOf Monster.I18n
* @see https://datatracker.ietf.org/doc/html/rfc3066 * @see https://datatracker.ietf.org/doc/html/rfc3066
*/ */
export class Translations extends Base { class Translations extends Base {
/** /**
* *
......
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
* @author schukai GmbH * @author schukai GmbH
*/ */
import {Base} from '../types/base.js'; import {Base} from '../types/base.js';
import {validateInstance, validateInteger} from "../types/validate.js"; import {validateInstance, validateInteger} from "../types/validate.js";
import {LogEntry} from "./logentry.js"; import {LogEntry} from "./logentry.js";
import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js"; import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js";
export {Handler}
/** /**
* The log handler is the interface between the log entries and the log listeners. * The log handler is the interface between the log entries and the log listeners.
* *
...@@ -24,7 +25,7 @@ import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js"; ...@@ -24,7 +25,7 @@ import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js";
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Logging * @memberOf Monster.Logging
*/ */
export class Handler extends Base { class Handler extends Base {
constructor() { constructor() {
super(); super();
......
...@@ -10,6 +10,8 @@ import {getGlobalObject} from "../../types/global.js"; ...@@ -10,6 +10,8 @@ import {getGlobalObject} from "../../types/global.js";
import {Handler} from '../handler.js'; import {Handler} from '../handler.js';
import {LogEntry} from "../logentry.js"; import {LogEntry} from "../logentry.js";
export {ConsoleHandler}
/** /**
* You can create an object of the class simply by using the namespace `new Monster.Logging.Handler.ConsoleHandler()`. * You can create an object of the class simply by using the namespace `new Monster.Logging.Handler.ConsoleHandler()`.
* *
...@@ -24,7 +26,7 @@ import {LogEntry} from "../logentry.js"; ...@@ -24,7 +26,7 @@ import {LogEntry} from "../logentry.js";
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.Logging.Handler * @memberOf Monster.Logging.Handler
*/ */
export class ConsoleHandler extends Handler { class ConsoleHandler extends Handler {
constructor() { constructor() {
super(); super();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment