@a11y-ui/core
Advanced tools
Comparing version 1.0.0-rc.13 to 1.0.0-rc.14
@@ -36,2 +36,3 @@ /// <reference types="node" /> | ||
}; | ||
type Stringified<T> = T | string; | ||
} |
@@ -5,2 +5,3 @@ "use strict"; | ||
const lib_1 = require("@leanup/lib"); | ||
const window_1 = require("./window"); | ||
let lockThemePatching = true; | ||
@@ -29,22 +30,26 @@ let warrentyWarning = false; | ||
} | ||
if (typeof window.A11yUi !== 'object' || window.A11yUi === null) { | ||
window.A11yUi = {}; | ||
if (typeof window_1.GLOBAL.A11yUi !== 'object' || window_1.GLOBAL.A11yUi === null) { | ||
window_1.GLOBAL.A11yUi = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && window.A11yUi !== null && (typeof window.A11yUi.Themes !== 'object' || window.A11yUi.Themes === null)) { | ||
window.A11yUi.Themes = {}; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
(typeof window_1.GLOBAL.A11yUi.Themes !== 'object' || | ||
window_1.GLOBAL.A11yUi.Themes === null)) { | ||
window_1.GLOBAL.A11yUi.Themes = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
(typeof window.A11yUi.Themes[themeName] !== 'object' || window.A11yUi.Themes[themeName] === null)) { | ||
window.A11yUi.Themes[themeName] = {}; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes !== null && | ||
(typeof window_1.GLOBAL.A11yUi.Themes[themeName] !== 'object' || | ||
window_1.GLOBAL.A11yUi.Themes[themeName] === null)) { | ||
window_1.GLOBAL.A11yUi.Themes[themeName] = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
typeof window.A11yUi.Themes[themeName] === 'object' && | ||
window.A11yUi.Themes[themeName] !== null) { | ||
window.A11yUi.Themes[themeName][tagName] = css; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes[themeName] === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes[themeName] !== null) { | ||
window_1.GLOBAL.A11yUi.Themes[themeName][tagName] = css; | ||
} | ||
@@ -84,10 +89,10 @@ }; | ||
const getThemeDetails = (element) => { | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Theme === 'object' && | ||
window.A11yUi.Theme !== null && | ||
typeof window.A11yUi.Theme.cache === 'boolean' && | ||
typeof window.A11yUi.Theme.name === 'string' && | ||
typeof window.A11yUi.Theme.reset === 'boolean') { | ||
return window.A11yUi.Theme; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme === 'object' && | ||
window_1.GLOBAL.A11yUi.Theme !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme.cache === 'boolean' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.name === 'string' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.reset === 'boolean') { | ||
return window_1.GLOBAL.A11yUi.Theme; | ||
} | ||
@@ -122,9 +127,9 @@ else { | ||
}; | ||
if ((typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Theme === 'object' && | ||
window.A11yUi.Theme !== null && | ||
typeof window.A11yUi.Theme.cache === 'boolean' && | ||
typeof window.A11yUi.Theme.name === 'string' && | ||
typeof window.A11yUi.Theme.reset === 'boolean') === false && | ||
if ((typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme === 'object' && | ||
window_1.GLOBAL.A11yUi.Theme !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme.cache === 'boolean' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.name === 'string' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.reset === 'boolean') === false && | ||
typeof themeName === 'string' && | ||
@@ -139,6 +144,6 @@ (options.name === undefined || themeName === options.name) && | ||
}); | ||
if (typeof window.A11yUi !== 'object' || window.A11yUi === null) { | ||
window.A11yUi = {}; | ||
if (typeof window_1.GLOBAL.A11yUi !== 'object' || window_1.GLOBAL.A11yUi === null) { | ||
window_1.GLOBAL.A11yUi = {}; | ||
} | ||
window.A11yUi.Theme = { | ||
window_1.GLOBAL.A11yUi.Theme = { | ||
cache: true, | ||
@@ -145,0 +150,0 @@ name: options.name || themeName, |
@@ -10,3 +10,3 @@ declare type RobustStoreSetItemOptions = { | ||
private constructor(); | ||
static getInstance(identifier: string, object?: Record<string, unknown>): RobustStore; | ||
static getInstance(identifier: string, object: Record<string, unknown>): RobustStore; | ||
private createStore; | ||
@@ -13,0 +13,0 @@ private recursiveSetItem; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RobustStore = void 0; | ||
const GLOBAL = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : {}; | ||
class RobustStore { | ||
@@ -9,3 +8,3 @@ constructor(object, identifier) { | ||
} | ||
static getInstance(identifier, object = GLOBAL) { | ||
static getInstance(identifier, object) { | ||
let instance = RobustStore.instances.get(identifier); | ||
@@ -12,0 +11,0 @@ if (instance === undefined) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setThemeStyle = void 0; | ||
const window_1 = require("./window"); | ||
const CSS_PROPERTIES_REGISTERED = new Set(); | ||
@@ -16,11 +17,11 @@ const CSS_STYLE_SHEETS = new Map(); | ||
else { | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
typeof window.A11yUi.Themes[themeName] === 'object' && | ||
window.A11yUi.Themes[themeName] !== null && | ||
typeof window.A11yUi.Themes[themeName][tagName] === 'string') { | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes[themeName] === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes[themeName] !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes[themeName][tagName] === 'string') { | ||
if ((tagName === 'GLOBAL' || tagName === 'PROPERTIES') && CSS_PROPERTIES_REGISTERED.has(themeName) === false) { | ||
let css = window.A11yUi.Themes[themeName][tagName]; | ||
let css = window_1.GLOBAL.A11yUi.Themes[themeName][tagName]; | ||
let properties = css.match(/--[^;]+/g); | ||
@@ -39,3 +40,3 @@ if (Array.isArray(properties)) { | ||
if (typeof style.replaceSync === 'function') { | ||
style.replaceSync(window.A11yUi.Themes[themeName][tagName]); | ||
style.replaceSync(window_1.GLOBAL.A11yUi.Themes[themeName][tagName]); | ||
} | ||
@@ -51,3 +52,3 @@ if (themeCache === true) { | ||
style = document.createElement('style'); | ||
style.innerHTML = window.A11yUi.Themes[themeName][tagName]; | ||
style.innerHTML = window_1.GLOBAL.A11yUi.Themes[themeName][tagName]; | ||
} | ||
@@ -54,0 +55,0 @@ return style; |
@@ -36,2 +36,3 @@ /// <reference types="node" /> | ||
}; | ||
type Stringified<T> = T | string; | ||
} |
import { Log } from '@leanup/lib'; | ||
import { GLOBAL } from './window'; | ||
let lockThemePatching = true; | ||
@@ -25,22 +26,26 @@ let warrentyWarning = false; | ||
} | ||
if (typeof window.A11yUi !== 'object' || window.A11yUi === null) { | ||
window.A11yUi = {}; | ||
if (typeof GLOBAL.A11yUi !== 'object' || GLOBAL.A11yUi === null) { | ||
GLOBAL.A11yUi = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && window.A11yUi !== null && (typeof window.A11yUi.Themes !== 'object' || window.A11yUi.Themes === null)) { | ||
window.A11yUi.Themes = {}; | ||
if (typeof GLOBAL.A11yUi === 'object' && | ||
GLOBAL.A11yUi !== null && | ||
(typeof GLOBAL.A11yUi.Themes !== 'object' || | ||
GLOBAL.A11yUi.Themes === null)) { | ||
GLOBAL.A11yUi.Themes = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
(typeof window.A11yUi.Themes[themeName] !== 'object' || window.A11yUi.Themes[themeName] === null)) { | ||
window.A11yUi.Themes[themeName] = {}; | ||
if (typeof GLOBAL.A11yUi === 'object' && | ||
GLOBAL.A11yUi !== null && | ||
typeof GLOBAL.A11yUi.Themes === 'object' && | ||
GLOBAL.A11yUi.Themes !== null && | ||
(typeof GLOBAL.A11yUi.Themes[themeName] !== 'object' || | ||
GLOBAL.A11yUi.Themes[themeName] === null)) { | ||
GLOBAL.A11yUi.Themes[themeName] = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
typeof window.A11yUi.Themes[themeName] === 'object' && | ||
window.A11yUi.Themes[themeName] !== null) { | ||
window.A11yUi.Themes[themeName][tagName] = css; | ||
if (typeof GLOBAL.A11yUi === 'object' && | ||
GLOBAL.A11yUi !== null && | ||
typeof GLOBAL.A11yUi.Themes === 'object' && | ||
GLOBAL.A11yUi.Themes !== null && | ||
typeof GLOBAL.A11yUi.Themes[themeName] === 'object' && | ||
GLOBAL.A11yUi.Themes[themeName] !== null) { | ||
GLOBAL.A11yUi.Themes[themeName][tagName] = css; | ||
} | ||
@@ -78,10 +83,10 @@ }; | ||
export const getThemeDetails = (element) => { | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Theme === 'object' && | ||
window.A11yUi.Theme !== null && | ||
typeof window.A11yUi.Theme.cache === 'boolean' && | ||
typeof window.A11yUi.Theme.name === 'string' && | ||
typeof window.A11yUi.Theme.reset === 'boolean') { | ||
return window.A11yUi.Theme; | ||
if (typeof GLOBAL.A11yUi === 'object' && | ||
GLOBAL.A11yUi !== null && | ||
typeof GLOBAL.A11yUi.Theme === 'object' && | ||
GLOBAL.A11yUi.Theme !== null && | ||
typeof GLOBAL.A11yUi.Theme.cache === 'boolean' && | ||
typeof GLOBAL.A11yUi.Theme.name === 'string' && | ||
typeof GLOBAL.A11yUi.Theme.reset === 'boolean') { | ||
return GLOBAL.A11yUi.Theme; | ||
} | ||
@@ -114,9 +119,9 @@ else { | ||
}; | ||
if ((typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Theme === 'object' && | ||
window.A11yUi.Theme !== null && | ||
typeof window.A11yUi.Theme.cache === 'boolean' && | ||
typeof window.A11yUi.Theme.name === 'string' && | ||
typeof window.A11yUi.Theme.reset === 'boolean') === false && | ||
if ((typeof GLOBAL.A11yUi === 'object' && | ||
GLOBAL.A11yUi !== null && | ||
typeof GLOBAL.A11yUi.Theme === 'object' && | ||
GLOBAL.A11yUi.Theme !== null && | ||
typeof GLOBAL.A11yUi.Theme.cache === 'boolean' && | ||
typeof GLOBAL.A11yUi.Theme.name === 'string' && | ||
typeof GLOBAL.A11yUi.Theme.reset === 'boolean') === false && | ||
typeof themeName === 'string' && | ||
@@ -131,6 +136,6 @@ (options.name === undefined || themeName === options.name) && | ||
}); | ||
if (typeof window.A11yUi !== 'object' || window.A11yUi === null) { | ||
window.A11yUi = {}; | ||
if (typeof GLOBAL.A11yUi !== 'object' || GLOBAL.A11yUi === null) { | ||
GLOBAL.A11yUi = {}; | ||
} | ||
window.A11yUi.Theme = { | ||
GLOBAL.A11yUi.Theme = { | ||
cache: true, | ||
@@ -137,0 +142,0 @@ name: options.name || themeName, |
@@ -10,3 +10,3 @@ declare type RobustStoreSetItemOptions = { | ||
private constructor(); | ||
static getInstance(identifier: string, object?: Record<string, unknown>): RobustStore; | ||
static getInstance(identifier: string, object: Record<string, unknown>): RobustStore; | ||
private createStore; | ||
@@ -13,0 +13,0 @@ private recursiveSetItem; |
@@ -1,2 +0,1 @@ | ||
const GLOBAL = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : {}; | ||
export class RobustStore { | ||
@@ -6,3 +5,3 @@ constructor(object, identifier) { | ||
} | ||
static getInstance(identifier, object = GLOBAL) { | ||
static getInstance(identifier, object) { | ||
let instance = RobustStore.instances.get(identifier); | ||
@@ -9,0 +8,0 @@ if (instance === undefined) { |
@@ -0,1 +1,2 @@ | ||
import { GLOBAL } from './window'; | ||
const CSS_PROPERTIES_REGISTERED = new Set(); | ||
@@ -13,11 +14,11 @@ const CSS_STYLE_SHEETS = new Map(); | ||
else { | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
typeof window.A11yUi.Themes[themeName] === 'object' && | ||
window.A11yUi.Themes[themeName] !== null && | ||
typeof window.A11yUi.Themes[themeName][tagName] === 'string') { | ||
if (typeof GLOBAL.A11yUi === 'object' && | ||
GLOBAL.A11yUi !== null && | ||
typeof GLOBAL.A11yUi.Themes === 'object' && | ||
GLOBAL.A11yUi.Themes !== null && | ||
typeof GLOBAL.A11yUi.Themes[themeName] === 'object' && | ||
GLOBAL.A11yUi.Themes[themeName] !== null && | ||
typeof GLOBAL.A11yUi.Themes[themeName][tagName] === 'string') { | ||
if ((tagName === 'GLOBAL' || tagName === 'PROPERTIES') && CSS_PROPERTIES_REGISTERED.has(themeName) === false) { | ||
let css = window.A11yUi.Themes[themeName][tagName]; | ||
let css = GLOBAL.A11yUi.Themes[themeName][tagName]; | ||
let properties = css.match(/--[^;]+/g); | ||
@@ -36,3 +37,3 @@ if (Array.isArray(properties)) { | ||
if (typeof style.replaceSync === 'function') { | ||
style.replaceSync(window.A11yUi.Themes[themeName][tagName]); | ||
style.replaceSync(GLOBAL.A11yUi.Themes[themeName][tagName]); | ||
} | ||
@@ -48,3 +49,3 @@ if (themeCache === true) { | ||
style = document.createElement('style'); | ||
style.innerHTML = window.A11yUi.Themes[themeName][tagName]; | ||
style.innerHTML = GLOBAL.A11yUi.Themes[themeName][tagName]; | ||
} | ||
@@ -51,0 +52,0 @@ return style; |
{ | ||
"name": "@a11y-ui/core", | ||
"version": "1.0.0-rc.13", | ||
"version": "1.0.0-rc.14", | ||
"license": "EUPL-1.2", | ||
@@ -5,0 +5,0 @@ "description": "Contains the generic types and utils to provide an overall web component architecture.", |
@@ -36,2 +36,3 @@ /// <reference types="node" /> | ||
}; | ||
type Stringified<T> = T | string; | ||
} |
@@ -10,3 +10,3 @@ declare type RobustStoreSetItemOptions = { | ||
private constructor(); | ||
static getInstance(identifier: string, object?: Record<string, unknown>): RobustStore; | ||
static getInstance(identifier: string, object: Record<string, unknown>): RobustStore; | ||
private createStore; | ||
@@ -13,0 +13,0 @@ private recursiveSetItem; |
@@ -36,2 +36,3 @@ /// <reference types="node" /> | ||
}; | ||
type Stringified<T> = T | string; | ||
} |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@leanup/lib"], factory); | ||
define(["require", "exports", "@leanup/lib", "./window"], factory); | ||
} | ||
@@ -15,2 +15,3 @@ })(function (require, exports) { | ||
const lib_1 = require("@leanup/lib"); | ||
const window_1 = require("./window"); | ||
let lockThemePatching = true; | ||
@@ -39,22 +40,26 @@ let warrentyWarning = false; | ||
} | ||
if (typeof window.A11yUi !== 'object' || window.A11yUi === null) { | ||
window.A11yUi = {}; | ||
if (typeof window_1.GLOBAL.A11yUi !== 'object' || window_1.GLOBAL.A11yUi === null) { | ||
window_1.GLOBAL.A11yUi = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && window.A11yUi !== null && (typeof window.A11yUi.Themes !== 'object' || window.A11yUi.Themes === null)) { | ||
window.A11yUi.Themes = {}; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
(typeof window_1.GLOBAL.A11yUi.Themes !== 'object' || | ||
window_1.GLOBAL.A11yUi.Themes === null)) { | ||
window_1.GLOBAL.A11yUi.Themes = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
(typeof window.A11yUi.Themes[themeName] !== 'object' || window.A11yUi.Themes[themeName] === null)) { | ||
window.A11yUi.Themes[themeName] = {}; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes !== null && | ||
(typeof window_1.GLOBAL.A11yUi.Themes[themeName] !== 'object' || | ||
window_1.GLOBAL.A11yUi.Themes[themeName] === null)) { | ||
window_1.GLOBAL.A11yUi.Themes[themeName] = {}; | ||
} | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
typeof window.A11yUi.Themes[themeName] === 'object' && | ||
window.A11yUi.Themes[themeName] !== null) { | ||
window.A11yUi.Themes[themeName][tagName] = css; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes[themeName] === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes[themeName] !== null) { | ||
window_1.GLOBAL.A11yUi.Themes[themeName][tagName] = css; | ||
} | ||
@@ -94,10 +99,10 @@ }; | ||
const getThemeDetails = (element) => { | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Theme === 'object' && | ||
window.A11yUi.Theme !== null && | ||
typeof window.A11yUi.Theme.cache === 'boolean' && | ||
typeof window.A11yUi.Theme.name === 'string' && | ||
typeof window.A11yUi.Theme.reset === 'boolean') { | ||
return window.A11yUi.Theme; | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme === 'object' && | ||
window_1.GLOBAL.A11yUi.Theme !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme.cache === 'boolean' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.name === 'string' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.reset === 'boolean') { | ||
return window_1.GLOBAL.A11yUi.Theme; | ||
} | ||
@@ -132,9 +137,9 @@ else { | ||
}; | ||
if ((typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Theme === 'object' && | ||
window.A11yUi.Theme !== null && | ||
typeof window.A11yUi.Theme.cache === 'boolean' && | ||
typeof window.A11yUi.Theme.name === 'string' && | ||
typeof window.A11yUi.Theme.reset === 'boolean') === false && | ||
if ((typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme === 'object' && | ||
window_1.GLOBAL.A11yUi.Theme !== null && | ||
typeof window_1.GLOBAL.A11yUi.Theme.cache === 'boolean' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.name === 'string' && | ||
typeof window_1.GLOBAL.A11yUi.Theme.reset === 'boolean') === false && | ||
typeof themeName === 'string' && | ||
@@ -149,6 +154,6 @@ (options.name === undefined || themeName === options.name) && | ||
}); | ||
if (typeof window.A11yUi !== 'object' || window.A11yUi === null) { | ||
window.A11yUi = {}; | ||
if (typeof window_1.GLOBAL.A11yUi !== 'object' || window_1.GLOBAL.A11yUi === null) { | ||
window_1.GLOBAL.A11yUi = {}; | ||
} | ||
window.A11yUi.Theme = { | ||
window_1.GLOBAL.A11yUi.Theme = { | ||
cache: true, | ||
@@ -155,0 +160,0 @@ name: options.name || themeName, |
@@ -10,3 +10,3 @@ declare type RobustStoreSetItemOptions = { | ||
private constructor(); | ||
static getInstance(identifier: string, object?: Record<string, unknown>): RobustStore; | ||
static getInstance(identifier: string, object: Record<string, unknown>): RobustStore; | ||
private createStore; | ||
@@ -13,0 +13,0 @@ private recursiveSetItem; |
@@ -13,3 +13,2 @@ (function (factory) { | ||
exports.RobustStore = void 0; | ||
const GLOBAL = typeof window === 'object' ? window : typeof global === 'object' ? global : typeof self === 'object' ? self : {}; | ||
class RobustStore { | ||
@@ -19,3 +18,3 @@ constructor(object, identifier) { | ||
} | ||
static getInstance(identifier, object = GLOBAL) { | ||
static getInstance(identifier, object) { | ||
let instance = RobustStore.instances.get(identifier); | ||
@@ -22,0 +21,0 @@ if (instance === undefined) { |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports"], factory); | ||
define(["require", "exports", "./window"], factory); | ||
} | ||
@@ -14,2 +14,3 @@ })(function (require, exports) { | ||
exports.setThemeStyle = void 0; | ||
const window_1 = require("./window"); | ||
const CSS_PROPERTIES_REGISTERED = new Set(); | ||
@@ -27,11 +28,11 @@ const CSS_STYLE_SHEETS = new Map(); | ||
else { | ||
if (typeof window.A11yUi === 'object' && | ||
window.A11yUi !== null && | ||
typeof window.A11yUi.Themes === 'object' && | ||
window.A11yUi.Themes !== null && | ||
typeof window.A11yUi.Themes[themeName] === 'object' && | ||
window.A11yUi.Themes[themeName] !== null && | ||
typeof window.A11yUi.Themes[themeName][tagName] === 'string') { | ||
if (typeof window_1.GLOBAL.A11yUi === 'object' && | ||
window_1.GLOBAL.A11yUi !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes[themeName] === 'object' && | ||
window_1.GLOBAL.A11yUi.Themes[themeName] !== null && | ||
typeof window_1.GLOBAL.A11yUi.Themes[themeName][tagName] === 'string') { | ||
if ((tagName === 'GLOBAL' || tagName === 'PROPERTIES') && CSS_PROPERTIES_REGISTERED.has(themeName) === false) { | ||
let css = window.A11yUi.Themes[themeName][tagName]; | ||
let css = window_1.GLOBAL.A11yUi.Themes[themeName][tagName]; | ||
let properties = css.match(/--[^;]+/g); | ||
@@ -50,3 +51,3 @@ if (Array.isArray(properties)) { | ||
if (typeof style.replaceSync === 'function') { | ||
style.replaceSync(window.A11yUi.Themes[themeName][tagName]); | ||
style.replaceSync(window_1.GLOBAL.A11yUi.Themes[themeName][tagName]); | ||
} | ||
@@ -62,3 +63,3 @@ if (themeCache === true) { | ||
style = document.createElement('style'); | ||
style.innerHTML = window.A11yUi.Themes[themeName][tagName]; | ||
style.innerHTML = window_1.GLOBAL.A11yUi.Themes[themeName][tagName]; | ||
} | ||
@@ -65,0 +66,0 @@ return style; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183627
123
2100