Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • oss/libraries/javascript/monster
1 result
Select Git revision
Loading items
Show changes
Commits on Source (5)
<a name="v3.27.0"></a>
## [v3.27.0] - 2023-03-14
### Add Features
- add instance getter
### Changes
- update packages
<a name="v3.26.0"></a>
## [v3.26.0] - 2023-03-08
### Add Features
......@@ -413,6 +422,7 @@
<a name="1.8.0"></a>
## 1.8.0 - 2021-08-15
[v3.27.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.26.0...v3.27.0
[v3.26.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.25.0...v3.26.0
[v3.25.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.24.0...v3.25.0
[v3.24.0]: https://gitlab.schukai.com/oss/libraries/javascript/monster/compare/v3.23.0...v3.24.0
......
{
"name": "@schukai/monster",
"version": "3.25.0",
"version": "3.26.0",
"description": "Monster is a simple library for creating fast, robust and lightweight websites.",
"keywords": [
"framework",
......
......@@ -5,7 +5,7 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import { internalSymbol } from "../constants.mjs";
import {instanceSymbol, internalSymbol} from "../constants.mjs";
import {extend} from "../data/extend.mjs";
import {Formatter as TextFormatter} from "../text/formatter.mjs";
......@@ -41,6 +41,15 @@ class Formatter extends TextFormatter {
this[internalTranslationSymbol] = validateInstance(translation, Translations);
}
/**
* This method is called by the `instanceof` operator.
* @returns {symbol}
* @since 3.27.0
*/
static get [instanceSymbol]() {
return Symbol.for("@schukai/monster/i18n/formatter@@instance");
}
/**
* @property {object} marker
* @property {array} marker.open=["i18n{","${"]
......
......@@ -5,6 +5,7 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {instanceSymbol} from "../constants.mjs";
import { Base } from "../types/base.mjs";
import { validateString } from "../types/validate.mjs";
import { clone } from "../util/clone.mjs";
......@@ -100,6 +101,15 @@ class Locale extends Base {
this[localeStringSymbol] = s.join("-");
}
/**
* This method is called by the `instanceof` operator.
* @returns {symbol}
* @since 3.27.0
*/
static get [instanceSymbol]() {
return Symbol.for("@schukai/monster/i18n/locale@@instance");
}
/**
* @return {string}
*/
......
......@@ -5,6 +5,7 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {instanceSymbol} from "../constants.mjs";
import {hasObjectLink, getLinkedObjects,addToObjectLink} from "../dom/attributes.mjs";
import {getLocaleOfDocument} from "../dom/locale.mjs";
import {BaseWithOptions} from "../types/basewithoptions.mjs";
......@@ -32,6 +33,16 @@ const translationsLinkSymbol = Symbol.for("@schukai/monster/i18n/translations@@l
* @see {@link https://datatracker.ietf.org/doc/html/rfc3066}
*/
class Provider extends BaseWithOptions {
/**
* This method is called by the `instanceof` operator.
* @returns {symbol}
* @since 3.27.0
*/
static get [instanceSymbol]() {
return Symbol.for("@schukai/monster/i18n/provider@@instance");
}
/**
* @param {Locale|string} locale
* @return {Promise}
......
......@@ -5,6 +5,7 @@
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {instanceSymbol} from "../constants.mjs";
import {getLinkedObjects, hasObjectLink} from "../dom/attributes.mjs";
import {ATTRIBUTE_OBJECTLINK} from "../dom/constants.mjs";
import {getDocument} from "../dom/util.mjs";
......@@ -44,6 +45,15 @@ class Translations extends Base {
this.storage = new Map();
}
/**
* This method is called by the `instanceof` operator.
* @returns {symbol}
* @since 3.27.0
*/
static get [instanceSymbol]() {
return Symbol.for("@schukai/monster/i18n/translations@@instance");
}
/**
* Fetches a text using the specified key.
* If no suitable key is found, `defaultText` is taken.
......@@ -107,9 +117,11 @@ class Translations extends Base {
return validateString(r[keyword]);
}
if (r.hasOwnProperty(DEFAULT_KEY)) {
return validateString(r[DEFAULT_KEY]);
}
// @deprecated since 2023-03-14
// DEFAULT_KEY is undefined
// if (r.hasOwnProperty(DEFAULT_KEY)) {
// return validateString(r[DEFAULT_KEY]);
// }
return validateString(defaultText);
}
......
......@@ -142,7 +142,7 @@ function getMonsterVersion() {
}
/** don't touch, replaced by make with package.json version */
monsterVersion = new Version("3.25.0");
monsterVersion = new Version("3.26.0");
return monsterVersion;
}
{
"name": "monster",
"version": "3.25.0",
"version": "3.26.0",
"description": "monster",
"repository": {
"type": "git",
......@@ -22,7 +22,7 @@
"devDependencies": {
"@oss/web-components-build-tools": "^1.2.8",
"@peculiar/webcrypto": "^1.4.1",
"autoprefixer": "^10.4.13",
"autoprefixer": "^10.4.14",
"browserslist": "^4.21.5",
"btoa": "^1.2.1",
"c8": "^7.13.0",
......@@ -40,7 +40,7 @@
"jsdoc": "^4.0.2",
"jsdoc-external-example": "github:volker-schukai/jsdoc-external-example",
"jsdoc-plantuml": "^1.0.2",
"jsdom": "^21.1.0",
"jsdom": "^21.1.1",
"jsdom-global": "^3.0.2",
"mocha": "^10.2.0",
"node-plantuml": "^0.9.0",
......@@ -57,7 +57,7 @@
"postcss-rtlcss": "^4.0.3",
"postcss-strip-units": "^2.0.1",
"rome": "^11.0.0",
"sinon": "^15.0.1",
"sinon": "^15.0.2",
"url": "^0.11.0",
"url-exist": "3.0.1",
"util": "^0.12.5",
......@@ -66,6 +66,6 @@
"vite-plugin-list-directory-contents": "^1.4.5",
"vite-plugin-minify": "^1.5.2",
"vite-plugin-mkcert": "^1.13.3",
"ws": "^8.12.1"
"ws": "^8.13.0"
}
}
This diff is collapsed.
......@@ -7,7 +7,7 @@ describe('Monster', function () {
let monsterVersion
/** don´t touch, replaced by make with package.json version */
monsterVersion = new Version("3.25.0")
monsterVersion = new Version("3.26.0")
let m = getMonsterVersion();
......
{"version":"3.26.0"}
{"version":"3.27.0"}