domql 3.7.3 → 3.7.5
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/iife/index.js +35 -16
- package/package.json +4 -4
package/dist/iife/index.js
CHANGED
|
@@ -1080,14 +1080,17 @@ var Domql = (() => {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
return element;
|
|
1082
1082
|
};
|
|
1083
|
-
trackSourcemapDeep = (sourcemap, obj, sourceName) => {
|
|
1083
|
+
trackSourcemapDeep = (sourcemap, obj, sourceName, seen) => {
|
|
1084
|
+
if (!seen) seen = /* @__PURE__ */ new WeakSet();
|
|
1085
|
+
if (seen.has(obj)) return;
|
|
1086
|
+
seen.add(obj);
|
|
1084
1087
|
for (const key in obj) {
|
|
1085
1088
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
1086
1089
|
if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
|
|
1087
1090
|
const val = obj[key];
|
|
1088
1091
|
if (isObject(val) && !isArray(val)) {
|
|
1089
1092
|
sourcemap[key] = sourcemap[key] || {};
|
|
1090
|
-
trackSourcemapDeep(sourcemap[key], val, sourceName);
|
|
1093
|
+
trackSourcemapDeep(sourcemap[key], val, sourceName, seen);
|
|
1091
1094
|
} else {
|
|
1092
1095
|
sourcemap[key] = sourceName;
|
|
1093
1096
|
}
|
|
@@ -1938,7 +1941,9 @@ var Domql = (() => {
|
|
|
1938
1941
|
);
|
|
1939
1942
|
createClient = mod.createClient;
|
|
1940
1943
|
}
|
|
1941
|
-
|
|
1944
|
+
const client = createClient(supabaseUrl, key, options);
|
|
1945
|
+
if (!client || !client.auth) return null;
|
|
1946
|
+
return supabaseAdapter(client);
|
|
1942
1947
|
};
|
|
1943
1948
|
applyFilters = (query, params) => {
|
|
1944
1949
|
if (!params) return query;
|
|
@@ -2570,7 +2575,7 @@ var Domql = (() => {
|
|
|
2570
2575
|
return resolved;
|
|
2571
2576
|
};
|
|
2572
2577
|
initAdapterAuth = async (adapter, context) => {
|
|
2573
|
-
if (adapter.__authInitialized) return;
|
|
2578
|
+
if (!adapter || adapter.__authInitialized) return;
|
|
2574
2579
|
adapter.__authInitialized = true;
|
|
2575
2580
|
if (!adapter.getSession) return;
|
|
2576
2581
|
const updateAuth = (user, session) => {
|
|
@@ -2602,9 +2607,10 @@ var Domql = (() => {
|
|
|
2602
2607
|
if (db.__resolving) return db.__resolving;
|
|
2603
2608
|
db.__resolving = resolveDb(db);
|
|
2604
2609
|
const resolved = await db.__resolving;
|
|
2610
|
+
delete db.__resolving;
|
|
2611
|
+
if (!resolved) return null;
|
|
2605
2612
|
db.__resolved = resolved;
|
|
2606
2613
|
context.fetch = resolved;
|
|
2607
|
-
delete db.__resolving;
|
|
2608
2614
|
if (db.auth !== false) await initAdapterAuth(resolved, context);
|
|
2609
2615
|
return resolved;
|
|
2610
2616
|
};
|
|
@@ -3451,12 +3457,12 @@ var Domql = (() => {
|
|
|
3451
3457
|
const result = fn.call(this, ...args);
|
|
3452
3458
|
if (result && typeof result.then === "function") {
|
|
3453
3459
|
result.catch((err) => {
|
|
3454
|
-
this
|
|
3460
|
+
error.call(this, err);
|
|
3455
3461
|
});
|
|
3456
3462
|
}
|
|
3457
3463
|
return result;
|
|
3458
3464
|
} catch (err) {
|
|
3459
|
-
this
|
|
3465
|
+
error.call(this, err);
|
|
3460
3466
|
if (context?.strictMode) throw err;
|
|
3461
3467
|
}
|
|
3462
3468
|
}
|
|
@@ -4111,13 +4117,19 @@ ${element}` : "";
|
|
|
4111
4117
|
const prop = element[param];
|
|
4112
4118
|
if (isFunction(prop) && !isMethod(param, element)) {
|
|
4113
4119
|
ref.__exec[param] = prop;
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
result.then
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4120
|
+
try {
|
|
4121
|
+
const result = prop(element, element.state, element.context);
|
|
4122
|
+
if (result && typeof result.then === "function") {
|
|
4123
|
+
result.then((resolved) => {
|
|
4124
|
+
element[param] = resolved;
|
|
4125
|
+
}).catch((e) => {
|
|
4126
|
+
console.warn("[DOMQL] Async exec error in", param, ":", e?.message || e);
|
|
4127
|
+
});
|
|
4128
|
+
} else {
|
|
4129
|
+
element[param] = result;
|
|
4130
|
+
}
|
|
4131
|
+
} catch (e) {
|
|
4132
|
+
console.warn("[DOMQL] Exec error in", param, ":", e?.message || e);
|
|
4121
4133
|
}
|
|
4122
4134
|
}
|
|
4123
4135
|
}
|
|
@@ -4273,7 +4285,10 @@ ${element}` : "";
|
|
|
4273
4285
|
const attrs = exec(params, element);
|
|
4274
4286
|
if (props.attr) deepMerge(attrs, props.attr);
|
|
4275
4287
|
for (const attr2 in attrs) {
|
|
4276
|
-
|
|
4288
|
+
let val = exec(attrs[attr2], element);
|
|
4289
|
+
if (isString(val) && val.includes("{{") && element.call) {
|
|
4290
|
+
val = element.call("replaceLiteralsWithObjectFields", val, element.state);
|
|
4291
|
+
}
|
|
4277
4292
|
if (val === __attr[attr2]) continue;
|
|
4278
4293
|
if (val !== false && val !== void 0 && val !== null && node.setAttribute) {
|
|
4279
4294
|
node.setAttribute(attr2, val);
|
|
@@ -6599,7 +6614,11 @@ ${element}` : "";
|
|
|
6599
6614
|
if (!ref.__skipCreate && REGISTRY[k] && !optionsHasDefine) {
|
|
6600
6615
|
continue;
|
|
6601
6616
|
} else if (element[k] && !hasDefine && !optionsHasDefine && !contextHasDefine) {
|
|
6602
|
-
|
|
6617
|
+
try {
|
|
6618
|
+
create(exec(element[k], element), element, k, options);
|
|
6619
|
+
} catch (e) {
|
|
6620
|
+
console.warn("[DOMQL] onlyResolveExtends child error in", k, ":", e?.message || e);
|
|
6621
|
+
}
|
|
6603
6622
|
}
|
|
6604
6623
|
}
|
|
6605
6624
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domql",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.5",
|
|
4
4
|
"license": "CC-BY-NC-4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"build:iife": "cross-env NODE_ENV=$NODE_ENV esbuild index.js --bundle --target=es2020 --format=iife --global-name=Domql --outfile=dist/iife/index.js --define:process.env.NODE_ENV=process.env.NODE_ENV"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@domql/element": "^3.7.
|
|
29
|
-
"@domql/state": "^3.7.
|
|
30
|
-
"@domql/utils": "^3.7.
|
|
28
|
+
"@domql/element": "^3.7.5",
|
|
29
|
+
"@domql/state": "^3.7.5",
|
|
30
|
+
"@domql/utils": "^3.7.5"
|
|
31
31
|
},
|
|
32
32
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
33
33
|
"browser": "./dist/esm/index.js",
|