@startinblox/core 2.0.6-beta.20 → 2.0.6-beta.21

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.
@@ -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
  import { q as mergeContexts, o as getRawContext, n as normalizeContext } from "./helpers-DtCY-jxq.js";
5
- import { S as StoreService } from "./store-D1nUbSMR.js";
5
+ import { S as StoreService } from "./store-CsN3nlRR.js";
6
6
  const store = StoreService.getInstance();
7
7
  class CustomGetter {
8
8
  // search attributes to give to server
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
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 { g as getDefaultExportFromCjs, S as StoreService, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as StoreType, d as StoreFactory, h as hasSetLocalData, e as hasQueryIndex, __tla as __tla_0 } from "./store-D1nUbSMR.js";
4
+ import { g as getDefaultExportFromCjs, S as StoreService, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as StoreType, d as StoreFactory, h as hasSetLocalData, e as hasQueryIndex, __tla as __tla_0 } from "./store-CsN3nlRR.js";
5
5
  import { d as defineComponent, n as normalizeContext, u as uniqID, f as fuzzyCompare, a as asyncQuerySelector, i as importInlineCSS, b as importCSS, c as doesResourceContainList, e as findClosingBracketMatchIndex, p as parseFieldsString, g as evalTemplateString, h as compare, j as generalComparator, t as transformArrayToContainer, s as setDeepProperty } from "./helpers-DtCY-jxq.js";
6
- import { __tla as __tla_1 } from "./store-D1nUbSMR.js";
7
- import { A, D } from "./store-D1nUbSMR.js";
6
+ import { __tla as __tla_1 } from "./store-CsN3nlRR.js";
7
+ import { A, D } from "./store-CsN3nlRR.js";
8
8
  import { k } from "./helpers-DtCY-jxq.js";
9
9
  let index$4, BaseWidgetMixin, index$3, CounterMixin, DspCatalogDisplay, EdcAssetsDisplay, FederationMixin, FilterMixin, GrouperMixin, HighlighterMixin, ListMixin, NextMixin, PaginateMixin, RequiredMixin, Sib, SolidAcChecker, SolidDelete, SolidDisplay, SolidForm, SolidFormSearch, SolidLang, SolidMemberAdd, SolidMemberDelete, SolidMembership, SolidTable, SolidTemplateElement, SolidWidget, SorterMixin, StoreMixin, index$2, index$1, index, TranslationMixin, ValidationMixin, WidgetMixin, b, o$2, newWidgetFactory, D2, o$1, m, widgetFactory;
10
10
  let __tla = Promise.all([
@@ -5852,7 +5852,7 @@ let __tla = (async () => {
5852
5852
  return obj;
5853
5853
  }
5854
5854
  mapSourceToDestination(src, opts) {
5855
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5855
+ var _a2, _b, _c, _d;
5856
5856
  const vc = src.verifiableCredential;
5857
5857
  const cs = vc.credentialSubject;
5858
5858
  let catInfo;
@@ -5879,6 +5879,25 @@ let __tla = (async () => {
5879
5879
  const resourceId = cs["@id"];
5880
5880
  const slug = resourceId.split("/").pop() || "unknown";
5881
5881
  const serviceId = `${opts.temsServiceBase}${encodeURIComponent(slug)}/`;
5882
+ const FOAF_THUMBNAIL_KEYS = [
5883
+ "foaf:thumbnail",
5884
+ "http://xmlns.com/foaf/0.1/thumbnail"
5885
+ ];
5886
+ const DCTERMS_CREATOR_KEYS = [
5887
+ "dcterms:creator",
5888
+ "dct:creator",
5889
+ "http://purl.org/dc/terms/creator"
5890
+ ];
5891
+ const pickKey = (obj, keys) => {
5892
+ if (!obj) return void 0;
5893
+ for (const k of keys) if (obj[k] !== void 0) return obj[k];
5894
+ return void 0;
5895
+ };
5896
+ const getThumbnailUrl = (obj) => {
5897
+ var _a3, _b2;
5898
+ return ((_a3 = pickKey(obj, FOAF_THUMBNAIL_KEYS)) == null ? void 0 : _a3["rdf:resource"]) ?? ((_b2 = pickKey(obj, FOAF_THUMBNAIL_KEYS)) == null ? void 0 : _b2["http://www.w3.org/1999/02/22-rdf-syntax-ns#resource"]);
5899
+ };
5900
+ const getCreator = (obj) => pickKey(obj, DCTERMS_CREATOR_KEYS);
5882
5901
  const creation_date = vc.issuanceDate;
5883
5902
  const update_date = vc.expirationDate;
5884
5903
  const name = catInfo["dcterms:title"] || catInfo["dct:title"];
@@ -5901,12 +5920,10 @@ let __tla = (async () => {
5901
5920
  const is_external = hasEndpoint;
5902
5921
  const is_api = hasEndpoint;
5903
5922
  const imageUrls = [];
5904
- if ((_a2 = catInfo["foaf:thumbnail"]) == null ? void 0 : _a2["rdf:resource"]) {
5905
- imageUrls.push(catInfo["foaf:thumbnail"]["rdf:resource"]);
5906
- }
5907
- if ((_c = (_b = catInfo["dcterms:creator"]) == null ? void 0 : _b["foaf:thumbnail"]) == null ? void 0 : _c["rdf:resource"]) {
5908
- imageUrls.push(catInfo["dcterms:creator"]["foaf:thumbnail"]["rdf:resource"]);
5909
- }
5923
+ const catThumbnail = getThumbnailUrl(catInfo);
5924
+ if (catThumbnail) imageUrls.push(catThumbnail);
5925
+ const creatorThumbnail = getThumbnailUrl(getCreator(catInfo));
5926
+ if (creatorThumbnail) imageUrls.push(creatorThumbnail);
5910
5927
  const images = {
5911
5928
  "@id": `${serviceId}images/`,
5912
5929
  "@type": "ldp:Container",
@@ -5927,18 +5944,19 @@ let __tla = (async () => {
5927
5944
  if (service_url.includes("demo.isan.org")) service_url = new URL(service_url).origin;
5928
5945
  let providerRef;
5929
5946
  if (usedKey === "service") {
5930
- providerRef = ((_d = cs["gax-core:operatedBy"]) == null ? void 0 : _d["@id"]) || "";
5947
+ providerRef = ((_a2 = cs["gax-core:operatedBy"]) == null ? void 0 : _a2["@id"]) || "";
5931
5948
  } else if (usedKey === "nested-service") {
5932
- providerRef = ((_e = cs["gax-core:operatedBy"]) == null ? void 0 : _e["@id"]) || ((_f = cs["gax-core:offeredBy"]) == null ? void 0 : _f["@id"]) || "";
5949
+ providerRef = ((_b = cs["gax-core:operatedBy"]) == null ? void 0 : _b["@id"]) || ((_c = cs["gax-core:offeredBy"]) == null ? void 0 : _c["@id"]) || "";
5933
5950
  } else {
5934
- providerRef = ((_g = cs["gax-core:offeredBy"]) == null ? void 0 : _g["@id"]) || "";
5951
+ providerRef = ((_d = cs["gax-core:offeredBy"]) == null ? void 0 : _d["@id"]) || "";
5935
5952
  }
5936
5953
  const providerSlug = providerRef.split(":").pop() + String(Math.random()) || "0";
5937
- const providerLogo = ((_i = (_h = catInfo["dcterms:creator"]) == null ? void 0 : _h["foaf:thumbnail"]) == null ? void 0 : _i["rdf:resource"]) || "";
5954
+ const creator = getCreator(catInfo);
5955
+ const providerLogo = getThumbnailUrl(creator) || "";
5938
5956
  const provider = {
5939
5957
  "@id": `${opts.temsProviderBase}${encodeURIComponent(providerSlug)}/`,
5940
5958
  "@type": "tems:Provider",
5941
- name: ((_j = catInfo["dcterms:creator"]) == null ? void 0 : _j["foaf:name"]) || "",
5959
+ name: (creator == null ? void 0 : creator["foaf:name"]) || (creator == null ? void 0 : creator["http://xmlns.com/foaf/0.1/name"]) || "",
5942
5960
  image: {
5943
5961
  "@id": `${opts.temsImageBase}${encodeURIComponent(providerLogo.split("/").pop() || "0")}/`,
5944
5962
  "@type": "tems:Image",
@@ -33060,7 +33078,7 @@ sh:property [
33060
33078
  window.dispatchEvent(event);
33061
33079
  }
33062
33080
  async initGetter() {
33063
- const { CustomGetter } = await import("./custom-getter-Blm6IRrs.js");
33081
+ const { CustomGetter } = await import("./custom-getter-TTrh1NFo.js");
33064
33082
  return CustomGetter;
33065
33083
  }
33066
33084
  disconnectedCallback() {
package/dist/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s, S, c, b, e, j, h, i } from "./store-D1nUbSMR.js";
1
+ import { s, S, c, b, e, j, h, i } from "./store-CsN3nlRR.js";
2
2
  export {
3
3
  s as SEMANTIZER,
4
4
  S as StoreService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "2.0.6-beta.20",
3
+ "version": "2.0.6-beta.21",
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",