@startinblox/core 2.0.2 → 2.0.4
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
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
var _a2;
|
|
5
|
-
import { g as getDefaultExportFromCjs, s as store, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as commonjsGlobal } from "./store-
|
|
5
|
+
import { g as getDefaultExportFromCjs, s as store, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as commonjsGlobal } from "./store-YR4Gxt5W.js";
|
|
6
6
|
import { d as defineComponent, n as normalizeContext, u as uniqID, e as evalTemplateString, a as doesResourceContainList, c as compare, p as parseFieldsString, f as findClosingBracketMatchIndex, g as generalComparator, b as fuzzyCompare, h as asyncQuerySelector, i as importInlineCSS, j as importCSS, t as transformArrayToContainer, s as setDeepProperty } from "./helpers-4GFJ8HI8.js";
|
|
7
7
|
import { k } from "./helpers-4GFJ8HI8.js";
|
|
8
8
|
if (!("flat" in Array.prototype)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { m as mergeContexts,
|
|
4
|
+
import { m as mergeContexts, l as getRawContext, n as normalizeContext, o as isUrlOrRelativePath, q as jsonldContextParserExports, a as doesResourceContainList } from "./helpers-4GFJ8HI8.js";
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6
6
|
function getDefaultExportFromCjs(x) {
|
|
7
7
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -8890,6 +8890,34 @@ class CustomGetter {
|
|
|
8890
8890
|
}
|
|
8891
8891
|
if (path2.length === 0) {
|
|
8892
8892
|
if (!value || !value["@id"]) return this.getLiteralValue(value);
|
|
8893
|
+
const valueKeys = Object.keys(value).filter((k) => k !== "@type");
|
|
8894
|
+
if (valueKeys.length === 1 && valueKeys[0] === "@id") {
|
|
8895
|
+
const cachedResource = store.get(value["@id"]);
|
|
8896
|
+
if (cachedResource) {
|
|
8897
|
+
return cachedResource;
|
|
8898
|
+
}
|
|
8899
|
+
try {
|
|
8900
|
+
const mergedContext = mergeContexts(
|
|
8901
|
+
this.clientContext,
|
|
8902
|
+
this.serverContext
|
|
8903
|
+
);
|
|
8904
|
+
const rawContext = getRawContext(mergedContext);
|
|
8905
|
+
if ((rawContext == null ? void 0 : rawContext[path]) && typeof rawContext[path] === "object" && rawContext[path]["@type"] === "@id") {
|
|
8906
|
+
return value["@id"];
|
|
8907
|
+
}
|
|
8908
|
+
} catch (error) {
|
|
8909
|
+
console.warn("Context parsing failed in CustomGetter:", error);
|
|
8910
|
+
}
|
|
8911
|
+
const resource2 = await this.getResource(
|
|
8912
|
+
value["@id"],
|
|
8913
|
+
mergeContexts(this.clientContext, this.serverContext),
|
|
8914
|
+
this.parentId || this.resourceId
|
|
8915
|
+
);
|
|
8916
|
+
if (resource2 === null) {
|
|
8917
|
+
return value["@id"];
|
|
8918
|
+
}
|
|
8919
|
+
return resource2;
|
|
8920
|
+
}
|
|
8893
8921
|
return await this.getResource(
|
|
8894
8922
|
value["@id"],
|
|
8895
8923
|
mergeContexts(this.clientContext, this.serverContext),
|
package/dist/store.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startinblox/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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",
|