@arpproject/recrate 0.1.49 → 0.1.51

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.
Files changed (2) hide show
  1. package/dist/recrate.es.js +8 -11
  2. package/package.json +1 -1
@@ -74008,7 +74008,7 @@ function normalise(entity, i) {
74008
74008
  if (!isValid && message === "The identifier is not valid according to the RO Crate spec nor is it a valid IRI.") {
74009
74009
  normalisedEntity["@id"] = `#${normalisedEntity["@id"]}`;
74010
74010
  }
74011
- normalisedEntity.name = shouldGenerateEntityName(entity.name) ? normalisedEntity["@id"].replace(/^#/, "") : entity.name;
74011
+ normalisedEntity.name = shouldGenerateEntityName(entity.name) ? "" : entity.name;
74012
74012
  if (isArray(normalisedEntity.name)) normalisedEntity.name = normalisedEntity.name.join(" ");
74013
74013
  for (let property of Object.keys(entity)) {
74014
74014
  if (["@id", "@type", "name", "@reverse"].includes(property)) continue;
@@ -94509,13 +94509,10 @@ const EntityProperty = ({
94509
94509
  }).filter(Boolean);
94510
94510
  }, [values, propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues]);
94511
94511
  const linkInstances = useMemo$1(() => {
94512
- return lodashExports.orderBy(
94513
- values.map((v2, i) => {
94514
- if (lodashExports.isPlainObject(v2) && typeof v2 !== "boolean") return { idx: i, value: v2 };
94515
- return null;
94516
- }).filter(Boolean),
94517
- ["value.@id"]
94518
- );
94512
+ return values.map((v2, i) => {
94513
+ if (lodashExports.isPlainObject(v2) && typeof v2 !== "boolean") return { idx: i, value: v2 };
94514
+ return null;
94515
+ }).filter(Boolean);
94519
94516
  }, [values]);
94520
94517
  const renderedLinkInstances = useMemo$1(() => {
94521
94518
  const reverseDeletedEntities = getPendingDeletedEntitiesForReverseProperty(
@@ -126869,7 +126866,7 @@ class CrateManager {
126869
126866
  if (shouldGenerateEntityName(crate["@graph"][i].name)) {
126870
126867
  this.__setWarning(
126871
126868
  "init",
126872
- `Entity '${normalisedEntity["@id"]}' did not have a name. Recrate generated '${normalisedEntity.name}' from its identifier.`
126869
+ `Entity '${normalisedEntity["@id"]}' does not have the required name property.`
126873
126870
  );
126874
126871
  }
126875
126872
  idMap[crate["@graph"][i]["@id"]] = normalisedEntity["@id"];
@@ -127637,7 +127634,7 @@ class CrateManager {
127637
127634
  console.log("updateProperty", { id: id2, property, idx, value });
127638
127635
  if (!id2) throw new Error(`'setProperty' requires 'id' to be defined`);
127639
127636
  if (!property) throw new Error(`setProperty' requires 'property' to be defined`);
127640
- if (value !== false && !value)
127637
+ if (value !== false && !value && property !== "name")
127641
127638
  throw new Error(`'setProperty' requires 'value' to be defined`);
127642
127639
  console.log("updateProperty", { id: id2, property, idx, value });
127643
127640
  if (isPlainObject(value) && isEmpty(value)) return;
@@ -135330,7 +135327,7 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
135330
135327
  }) : null
135331
135328
  );
135332
135329
  var CacheProvider = EmotionCacheContext.Provider;
135333
- const version = "0.1.49";
135330
+ const version = "0.1.51";
135334
135331
  const pkg = {
135335
135332
  version
135336
135333
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arpproject/recrate",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "type": "module",
5
5
  "main": "./dist/recrate.es.js",
6
6
  "module": "./dist/recrate.es.js",