@startinblox/core 0.20.0-beta.2 → 1.0.0-beta.1
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/{helpers-BICN491G.js → helpers-Ei-jd7qG.js} +31 -24
- package/dist/helpers.js +3 -3
- package/dist/index.js +36651 -36425
- package/dist/slimselect-CT2Oyr_0.js +4 -0
- package/package.json +1 -1
- package/dist/slimselect-BTZP03JZ.js +0 -4
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
1
2
|
var __typeError = (msg) => {
|
|
2
3
|
throw TypeError(msg);
|
|
3
4
|
};
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
7
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
8
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -1313,26 +1316,24 @@ Fuse.config = Config;
|
|
|
1313
1316
|
register(ExtendedSearch);
|
|
1314
1317
|
}
|
|
1315
1318
|
function uniqID() {
|
|
1316
|
-
return
|
|
1319
|
+
return `_${(Math.random() * 36 ** 20).toString(36).slice(0, 10)}`;
|
|
1317
1320
|
}
|
|
1318
1321
|
function stringToDom(html) {
|
|
1319
1322
|
const template = document.createElement("template");
|
|
1320
1323
|
template.innerHTML = html;
|
|
1321
1324
|
return template.content;
|
|
1322
1325
|
}
|
|
1326
|
+
const AsyncFunction = Object.getPrototypeOf(async () => {
|
|
1327
|
+
}).constructor;
|
|
1323
1328
|
async function evalTemplateString(str, variables = {}) {
|
|
1324
1329
|
const keys = Object.keys(variables);
|
|
1325
1330
|
const values = keys.map((key) => variables[key]);
|
|
1326
1331
|
try {
|
|
1327
|
-
const
|
|
1328
|
-
async function() {
|
|
1329
|
-
}
|
|
1330
|
-
).constructor;
|
|
1331
|
-
const func = AsyncFunction.call(null, ...keys, "return `" + str + "`");
|
|
1332
|
+
const func = AsyncFunction.call(null, ...keys, `return \`${str}\``);
|
|
1332
1333
|
return await func(...values);
|
|
1333
1334
|
} catch (e) {
|
|
1334
1335
|
console.log(e);
|
|
1335
|
-
throw new SyntaxError(
|
|
1336
|
+
throw new SyntaxError(`\`${str}\``);
|
|
1336
1337
|
}
|
|
1337
1338
|
}
|
|
1338
1339
|
function importCSS(...stylesheets) {
|
|
@@ -1388,7 +1389,7 @@ function relativeSource(source) {
|
|
|
1388
1389
|
const e = new Error();
|
|
1389
1390
|
if (!e.stack) return source;
|
|
1390
1391
|
const f2 = e.stack.split("\n").filter((l) => l.includes(":"))[2];
|
|
1391
|
-
|
|
1392
|
+
const line = f2.match(/[a-z]+:.*$/);
|
|
1392
1393
|
if (!line) return source;
|
|
1393
1394
|
const calledFile = line[0].replace(/(\:[0-9]+){2}\)?$/, "");
|
|
1394
1395
|
source = new URL(source, calledFile).href;
|
|
@@ -1397,8 +1398,8 @@ function relativeSource(source) {
|
|
|
1397
1398
|
function loadScript(source) {
|
|
1398
1399
|
source = relativeSource(source);
|
|
1399
1400
|
return new Promise((resolve) => {
|
|
1400
|
-
|
|
1401
|
-
|
|
1401
|
+
const script = document.createElement("script");
|
|
1402
|
+
const head = document.querySelector("head");
|
|
1402
1403
|
script.async = true;
|
|
1403
1404
|
script.onload = () => setTimeout(resolve, 0);
|
|
1404
1405
|
script.src = source;
|
|
@@ -1406,7 +1407,7 @@ function loadScript(source) {
|
|
|
1406
1407
|
});
|
|
1407
1408
|
}
|
|
1408
1409
|
function domIsReady() {
|
|
1409
|
-
return new Promise(
|
|
1410
|
+
return new Promise((resolve) => {
|
|
1410
1411
|
if (document.readyState === "complete") {
|
|
1411
1412
|
resolve();
|
|
1412
1413
|
} else {
|
|
@@ -1418,27 +1419,27 @@ function setDeepProperty(obj, path, value) {
|
|
|
1418
1419
|
const name = path.shift();
|
|
1419
1420
|
if (name) {
|
|
1420
1421
|
if (!(name in obj)) obj[name] = {};
|
|
1421
|
-
if (path.length) setDeepProperty(obj[name], path, value);
|
|
1422
|
+
if (path.length > 0) setDeepProperty(obj[name], path, value);
|
|
1422
1423
|
else obj[name] = value;
|
|
1423
1424
|
}
|
|
1424
1425
|
}
|
|
1425
1426
|
function parseFieldsString(fields) {
|
|
1426
|
-
|
|
1427
|
+
if (!fields) return [];
|
|
1427
1428
|
while (fields.indexOf("(") > 0) {
|
|
1428
|
-
|
|
1429
|
-
|
|
1429
|
+
const firstBracket = fields.indexOf("(");
|
|
1430
|
+
const noset = fields.substring(
|
|
1430
1431
|
firstBracket,
|
|
1431
1432
|
findClosingBracketMatchIndex(fields, firstBracket) + 1
|
|
1432
1433
|
);
|
|
1433
1434
|
fields = fields.replace(noset, "");
|
|
1434
1435
|
}
|
|
1435
1436
|
const re = /((^\s*|,)\s*)(("(\\"|[^"])*")|('(\\'|[^'])*')|[^,]*)/gm;
|
|
1436
|
-
fieldsArray = fields.match(re) || [];
|
|
1437
|
+
const fieldsArray = fields.match(re) || [];
|
|
1437
1438
|
if (!fieldsArray) return [];
|
|
1438
1439
|
return fieldsArray.map((a) => a.replace(/^[\s,]+/, ""));
|
|
1439
1440
|
}
|
|
1440
1441
|
function findClosingBracketMatchIndex(str, pos) {
|
|
1441
|
-
if (str[pos]
|
|
1442
|
+
if (str[pos] !== "(") throw new Error(`No '(' at index ${pos}`);
|
|
1442
1443
|
let depth = 1;
|
|
1443
1444
|
for (let i = pos + 1; i < str.length; i++) {
|
|
1444
1445
|
switch (str[i]) {
|
|
@@ -1446,7 +1447,7 @@ function findClosingBracketMatchIndex(str, pos) {
|
|
|
1446
1447
|
depth++;
|
|
1447
1448
|
break;
|
|
1448
1449
|
case ")":
|
|
1449
|
-
if (--depth
|
|
1450
|
+
if (--depth === 0) return i;
|
|
1450
1451
|
break;
|
|
1451
1452
|
}
|
|
1452
1453
|
}
|
|
@@ -1499,11 +1500,11 @@ function generalComparator(a, b, order = "asc") {
|
|
|
1499
1500
|
let comparison = 0;
|
|
1500
1501
|
if (typeof a === "boolean" && typeof b === "boolean") {
|
|
1501
1502
|
comparison = a === b ? 0 : a ? 1 : -1;
|
|
1502
|
-
} else if (!isNaN(a) && !isNaN(b)) {
|
|
1503
|
+
} else if (!Number.isNaN(+a) && !Number.isNaN(+b)) {
|
|
1503
1504
|
comparison = Number(a) - Number(b);
|
|
1504
1505
|
} else if (Array.isArray(a) && Array.isArray(b)) {
|
|
1505
1506
|
comparison = a.length - b.length;
|
|
1506
|
-
} else if (!isNaN(Date.parse(a)) && !isNaN(Date.parse(b))) {
|
|
1507
|
+
} else if (!Number.isNaN(Date.parse(a)) && !Number.isNaN(Date.parse(b))) {
|
|
1507
1508
|
const dateA = new Date(a);
|
|
1508
1509
|
const dateB = new Date(a);
|
|
1509
1510
|
comparison = dateA.getTime() - dateB.getTime();
|
|
@@ -1523,7 +1524,7 @@ function generalComparator(a, b, order = "asc") {
|
|
|
1523
1524
|
}
|
|
1524
1525
|
function transformArrayToContainer(resource) {
|
|
1525
1526
|
const newValue = { ...resource };
|
|
1526
|
-
for (
|
|
1527
|
+
for (const predicate of Object.keys(newValue)) {
|
|
1527
1528
|
const predicateValue = newValue[predicate];
|
|
1528
1529
|
if (!predicateValue || typeof predicateValue !== "object") continue;
|
|
1529
1530
|
if (["permissions", "@context"].includes(predicate)) continue;
|
|
@@ -1549,6 +1550,8 @@ class AsyncIterableBuilder {
|
|
|
1549
1550
|
__privateAdd(this, _AsyncIterableBuilder_instances);
|
|
1550
1551
|
__privateAdd(this, _values, []);
|
|
1551
1552
|
__privateAdd(this, _resolve);
|
|
1553
|
+
__publicField(this, "iterable");
|
|
1554
|
+
__publicField(this, "next");
|
|
1552
1555
|
__privateMethod(this, _AsyncIterableBuilder_instances, nextPromise_fn).call(this);
|
|
1553
1556
|
this.iterable = __privateMethod(this, _AsyncIterableBuilder_instances, createIterable_fn).call(this);
|
|
1554
1557
|
this.next = __privateMethod(this, _AsyncIterableBuilder_instances, next_fn).bind(this);
|
|
@@ -1570,7 +1573,11 @@ next_fn = function(value, done = false) {
|
|
|
1570
1573
|
__privateMethod(this, _AsyncIterableBuilder_instances, nextPromise_fn).call(this);
|
|
1571
1574
|
};
|
|
1572
1575
|
nextPromise_fn = function() {
|
|
1573
|
-
__privateGet(this, _values).push(
|
|
1576
|
+
__privateGet(this, _values).push(
|
|
1577
|
+
new Promise((resolve) => {
|
|
1578
|
+
__privateSet(this, _resolve, resolve);
|
|
1579
|
+
})
|
|
1580
|
+
);
|
|
1574
1581
|
};
|
|
1575
1582
|
const asyncQuerySelector = (selector, parent = document) => new Promise((resolve) => {
|
|
1576
1583
|
const element = parent.querySelector(selector);
|
|
@@ -1632,11 +1639,11 @@ const helpers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
1632
1639
|
export {
|
|
1633
1640
|
AsyncIterableBuilder as A,
|
|
1634
1641
|
asyncQuerySelector as a,
|
|
1635
|
-
|
|
1642
|
+
fuzzyCompare as b,
|
|
1636
1643
|
compare as c,
|
|
1637
1644
|
defineComponent as d,
|
|
1638
1645
|
evalTemplateString as e,
|
|
1639
|
-
|
|
1646
|
+
findClosingBracketMatchIndex as f,
|
|
1640
1647
|
generalComparator as g,
|
|
1641
1648
|
helpers as h,
|
|
1642
1649
|
importInlineCSS as i,
|
package/dist/helpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, o, c, A as A2, d, n, e,
|
|
1
|
+
import { A, a, o, c, A as A2, d, n, e, f, b, g, k, i, l, m, p, s, j, t, u } from "./helpers-Ei-jd7qG.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AsyncIterableBuilder,
|
|
4
4
|
a as asyncQuerySelector,
|
|
@@ -8,8 +8,8 @@ export {
|
|
|
8
8
|
d as defineComponent,
|
|
9
9
|
n as domIsReady,
|
|
10
10
|
e as evalTemplateString,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
f as findClosingBracketMatchIndex,
|
|
12
|
+
b as fuzzyCompare,
|
|
13
13
|
g as generalComparator,
|
|
14
14
|
k as importCSS,
|
|
15
15
|
i as importInlineCSS,
|