@public-ui/hydrate 1.7.7 → 1.7.8
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/dist/index.js +24 -58
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -9538,16 +9538,21 @@ const initMeta = () => {
|
|
|
9538
9538
|
console.warn(`You can only initialize DEV_MODE and COLOR_CONTRAST_ANALYSIS once.`);
|
|
9539
9539
|
}
|
|
9540
9540
|
};
|
|
9541
|
-
const
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9541
|
+
const getKoliBri = () => {
|
|
9542
|
+
let kolibri = getWindow$1().KoliBri;
|
|
9543
|
+
if (kolibri === undefined) {
|
|
9544
|
+
kolibri = {};
|
|
9545
|
+
Object.defineProperty(getWindow$1(), 'KoliBri', {
|
|
9546
|
+
value: kolibri,
|
|
9547
|
+
writable: false,
|
|
9548
|
+
});
|
|
9549
|
+
}
|
|
9550
|
+
return kolibri;
|
|
9551
|
+
};
|
|
9547
9552
|
const initKoliBri = () => {
|
|
9548
|
-
if (
|
|
9553
|
+
if (getKoliBri().Modal === undefined) {
|
|
9549
9554
|
const Modal = new ModalService();
|
|
9550
|
-
Object.defineProperty(
|
|
9555
|
+
Object.defineProperty(getKoliBri(), 'Modal', {
|
|
9551
9556
|
get: function () {
|
|
9552
9557
|
return Modal;
|
|
9553
9558
|
},
|
|
@@ -9559,7 +9564,7 @@ const initKoliBri = () => {
|
|
|
9559
9564
|
| . ' | .-. | | | ,--. | .-. \\ | .--' ,--.
|
|
9560
9565
|
| |\\ \\ | '-' | | | | | | '--' / | | | |
|
|
9561
9566
|
\`--' \`--´ \`---´ \`--' \`--' \`------´ \`--' \`--'
|
|
9562
|
-
🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | 1.7.
|
|
9567
|
+
🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | 1.7.8
|
|
9563
9568
|
`, {
|
|
9564
9569
|
forceLog: true,
|
|
9565
9570
|
});
|
|
@@ -9569,15 +9574,8 @@ const initKoliBri = () => {
|
|
|
9569
9574
|
}
|
|
9570
9575
|
};
|
|
9571
9576
|
const renderDevAdvice = () => {
|
|
9572
|
-
if (
|
|
9573
|
-
Object.defineProperty(
|
|
9574
|
-
get: function () {
|
|
9575
|
-
return KoliBri;
|
|
9576
|
-
},
|
|
9577
|
-
});
|
|
9578
|
-
}
|
|
9579
|
-
if (KoliBri.adviceShown !== true) {
|
|
9580
|
-
Object.defineProperty(KoliBri, 'adviceShown', {
|
|
9577
|
+
if (getKoliBri().adviceShown !== true) {
|
|
9578
|
+
Object.defineProperty(getKoliBri(), 'adviceShown', {
|
|
9581
9579
|
get: function () {
|
|
9582
9580
|
return true;
|
|
9583
9581
|
},
|
|
@@ -9597,15 +9595,15 @@ if (processEnv === 'test') {
|
|
|
9597
9595
|
|
|
9598
9596
|
const register = async (themes, loaders, options) => {
|
|
9599
9597
|
var _a, _b;
|
|
9600
|
-
if (
|
|
9601
|
-
Object.defineProperty(
|
|
9598
|
+
if (getKoliBri().I18n === undefined) {
|
|
9599
|
+
Object.defineProperty(getKoliBri(), 'I18n', {
|
|
9602
9600
|
value: await I18nextService.createInstance((_b = (_a = options === null || options === void 0 ? void 0 : options.translation) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'de', options === null || options === void 0 ? void 0 : options.translations),
|
|
9603
9601
|
writable: false,
|
|
9604
9602
|
});
|
|
9605
9603
|
}
|
|
9606
9604
|
return await _(themes, loaders, options);
|
|
9607
9605
|
};
|
|
9608
|
-
const getI18nService = () =>
|
|
9606
|
+
const getI18nService = () => getKoliBri().I18n;
|
|
9609
9607
|
|
|
9610
9608
|
var appGlobalScript = async () => {
|
|
9611
9609
|
setMode((elm) => {
|
|
@@ -17824,13 +17822,6 @@ class KolInputText {
|
|
|
17824
17822
|
|
|
17825
17823
|
const defaultStyleCss$k = "/*!@:host*/.sc-kol-kolibri-default-h{--a11y-min-size:44px;background-color:white;color:black;font-family:Verdana}/*!@**/*.sc-kol-kolibri-default{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}/*!@[role='button'],\nbutton:not([role='link']),\nkol-input .input*/[role='button'].sc-kol-kolibri-default,button.sc-kol-kolibri-default:not([role='link']),kol-input.sc-kol-kolibri-default .input.sc-kol-kolibri-default{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}/*!@a,\nbutton,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\ninput,\noption,\nselect,\ntextarea*/a.sc-kol-kolibri-default,button.sc-kol-kolibri-default,h1.sc-kol-kolibri-default,h2.sc-kol-kolibri-default,h3.sc-kol-kolibri-default,h4.sc-kol-kolibri-default,h5.sc-kol-kolibri-default,h6.sc-kol-kolibri-default,input.sc-kol-kolibri-default,option.sc-kol-kolibri-default,select.sc-kol-kolibri-default,textarea.sc-kol-kolibri-default{font-family:inherit;font-size:inherit}/*!@.visually-hidden*/.visually-hidden.sc-kol-kolibri-default{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}/*!@:is(a, button)*/.sc-kol-kolibri-default:is(a,button).sc-kol-kolibri-default{background-color:transparent;border:none;margin:0;padding:0;width:100%}/*!@[hidden]*/[hidden].sc-kol-kolibri-default{display:none !important}/*!@:host*/.sc-kol-kolibri-default-h{max-width:100%}/*!@**/*.sc-kol-kolibri-default{box-sizing:border-box}/*!@kol-span-wc*/kol-span-wc.sc-kol-kolibri-default{display:grid;place-items:center}/*!@kol-span-wc > span*/kol-span-wc.sc-kol-kolibri-default>span.sc-kol-kolibri-default{display:flex;place-items:center}/*!@a,\nbutton*/a.sc-kol-kolibri-default,button.sc-kol-kolibri-default{cursor:pointer}/*!@.icon-only > kol-span-wc > span > span*/.icon-only.sc-kol-kolibri-default>kol-span-wc.sc-kol-kolibri-default>span.sc-kol-kolibri-default>span.sc-kol-kolibri-default{display:none}/*!@:host*/.sc-kol-kolibri-default-h{display:inline-block}/*!@text*/text.sc-kol-kolibri-default{font-size:90px;letter-spacing:normal;word-spacing:normal}/*!@svg*/svg.sc-kol-kolibri-default{max-height:100%}";
|
|
17826
17824
|
|
|
17827
|
-
const max$1 = 360;
|
|
17828
|
-
function degreeToRadians(degree) {
|
|
17829
|
-
return (degree * Math.PI) / 180;
|
|
17830
|
-
}
|
|
17831
|
-
function getColorNumber(degree) {
|
|
17832
|
-
return Math.round(((Math.cos(degreeToRadians(degree)) + 1) / 2) * 225);
|
|
17833
|
-
}
|
|
17834
17825
|
class KolKolibri {
|
|
17835
17826
|
constructor(hostRef) {
|
|
17836
17827
|
registerInstance(this, hostRef);
|
|
@@ -17847,11 +17838,9 @@ class KolKolibri {
|
|
|
17847
17838
|
devHint(`[KolKolibri] You used the complex color schema. For the KoliBri we use need the color as hex string.`);
|
|
17848
17839
|
}
|
|
17849
17840
|
};
|
|
17850
|
-
this._animate = false;
|
|
17851
17841
|
this._color = '#003c78';
|
|
17852
17842
|
this._labeled = undefined;
|
|
17853
17843
|
this.state = {
|
|
17854
|
-
_animate: false,
|
|
17855
17844
|
_color: {
|
|
17856
17845
|
red: 0,
|
|
17857
17846
|
green: 60,
|
|
@@ -17861,14 +17850,9 @@ class KolKolibri {
|
|
|
17861
17850
|
};
|
|
17862
17851
|
}
|
|
17863
17852
|
render() {
|
|
17864
|
-
const fillColor = this.state.
|
|
17865
|
-
? `rgb(${getColorNumber(this.state._color.red)},${getColorNumber(this.state._color.green)},${getColorNumber(this.state._color.blue)})`
|
|
17866
|
-
: `rgb(${this.state._color.red},${this.state._color.green},${this.state._color.blue})`;
|
|
17853
|
+
const fillColor = `rgb(${this.state._color.red},${this.state._color.green},${this.state._color.blue})`;
|
|
17867
17854
|
return (hAsync(Host, null, hAsync("svg", { role: "img", "aria-label": translate('kol-kolibri-logo'), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 600 600", fill: fillColor }, hAsync("path", { d: "M353 322L213 304V434L353 322Z" }), hAsync("path", { d: "M209 564V304L149 434L209 564Z" }), hAsync("path", { d: "M357 316L417 250L361 210L275 244L357 316Z" }), hAsync("path", { d: "M329 218L237 92L250 222L272 241L329 218Z" }), hAsync("path", { d: "M353 318L35 36L213 300L353 318Z" }), hAsync("path", { d: "M391 286L565 272L421 252L391 286Z" }), this.state._labeled === true && (hAsync("text", { x: "250", y: "525", fill: fillColor }, "KoliBri")))));
|
|
17868
17855
|
}
|
|
17869
|
-
validateAnimate(value) {
|
|
17870
|
-
watchBoolean(this, '_animate', value);
|
|
17871
|
-
}
|
|
17872
17856
|
validateColor(value) {
|
|
17873
17857
|
validateColor(this, value, {
|
|
17874
17858
|
defaultValue: '#003c78',
|
|
@@ -17881,27 +17865,10 @@ class KolKolibri {
|
|
|
17881
17865
|
watchBoolean(this, '_labeled', value);
|
|
17882
17866
|
}
|
|
17883
17867
|
componentWillLoad() {
|
|
17884
|
-
this.validateAnimate(this._animate);
|
|
17885
17868
|
this.validateColor(this._color);
|
|
17886
17869
|
this.validateLabeled(this._labeled);
|
|
17887
17870
|
}
|
|
17888
|
-
componentDidRender() {
|
|
17889
|
-
clearInterval(this.interval);
|
|
17890
|
-
if (this.state._animate) {
|
|
17891
|
-
this.interval = setInterval(() => {
|
|
17892
|
-
this.state = Object.assign(Object.assign({}, this.state), { _color: {
|
|
17893
|
-
red: (this.state._color.red + 1) % max$1,
|
|
17894
|
-
green: (this.state._color.green + 2) % max$1,
|
|
17895
|
-
blue: (this.state._color.blue + 3) % max$1,
|
|
17896
|
-
} });
|
|
17897
|
-
}, 50);
|
|
17898
|
-
}
|
|
17899
|
-
}
|
|
17900
|
-
disconnectedCallback() {
|
|
17901
|
-
clearInterval(this.interval);
|
|
17902
|
-
}
|
|
17903
17871
|
static get watchers() { return {
|
|
17904
|
-
"_animate": ["validateAnimate"],
|
|
17905
17872
|
"_color": ["validateColor"],
|
|
17906
17873
|
"_labeled": ["validateLabeled"]
|
|
17907
17874
|
}; }
|
|
@@ -17912,7 +17879,6 @@ class KolKolibri {
|
|
|
17912
17879
|
"$flags$": 41,
|
|
17913
17880
|
"$tagName$": "kol-kolibri",
|
|
17914
17881
|
"$members$": {
|
|
17915
|
-
"_animate": [4],
|
|
17916
17882
|
"_color": [1],
|
|
17917
17883
|
"_labeled": [4],
|
|
17918
17884
|
"state": [32]
|
|
@@ -18756,16 +18722,16 @@ class KolModal {
|
|
|
18756
18722
|
componentDidRender() {
|
|
18757
18723
|
if (this.hostElement) {
|
|
18758
18724
|
if (this.state._activeElement) {
|
|
18759
|
-
|
|
18725
|
+
getKoliBri().Modal.openModal(this.hostElement, this.state._activeElement);
|
|
18760
18726
|
}
|
|
18761
18727
|
else {
|
|
18762
|
-
|
|
18728
|
+
getKoliBri().Modal.closeModal(this.hostElement);
|
|
18763
18729
|
}
|
|
18764
18730
|
}
|
|
18765
18731
|
}
|
|
18766
18732
|
disconnectedCallback() {
|
|
18767
18733
|
if (this.hostElement) {
|
|
18768
|
-
|
|
18734
|
+
getKoliBri().Modal.closeModal(this.hostElement);
|
|
18769
18735
|
}
|
|
18770
18736
|
}
|
|
18771
18737
|
render() {
|
|
@@ -35738,7 +35704,7 @@ registerComponents([
|
|
|
35738
35704
|
|
|
35739
35705
|
function prototypeKoliBri(name, cb) {
|
|
35740
35706
|
try {
|
|
35741
|
-
Object.defineProperty(
|
|
35707
|
+
Object.defineProperty(getKoliBri(), name, {
|
|
35742
35708
|
get: function () {
|
|
35743
35709
|
return cb;
|
|
35744
35710
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/hydrate",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.8",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": "https://github.com/public-ui/kolibri",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"hydrate"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@public-ui/components": "1.7.
|
|
45
|
+
"@public-ui/components": "1.7.8",
|
|
46
46
|
"rimraf": "3.0.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@public-ui/components": "1.7.
|
|
49
|
+
"@public-ui/components": "1.7.8"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"type": "commonjs",
|