@arpproject/recrate 0.1.42-test → 0.1.43-test

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.
@@ -60810,6 +60810,7 @@ const AiApprovalStepperHeader = ({
60810
60810
  domEvent.stopPropagation();
60811
60811
  if (!isAiBulkApprovalMode(key)) return;
60812
60812
  updateBulkApprovalMode(key);
60813
+ onAction(key);
60813
60814
  }
60814
60815
  };
60815
60816
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: getBulkActionTooltip(decision, bulkApprovalMode), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -60933,6 +60934,8 @@ const ICON_TAB_PANE_WIDTH = 80;
60933
60934
  const MIN_LABEL_TAB_PANE_WIDTH = 100;
60934
60935
  const MAX_LABEL_TAB_PANE_WIDTH = 250;
60935
60936
  const getProfileTabKey = (tab) => String((tab == null ? void 0 : tab.profileUrl) || (tab == null ? void 0 : tab.name) || "");
60937
+ const ABOUT_CORE_PROPERTIES = ["@id", "@type", "name"];
60938
+ const isAboutCoreProperty = (property) => ABOUT_CORE_PROPERTIES.includes(property);
60936
60939
  const isProfileTab = (tab) => {
60937
60940
  const name2 = String((tab == null ? void 0 : tab.name) || "").toLowerCase();
60938
60941
  const label = String((tab == null ? void 0 : tab.label) || (tab == null ? void 0 : tab.name) || "").toLowerCase();
@@ -60952,6 +60955,10 @@ const tabContainsProperty = (tab, property) => {
60952
60955
  return (_a2 = tab == null ? void 0 : tab.inputs) == null ? void 0 : _a2.some((input) => (input == null ? void 0 : input.name) === property || (input == null ? void 0 : input.id) === property);
60953
60956
  };
60954
60957
  const findTabForProperty = (tabs, property) => {
60958
+ const aboutTab = tabs.find(isAboutTab);
60959
+ if (aboutTab && isAboutCoreProperty(property)) {
60960
+ return aboutTab;
60961
+ }
60955
60962
  const matchingTabs = tabs.filter((tab) => tabContainsProperty(tab, property));
60956
60963
  return matchingTabs.find((tab) => !isAboutTab(tab)) ?? matchingTabs[0] ?? tabs.find((tab) => ["overflow", "other"].includes(String((tab == null ? void 0 : tab.name) || "").toLowerCase()));
60957
60964
  };
@@ -60961,7 +60968,10 @@ const addMissingReviewPropertiesToTabs = (tabs, properties) => {
60961
60968
  ));
60962
60969
  if (!tabs.length || !uniqueProperties.length) return tabs;
60963
60970
  const assignedProperties = new Set(
60964
- tabs.flatMap((tab) => Array.isArray(tab == null ? void 0 : tab.inputs) ? tab.inputs.flatMap((input) => [input == null ? void 0 : input.name, input == null ? void 0 : input.id]) : []).filter((property) => typeof property === "string" && property.length > 0)
60971
+ [
60972
+ ...tabs.some(isAboutTab) ? ABOUT_CORE_PROPERTIES : [],
60973
+ ...tabs.flatMap((tab) => Array.isArray(tab == null ? void 0 : tab.inputs) ? tab.inputs.flatMap((input) => [input == null ? void 0 : input.name, input == null ? void 0 : input.id]) : [])
60974
+ ].filter((property) => typeof property === "string" && property.length > 0)
60965
60975
  );
60966
60976
  const missingProperties = uniqueProperties.filter((property) => !assignedProperties.has(property));
60967
60977
  if (!missingProperties.length) return tabs;
@@ -61122,21 +61132,23 @@ const ProfileTabRail = ({
61122
61132
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "recrate-tab-rail-status", children: [
61123
61133
  tab.missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCircleXmark, size: "lg" }) }),
61124
61134
  tab.hasData && !tab.missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCircleCheck, size: "lg" }) }),
61125
- canRemove && /* @__PURE__ */ jsxRuntimeExports.jsx(
61135
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
61126
61136
  Button$1,
61127
61137
  {
61128
- "aria-label": "Remove profile",
61138
+ "aria-label": canRemove ? "Remove profile" : void 0,
61139
+ "aria-hidden": !canRemove,
61140
+ tabIndex: canRemove ? 0 : -1,
61129
61141
  type: "text",
61130
61142
  size: "small",
61131
61143
  className: "recrate-tab-rail-remove-button",
61132
61144
  style: {
61133
- visibility: hoveredTabKey === tab.name ? "visible" : "hidden",
61134
- opacity: hoveredTabKey === tab.name ? 1 : 0,
61135
- pointerEvents: hoveredTabKey === tab.name ? "auto" : "none"
61145
+ visibility: canRemove && hoveredTabKey === tab.name ? "visible" : "hidden",
61146
+ opacity: canRemove && hoveredTabKey === tab.name ? 1 : 0,
61147
+ pointerEvents: canRemove && hoveredTabKey === tab.name ? "auto" : "none"
61136
61148
  },
61137
61149
  onClick: (e3) => {
61138
61150
  e3.stopPropagation();
61139
- onRemoveProfile == null ? void 0 : onRemoveProfile(tab);
61151
+ if (canRemove) onRemoveProfile == null ? void 0 : onRemoveProfile(tab);
61140
61152
  },
61141
61153
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$k, { style: { color: "oklch(57.7% 0.245 27.325)" } })
61142
61154
  }
@@ -74349,6 +74361,48 @@ const EntityId = ({
74349
74361
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: entity["@id"] }) })
74350
74362
  ] });
74351
74363
  };
74364
+ const valueIsEmpty$1 = (value) => {
74365
+ if (value === void 0 || value === null) return true;
74366
+ if (typeof value === "string") return value.trim().length === 0;
74367
+ if (Array.isArray(value)) return value.length === 0;
74368
+ return false;
74369
+ };
74370
+ const formatValue = (value, emptyLabel) => {
74371
+ if (valueIsEmpty$1(value)) return emptyLabel;
74372
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
74373
+ return String(value);
74374
+ }
74375
+ try {
74376
+ return JSON.stringify(value, null, 2);
74377
+ } catch {
74378
+ return String(value);
74379
+ }
74380
+ };
74381
+ const AiFieldDiffView = ({
74382
+ previousValue,
74383
+ currentValue,
74384
+ operation
74385
+ }) => {
74386
+ const { t: t2 } = useTranslation();
74387
+ const isDelete = operation === "delete";
74388
+ const emptyLabel = String(t2("ai_empty_value"));
74389
+ const removedValue = formatValue(previousValue, emptyLabel);
74390
+ const addedValue = isDelete ? emptyLabel : formatValue(currentValue, emptyLabel);
74391
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff", "aria-label": String(t2("ai_field_diff_aria")), children: [
74392
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff-head", children: [
74393
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isDelete ? t2("ai_proposed_deletion") : t2("ai_proposed_change") }),
74394
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recrate-ai-field-diff-chip", children: t2("ai_edit_chip") })
74395
+ ] }),
74396
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff-line recrate-ai-field-diff-line-removed", children: [
74397
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recrate-ai-field-diff-marker", children: "-" }),
74398
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `recrate-ai-field-diff-value ${valueIsEmpty$1(previousValue) ? "recrate-ai-field-diff-empty" : ""}`, children: removedValue })
74399
+ ] }),
74400
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff-line recrate-ai-field-diff-line-added", children: [
74401
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recrate-ai-field-diff-marker", children: "+" }),
74402
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `recrate-ai-field-diff-value ${valueIsEmpty$1(isDelete ? void 0 : currentValue) ? "recrate-ai-field-diff-empty" : ""}`, children: addedValue })
74403
+ ] })
74404
+ ] });
74405
+ };
74352
74406
  var ttl2jsonld$1 = { exports: {} };
74353
74407
  var ttl2jsonld = ttl2jsonld$1.exports;
74354
74408
  var hasRequiredTtl2jsonld;
@@ -79502,14 +79556,18 @@ const EntityType = ({
79502
79556
  entity,
79503
79557
  onUpdateEntity,
79504
79558
  aiEdited = false,
79505
- aiEditedVariant = "edited"
79559
+ aiEditedVariant = "edited",
79560
+ aiReview
79506
79561
  }) => {
79507
79562
  var _a2;
79508
79563
  const [selectedClass, setSelectedClass] = useState(void 0);
79564
+ const [showAiDiff, setShowAiDiff] = useState(false);
79509
79565
  const profileManager = useContext(ProfileManagerContext);
79510
79566
  const state = useStateStore();
79511
79567
  const schemaState = useSchemaRegistry();
79512
79568
  const { t: t2 } = useTranslation();
79569
+ const showAiReview = Boolean(aiReview);
79570
+ const isAiDelete = (aiReview == null ? void 0 : aiReview.operation) === "delete";
79513
79571
  const classes = useMemo$1(() => {
79514
79572
  return (profileManager == null ? void 0 : profileManager.getClasses().map((c2) => ({ value: c2, label: c2 }))) || [];
79515
79573
  }, [profileManager, schemaState.revision]);
@@ -79538,84 +79596,92 @@ const EntityType = ({
79538
79596
  });
79539
79597
  setSelectedClass("");
79540
79598
  };
79541
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row", children: [
79542
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 recrate-property-name recrate-property-name-with-ai", children: [
79543
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "@type" }),
79544
- aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
79545
- ] }),
79546
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "w-2/3 xl:w-4/5 flex-row flex-wrap", children: [
79547
- types2.map((etype) => /* @__PURE__ */ jsxRuntimeExports.jsx(
79548
- Tag$1,
79549
- {
79550
- closable,
79551
- onClose: () => handleDelete(etype),
79552
- style: {
79553
- backgroundColor: "#f0f0f0",
79554
- borderRadius: "16px",
79555
- padding: "0 12px",
79556
- height: "32px",
79557
- display: "flex",
79558
- alignItems: "center",
79559
- margin: "4px"
79560
- },
79561
- children: getTypeLabelFromProfile(etype)
79562
- },
79563
- etype
79564
- )),
79565
- !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
79566
- Select,
79567
- {
79568
- value: selectedClass,
79569
- onChange: (value) => handleSave(value),
79570
- placeholder: t2("select_a_class_to_add"),
79571
- style: { width: 250, margin: "4px", height: "32px" },
79572
- children: classes.map((classOption) => /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Option, { value: classOption.value, children: classOption.label }, classOption.value))
79573
- }
79574
- )
79575
- ] })
79576
- ] });
79577
- };
79578
- const valueIsEmpty$1 = (value) => {
79579
- if (value === void 0 || value === null) return true;
79580
- if (typeof value === "string") return value.trim().length === 0;
79581
- if (Array.isArray(value)) return value.length === 0;
79582
- return false;
79583
- };
79584
- const formatValue = (value, emptyLabel) => {
79585
- if (valueIsEmpty$1(value)) return emptyLabel;
79586
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
79587
- return String(value);
79588
- }
79589
- try {
79590
- return JSON.stringify(value, null, 2);
79591
- } catch {
79592
- return String(value);
79593
- }
79594
- };
79595
- const AiFieldDiffView = ({
79596
- previousValue,
79597
- currentValue,
79598
- operation
79599
- }) => {
79600
- const { t: t2 } = useTranslation();
79601
- const isDelete = operation === "delete";
79602
- const emptyLabel = String(t2("ai_empty_value"));
79603
- const removedValue = formatValue(previousValue, emptyLabel);
79604
- const addedValue = isDelete ? emptyLabel : formatValue(currentValue, emptyLabel);
79605
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff", "aria-label": String(t2("ai_field_diff_aria")), children: [
79606
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff-head", children: [
79607
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isDelete ? t2("ai_proposed_deletion") : t2("ai_proposed_change") }),
79608
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recrate-ai-field-diff-chip", children: t2("ai_edit_chip") })
79609
- ] }),
79610
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff-line recrate-ai-field-diff-line-removed", children: [
79611
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recrate-ai-field-diff-marker", children: "-" }),
79612
- /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `recrate-ai-field-diff-value ${valueIsEmpty$1(previousValue) ? "recrate-ai-field-diff-empty" : ""}`, children: removedValue })
79613
- ] }),
79614
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-field-diff-line recrate-ai-field-diff-line-added", children: [
79615
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recrate-ai-field-diff-marker", children: "+" }),
79616
- /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `recrate-ai-field-diff-value ${valueIsEmpty$1(isDelete ? void 0 : currentValue) ? "recrate-ai-field-diff-empty" : ""}`, children: addedValue })
79617
- ] })
79618
- ] });
79599
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
79600
+ "div",
79601
+ {
79602
+ className: `flex flex-row flex-grow ${showAiReview ? `p-2 recrate-property-background recrate-ai-review ${isAiDelete ? "recrate-ai-delete" : "recrate-ai-suggestion"}` : ""} recrate-property recrate-property-name-type`,
79603
+ children: [
79604
+ showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-suggestion-badge", children: [
79605
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recrate-ai-suggestion-badge-icon", children: "✦" }),
79606
+ isAiDelete ? t2("ai_delete_badge") : t2("ai_suggestion_badge")
79607
+ ] }),
79608
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col recrate-property-heading", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-property-name recrate-property-name-with-ai", children: [
79609
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "@type" }),
79610
+ aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
79611
+ ] }) }),
79612
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-col flex-grow recrate-property-value", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-row gap-2 ${showAiReview ? "recrate-ai-field-row recrate-ai-type-field-row" : ""}`, children: [
79613
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-grow min-w-0 ${showAiReview ? "recrate-ai-field-control" : ""}`, children: showAiDiff && (aiReview == null ? void 0 : aiReview.previousValueDiffers) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
79614
+ AiFieldDiffView,
79615
+ {
79616
+ previousValue: aiReview == null ? void 0 : aiReview.previousValue,
79617
+ currentValue: types2,
79618
+ operation: aiReview == null ? void 0 : aiReview.operation
79619
+ }
79620
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row flex-wrap", children: [
79621
+ types2.map((etype) => /* @__PURE__ */ jsxRuntimeExports.jsx(
79622
+ Tag$1,
79623
+ {
79624
+ closable,
79625
+ onClose: () => handleDelete(etype),
79626
+ style: {
79627
+ backgroundColor: "#f0f0f0",
79628
+ borderRadius: "16px",
79629
+ padding: "0 12px",
79630
+ height: "32px",
79631
+ display: "flex",
79632
+ alignItems: "center",
79633
+ margin: "4px"
79634
+ },
79635
+ children: getTypeLabelFromProfile(etype)
79636
+ },
79637
+ etype
79638
+ )),
79639
+ !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
79640
+ Select,
79641
+ {
79642
+ value: selectedClass,
79643
+ onChange: (value) => handleSave(value),
79644
+ placeholder: t2("select_a_class_to_add"),
79645
+ style: { width: 250, margin: "4px", height: "32px" },
79646
+ children: classes.map((classOption) => /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Option, { value: classOption.value, children: classOption.label }, classOption.value))
79647
+ }
79648
+ )
79649
+ ] }) }),
79650
+ showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-actions recrate-ai-type-actions", children: [
79651
+ (aiReview == null ? void 0 : aiReview.previousValueDiffers) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiDiff ? t2("ai_hide_diff") : t2("ai_show_diff"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79652
+ Button$1,
79653
+ {
79654
+ size: "middle",
79655
+ className: "recrate-ai-action-diff",
79656
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}),
79657
+ "aria-label": showAiDiff ? String(t2("ai_hide_ai_diff_aria")) : String(t2("ai_show_ai_diff_aria")),
79658
+ "aria-pressed": showAiDiff,
79659
+ onClick: () => setShowAiDiff((visible) => !visible)
79660
+ }
79661
+ ) }),
79662
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isAiDelete ? t2("ai_approve_deletion_tooltip") : t2("ai_approve_suggested_value_tooltip"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79663
+ Button$1,
79664
+ {
79665
+ size: "middle",
79666
+ className: "recrate-ai-action-approve",
79667
+ onClick: aiReview == null ? void 0 : aiReview.onApprove,
79668
+ children: isAiDelete ? t2("ai_delete") : t2("ai_accept")
79669
+ }
79670
+ ) }),
79671
+ (aiReview == null ? void 0 : aiReview.previousValueDiffers) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: t2("ai_restore_previous_value_tooltip"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79672
+ Button$1,
79673
+ {
79674
+ size: "middle",
79675
+ className: "recrate-ai-action-reject",
79676
+ onClick: aiReview == null ? void 0 : aiReview.onReject,
79677
+ children: isAiDelete ? t2("ai_restore") : t2("ai_reject")
79678
+ }
79679
+ ) })
79680
+ ] })
79681
+ ] }) })
79682
+ ]
79683
+ }
79684
+ );
79619
79685
  };
79620
79686
  const EntityName = ({
79621
79687
  entity,
@@ -79637,20 +79703,20 @@ const EntityName = ({
79637
79703
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
79638
79704
  "div",
79639
79705
  {
79640
- className: `flex flex-row ${showAiReview ? `${showHelp ? "p-2" : "px-2 py-1 recrate-property-compact"} recrate-ai-review ${isAiDelete ? "recrate-ai-delete" : "recrate-ai-suggestion"}` : ""} recrate-property recrate-property-name-name`,
79706
+ className: `flex flex-row flex-grow ${showAiReview ? `${showHelp ? "p-2" : "px-2 py-1 recrate-property-compact"} recrate-property-background recrate-ai-review ${isAiDelete ? "recrate-ai-delete" : "recrate-ai-suggestion"}` : ""} recrate-property recrate-property-name-name`,
79641
79707
  children: [
79642
79708
  showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-ai-suggestion-badge", children: [
79643
79709
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "recrate-ai-suggestion-badge-icon", children: "✦" }),
79644
79710
  isAiDelete ? t2("ai_delete_badge") : t2("ai_suggestion_badge")
79645
79711
  ] }),
79646
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col", children: [
79712
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col recrate-property-heading", children: [
79647
79713
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate-property-name recrate-property-name-with-ai", children: [
79648
79714
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("name_field_label") }),
79649
79715
  aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
79650
79716
  ] }),
79651
79717
  showHelp && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 font-light text-xs pr-1 recrate-property-help", children: t2("name_field_help") })
79652
79718
  ] }),
79653
- !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-row gap-2 ${showAiReview ? "recrate-ai-field-row" : ""}`, children: [
79719
+ !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-col flex-grow recrate-property-value", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-row gap-2 ${showAiReview ? "recrate-ai-field-row" : ""}`, children: [
79654
79720
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-grow min-w-0 ${showAiReview ? "recrate-ai-field-control" : ""}`, children: showAiDiff && (aiReview == null ? void 0 : aiReview.previousValueDiffers) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
79655
79721
  AiFieldDiffView,
79656
79722
  {
@@ -79729,7 +79795,13 @@ const CoreEntityFields = ({
79729
79795
  }) => {
79730
79796
  const renderRequiredWarning = !readonly && missingRequiredData;
79731
79797
  const idIsVisible = shouldRenderCoreField("@id");
79798
+ const typeAiReview = getCoreAiReviewProps("@type");
79799
+ const nameAiReview = getCoreAiReviewProps("name");
79800
+ const typeWrapperClassName = typeAiReview ? "" : `p-2 recrate-property recrate-property-name-type ${selectedAiApprovalProperty === "@type" ? "recrate-ai-review-current" : ""}`;
79801
+ const nameWrapperClassName = nameAiReview ? "" : `p-2 recrate-property recrate-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded" : ""}`;
79732
79802
  if (layout === "untabbed") {
79803
+ const untabbedTypeWrapperClassName = typeAiReview ? "" : `my-2 ${typeWrapperClassName}`;
79804
+ const untabbedNameWrapperClassName = nameAiReview ? "" : `my-2 p-2 recrate-property recrate-property-name-name ${savedProperty === "name" ? untabbedNameSavedClassName : ""}`;
79733
79805
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
79734
79806
  idIsVisible && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 my-2 p-2", children: [
79735
79807
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -79754,20 +79826,21 @@ const CoreEntityFields = ({
79754
79826
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
79755
79827
  /* @__PURE__ */ jsxRuntimeExports.jsx(RequiredPropertiesWarningButton, { onClick: onToggleHighlightRequiredProperties })
79756
79828
  ] }),
79757
- shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `my-2 p-2 recrate-property recrate-property-name-type ${selectedAiApprovalProperty === "@type" ? "recrate-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79829
+ shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: untabbedTypeWrapperClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79758
79830
  EntityType,
79759
79831
  {
79760
79832
  entity,
79761
79833
  onUpdateEntity: onUpdateCoreProperty,
79762
79834
  aiEdited: fieldWasAiEdited("@type"),
79763
- aiEditedVariant: fieldAiEditedVariant("@type")
79835
+ aiEditedVariant: fieldAiEditedVariant("@type"),
79836
+ aiReview: typeAiReview
79764
79837
  }
79765
79838
  ) }),
79766
79839
  shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
79767
79840
  "div",
79768
79841
  {
79769
79842
  "data-recrate-property": "name",
79770
- className: `my-2 p-2 recrate-property recrate-property-name-name ${savedProperty === "name" ? untabbedNameSavedClassName : ""}`,
79843
+ className: untabbedNameWrapperClassName,
79771
79844
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79772
79845
  EntityName,
79773
79846
  {
@@ -79776,7 +79849,7 @@ const CoreEntityFields = ({
79776
79849
  showHelp: showFieldHelp,
79777
79850
  aiEdited: fieldWasAiEdited("name"),
79778
79851
  aiEditedVariant: fieldAiEditedVariant("name"),
79779
- aiReview: getCoreAiReviewProps("name")
79852
+ aiReview: nameAiReview
79780
79853
  }
79781
79854
  )
79782
79855
  }
@@ -79800,20 +79873,21 @@ const CoreEntityFields = ({
79800
79873
  )
79801
79874
  }
79802
79875
  ),
79803
- shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `p-2 recrate-property recrate-property-name-type ${selectedAiApprovalProperty === "@type" ? "recrate-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79876
+ shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: typeWrapperClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79804
79877
  EntityType,
79805
79878
  {
79806
79879
  entity,
79807
79880
  onUpdateEntity: onUpdateCoreProperty,
79808
79881
  aiEdited: fieldWasAiEdited("@type"),
79809
- aiEditedVariant: fieldAiEditedVariant("@type")
79882
+ aiEditedVariant: fieldAiEditedVariant("@type"),
79883
+ aiReview: typeAiReview
79810
79884
  }
79811
79885
  ) }),
79812
79886
  shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
79813
79887
  "div",
79814
79888
  {
79815
79889
  "data-recrate-property": "name",
79816
- className: `p-2 recrate-property recrate-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded" : ""}`,
79890
+ className: nameWrapperClassName,
79817
79891
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
79818
79892
  EntityName,
79819
79893
  {
@@ -79822,7 +79896,7 @@ const CoreEntityFields = ({
79822
79896
  showHelp: showFieldHelp,
79823
79897
  aiEdited: fieldWasAiEdited("name"),
79824
79898
  aiEditedVariant: fieldAiEditedVariant("name"),
79825
- aiReview: getCoreAiReviewProps("name")
79899
+ aiReview: nameAiReview
79826
79900
  }
79827
79901
  )
79828
79902
  }
@@ -95560,11 +95634,13 @@ const DialogAddProperty = ({
95560
95634
  onClose,
95561
95635
  onManageSchemas,
95562
95636
  open,
95563
- onAddPropertyPlaceholder
95637
+ onAddPropertyPlaceholder,
95638
+ enableSchemaSelectorButton = true
95564
95639
  }) => {
95565
95640
  const { t: t2 } = useTranslation();
95566
95641
  const profileManager = useContext(ProfileManagerContext);
95567
95642
  const schemaState = useSchemaRegistry();
95643
+ const schemaSelectorEnabled = enableSchemaSelectorButton !== false;
95568
95644
  const [filter2, setFilter] = useState("");
95569
95645
  const deferredFilter = useDeferredValue(filter2);
95570
95646
  const loadedSchemas = React__default.useMemo(
@@ -95572,25 +95648,45 @@ const DialogAddProperty = ({
95572
95648
  [schemaState]
95573
95649
  );
95574
95650
  const [selectedSchema, setSelectedSchema] = useState(getStoredSchemaFilter);
95651
+ const deferredSelectedSchema = useDeferredValue(selectedSchema);
95575
95652
  const [onlyMatchingProperties, setOnlyMatchingProperties] = useState(true);
95576
95653
  const deferredOnlyMatchingProperties = useDeferredValue(onlyMatchingProperties);
95577
95654
  const [selectedPropertyName, setSelectedPropertyName] = useState(null);
95655
+ const [catalogReady, setCatalogReady] = useState(false);
95656
+ const listUpdating = open && !catalogReady || deferredFilter !== filter2 || deferredSelectedSchema !== selectedSchema || deferredOnlyMatchingProperties !== onlyMatchingProperties;
95578
95657
  useEffect(() => {
95579
95658
  if (open) {
95580
95659
  setSelectedPropertyName(null);
95581
95660
  }
95582
95661
  }, [open]);
95583
95662
  useEffect(() => {
95663
+ if (!open) {
95664
+ setCatalogReady(false);
95665
+ return void 0;
95666
+ }
95667
+ if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
95668
+ const frameId = window.requestAnimationFrame(() => setCatalogReady(true));
95669
+ return () => window.cancelAnimationFrame(frameId);
95670
+ }
95671
+ const timeoutId = setTimeout(() => setCatalogReady(true), 0);
95672
+ return () => clearTimeout(timeoutId);
95673
+ }, [open]);
95674
+ useEffect(() => {
95675
+ if (!schemaSelectorEnabled || typeof window === "undefined") return;
95584
95676
  window.localStorage.setItem(SELECTED_SCHEMA_STORAGE_KEY, selectedSchema);
95585
- }, [selectedSchema]);
95677
+ }, [schemaSelectorEnabled, selectedSchema]);
95586
95678
  const availableInputs = React__default.useMemo(() => {
95679
+ if (!open || !catalogReady) return [];
95587
95680
  if (!(entity == null ? void 0 : entity["@type"])) return [];
95588
- const { inputs: inputs2 } = deferredOnlyMatchingProperties ? profileManager.getAllInputs({ entity }) : profileManager.getAllPropertyInputs();
95681
+ const { inputs: inputs2 } = schemaSelectorEnabled && deferredOnlyMatchingProperties ? profileManager.getAllInputs({ entity }) : profileManager.getAllPropertyInputs();
95589
95682
  return inputs2;
95590
95683
  }, [
95591
95684
  deferredOnlyMatchingProperties,
95592
95685
  entity,
95686
+ catalogReady,
95687
+ open,
95593
95688
  profileManager,
95689
+ schemaSelectorEnabled,
95594
95690
  schemaState.revision
95595
95691
  ]);
95596
95692
  const indexedInputs = React__default.useMemo(
@@ -95611,21 +95707,23 @@ const DialogAddProperty = ({
95611
95707
  const inputs = React__default.useMemo(() => {
95612
95708
  const query = deferredFilter.toLowerCase();
95613
95709
  return indexedInputs.filter(({ schemaId, searchText }) => {
95614
- const matchesSchema = selectedSchema === ALL_SCHEMAS_ID || selectedSchema === schemaId;
95710
+ const matchesSchema = !schemaSelectorEnabled || deferredSelectedSchema === ALL_SCHEMAS_ID || deferredSelectedSchema === schemaId;
95615
95711
  const matchesText = !query || searchText.includes(query);
95616
95712
  return matchesSchema && matchesText;
95617
95713
  }).map(({ input }) => input);
95618
95714
  }, [
95619
95715
  deferredFilter,
95716
+ deferredSelectedSchema,
95620
95717
  indexedInputs,
95621
- selectedSchema
95718
+ schemaSelectorEnabled
95622
95719
  ]);
95623
95720
  const rowHeight = ke({
95624
95721
  defaultRowHeight: 88,
95625
95722
  key: [
95626
95723
  entity == null ? void 0 : entity["@id"],
95627
95724
  [].concat((entity == null ? void 0 : entity["@type"]) ?? []).join(","),
95628
- selectedSchema,
95725
+ schemaSelectorEnabled,
95726
+ deferredSelectedSchema,
95629
95727
  deferredOnlyMatchingProperties,
95630
95728
  deferredFilter,
95631
95729
  schemaState.revision
@@ -95646,6 +95744,7 @@ const DialogAddProperty = ({
95646
95744
  ];
95647
95745
  }, [loadedSchemas, t2]);
95648
95746
  const selectedSchemaDetails = React__default.useMemo(() => {
95747
+ if (!schemaSelectorEnabled) return null;
95649
95748
  if (selectedSchema === ALL_SCHEMAS_ID) return null;
95650
95749
  const registration = loadedSchemas.find((schema) => schema.id === selectedSchema);
95651
95750
  const loaded2 = schemaState.loadedSchemas[selectedSchema];
@@ -95660,8 +95759,9 @@ const DialogAddProperty = ({
95660
95759
  propertyCount: loaded2.properties.length,
95661
95760
  domainNames
95662
95761
  };
95663
- }, [loadedSchemas, schemaState.loadedSchemas, selectedSchema]);
95762
+ }, [loadedSchemas, schemaSelectorEnabled, schemaState.loadedSchemas, selectedSchema]);
95664
95763
  useEffect(() => {
95764
+ if (!schemaSelectorEnabled) return;
95665
95765
  if (loadedSchemas.length === 1) {
95666
95766
  if (selectedSchema !== loadedSchemas[0].id) {
95667
95767
  setSelectedSchema(loadedSchemas[0].id);
@@ -95671,7 +95771,7 @@ const DialogAddProperty = ({
95671
95771
  if (selectedSchema !== ALL_SCHEMAS_ID && !schemaOptions.some((option) => option.value === selectedSchema)) {
95672
95772
  setSelectedSchema(ALL_SCHEMAS_ID);
95673
95773
  }
95674
- }, [loadedSchemas, schemaOptions, selectedSchema]);
95774
+ }, [loadedSchemas, schemaOptions, schemaSelectorEnabled, selectedSchema]);
95675
95775
  const handlePropertySelection = useCallback((item) => {
95676
95776
  if (!(item == null ? void 0 : item.name) || selectedPropertyName === item.name) return;
95677
95777
  setSelectedPropertyName(item.name);
@@ -95699,7 +95799,7 @@ const DialogAddProperty = ({
95699
95799
  open,
95700
95800
  width: 600,
95701
95801
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { vertical: true, gap: 16, className: "h-full", children: [
95702
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 8, wrap: true, children: [
95802
+ schemaSelectorEnabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 8, wrap: true, children: [
95703
95803
  /* @__PURE__ */ jsxRuntimeExports.jsx(
95704
95804
  Select,
95705
95805
  {
@@ -95718,6 +95818,7 @@ const DialogAddProperty = ({
95718
95818
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}),
95719
95819
  "aria-label": String(t2("manage_schemas")),
95720
95820
  onClick: onManageSchemas,
95821
+ disabled: !onManageSchemas,
95721
95822
  children: t2("manage_schemas")
95722
95823
  }
95723
95824
  )
@@ -95734,7 +95835,7 @@ const DialogAddProperty = ({
95734
95835
  ),
95735
95836
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "primary", size: "middle", children: t2("search") || "Search" })
95736
95837
  ] }),
95737
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
95838
+ schemaSelectorEnabled && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
95738
95839
  /* @__PURE__ */ jsxRuntimeExports.jsx(
95739
95840
  Checkbox,
95740
95841
  {
@@ -95752,11 +95853,11 @@ const DialogAddProperty = ({
95752
95853
  }
95753
95854
  )
95754
95855
  ] }),
95755
- schemaState.loadingSchemaIds.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
95856
+ schemaSelectorEnabled && schemaState.loadingSchemaIds.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
95756
95857
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, { size: "small" }),
95757
95858
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", children: t2("loading_registered_schemas") })
95758
95859
  ] }),
95759
- Object.keys(schemaState.schemaErrors).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
95860
+ schemaSelectorEnabled && Object.keys(schemaState.schemaErrors).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
95760
95861
  Alert,
95761
95862
  {
95762
95863
  type: "warning",
@@ -95766,42 +95867,63 @@ const DialogAddProperty = ({
95766
95867
  })
95767
95868
  }
95768
95869
  ),
95769
- inputs.length === 0 && schemaState.loadingSchemaIds.length === 0 && selectedSchemaDetails && deferredOnlyMatchingProperties && !filter2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
95770
- Alert,
95771
- {
95772
- type: "info",
95773
- showIcon: true,
95774
- message: t2("no_schema_properties_apply", {
95775
- schema: selectedSchemaDetails.displayName
95776
- }),
95777
- description: t2("no_schema_properties_description", {
95778
- count: selectedSchemaDetails.propertyCount,
95779
- schema: selectedSchemaDetails.displayName,
95780
- domains: selectedSchemaDetails.domainNames.join(", "),
95781
- types: [].concat((entity == null ? void 0 : entity["@type"]) ?? []).join(", ")
95782
- })
95783
- }
95784
- ),
95785
- inputs.length === 0 && schemaState.loadingSchemaIds.length === 0 && (!selectedSchemaDetails || !deferredOnlyMatchingProperties || Boolean(deferredFilter)) && /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", children: t2("no_properties_match_filters") }),
95786
- inputs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recrate-add-property-list", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
95787
- Ae,
95870
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
95871
+ "div",
95788
95872
  {
95789
- "aria-label": String(t2("available_properties")),
95790
- defaultHeight: 600,
95791
- overscanCount: 6,
95792
- rowComponent: PropertyRow,
95793
- rowCount: inputs.length,
95794
- rowHeight,
95795
- rowProps: {
95796
- inputs,
95797
- profileOrOther: t2("profile_or_other"),
95798
- selectedPropertyName,
95799
- onSelect: handlePropertySelection,
95800
- onKeyDown: handlePropertyKeyDown
95801
- },
95802
- style: { height: "100%", width: "100%" }
95873
+ className: `recrate-add-property-results ${listUpdating ? "recrate-add-property-results-updating" : ""}`,
95874
+ "aria-busy": listUpdating,
95875
+ children: [
95876
+ listUpdating && /* @__PURE__ */ jsxRuntimeExports.jsxs(
95877
+ "div",
95878
+ {
95879
+ className: "recrate-add-property-results-mask",
95880
+ role: "status",
95881
+ "aria-live": "polite",
95882
+ children: [
95883
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, { size: "small" }),
95884
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: t2("updating_property_list") })
95885
+ ]
95886
+ }
95887
+ ),
95888
+ inputs.length === 0 && !listUpdating && (!schemaSelectorEnabled || schemaState.loadingSchemaIds.length === 0) && selectedSchemaDetails && deferredOnlyMatchingProperties && !filter2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
95889
+ Alert,
95890
+ {
95891
+ type: "info",
95892
+ showIcon: true,
95893
+ message: t2("no_schema_properties_apply", {
95894
+ schema: selectedSchemaDetails.displayName
95895
+ }),
95896
+ description: t2("no_schema_properties_description", {
95897
+ count: selectedSchemaDetails.propertyCount,
95898
+ schema: selectedSchemaDetails.displayName,
95899
+ domains: selectedSchemaDetails.domainNames.join(", "),
95900
+ types: [].concat((entity == null ? void 0 : entity["@type"]) ?? []).join(", ")
95901
+ })
95902
+ }
95903
+ ),
95904
+ inputs.length === 0 && !listUpdating && (!schemaSelectorEnabled || schemaState.loadingSchemaIds.length === 0) && (!selectedSchemaDetails || !deferredOnlyMatchingProperties || Boolean(deferredFilter)) && /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", children: t2("no_properties_match_filters") }),
95905
+ inputs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "recrate-add-property-list", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
95906
+ Ae,
95907
+ {
95908
+ "aria-label": String(t2("available_properties")),
95909
+ defaultHeight: 600,
95910
+ overscanCount: 6,
95911
+ rowComponent: PropertyRow,
95912
+ rowCount: inputs.length,
95913
+ rowHeight,
95914
+ rowProps: {
95915
+ inputs,
95916
+ profileOrOther: t2("profile_or_other"),
95917
+ selectedPropertyName,
95918
+ onSelect: handlePropertySelection,
95919
+ onKeyDown: handlePropertyKeyDown
95920
+ },
95921
+ style: { height: "100%", width: "100%" }
95922
+ }
95923
+ ) })
95924
+ ]
95803
95925
  }
95804
- ) })
95926
+ )
95805
95927
  ] })
95806
95928
  }
95807
95929
  );
@@ -122133,7 +122255,7 @@ const RenderControls = ({
122133
122255
  onSaveEntityTemplate,
122134
122256
  onUpdateContext
122135
122257
  }) => {
122136
- var _a2, _b, _c, _d, _e2, _f, _g;
122258
+ var _a2, _b, _c, _d, _e2, _f, _g, _h;
122137
122259
  const { t: t2 } = useTranslation();
122138
122260
  const state = useStateStore();
122139
122261
  const debugNav = (...args) => console.log("[recrate-nav-debug][controls]", ...args);
@@ -122174,6 +122296,7 @@ const RenderControls = ({
122174
122296
  };
122175
122297
  const canGoBack = state.editorState.canBack();
122176
122298
  const canGoForward = state.editorState.canForward();
122299
+ const schemaSelectorEnabled = ((_a2 = state.configuration) == null ? void 0 : _a2.enableSchemaSelectorButton) !== false;
122177
122300
  const handleBack = () => {
122178
122301
  if (!canGoBack) return;
122179
122302
  const before = state.editorState.latest();
@@ -122239,7 +122362,7 @@ const RenderControls = ({
122239
122362
  }
122240
122363
  )
122241
122364
  ] }),
122242
- !((_a2 = state.configuration) == null ? void 0 : _a2.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122365
+ !((_b = state.configuration) == null ? void 0 : _b.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122243
122366
  Button$1,
122244
122367
  {
122245
122368
  onClick: () => toggle("addProperty"),
@@ -122248,7 +122371,7 @@ const RenderControls = ({
122248
122371
  children: t2("add_label")
122249
122372
  }
122250
122373
  ),
122251
- !((_b = state.configuration) == null ? void 0 : _b.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122374
+ !((_c = state.configuration) == null ? void 0 : _c.readonly) && schemaSelectorEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx(
122252
122375
  Button$1,
122253
122376
  {
122254
122377
  onClick: () => toggle("schemas"),
@@ -122257,7 +122380,7 @@ const RenderControls = ({
122257
122380
  children: t2("schemas_label")
122258
122381
  }
122259
122382
  ),
122260
- ((_c = state.configuration) == null ? void 0 : _c.enableContextEditor) && !((_d = state.configuration) == null ? void 0 : _d.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122383
+ ((_d = state.configuration) == null ? void 0 : _d.enableContextEditor) && !((_e2 = state.configuration) == null ? void 0 : _e2.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122261
122384
  Button$1,
122262
122385
  {
122263
122386
  onClick: () => toggle("editContext"),
@@ -122266,7 +122389,7 @@ const RenderControls = ({
122266
122389
  children: t2("edit_context_label")
122267
122390
  }
122268
122391
  ),
122269
- ((_e2 = state.configuration) == null ? void 0 : _e2.enableCratePreview) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122392
+ ((_f = state.configuration) == null ? void 0 : _f.enableCratePreview) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122270
122393
  Button$1,
122271
122394
  {
122272
122395
  onClick: () => toggle("previewCrate"),
@@ -122275,7 +122398,7 @@ const RenderControls = ({
122275
122398
  children: t2("preview_label")
122276
122399
  }
122277
122400
  ),
122278
- ((_f = state.configuration) == null ? void 0 : _f.enableBrowseEntities) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122401
+ ((_g = state.configuration) == null ? void 0 : _g.enableBrowseEntities) && /* @__PURE__ */ jsxRuntimeExports.jsx(
122279
122402
  Button$1,
122280
122403
  {
122281
122404
  onClick: () => toggle("browseEntities"),
@@ -122285,7 +122408,7 @@ const RenderControls = ({
122285
122408
  }
122286
122409
  ),
122287
122410
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row space-x-1", children: [
122288
- ((_g = state.configuration) == null ? void 0 : _g.enableTemplateSave) && !isRootDataset && !isRootDescriptor && /* @__PURE__ */ jsxRuntimeExports.jsx(
122411
+ ((_h = state.configuration) == null ? void 0 : _h.enableTemplateSave) && !isRootDataset && !isRootDescriptor && /* @__PURE__ */ jsxRuntimeExports.jsx(
122289
122412
  Button$1,
122290
122413
  {
122291
122414
  onClick: () => toggle("saveEntityAsTemplate"),
@@ -122329,7 +122452,8 @@ const RenderControls = ({
122329
122452
  onAddPropertyPlaceholder,
122330
122453
  open: dialogs.addProperty,
122331
122454
  onClose: () => toggle("addProperty"),
122332
- onManageSchemas: openSchemasFromAddProperty
122455
+ onManageSchemas: schemaSelectorEnabled ? openSchemasFromAddProperty : void 0,
122456
+ enableSchemaSelectorButton: schemaSelectorEnabled
122333
122457
  }
122334
122458
  ),
122335
122459
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -126530,7 +126654,7 @@ function getContextDefinition(id2) {
126530
126654
  const entityDateCreatedProperty = "hasCreationDate";
126531
126655
  const entityDateUpdatedProperty = "hasModificationDate";
126532
126656
  const structuredClone = function(data) {
126533
- return window.structuredClone(data);
126657
+ return globalThis.structuredClone(data);
126534
126658
  };
126535
126659
  class CrateManager {
126536
126660
  constructor({
@@ -127485,6 +127609,7 @@ class CrateManager {
127485
127609
 
127486
127610
  */
127487
127611
  deleteProperty({ id: id2, property, idx }) {
127612
+ var _a2;
127488
127613
  if (!id2) throw new Error(`'deleteProperty' requires 'id' to be defined`);
127489
127614
  if (!property) throw new Error(`deleteProperty' requires 'property' to be defined`);
127490
127615
  let entity;
@@ -127492,11 +127617,11 @@ class CrateManager {
127492
127617
  const indexRef = this.entityIdIndex[id2];
127493
127618
  entity = this.crate["@graph"][indexRef];
127494
127619
  if (isUndefined(entity)) return;
127495
- let { propertyDefinition } = this.pm.getPropertyDefinition({
127620
+ const propertyDefinition = (_a2 = this.pm) == null ? void 0 : _a2.getPropertyDefinition({
127496
127621
  property,
127497
127622
  entity
127498
- });
127499
- if (propertyDefinition.handlesMultipleValues === true) {
127623
+ }).propertyDefinition;
127624
+ if ((propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) === true) {
127500
127625
  delete entity[property];
127501
127626
  } else {
127502
127627
  entity[property].splice(idx, 1);
@@ -130544,6 +130669,10 @@ class ProfileManager {
130544
130669
  this.__processInputs();
130545
130670
  }
130546
130671
  }
130672
+ normaliseEntityTypes(entity) {
130673
+ const rawTypes = entity == null ? void 0 : entity["@type"];
130674
+ return compact([].concat(rawTypes));
130675
+ }
130547
130676
  /**
130548
130677
  * Process input definitions for certain types.
130549
130678
  *
@@ -130598,8 +130727,9 @@ class ProfileManager {
130598
130727
  var _a2;
130599
130728
  if (!((_a2 = this.profile) == null ? void 0 : _a2.layouts) || !this.profile.layouts.length) return null;
130600
130729
  let layouts = this.profile.layouts;
130730
+ const entityTypes = this.normaliseEntityTypes(entity);
130601
130731
  let layout = layouts.filter((layout2) => {
130602
- return intersection(layout2.appliesTo, entity["@type"]).length;
130732
+ return intersection(layout2.appliesTo, entityTypes).length;
130603
130733
  });
130604
130734
  if (!layout.length) return null;
130605
130735
  let firstMatchingLayout = layout[0];
@@ -130662,7 +130792,7 @@ class ProfileManager {
130662
130792
  *
130663
130793
  */
130664
130794
  getEntityTypeHierarchy({ entity }) {
130665
- let types2 = entity["@type"];
130795
+ let types2 = this.normaliseEntityTypes(entity);
130666
130796
  types2 = this.mapTypeHierarchies({ types: types2 });
130667
130797
  return types2;
130668
130798
  }
@@ -130680,7 +130810,7 @@ class ProfileManager {
130680
130810
  property,
130681
130811
  entity
130682
130812
  }) {
130683
- const typeList = Array.isArray(entity["@type"]) ? entity["@type"] : [entity["@type"]];
130813
+ const typeList = this.normaliseEntityTypes(entity);
130684
130814
  const cacheKey = `${schemaRegistry.getSnapshot().revision}::${typeList.slice().sort().join("|")}::${property.toLowerCase()}`;
130685
130815
  const cachedPropertyDefinition = this.propertyDefinitionCache.get(cacheKey);
130686
130816
  if (cachedPropertyDefinition) {
@@ -130701,6 +130831,13 @@ class ProfileManager {
130701
130831
  propertyDefinition = cloneDeep(definition[0]);
130702
130832
  }
130703
130833
  }
130834
+ if (isEmpty(propertyDefinition)) {
130835
+ let { inputs: inputs2 } = this.getAllPropertyInputs();
130836
+ let definition = inputs2.filter((p2) => p2.name.toLowerCase() === property.toLowerCase());
130837
+ if (definition.length) {
130838
+ propertyDefinition = cloneDeep(definition[0]);
130839
+ }
130840
+ }
130704
130841
  if (isEmpty(propertyDefinition)) {
130705
130842
  propertyDefinition = {
130706
130843
  id: "",
@@ -130755,7 +130892,7 @@ class ProfileManager {
130755
130892
  */
130756
130893
  getInputsFromProfile({ entity }) {
130757
130894
  var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
130758
- let types2 = entity["@type"];
130895
+ const types2 = this.normaliseEntityTypes(entity);
130759
130896
  let inputs = [];
130760
130897
  for (let type4 of types2) {
130761
130898
  if ((_b = (_a2 = this.profile) == null ? void 0 : _a2.classes) == null ? void 0 : _b[type4]) {
@@ -130813,8 +130950,12 @@ class ProfileManager {
130813
130950
  * and loaded runtime schemas without applying entity type restrictions.
130814
130951
  */
130815
130952
  getAllPropertyInputs() {
130816
- var _a2;
130817
- const profileInputs = Object.values(((_a2 = this.profile) == null ? void 0 : _a2.classes) ?? {}).flatMap(
130953
+ var _a2, _b;
130954
+ const revision = schemaRegistry.getSnapshot().revision;
130955
+ if (((_a2 = this.allPropertyInputsCache) == null ? void 0 : _a2.revision) === revision) {
130956
+ return { inputs: this.allPropertyInputsCache.inputs };
130957
+ }
130958
+ const profileInputs = Object.values(((_b = this.profile) == null ? void 0 : _b.classes) ?? {}).flatMap(
130818
130959
  (definition) => definition.inputs ?? []
130819
130960
  );
130820
130961
  const inputs = uniqBy(
@@ -130825,7 +130966,9 @@ class ProfileManager {
130825
130966
  ],
130826
130967
  "id"
130827
130968
  );
130828
- return { inputs: orderBy(inputs, "name") };
130969
+ const orderedInputs = orderBy(inputs, "name");
130970
+ this.allPropertyInputsCache = { revision, inputs: orderedInputs };
130971
+ return { inputs: orderedInputs };
130829
130972
  }
130830
130973
  /**
130831
130974
  *
@@ -130839,7 +130982,7 @@ class ProfileManager {
130839
130982
  * be exclusive rather than inclusive
130840
130983
  */
130841
130984
  getTypeDefinition({ entity }) {
130842
- let types2 = entity["@type"];
130985
+ const types2 = this.normaliseEntityTypes(entity);
130843
130986
  let directive = types2.map((type4) => {
130844
130987
  var _a2, _b, _c;
130845
130988
  return (_c = (_b = (_a2 = this.profile) == null ? void 0 : _a2.classes) == null ? void 0 : _b[type4]) == null ? void 0 : _c.definition;
@@ -133591,6 +133734,7 @@ const en = {
133591
133734
  matching_properties_help: "When enabled, only properties that are allowed on the current type are shown. Should only be deactivated by experts.",
133592
133735
  about_matching_properties: "About matching properties",
133593
133736
  loading_registered_schemas: "Loading registered schemas...",
133737
+ updating_property_list: "Updating properties...",
133594
133738
  registered_schemas_load_error_one: "{{count}} registered schema could not be loaded",
133595
133739
  registered_schemas_load_error_other: "{{count}} registered schemas could not be loaded",
133596
133740
  no_schema_properties_apply: "No {{schema}} properties apply to this entity",
@@ -133832,9 +133976,7 @@ const en = {
133832
133976
  ai_approve_suggested_value_tooltip: "Approve this AI-suggested value",
133833
133977
  ai_restore_previous_value_tooltip: "Restore the previous value and mark this suggestion reviewed",
133834
133978
  ai_delete: "Delete",
133835
- ai_accept: "Accept",
133836
133979
  ai_restore: "Restore",
133837
- ai_reject: "Reject",
133838
133980
  // DeletedLinkedEntityCard.tsx
133839
133981
  ai_fields_can_be_restored_one: "{{count}} field can be restored.",
133840
133982
  ai_fields_can_be_restored_other: "{{count}} fields can be restored.",
@@ -133898,6 +134040,7 @@ const hu = {
133898
134040
  matching_properties_help: "Ha engedélyezve van, csak az aktuális típusnál megengedett tulajdonságok jelennek meg. Kikapcsolása csak szakértőknek ajánlott.",
133899
134041
  about_matching_properties: "Az illeszkedő tulajdonságok ismertetése",
133900
134042
  loading_registered_schemas: "Regisztrált sémák betöltése...",
134043
+ updating_property_list: "Tulajdonságok frissítése...",
133901
134044
  registered_schemas_load_error_one: "{{count}} regisztrált séma nem tölthető be",
133902
134045
  registered_schemas_load_error_other: "{{count}} regisztrált séma nem tölthető be",
133903
134046
  no_schema_properties_apply: "A(z) {{schema}} egyetlen tulajdonsága sem alkalmazható erre az entitásra",
@@ -134082,9 +134225,17 @@ const hu = {
134082
134225
  ai_review_next_entity_tooltip: "Következő, AI módosítással rendelkező entitás ellenőrzése",
134083
134226
  ai_no_other_entities_need_review: "Nincs több AI ellenőrzésre váró entitás",
134084
134227
  ai_accept_all_tooltip: "Az entitás összes függőben lévő AI módosításának elfogadása",
134228
+ ai_accept: "Elfogadás",
134229
+ ai_accept_all_global_tooltip: "A crate összes függőben lévő AI módosításának elfogadása",
134085
134230
  ai_accept_all: "Összes elfogadása",
134231
+ ai_accept_and_review_tooltip: "Az entitás összes függőben lévő AI módosításának elfogadása, majd a következő entitás ellenőrzése",
134232
+ ai_accept_and_review: "Elfogadás és ellenőrzés",
134086
134233
  ai_reject_all_tooltip: "Az entitás összes függőben lévő AI módosításának visszaállítása az előző értékre",
134234
+ ai_reject: "Elutasítás",
134235
+ ai_reject_all_global_tooltip: "A crate összes függőben lévő AI módosításának visszaállítása az előző értékre",
134087
134236
  ai_reject_all: "Összes elutasítása",
134237
+ ai_reject_and_review_tooltip: "Az entitás összes függőben lévő AI módosításának visszaállítása, majd a következő entitás ellenőrzése",
134238
+ ai_reject_and_review: "Elutasítás és ellenőrzés",
134088
134239
  ai_pending_field_navigation_aria: "Függőben lévő AI mezők navigációja",
134089
134240
  ai_previous_pending_field: "Előző függő mező",
134090
134241
  ai_previous_pending_field_aria: "Előző függőben lévő AI mező",
@@ -134131,9 +134282,7 @@ const hu = {
134131
134282
  ai_approve_suggested_value_tooltip: "AI által javasolt érték jóváhagyása",
134132
134283
  ai_restore_previous_value_tooltip: "Előző érték visszaállítása és a javaslat ellenőrzöttként jelölése",
134133
134284
  ai_delete: "Törlés",
134134
- ai_accept: "Elfogadás",
134135
134285
  ai_restore: "Visszaállítás",
134136
- ai_reject: "Elutasítás",
134137
134286
  // DeletedLinkedEntityCard.tsx
134138
134287
  ai_fields_can_be_restored_one: "{{count}} mező visszaállítható.",
134139
134288
  ai_fields_can_be_restored_other: "{{count}} mező visszaállítható.",
@@ -134198,6 +134347,9 @@ const propertyDefinitions = {
134198
134347
  enableBulkAdd: {
134199
134348
  default: true
134200
134349
  },
134350
+ enableSchemaSelectorButton: {
134351
+ default: true
134352
+ },
134201
134353
  enableReverseLinkBrowser: {
134202
134354
  default: false
134203
134355
  },
@@ -135025,7 +135177,7 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
135025
135177
  }) : null
135026
135178
  );
135027
135179
  var CacheProvider = EmotionCacheContext.Provider;
135028
- const version = "0.1.42-test";
135180
+ const version = "0.1.43-test";
135029
135181
  const pkg = {
135030
135182
  version
135031
135183
  };
@@ -135217,6 +135369,7 @@ function RecrateCrateBuilderInner(props) {
135217
135369
  enableBrowseEntities = propertyDefinitions.enableBrowseEntities.default,
135218
135370
  enableTemplateSave = propertyDefinitions.enableTemplateSave.default,
135219
135371
  enableBulkAdd = propertyDefinitions.enableBulkAdd.default,
135372
+ enableSchemaSelectorButton = propertyDefinitions.enableSchemaSelectorButton.default,
135220
135373
  enableProfileActions,
135221
135374
  enableReverseLinkBrowser = propertyDefinitions.enableReverseLinkBrowser.default,
135222
135375
  enableUrlMarkup = propertyDefinitions.enableUrlMarkup.default,
@@ -135364,6 +135517,7 @@ function RecrateCrateBuilderInner(props) {
135364
135517
  enableBrowseEntities,
135365
135518
  enableTemplateSave,
135366
135519
  enableBulkAdd,
135520
+ enableSchemaSelectorButton,
135367
135521
  enableProfileActions: profileActionsEnabled,
135368
135522
  enableReverseLinkBrowser,
135369
135523
  enableUrlMarkup,
@@ -135392,6 +135546,7 @@ function RecrateCrateBuilderInner(props) {
135392
135546
  enableBrowseEntities,
135393
135547
  enableTemplateSave,
135394
135548
  enableBulkAdd,
135549
+ enableSchemaSelectorButton,
135395
135550
  enableProfileActions,
135396
135551
  enableReverseLinkBrowser,
135397
135552
  enableUrlMarkup,