@arpproject/recrate 0.1.30 → 0.1.31
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/recrate.es.js +49 -8
- package/package.json +1 -1
package/dist/recrate.es.js
CHANGED
|
@@ -109627,8 +109627,8 @@ const QuickSettingsHeader = ({
|
|
|
109627
109627
|
{
|
|
109628
109628
|
className: "describo-quick-settings-filter",
|
|
109629
109629
|
value: fieldTitleFilter,
|
|
109630
|
-
placeholder: "Filter fields by
|
|
109631
|
-
"aria-label": "Filter fields by
|
|
109630
|
+
placeholder: "Filter fields by name or value",
|
|
109631
|
+
"aria-label": "Filter fields by name or value",
|
|
109632
109632
|
onChange: (event) => onFieldTitleFilterChange(event.target.value),
|
|
109633
109633
|
allowClear: {
|
|
109634
109634
|
clearIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, { "aria-label": "Clear field filter" })
|
|
@@ -111502,6 +111502,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111502
111502
|
captureViewContext(activeTab);
|
|
111503
111503
|
}
|
|
111504
111504
|
setExtraProperties([]);
|
|
111505
|
+
setFieldTitleFilter("");
|
|
111505
111506
|
init2({ entity });
|
|
111506
111507
|
}, [entity]);
|
|
111507
111508
|
useEffect(() => {
|
|
@@ -112233,13 +112234,53 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112233
112234
|
entity: contextEntity
|
|
112234
112235
|
})) == null ? void 0 : _a3.propertyDefinition) == null ? void 0 : _b2.label) || property;
|
|
112235
112236
|
};
|
|
112236
|
-
const
|
|
112237
|
+
const getSearchableScalarText = (value) => {
|
|
112238
|
+
if (value === null || typeof value === "undefined") return [];
|
|
112239
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
112240
|
+
return [String(value)];
|
|
112241
|
+
}
|
|
112242
|
+
return [];
|
|
112243
|
+
};
|
|
112244
|
+
const getLinkedEntitySearchText = (value) => {
|
|
112245
|
+
const id2 = typeof (value == null ? void 0 : value["@id"]) === "string" ? value["@id"] : void 0;
|
|
112246
|
+
if (!id2) return [];
|
|
112247
|
+
try {
|
|
112248
|
+
const linkedEntity = crateManager == null ? void 0 : crateManager.getEntity({ id: id2, link: false, materialise: false });
|
|
112249
|
+
if (!linkedEntity || linkedEntity === value) return [];
|
|
112250
|
+
return [
|
|
112251
|
+
...getSearchableScalarText(linkedEntity["@id"]),
|
|
112252
|
+
...getSearchableScalarText(linkedEntity.name),
|
|
112253
|
+
...getSearchableValueText(linkedEntity["@type"])
|
|
112254
|
+
];
|
|
112255
|
+
} catch {
|
|
112256
|
+
return [];
|
|
112257
|
+
}
|
|
112258
|
+
};
|
|
112259
|
+
const getSearchableValueText = (value) => {
|
|
112260
|
+
const scalarText = getSearchableScalarText(value);
|
|
112261
|
+
if (scalarText.length) return scalarText;
|
|
112262
|
+
if (Array.isArray(value)) {
|
|
112263
|
+
return value.flatMap(getSearchableValueText);
|
|
112264
|
+
}
|
|
112265
|
+
if (value && typeof value === "object") {
|
|
112266
|
+
return [
|
|
112267
|
+
...Object.values(value).flatMap(getSearchableValueText),
|
|
112268
|
+
...getLinkedEntitySearchText(value)
|
|
112269
|
+
];
|
|
112270
|
+
}
|
|
112271
|
+
return [];
|
|
112272
|
+
};
|
|
112273
|
+
const matchesFieldFilter = (property, label) => {
|
|
112237
112274
|
const filter2 = fieldTitleFilter.trim().toLowerCase();
|
|
112238
112275
|
if (!filter2) return true;
|
|
112239
|
-
|
|
112240
|
-
|
|
112241
|
-
|
|
112242
|
-
|
|
112276
|
+
const fieldText = [
|
|
112277
|
+
getFieldTitle(property, label),
|
|
112278
|
+
...getSearchableValueText(contextEntity == null ? void 0 : contextEntity[property])
|
|
112279
|
+
].join(" ").toLowerCase();
|
|
112280
|
+
return fieldText.includes(filter2);
|
|
112281
|
+
};
|
|
112282
|
+
const shouldRenderCoreField = (property, label) => matchesFieldFilter(property, label);
|
|
112283
|
+
const shouldRenderField = (property, label) => matchesFieldFilter(property, label) && (!hideEmptyFields || hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]));
|
|
112243
112284
|
const editorScrollClassName = `describo-editor-scroll ${quickSettingsVisible ? "px-3 pb-3 pt-0" : "p-3"}`;
|
|
112244
112285
|
if (!entity || !entity["@id"]) {
|
|
112245
112286
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "No entity selected" });
|
|
@@ -120913,7 +120954,7 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
|
|
|
120913
120954
|
}) : null
|
|
120914
120955
|
);
|
|
120915
120956
|
var CacheProvider = EmotionCacheContext.Provider;
|
|
120916
|
-
const version = "0.1.
|
|
120957
|
+
const version = "0.1.31";
|
|
120917
120958
|
const pkg = {
|
|
120918
120959
|
version
|
|
120919
120960
|
};
|