@arpproject/recrate 0.1.32 → 0.1.33

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.
@@ -9,6 +9,8 @@ interface RenderEntityProps {
9
9
  onSaveEntityTemplate: () => void;
10
10
  onWarning: () => void;
11
11
  onError: () => void;
12
+ quickSettingsVisible?: boolean;
13
+ onQuickSettingsVisibleChange?: (visible: boolean) => void;
12
14
  onAddNewProfileRequest?: (requested: boolean) => void;
13
15
  onRemoveProfile?: (data: any) => void;
14
16
  }
@@ -12,6 +12,7 @@ export interface DescriboCrateBuilderProps {
12
12
  enableBrowseEntities?: boolean;
13
13
  enableTemplateSave?: boolean;
14
14
  enableBulkAdd?: boolean;
15
+ enableProfileActions?: boolean;
15
16
  enableReverseLinkBrowser?: boolean;
16
17
  enableUrlMarkup?: boolean;
17
18
  enableEntityTimestamps?: boolean;
@@ -23,6 +24,7 @@ export interface DescriboCrateBuilderProps {
23
24
  language?: string;
24
25
  resetTabOnEntityChange?: boolean;
25
26
  resetTabOnProfileChange?: boolean;
27
+ quickSettingsVisible?: boolean;
26
28
  stateScopeKey?: string;
27
29
  onReady?: () => void;
28
30
  onError?: (errors: any) => void;
@@ -45,6 +47,7 @@ export interface DescriboCrateBuilderProps {
45
47
  value?: any;
46
48
  }) => void;
47
49
  onSaveEntityTemplate?: (entity: any) => void;
50
+ onQuickSettingsVisibleChange?: (visible: boolean) => void;
48
51
  onAddNewProfileRequest?: (requested: boolean) => void;
49
52
  onRemoveProfile?: (payload: any) => void;
50
53
  }
@@ -36,6 +36,11 @@ export declare const propertyDefinitions: {
36
36
  default: boolean;
37
37
  validator: (val: boolean) => boolean;
38
38
  };
39
+ enableProfileActions: {
40
+ type: (BooleanConstructor | undefined)[];
41
+ default: undefined;
42
+ validator: (val: boolean | undefined) => boolean;
43
+ };
39
44
  enableReverseLinkBrowser: {
40
45
  type: BooleanConstructor;
41
46
  default: boolean;
@@ -110722,14 +110722,13 @@ const QuickSettingsHeader = ({
110722
110722
  onClick: onToggleEmptyFields
110723
110723
  }
110724
110724
  ) }),
110725
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiEditedFields ? t2("show_all_fields") : t2("show_ai_edited_fields"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110725
+ aiEditedFieldCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiEditedFields ? t2("show_all_fields") : t2("show_ai_edited_fields"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
110726
110726
  Button$1,
110727
110727
  {
110728
110728
  type: showAiEditedFields ? "primary" : "default",
110729
110729
  className: "describo-ai-edited-filter-button",
110730
110730
  "aria-label": showAiEditedFields ? String(t2("show_all_fields")) : String(t2("show_ai_edited_fields")),
110731
110731
  "aria-pressed": showAiEditedFields,
110732
- disabled: aiEditedFieldCount === 0,
110733
110732
  onClick: onToggleAiEditedFields,
110734
110733
  children: "✦"
110735
110734
  }
@@ -112537,8 +112536,19 @@ const buildAiApprovalNavigationKey = (entityId, approvalRecord) => {
112537
112536
  return `${entityId}:${propertyName2}:${operation}:${timestamp}:${previousValue}`;
112538
112537
  };
112539
112538
  const RenderEntity = forwardRef((props, ref) => {
112540
- var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
112541
- const { entity, onLoadEntity, onSaveCrate, onSaveEntityTemplate, onWarning, onError, onAddNewProfileRequest, onRemoveProfile } = props;
112539
+ var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
112540
+ const {
112541
+ entity,
112542
+ onLoadEntity,
112543
+ onSaveCrate,
112544
+ onSaveEntityTemplate,
112545
+ onWarning,
112546
+ onError,
112547
+ quickSettingsVisible: controlledQuickSettingsVisible,
112548
+ onQuickSettingsVisibleChange,
112549
+ onAddNewProfileRequest,
112550
+ onRemoveProfile
112551
+ } = props;
112542
112552
  const state = useStateStore();
112543
112553
  const profileManager = useContext(ProfileManagerContext);
112544
112554
  const crateManager = useContext(CrateManagerContext);
@@ -112554,7 +112564,7 @@ const RenderEntity = forwardRef((props, ref) => {
112554
112564
  const [savedProperty, setSavedProperty] = useState(void 0);
112555
112565
  const [tabs, setTabs] = useState([]);
112556
112566
  const [showAddPanel, setShowAddPanel] = useState(false);
112557
- const [quickSettingsVisible, setQuickSettingsVisible] = useState(false);
112567
+ const [internalQuickSettingsVisible, setInternalQuickSettingsVisible] = useState(false);
112558
112568
  const [showFieldHelp, setShowFieldHelp] = useState(true);
112559
112569
  const [fieldTitleFilter, setFieldTitleFilter] = useState("");
112560
112570
  const [hideEmptyFields, setHideEmptyFields] = useState(false);
@@ -112579,6 +112589,15 @@ const RenderEntity = forwardRef((props, ref) => {
112579
112589
  const [scrollRestoreNonce, setScrollRestoreNonce] = useState(0);
112580
112590
  const contentContainerRef = useRef(null);
112581
112591
  const activeContentRef = useRef(null);
112592
+ const quickSettingsVisible = controlledQuickSettingsVisible ?? internalQuickSettingsVisible;
112593
+ const updateQuickSettingsVisible = useCallback((visible) => {
112594
+ if (quickSettingsVisible === visible) return;
112595
+ setInternalQuickSettingsVisible(visible);
112596
+ onQuickSettingsVisibleChange == null ? void 0 : onQuickSettingsVisibleChange(visible);
112597
+ }, [onQuickSettingsVisibleChange, quickSettingsVisible]);
112598
+ const enableProfileActions = ((_a2 = state.configuration) == null ? void 0 : _a2.enableProfileActions) === true;
112599
+ const canAddProfile = enableProfileActions && Boolean(onAddNewProfileRequest);
112600
+ const canRemoveProfile = enableProfileActions && Boolean(onRemoveProfile);
112582
112601
  const tabRailListRef = useRef(null);
112583
112602
  const editorPanelRef = useRef(null);
112584
112603
  const navigationRestoreReadyRef = useRef(false);
@@ -113148,6 +113167,7 @@ const RenderEntity = forwardRef((props, ref) => {
113148
113167
  };
113149
113168
  const handleAddNewProfile = () => {
113150
113169
  var _a3;
113170
+ if (!canAddProfile) return;
113151
113171
  try {
113152
113172
  const next2 = !showAddPanel;
113153
113173
  const currentProfileTabKeys = tabs.filter(isProfileTab).map(getProfileTabKey).filter(Boolean);
@@ -113175,6 +113195,7 @@ const RenderEntity = forwardRef((props, ref) => {
113175
113195
  }
113176
113196
  };
113177
113197
  const handleRemoveProfile = (tab) => {
113198
+ if (!canRemoveProfile) return;
113178
113199
  try {
113179
113200
  onRemoveProfile == null ? void 0 : onRemoveProfile({
113180
113201
  entityId: entity["@id"],
@@ -113447,7 +113468,7 @@ const RenderEntity = forwardRef((props, ref) => {
113447
113468
  }
113448
113469
  }
113449
113470
  ) }),
113450
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: t2("add_profile_button_tooltip"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
113471
+ canAddProfile && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: t2("add_profile_button_tooltip"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
113451
113472
  Button$1,
113452
113473
  {
113453
113474
  type: "default",
@@ -113478,7 +113499,7 @@ const RenderEntity = forwardRef((props, ref) => {
113478
113499
  onScroll: updateTabRailScrollState,
113479
113500
  children: tabs.map((tab, idx) => {
113480
113501
  const isActive2 = tab.name === activeTab;
113481
- const canRemove = !(["about", "overflow", "other"].includes((tab.name || "").toLowerCase()) || ["about", "other"].includes((tab.label || tab.name || "").toLowerCase()));
113502
+ const canRemove = canRemoveProfile && !(["about", "overflow", "other"].includes((tab.name || "").toLowerCase()) || ["about", "other"].includes((tab.label || tab.name || "").toLowerCase()));
113482
113503
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
113483
113504
  "div",
113484
113505
  {
@@ -114039,7 +114060,7 @@ const RenderEntity = forwardRef((props, ref) => {
114039
114060
  }
114040
114061
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row", children: [
114041
114062
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col w-full", children: [
114042
- ((_a2 = state.configuration) == null ? void 0 : _a2.showControls) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between pb-1 border-b border-slate-700", children: [
114063
+ ((_b = state.configuration) == null ? void 0 : _b.showControls) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between pb-1 border-b border-slate-700", children: [
114043
114064
  /* @__PURE__ */ jsxRuntimeExports.jsx(
114044
114065
  RenderControls,
114045
114066
  {
@@ -114058,14 +114079,14 @@ const RenderEntity = forwardRef((props, ref) => {
114058
114079
  Button$1,
114059
114080
  {
114060
114081
  style: { marginRight: 8 },
114061
- onClick: () => setQuickSettingsVisible((visible) => !visible),
114082
+ onClick: () => updateQuickSettingsVisible(!quickSettingsVisible),
114062
114083
  type: quickSettingsVisible ? "primary" : "default",
114063
114084
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$8, {}),
114064
114085
  "aria-label": "Quick filter settings",
114065
114086
  "aria-pressed": quickSettingsVisible
114066
114087
  }
114067
114088
  ) }),
114068
- ((_b = state.configuration) == null ? void 0 : _b.enableReverseLinkBrowser) && /* @__PURE__ */ jsxRuntimeExports.jsx(
114089
+ ((_c = state.configuration) == null ? void 0 : _c.enableReverseLinkBrowser) && /* @__PURE__ */ jsxRuntimeExports.jsx(
114069
114090
  "button",
114070
114091
  {
114071
114092
  className: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded text-sm",
@@ -114088,7 +114109,7 @@ const RenderEntity = forwardRef((props, ref) => {
114088
114109
  activePropertyLabel: selectedAiApprovalProperty ? getFieldTitle(selectedAiApprovalProperty) : void 0,
114089
114110
  remainingEntityCount: pendingOtherAiApprovalEntities.length,
114090
114111
  remainingFieldCount: pendingOtherAiApprovalFieldCount,
114091
- readonly: (_c = state.configuration) == null ? void 0 : _c.readonly,
114112
+ readonly: (_d = state.configuration) == null ? void 0 : _d.readonly,
114092
114113
  canGoPrevious: selectedAiApprovalIndex > 0,
114093
114114
  canGoNext: selectedAiApprovalIndex < pendingAiApprovals.length - 1,
114094
114115
  onPrevious: () => navigateToAiApproval(selectedAiApprovalIndex - 1),
@@ -114098,13 +114119,13 @@ const RenderEntity = forwardRef((props, ref) => {
114098
114119
  onReviewNextEntity: handleReviewNextAiApprovalEntity
114099
114120
  }
114100
114121
  ),
114101
- !renderTabs && (((_d = state.configuration) == null ? void 0 : _d.tabLocation) === "left" || ((_e2 = state.configuration) == null ? void 0 : _e2.tabLocation) === "right" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: contentContainerRef, className: "min-h-0 overflow-hidden", style: { height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Ve, { vertical: false, proportionalLayout: false, separator: !iconView, onChange: (sizes2) => {
114122
+ !renderTabs && (((_e2 = state.configuration) == null ? void 0 : _e2.tabLocation) === "left" || ((_f = state.configuration) == null ? void 0 : _f.tabLocation) === "right" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: contentContainerRef, className: "min-h-0 overflow-hidden", style: { height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Ve, { vertical: false, proportionalLayout: false, separator: !iconView, onChange: (sizes2) => {
114102
114123
  var _a3;
114103
114124
  const w2 = ((_a3 = state.configuration) == null ? void 0 : _a3.tabLocation) === "left" ? sizes2[0] : sizes2[1];
114104
114125
  setTabPaneWidth(w2);
114105
114126
  persistTabWidth(w2);
114106
114127
  }, children: [
114107
- ((_f = state.configuration) == null ? void 0 : _f.tabLocation) === "left" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-r border-slate-200", children: [
114128
+ ((_g = state.configuration) == null ? void 0 : _g.tabLocation) === "left" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-r border-slate-200", children: [
114108
114129
  renderProfileActionRail(),
114109
114130
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute right-0 top-0 bottom-0 w-1 bg-slate-300 opacity-0 group-hover:opacity-100" })
114110
114131
  ] }) }),
@@ -114127,7 +114148,7 @@ const RenderEntity = forwardRef((props, ref) => {
114127
114148
  )
114128
114149
  }
114129
114150
  ),
114130
- !((_g = state.configuration) == null ? void 0 : _g.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
114151
+ !((_h = state.configuration) == null ? void 0 : _h.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
114131
114152
  "button",
114132
114153
  {
114133
114154
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",
@@ -114136,7 +114157,7 @@ const RenderEntity = forwardRef((props, ref) => {
114136
114157
  }
114137
114158
  )
114138
114159
  ] }),
114139
- !shouldRenderCoreField("@id") && !((_h = state.configuration) == null ? void 0 : _h.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
114160
+ !shouldRenderCoreField("@id") && !((_i = state.configuration) == null ? void 0 : _i.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
114140
114161
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
114141
114162
  /* @__PURE__ */ jsxRuntimeExports.jsx(
114142
114163
  "button",
@@ -114214,11 +114235,11 @@ const RenderEntity = forwardRef((props, ref) => {
114214
114235
  return null;
114215
114236
  })
114216
114237
  ] }) }),
114217
- ((_i = state.configuration) == null ? void 0 : _i.tabLocation) === "right" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-l border-slate-200", children: [
114238
+ ((_j = state.configuration) == null ? void 0 : _j.tabLocation) === "right" && /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { minSize: iconView ? ICON_TAB_PANE_WIDTH : MIN_LABEL_TAB_PANE_WIDTH, maxSize: iconView ? ICON_TAB_PANE_WIDTH : MAX_LABEL_TAB_PANE_WIDTH, preferredSize: iconView ? ICON_TAB_PANE_WIDTH : tabPaneWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group h-full border-l border-slate-200", children: [
114218
114239
  renderProfileActionRail(),
114219
114240
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-slate-300 opacity-0 group-hover:opacity-100" })
114220
114241
  ] }) })
114221
- ] }, `untabbed-${(_j = state.configuration) == null ? void 0 : _j.tabLocation}-${iconView ? "icon" : "label"}`) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: contentContainerRef, className: "flex min-h-0 overflow-hidden", style: {
114242
+ ] }, `untabbed-${(_k = state.configuration) == null ? void 0 : _k.tabLocation}-${iconView ? "icon" : "label"}`) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: contentContainerRef, className: "flex min-h-0 overflow-hidden", style: {
114222
114243
  flexDirection: "column",
114223
114244
  height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)"
114224
114245
  }, children: [
@@ -114228,7 +114249,7 @@ const RenderEntity = forwardRef((props, ref) => {
114228
114249
  tabPosition: "top",
114229
114250
  items: [
114230
114251
  toggleViewTabItem,
114231
- addProfileTabItem
114252
+ ...canAddProfile ? [addProfileTabItem] : []
114232
114253
  ],
114233
114254
  style: { width: "100%" },
114234
114255
  tabBarStyle: { width: "100%" }
@@ -114253,7 +114274,7 @@ const RenderEntity = forwardRef((props, ref) => {
114253
114274
  )
114254
114275
  }
114255
114276
  ),
114256
- !((_k = state.configuration) == null ? void 0 : _k.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
114277
+ !((_l = state.configuration) == null ? void 0 : _l.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
114257
114278
  "button",
114258
114279
  {
114259
114280
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",
@@ -114262,7 +114283,7 @@ const RenderEntity = forwardRef((props, ref) => {
114262
114283
  }
114263
114284
  )
114264
114285
  ] }),
114265
- !shouldRenderCoreField("@id") && !((_l = state.configuration) == null ? void 0 : _l.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
114286
+ !shouldRenderCoreField("@id") && !((_m = state.configuration) == null ? void 0 : _m.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row place-content-between my-2 p-2", children: [
114266
114287
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
114267
114288
  /* @__PURE__ */ jsxRuntimeExports.jsx(
114268
114289
  "button",
@@ -114353,7 +114374,7 @@ const RenderEntity = forwardRef((props, ref) => {
114353
114374
  ] }) }),
114354
114375
  /* @__PURE__ */ jsxRuntimeExports.jsx(Ve.Pane, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: activeContentRef, className: `${editorScrollClassName} h-full overflow-y-auto scroll-smooth min-h-0`, children: [
114355
114376
  renderQuickSettingsHeader(),
114356
- !((_m = state.configuration) == null ? void 0 : _m.readonly) && ((_n = tabs.find((t22) => t22.name === activeTab)) == null ? void 0 : _n.missingRequiredData) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-red-600 float-right mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
114377
+ !((_n = state.configuration) == null ? void 0 : _n.readonly) && ((_o = tabs.find((t22) => t22.name === activeTab)) == null ? void 0 : _o.missingRequiredData) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-red-600 float-right mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
114357
114378
  "button",
114358
114379
  {
114359
114380
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded text-sm",
@@ -114405,7 +114426,7 @@ const RenderEntity = forwardRef((props, ref) => {
114405
114426
  )
114406
114427
  }
114407
114428
  ),
114408
- (_o = tabs.find((tab) => tab.name === "about")) == null ? void 0 : _o.inputs.map((input) => {
114429
+ (_p = tabs.find((tab) => tab.name === "about")) == null ? void 0 : _p.inputs.map((input) => {
114409
114430
  if (!["@id", "@type", "name", "@reverse"].includes(input.name) && shouldRenderField(input.name, input.label)) {
114410
114431
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
114411
114432
  "div",
@@ -114490,7 +114511,7 @@ const RenderEntity = forwardRef((props, ref) => {
114490
114511
  return null;
114491
114512
  })
114492
114513
  ] }) })
114493
- ] }, `tabbed-${(_p = state.configuration) == null ? void 0 : _p.tabLocation}-${iconView ? "icon" : "label"}`) })
114514
+ ] }, `tabbed-${(_q = state.configuration) == null ? void 0 : _q.tabLocation}-${iconView ? "icon" : "label"}`) })
114494
114515
  ] }),
114495
114516
  /* @__PURE__ */ jsxRuntimeExports.jsx(
114496
114517
  Drawer2,
@@ -123040,7 +123061,7 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
123040
123061
  }) : null
123041
123062
  );
123042
123063
  var CacheProvider = EmotionCacheContext.Provider;
123043
- const version = "0.1.32";
123064
+ const version = "0.1.33";
123044
123065
  const pkg = {
123045
123066
  version
123046
123067
  };
@@ -123177,6 +123198,7 @@ function DescriboCrateBuilderInner(props) {
123177
123198
  enableBrowseEntities = propertyDefinitions.enableBrowseEntities.default,
123178
123199
  enableTemplateSave = propertyDefinitions.enableTemplateSave.default,
123179
123200
  enableBulkAdd = propertyDefinitions.enableBulkAdd.default,
123201
+ enableProfileActions,
123180
123202
  enableReverseLinkBrowser = propertyDefinitions.enableReverseLinkBrowser.default,
123181
123203
  enableUrlMarkup = propertyDefinitions.enableUrlMarkup.default,
123182
123204
  enableEntityTimestamps = propertyDefinitions.enableEntityTimestamps.default,
@@ -123188,6 +123210,7 @@ function DescriboCrateBuilderInner(props) {
123188
123210
  language: language2 = propertyDefinitions.language.default,
123189
123211
  resetTabOnEntityChange = false,
123190
123212
  resetTabOnProfileChange = false,
123213
+ quickSettingsVisible,
123191
123214
  stateScopeKey,
123192
123215
  onReady,
123193
123216
  onError,
@@ -123196,6 +123219,7 @@ function DescriboCrateBuilderInner(props) {
123196
123219
  onSaveCrate,
123197
123220
  onSaveRoCrateApproval,
123198
123221
  onSaveEntityTemplate,
123222
+ onQuickSettingsVisibleChange,
123199
123223
  onAddNewProfileRequest,
123200
123224
  onRemoveProfile
123201
123225
  } = props;
@@ -123210,6 +123234,7 @@ function DescriboCrateBuilderInner(props) {
123210
123234
  const renderEntityRef = useRef(null);
123211
123235
  const keys2 = useRef({ cm: 0, pm: 0, lookups: 0 });
123212
123236
  const lastHandledEntityIdRef = useRef(void 0);
123237
+ const hasProfileActionHandler = Boolean(onAddNewProfileRequest || onRemoveProfile);
123213
123238
  useEffect(() => {
123214
123239
  setApprovalState(roCrateApproval);
123215
123240
  }, [roCrateApproval]);
@@ -123258,12 +123283,14 @@ function DescriboCrateBuilderInner(props) {
123258
123283
  markApprovalEntityApproved
123259
123284
  }), [approvalState, markApprovalEntityApproved, markApprovalPropertyApproved]);
123260
123285
  const configuration = useMemo$1(() => {
123286
+ const profileActionsEnabled = enableProfileActions ?? hasProfileActionHandler;
123261
123287
  const config2 = {
123262
123288
  enableContextEditor,
123263
123289
  enableCratePreview,
123264
123290
  enableBrowseEntities,
123265
123291
  enableTemplateSave,
123266
123292
  enableBulkAdd,
123293
+ enableProfileActions: profileActionsEnabled,
123267
123294
  enableReverseLinkBrowser,
123268
123295
  enableUrlMarkup,
123269
123296
  enableEntityTimestamps,
@@ -123291,6 +123318,7 @@ function DescriboCrateBuilderInner(props) {
123291
123318
  enableBrowseEntities,
123292
123319
  enableTemplateSave,
123293
123320
  enableBulkAdd,
123321
+ enableProfileActions,
123294
123322
  enableReverseLinkBrowser,
123295
123323
  enableUrlMarkup,
123296
123324
  enableEntityTimestamps,
@@ -123300,7 +123328,8 @@ function DescriboCrateBuilderInner(props) {
123300
123328
  tabLocation,
123301
123329
  showControls,
123302
123330
  language2,
123303
- lookup
123331
+ lookup,
123332
+ hasProfileActionHandler
123304
123333
  ]);
123305
123334
  const init2 = useCallback(async () => {
123306
123335
  var _a2, _b;
@@ -123458,8 +123487,10 @@ function DescriboCrateBuilderInner(props) {
123458
123487
  onSaveEntityTemplate: saveEntityAsTemplate,
123459
123488
  onWarning: handleWarning,
123460
123489
  onError: handleError,
123461
- onAddNewProfileRequest: handleAddProfileRequest,
123462
- onRemoveProfile
123490
+ quickSettingsVisible,
123491
+ onQuickSettingsVisibleChange,
123492
+ onAddNewProfileRequest: configuration.enableProfileActions ? handleAddProfileRequest : void 0,
123493
+ onRemoveProfile: configuration.enableProfileActions ? onRemoveProfile : void 0
123463
123494
  }
123464
123495
  ) }) }) }) }) }) }) }),
123465
123496
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pointer-events-none fixed bottom-2 right-2 z-50 text-xs text-gray-400", children: [
package/dist/types.d.ts CHANGED
@@ -21,6 +21,7 @@ export type DescriboCrateBuilderProps = {
21
21
  enableBrowseEntities?: boolean;
22
22
  enableTemplateSave?: boolean;
23
23
  enableBulkAdd?: boolean;
24
+ enableProfileActions?: boolean;
24
25
  readonly?: boolean;
25
26
  enableReverseLinkBrowser?: boolean;
26
27
  enableInternalRouting?: boolean;
@@ -42,6 +43,7 @@ export type DescriboCrateBuilderProps = {
42
43
  }) => void;
43
44
  onSaveCrateAsTemplate?: (name: string, crate: JSONObject) => void;
44
45
  onSaveEntityAsTemplate?: (name: string, entity: JSONObject) => void;
46
+ onQuickSettingsVisibleChange?: (visible: boolean) => void;
45
47
  onNavigation?: (entity: {
46
48
  "@id": string;
47
49
  }) => void;
@@ -49,6 +51,7 @@ export type DescriboCrateBuilderProps = {
49
51
  showControls?: boolean;
50
52
  resetTabOnEntityChange?: boolean;
51
53
  resetTabOnProfileChange?: boolean;
54
+ quickSettingsVisible?: boolean;
52
55
  stateScopeKey?: string;
53
56
  enableUrlMarkup?: boolean;
54
57
  enableEntityTimestamps?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arpproject/recrate",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "type": "module",
5
5
  "main": "./dist/recrate.es.js",
6
6
  "module": "./dist/recrate.es.js",