@udixio/theme 1.0.0-beta.12 → 1.0.0-beta.13
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/config/config.service.d.ts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/plugins/tailwind/main.d.ts +1 -1
- package/dist/theme.cjs.development.js +77 -460
- package/dist/theme.cjs.development.js.map +1 -1
- package/dist/theme.cjs.production.min.js +1 -1
- package/dist/theme.cjs.production.min.js.map +1 -1
- package/dist/theme.esm.js +77 -460
- package/dist/theme.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/config/config.service.ts +20 -5
- package/src/main.ts +2 -2
- package/src/plugins/tailwind/main.ts +2 -2
package/dist/main.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var awilix = require('awilix');
|
|
6
6
|
var materialColorUtilities = require('@material/material-color-utilities');
|
|
7
7
|
var path = require('path');
|
|
8
|
+
var node_fs = require('node:fs');
|
|
8
9
|
var plugin = require('tailwindcss/plugin');
|
|
9
10
|
|
|
10
11
|
var ColorService = /*#__PURE__*/function () {
|
|
@@ -67,31 +68,6 @@ function _arrayLikeToArray(r, a) {
|
|
|
67
68
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
68
69
|
return n;
|
|
69
70
|
}
|
|
70
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
71
|
-
try {
|
|
72
|
-
var i = n[a](c),
|
|
73
|
-
u = i.value;
|
|
74
|
-
} catch (n) {
|
|
75
|
-
return void e(n);
|
|
76
|
-
}
|
|
77
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
78
|
-
}
|
|
79
|
-
function _asyncToGenerator(n) {
|
|
80
|
-
return function () {
|
|
81
|
-
var t = this,
|
|
82
|
-
e = arguments;
|
|
83
|
-
return new Promise(function (r, o) {
|
|
84
|
-
var a = n.apply(t, e);
|
|
85
|
-
function _next(n) {
|
|
86
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
87
|
-
}
|
|
88
|
-
function _throw(n) {
|
|
89
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
90
|
-
}
|
|
91
|
-
_next(void 0);
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
71
|
function _defineProperties(e, r) {
|
|
96
72
|
for (var t = 0; t < r.length; t++) {
|
|
97
73
|
var o = r[t];
|
|
@@ -132,307 +108,6 @@ function _extends() {
|
|
|
132
108
|
function _inheritsLoose(t, o) {
|
|
133
109
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
134
110
|
}
|
|
135
|
-
function _regeneratorRuntime() {
|
|
136
|
-
_regeneratorRuntime = function () {
|
|
137
|
-
return e;
|
|
138
|
-
};
|
|
139
|
-
var t,
|
|
140
|
-
e = {},
|
|
141
|
-
r = Object.prototype,
|
|
142
|
-
n = r.hasOwnProperty,
|
|
143
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
144
|
-
t[e] = r.value;
|
|
145
|
-
},
|
|
146
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
147
|
-
a = i.iterator || "@@iterator",
|
|
148
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
149
|
-
u = i.toStringTag || "@@toStringTag";
|
|
150
|
-
function define(t, e, r) {
|
|
151
|
-
return Object.defineProperty(t, e, {
|
|
152
|
-
value: r,
|
|
153
|
-
enumerable: !0,
|
|
154
|
-
configurable: !0,
|
|
155
|
-
writable: !0
|
|
156
|
-
}), t[e];
|
|
157
|
-
}
|
|
158
|
-
try {
|
|
159
|
-
define({}, "");
|
|
160
|
-
} catch (t) {
|
|
161
|
-
define = function (t, e, r) {
|
|
162
|
-
return t[e] = r;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function wrap(t, e, r, n) {
|
|
166
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
167
|
-
a = Object.create(i.prototype),
|
|
168
|
-
c = new Context(n || []);
|
|
169
|
-
return o(a, "_invoke", {
|
|
170
|
-
value: makeInvokeMethod(t, r, c)
|
|
171
|
-
}), a;
|
|
172
|
-
}
|
|
173
|
-
function tryCatch(t, e, r) {
|
|
174
|
-
try {
|
|
175
|
-
return {
|
|
176
|
-
type: "normal",
|
|
177
|
-
arg: t.call(e, r)
|
|
178
|
-
};
|
|
179
|
-
} catch (t) {
|
|
180
|
-
return {
|
|
181
|
-
type: "throw",
|
|
182
|
-
arg: t
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
e.wrap = wrap;
|
|
187
|
-
var h = "suspendedStart",
|
|
188
|
-
l = "suspendedYield",
|
|
189
|
-
f = "executing",
|
|
190
|
-
s = "completed",
|
|
191
|
-
y = {};
|
|
192
|
-
function Generator() {}
|
|
193
|
-
function GeneratorFunction() {}
|
|
194
|
-
function GeneratorFunctionPrototype() {}
|
|
195
|
-
var p = {};
|
|
196
|
-
define(p, a, function () {
|
|
197
|
-
return this;
|
|
198
|
-
});
|
|
199
|
-
var d = Object.getPrototypeOf,
|
|
200
|
-
v = d && d(d(values([])));
|
|
201
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
202
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
203
|
-
function defineIteratorMethods(t) {
|
|
204
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
205
|
-
define(t, e, function (t) {
|
|
206
|
-
return this._invoke(e, t);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function AsyncIterator(t, e) {
|
|
211
|
-
function invoke(r, o, i, a) {
|
|
212
|
-
var c = tryCatch(t[r], t, o);
|
|
213
|
-
if ("throw" !== c.type) {
|
|
214
|
-
var u = c.arg,
|
|
215
|
-
h = u.value;
|
|
216
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
217
|
-
invoke("next", t, i, a);
|
|
218
|
-
}, function (t) {
|
|
219
|
-
invoke("throw", t, i, a);
|
|
220
|
-
}) : e.resolve(h).then(function (t) {
|
|
221
|
-
u.value = t, i(u);
|
|
222
|
-
}, function (t) {
|
|
223
|
-
return invoke("throw", t, i, a);
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
a(c.arg);
|
|
227
|
-
}
|
|
228
|
-
var r;
|
|
229
|
-
o(this, "_invoke", {
|
|
230
|
-
value: function (t, n) {
|
|
231
|
-
function callInvokeWithMethodAndArg() {
|
|
232
|
-
return new e(function (e, r) {
|
|
233
|
-
invoke(t, n, e, r);
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
function makeInvokeMethod(e, r, n) {
|
|
241
|
-
var o = h;
|
|
242
|
-
return function (i, a) {
|
|
243
|
-
if (o === f) throw Error("Generator is already running");
|
|
244
|
-
if (o === s) {
|
|
245
|
-
if ("throw" === i) throw a;
|
|
246
|
-
return {
|
|
247
|
-
value: t,
|
|
248
|
-
done: !0
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
for (n.method = i, n.arg = a;;) {
|
|
252
|
-
var c = n.delegate;
|
|
253
|
-
if (c) {
|
|
254
|
-
var u = maybeInvokeDelegate(c, n);
|
|
255
|
-
if (u) {
|
|
256
|
-
if (u === y) continue;
|
|
257
|
-
return u;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
261
|
-
if (o === h) throw o = s, n.arg;
|
|
262
|
-
n.dispatchException(n.arg);
|
|
263
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
264
|
-
o = f;
|
|
265
|
-
var p = tryCatch(e, r, n);
|
|
266
|
-
if ("normal" === p.type) {
|
|
267
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
268
|
-
return {
|
|
269
|
-
value: p.arg,
|
|
270
|
-
done: n.done
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
function maybeInvokeDelegate(e, r) {
|
|
278
|
-
var n = r.method,
|
|
279
|
-
o = e.iterator[n];
|
|
280
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
281
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
282
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
283
|
-
var a = i.arg;
|
|
284
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
285
|
-
}
|
|
286
|
-
function pushTryEntry(t) {
|
|
287
|
-
var e = {
|
|
288
|
-
tryLoc: t[0]
|
|
289
|
-
};
|
|
290
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
291
|
-
}
|
|
292
|
-
function resetTryEntry(t) {
|
|
293
|
-
var e = t.completion || {};
|
|
294
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
295
|
-
}
|
|
296
|
-
function Context(t) {
|
|
297
|
-
this.tryEntries = [{
|
|
298
|
-
tryLoc: "root"
|
|
299
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
300
|
-
}
|
|
301
|
-
function values(e) {
|
|
302
|
-
if (e || "" === e) {
|
|
303
|
-
var r = e[a];
|
|
304
|
-
if (r) return r.call(e);
|
|
305
|
-
if ("function" == typeof e.next) return e;
|
|
306
|
-
if (!isNaN(e.length)) {
|
|
307
|
-
var o = -1,
|
|
308
|
-
i = function next() {
|
|
309
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
310
|
-
return next.value = t, next.done = !0, next;
|
|
311
|
-
};
|
|
312
|
-
return i.next = i;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
316
|
-
}
|
|
317
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
318
|
-
value: GeneratorFunctionPrototype,
|
|
319
|
-
configurable: !0
|
|
320
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
321
|
-
value: GeneratorFunction,
|
|
322
|
-
configurable: !0
|
|
323
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
324
|
-
var e = "function" == typeof t && t.constructor;
|
|
325
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
326
|
-
}, e.mark = function (t) {
|
|
327
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
328
|
-
}, e.awrap = function (t) {
|
|
329
|
-
return {
|
|
330
|
-
__await: t
|
|
331
|
-
};
|
|
332
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
333
|
-
return this;
|
|
334
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
335
|
-
void 0 === i && (i = Promise);
|
|
336
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
337
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
338
|
-
return t.done ? t.value : a.next();
|
|
339
|
-
});
|
|
340
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
341
|
-
return this;
|
|
342
|
-
}), define(g, "toString", function () {
|
|
343
|
-
return "[object Generator]";
|
|
344
|
-
}), e.keys = function (t) {
|
|
345
|
-
var e = Object(t),
|
|
346
|
-
r = [];
|
|
347
|
-
for (var n in e) r.push(n);
|
|
348
|
-
return r.reverse(), function next() {
|
|
349
|
-
for (; r.length;) {
|
|
350
|
-
var t = r.pop();
|
|
351
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
352
|
-
}
|
|
353
|
-
return next.done = !0, next;
|
|
354
|
-
};
|
|
355
|
-
}, e.values = values, Context.prototype = {
|
|
356
|
-
constructor: Context,
|
|
357
|
-
reset: function (e) {
|
|
358
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
359
|
-
},
|
|
360
|
-
stop: function () {
|
|
361
|
-
this.done = !0;
|
|
362
|
-
var t = this.tryEntries[0].completion;
|
|
363
|
-
if ("throw" === t.type) throw t.arg;
|
|
364
|
-
return this.rval;
|
|
365
|
-
},
|
|
366
|
-
dispatchException: function (e) {
|
|
367
|
-
if (this.done) throw e;
|
|
368
|
-
var r = this;
|
|
369
|
-
function handle(n, o) {
|
|
370
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
371
|
-
}
|
|
372
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
373
|
-
var i = this.tryEntries[o],
|
|
374
|
-
a = i.completion;
|
|
375
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
376
|
-
if (i.tryLoc <= this.prev) {
|
|
377
|
-
var c = n.call(i, "catchLoc"),
|
|
378
|
-
u = n.call(i, "finallyLoc");
|
|
379
|
-
if (c && u) {
|
|
380
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
381
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
382
|
-
} else if (c) {
|
|
383
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
384
|
-
} else {
|
|
385
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
386
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
abrupt: function (t, e) {
|
|
392
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
393
|
-
var o = this.tryEntries[r];
|
|
394
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
395
|
-
var i = o;
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
400
|
-
var a = i ? i.completion : {};
|
|
401
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
402
|
-
},
|
|
403
|
-
complete: function (t, e) {
|
|
404
|
-
if ("throw" === t.type) throw t.arg;
|
|
405
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
406
|
-
},
|
|
407
|
-
finish: function (t) {
|
|
408
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
409
|
-
var r = this.tryEntries[e];
|
|
410
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
catch: function (t) {
|
|
414
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
415
|
-
var r = this.tryEntries[e];
|
|
416
|
-
if (r.tryLoc === t) {
|
|
417
|
-
var n = r.completion;
|
|
418
|
-
if ("throw" === n.type) {
|
|
419
|
-
var o = n.arg;
|
|
420
|
-
resetTryEntry(r);
|
|
421
|
-
}
|
|
422
|
-
return o;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
throw Error("illegal catch attempt");
|
|
426
|
-
},
|
|
427
|
-
delegateYield: function (e, r, n) {
|
|
428
|
-
return this.delegate = {
|
|
429
|
-
iterator: values(e),
|
|
430
|
-
resultName: r,
|
|
431
|
-
nextLoc: n
|
|
432
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
433
|
-
}
|
|
434
|
-
}, e;
|
|
435
|
-
}
|
|
436
111
|
function _setPrototypeOf(t, e) {
|
|
437
112
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
438
113
|
return t.__proto__ = e, t;
|
|
@@ -1828,93 +1503,72 @@ var ConfigService = /*#__PURE__*/function () {
|
|
|
1828
1503
|
this.appService = appService;
|
|
1829
1504
|
}
|
|
1830
1505
|
var _proto = ConfigService.prototype;
|
|
1831
|
-
_proto.loadConfig =
|
|
1832
|
-
var
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
Object.entries(palettes).forEach(function (_ref2) {
|
|
1862
|
-
var key = _ref2[0],
|
|
1863
|
-
value = _ref2[1];
|
|
1864
|
-
return themeService.addCustomPalette(key, value);
|
|
1865
|
-
});
|
|
1866
|
-
}
|
|
1867
|
-
if (useDefaultColors) {
|
|
1868
|
-
colorService.addColors(defaultColors);
|
|
1869
|
-
}
|
|
1870
|
-
if (colors) {
|
|
1871
|
-
colorService.addColors(colors);
|
|
1872
|
-
}
|
|
1873
|
-
if (plugins) {
|
|
1874
|
-
plugins.forEach(function (plugin) {
|
|
1875
|
-
if (Array.isArray(plugin)) {
|
|
1876
|
-
pluginService.addPlugin(plugin[0], plugin[1]);
|
|
1877
|
-
} else {
|
|
1878
|
-
pluginService.addPlugin(plugin, {});
|
|
1879
|
-
}
|
|
1880
|
-
});
|
|
1881
|
-
pluginService.loadPlugins(this.appService);
|
|
1882
|
-
}
|
|
1883
|
-
case 21:
|
|
1884
|
-
case "end":
|
|
1885
|
-
return _context.stop();
|
|
1886
|
-
}
|
|
1887
|
-
}, _callee, this);
|
|
1888
|
-
}));
|
|
1889
|
-
function loadConfig() {
|
|
1890
|
-
return _loadConfig.apply(this, arguments);
|
|
1506
|
+
_proto.loadConfig = function loadConfig() {
|
|
1507
|
+
var _this$appService = this.appService,
|
|
1508
|
+
themeService = _this$appService.themeService,
|
|
1509
|
+
colorService = _this$appService.colorService,
|
|
1510
|
+
pluginService = _this$appService.pluginService;
|
|
1511
|
+
var _this$getConfig = this.getConfig(),
|
|
1512
|
+
sourceColor = _this$getConfig.sourceColor,
|
|
1513
|
+
_this$getConfig$contr = _this$getConfig.contrastLevel,
|
|
1514
|
+
contrastLevel = _this$getConfig$contr === void 0 ? 0 : _this$getConfig$contr,
|
|
1515
|
+
_this$getConfig$isDar = _this$getConfig.isDark,
|
|
1516
|
+
isDark = _this$getConfig$isDar === void 0 ? false : _this$getConfig$isDar,
|
|
1517
|
+
_this$getConfig$varia = _this$getConfig.variant,
|
|
1518
|
+
variant = _this$getConfig$varia === void 0 ? VariantModel.tonalSpot : _this$getConfig$varia,
|
|
1519
|
+
palettes = _this$getConfig.palettes,
|
|
1520
|
+
colors = _this$getConfig.colors,
|
|
1521
|
+
_this$getConfig$useDe = _this$getConfig.useDefaultColors,
|
|
1522
|
+
useDefaultColors = _this$getConfig$useDe === void 0 ? true : _this$getConfig$useDe,
|
|
1523
|
+
plugins = _this$getConfig.plugins;
|
|
1524
|
+
themeService.create({
|
|
1525
|
+
contrastLevel: contrastLevel,
|
|
1526
|
+
isDark: isDark,
|
|
1527
|
+
sourceColorHex: sourceColor,
|
|
1528
|
+
variant: variant
|
|
1529
|
+
});
|
|
1530
|
+
if (palettes) {
|
|
1531
|
+
Object.entries(palettes).forEach(function (_ref2) {
|
|
1532
|
+
var key = _ref2[0],
|
|
1533
|
+
value = _ref2[1];
|
|
1534
|
+
return themeService.addCustomPalette(key, value);
|
|
1535
|
+
});
|
|
1891
1536
|
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
configImport = _context2.sent;
|
|
1905
|
-
config = configImport["default"];
|
|
1906
|
-
return _context2.abrupt("return", config);
|
|
1907
|
-
case 6:
|
|
1908
|
-
case "end":
|
|
1909
|
-
return _context2.stop();
|
|
1537
|
+
if (useDefaultColors) {
|
|
1538
|
+
colorService.addColors(defaultColors);
|
|
1539
|
+
}
|
|
1540
|
+
if (colors) {
|
|
1541
|
+
colorService.addColors(colors);
|
|
1542
|
+
}
|
|
1543
|
+
if (plugins) {
|
|
1544
|
+
plugins.forEach(function (plugin) {
|
|
1545
|
+
if (Array.isArray(plugin)) {
|
|
1546
|
+
pluginService.addPlugin(plugin[0], plugin[1]);
|
|
1547
|
+
} else {
|
|
1548
|
+
pluginService.addPlugin(plugin, {});
|
|
1910
1549
|
}
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1550
|
+
});
|
|
1551
|
+
pluginService.loadPlugins(this.appService);
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1554
|
+
_proto.getConfig = function getConfig() {
|
|
1555
|
+
var base = path.resolve(this.configPath);
|
|
1556
|
+
var extensions = ['.js', '.ts', '.jms', '.jcs'];
|
|
1557
|
+
var configImport = null;
|
|
1558
|
+
for (var _i = 0, _extensions = extensions; _i < _extensions.length; _i++) {
|
|
1559
|
+
var ext = _extensions[_i];
|
|
1560
|
+
var path$1 = base + ext;
|
|
1561
|
+
if (node_fs.existsSync(path$1)) {
|
|
1562
|
+
configImport = require(path$1);
|
|
1563
|
+
break;
|
|
1564
|
+
}
|
|
1915
1565
|
}
|
|
1916
|
-
|
|
1917
|
-
|
|
1566
|
+
if (!configImport) {
|
|
1567
|
+
throw new Error('Configuration file not found');
|
|
1568
|
+
}
|
|
1569
|
+
var config = configImport["default"];
|
|
1570
|
+
return config;
|
|
1571
|
+
};
|
|
1918
1572
|
return ConfigService;
|
|
1919
1573
|
}();
|
|
1920
1574
|
|
|
@@ -1969,28 +1623,11 @@ importContainer(AppContainer, [ConfigModule, AppModule, PluginModule, ColorModul
|
|
|
1969
1623
|
function bootstrap() {
|
|
1970
1624
|
return AppContainer.resolve('appService');
|
|
1971
1625
|
}
|
|
1972
|
-
function bootstrapFromConfig(
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
var configService;
|
|
1978
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1979
|
-
while (1) switch (_context.prev = _context.next) {
|
|
1980
|
-
case 0:
|
|
1981
|
-
configService = AppContainer.resolve('configService');
|
|
1982
|
-
if (path) configService.configPath = path;
|
|
1983
|
-
_context.next = 4;
|
|
1984
|
-
return configService.loadConfig();
|
|
1985
|
-
case 4:
|
|
1986
|
-
return _context.abrupt("return", AppContainer.resolve('appService'));
|
|
1987
|
-
case 5:
|
|
1988
|
-
case "end":
|
|
1989
|
-
return _context.stop();
|
|
1990
|
-
}
|
|
1991
|
-
}, _callee);
|
|
1992
|
-
}));
|
|
1993
|
-
return _bootstrapFromConfig.apply(this, arguments);
|
|
1626
|
+
function bootstrapFromConfig(path) {
|
|
1627
|
+
var configService = AppContainer.resolve('configService');
|
|
1628
|
+
if (path) configService.configPath = path;
|
|
1629
|
+
configService.loadConfig();
|
|
1630
|
+
return AppContainer.resolve('appService');
|
|
1994
1631
|
}
|
|
1995
1632
|
|
|
1996
1633
|
var PluginAbstract = function PluginAbstract() {};
|
|
@@ -2128,34 +1765,14 @@ var TailwindPlugin = /*#__PURE__*/function (_PluginAbstract) {
|
|
|
2128
1765
|
return TailwindPlugin;
|
|
2129
1766
|
}(PluginAbstract);
|
|
2130
1767
|
|
|
2131
|
-
var createTheme =
|
|
2132
|
-
var
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
case 2:
|
|
2140
|
-
app = _context.sent;
|
|
2141
|
-
plugin = app.pluginService.getPlugin(TailwindPlugin);
|
|
2142
|
-
if (plugin) {
|
|
2143
|
-
_context.next = 6;
|
|
2144
|
-
break;
|
|
2145
|
-
}
|
|
2146
|
-
throw new Error('Tailwind plugin not found');
|
|
2147
|
-
case 6:
|
|
2148
|
-
return _context.abrupt("return", plugin.getTheme());
|
|
2149
|
-
case 7:
|
|
2150
|
-
case "end":
|
|
2151
|
-
return _context.stop();
|
|
2152
|
-
}
|
|
2153
|
-
}, _callee);
|
|
2154
|
-
}));
|
|
2155
|
-
return function createTheme() {
|
|
2156
|
-
return _ref.apply(this, arguments);
|
|
2157
|
-
};
|
|
2158
|
-
}();
|
|
1768
|
+
var createTheme = function createTheme() {
|
|
1769
|
+
var app = bootstrapFromConfig();
|
|
1770
|
+
var plugin = app.pluginService.getPlugin(TailwindPlugin);
|
|
1771
|
+
if (!plugin) {
|
|
1772
|
+
throw new Error('Tailwind plugin not found');
|
|
1773
|
+
}
|
|
1774
|
+
return plugin.getTheme();
|
|
1775
|
+
};
|
|
2159
1776
|
|
|
2160
1777
|
exports.AppContainer = AppContainer;
|
|
2161
1778
|
exports.AppModule = AppModule;
|