@startinblox/core 0.19.22-beta.2 → 0.19.22-beta.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/index.js +665 -203
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -133,9 +133,416 @@ class Compositor {
|
|
|
133
133
|
return accessors;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
137
|
+
function getDefaultExportFromCjs(x) {
|
|
138
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
139
|
+
}
|
|
140
|
+
function getAugmentedNamespace(n) {
|
|
141
|
+
if (n.__esModule) return n;
|
|
142
|
+
var f = n.default;
|
|
143
|
+
if (typeof f == "function") {
|
|
144
|
+
var a = function a2() {
|
|
145
|
+
if (this instanceof a2) {
|
|
146
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
147
|
+
}
|
|
148
|
+
return f.apply(this, arguments);
|
|
149
|
+
};
|
|
150
|
+
a.prototype = f.prototype;
|
|
151
|
+
} else a = {};
|
|
152
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
153
|
+
Object.keys(n).forEach(function(k) {
|
|
154
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
155
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
156
|
+
enumerable: true,
|
|
157
|
+
get: function() {
|
|
158
|
+
return n[k];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
return a;
|
|
163
|
+
}
|
|
164
|
+
var loglevel = { exports: {} };
|
|
165
|
+
(function(module2) {
|
|
166
|
+
(function(root2, definition) {
|
|
167
|
+
if (module2.exports) {
|
|
168
|
+
module2.exports = definition();
|
|
169
|
+
} else {
|
|
170
|
+
root2.log = definition();
|
|
171
|
+
}
|
|
172
|
+
})(commonjsGlobal, function() {
|
|
173
|
+
var noop = function() {
|
|
174
|
+
};
|
|
175
|
+
var undefinedType = "undefined";
|
|
176
|
+
var isIE = typeof window !== undefinedType && typeof window.navigator !== undefinedType && /Trident\/|MSIE /.test(window.navigator.userAgent);
|
|
177
|
+
var logMethods = [
|
|
178
|
+
"trace",
|
|
179
|
+
"debug",
|
|
180
|
+
"info",
|
|
181
|
+
"warn",
|
|
182
|
+
"error"
|
|
183
|
+
];
|
|
184
|
+
var _loggersByName = {};
|
|
185
|
+
var defaultLogger = null;
|
|
186
|
+
function bindMethod(obj, methodName) {
|
|
187
|
+
var method = obj[methodName];
|
|
188
|
+
if (typeof method.bind === "function") {
|
|
189
|
+
return method.bind(obj);
|
|
190
|
+
} else {
|
|
191
|
+
try {
|
|
192
|
+
return Function.prototype.bind.call(method, obj);
|
|
193
|
+
} catch (e) {
|
|
194
|
+
return function() {
|
|
195
|
+
return Function.prototype.apply.apply(method, [obj, arguments]);
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function traceForIE() {
|
|
201
|
+
if (console.log) {
|
|
202
|
+
if (console.log.apply) {
|
|
203
|
+
console.log.apply(console, arguments);
|
|
204
|
+
} else {
|
|
205
|
+
Function.prototype.apply.apply(console.log, [console, arguments]);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (console.trace) console.trace();
|
|
209
|
+
}
|
|
210
|
+
function realMethod(methodName) {
|
|
211
|
+
if (methodName === "debug") {
|
|
212
|
+
methodName = "log";
|
|
213
|
+
}
|
|
214
|
+
if (typeof console === undefinedType) {
|
|
215
|
+
return false;
|
|
216
|
+
} else if (methodName === "trace" && isIE) {
|
|
217
|
+
return traceForIE;
|
|
218
|
+
} else if (console[methodName] !== void 0) {
|
|
219
|
+
return bindMethod(console, methodName);
|
|
220
|
+
} else if (console.log !== void 0) {
|
|
221
|
+
return bindMethod(console, "log");
|
|
222
|
+
} else {
|
|
223
|
+
return noop;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function replaceLoggingMethods() {
|
|
227
|
+
var level2 = this.getLevel();
|
|
228
|
+
for (var i = 0; i < logMethods.length; i++) {
|
|
229
|
+
var methodName = logMethods[i];
|
|
230
|
+
this[methodName] = i < level2 ? noop : this.methodFactory(methodName, level2, this.name);
|
|
231
|
+
}
|
|
232
|
+
this.log = this.debug;
|
|
233
|
+
if (typeof console === undefinedType && level2 < this.levels.SILENT) {
|
|
234
|
+
return "No console available for logging";
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function enableLoggingWhenConsoleArrives(methodName) {
|
|
238
|
+
return function() {
|
|
239
|
+
if (typeof console !== undefinedType) {
|
|
240
|
+
replaceLoggingMethods.call(this);
|
|
241
|
+
this[methodName].apply(this, arguments);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function defaultMethodFactory(methodName, _level, _loggerName) {
|
|
246
|
+
return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
|
|
247
|
+
}
|
|
248
|
+
function Logger(name, factory2) {
|
|
249
|
+
var self2 = this;
|
|
250
|
+
var inheritedLevel;
|
|
251
|
+
var defaultLevel;
|
|
252
|
+
var userLevel;
|
|
253
|
+
var storageKey = "loglevel";
|
|
254
|
+
if (typeof name === "string") {
|
|
255
|
+
storageKey += ":" + name;
|
|
256
|
+
} else if (typeof name === "symbol") {
|
|
257
|
+
storageKey = void 0;
|
|
258
|
+
}
|
|
259
|
+
function persistLevelIfPossible(levelNum) {
|
|
260
|
+
var levelName = (logMethods[levelNum] || "silent").toUpperCase();
|
|
261
|
+
if (typeof window === undefinedType || !storageKey) return;
|
|
262
|
+
try {
|
|
263
|
+
window.localStorage[storageKey] = levelName;
|
|
264
|
+
return;
|
|
265
|
+
} catch (ignore) {
|
|
266
|
+
}
|
|
267
|
+
try {
|
|
268
|
+
window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
|
|
269
|
+
} catch (ignore) {
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function getPersistedLevel() {
|
|
273
|
+
var storedLevel;
|
|
274
|
+
if (typeof window === undefinedType || !storageKey) return;
|
|
275
|
+
try {
|
|
276
|
+
storedLevel = window.localStorage[storageKey];
|
|
277
|
+
} catch (ignore) {
|
|
278
|
+
}
|
|
279
|
+
if (typeof storedLevel === undefinedType) {
|
|
280
|
+
try {
|
|
281
|
+
var cookie = window.document.cookie;
|
|
282
|
+
var cookieName = encodeURIComponent(storageKey);
|
|
283
|
+
var location2 = cookie.indexOf(cookieName + "=");
|
|
284
|
+
if (location2 !== -1) {
|
|
285
|
+
storedLevel = /^([^;]+)/.exec(
|
|
286
|
+
cookie.slice(location2 + cookieName.length + 1)
|
|
287
|
+
)[1];
|
|
288
|
+
}
|
|
289
|
+
} catch (ignore) {
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (self2.levels[storedLevel] === void 0) {
|
|
293
|
+
storedLevel = void 0;
|
|
294
|
+
}
|
|
295
|
+
return storedLevel;
|
|
296
|
+
}
|
|
297
|
+
function clearPersistedLevel() {
|
|
298
|
+
if (typeof window === undefinedType || !storageKey) return;
|
|
299
|
+
try {
|
|
300
|
+
window.localStorage.removeItem(storageKey);
|
|
301
|
+
} catch (ignore) {
|
|
302
|
+
}
|
|
303
|
+
try {
|
|
304
|
+
window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
305
|
+
} catch (ignore) {
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function normalizeLevel(input) {
|
|
309
|
+
var level2 = input;
|
|
310
|
+
if (typeof level2 === "string" && self2.levels[level2.toUpperCase()] !== void 0) {
|
|
311
|
+
level2 = self2.levels[level2.toUpperCase()];
|
|
312
|
+
}
|
|
313
|
+
if (typeof level2 === "number" && level2 >= 0 && level2 <= self2.levels.SILENT) {
|
|
314
|
+
return level2;
|
|
315
|
+
} else {
|
|
316
|
+
throw new TypeError("log.setLevel() called with invalid level: " + input);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
self2.name = name;
|
|
320
|
+
self2.levels = {
|
|
321
|
+
"TRACE": 0,
|
|
322
|
+
"DEBUG": 1,
|
|
323
|
+
"INFO": 2,
|
|
324
|
+
"WARN": 3,
|
|
325
|
+
"ERROR": 4,
|
|
326
|
+
"SILENT": 5
|
|
327
|
+
};
|
|
328
|
+
self2.methodFactory = factory2 || defaultMethodFactory;
|
|
329
|
+
self2.getLevel = function() {
|
|
330
|
+
if (userLevel != null) {
|
|
331
|
+
return userLevel;
|
|
332
|
+
} else if (defaultLevel != null) {
|
|
333
|
+
return defaultLevel;
|
|
334
|
+
} else {
|
|
335
|
+
return inheritedLevel;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
self2.setLevel = function(level2, persist) {
|
|
339
|
+
userLevel = normalizeLevel(level2);
|
|
340
|
+
if (persist !== false) {
|
|
341
|
+
persistLevelIfPossible(userLevel);
|
|
342
|
+
}
|
|
343
|
+
return replaceLoggingMethods.call(self2);
|
|
344
|
+
};
|
|
345
|
+
self2.setDefaultLevel = function(level2) {
|
|
346
|
+
defaultLevel = normalizeLevel(level2);
|
|
347
|
+
if (!getPersistedLevel()) {
|
|
348
|
+
self2.setLevel(level2, false);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
self2.resetLevel = function() {
|
|
352
|
+
userLevel = null;
|
|
353
|
+
clearPersistedLevel();
|
|
354
|
+
replaceLoggingMethods.call(self2);
|
|
355
|
+
};
|
|
356
|
+
self2.enableAll = function(persist) {
|
|
357
|
+
self2.setLevel(self2.levels.TRACE, persist);
|
|
358
|
+
};
|
|
359
|
+
self2.disableAll = function(persist) {
|
|
360
|
+
self2.setLevel(self2.levels.SILENT, persist);
|
|
361
|
+
};
|
|
362
|
+
self2.rebuild = function() {
|
|
363
|
+
if (defaultLogger !== self2) {
|
|
364
|
+
inheritedLevel = normalizeLevel(defaultLogger.getLevel());
|
|
365
|
+
}
|
|
366
|
+
replaceLoggingMethods.call(self2);
|
|
367
|
+
if (defaultLogger === self2) {
|
|
368
|
+
for (var childName in _loggersByName) {
|
|
369
|
+
_loggersByName[childName].rebuild();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
inheritedLevel = normalizeLevel(
|
|
374
|
+
defaultLogger ? defaultLogger.getLevel() : "WARN"
|
|
375
|
+
);
|
|
376
|
+
var initialLevel = getPersistedLevel();
|
|
377
|
+
if (initialLevel != null) {
|
|
378
|
+
userLevel = normalizeLevel(initialLevel);
|
|
379
|
+
}
|
|
380
|
+
replaceLoggingMethods.call(self2);
|
|
381
|
+
}
|
|
382
|
+
defaultLogger = new Logger();
|
|
383
|
+
defaultLogger.getLogger = function getLogger(name) {
|
|
384
|
+
if (typeof name !== "symbol" && typeof name !== "string" || name === "") {
|
|
385
|
+
throw new TypeError("You must supply a name when creating a logger.");
|
|
386
|
+
}
|
|
387
|
+
var logger = _loggersByName[name];
|
|
388
|
+
if (!logger) {
|
|
389
|
+
logger = _loggersByName[name] = new Logger(
|
|
390
|
+
name,
|
|
391
|
+
defaultLogger.methodFactory
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
return logger;
|
|
395
|
+
};
|
|
396
|
+
var _log = typeof window !== undefinedType ? window.log : void 0;
|
|
397
|
+
defaultLogger.noConflict = function() {
|
|
398
|
+
if (typeof window !== undefinedType && window.log === defaultLogger) {
|
|
399
|
+
window.log = _log;
|
|
400
|
+
}
|
|
401
|
+
return defaultLogger;
|
|
402
|
+
};
|
|
403
|
+
defaultLogger.getLoggers = function getLoggers() {
|
|
404
|
+
return _loggersByName;
|
|
405
|
+
};
|
|
406
|
+
defaultLogger["default"] = defaultLogger;
|
|
407
|
+
return defaultLogger;
|
|
408
|
+
});
|
|
409
|
+
})(loglevel);
|
|
410
|
+
var loglevelExports = loglevel.exports;
|
|
411
|
+
const log = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
|
|
412
|
+
const __vite_import_meta_env__ = { "BASE_URL": "./", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
|
|
413
|
+
const colors = {
|
|
414
|
+
reset: "\x1B[0m",
|
|
415
|
+
trace: "\x1B[38;2;169;169;169m",
|
|
416
|
+
// Gray
|
|
417
|
+
debug: "\x1B[38;2;0;0;255m",
|
|
418
|
+
// Blue
|
|
419
|
+
info: "\x1B[38;2;0;128;0m",
|
|
420
|
+
// Green
|
|
421
|
+
warn: "\x1B[38;2;218;165;32m",
|
|
422
|
+
// Yellow
|
|
423
|
+
error: "\x1B[38;2;255;0;0m"
|
|
424
|
+
// Red
|
|
425
|
+
};
|
|
426
|
+
function formatMessage(level2, messages) {
|
|
427
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
428
|
+
const color = colors[level2] || colors.reset;
|
|
429
|
+
const formattedMessages = messages.map((msg) => {
|
|
430
|
+
if (typeof msg === "object") {
|
|
431
|
+
try {
|
|
432
|
+
return JSON.stringify(msg, null, 2);
|
|
433
|
+
} catch (error2) {
|
|
434
|
+
return String(msg);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return String(msg);
|
|
438
|
+
}).join(" ");
|
|
439
|
+
return `${color}[${timestamp}] ${formattedMessages}${colors.reset}`;
|
|
440
|
+
}
|
|
441
|
+
var originalFactory = log.methodFactory;
|
|
442
|
+
log.methodFactory = function(methodName, logLevel, loggerName) {
|
|
443
|
+
const rawMethod = originalFactory(methodName, logLevel, loggerName);
|
|
444
|
+
return function(...messages) {
|
|
445
|
+
rawMethod(formatMessage(methodName, messages));
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
if ((__vite_import_meta_env__ == null ? void 0 : __vite_import_meta_env__.VITE_DEBUG) === "True") {
|
|
449
|
+
log.setLevel("debug");
|
|
450
|
+
} else {
|
|
451
|
+
log.setLevel("warn");
|
|
452
|
+
}
|
|
453
|
+
function trackRenderAsync(fn, context2) {
|
|
454
|
+
return async function(...args) {
|
|
455
|
+
let componentName = context2 ? context2 : this.name ? this.name : this.constructor.name;
|
|
456
|
+
if (this.element.id) {
|
|
457
|
+
componentName += ` (id: ${this.element.id})`;
|
|
458
|
+
} else if (this.dataSrc) {
|
|
459
|
+
componentName += ` (data-src: ${this.dataSrc})`;
|
|
460
|
+
} else if (this.resourceId) {
|
|
461
|
+
componentName += ` (resourceId: ${this.resourceId})`;
|
|
462
|
+
}
|
|
463
|
+
const startTime = performance.now();
|
|
464
|
+
const result = await fn.apply(this, args);
|
|
465
|
+
const endTime = performance.now();
|
|
466
|
+
const renderTime = endTime - startTime;
|
|
467
|
+
if (this.profiler) {
|
|
468
|
+
this.profiler.updateStats(componentName, renderTime);
|
|
469
|
+
this.profiler.printStats();
|
|
470
|
+
} else {
|
|
471
|
+
log.debug(`Component ${componentName} rendered in ${renderTime.toFixed(2)} ms`);
|
|
472
|
+
}
|
|
473
|
+
return result;
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
class Profiler {
|
|
477
|
+
constructor() {
|
|
478
|
+
this.stats = {};
|
|
479
|
+
this.stats = {};
|
|
480
|
+
}
|
|
481
|
+
getOrCreateStats(componentName) {
|
|
482
|
+
if (!this.stats[componentName]) {
|
|
483
|
+
this.stats[componentName] = {
|
|
484
|
+
renderCount: 0,
|
|
485
|
+
totalExecutionTime: 0,
|
|
486
|
+
lastExecutionTime: 0,
|
|
487
|
+
averageExecutionTime: 0,
|
|
488
|
+
minExecutionTime: Infinity,
|
|
489
|
+
maxExecutionTime: 0
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
return this.stats[componentName];
|
|
493
|
+
}
|
|
494
|
+
getStats(componentName) {
|
|
495
|
+
return this.stats[componentName];
|
|
496
|
+
}
|
|
497
|
+
updateStats(componentName, renderTime) {
|
|
498
|
+
const stats = this.getOrCreateStats(componentName);
|
|
499
|
+
stats.renderCount++;
|
|
500
|
+
stats.lastExecutionTime = renderTime;
|
|
501
|
+
stats.totalExecutionTime += renderTime;
|
|
502
|
+
stats.averageExecutionTime = stats.totalExecutionTime / stats.renderCount;
|
|
503
|
+
stats.minExecutionTime = Math.min(stats.minExecutionTime, renderTime);
|
|
504
|
+
stats.maxExecutionTime = Math.max(stats.maxExecutionTime, renderTime);
|
|
505
|
+
}
|
|
506
|
+
formatTime(time) {
|
|
507
|
+
if (time >= 1e3) {
|
|
508
|
+
return `${(time / 1e3).toFixed(2)} seconds`;
|
|
509
|
+
} else {
|
|
510
|
+
return `${time.toFixed(2)} ms`;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
formatComponentStats(componentName, stats) {
|
|
514
|
+
return `
|
|
515
|
+
Component: ${componentName}
|
|
516
|
+
Render Count: ${stats.renderCount}
|
|
517
|
+
Total Execution Time: ${this.formatTime(stats.totalExecutionTime)}
|
|
518
|
+
Last Execution Time: ${this.formatTime(stats.lastExecutionTime)}
|
|
519
|
+
Average Execution Time: ${this.formatTime(stats.averageExecutionTime)}
|
|
520
|
+
Min Execution Time: ${this.formatTime(stats.minExecutionTime)}
|
|
521
|
+
Max Execution Time: ${this.formatTime(stats.maxExecutionTime)}
|
|
522
|
+
`;
|
|
523
|
+
}
|
|
524
|
+
printStats(componentName) {
|
|
525
|
+
let output = "Component Performance Stats:\n";
|
|
526
|
+
if (componentName) {
|
|
527
|
+
const stats = this.stats[componentName];
|
|
528
|
+
if (!stats) {
|
|
529
|
+
output += `Component ${componentName} not found.
|
|
530
|
+
`;
|
|
531
|
+
} else {
|
|
532
|
+
output += this.formatComponentStats(componentName, stats);
|
|
533
|
+
}
|
|
534
|
+
} else {
|
|
535
|
+
for (const [name, stats] of Object.entries(this.stats)) {
|
|
536
|
+
output += this.formatComponentStats(name, stats);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
log.debug(output);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
136
542
|
class Component {
|
|
137
543
|
constructor(element) {
|
|
138
544
|
this.element = element;
|
|
545
|
+
this.profiler = new Profiler();
|
|
139
546
|
}
|
|
140
547
|
created() {
|
|
141
548
|
}
|
|
@@ -1265,6 +1672,69 @@ function preHTML(strings, ...values) {
|
|
|
1265
1672
|
});
|
|
1266
1673
|
return html$1(newStrings, ...dropIndices(values, needlessValues));
|
|
1267
1674
|
}
|
|
1675
|
+
class PostProcessorRegistry {
|
|
1676
|
+
constructor(currentPostProcessors = []) {
|
|
1677
|
+
this.currentPostProcessors = [...currentPostProcessors];
|
|
1678
|
+
}
|
|
1679
|
+
attach(callback, callbackName) {
|
|
1680
|
+
this.currentPostProcessors.push({ name: callbackName, fn: callback });
|
|
1681
|
+
}
|
|
1682
|
+
getPostProcessors() {
|
|
1683
|
+
return this.currentPostProcessors;
|
|
1684
|
+
}
|
|
1685
|
+
printCurrentCallbacks() {
|
|
1686
|
+
if (this.currentPostProcessors.length === 0) {
|
|
1687
|
+
console.log("No post-processors registered.");
|
|
1688
|
+
} else {
|
|
1689
|
+
console.log("Registered post-processors:");
|
|
1690
|
+
this.currentPostProcessors.forEach((proc) => {
|
|
1691
|
+
console.log(`- ${proc.name}`);
|
|
1692
|
+
});
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
getFormattedCallbacks() {
|
|
1696
|
+
if (this.currentPostProcessors.length === 0) {
|
|
1697
|
+
return "No post-processors registered.";
|
|
1698
|
+
} else {
|
|
1699
|
+
let formattedText = "Registered post-processors:\n";
|
|
1700
|
+
this.currentPostProcessors.forEach((proc) => {
|
|
1701
|
+
formattedText += `- ${proc.name}
|
|
1702
|
+
`;
|
|
1703
|
+
});
|
|
1704
|
+
return formattedText.trim();
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
static printFormattedCallbacks(currentPostProcessors) {
|
|
1708
|
+
if (currentPostProcessors.length === 0) {
|
|
1709
|
+
return "No post-processors registered.";
|
|
1710
|
+
} else {
|
|
1711
|
+
let formattedText = "Registered post-processors:\n";
|
|
1712
|
+
currentPostProcessors.forEach((proc) => {
|
|
1713
|
+
formattedText += `- ${proc.name}
|
|
1714
|
+
`;
|
|
1715
|
+
});
|
|
1716
|
+
return formattedText.trim();
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
whichCallbackExecutedNext() {
|
|
1720
|
+
if (this.currentPostProcessors.length === 0) {
|
|
1721
|
+
return "No post-processors registered.";
|
|
1722
|
+
} else {
|
|
1723
|
+
return `Next post-processor to be executed is: ${this.currentPostProcessors[0].name}`;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
deepCopy() {
|
|
1727
|
+
const copy2 = new PostProcessorRegistry(this.currentPostProcessors);
|
|
1728
|
+
return copy2;
|
|
1729
|
+
}
|
|
1730
|
+
shift() {
|
|
1731
|
+
const res = this.currentPostProcessors.shift();
|
|
1732
|
+
if (res) {
|
|
1733
|
+
return res.fn;
|
|
1734
|
+
}
|
|
1735
|
+
return void 0;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1268
1738
|
const BaseWidgetMixin = {
|
|
1269
1739
|
name: "widget-mixin",
|
|
1270
1740
|
use: [],
|
|
@@ -1300,20 +1770,20 @@ const BaseWidgetMixin = {
|
|
|
1300
1770
|
}
|
|
1301
1771
|
},
|
|
1302
1772
|
initialState: {
|
|
1303
|
-
listValueTransformations:
|
|
1304
|
-
listTemplateAdditions:
|
|
1773
|
+
listValueTransformations: new PostProcessorRegistry(),
|
|
1774
|
+
listTemplateAdditions: new PostProcessorRegistry(),
|
|
1305
1775
|
listAttributes: {},
|
|
1306
|
-
listCallbacks:
|
|
1776
|
+
listCallbacks: new PostProcessorRegistry(),
|
|
1307
1777
|
renderPlanned: false
|
|
1308
1778
|
},
|
|
1309
1779
|
get template() {
|
|
1310
1780
|
return null;
|
|
1311
1781
|
},
|
|
1312
1782
|
created() {
|
|
1313
|
-
this.listValueTransformations =
|
|
1783
|
+
this.listValueTransformations = new PostProcessorRegistry();
|
|
1314
1784
|
this.listAttributes = {};
|
|
1315
|
-
this.listTemplateAdditions =
|
|
1316
|
-
this.listCallbacks =
|
|
1785
|
+
this.listTemplateAdditions = new PostProcessorRegistry();
|
|
1786
|
+
this.listCallbacks = new PostProcessorRegistry();
|
|
1317
1787
|
this.subscription = null;
|
|
1318
1788
|
},
|
|
1319
1789
|
attached() {
|
|
@@ -1332,23 +1802,23 @@ const BaseWidgetMixin = {
|
|
|
1332
1802
|
}
|
|
1333
1803
|
},
|
|
1334
1804
|
render() {
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1337
|
-
const nextProcessor =
|
|
1338
|
-
nextProcessor(this.value,
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
nextCallback(this.value,
|
|
1805
|
+
const listValueTransformationsCopy = this.listValueTransformations.deepCopy();
|
|
1806
|
+
listValueTransformationsCopy.attach(this.renderTemplate.bind(this), "BaseWidgetMixin:renderTemplate");
|
|
1807
|
+
const nextProcessor = listValueTransformationsCopy.shift();
|
|
1808
|
+
nextProcessor(this.value, listValueTransformationsCopy);
|
|
1809
|
+
const listCallbacksCopy = this.listCallbacks.deepCopy();
|
|
1810
|
+
const nextCallback = listCallbacksCopy.shift();
|
|
1811
|
+
if (nextCallback) {
|
|
1812
|
+
nextCallback(this.value, listCallbacksCopy);
|
|
1343
1813
|
}
|
|
1344
1814
|
this.element.dispatchEvent(new CustomEvent("widgetRendered", { bubbles: true }));
|
|
1345
1815
|
},
|
|
1346
1816
|
renderTemplate(value) {
|
|
1347
1817
|
const template = this.template(value, { ...this.listAttributes });
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1350
|
-
const nextProcessor =
|
|
1351
|
-
nextProcessor(template,
|
|
1818
|
+
const listTemplateAdditionsCopy = this.listTemplateAdditions.deepCopy();
|
|
1819
|
+
listTemplateAdditionsCopy.attach(this.templateToDOM.bind(this), "BaseWidgetMixin:templateToDOM");
|
|
1820
|
+
const nextProcessor = listTemplateAdditionsCopy.shift();
|
|
1821
|
+
nextProcessor(template, listTemplateAdditionsCopy);
|
|
1352
1822
|
},
|
|
1353
1823
|
templateToDOM(template) {
|
|
1354
1824
|
render$1(template, this.element);
|
|
@@ -1430,34 +1900,6 @@ const defaultTemplates = {
|
|
|
1430
1900
|
dependencies: []
|
|
1431
1901
|
}
|
|
1432
1902
|
};
|
|
1433
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1434
|
-
function getDefaultExportFromCjs(x) {
|
|
1435
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1436
|
-
}
|
|
1437
|
-
function getAugmentedNamespace(n) {
|
|
1438
|
-
if (n.__esModule) return n;
|
|
1439
|
-
var f = n.default;
|
|
1440
|
-
if (typeof f == "function") {
|
|
1441
|
-
var a = function a2() {
|
|
1442
|
-
if (this instanceof a2) {
|
|
1443
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
1444
|
-
}
|
|
1445
|
-
return f.apply(this, arguments);
|
|
1446
|
-
};
|
|
1447
|
-
a.prototype = f.prototype;
|
|
1448
|
-
} else a = {};
|
|
1449
|
-
Object.defineProperty(a, "__esModule", { value: true });
|
|
1450
|
-
Object.keys(n).forEach(function(k) {
|
|
1451
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
1452
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
1453
|
-
enumerable: true,
|
|
1454
|
-
get: function() {
|
|
1455
|
-
return n[k];
|
|
1456
|
-
}
|
|
1457
|
-
});
|
|
1458
|
-
});
|
|
1459
|
-
return a;
|
|
1460
|
-
}
|
|
1461
1903
|
var jsonldContextParser = {};
|
|
1462
1904
|
var ContextParser$3 = {};
|
|
1463
1905
|
var g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || // eslint-disable-next-line no-undef
|
|
@@ -12099,7 +12541,7 @@ const EditableMixin = {
|
|
|
12099
12541
|
}
|
|
12100
12542
|
},
|
|
12101
12543
|
created() {
|
|
12102
|
-
this.listTemplateAdditions.
|
|
12544
|
+
this.listTemplateAdditions.attach(this.addEditButton.bind(this), "EditableMixin:addEditButton");
|
|
12103
12545
|
},
|
|
12104
12546
|
addEditButton(template, listTemplateAdditions) {
|
|
12105
12547
|
let newTemplate = null;
|
|
@@ -12518,7 +12960,7 @@ const MultipleFormMixin = {
|
|
|
12518
12960
|
}
|
|
12519
12961
|
},
|
|
12520
12962
|
created() {
|
|
12521
|
-
this.listValueTransformations.
|
|
12963
|
+
this.listValueTransformations.attach(this.setDataSrc.bind(this), "MultipleFormMixin:setDataSrc");
|
|
12522
12964
|
this.listAttributes["children"] = [];
|
|
12523
12965
|
this.listAttributes["addLabel"] = this.addLabel;
|
|
12524
12966
|
this.listAttributes["removeLabel"] = this.removeLabel;
|
|
@@ -12623,7 +13065,7 @@ const MultipleselectFormMixin = {
|
|
|
12623
13065
|
}
|
|
12624
13066
|
},
|
|
12625
13067
|
created() {
|
|
12626
|
-
this.listValueTransformations.
|
|
13068
|
+
this.listValueTransformations.attach(this.setDataSrc.bind(this), "MultipleselectFormMixin:setDataSrc");
|
|
12627
13069
|
},
|
|
12628
13070
|
setDataSrc(value, listValueTransformations) {
|
|
12629
13071
|
if (value && value !== this.dataSrc) {
|
|
@@ -12696,7 +13138,7 @@ const SorterMixin = {
|
|
|
12696
13138
|
randomOrder: null
|
|
12697
13139
|
},
|
|
12698
13140
|
attached() {
|
|
12699
|
-
this.listPostProcessors.
|
|
13141
|
+
this.listPostProcessors.attach(this.orderCallback.bind(this), "SorterMixin:orderCallback");
|
|
12700
13142
|
},
|
|
12701
13143
|
created() {
|
|
12702
13144
|
this.randomOrder = [];
|
|
@@ -12793,7 +13235,7 @@ const FederationMixin = {
|
|
|
12793
13235
|
containerFetched: null
|
|
12794
13236
|
},
|
|
12795
13237
|
attached() {
|
|
12796
|
-
this.listPostProcessors.
|
|
13238
|
+
this.listPostProcessors.attach(this.fetchSources.bind(this), "FederationMixin:fetchSources");
|
|
12797
13239
|
},
|
|
12798
13240
|
async fetchSources(resources, listPostProcessors, div2, context2) {
|
|
12799
13241
|
this.containerFetched = [];
|
|
@@ -12887,21 +13329,21 @@ const RangeMixin = {
|
|
|
12887
13329
|
}
|
|
12888
13330
|
},
|
|
12889
13331
|
initialState: {
|
|
12890
|
-
listPostProcessors:
|
|
13332
|
+
listPostProcessors: new PostProcessorRegistry()
|
|
12891
13333
|
},
|
|
12892
13334
|
created() {
|
|
12893
|
-
this.listPostProcessors =
|
|
13335
|
+
this.listPostProcessors = new PostProcessorRegistry();
|
|
12894
13336
|
this.listAttributes["optionLabel"] = this.optionLabel;
|
|
12895
13337
|
this.listAttributes["optionValue"] = this.optionValue;
|
|
12896
13338
|
},
|
|
12897
13339
|
async populate() {
|
|
12898
13340
|
const resources = this.resource ? this.resource["ldp:contains"] : [];
|
|
12899
|
-
const
|
|
12900
|
-
|
|
12901
|
-
const nextProcessor =
|
|
13341
|
+
const listPostProcessorsCopy = this.listPostProcessors.deepCopy();
|
|
13342
|
+
listPostProcessorsCopy.attach(this.setRangeAttribute.bind(this), "RangeMixin:setRangeAttribute");
|
|
13343
|
+
const nextProcessor = listPostProcessorsCopy.shift();
|
|
12902
13344
|
await nextProcessor(
|
|
12903
13345
|
resources,
|
|
12904
|
-
|
|
13346
|
+
listPostProcessorsCopy,
|
|
12905
13347
|
null,
|
|
12906
13348
|
this.dataSrc
|
|
12907
13349
|
);
|
|
@@ -14133,7 +14575,7 @@ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
14133
14575
|
const DateMixin = {
|
|
14134
14576
|
name: "date-mixin",
|
|
14135
14577
|
created() {
|
|
14136
|
-
this.listValueTransformations.
|
|
14578
|
+
this.listValueTransformations.attach(this.transformValue.bind(this), "DateMixin:transformValue");
|
|
14137
14579
|
},
|
|
14138
14580
|
transformValue(value, listValueTransformations) {
|
|
14139
14581
|
try {
|
|
@@ -14160,7 +14602,7 @@ const DateMixin = {
|
|
|
14160
14602
|
const DateTimeMixin = {
|
|
14161
14603
|
name: "date-time-mixin",
|
|
14162
14604
|
created() {
|
|
14163
|
-
this.listValueTransformations.
|
|
14605
|
+
this.listValueTransformations.attach(this.transformValue.bind(this), "DateTimeMixin:transformValue");
|
|
14164
14606
|
},
|
|
14165
14607
|
transformValue(value, listValueTransformations) {
|
|
14166
14608
|
const newValue = value ? new Date(value).toLocaleString() : value;
|
|
@@ -14199,7 +14641,7 @@ const unsafeHTML = directive((value) => (part2) => {
|
|
|
14199
14641
|
const MultilineMixin = {
|
|
14200
14642
|
name: "multiline-mixin",
|
|
14201
14643
|
created() {
|
|
14202
|
-
this.listValueTransformations.
|
|
14644
|
+
this.listValueTransformations.attach(this.transformValue.bind(this), "MultilineMixin:transformValue");
|
|
14203
14645
|
},
|
|
14204
14646
|
transformValue(value, listValueTransformations) {
|
|
14205
14647
|
const newValue = value ? unsafeHTML(value.replace(/\n/g, "<br/>")) : value;
|
|
@@ -19426,7 +19868,7 @@ const mila = /* @__PURE__ */ getDefaultExportFromCjs(markdownItLinkAttributes);
|
|
|
19426
19868
|
const MarkdownMixin = {
|
|
19427
19869
|
name: "markdown-mixin",
|
|
19428
19870
|
created() {
|
|
19429
|
-
this.listValueTransformations.
|
|
19871
|
+
this.listValueTransformations.attach(this.transformValue.bind(this), "MarkdownMixin:transformValue");
|
|
19430
19872
|
},
|
|
19431
19873
|
transformValue(value, listValueTransformations) {
|
|
19432
19874
|
let newValue = "";
|
|
@@ -19455,7 +19897,7 @@ const OembedMixin = {
|
|
|
19455
19897
|
existingOembed: null
|
|
19456
19898
|
},
|
|
19457
19899
|
created() {
|
|
19458
|
-
this.listValueTransformations.
|
|
19900
|
+
this.listValueTransformations.attach(this.transformValue.bind(this), "OembedMixin:transformValue");
|
|
19459
19901
|
},
|
|
19460
19902
|
async transformValue(value, listValueTransformations) {
|
|
19461
19903
|
if (!value) return;
|
|
@@ -21710,7 +22152,7 @@ function normalizeTruncateCfg(truncate) {
|
|
|
21710
22152
|
const AutolinkMixin = {
|
|
21711
22153
|
name: "autolink-mixin",
|
|
21712
22154
|
created() {
|
|
21713
|
-
this.listValueTransformations.
|
|
22155
|
+
this.listValueTransformations.attach(this.transformValue.bind(this), "AutolinkMixin:transformValue");
|
|
21714
22156
|
},
|
|
21715
22157
|
transformValue(value, listValueTransformations) {
|
|
21716
22158
|
const template = document.createElement("template");
|
|
@@ -21731,7 +22173,7 @@ const LabelMixin = {
|
|
|
21731
22173
|
name: "label-mixin",
|
|
21732
22174
|
created() {
|
|
21733
22175
|
this.listAttributes["id"] = uniqID();
|
|
21734
|
-
this.listTemplateAdditions.
|
|
22176
|
+
this.listTemplateAdditions.attach(this.addLabel.bind(this), "LabelMixin:addLabel");
|
|
21735
22177
|
},
|
|
21736
22178
|
addLabel(template, listTemplateAdditions) {
|
|
21737
22179
|
const newTemplate = html$1`
|
|
@@ -21745,7 +22187,7 @@ const LabelMixin = {
|
|
|
21745
22187
|
const LabelLastMixin = {
|
|
21746
22188
|
name: "label-last-mixin",
|
|
21747
22189
|
created() {
|
|
21748
|
-
this.listTemplateAdditions.
|
|
22190
|
+
this.listTemplateAdditions.attach(this.addLabelLast.bind(this), "LabelLastMixin:addLabelLast");
|
|
21749
22191
|
},
|
|
21750
22192
|
addLabelLast(template, listTemplateAdditions) {
|
|
21751
22193
|
const newTemplate = html$1`
|
|
@@ -21759,7 +22201,7 @@ const LabelLastMixin = {
|
|
|
21759
22201
|
const AddableMixin = {
|
|
21760
22202
|
name: "addable-mixin",
|
|
21761
22203
|
created() {
|
|
21762
|
-
this.listTemplateAdditions.
|
|
22204
|
+
this.listTemplateAdditions.attach(this.addableValue.bind(this), "AddableMixin:addableValue");
|
|
21763
22205
|
},
|
|
21764
22206
|
getAddableAttributes() {
|
|
21765
22207
|
const addableAttr = Array.from(this.element.attributes).filter((a) => a.name.startsWith("addable-"));
|
|
@@ -22535,7 +22977,7 @@ const AutocompletionMixin = {
|
|
|
22535
22977
|
importInlineCSS("slimselect", () => import("./slimselect-DIo2l9XQ.js"));
|
|
22536
22978
|
this.slimSelect = null;
|
|
22537
22979
|
this.addToAttributes(true, "autocomplete");
|
|
22538
|
-
this.listCallbacks.
|
|
22980
|
+
this.listCallbacks.attach(this.addCallback.bind(this), "AutocompletionMixin:addCallback");
|
|
22539
22981
|
},
|
|
22540
22982
|
detached() {
|
|
22541
22983
|
if (this.slimSelect) this.slimSelect.destroy();
|
|
@@ -46594,7 +47036,7 @@ const RichtextMixin = {
|
|
|
46594
47036
|
created() {
|
|
46595
47037
|
importInlineCSS("quill", () => import("./quill.snow-B73wIbzm.js"));
|
|
46596
47038
|
this.quill = null;
|
|
46597
|
-
this.listCallbacks.
|
|
47039
|
+
this.listCallbacks.attach(this.addCallback.bind(this), "RichtextMixin:addCallback");
|
|
46598
47040
|
},
|
|
46599
47041
|
getPlaceHolderValue() {
|
|
46600
47042
|
return this.element.hasAttribute("placeholder") ? this.element.getAttribute("placeholder") : "";
|
|
@@ -47176,12 +47618,12 @@ const ListMixin = {
|
|
|
47176
47618
|
},
|
|
47177
47619
|
initialState: {
|
|
47178
47620
|
// Processors functions to execute on the list before rendering
|
|
47179
|
-
listPostProcessors:
|
|
47621
|
+
listPostProcessors: new PostProcessorRegistry(),
|
|
47180
47622
|
// Rendering to execute after all the processors have been executed
|
|
47181
47623
|
renderCallbacks: []
|
|
47182
47624
|
},
|
|
47183
47625
|
created() {
|
|
47184
|
-
this.listPostProcessors =
|
|
47626
|
+
this.listPostProcessors = new PostProcessorRegistry();
|
|
47185
47627
|
this.renderCallbacks = [];
|
|
47186
47628
|
},
|
|
47187
47629
|
appendSingleElt(parent) {
|
|
@@ -47200,6 +47642,7 @@ const ListMixin = {
|
|
|
47200
47642
|
},
|
|
47201
47643
|
async populate() {
|
|
47202
47644
|
var _a2, _b, _c, _d;
|
|
47645
|
+
const listPostProcessorsCopy = this.listPostProcessors.deepCopy();
|
|
47203
47646
|
const div2 = this.div;
|
|
47204
47647
|
if (!this.resource) return;
|
|
47205
47648
|
if (!((_b = (_a2 = this.resource).isContainer) == null ? void 0 : _b.call(_a2)) && !this.arrayField && !this.predicateName) {
|
|
@@ -47209,27 +47652,25 @@ const ListMixin = {
|
|
|
47209
47652
|
}
|
|
47210
47653
|
if ((_d = (_c = this.resource).isContainer) == null ? void 0 : _d.call(_c)) {
|
|
47211
47654
|
this.setElementAttribute("container");
|
|
47212
|
-
const listPostProcessors = [...this.listPostProcessors];
|
|
47213
47655
|
this.renderCallbacks = [];
|
|
47214
|
-
|
|
47215
|
-
|
|
47216
|
-
const nextProcessor =
|
|
47656
|
+
listPostProcessorsCopy.attach(this.renderDOM.bind(this), "ListMixin:renderDOM");
|
|
47657
|
+
listPostProcessorsCopy.attach(this.handleEmptyWidget.bind(this), "ListMixin:handleEmptyWidget");
|
|
47658
|
+
const nextProcessor = listPostProcessorsCopy.shift();
|
|
47217
47659
|
await nextProcessor(
|
|
47218
47660
|
this.resource["ldp:contains"],
|
|
47219
|
-
|
|
47661
|
+
listPostProcessorsCopy,
|
|
47220
47662
|
div2,
|
|
47221
47663
|
this.dataSrc
|
|
47222
47664
|
);
|
|
47223
47665
|
} else if (this.arrayField && this.predicateName && this.resource[this.predicateName]) {
|
|
47224
47666
|
this.setElementAttribute("container");
|
|
47225
|
-
const listPostProcessors = [...this.listPostProcessors];
|
|
47226
47667
|
this.renderCallbacks = [];
|
|
47227
|
-
|
|
47228
|
-
|
|
47229
|
-
const nextProcessor =
|
|
47668
|
+
listPostProcessorsCopy.attach(this.renderDOM.bind(this), "ListMixin:renderDOM");
|
|
47669
|
+
listPostProcessorsCopy.attach(this.handleEmptyWidget.bind(this), "ListMixin:handleEmptyWidget");
|
|
47670
|
+
const nextProcessor = listPostProcessorsCopy.shift();
|
|
47230
47671
|
await nextProcessor(
|
|
47231
47672
|
await this.resource[this.predicateName],
|
|
47232
|
-
|
|
47673
|
+
listPostProcessorsCopy,
|
|
47233
47674
|
div2,
|
|
47234
47675
|
this.dataSrc
|
|
47235
47676
|
);
|
|
@@ -47307,7 +47748,7 @@ const PaginateMixin = {
|
|
|
47307
47748
|
this.currentPage = [];
|
|
47308
47749
|
},
|
|
47309
47750
|
attached() {
|
|
47310
|
-
this.listPostProcessors.
|
|
47751
|
+
this.listPostProcessors.attach(this.paginateCallback.bind(this), "PaginateMixin:paginateCallback");
|
|
47311
47752
|
},
|
|
47312
47753
|
async paginateCallback(resources, listPostProcessors, div2, context2) {
|
|
47313
47754
|
if (this.paginateBy > 0) {
|
|
@@ -47605,7 +48046,7 @@ const FilterMixin = {
|
|
|
47605
48046
|
if (!this.searchForm) throw `#${filteredBy} is not in DOM`;
|
|
47606
48047
|
this.searchForm.addEventListener("formChange", () => this.onServerSearchChange());
|
|
47607
48048
|
} else {
|
|
47608
|
-
this.listPostProcessors.
|
|
48049
|
+
this.listPostProcessors.attach(this.filterCallback.bind(this), "FilterMixin:filterCallback");
|
|
47609
48050
|
}
|
|
47610
48051
|
},
|
|
47611
48052
|
get filters() {
|
|
@@ -47719,7 +48160,7 @@ const CounterMixin = {
|
|
|
47719
48160
|
parentCounterDiv: null
|
|
47720
48161
|
},
|
|
47721
48162
|
attached() {
|
|
47722
|
-
this.listPostProcessors.
|
|
48163
|
+
this.listPostProcessors.attach(this.countResources.bind(this), "CounterMixin:countResources");
|
|
47723
48164
|
},
|
|
47724
48165
|
async countResources(resources, listPostProcessors, div2, context2) {
|
|
47725
48166
|
if (this.counterTemplate) {
|
|
@@ -47781,7 +48222,7 @@ const GrouperMixin = {
|
|
|
47781
48222
|
}
|
|
47782
48223
|
},
|
|
47783
48224
|
attached() {
|
|
47784
|
-
this.listPostProcessors.
|
|
48225
|
+
this.listPostProcessors.attach(this.groupResources.bind(this), "GrouperMixin:groupResources");
|
|
47785
48226
|
},
|
|
47786
48227
|
async groupResources(resources, listPostProcessors, div2, context2) {
|
|
47787
48228
|
const nextProcessor = listPostProcessors.shift();
|
|
@@ -47805,7 +48246,7 @@ const GrouperMixin = {
|
|
|
47805
48246
|
if (nextProcessor) await nextProcessor(
|
|
47806
48247
|
groups[group].resources,
|
|
47807
48248
|
// give only resources from group
|
|
47808
|
-
|
|
48249
|
+
listPostProcessors.deepCopy(),
|
|
47809
48250
|
// copy post processors
|
|
47810
48251
|
parent,
|
|
47811
48252
|
// parent is group widget
|
|
@@ -47841,7 +48282,7 @@ const HighlighterMixin = {
|
|
|
47841
48282
|
name: "highlighter-mixin",
|
|
47842
48283
|
use: [],
|
|
47843
48284
|
attached() {
|
|
47844
|
-
this.listPostProcessors.
|
|
48285
|
+
this.listPostProcessors.attach(this.hightlightCallback.bind(this), "HighlighterMixin:hightlightCallback");
|
|
47845
48286
|
},
|
|
47846
48287
|
async hightlightCallback(resources, listPostProcessors, div2, context2) {
|
|
47847
48288
|
for (let attr of this.element.attributes) {
|
|
@@ -47894,7 +48335,7 @@ const RequiredMixin = {
|
|
|
47894
48335
|
name: "required-mixin",
|
|
47895
48336
|
use: [],
|
|
47896
48337
|
attached() {
|
|
47897
|
-
this.listPostProcessors.
|
|
48338
|
+
this.listPostProcessors.attach(this.requiredResources.bind(this), "RequiredMixin:requiredResources");
|
|
47898
48339
|
},
|
|
47899
48340
|
async requiredResources(resources, listPostProcessors, div2, context2) {
|
|
47900
48341
|
const displays = [];
|
|
@@ -48039,7 +48480,7 @@ const SolidDisplay = {
|
|
|
48039
48480
|
* @param div
|
|
48040
48481
|
* @param context
|
|
48041
48482
|
*/
|
|
48042
|
-
async
|
|
48483
|
+
renderDOM: trackRenderAsync(async function(resources, listPostProcessors, div2, context2) {
|
|
48043
48484
|
const attributes = this.getChildAttributes();
|
|
48044
48485
|
const template = html$1`${resources.map((r) => r ? this.getChildTemplate(r["@id"], attributes) : null)}`;
|
|
48045
48486
|
render$1(template, div2);
|
|
@@ -48051,7 +48492,7 @@ const SolidDisplay = {
|
|
|
48051
48492
|
div2,
|
|
48052
48493
|
context2
|
|
48053
48494
|
);
|
|
48054
|
-
},
|
|
48495
|
+
}, "SolidDisplay:renderDom"),
|
|
48055
48496
|
/**
|
|
48056
48497
|
* Get attributes to dispatch to children from current element
|
|
48057
48498
|
*/
|
|
@@ -49044,29 +49485,32 @@ const SolidForm = {
|
|
|
49044
49485
|
</div>
|
|
49045
49486
|
`;
|
|
49046
49487
|
},
|
|
49047
|
-
|
|
49048
|
-
|
|
49049
|
-
|
|
49050
|
-
|
|
49051
|
-
|
|
49052
|
-
|
|
49053
|
-
|
|
49054
|
-
|
|
49055
|
-
|
|
49056
|
-
|
|
49057
|
-
|
|
49058
|
-
|
|
49488
|
+
populate: trackRenderAsync(
|
|
49489
|
+
async function() {
|
|
49490
|
+
this.element.oninput = () => this.onInput();
|
|
49491
|
+
this.element.onchange = () => this.onChange();
|
|
49492
|
+
const fields = await this.getFields();
|
|
49493
|
+
const widgetTemplates = await Promise.all(fields.map((field) => this.createWidgetTemplate(field)));
|
|
49494
|
+
const template = html$1`
|
|
49495
|
+
<div data-id="error"></div>
|
|
49496
|
+
${!this.isNaked ? html$1`
|
|
49497
|
+
<form
|
|
49498
|
+
@submit=${this.onSubmit.bind(this)}
|
|
49499
|
+
@reset=${this.onReset.bind(this)}
|
|
49500
|
+
>
|
|
49501
|
+
${widgetTemplates}
|
|
49502
|
+
${!this.isSavingAutomatically ? this.getSubmitTemplate() : ""}
|
|
49503
|
+
${this.element.hasAttribute("reset") ? html$1`<input type="reset" />` : ""}
|
|
49504
|
+
</form>
|
|
49505
|
+
` : html$1`
|
|
49059
49506
|
${widgetTemplates}
|
|
49060
|
-
|
|
49061
|
-
|
|
49062
|
-
|
|
49063
|
-
|
|
49064
|
-
|
|
49065
|
-
|
|
49066
|
-
|
|
49067
|
-
`;
|
|
49068
|
-
render$1(template, this.element);
|
|
49069
|
-
}
|
|
49507
|
+
`}
|
|
49508
|
+
${this.getModalDialog()}
|
|
49509
|
+
`;
|
|
49510
|
+
render$1(template, this.element);
|
|
49511
|
+
},
|
|
49512
|
+
"SolidForm:populate"
|
|
49513
|
+
)
|
|
49070
49514
|
};
|
|
49071
49515
|
Sib.register(SolidForm);
|
|
49072
49516
|
const SolidFormSearch = {
|
|
@@ -49254,26 +49698,29 @@ const SolidFormSearch = {
|
|
|
49254
49698
|
this.inputChange(input);
|
|
49255
49699
|
}, this.debounce);
|
|
49256
49700
|
},
|
|
49257
|
-
|
|
49258
|
-
|
|
49259
|
-
|
|
49260
|
-
this.
|
|
49261
|
-
|
|
49262
|
-
|
|
49263
|
-
|
|
49264
|
-
|
|
49265
|
-
|
|
49266
|
-
|
|
49267
|
-
|
|
49268
|
-
|
|
49269
|
-
|
|
49270
|
-
|
|
49271
|
-
|
|
49272
|
-
|
|
49273
|
-
|
|
49274
|
-
|
|
49275
|
-
|
|
49276
|
-
|
|
49701
|
+
populate: trackRenderAsync(
|
|
49702
|
+
async function() {
|
|
49703
|
+
await this.replaceAttributesData();
|
|
49704
|
+
if (this.submitButton == null) {
|
|
49705
|
+
this.element.addEventListener("input", (e) => this.debounceInput(e.target));
|
|
49706
|
+
} else {
|
|
49707
|
+
this.element.addEventListener("submit", (e) => {
|
|
49708
|
+
e.preventDefault();
|
|
49709
|
+
this.inputChange(e.target);
|
|
49710
|
+
});
|
|
49711
|
+
}
|
|
49712
|
+
const fields = await this.getFields();
|
|
49713
|
+
const widgetTemplates = await Promise.all(fields.map((field) => this.createWidgetTemplate(field)));
|
|
49714
|
+
const template = html$1`
|
|
49715
|
+
<form>
|
|
49716
|
+
${widgetTemplates}
|
|
49717
|
+
${this.submitButton == null ? "" : this.getSubmitTemplate()}
|
|
49718
|
+
</form>
|
|
49719
|
+
`;
|
|
49720
|
+
render$1(template, this.element);
|
|
49721
|
+
},
|
|
49722
|
+
"SolidFormSearch:populate"
|
|
49723
|
+
)
|
|
49277
49724
|
};
|
|
49278
49725
|
Sib.register(SolidFormSearch);
|
|
49279
49726
|
const SolidWidget = {
|
|
@@ -49356,25 +49803,28 @@ const SolidAcChecker = {
|
|
|
49356
49803
|
default: ""
|
|
49357
49804
|
}
|
|
49358
49805
|
},
|
|
49359
|
-
|
|
49360
|
-
|
|
49361
|
-
|
|
49362
|
-
|
|
49363
|
-
|
|
49364
|
-
|
|
49365
|
-
|
|
49366
|
-
|
|
49367
|
-
|
|
49368
|
-
|
|
49369
|
-
|
|
49370
|
-
|
|
49371
|
-
|
|
49372
|
-
|
|
49373
|
-
|
|
49374
|
-
|
|
49375
|
-
|
|
49376
|
-
|
|
49377
|
-
|
|
49806
|
+
populate: trackRenderAsync(
|
|
49807
|
+
async function() {
|
|
49808
|
+
if (!this.resource) return;
|
|
49809
|
+
let displayElement;
|
|
49810
|
+
const ContextParser3 = JSONLDContextParser.ContextParser;
|
|
49811
|
+
const permissions = await this.resource.permissions;
|
|
49812
|
+
if (this.permission) {
|
|
49813
|
+
displayElement = permissions.some((p) => {
|
|
49814
|
+
return ContextParser3.expandTerm(p, this.context, true) === this.permission;
|
|
49815
|
+
});
|
|
49816
|
+
} else if (this.noPermission) {
|
|
49817
|
+
displayElement = permissions.every((p) => {
|
|
49818
|
+
return ContextParser3.expandTerm(p, this.context, true) !== this.noPermission;
|
|
49819
|
+
});
|
|
49820
|
+
} else {
|
|
49821
|
+
console.warn('solid-ac-checker: you should define at least one of "permission" or "no-permission" attribute.');
|
|
49822
|
+
return;
|
|
49823
|
+
}
|
|
49824
|
+
if (displayElement) this.element.removeAttribute("hidden");
|
|
49825
|
+
},
|
|
49826
|
+
"SolidAcChecker:populate"
|
|
49827
|
+
),
|
|
49378
49828
|
empty() {
|
|
49379
49829
|
this.element.setAttribute("hidden", "");
|
|
49380
49830
|
}
|
|
@@ -49434,14 +49884,17 @@ const SolidDelete = {
|
|
|
49434
49884
|
update() {
|
|
49435
49885
|
this.render();
|
|
49436
49886
|
},
|
|
49437
|
-
|
|
49438
|
-
|
|
49439
|
-
|
|
49440
|
-
|
|
49441
|
-
|
|
49442
|
-
|
|
49443
|
-
|
|
49444
|
-
|
|
49887
|
+
render: trackRenderAsync(
|
|
49888
|
+
async function() {
|
|
49889
|
+
await this.replaceAttributesData(false);
|
|
49890
|
+
const button = html$1`
|
|
49891
|
+
<button @click=${this.delete.bind(this)}>${this.dataLabel || this.t("solid-delete.button")}</button>
|
|
49892
|
+
${this.getModalDialog()}
|
|
49893
|
+
`;
|
|
49894
|
+
render$1(button, this.element);
|
|
49895
|
+
},
|
|
49896
|
+
"SolidDelete:render"
|
|
49897
|
+
)
|
|
49445
49898
|
};
|
|
49446
49899
|
Sib.register(SolidDelete);
|
|
49447
49900
|
const SolidLang = {
|
|
@@ -49702,7 +50155,7 @@ const SolidTable = {
|
|
|
49702
50155
|
* @param div
|
|
49703
50156
|
* @param context
|
|
49704
50157
|
*/
|
|
49705
|
-
async
|
|
50158
|
+
renderDOM: trackRenderAsync(async function(resources, listPostProcessors, div2, context2) {
|
|
49706
50159
|
const selectedLines = [...this.selectedLines];
|
|
49707
50160
|
const fields = await this.getFields();
|
|
49708
50161
|
const childTemplates = await Promise.all(
|
|
@@ -49723,7 +50176,7 @@ const SolidTable = {
|
|
|
49723
50176
|
div2,
|
|
49724
50177
|
context2
|
|
49725
50178
|
);
|
|
49726
|
-
}
|
|
50179
|
+
}, "SolidTable:renderDom")
|
|
49727
50180
|
};
|
|
49728
50181
|
Sib.register(SolidTable);
|
|
49729
50182
|
const SolidMap = {
|
|
@@ -49902,13 +50355,16 @@ const SolidMap = {
|
|
|
49902
50355
|
* @param div
|
|
49903
50356
|
* @param context
|
|
49904
50357
|
*/
|
|
49905
|
-
|
|
49906
|
-
|
|
49907
|
-
|
|
49908
|
-
|
|
49909
|
-
|
|
49910
|
-
|
|
49911
|
-
|
|
50358
|
+
renderDOM: trackRenderAsync(
|
|
50359
|
+
async function(resources, listPostProcessors, div2, context2) {
|
|
50360
|
+
const groupClass = div2.dataset.groupClass || "";
|
|
50361
|
+
await Promise.all(resources.map((resource) => this.appendChildElt(resource["@id"], groupClass)));
|
|
50362
|
+
this.planReset();
|
|
50363
|
+
const nextProcessor = listPostProcessors.shift();
|
|
50364
|
+
if (nextProcessor) await nextProcessor(resources, listPostProcessors, div2, context2);
|
|
50365
|
+
},
|
|
50366
|
+
"SolidMap:renderDOM"
|
|
50367
|
+
)
|
|
49912
50368
|
};
|
|
49913
50369
|
Sib.register(SolidMap);
|
|
49914
50370
|
const SolidMembership = {
|
|
@@ -50040,32 +50496,35 @@ const SolidMembership = {
|
|
|
50040
50496
|
update() {
|
|
50041
50497
|
this.render();
|
|
50042
50498
|
},
|
|
50043
|
-
|
|
50044
|
-
|
|
50045
|
-
|
|
50046
|
-
|
|
50047
|
-
|
|
50048
|
-
|
|
50049
|
-
|
|
50050
|
-
|
|
50051
|
-
|
|
50052
|
-
|
|
50053
|
-
|
|
50054
|
-
|
|
50055
|
-
|
|
50056
|
-
|
|
50057
|
-
|
|
50058
|
-
|
|
50059
|
-
|
|
50060
|
-
|
|
50061
|
-
|
|
50062
|
-
|
|
50063
|
-
|
|
50064
|
-
|
|
50065
|
-
|
|
50066
|
-
|
|
50067
|
-
|
|
50068
|
-
|
|
50499
|
+
render: trackRenderAsync(
|
|
50500
|
+
async function() {
|
|
50501
|
+
await this.populate();
|
|
50502
|
+
let button = html$1``;
|
|
50503
|
+
if (this.isMember) {
|
|
50504
|
+
button = html$1`
|
|
50505
|
+
<solid-ac-checker data-src="${this.dataSrc}"
|
|
50506
|
+
permission="acl:Read"
|
|
50507
|
+
class=${ifDefined(`${this.classSubmitButton ? "leave " + this.classSubmitButton : "leave"}`)}
|
|
50508
|
+
>
|
|
50509
|
+
<button @click=${this.changeMembership.bind(this)}>${this.dataLeaveLabel || this.t("solid-leave-group.button")}</button>
|
|
50510
|
+
${this.getModalDialog()}
|
|
50511
|
+
</solid-ac-checker>
|
|
50512
|
+
`;
|
|
50513
|
+
} else {
|
|
50514
|
+
button = html$1`
|
|
50515
|
+
<solid-ac-checker data-src="${this.dataSrc}"
|
|
50516
|
+
permission="acl:Read"
|
|
50517
|
+
class=${ifDefined(`${this.classSubmitButton ? "join " + this.classSubmitButton : "join"}`)}
|
|
50518
|
+
>
|
|
50519
|
+
<button @click=${this.changeMembership.bind(this)}>${this.dataJoinLabel || this.t("solid-join-group.button")}</button>
|
|
50520
|
+
${this.getModalDialog()}
|
|
50521
|
+
</solid-ac-checker>
|
|
50522
|
+
`;
|
|
50523
|
+
}
|
|
50524
|
+
render$1(button, this.element);
|
|
50525
|
+
},
|
|
50526
|
+
"SolidMembership:render"
|
|
50527
|
+
)
|
|
50069
50528
|
};
|
|
50070
50529
|
Sib.register(SolidMembership);
|
|
50071
50530
|
const SolidMemberDelete = {
|
|
@@ -50172,11 +50631,12 @@ const SolidMemberDelete = {
|
|
|
50172
50631
|
update() {
|
|
50173
50632
|
this.render();
|
|
50174
50633
|
},
|
|
50175
|
-
|
|
50176
|
-
|
|
50177
|
-
|
|
50178
|
-
|
|
50179
|
-
|
|
50634
|
+
render: trackRenderAsync(
|
|
50635
|
+
async function() {
|
|
50636
|
+
await this.populate();
|
|
50637
|
+
let button = html$1``;
|
|
50638
|
+
if (this.isMember) {
|
|
50639
|
+
button = html$1`
|
|
50180
50640
|
<solid-ac-checker data-src="${this.dataSrc}"
|
|
50181
50641
|
permission="acl:Write"
|
|
50182
50642
|
class=${ifDefined(this.classSubmitButton)}
|
|
@@ -50188,13 +50648,15 @@ const SolidMemberDelete = {
|
|
|
50188
50648
|
${this.getModalDialog()}
|
|
50189
50649
|
</solid-ac-checker>
|
|
50190
50650
|
`;
|
|
50191
|
-
|
|
50192
|
-
|
|
50651
|
+
} else {
|
|
50652
|
+
button = html$1`
|
|
50193
50653
|
<span>${this.dataUnknownMember || this.t("solid-member-unknown.span")}</span>
|
|
50194
50654
|
`;
|
|
50195
|
-
|
|
50196
|
-
|
|
50197
|
-
|
|
50655
|
+
}
|
|
50656
|
+
render$1(button, this.element);
|
|
50657
|
+
},
|
|
50658
|
+
"SolidMemberDelete:render"
|
|
50659
|
+
)
|
|
50198
50660
|
};
|
|
50199
50661
|
Sib.register(SolidMemberDelete);
|
|
50200
50662
|
const SolidMemberAdd = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startinblox/core",
|
|
3
|
-
"version": "0.19.22-beta.
|
|
3
|
+
"version": "0.19.22-beta.3",
|
|
4
4
|
"description": "This is a series of web component respecting both the web components standards and the Linked Data Platform convention.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"vite": "^5.4.8"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"cors": "^2.8.5"
|
|
100
|
+
"cors": "^2.8.5",
|
|
101
|
+
"loglevel": "^1.9.1"
|
|
101
102
|
}
|
|
102
103
|
}
|