@genesislcap/design-system-configurator 14.451.2 → 14.451.3
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/163.163.31f9511f9f40e5bafbd7.js +2 -0
- package/dist/163.3287ce465168bd1310e4563d2d7599e1.js.map +1 -0
- package/dist/{621.621.6a11dbb3a0200f8da5b0.js → 224.224.43c837da250d9d5a5e22.js} +2 -2
- package/dist/224.4d6be1dd084c184e7922da944a0aba19.js.map +1 -0
- package/dist/{designSystemConfigurator.ea948a9808dfd00f30a87de4552ce4b5.js.map → designSystemConfigurator.e4c0faee10c849209dd80098c1036e7d.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/{main.5b934215a73db02895776c9724a48303.js.map → main.3afe4b7ac1d736db1a3d2d0f1053712c.js.map} +1 -1
- package/dist/{main.6c0b6f12e4db0ce14f72.js → main.40f4ab93dae991fad825.js} +2 -2
- package/dist/remoteEntry.js +2 -2
- package/package.json +13 -13
- package/dist/163.163.c55b13271bab6e09488a.js +0 -2
- package/dist/163.cc16a8b4baeb1fa09353eec1c3db5d8a.js.map +0 -1
- package/dist/621.0d45dd092611399502ff4bc317830f13.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"621.621.xxxxxxxxxxxxxxxxxxxx.js","mappings":"6OAAA,MAAAA,EAAA,CACAC,OAAAC,OAAAC,kBACAC,MAAA,EACAC,MAAA,EACAC,KAAA,EACAC,IAAA,EACAC,KAAA,EACAC,QAAA,EACAC,KAAA,EACAC,MAAA,EACAC,MAAA,EACAC,IAAA,EACAC,MAAA,EACAC,MAAA,EACAC,QAAAd,OAAAe,mBAEAC,EAAA,CAEAjB,OAAA,CACAkB,OAAA,GAGAf,MAAA,CACAe,MAAAnB,EAAAI,OAEAC,MAAA,CACAc,MAAAnB,EAAAK,OAGAC,KAAA,CACAa,MAAAnB,EAAAM,MAGAC,IAAA,CACAY,MAAAnB,EAAAO,KAGAC,KA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,CAAAb,GACA,UAAA9B,KAAAvB,KAAAL,QAAAO,UACAqB,EAAA3E,IAAAyG,EAAA,CACA1D,QAAAK,KAAAL,SAGA,EAEA,SAAAM,EAAA6E,EAAA/E,EAAA,GAA6CgF,EAAA,GAC7C,gBAAAD,EACAC,EAEA,iBAAAD,EACAA,EAEA/E,EAAA+E,SAAA,IAAA/E,EAAA+E,GAAAtH,MACAuC,EAAA+E,GAAAtH,MAEAuH,CACA,CACArF,EAAA/B,UAAAqH,IAAAtF,EAAA/B,UAAA2D,YACA5B,EAAA/B,UAAAsH,OAAAvF,EAAA/B,UAAA8D,eACA/B,EAAA/B,UAAAuH,MAAAxF,EAAA/B,UAAA8D,eACA/B,EAAA/B,UAAAwH,UAAAzF,EAAA/B,UAAAyD,QACA1B,EAAA/B,UAAAyH,KAAA1F,EAAA/B,UAAAkD,UACAnB,EAAA/B,UAAA0H,MAAA3F,EAAA/B,UAAAoF,UACArD,EAAA/B,UAAA2H,OAAA5F,EAAA/B,UAAAqF,WCxeO,MAAAuC,EAAA,CACP/H,MAAWnB,EAASc,OA+Bb,SAAAqI,EAAAC,EAAA9F,EAAA4F,GACP,MAAAG,EDwcA,SAAA/F,EAAA,IACA,WAAAD,EAAAC,EACA,CC1cmBgG,GAAavE,QAAAqE,QAChCG,KAAAjG,aAAA,EAAAA,EAAAnC,SACAkI,EAAAlI,MAAAmC,EAAAnC,OACA,MAAAqI,EAAAH,EAIA,OAHAG,EAAAC,WAAA,CAAAC,EAAAC,EAAA,uCAAAC,KACAJ,EAAAlJ,KAAA,2BAAoDoJ,OAAYC,IAAY,IAAMC,EAAA,8BAAqDA,KAAqB,MAE5JJ,CACA","sources":["webpack://@genesislcap/design-system-configurator/javascript/node_modules/consola/dist/core.mjs","webpack://@genesislcap/design-system-configurator/../foundation/foundation-logger/dist/esm/logger.js"],"sourcesContent":["const LogLevels = {\n silent: Number.NEGATIVE_INFINITY,\n fatal: 0,\n error: 0,\n warn: 1,\n log: 2,\n info: 3,\n success: 3,\n fail: 3,\n ready: 3,\n start: 3,\n box: 3,\n debug: 4,\n trace: 5,\n verbose: Number.POSITIVE_INFINITY\n};\nconst LogTypes = {\n // Silent\n silent: {\n level: -1\n },\n // Level 0\n fatal: {\n level: LogLevels.fatal\n },\n error: {\n level: LogLevels.error\n },\n // Level 1\n warn: {\n level: LogLevels.warn\n },\n // Level 2\n log: {\n level: LogLevels.log\n },\n // Level 3\n info: {\n level: LogLevels.info\n },\n success: {\n level: LogLevels.success\n },\n fail: {\n level: LogLevels.fail\n },\n ready: {\n level: LogLevels.info\n },\n start: {\n level: LogLevels.info\n },\n box: {\n level: LogLevels.info\n },\n // Level 4\n debug: {\n level: LogLevels.debug\n },\n // Level 5\n trace: {\n level: LogLevels.trace\n },\n // Verbose\n verbose: {\n level: LogLevels.verbose\n }\n};\n\nfunction isPlainObject$1(value) {\n if (value === null || typeof value !== \"object\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n if (Symbol.iterator in value) {\n return false;\n }\n if (Symbol.toStringTag in value) {\n return Object.prototype.toString.call(value) === \"[object Module]\";\n }\n return true;\n}\n\nfunction _defu(baseObject, defaults, namespace = \".\", merger) {\n if (!isPlainObject$1(defaults)) {\n return _defu(baseObject, {}, namespace, merger);\n }\n const object = Object.assign({}, defaults);\n for (const key in baseObject) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = baseObject[key];\n if (value === null || value === void 0) {\n continue;\n }\n if (merger && merger(object, key, value, namespace)) {\n continue;\n }\n if (Array.isArray(value) && Array.isArray(object[key])) {\n object[key] = [...value, ...object[key]];\n } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {\n object[key] = _defu(\n value,\n object[key],\n (namespace ? `${namespace}.` : \"\") + key.toString(),\n merger\n );\n } else {\n object[key] = value;\n }\n }\n return object;\n}\nfunction createDefu(merger) {\n return (...arguments_) => (\n // eslint-disable-next-line unicorn/no-array-reduce\n arguments_.reduce((p, c) => _defu(p, c, \"\", merger), {})\n );\n}\nconst defu = createDefu();\n\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === \"[object Object]\";\n}\nfunction isLogObj(arg) {\n if (!isPlainObject(arg)) {\n return false;\n }\n if (!arg.message && !arg.args) {\n return false;\n }\n if (arg.stack) {\n return false;\n }\n return true;\n}\n\nlet paused = false;\nconst queue = [];\nclass Consola {\n options;\n _lastLog;\n _mockFn;\n /**\n * Creates an instance of Consola with specified options or defaults.\n *\n * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.\n */\n constructor(options = {}) {\n const types = options.types || LogTypes;\n this.options = defu(\n {\n ...options,\n defaults: { ...options.defaults },\n level: _normalizeLogLevel(options.level, types),\n reporters: [...options.reporters || []]\n },\n {\n types: LogTypes,\n throttle: 1e3,\n throttleMin: 5,\n formatOptions: {\n date: true,\n colors: false,\n compact: true\n }\n }\n );\n for (const type in types) {\n const defaults = {\n type,\n ...this.options.defaults,\n ...types[type]\n };\n this[type] = this._wrapLogFn(defaults);\n this[type].raw = this._wrapLogFn(\n defaults,\n true\n );\n }\n if (this.options.mockFn) {\n this.mockTypes();\n }\n this._lastLog = {};\n }\n /**\n * Gets the current log level of the Consola instance.\n *\n * @returns {number} The current log level.\n */\n get level() {\n return this.options.level;\n }\n /**\n * Sets the minimum log level that will be output by the instance.\n *\n * @param {number} level - The new log level to set.\n */\n set level(level) {\n this.options.level = _normalizeLogLevel(\n level,\n this.options.types,\n this.options.level\n );\n }\n /**\n * Displays a prompt to the user and returns the response.\n * Throw an error if `prompt` is not supported by the current configuration.\n *\n * @template T\n * @param {string} message - The message to display in the prompt.\n * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.\n * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.\n */\n prompt(message, opts) {\n if (!this.options.prompt) {\n throw new Error(\"prompt is not supported!\");\n }\n return this.options.prompt(message, opts);\n }\n /**\n * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.\n *\n * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.\n * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.\n */\n create(options) {\n const instance = new Consola({\n ...this.options,\n ...options\n });\n if (this._mockFn) {\n instance.mockTypes(this._mockFn);\n }\n return instance;\n }\n /**\n * Creates a new Consola instance with the specified default log object properties.\n *\n * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.\n * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.\n */\n withDefaults(defaults) {\n return this.create({\n ...this.options,\n defaults: {\n ...this.options.defaults,\n ...defaults\n }\n });\n }\n /**\n * Creates a new Consola instance with a specified tag, which will be included in every log.\n *\n * @param {string} tag - The tag to include in each log of the new instance.\n * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.\n */\n withTag(tag) {\n return this.withDefaults({\n tag: this.options.defaults.tag ? this.options.defaults.tag + \":\" + tag : tag\n });\n }\n /**\n * Adds a custom reporter to the Consola instance.\n * Reporters will be called for each log message, depending on their implementation and log level.\n *\n * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.\n * @returns {Consola} The current Consola instance.\n */\n addReporter(reporter) {\n this.options.reporters.push(reporter);\n return this;\n }\n /**\n * Removes a custom reporter from the Consola instance.\n * If no reporter is specified, all reporters will be removed.\n *\n * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.\n * @returns {Consola} The current Consola instance.\n */\n removeReporter(reporter) {\n if (reporter) {\n const i = this.options.reporters.indexOf(reporter);\n if (i !== -1) {\n return this.options.reporters.splice(i, 1);\n }\n } else {\n this.options.reporters.splice(0);\n }\n return this;\n }\n /**\n * Replaces all reporters of the Consola instance with the specified array of reporters.\n *\n * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.\n * @returns {Consola} The current Consola instance.\n */\n setReporters(reporters) {\n this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];\n return this;\n }\n wrapAll() {\n this.wrapConsole();\n this.wrapStd();\n }\n restoreAll() {\n this.restoreConsole();\n this.restoreStd();\n }\n /**\n * Overrides console methods with Consola logging methods for consistent logging.\n */\n wrapConsole() {\n for (const type in this.options.types) {\n if (!console[\"__\" + type]) {\n console[\"__\" + type] = console[type];\n }\n console[type] = this[type].raw;\n }\n }\n /**\n * Restores the original console methods, removing Consola overrides.\n */\n restoreConsole() {\n for (const type in this.options.types) {\n if (console[\"__\" + type]) {\n console[type] = console[\"__\" + type];\n delete console[\"__\" + type];\n }\n }\n }\n /**\n * Overrides standard output and error streams to redirect them through Consola.\n */\n wrapStd() {\n this._wrapStream(this.options.stdout, \"log\");\n this._wrapStream(this.options.stderr, \"log\");\n }\n _wrapStream(stream, type) {\n if (!stream) {\n return;\n }\n if (!stream.__write) {\n stream.__write = stream.write;\n }\n stream.write = (data) => {\n this[type].raw(String(data).trim());\n };\n }\n /**\n * Restores the original standard output and error streams, removing the Consola redirection.\n */\n restoreStd() {\n this._restoreStream(this.options.stdout);\n this._restoreStream(this.options.stderr);\n }\n _restoreStream(stream) {\n if (!stream) {\n return;\n }\n if (stream.__write) {\n stream.write = stream.__write;\n delete stream.__write;\n }\n }\n /**\n * Pauses logging, queues incoming logs until resumed.\n */\n pauseLogs() {\n paused = true;\n }\n /**\n * Resumes logging, processing any queued logs.\n */\n resumeLogs() {\n paused = false;\n const _queue = queue.splice(0);\n for (const item of _queue) {\n item[0]._logFn(item[1], item[2]);\n }\n }\n /**\n * Replaces logging methods with mocks if a mock function is provided.\n *\n * @param {ConsolaOptions[\"mockFn\"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions[\"mockFn\"]}.\n */\n mockTypes(mockFn) {\n const _mockFn = mockFn || this.options.mockFn;\n this._mockFn = _mockFn;\n if (typeof _mockFn !== \"function\") {\n return;\n }\n for (const type in this.options.types) {\n this[type] = _mockFn(type, this.options.types[type]) || this[type];\n this[type].raw = this[type];\n }\n }\n _wrapLogFn(defaults, isRaw) {\n return (...args) => {\n if (paused) {\n queue.push([this, defaults, args, isRaw]);\n return;\n }\n return this._logFn(defaults, args, isRaw);\n };\n }\n _logFn(defaults, args, isRaw) {\n if ((defaults.level || 0) > this.level) {\n return false;\n }\n const logObj = {\n date: /* @__PURE__ */ new Date(),\n args: [],\n ...defaults,\n level: _normalizeLogLevel(defaults.level, this.options.types)\n };\n if (!isRaw && args.length === 1 && isLogObj(args[0])) {\n Object.assign(logObj, args[0]);\n } else {\n logObj.args = [...args];\n }\n if (logObj.message) {\n logObj.args.unshift(logObj.message);\n delete logObj.message;\n }\n if (logObj.additional) {\n if (!Array.isArray(logObj.additional)) {\n logObj.additional = logObj.additional.split(\"\\n\");\n }\n logObj.args.push(\"\\n\" + logObj.additional.join(\"\\n\"));\n delete logObj.additional;\n }\n logObj.type = typeof logObj.type === \"string\" ? logObj.type.toLowerCase() : \"log\";\n logObj.tag = typeof logObj.tag === \"string\" ? logObj.tag : \"\";\n const resolveLog = (newLog = false) => {\n const repeated = (this._lastLog.count || 0) - this.options.throttleMin;\n if (this._lastLog.object && repeated > 0) {\n const args2 = [...this._lastLog.object.args];\n if (repeated > 1) {\n args2.push(`(repeated ${repeated} times)`);\n }\n this._log({ ...this._lastLog.object, args: args2 });\n this._lastLog.count = 1;\n }\n if (newLog) {\n this._lastLog.object = logObj;\n this._log(logObj);\n }\n };\n clearTimeout(this._lastLog.timeout);\n const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;\n this._lastLog.time = logObj.date;\n if (diffTime < this.options.throttle) {\n try {\n const serializedLog = JSON.stringify([\n logObj.type,\n logObj.tag,\n logObj.args\n ]);\n const isSameLog = this._lastLog.serialized === serializedLog;\n this._lastLog.serialized = serializedLog;\n if (isSameLog) {\n this._lastLog.count = (this._lastLog.count || 0) + 1;\n if (this._lastLog.count > this.options.throttleMin) {\n this._lastLog.timeout = setTimeout(\n resolveLog,\n this.options.throttle\n );\n return;\n }\n }\n } catch {\n }\n }\n resolveLog(true);\n }\n _log(logObj) {\n for (const reporter of this.options.reporters) {\n reporter.log(logObj, {\n options: this.options\n });\n }\n }\n}\nfunction _normalizeLogLevel(input, types = {}, defaultLevel = 3) {\n if (input === void 0) {\n return defaultLevel;\n }\n if (typeof input === \"number\") {\n return input;\n }\n if (types[input] && types[input].level !== void 0) {\n return types[input].level;\n }\n return defaultLevel;\n}\nConsola.prototype.add = Consola.prototype.addReporter;\nConsola.prototype.remove = Consola.prototype.removeReporter;\nConsola.prototype.clear = Consola.prototype.removeReporter;\nConsola.prototype.withScope = Consola.prototype.withTag;\nConsola.prototype.mock = Consola.prototype.mockTypes;\nConsola.prototype.pause = Consola.prototype.pauseLogs;\nConsola.prototype.resume = Consola.prototype.resumeLogs;\nfunction createConsola(options = {}) {\n return new Consola(options);\n}\n\nexport { Consola, LogLevels, LogTypes, createConsola };\n","import { createConsola, LogLevels } from 'consola/core';\n/**\n * Used to set the logging level.\n *\n * @example Explicitly set the level of an imported package beyond the current runtime level.\n * ```ts\n * import { LogLevel } from '@genesislcap/foundation-logger';\n * import { logger as myPackageLogger } from 'my-package';\n * myPackageLogger.level = LogLevel.Error;\n * ```\n *\n * @public\n */\nexport { LogLevels } from 'consola/core';\n/**\n * The default logger options.\n * @public\n */\nexport const defaultLoggerOptions = {\n level: LogLevels.debug,\n};\n/**\n * Creates a logger with the given name and options.\n *\n * @example Create a logger in my-package/utils.\n * ```ts\n * import { createLogger } from '@genesislcap/foundation-logger';\n * export const logger = createLogger('my-package');\n * ```\n *\n * @example Using the logger within my-package.\n * ```ts\n * import { logger } from '../utils';\n * logger.debug(`Data retrieved from ${resourceName}`);\n * logger.info(this.toggled ? 'On' : 'Off');\n * logger.warn('Not available in this browser.');\n * ```\n *\n * @example Explicitly set the level of an imported package.\n * ```ts\n * import { logger as commsLogger } from '@genesislcap/foundation-comms';\n * import { LogLevel } from '@genesislcap/foundation-logger';\n * commsLogger.level = LogLevel.Warn;\n * ```\n *\n * @param name - The name to give the logger.\n * @param options - The options to use when creating the logger.\n * @returns The resulting logger.\n * @public\n */\nexport function createLogger(name, options = defaultLoggerOptions) {\n const logger = createConsola().withTag(name);\n if ((options === null || options === void 0 ? void 0 : options.level) !== undefined)\n logger.level = options.level;\n const typedLogger = logger;\n typedLogger.deprecated = (symbol, instruction = 'Consult docs for better alternative.', removalVersionTarget) => {\n typedLogger.warn(`Deprecated symbol used '${symbol}'. ${instruction}`, `${removalVersionTarget ? `Will be removed in version ${removalVersionTarget}.` : ''}`);\n };\n return typedLogger;\n}\n"],"names":["LogLevels","silent","Number","NEGATIVE_INFINITY","fatal","error","warn","log","info","success","fail","ready","start","box","debug","trace","verbose","POSITIVE_INFINITY","LogTypes","level","isPlainObject$1","value","prototype","Object","getPrototypeOf","Symbol","iterator","toStringTag","toString","call","_defu","baseObject","defaults","namespace","merger","object","assign","key","Array","isArray","defu","arguments_","reduce","p","c","isLogObj","arg","obj","message","args","stack","paused","queue","Consola","options","_lastLog","_mockFn","constructor","types","this","_normalizeLogLevel","reporters","throttle","throttleMin","formatOptions","date","colors","compact","type","_wrapLogFn","raw","mockFn","mockTypes","prompt","opts","Error","create","instance","withDefaults","withTag","tag","addReporter","reporter","push","removeReporter","i","indexOf","splice","setReporters","wrapAll","wrapConsole","wrapStd","restoreAll","restoreConsole","restoreStd","console","_wrapStream","stdout","stderr","stream","__write","write","data","String","trim","_restoreStream","pauseLogs","resumeLogs","_queue","item","_logFn","isRaw","logObj","Date","length","unshift","additional","split","join","toLowerCase","resolveLog","newLog","repeated","count","args2","_log","clearTimeout","timeout","diffTime","time","getTime","serializedLog","JSON","stringify","isSameLog","serialized","setTimeout","input","defaultLevel","add","remove","clear","withScope","mock","pause","resume","defaultLoggerOptions","createLogger","name","logger","createConsola","undefined","typedLogger","deprecated","symbol","instruction","removalVersionTarget"],"sourceRoot":""}
|