@arpproject/recrate 0.1.31 → 0.1.32-test2
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/crate-builder/RenderEntity/AiApprovalStepperHeader.d.ts +18 -0
- package/dist/crate-builder/RenderEntity/AiEditedFieldBadge.d.ts +10 -0
- package/dist/crate-builder/RenderEntity/AiEntityDiffView.d.ts +19 -0
- package/dist/crate-builder/RenderEntity/AiEntityReviewSummary.d.ts +8 -0
- package/dist/crate-builder/RenderEntity/AiFieldDiffView.d.ts +8 -0
- package/dist/crate-builder/RenderEntity/DeletedLinkedEntityCard.d.ts +27 -0
- package/dist/crate-builder/RenderEntity/DisplayPropertyName.d.ts +3 -0
- package/dist/crate-builder/RenderEntity/EntityId.d.ts +3 -0
- package/dist/crate-builder/RenderEntity/EntityName.d.ts +10 -0
- package/dist/crate-builder/RenderEntity/EntityProperty.d.ts +7 -0
- package/dist/crate-builder/RenderEntity/EntityType.d.ts +3 -0
- package/dist/crate-builder/RenderEntity/LinkedEntityAssociations.d.ts +9 -0
- package/dist/crate-builder/RenderEntity/LinkedEntityCard.d.ts +27 -0
- package/dist/crate-builder/RenderEntity/LinkedEntityCardHeader.d.ts +10 -0
- package/dist/crate-builder/RenderEntity/PaginateLinkedEntities.d.ts +4 -0
- package/dist/crate-builder/RenderEntity/QuickSettingsHeader.d.ts +3 -0
- package/dist/crate-builder/RenderEntity/RenderLinkedItem.d.ts +4 -0
- package/dist/crate-builder/RenderEntity/approval-utils.d.ts +24 -0
- package/dist/crate-builder/Shell.d.ts +11 -0
- package/dist/recrate.css +2 -2
- package/dist/recrate.es.js +2165 -401
- package/dist/types.d.ts +10 -0
- package/package.json +1 -1
package/dist/recrate.es.js
CHANGED
|
@@ -7936,9 +7936,9 @@ var CheckCircleFilled = function CheckCircleFilled2(props, ref) {
|
|
|
7936
7936
|
icon: CheckCircleFilled$1
|
|
7937
7937
|
}));
|
|
7938
7938
|
};
|
|
7939
|
-
var RefIcon$
|
|
7939
|
+
var RefIcon$C = /* @__PURE__ */ React.forwardRef(CheckCircleFilled);
|
|
7940
7940
|
if (process.env.NODE_ENV !== "production") {
|
|
7941
|
-
RefIcon$
|
|
7941
|
+
RefIcon$C.displayName = "CheckCircleFilled";
|
|
7942
7942
|
}
|
|
7943
7943
|
var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
|
|
7944
7944
|
var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
|
|
@@ -7947,9 +7947,9 @@ var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
|
|
|
7947
7947
|
icon: CloseCircleFilled$1
|
|
7948
7948
|
}));
|
|
7949
7949
|
};
|
|
7950
|
-
var RefIcon$
|
|
7950
|
+
var RefIcon$B = /* @__PURE__ */ React.forwardRef(CloseCircleFilled);
|
|
7951
7951
|
if (process.env.NODE_ENV !== "production") {
|
|
7952
|
-
RefIcon$
|
|
7952
|
+
RefIcon$B.displayName = "CloseCircleFilled";
|
|
7953
7953
|
}
|
|
7954
7954
|
var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
|
|
7955
7955
|
var CloseOutlined = function CloseOutlined2(props, ref) {
|
|
@@ -7958,9 +7958,9 @@ var CloseOutlined = function CloseOutlined2(props, ref) {
|
|
|
7958
7958
|
icon: CloseOutlined$1
|
|
7959
7959
|
}));
|
|
7960
7960
|
};
|
|
7961
|
-
var RefIcon$
|
|
7961
|
+
var RefIcon$A = /* @__PURE__ */ React.forwardRef(CloseOutlined);
|
|
7962
7962
|
if (process.env.NODE_ENV !== "production") {
|
|
7963
|
-
RefIcon$
|
|
7963
|
+
RefIcon$A.displayName = "CloseOutlined";
|
|
7964
7964
|
}
|
|
7965
7965
|
var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
|
|
7966
7966
|
var ExclamationCircleFilled = function ExclamationCircleFilled2(props, ref) {
|
|
@@ -7969,9 +7969,9 @@ var ExclamationCircleFilled = function ExclamationCircleFilled2(props, ref) {
|
|
|
7969
7969
|
icon: ExclamationCircleFilled$1
|
|
7970
7970
|
}));
|
|
7971
7971
|
};
|
|
7972
|
-
var RefIcon$
|
|
7972
|
+
var RefIcon$z = /* @__PURE__ */ React.forwardRef(ExclamationCircleFilled);
|
|
7973
7973
|
if (process.env.NODE_ENV !== "production") {
|
|
7974
|
-
RefIcon$
|
|
7974
|
+
RefIcon$z.displayName = "ExclamationCircleFilled";
|
|
7975
7975
|
}
|
|
7976
7976
|
var InfoCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
|
|
7977
7977
|
var InfoCircleFilled = function InfoCircleFilled2(props, ref) {
|
|
@@ -7980,9 +7980,9 @@ var InfoCircleFilled = function InfoCircleFilled2(props, ref) {
|
|
|
7980
7980
|
icon: InfoCircleFilled$1
|
|
7981
7981
|
}));
|
|
7982
7982
|
};
|
|
7983
|
-
var RefIcon$
|
|
7983
|
+
var RefIcon$y = /* @__PURE__ */ React.forwardRef(InfoCircleFilled);
|
|
7984
7984
|
if (process.env.NODE_ENV !== "production") {
|
|
7985
|
-
RefIcon$
|
|
7985
|
+
RefIcon$y.displayName = "InfoCircleFilled";
|
|
7986
7986
|
}
|
|
7987
7987
|
var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
|
|
7988
7988
|
var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
|
|
@@ -8723,9 +8723,9 @@ var LoadingOutlined = function LoadingOutlined2(props, ref) {
|
|
|
8723
8723
|
icon: LoadingOutlined$1
|
|
8724
8724
|
}));
|
|
8725
8725
|
};
|
|
8726
|
-
var RefIcon$
|
|
8726
|
+
var RefIcon$x = /* @__PURE__ */ React.forwardRef(LoadingOutlined);
|
|
8727
8727
|
if (process.env.NODE_ENV !== "production") {
|
|
8728
|
-
RefIcon$
|
|
8728
|
+
RefIcon$x.displayName = "LoadingOutlined";
|
|
8729
8729
|
}
|
|
8730
8730
|
function mergeProps$1(...items) {
|
|
8731
8731
|
const ret = {};
|
|
@@ -8784,7 +8784,7 @@ const useClosable = (propCloseCollection, contextCloseCollection, fallbackCloseC
|
|
|
8784
8784
|
const [contextLocale] = useLocale$1("global", localeValues.global);
|
|
8785
8785
|
const closeBtnIsDisabled = typeof propCloseConfig !== "boolean" ? !!(propCloseConfig === null || propCloseConfig === void 0 ? void 0 : propCloseConfig.disabled) : false;
|
|
8786
8786
|
const mergedFallbackCloseCollection = React__default.useMemo(() => Object.assign({
|
|
8787
|
-
closeIcon: /* @__PURE__ */ React__default.createElement(RefIcon$
|
|
8787
|
+
closeIcon: /* @__PURE__ */ React__default.createElement(RefIcon$A, null)
|
|
8788
8788
|
}, fallbackCloseCollection), [fallbackCloseCollection]);
|
|
8789
8789
|
const mergedClosableConfig = React__default.useMemo(() => {
|
|
8790
8790
|
if (propCloseConfig === false) {
|
|
@@ -9109,11 +9109,11 @@ const useStyle$u = genStyleHooks("Message", (token2) => {
|
|
|
9109
9109
|
return t2;
|
|
9110
9110
|
});
|
|
9111
9111
|
const TypeIcon = {
|
|
9112
|
-
info: /* @__PURE__ */ React.createElement(RefIcon$
|
|
9113
|
-
success: /* @__PURE__ */ React.createElement(RefIcon$
|
|
9114
|
-
error: /* @__PURE__ */ React.createElement(RefIcon$
|
|
9115
|
-
warning: /* @__PURE__ */ React.createElement(RefIcon$
|
|
9116
|
-
loading: /* @__PURE__ */ React.createElement(RefIcon$
|
|
9112
|
+
info: /* @__PURE__ */ React.createElement(RefIcon$y, null),
|
|
9113
|
+
success: /* @__PURE__ */ React.createElement(RefIcon$C, null),
|
|
9114
|
+
error: /* @__PURE__ */ React.createElement(RefIcon$B, null),
|
|
9115
|
+
warning: /* @__PURE__ */ React.createElement(RefIcon$z, null),
|
|
9116
|
+
loading: /* @__PURE__ */ React.createElement(RefIcon$x, null)
|
|
9117
9117
|
};
|
|
9118
9118
|
const PureContent$1 = ({
|
|
9119
9119
|
prefixCls,
|
|
@@ -9200,7 +9200,7 @@ const Holder$1 = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
9200
9200
|
const getNotificationMotion = () => getMotion$3(prefixCls, transitionName);
|
|
9201
9201
|
const mergedCloseIcon = /* @__PURE__ */ React.createElement("span", {
|
|
9202
9202
|
className: `${prefixCls}-close-x`
|
|
9203
|
-
}, /* @__PURE__ */ React.createElement(RefIcon$
|
|
9203
|
+
}, /* @__PURE__ */ React.createElement(RefIcon$A, {
|
|
9204
9204
|
className: `${prefixCls}-close-icon`
|
|
9205
9205
|
}));
|
|
9206
9206
|
const [api2, holder] = useNotification$1({
|
|
@@ -10240,7 +10240,7 @@ const InnerLoadingIcon = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
10240
10240
|
className: mergedIconCls,
|
|
10241
10241
|
style: style2,
|
|
10242
10242
|
ref
|
|
10243
|
-
}, /* @__PURE__ */ React__default.createElement(RefIcon$
|
|
10243
|
+
}, /* @__PURE__ */ React__default.createElement(RefIcon$x, {
|
|
10244
10244
|
className: iconClassName
|
|
10245
10245
|
}));
|
|
10246
10246
|
});
|
|
@@ -10976,9 +10976,9 @@ var RightOutlined = function RightOutlined2(props, ref) {
|
|
|
10976
10976
|
icon: RightOutlined$1
|
|
10977
10977
|
}));
|
|
10978
10978
|
};
|
|
10979
|
-
var RefIcon$
|
|
10979
|
+
var RefIcon$w = /* @__PURE__ */ React.forwardRef(RightOutlined);
|
|
10980
10980
|
if (process.env.NODE_ENV !== "production") {
|
|
10981
|
-
RefIcon$
|
|
10981
|
+
RefIcon$w.displayName = "RightOutlined";
|
|
10982
10982
|
}
|
|
10983
10983
|
const genCollapseMotion = (token2) => ({
|
|
10984
10984
|
[token2.componentCls]: {
|
|
@@ -17099,7 +17099,7 @@ const NormalOkBtn = () => {
|
|
|
17099
17099
|
function renderCloseIcon(prefixCls, closeIcon) {
|
|
17100
17100
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
17101
17101
|
className: `${prefixCls}-close-x`
|
|
17102
|
-
}, closeIcon || /* @__PURE__ */ React__default.createElement(RefIcon$
|
|
17102
|
+
}, closeIcon || /* @__PURE__ */ React__default.createElement(RefIcon$A, {
|
|
17103
17103
|
className: `${prefixCls}-close-icon`
|
|
17104
17104
|
}));
|
|
17105
17105
|
}
|
|
@@ -17691,7 +17691,7 @@ const Modal = (props) => {
|
|
|
17691
17691
|
})) : null;
|
|
17692
17692
|
const [mergedClosable, mergedCloseIcon, closeBtnIsDisabled, ariaProps] = useClosable(pickClosable(props), pickClosable(modalContext), {
|
|
17693
17693
|
closable: true,
|
|
17694
|
-
closeIcon: /* @__PURE__ */ React.createElement(RefIcon$
|
|
17694
|
+
closeIcon: /* @__PURE__ */ React.createElement(RefIcon$A, {
|
|
17695
17695
|
className: `${prefixCls}-close-icon`
|
|
17696
17696
|
}),
|
|
17697
17697
|
closeIconRender: (icon2) => renderCloseIcon(prefixCls, icon2)
|
|
@@ -17888,16 +17888,16 @@ const ConfirmContent = (props) => {
|
|
|
17888
17888
|
if (!icon2 && icon2 !== null) {
|
|
17889
17889
|
switch (type4) {
|
|
17890
17890
|
case "info":
|
|
17891
|
-
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
17891
|
+
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$y, null);
|
|
17892
17892
|
break;
|
|
17893
17893
|
case "success":
|
|
17894
|
-
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
17894
|
+
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$C, null);
|
|
17895
17895
|
break;
|
|
17896
17896
|
case "error":
|
|
17897
|
-
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
17897
|
+
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$B, null);
|
|
17898
17898
|
break;
|
|
17899
17899
|
default:
|
|
17900
|
-
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
17900
|
+
mergedIcon = /* @__PURE__ */ React.createElement(RefIcon$z, null);
|
|
17901
17901
|
}
|
|
17902
17902
|
}
|
|
17903
17903
|
const mergedOkCancel = okCancel !== null && okCancel !== void 0 ? okCancel : type4 === "confirm";
|
|
@@ -18661,15 +18661,15 @@ function getCloseIcon(prefixCls, closeIcon) {
|
|
|
18661
18661
|
if (closeIcon === null || closeIcon === false) {
|
|
18662
18662
|
return null;
|
|
18663
18663
|
}
|
|
18664
|
-
return closeIcon || /* @__PURE__ */ React.createElement(RefIcon$
|
|
18664
|
+
return closeIcon || /* @__PURE__ */ React.createElement(RefIcon$A, {
|
|
18665
18665
|
className: `${prefixCls}-close-icon`
|
|
18666
18666
|
});
|
|
18667
18667
|
}
|
|
18668
18668
|
const typeToIcon = {
|
|
18669
|
-
success: RefIcon$
|
|
18670
|
-
info: RefIcon$
|
|
18671
|
-
error: RefIcon$
|
|
18672
|
-
warning: RefIcon$
|
|
18669
|
+
success: RefIcon$C,
|
|
18670
|
+
info: RefIcon$y,
|
|
18671
|
+
error: RefIcon$B,
|
|
18672
|
+
warning: RefIcon$z
|
|
18673
18673
|
};
|
|
18674
18674
|
const PureContent = (props) => {
|
|
18675
18675
|
const {
|
|
@@ -25280,9 +25280,9 @@ var CheckOutlined = function CheckOutlined2(props, ref) {
|
|
|
25280
25280
|
icon: CheckOutlined$1
|
|
25281
25281
|
}));
|
|
25282
25282
|
};
|
|
25283
|
-
var RefIcon$
|
|
25283
|
+
var RefIcon$v = /* @__PURE__ */ React.forwardRef(CheckOutlined);
|
|
25284
25284
|
if (process.env.NODE_ENV !== "production") {
|
|
25285
|
-
RefIcon$
|
|
25285
|
+
RefIcon$v.displayName = "CheckOutlined";
|
|
25286
25286
|
}
|
|
25287
25287
|
var DownOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
|
|
25288
25288
|
var DownOutlined = function DownOutlined2(props, ref) {
|
|
@@ -25291,9 +25291,9 @@ var DownOutlined = function DownOutlined2(props, ref) {
|
|
|
25291
25291
|
icon: DownOutlined$1
|
|
25292
25292
|
}));
|
|
25293
25293
|
};
|
|
25294
|
-
var RefIcon$
|
|
25294
|
+
var RefIcon$u = /* @__PURE__ */ React.forwardRef(DownOutlined);
|
|
25295
25295
|
if (process.env.NODE_ENV !== "production") {
|
|
25296
|
-
RefIcon$
|
|
25296
|
+
RefIcon$u.displayName = "DownOutlined";
|
|
25297
25297
|
}
|
|
25298
25298
|
var SearchOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
|
|
25299
25299
|
var SearchOutlined = function SearchOutlined2(props, ref) {
|
|
@@ -25302,9 +25302,9 @@ var SearchOutlined = function SearchOutlined2(props, ref) {
|
|
|
25302
25302
|
icon: SearchOutlined$1
|
|
25303
25303
|
}));
|
|
25304
25304
|
};
|
|
25305
|
-
var RefIcon$
|
|
25305
|
+
var RefIcon$t = /* @__PURE__ */ React.forwardRef(SearchOutlined);
|
|
25306
25306
|
if (process.env.NODE_ENV !== "production") {
|
|
25307
|
-
RefIcon$
|
|
25307
|
+
RefIcon$t.displayName = "SearchOutlined";
|
|
25308
25308
|
}
|
|
25309
25309
|
function useIcons$1({
|
|
25310
25310
|
suffixIcon,
|
|
@@ -25324,7 +25324,7 @@ function useIcons$1({
|
|
|
25324
25324
|
const warning3 = devUseWarning(componentName);
|
|
25325
25325
|
warning3.deprecated(!clearIcon, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
|
|
25326
25326
|
}
|
|
25327
|
-
const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React.createElement(RefIcon$
|
|
25327
|
+
const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React.createElement(RefIcon$B, null);
|
|
25328
25328
|
const getSuffixIconNode = (arrowIcon) => {
|
|
25329
25329
|
if (suffixIcon === null && !hasFeedback && !showArrow) {
|
|
25330
25330
|
return null;
|
|
@@ -25335,7 +25335,7 @@ function useIcons$1({
|
|
|
25335
25335
|
if (suffixIcon !== void 0) {
|
|
25336
25336
|
mergedSuffixIcon = getSuffixIconNode(suffixIcon);
|
|
25337
25337
|
} else if (loading) {
|
|
25338
|
-
mergedSuffixIcon = getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$
|
|
25338
|
+
mergedSuffixIcon = getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$x, {
|
|
25339
25339
|
spin: true
|
|
25340
25340
|
}));
|
|
25341
25341
|
} else {
|
|
@@ -25345,11 +25345,11 @@ function useIcons$1({
|
|
|
25345
25345
|
showSearch
|
|
25346
25346
|
}) => {
|
|
25347
25347
|
if (open && showSearch) {
|
|
25348
|
-
return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$
|
|
25348
|
+
return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$t, {
|
|
25349
25349
|
className: iconCls
|
|
25350
25350
|
}));
|
|
25351
25351
|
}
|
|
25352
|
-
return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$
|
|
25352
|
+
return getSuffixIconNode(/* @__PURE__ */ React.createElement(RefIcon$u, {
|
|
25353
25353
|
className: iconCls
|
|
25354
25354
|
}));
|
|
25355
25355
|
};
|
|
@@ -25358,7 +25358,7 @@ function useIcons$1({
|
|
|
25358
25358
|
if (menuItemSelectedIcon !== void 0) {
|
|
25359
25359
|
mergedItemIcon = menuItemSelectedIcon;
|
|
25360
25360
|
} else if (multiple) {
|
|
25361
|
-
mergedItemIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
25361
|
+
mergedItemIcon = /* @__PURE__ */ React.createElement(RefIcon$v, null);
|
|
25362
25362
|
} else {
|
|
25363
25363
|
mergedItemIcon = null;
|
|
25364
25364
|
}
|
|
@@ -25366,7 +25366,7 @@ function useIcons$1({
|
|
|
25366
25366
|
if (removeIcon !== void 0) {
|
|
25367
25367
|
mergedRemoveIcon = removeIcon;
|
|
25368
25368
|
} else {
|
|
25369
|
-
mergedRemoveIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
25369
|
+
mergedRemoveIcon = /* @__PURE__ */ React.createElement(RefIcon$A, null);
|
|
25370
25370
|
}
|
|
25371
25371
|
return {
|
|
25372
25372
|
clearIcon: mergedClearIcon,
|
|
@@ -27693,9 +27693,9 @@ var LeftOutlined = function LeftOutlined2(props, ref) {
|
|
|
27693
27693
|
icon: LeftOutlined$1
|
|
27694
27694
|
}));
|
|
27695
27695
|
};
|
|
27696
|
-
var RefIcon$
|
|
27696
|
+
var RefIcon$s = /* @__PURE__ */ React.forwardRef(LeftOutlined);
|
|
27697
27697
|
if (process.env.NODE_ENV !== "production") {
|
|
27698
|
-
RefIcon$
|
|
27698
|
+
RefIcon$s.displayName = "LeftOutlined";
|
|
27699
27699
|
}
|
|
27700
27700
|
var ESC$1 = KeyCode.ESC, TAB = KeyCode.TAB;
|
|
27701
27701
|
function useAccessibility$1(_ref) {
|
|
@@ -29284,9 +29284,9 @@ var EllipsisOutlined = function EllipsisOutlined2(props, ref) {
|
|
|
29284
29284
|
icon: EllipsisOutlined$1
|
|
29285
29285
|
}));
|
|
29286
29286
|
};
|
|
29287
|
-
var RefIcon$
|
|
29287
|
+
var RefIcon$r = /* @__PURE__ */ React.forwardRef(EllipsisOutlined);
|
|
29288
29288
|
if (process.env.NODE_ENV !== "production") {
|
|
29289
|
-
RefIcon$
|
|
29289
|
+
RefIcon$r.displayName = "EllipsisOutlined";
|
|
29290
29290
|
}
|
|
29291
29291
|
var dayjs_min$1 = { exports: {} };
|
|
29292
29292
|
var dayjs_min = dayjs_min$1.exports;
|
|
@@ -30612,7 +30612,7 @@ function getWeekStartDate(locale2, generateConfig2, value) {
|
|
|
30612
30612
|
}
|
|
30613
30613
|
return alignStartDate;
|
|
30614
30614
|
}
|
|
30615
|
-
function formatValue(value, _ref) {
|
|
30615
|
+
function formatValue$1(value, _ref) {
|
|
30616
30616
|
var generateConfig2 = _ref.generateConfig, locale2 = _ref.locale, format3 = _ref.format;
|
|
30617
30617
|
if (!value) {
|
|
30618
30618
|
return "";
|
|
@@ -31084,7 +31084,7 @@ var EMPTY_VALUE = [];
|
|
|
31084
31084
|
function useUtil(generateConfig2, locale2, formatList) {
|
|
31085
31085
|
var getDateTexts = function getDateTexts2(dates) {
|
|
31086
31086
|
return dates.map(function(date4) {
|
|
31087
|
-
return formatValue(date4, {
|
|
31087
|
+
return formatValue$1(date4, {
|
|
31088
31088
|
generateConfig: generateConfig2,
|
|
31089
31089
|
locale: locale2,
|
|
31090
31090
|
format: formatList[0]
|
|
@@ -31503,7 +31503,7 @@ function PanelBody(props) {
|
|
|
31503
31503
|
rangeStart = isSame(generateConfig2, locale2, currentDate, hoverStart, type4);
|
|
31504
31504
|
rangeEnd2 = isSame(generateConfig2, locale2, currentDate, hoverEnd, type4);
|
|
31505
31505
|
}
|
|
31506
|
-
var title = titleFormat ? formatValue(currentDate, {
|
|
31506
|
+
var title = titleFormat ? formatValue$1(currentDate, {
|
|
31507
31507
|
locale: locale2,
|
|
31508
31508
|
format: titleFormat,
|
|
31509
31509
|
generateConfig: generateConfig2
|
|
@@ -31720,7 +31720,7 @@ function DatePanel(props) {
|
|
|
31720
31720
|
return generateConfig2.addDate(date4, offset2);
|
|
31721
31721
|
};
|
|
31722
31722
|
var getCellText = function getCellText2(date4) {
|
|
31723
|
-
return formatValue(date4, {
|
|
31723
|
+
return formatValue$1(date4, {
|
|
31724
31724
|
locale: locale2,
|
|
31725
31725
|
format: locale2.cellDateFormat,
|
|
31726
31726
|
generateConfig: generateConfig2
|
|
@@ -31740,7 +31740,7 @@ function DatePanel(props) {
|
|
|
31740
31740
|
},
|
|
31741
31741
|
tabIndex: -1,
|
|
31742
31742
|
className: "".concat(prefixCls, "-year-btn")
|
|
31743
|
-
}, formatValue(pickerValue, {
|
|
31743
|
+
}, formatValue$1(pickerValue, {
|
|
31744
31744
|
locale: locale2,
|
|
31745
31745
|
format: locale2.yearFormat,
|
|
31746
31746
|
generateConfig: generateConfig2
|
|
@@ -31754,7 +31754,7 @@ function DatePanel(props) {
|
|
|
31754
31754
|
},
|
|
31755
31755
|
tabIndex: -1,
|
|
31756
31756
|
className: "".concat(prefixCls, "-month-btn")
|
|
31757
|
-
}, locale2.monthFormat ? formatValue(pickerValue, {
|
|
31757
|
+
}, locale2.monthFormat ? formatValue$1(pickerValue, {
|
|
31758
31758
|
locale: locale2,
|
|
31759
31759
|
format: locale2.monthFormat,
|
|
31760
31760
|
generateConfig: generateConfig2
|
|
@@ -32008,7 +32008,7 @@ function TimePanelBody(props) {
|
|
|
32008
32008
|
var pmDate = generateConfig2.setHour(base2, 18);
|
|
32009
32009
|
var formatMeridiem = function formatMeridiem2(date4, defaultLabel) {
|
|
32010
32010
|
var cellMeridiemFormat = locale2.cellMeridiemFormat;
|
|
32011
|
-
return cellMeridiemFormat ? formatValue(date4, {
|
|
32011
|
+
return cellMeridiemFormat ? formatValue$1(date4, {
|
|
32012
32012
|
generateConfig: generateConfig2,
|
|
32013
32013
|
locale: locale2,
|
|
32014
32014
|
format: cellMeridiemFormat
|
|
@@ -32165,7 +32165,7 @@ function TimePanel(props) {
|
|
|
32165
32165
|
value: info
|
|
32166
32166
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
32167
32167
|
className: classNames(panelPrefixCls)
|
|
32168
|
-
}, /* @__PURE__ */ React.createElement(PanelHeader, null, value ? formatValue(value, {
|
|
32168
|
+
}, /* @__PURE__ */ React.createElement(PanelHeader, null, value ? formatValue$1(value, {
|
|
32169
32169
|
locale: locale2,
|
|
32170
32170
|
format: format3,
|
|
32171
32171
|
generateConfig: generateConfig2
|
|
@@ -32215,12 +32215,12 @@ function DecadePanel(props) {
|
|
|
32215
32215
|
};
|
|
32216
32216
|
var getCellText = function getCellText2(date4) {
|
|
32217
32217
|
var cellYearFormat = locale2.cellYearFormat;
|
|
32218
|
-
var startYearStr = formatValue(date4, {
|
|
32218
|
+
var startYearStr = formatValue$1(date4, {
|
|
32219
32219
|
locale: locale2,
|
|
32220
32220
|
format: cellYearFormat,
|
|
32221
32221
|
generateConfig: generateConfig2
|
|
32222
32222
|
});
|
|
32223
|
-
var endYearStr = formatValue(generateConfig2.addYear(date4, 9), {
|
|
32223
|
+
var endYearStr = formatValue$1(generateConfig2.addYear(date4, 9), {
|
|
32224
32224
|
locale: locale2,
|
|
32225
32225
|
format: cellYearFormat,
|
|
32226
32226
|
generateConfig: generateConfig2
|
|
@@ -32238,11 +32238,11 @@ function DecadePanel(props) {
|
|
|
32238
32238
|
var baseEndDate = generateConfig2.addDate(baseEndYear, -1);
|
|
32239
32239
|
return disabledDate(baseStartYear, disabledInfo) && disabledDate(baseEndDate, disabledInfo);
|
|
32240
32240
|
} : null;
|
|
32241
|
-
var yearNode = "".concat(formatValue(startYearDate, {
|
|
32241
|
+
var yearNode = "".concat(formatValue$1(startYearDate, {
|
|
32242
32242
|
locale: locale2,
|
|
32243
32243
|
format: locale2.yearFormat,
|
|
32244
32244
|
generateConfig: generateConfig2
|
|
32245
|
-
}), "-").concat(formatValue(endYearDate, {
|
|
32245
|
+
}), "-").concat(formatValue$1(endYearDate, {
|
|
32246
32246
|
locale: locale2,
|
|
32247
32247
|
format: locale2.yearFormat,
|
|
32248
32248
|
generateConfig: generateConfig2
|
|
@@ -32279,7 +32279,7 @@ function MonthPanel(props) {
|
|
|
32279
32279
|
};
|
|
32280
32280
|
var getCellText = function getCellText2(date4) {
|
|
32281
32281
|
var month = generateConfig2.getMonth(date4);
|
|
32282
|
-
return locale2.monthFormat ? formatValue(date4, {
|
|
32282
|
+
return locale2.monthFormat ? formatValue$1(date4, {
|
|
32283
32283
|
locale: locale2,
|
|
32284
32284
|
format: locale2.monthFormat,
|
|
32285
32285
|
generateConfig: generateConfig2
|
|
@@ -32303,7 +32303,7 @@ function MonthPanel(props) {
|
|
|
32303
32303
|
},
|
|
32304
32304
|
tabIndex: -1,
|
|
32305
32305
|
className: "".concat(prefixCls, "-year-btn")
|
|
32306
|
-
}, formatValue(pickerValue, {
|
|
32306
|
+
}, formatValue$1(pickerValue, {
|
|
32307
32307
|
locale: locale2,
|
|
32308
32308
|
format: locale2.yearFormat,
|
|
32309
32309
|
generateConfig: generateConfig2
|
|
@@ -32343,7 +32343,7 @@ function QuarterPanel(props) {
|
|
|
32343
32343
|
return generateConfig2.addMonth(date4, offset2 * 3);
|
|
32344
32344
|
};
|
|
32345
32345
|
var getCellText = function getCellText2(date4) {
|
|
32346
|
-
return formatValue(date4, {
|
|
32346
|
+
return formatValue$1(date4, {
|
|
32347
32347
|
locale: locale2,
|
|
32348
32348
|
format: locale2.cellQuarterFormat,
|
|
32349
32349
|
generateConfig: generateConfig2
|
|
@@ -32361,7 +32361,7 @@ function QuarterPanel(props) {
|
|
|
32361
32361
|
},
|
|
32362
32362
|
tabIndex: -1,
|
|
32363
32363
|
className: "".concat(prefixCls, "-year-btn")
|
|
32364
|
-
}, formatValue(pickerValue, {
|
|
32364
|
+
}, formatValue$1(pickerValue, {
|
|
32365
32365
|
locale: locale2,
|
|
32366
32366
|
format: locale2.yearFormat,
|
|
32367
32367
|
generateConfig: generateConfig2
|
|
@@ -32442,7 +32442,7 @@ function YearPanel(props) {
|
|
|
32442
32442
|
return generateConfig2.addYear(date4, offset2);
|
|
32443
32443
|
};
|
|
32444
32444
|
var getCellText = function getCellText2(date4) {
|
|
32445
|
-
return formatValue(date4, {
|
|
32445
|
+
return formatValue$1(date4, {
|
|
32446
32446
|
locale: locale2,
|
|
32447
32447
|
format: locale2.cellYearFormat,
|
|
32448
32448
|
generateConfig: generateConfig2
|
|
@@ -32467,11 +32467,11 @@ function YearPanel(props) {
|
|
|
32467
32467
|
},
|
|
32468
32468
|
tabIndex: -1,
|
|
32469
32469
|
className: "".concat(prefixCls, "-decade-btn")
|
|
32470
|
-
}, formatValue(startYearDate, {
|
|
32470
|
+
}, formatValue$1(startYearDate, {
|
|
32471
32471
|
locale: locale2,
|
|
32472
32472
|
format: locale2.yearFormat,
|
|
32473
32473
|
generateConfig: generateConfig2
|
|
32474
|
-
}), "-", formatValue(endYearDate, {
|
|
32474
|
+
}), "-", formatValue$1(endYearDate, {
|
|
32475
32475
|
locale: locale2,
|
|
32476
32476
|
format: locale2.yearFormat,
|
|
32477
32477
|
generateConfig: generateConfig2
|
|
@@ -32883,7 +32883,7 @@ function useInputProps(props, postProps) {
|
|
|
32883
32883
|
};
|
|
32884
32884
|
var firstFormat = format3[0];
|
|
32885
32885
|
var getText = React.useCallback(function(date4) {
|
|
32886
|
-
return formatValue(date4, {
|
|
32886
|
+
return formatValue$1(date4, {
|
|
32887
32887
|
locale: locale2,
|
|
32888
32888
|
format: firstFormat,
|
|
32889
32889
|
generateConfig: generateConfig2
|
|
@@ -37395,9 +37395,9 @@ var PlusOutlined = function PlusOutlined2(props, ref) {
|
|
|
37395
37395
|
icon: PlusOutlined$1
|
|
37396
37396
|
}));
|
|
37397
37397
|
};
|
|
37398
|
-
var RefIcon$
|
|
37398
|
+
var RefIcon$q = /* @__PURE__ */ React.forwardRef(PlusOutlined);
|
|
37399
37399
|
if (process.env.NODE_ENV !== "production") {
|
|
37400
|
-
RefIcon$
|
|
37400
|
+
RefIcon$q.displayName = "PlusOutlined";
|
|
37401
37401
|
}
|
|
37402
37402
|
const TabContext = /* @__PURE__ */ createContext(null);
|
|
37403
37403
|
var useIndicator = function useIndicator2(options) {
|
|
@@ -39693,8 +39693,8 @@ const InternalTabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
39693
39693
|
}) => {
|
|
39694
39694
|
onEdit === null || onEdit === void 0 ? void 0 : onEdit(editType === "add" ? event : key, editType);
|
|
39695
39695
|
},
|
|
39696
|
-
removeIcon: (_a2 = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a2 !== void 0 ? _a2 : /* @__PURE__ */ React.createElement(RefIcon$
|
|
39697
|
-
addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /* @__PURE__ */ React.createElement(RefIcon$
|
|
39696
|
+
removeIcon: (_a2 = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a2 !== void 0 ? _a2 : /* @__PURE__ */ React.createElement(RefIcon$A, null),
|
|
39697
|
+
addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /* @__PURE__ */ React.createElement(RefIcon$q, null),
|
|
39698
39698
|
showAdd: hideAdd !== true
|
|
39699
39699
|
};
|
|
39700
39700
|
}
|
|
@@ -39729,7 +39729,7 @@ const InternalTabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
39729
39729
|
style: mergedStyle,
|
|
39730
39730
|
editable: editable2,
|
|
39731
39731
|
more: Object.assign({
|
|
39732
|
-
icon: (_l = (_k = (_j = (_h = tabs === null || tabs === void 0 ? void 0 : tabs.more) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : tabs === null || tabs === void 0 ? void 0 : tabs.moreIcon) !== null && _k !== void 0 ? _k : moreIcon) !== null && _l !== void 0 ? _l : /* @__PURE__ */ React.createElement(RefIcon$
|
|
39732
|
+
icon: (_l = (_k = (_j = (_h = tabs === null || tabs === void 0 ? void 0 : tabs.more) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : tabs === null || tabs === void 0 ? void 0 : tabs.moreIcon) !== null && _k !== void 0 ? _k : moreIcon) !== null && _l !== void 0 ? _l : /* @__PURE__ */ React.createElement(RefIcon$r, null),
|
|
39733
39733
|
transitionName: `${rootPrefixCls}-slide-up`
|
|
39734
39734
|
}, more),
|
|
39735
39735
|
prefixCls,
|
|
@@ -41245,9 +41245,9 @@ var UpOutlined = function UpOutlined2(props, ref) {
|
|
|
41245
41245
|
icon: UpOutlined$1
|
|
41246
41246
|
}));
|
|
41247
41247
|
};
|
|
41248
|
-
var RefIcon$
|
|
41248
|
+
var RefIcon$p = /* @__PURE__ */ React.forwardRef(UpOutlined);
|
|
41249
41249
|
if (process.env.NODE_ENV !== "production") {
|
|
41250
|
-
RefIcon$
|
|
41250
|
+
RefIcon$p.displayName = "UpOutlined";
|
|
41251
41251
|
}
|
|
41252
41252
|
function hasAddon(props) {
|
|
41253
41253
|
return !!(props.addonBefore || props.addonAfter);
|
|
@@ -41607,7 +41607,7 @@ const getAllowClear = (allowClear) => {
|
|
|
41607
41607
|
mergedAllowClear = allowClear;
|
|
41608
41608
|
} else if (allowClear) {
|
|
41609
41609
|
mergedAllowClear = {
|
|
41610
|
-
clearIcon: /* @__PURE__ */ React__default.createElement(RefIcon$
|
|
41610
|
+
clearIcon: /* @__PURE__ */ React__default.createElement(RefIcon$B, null)
|
|
41611
41611
|
};
|
|
41612
41612
|
}
|
|
41613
41613
|
return mergedAllowClear;
|
|
@@ -41795,9 +41795,9 @@ var SwapRightOutlined = function SwapRightOutlined2(props, ref) {
|
|
|
41795
41795
|
icon: SwapRightOutlined$1
|
|
41796
41796
|
}));
|
|
41797
41797
|
};
|
|
41798
|
-
var RefIcon$
|
|
41798
|
+
var RefIcon$o = /* @__PURE__ */ React.forwardRef(SwapRightOutlined);
|
|
41799
41799
|
if (process.env.NODE_ENV !== "production") {
|
|
41800
|
-
RefIcon$
|
|
41800
|
+
RefIcon$o.displayName = "SwapRightOutlined";
|
|
41801
41801
|
}
|
|
41802
41802
|
const useMergedPickerSemantic = (pickerType, classNames$1, styles2, popupClassName, popupStyle) => {
|
|
41803
41803
|
const {
|
|
@@ -41900,9 +41900,9 @@ var CalendarOutlined = function CalendarOutlined2(props, ref) {
|
|
|
41900
41900
|
icon: CalendarOutlined$1
|
|
41901
41901
|
}));
|
|
41902
41902
|
};
|
|
41903
|
-
var RefIcon$
|
|
41903
|
+
var RefIcon$n = /* @__PURE__ */ React.forwardRef(CalendarOutlined);
|
|
41904
41904
|
if (process.env.NODE_ENV !== "production") {
|
|
41905
|
-
RefIcon$
|
|
41905
|
+
RefIcon$n.displayName = "CalendarOutlined";
|
|
41906
41906
|
}
|
|
41907
41907
|
var ClockCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z" } }] }, "name": "clock-circle", "theme": "outlined" };
|
|
41908
41908
|
var ClockCircleOutlined = function ClockCircleOutlined2(props, ref) {
|
|
@@ -41911,9 +41911,9 @@ var ClockCircleOutlined = function ClockCircleOutlined2(props, ref) {
|
|
|
41911
41911
|
icon: ClockCircleOutlined$1
|
|
41912
41912
|
}));
|
|
41913
41913
|
};
|
|
41914
|
-
var RefIcon$
|
|
41914
|
+
var RefIcon$m = /* @__PURE__ */ React.forwardRef(ClockCircleOutlined);
|
|
41915
41915
|
if (process.env.NODE_ENV !== "production") {
|
|
41916
|
-
RefIcon$
|
|
41916
|
+
RefIcon$m.displayName = "ClockCircleOutlined";
|
|
41917
41917
|
}
|
|
41918
41918
|
const SuffixIcon = ({
|
|
41919
41919
|
picker,
|
|
@@ -41925,7 +41925,7 @@ const SuffixIcon = ({
|
|
|
41925
41925
|
return null;
|
|
41926
41926
|
}
|
|
41927
41927
|
if (suffixIcon === true || suffixIcon === void 0) {
|
|
41928
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, picker === TIME ? /* @__PURE__ */ React__default.createElement(RefIcon$
|
|
41928
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, picker === TIME ? /* @__PURE__ */ React__default.createElement(RefIcon$m, null) : /* @__PURE__ */ React__default.createElement(RefIcon$n, null), hasFeedback && feedbackIcon);
|
|
41929
41929
|
}
|
|
41930
41930
|
return suffixIcon;
|
|
41931
41931
|
};
|
|
@@ -42032,7 +42032,7 @@ const generateRangePicker = (generateConfig2) => {
|
|
|
42032
42032
|
separator: /* @__PURE__ */ React.createElement("span", {
|
|
42033
42033
|
"aria-label": "to",
|
|
42034
42034
|
className: `${prefixCls}-separator`
|
|
42035
|
-
}, /* @__PURE__ */ React.createElement(RefIcon$
|
|
42035
|
+
}, /* @__PURE__ */ React.createElement(RefIcon$o, null)),
|
|
42036
42036
|
disabled: mergedDisabled,
|
|
42037
42037
|
ref: innerRef,
|
|
42038
42038
|
placement,
|
|
@@ -44524,9 +44524,9 @@ var QuestionCircleOutlined = function QuestionCircleOutlined2(props, ref) {
|
|
|
44524
44524
|
icon: QuestionCircleOutlined$1
|
|
44525
44525
|
}));
|
|
44526
44526
|
};
|
|
44527
|
-
var RefIcon$
|
|
44527
|
+
var RefIcon$l = /* @__PURE__ */ React.forwardRef(QuestionCircleOutlined);
|
|
44528
44528
|
if (process.env.NODE_ENV !== "production") {
|
|
44529
|
-
RefIcon$
|
|
44529
|
+
RefIcon$l.displayName = "QuestionCircleOutlined";
|
|
44530
44530
|
}
|
|
44531
44531
|
var __rest$h = function(s2, e3) {
|
|
44532
44532
|
var t2 = {};
|
|
@@ -44574,7 +44574,7 @@ const FormItemLabel = ({
|
|
|
44574
44574
|
const tooltipProps = convertToTooltipProps(tooltip);
|
|
44575
44575
|
if (tooltipProps) {
|
|
44576
44576
|
const {
|
|
44577
|
-
icon: icon2 = /* @__PURE__ */ React.createElement(RefIcon$
|
|
44577
|
+
icon: icon2 = /* @__PURE__ */ React.createElement(RefIcon$l, null)
|
|
44578
44578
|
} = tooltipProps, restTooltipProps = __rest$h(tooltipProps, ["icon"]);
|
|
44579
44579
|
const tooltipNode = /* @__PURE__ */ React.createElement(Tooltip2, Object.assign({}, restTooltipProps), /* @__PURE__ */ React.cloneElement(icon2, {
|
|
44580
44580
|
className: `${prefixCls}-item-tooltip`,
|
|
@@ -44619,10 +44619,10 @@ const FormItemLabel = ({
|
|
|
44619
44619
|
}, labelChildren));
|
|
44620
44620
|
};
|
|
44621
44621
|
const iconMap = {
|
|
44622
|
-
success: RefIcon$
|
|
44623
|
-
warning: RefIcon$
|
|
44624
|
-
error: RefIcon$
|
|
44625
|
-
validating: RefIcon$
|
|
44622
|
+
success: RefIcon$C,
|
|
44623
|
+
warning: RefIcon$z,
|
|
44624
|
+
error: RefIcon$B,
|
|
44625
|
+
validating: RefIcon$x
|
|
44626
44626
|
};
|
|
44627
44627
|
function StatusProvider({
|
|
44628
44628
|
children,
|
|
@@ -45112,9 +45112,9 @@ var EyeOutlined = function EyeOutlined2(props, ref) {
|
|
|
45112
45112
|
icon: EyeOutlined$1
|
|
45113
45113
|
}));
|
|
45114
45114
|
};
|
|
45115
|
-
var RefIcon$
|
|
45115
|
+
var RefIcon$k = /* @__PURE__ */ React.forwardRef(EyeOutlined);
|
|
45116
45116
|
if (process.env.NODE_ENV !== "production") {
|
|
45117
|
-
RefIcon$
|
|
45117
|
+
RefIcon$k.displayName = "EyeOutlined";
|
|
45118
45118
|
}
|
|
45119
45119
|
const Group = (props) => {
|
|
45120
45120
|
const {
|
|
@@ -45472,9 +45472,9 @@ var EyeInvisibleOutlined = function EyeInvisibleOutlined2(props, ref) {
|
|
|
45472
45472
|
icon: EyeInvisibleOutlined$1
|
|
45473
45473
|
}));
|
|
45474
45474
|
};
|
|
45475
|
-
var RefIcon$
|
|
45475
|
+
var RefIcon$j = /* @__PURE__ */ React.forwardRef(EyeInvisibleOutlined);
|
|
45476
45476
|
if (process.env.NODE_ENV !== "production") {
|
|
45477
|
-
RefIcon$
|
|
45477
|
+
RefIcon$j.displayName = "EyeInvisibleOutlined";
|
|
45478
45478
|
}
|
|
45479
45479
|
var __rest$c = function(s2, e3) {
|
|
45480
45480
|
var t2 = {};
|
|
@@ -45484,7 +45484,7 @@ var __rest$c = function(s2, e3) {
|
|
|
45484
45484
|
}
|
|
45485
45485
|
return t2;
|
|
45486
45486
|
};
|
|
45487
|
-
const defaultIconRender = (visible) => visible ? /* @__PURE__ */ React.createElement(RefIcon$
|
|
45487
|
+
const defaultIconRender = (visible) => visible ? /* @__PURE__ */ React.createElement(RefIcon$k, null) : /* @__PURE__ */ React.createElement(RefIcon$j, null);
|
|
45488
45488
|
const actionMap = {
|
|
45489
45489
|
click: "onClick",
|
|
45490
45490
|
hover: "onMouseOver"
|
|
@@ -45639,7 +45639,7 @@ const Search = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
45639
45639
|
customOnPressEnter === null || customOnPressEnter === void 0 ? void 0 : customOnPressEnter(e3);
|
|
45640
45640
|
onSearch(e3);
|
|
45641
45641
|
};
|
|
45642
|
-
const searchIcon = typeof enterButton === "boolean" ? /* @__PURE__ */ React.createElement(RefIcon$
|
|
45642
|
+
const searchIcon = typeof enterButton === "boolean" ? /* @__PURE__ */ React.createElement(RefIcon$t, null) : null;
|
|
45643
45643
|
const btnClassName = `${prefixCls}-button`;
|
|
45644
45644
|
let button;
|
|
45645
45645
|
const enterButtonAsElement = enterButton || {};
|
|
@@ -46308,9 +46308,9 @@ var DoubleLeftOutlined = function DoubleLeftOutlined2(props, ref) {
|
|
|
46308
46308
|
icon: DoubleLeftOutlined$1
|
|
46309
46309
|
}));
|
|
46310
46310
|
};
|
|
46311
|
-
var RefIcon$
|
|
46311
|
+
var RefIcon$i = /* @__PURE__ */ React.forwardRef(DoubleLeftOutlined);
|
|
46312
46312
|
if (process.env.NODE_ENV !== "production") {
|
|
46313
|
-
RefIcon$
|
|
46313
|
+
RefIcon$i.displayName = "DoubleLeftOutlined";
|
|
46314
46314
|
}
|
|
46315
46315
|
var DoubleRightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z" } }] }, "name": "double-right", "theme": "outlined" };
|
|
46316
46316
|
var DoubleRightOutlined = function DoubleRightOutlined2(props, ref) {
|
|
@@ -46319,9 +46319,9 @@ var DoubleRightOutlined = function DoubleRightOutlined2(props, ref) {
|
|
|
46319
46319
|
icon: DoubleRightOutlined$1
|
|
46320
46320
|
}));
|
|
46321
46321
|
};
|
|
46322
|
-
var RefIcon$
|
|
46322
|
+
var RefIcon$h = /* @__PURE__ */ React.forwardRef(DoubleRightOutlined);
|
|
46323
46323
|
if (process.env.NODE_ENV !== "production") {
|
|
46324
|
-
RefIcon$
|
|
46324
|
+
RefIcon$h.displayName = "DoubleRightOutlined";
|
|
46325
46325
|
}
|
|
46326
46326
|
var locale = {
|
|
46327
46327
|
// Options
|
|
@@ -47553,21 +47553,21 @@ const Pagination2 = (props) => {
|
|
|
47553
47553
|
className: `${prefixCls}-item-link`,
|
|
47554
47554
|
type: "button",
|
|
47555
47555
|
tabIndex: -1
|
|
47556
|
-
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$
|
|
47556
|
+
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$w, null) : /* @__PURE__ */ React.createElement(RefIcon$s, null));
|
|
47557
47557
|
const nextIcon = /* @__PURE__ */ React.createElement("button", {
|
|
47558
47558
|
className: `${prefixCls}-item-link`,
|
|
47559
47559
|
type: "button",
|
|
47560
47560
|
tabIndex: -1
|
|
47561
|
-
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$
|
|
47561
|
+
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$s, null) : /* @__PURE__ */ React.createElement(RefIcon$w, null));
|
|
47562
47562
|
const jumpPrevIcon = (
|
|
47563
47563
|
// biome-ignore lint/a11y/useValidAnchor: it is hard to refactor
|
|
47564
47564
|
/* @__PURE__ */ React.createElement("a", {
|
|
47565
47565
|
className: `${prefixCls}-item-link`
|
|
47566
47566
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
47567
47567
|
className: `${prefixCls}-item-container`
|
|
47568
|
-
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$
|
|
47568
|
+
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$h, {
|
|
47569
47569
|
className: `${prefixCls}-item-link-icon`
|
|
47570
|
-
}) : /* @__PURE__ */ React.createElement(RefIcon$
|
|
47570
|
+
}) : /* @__PURE__ */ React.createElement(RefIcon$i, {
|
|
47571
47571
|
className: `${prefixCls}-item-link-icon`
|
|
47572
47572
|
}), ellipsis))
|
|
47573
47573
|
);
|
|
@@ -47577,9 +47577,9 @@ const Pagination2 = (props) => {
|
|
|
47577
47577
|
className: `${prefixCls}-item-link`
|
|
47578
47578
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
47579
47579
|
className: `${prefixCls}-item-container`
|
|
47580
|
-
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$
|
|
47580
|
+
}, direction === "rtl" ? /* @__PURE__ */ React.createElement(RefIcon$i, {
|
|
47581
47581
|
className: `${prefixCls}-item-link-icon`
|
|
47582
|
-
}) : /* @__PURE__ */ React.createElement(RefIcon$
|
|
47582
|
+
}) : /* @__PURE__ */ React.createElement(RefIcon$h, {
|
|
47583
47583
|
className: `${prefixCls}-item-link-icon`
|
|
47584
47584
|
}), ellipsis))
|
|
47585
47585
|
);
|
|
@@ -48018,7 +48018,7 @@ const InternalSwitch = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
48018
48018
|
const prefixCls = getPrefixCls("switch", customizePrefixCls);
|
|
48019
48019
|
const loadingIcon = /* @__PURE__ */ React.createElement("div", {
|
|
48020
48020
|
className: `${prefixCls}-handle`
|
|
48021
|
-
}, loading && /* @__PURE__ */ React.createElement(RefIcon$
|
|
48021
|
+
}, loading && /* @__PURE__ */ React.createElement(RefIcon$x, {
|
|
48022
48022
|
className: `${prefixCls}-loading-icon`
|
|
48023
48023
|
}));
|
|
48024
48024
|
const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls);
|
|
@@ -48359,9 +48359,9 @@ var DeleteOutlined = function DeleteOutlined2(props, ref) {
|
|
|
48359
48359
|
icon: DeleteOutlined$1
|
|
48360
48360
|
}));
|
|
48361
48361
|
};
|
|
48362
|
-
var RefIcon$
|
|
48362
|
+
var RefIcon$g = /* @__PURE__ */ React.forwardRef(DeleteOutlined);
|
|
48363
48363
|
if (process.env.NODE_ENV !== "production") {
|
|
48364
|
-
RefIcon$
|
|
48364
|
+
RefIcon$g.displayName = "DeleteOutlined";
|
|
48365
48365
|
}
|
|
48366
48366
|
var EditOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" };
|
|
48367
48367
|
var EditOutlined = function EditOutlined2(props, ref) {
|
|
@@ -48370,9 +48370,9 @@ var EditOutlined = function EditOutlined2(props, ref) {
|
|
|
48370
48370
|
icon: EditOutlined$1
|
|
48371
48371
|
}));
|
|
48372
48372
|
};
|
|
48373
|
-
var RefIcon$
|
|
48373
|
+
var RefIcon$f = /* @__PURE__ */ React.forwardRef(EditOutlined);
|
|
48374
48374
|
if (process.env.NODE_ENV !== "production") {
|
|
48375
|
-
RefIcon$
|
|
48375
|
+
RefIcon$f.displayName = "EditOutlined";
|
|
48376
48376
|
}
|
|
48377
48377
|
var EnterOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z" } }] }, "name": "enter", "theme": "outlined" };
|
|
48378
48378
|
var EnterOutlined = function EnterOutlined2(props, ref) {
|
|
@@ -48381,9 +48381,9 @@ var EnterOutlined = function EnterOutlined2(props, ref) {
|
|
|
48381
48381
|
icon: EnterOutlined$1
|
|
48382
48382
|
}));
|
|
48383
48383
|
};
|
|
48384
|
-
var RefIcon$
|
|
48384
|
+
var RefIcon$e = /* @__PURE__ */ React.forwardRef(EnterOutlined);
|
|
48385
48385
|
if (process.env.NODE_ENV !== "production") {
|
|
48386
|
-
RefIcon$
|
|
48386
|
+
RefIcon$e.displayName = "EnterOutlined";
|
|
48387
48387
|
}
|
|
48388
48388
|
const getTitleStyle = (fontSize, lineHeight, color, token2) => {
|
|
48389
48389
|
const {
|
|
@@ -48705,7 +48705,7 @@ const Editable = (props) => {
|
|
|
48705
48705
|
onCancel,
|
|
48706
48706
|
onEnd,
|
|
48707
48707
|
component,
|
|
48708
|
-
enterIcon = /* @__PURE__ */ React.createElement(RefIcon$
|
|
48708
|
+
enterIcon = /* @__PURE__ */ React.createElement(RefIcon$e, null)
|
|
48709
48709
|
} = props;
|
|
48710
48710
|
const ref = React.useRef(null);
|
|
48711
48711
|
const inComposition = React.useRef(false);
|
|
@@ -49091,9 +49091,9 @@ var CopyOutlined = function CopyOutlined2(props, ref) {
|
|
|
49091
49091
|
icon: CopyOutlined$1
|
|
49092
49092
|
}));
|
|
49093
49093
|
};
|
|
49094
|
-
var RefIcon$
|
|
49094
|
+
var RefIcon$d = /* @__PURE__ */ React.forwardRef(CopyOutlined);
|
|
49095
49095
|
if (process.env.NODE_ENV !== "production") {
|
|
49096
|
-
RefIcon$
|
|
49096
|
+
RefIcon$d.displayName = "CopyOutlined";
|
|
49097
49097
|
}
|
|
49098
49098
|
function toList(val) {
|
|
49099
49099
|
if (val === false) {
|
|
@@ -49154,7 +49154,7 @@ const CopyBtn = ({
|
|
|
49154
49154
|
onClick: onCopy,
|
|
49155
49155
|
"aria-label": ariaLabel,
|
|
49156
49156
|
tabIndex
|
|
49157
|
-
}, copied ? getNode(iconNodes[1], /* @__PURE__ */ React.createElement(RefIcon$
|
|
49157
|
+
}, copied ? getNode(iconNodes[1], /* @__PURE__ */ React.createElement(RefIcon$v, null), true) : getNode(iconNodes[0], btnLoading ? /* @__PURE__ */ React.createElement(RefIcon$x, null) : /* @__PURE__ */ React.createElement(RefIcon$d, null), true)));
|
|
49158
49158
|
};
|
|
49159
49159
|
const MeasureText = /* @__PURE__ */ React.forwardRef(({
|
|
49160
49160
|
style: style2,
|
|
@@ -49593,7 +49593,7 @@ const Base = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
49593
49593
|
onClick: onEditClick,
|
|
49594
49594
|
"aria-label": ariaLabel,
|
|
49595
49595
|
tabIndex
|
|
49596
|
-
}, icon2 || /* @__PURE__ */ React.createElement(RefIcon$
|
|
49596
|
+
}, icon2 || /* @__PURE__ */ React.createElement(RefIcon$f, {
|
|
49597
49597
|
role: "button"
|
|
49598
49598
|
}))) : null;
|
|
49599
49599
|
};
|
|
@@ -49770,9 +49770,9 @@ var AppstoreOutlined = function AppstoreOutlined2(props, ref) {
|
|
|
49770
49770
|
icon: AppstoreOutlined$1
|
|
49771
49771
|
}));
|
|
49772
49772
|
};
|
|
49773
|
-
var RefIcon$
|
|
49773
|
+
var RefIcon$c = /* @__PURE__ */ React.forwardRef(AppstoreOutlined);
|
|
49774
49774
|
if (process.env.NODE_ENV !== "production") {
|
|
49775
|
-
RefIcon$
|
|
49775
|
+
RefIcon$c.displayName = "AppstoreOutlined";
|
|
49776
49776
|
}
|
|
49777
49777
|
var ArrowLeftOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "arrow-left", "theme": "outlined" };
|
|
49778
49778
|
var ArrowLeftOutlined = function ArrowLeftOutlined2(props, ref) {
|
|
@@ -49781,9 +49781,9 @@ var ArrowLeftOutlined = function ArrowLeftOutlined2(props, ref) {
|
|
|
49781
49781
|
icon: ArrowLeftOutlined$1
|
|
49782
49782
|
}));
|
|
49783
49783
|
};
|
|
49784
|
-
var RefIcon$
|
|
49784
|
+
var RefIcon$b = /* @__PURE__ */ React.forwardRef(ArrowLeftOutlined);
|
|
49785
49785
|
if (process.env.NODE_ENV !== "production") {
|
|
49786
|
-
RefIcon$
|
|
49786
|
+
RefIcon$b.displayName = "ArrowLeftOutlined";
|
|
49787
49787
|
}
|
|
49788
49788
|
var ArrowRightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z" } }] }, "name": "arrow-right", "theme": "outlined" };
|
|
49789
49789
|
var ArrowRightOutlined = function ArrowRightOutlined2(props, ref) {
|
|
@@ -49792,9 +49792,9 @@ var ArrowRightOutlined = function ArrowRightOutlined2(props, ref) {
|
|
|
49792
49792
|
icon: ArrowRightOutlined$1
|
|
49793
49793
|
}));
|
|
49794
49794
|
};
|
|
49795
|
-
var RefIcon$
|
|
49795
|
+
var RefIcon$a = /* @__PURE__ */ React.forwardRef(ArrowRightOutlined);
|
|
49796
49796
|
if (process.env.NODE_ENV !== "production") {
|
|
49797
|
-
RefIcon$
|
|
49797
|
+
RefIcon$a.displayName = "ArrowRightOutlined";
|
|
49798
49798
|
}
|
|
49799
49799
|
var CodeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "code", "theme": "outlined" };
|
|
49800
49800
|
var CodeOutlined = function CodeOutlined2(props, ref) {
|
|
@@ -49803,9 +49803,9 @@ var CodeOutlined = function CodeOutlined2(props, ref) {
|
|
|
49803
49803
|
icon: CodeOutlined$1
|
|
49804
49804
|
}));
|
|
49805
49805
|
};
|
|
49806
|
-
var RefIcon$
|
|
49806
|
+
var RefIcon$9 = /* @__PURE__ */ React.forwardRef(CodeOutlined);
|
|
49807
49807
|
if (process.env.NODE_ENV !== "production") {
|
|
49808
|
-
RefIcon$
|
|
49808
|
+
RefIcon$9.displayName = "CodeOutlined";
|
|
49809
49809
|
}
|
|
49810
49810
|
var ControlOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z" } }] }, "name": "control", "theme": "outlined" };
|
|
49811
49811
|
var ControlOutlined = function ControlOutlined2(props, ref) {
|
|
@@ -49814,9 +49814,20 @@ var ControlOutlined = function ControlOutlined2(props, ref) {
|
|
|
49814
49814
|
icon: ControlOutlined$1
|
|
49815
49815
|
}));
|
|
49816
49816
|
};
|
|
49817
|
-
var RefIcon$
|
|
49817
|
+
var RefIcon$8 = /* @__PURE__ */ React.forwardRef(ControlOutlined);
|
|
49818
49818
|
if (process.env.NODE_ENV !== "production") {
|
|
49819
|
-
RefIcon$
|
|
49819
|
+
RefIcon$8.displayName = "ControlOutlined";
|
|
49820
|
+
}
|
|
49821
|
+
var DiffOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M476 399.1c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1V484h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H420v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V540h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H476v-84.9zM560.5 704h-225c-4.1 0-7.5 3.2-7.5 7v42c0 3.8 3.4 7 7.5 7h225c4.1 0 7.5-3.2 7.5-7v-42c0-3.8-3.4-7-7.5-7zm-7.1-502.6c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v704c0 17.7 14.3 32 32 32h512c17.7 0 32-14.3 32-32V397.3c0-8.5-3.4-16.6-9.4-22.6L553.4 201.4zM664 888H232V264h282.2L664 413.8V888zm190.2-581.4L611.3 72.9c-6-5.7-13.9-8.9-22.2-8.9H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h277l219 210.6V824c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V329.6c0-8.7-3.5-17-9.8-23z" } }] }, "name": "diff", "theme": "outlined" };
|
|
49822
|
+
var DiffOutlined = function DiffOutlined2(props, ref) {
|
|
49823
|
+
return /* @__PURE__ */ React.createElement(Icon$2, _extends$1({}, props, {
|
|
49824
|
+
ref,
|
|
49825
|
+
icon: DiffOutlined$1
|
|
49826
|
+
}));
|
|
49827
|
+
};
|
|
49828
|
+
var RefIcon$7 = /* @__PURE__ */ React.forwardRef(DiffOutlined);
|
|
49829
|
+
if (process.env.NODE_ENV !== "production") {
|
|
49830
|
+
RefIcon$7.displayName = "DiffOutlined";
|
|
49820
49831
|
}
|
|
49821
49832
|
var ExportOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z" } }] }, "name": "export", "theme": "outlined" };
|
|
49822
49833
|
var ExportOutlined = function ExportOutlined2(props, ref) {
|
|
@@ -60101,7 +60112,7 @@ const Text$2 = ({
|
|
|
60101
60112
|
color: "green",
|
|
60102
60113
|
size: "middle",
|
|
60103
60114
|
danger: !isValidTextValue,
|
|
60104
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
60115
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, {})
|
|
60105
60116
|
}
|
|
60106
60117
|
)
|
|
60107
60118
|
] }),
|
|
@@ -67653,7 +67664,21 @@ const useStateStore = () => {
|
|
|
67653
67664
|
const scopedStore = useContext(StateStoreContext);
|
|
67654
67665
|
return useStore(scopedStore ?? defaultStore);
|
|
67655
67666
|
};
|
|
67656
|
-
const
|
|
67667
|
+
const AiEditedFieldBadge = ({
|
|
67668
|
+
className = "",
|
|
67669
|
+
title,
|
|
67670
|
+
ariaLabel,
|
|
67671
|
+
variant = "edited"
|
|
67672
|
+
}) => {
|
|
67673
|
+
const label = variant === "deleted" ? "Deleted by AI" : "Edited by AI";
|
|
67674
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: title ?? label, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `describo-ai-edited-icon ${className}`, "aria-label": ariaLabel ?? label, children: "✦" }) });
|
|
67675
|
+
};
|
|
67676
|
+
const EntityId = ({
|
|
67677
|
+
entity,
|
|
67678
|
+
onUpdate,
|
|
67679
|
+
aiEdited = false,
|
|
67680
|
+
aiEditedVariant = "edited"
|
|
67681
|
+
}) => {
|
|
67657
67682
|
var _a2;
|
|
67658
67683
|
const state = useStateStore();
|
|
67659
67684
|
const handleSave = async (data) => {
|
|
@@ -67667,7 +67692,10 @@ const EntityId = ({ entity, onUpdate }) => {
|
|
|
67667
67692
|
return entity["@id"] === "./" || types2.some((type4) => ["Dataset", "File"].includes(type4));
|
|
67668
67693
|
};
|
|
67669
67694
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row", children: [
|
|
67670
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
67695
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 describo-property-name describo-property-name-with-ai", children: [
|
|
67696
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "@id" }),
|
|
67697
|
+
aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
|
|
67698
|
+
] }),
|
|
67671
67699
|
!((_a2 = state.configuration) == null ? void 0 : _a2.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-2/3 xl:w-4/5 flex flex-row describo-property-value", children: [
|
|
67672
67700
|
isURL(entity["@id"]) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67673
67701
|
Button$1,
|
|
@@ -67693,7 +67721,12 @@ const EntityId = ({ entity, onUpdate }) => {
|
|
|
67693
67721
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: entity["@id"] }) })
|
|
67694
67722
|
] });
|
|
67695
67723
|
};
|
|
67696
|
-
const EntityType = ({
|
|
67724
|
+
const EntityType = ({
|
|
67725
|
+
entity,
|
|
67726
|
+
onUpdateEntity,
|
|
67727
|
+
aiEdited = false,
|
|
67728
|
+
aiEditedVariant = "edited"
|
|
67729
|
+
}) => {
|
|
67697
67730
|
var _a2;
|
|
67698
67731
|
const [selectedClass, setSelectedClass] = useState(void 0);
|
|
67699
67732
|
const profileManager = useContext(ProfileManagerContext);
|
|
@@ -67728,7 +67761,10 @@ const EntityType = ({ entity, onUpdateEntity }) => {
|
|
|
67728
67761
|
setSelectedClass("");
|
|
67729
67762
|
};
|
|
67730
67763
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row", children: [
|
|
67731
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
67764
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 describo-property-name describo-property-name-with-ai", children: [
|
|
67765
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "@type" }),
|
|
67766
|
+
aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
|
|
67767
|
+
] }),
|
|
67732
67768
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "w-2/3 xl:w-4/5 flex-row flex-wrap", children: [
|
|
67733
67769
|
types2.map((etype) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67734
67770
|
Tag$1,
|
|
@@ -67761,27 +67797,130 @@ const EntityType = ({ entity, onUpdateEntity }) => {
|
|
|
67761
67797
|
] })
|
|
67762
67798
|
] });
|
|
67763
67799
|
};
|
|
67764
|
-
const
|
|
67800
|
+
const valueIsEmpty = (value) => {
|
|
67801
|
+
if (value === void 0 || value === null) return true;
|
|
67802
|
+
if (typeof value === "string") return value.trim().length === 0;
|
|
67803
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
67804
|
+
return false;
|
|
67805
|
+
};
|
|
67806
|
+
const formatValue = (value) => {
|
|
67807
|
+
if (valueIsEmpty(value)) return "empty";
|
|
67808
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
67809
|
+
return String(value);
|
|
67810
|
+
}
|
|
67811
|
+
try {
|
|
67812
|
+
return JSON.stringify(value, null, 2);
|
|
67813
|
+
} catch {
|
|
67814
|
+
return String(value);
|
|
67815
|
+
}
|
|
67816
|
+
};
|
|
67817
|
+
const AiFieldDiffView = ({
|
|
67818
|
+
previousValue,
|
|
67819
|
+
currentValue,
|
|
67820
|
+
operation
|
|
67821
|
+
}) => {
|
|
67822
|
+
const isDelete = operation === "delete";
|
|
67823
|
+
const removedValue = formatValue(previousValue);
|
|
67824
|
+
const addedValue = isDelete ? "empty" : formatValue(currentValue);
|
|
67825
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff", "aria-label": "AI field diff", children: [
|
|
67826
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff-head", children: [
|
|
67827
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isDelete ? "Proposed deletion" : "Proposed change" }),
|
|
67828
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-field-diff-chip", children: "AI edit" })
|
|
67829
|
+
] }),
|
|
67830
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff-line describo-ai-field-diff-line-removed", children: [
|
|
67831
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-field-diff-marker", children: "-" }),
|
|
67832
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `describo-ai-field-diff-value ${valueIsEmpty(previousValue) ? "describo-ai-field-diff-empty" : ""}`, children: removedValue })
|
|
67833
|
+
] }),
|
|
67834
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-field-diff-line describo-ai-field-diff-line-added", children: [
|
|
67835
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-field-diff-marker", children: "+" }),
|
|
67836
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `describo-ai-field-diff-value ${valueIsEmpty(isDelete ? void 0 : currentValue) ? "describo-ai-field-diff-empty" : ""}`, children: addedValue })
|
|
67837
|
+
] })
|
|
67838
|
+
] });
|
|
67839
|
+
};
|
|
67840
|
+
const EntityName = ({
|
|
67841
|
+
entity,
|
|
67842
|
+
onUpdate,
|
|
67843
|
+
showHelp = true,
|
|
67844
|
+
aiEdited = false,
|
|
67845
|
+
aiEditedVariant = "edited",
|
|
67846
|
+
aiReview
|
|
67847
|
+
}) => {
|
|
67765
67848
|
var _a2;
|
|
67766
67849
|
const [t2, i18n] = useTranslation();
|
|
67767
67850
|
const state = useStateStore();
|
|
67851
|
+
const [showAiDiff, setShowAiDiff] = useState(false);
|
|
67852
|
+
const showAiReview = Boolean(aiReview);
|
|
67853
|
+
const isAiDelete = (aiReview == null ? void 0 : aiReview.operation) === "delete";
|
|
67768
67854
|
const handleSave = async (data) => {
|
|
67769
67855
|
onUpdate(data);
|
|
67770
67856
|
};
|
|
67771
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
67772
|
-
|
|
67773
|
-
|
|
67774
|
-
|
|
67775
|
-
|
|
67776
|
-
|
|
67777
|
-
|
|
67778
|
-
|
|
67779
|
-
|
|
67780
|
-
|
|
67781
|
-
|
|
67782
|
-
|
|
67783
|
-
|
|
67784
|
-
|
|
67857
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
67858
|
+
"div",
|
|
67859
|
+
{
|
|
67860
|
+
className: `flex flex-row ${showAiReview ? `${showHelp ? "p-2" : "px-2 py-1 describo-property-compact"} describo-ai-review ${isAiDelete ? "describo-ai-delete" : "describo-ai-suggestion"}` : ""} describo-property describo-property-name-name`,
|
|
67861
|
+
children: [
|
|
67862
|
+
showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge", children: [
|
|
67863
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
|
|
67864
|
+
isAiDelete ? "AI delete" : "AI suggestion"
|
|
67865
|
+
] }),
|
|
67866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col", children: [
|
|
67867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-property-name describo-property-name-with-ai", children: [
|
|
67868
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("name_field_label") }),
|
|
67869
|
+
aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
|
|
67870
|
+
] }),
|
|
67871
|
+
showHelp && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 font-light text-xs pr-1 describo-property-help", children: t2("name_field_help") })
|
|
67872
|
+
] }),
|
|
67873
|
+
!((_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 ? "describo-ai-field-row" : ""}`, children: [
|
|
67874
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-grow min-w-0 ${showAiReview ? "describo-ai-field-control" : ""}`, children: showAiDiff && (aiReview == null ? void 0 : aiReview.previousValueDiffers) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67875
|
+
AiFieldDiffView,
|
|
67876
|
+
{
|
|
67877
|
+
previousValue: aiReview == null ? void 0 : aiReview.previousValue,
|
|
67878
|
+
currentValue: entity.name,
|
|
67879
|
+
operation: aiReview == null ? void 0 : aiReview.operation
|
|
67880
|
+
}
|
|
67881
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67882
|
+
Text$2,
|
|
67883
|
+
{
|
|
67884
|
+
property: "name",
|
|
67885
|
+
value: entity.name,
|
|
67886
|
+
onSaveProperty: handleSave
|
|
67887
|
+
}
|
|
67888
|
+
) }),
|
|
67889
|
+
showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-actions", children: [
|
|
67890
|
+
(aiReview == null ? void 0 : aiReview.previousValueDiffers) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiDiff ? "Hide diff" : "Show diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67891
|
+
Button$1,
|
|
67892
|
+
{
|
|
67893
|
+
size: "middle",
|
|
67894
|
+
className: "describo-ai-action-diff",
|
|
67895
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
|
|
67896
|
+
"aria-label": showAiDiff ? "Hide AI diff" : "Show AI diff",
|
|
67897
|
+
"aria-pressed": showAiDiff,
|
|
67898
|
+
onClick: () => setShowAiDiff((visible) => !visible)
|
|
67899
|
+
}
|
|
67900
|
+
) }),
|
|
67901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isAiDelete ? "Approve this AI deletion" : "Approve this AI-suggested value", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67902
|
+
Button$1,
|
|
67903
|
+
{
|
|
67904
|
+
size: "middle",
|
|
67905
|
+
className: "describo-ai-action-approve",
|
|
67906
|
+
onClick: aiReview == null ? void 0 : aiReview.onApprove,
|
|
67907
|
+
children: isAiDelete ? "Delete" : "Accept"
|
|
67908
|
+
}
|
|
67909
|
+
) }),
|
|
67910
|
+
(aiReview == null ? void 0 : aiReview.previousValueDiffers) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore the previous value and mark this suggestion reviewed", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67911
|
+
Button$1,
|
|
67912
|
+
{
|
|
67913
|
+
size: "middle",
|
|
67914
|
+
className: "describo-ai-action-reject",
|
|
67915
|
+
onClick: aiReview == null ? void 0 : aiReview.onReject,
|
|
67916
|
+
children: isAiDelete ? "Restore" : "Reject"
|
|
67917
|
+
}
|
|
67918
|
+
) })
|
|
67919
|
+
] })
|
|
67920
|
+
] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2/3 xl:w-4/5 flex flex-row", children: entity.name })
|
|
67921
|
+
]
|
|
67922
|
+
}
|
|
67923
|
+
);
|
|
67785
67924
|
};
|
|
67786
67925
|
const PropertyHelp = ({ help }) => {
|
|
67787
67926
|
const [showMore, setShowMore] = useState(false);
|
|
@@ -68067,7 +68206,7 @@ const NumberComponent = ({
|
|
|
68067
68206
|
color: "green",
|
|
68068
68207
|
size: "middle",
|
|
68069
68208
|
disabled: !isValidNumber || !isValidConstraints,
|
|
68070
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
68209
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, {})
|
|
68071
68210
|
}
|
|
68072
68211
|
)
|
|
68073
68212
|
] }),
|
|
@@ -68093,6 +68232,7 @@ const SelectComponent = ({
|
|
|
68093
68232
|
const [internalValue, setInternalValue] = useState(value === "" ? void 0 : value);
|
|
68094
68233
|
const [hasValidValues, setHasValidValues] = useState(false);
|
|
68095
68234
|
useEffect(() => {
|
|
68235
|
+
setInternalValue(value === "" ? void 0 : value);
|
|
68096
68236
|
setHasValidValues(verifySelectValuesAreStrings(definition.values));
|
|
68097
68237
|
}, [value]);
|
|
68098
68238
|
useEffect(() => {
|
|
@@ -68205,7 +68345,7 @@ const Url = ({
|
|
|
68205
68345
|
color: "green",
|
|
68206
68346
|
size: "middle",
|
|
68207
68347
|
danger: !isValidUrl,
|
|
68208
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
68348
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, {})
|
|
68209
68349
|
}
|
|
68210
68350
|
)
|
|
68211
68351
|
] }),
|
|
@@ -68453,98 +68593,6 @@ const EntityPropertyInstance = ({
|
|
|
68453
68593
|
}
|
|
68454
68594
|
);
|
|
68455
68595
|
};
|
|
68456
|
-
/*!
|
|
68457
|
-
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
|
68458
|
-
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
68459
|
-
* Copyright 2024 Fonticons, Inc.
|
|
68460
|
-
*/
|
|
68461
|
-
const faJs = {
|
|
68462
|
-
prefix: "fab",
|
|
68463
|
-
iconName: "js",
|
|
68464
|
-
icon: [448, 512, [], "f3b8", "M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"]
|
|
68465
|
-
};
|
|
68466
|
-
const typeIcons = {
|
|
68467
|
-
Book: faBookOpen,
|
|
68468
|
-
ContactPoint: faAddressCard,
|
|
68469
|
-
ComputerLanguage: faJs,
|
|
68470
|
-
CreateAction: faPlus,
|
|
68471
|
-
CreativeWork: faImage,
|
|
68472
|
-
Country: faFlag,
|
|
68473
|
-
Dataset: faFolder,
|
|
68474
|
-
DataDownload: faDownload,
|
|
68475
|
-
DerivedMaterial: faDownload,
|
|
68476
|
-
File: faFile,
|
|
68477
|
-
GeoCoordinates: faMapMarkerAlt,
|
|
68478
|
-
GeoShape: faMapMarkerAlt,
|
|
68479
|
-
IndividualProduct: faBarcode,
|
|
68480
|
-
Language: faSignLanguage,
|
|
68481
|
-
Organization: faUniversity,
|
|
68482
|
-
Organisation: faUniversity,
|
|
68483
|
-
Person: faUser,
|
|
68484
|
-
Place: faGlobe,
|
|
68485
|
-
PropertyValue: faParagraph,
|
|
68486
|
-
Publication: faNewspaper,
|
|
68487
|
-
RepositoryCollection: faCubes,
|
|
68488
|
-
RepositoryObject: faCube,
|
|
68489
|
-
ScholarlyArticle: faScroll,
|
|
68490
|
-
Script: faCode,
|
|
68491
|
-
SoftwareApplication: faCode,
|
|
68492
|
-
URL: faLink,
|
|
68493
|
-
Workflow: faProjectDiagram,
|
|
68494
|
-
WorkflowSketch: faProjectDiagram
|
|
68495
|
-
};
|
|
68496
|
-
const RenderTypes = ({ types: types2 }) => {
|
|
68497
|
-
const profileManager = useContext(ProfileManagerContext);
|
|
68498
|
-
const getTypeLabelFromProfile = (type4) => {
|
|
68499
|
-
return (profileManager == null ? void 0 : profileManager.getTypeLabel(type4)) || type4;
|
|
68500
|
-
};
|
|
68501
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row space-x-1", children: types2.map((etype, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
68502
|
-
Tag$1,
|
|
68503
|
-
{
|
|
68504
|
-
className: "text-gray-800 font-light flex flex-row items-center space-x-1",
|
|
68505
|
-
style: {
|
|
68506
|
-
backgroundColor: "#f0f0f0",
|
|
68507
|
-
borderRadius: "16px",
|
|
68508
|
-
padding: "0 12px",
|
|
68509
|
-
height: "32px",
|
|
68510
|
-
display: "flex",
|
|
68511
|
-
alignItems: "center",
|
|
68512
|
-
margin: "4px"
|
|
68513
|
-
},
|
|
68514
|
-
children: [
|
|
68515
|
-
typeIcons[etype] && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
68516
|
-
FontAwesomeIcon,
|
|
68517
|
-
{
|
|
68518
|
-
icon: typeIcons[etype],
|
|
68519
|
-
fixedWidth: true
|
|
68520
|
-
}
|
|
68521
|
-
),
|
|
68522
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: getTypeLabelFromProfile(etype) })
|
|
68523
|
-
]
|
|
68524
|
-
},
|
|
68525
|
-
idx
|
|
68526
|
-
)) });
|
|
68527
|
-
};
|
|
68528
|
-
const ItemLink = ({ entity, onLoadEntity, className }) => {
|
|
68529
|
-
const handleLoadEntity = () => {
|
|
68530
|
-
onLoadEntity({ id: entity["@id"] });
|
|
68531
|
-
};
|
|
68532
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex min-w-0 w-full flex-col ${className || ""}`, onClick: handleLoadEntity, children: [
|
|
68533
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
68534
|
-
Typography.Text,
|
|
68535
|
-
{
|
|
68536
|
-
type: "secondary",
|
|
68537
|
-
style: { fontSize: "0.75rem" },
|
|
68538
|
-
className: "pb-1 mb-1 border-b border-black/20",
|
|
68539
|
-
children: decodeURIComponent(entity["@id"])
|
|
68540
|
-
}
|
|
68541
|
-
),
|
|
68542
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 items-center", children: [
|
|
68543
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-base flex flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderTypes, { types: entity["@type"] }) }),
|
|
68544
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { strong: true, children: entity.name })
|
|
68545
|
-
] })
|
|
68546
|
-
] });
|
|
68547
|
-
};
|
|
68548
68596
|
const UnlinkEntity = ({ entity, onUnlinkEntity }) => {
|
|
68549
68597
|
const handleUnlink = () => {
|
|
68550
68598
|
onUnlinkEntity({ entity: { "@id": entity["@id"] } });
|
|
@@ -79784,18 +79832,563 @@ const Map$1 = ({ entity, crateManager }) => {
|
|
|
79784
79832
|
};
|
|
79785
79833
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: mapId, className: "w-[600px] h-[520px] describo-property-type-map", ref: mapRef });
|
|
79786
79834
|
};
|
|
79835
|
+
const formatEntityDiffValue = (value) => {
|
|
79836
|
+
if (value === void 0 || value === null) return "empty";
|
|
79837
|
+
if (Array.isArray(value)) return value.map(formatEntityDiffValue).join(", ");
|
|
79838
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
79839
|
+
return String(value);
|
|
79840
|
+
}
|
|
79841
|
+
if (typeof (value == null ? void 0 : value["@id"]) === "string") return value["@id"];
|
|
79842
|
+
try {
|
|
79843
|
+
return JSON.stringify(value);
|
|
79844
|
+
} catch {
|
|
79845
|
+
return String(value);
|
|
79846
|
+
}
|
|
79847
|
+
};
|
|
79848
|
+
const AiEntityDiffView = ({
|
|
79849
|
+
entityId,
|
|
79850
|
+
rows,
|
|
79851
|
+
operation = "edit",
|
|
79852
|
+
readonly = false,
|
|
79853
|
+
onClose,
|
|
79854
|
+
onAccept,
|
|
79855
|
+
onReject
|
|
79856
|
+
}) => {
|
|
79857
|
+
const isDelete = operation === "delete";
|
|
79858
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `describo-ai-entity-diff-card ${isDelete ? "describo-ai-entity-diff-card-delete" : ""}`, children: [
|
|
79859
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-diff-head", children: [
|
|
79860
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: isDelete ? `AI deleted entity: ${entityId}` : `AI edited entity: ${entityId}` }),
|
|
79861
|
+
onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Hide entity diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79862
|
+
Button$1,
|
|
79863
|
+
{
|
|
79864
|
+
type: "text",
|
|
79865
|
+
size: "small",
|
|
79866
|
+
className: "describo-ai-entity-diff-close",
|
|
79867
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, {}),
|
|
79868
|
+
"aria-label": "Hide AI entity diff",
|
|
79869
|
+
onClick: (event) => {
|
|
79870
|
+
event.stopPropagation();
|
|
79871
|
+
onClose();
|
|
79872
|
+
}
|
|
79873
|
+
}
|
|
79874
|
+
) })
|
|
79875
|
+
] }),
|
|
79876
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-body", children: rows.map((row, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
79877
|
+
"div",
|
|
79878
|
+
{
|
|
79879
|
+
className: `describo-ai-entity-diff-line describo-ai-entity-diff-line-${row.kind}`,
|
|
79880
|
+
children: [
|
|
79881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-marker", children: row.kind === "removed" ? "-" : row.kind === "added" ? "+" : "" }),
|
|
79882
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-key", children: row.label }),
|
|
79883
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-entity-diff-value", children: formatEntityDiffValue(row.value) })
|
|
79884
|
+
]
|
|
79885
|
+
},
|
|
79886
|
+
`${row.kind}-${row.propertyName}-${index2}`
|
|
79887
|
+
)) }),
|
|
79888
|
+
!readonly && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-diff-actions", children: [
|
|
79889
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isDelete ? "Approve this AI deletion" : "Accept every AI edit for this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79890
|
+
Button$1,
|
|
79891
|
+
{
|
|
79892
|
+
size: "middle",
|
|
79893
|
+
className: "describo-ai-entity-diff-button",
|
|
79894
|
+
onClick: (event) => {
|
|
79895
|
+
event.stopPropagation();
|
|
79896
|
+
onAccept == null ? void 0 : onAccept();
|
|
79897
|
+
},
|
|
79898
|
+
children: isDelete ? "Delete entity" : "Accept edit"
|
|
79899
|
+
}
|
|
79900
|
+
) }),
|
|
79901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isDelete ? "Restore this entity and mark the deletion reviewed" : "Restore previous values for this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79902
|
+
Button$1,
|
|
79903
|
+
{
|
|
79904
|
+
size: "middle",
|
|
79905
|
+
className: "describo-ai-entity-diff-button describo-ai-entity-diff-button-reject",
|
|
79906
|
+
onClick: (event) => {
|
|
79907
|
+
event.stopPropagation();
|
|
79908
|
+
onReject == null ? void 0 : onReject();
|
|
79909
|
+
},
|
|
79910
|
+
children: isDelete ? "Keep entity" : "Reject edit"
|
|
79911
|
+
}
|
|
79912
|
+
) })
|
|
79913
|
+
] })
|
|
79914
|
+
] });
|
|
79915
|
+
};
|
|
79916
|
+
/*!
|
|
79917
|
+
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
|
79918
|
+
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
79919
|
+
* Copyright 2024 Fonticons, Inc.
|
|
79920
|
+
*/
|
|
79921
|
+
const faJs = {
|
|
79922
|
+
prefix: "fab",
|
|
79923
|
+
iconName: "js",
|
|
79924
|
+
icon: [448, 512, [], "f3b8", "M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"]
|
|
79925
|
+
};
|
|
79926
|
+
const typeIcons = {
|
|
79927
|
+
Book: faBookOpen,
|
|
79928
|
+
ContactPoint: faAddressCard,
|
|
79929
|
+
ComputerLanguage: faJs,
|
|
79930
|
+
CreateAction: faPlus,
|
|
79931
|
+
CreativeWork: faImage,
|
|
79932
|
+
Country: faFlag,
|
|
79933
|
+
Dataset: faFolder,
|
|
79934
|
+
DataDownload: faDownload,
|
|
79935
|
+
DerivedMaterial: faDownload,
|
|
79936
|
+
File: faFile,
|
|
79937
|
+
GeoCoordinates: faMapMarkerAlt,
|
|
79938
|
+
GeoShape: faMapMarkerAlt,
|
|
79939
|
+
IndividualProduct: faBarcode,
|
|
79940
|
+
Language: faSignLanguage,
|
|
79941
|
+
Organization: faUniversity,
|
|
79942
|
+
Organisation: faUniversity,
|
|
79943
|
+
Person: faUser,
|
|
79944
|
+
Place: faGlobe,
|
|
79945
|
+
PropertyValue: faParagraph,
|
|
79946
|
+
Publication: faNewspaper,
|
|
79947
|
+
RepositoryCollection: faCubes,
|
|
79948
|
+
RepositoryObject: faCube,
|
|
79949
|
+
ScholarlyArticle: faScroll,
|
|
79950
|
+
Script: faCode,
|
|
79951
|
+
SoftwareApplication: faCode,
|
|
79952
|
+
URL: faLink,
|
|
79953
|
+
Workflow: faProjectDiagram,
|
|
79954
|
+
WorkflowSketch: faProjectDiagram
|
|
79955
|
+
};
|
|
79956
|
+
const RenderTypes = ({ types: types2 }) => {
|
|
79957
|
+
const profileManager = useContext(ProfileManagerContext);
|
|
79958
|
+
const getTypeLabelFromProfile = (type4) => {
|
|
79959
|
+
return (profileManager == null ? void 0 : profileManager.getTypeLabel(type4)) || type4;
|
|
79960
|
+
};
|
|
79961
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row space-x-1", children: types2.map((etype, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
79962
|
+
Tag$1,
|
|
79963
|
+
{
|
|
79964
|
+
className: "text-gray-800 font-light flex flex-row items-center space-x-1",
|
|
79965
|
+
style: {
|
|
79966
|
+
backgroundColor: "#f0f0f0",
|
|
79967
|
+
borderRadius: "16px",
|
|
79968
|
+
padding: "0 12px",
|
|
79969
|
+
height: "32px",
|
|
79970
|
+
display: "flex",
|
|
79971
|
+
alignItems: "center",
|
|
79972
|
+
margin: "4px"
|
|
79973
|
+
},
|
|
79974
|
+
children: [
|
|
79975
|
+
typeIcons[etype] && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79976
|
+
FontAwesomeIcon,
|
|
79977
|
+
{
|
|
79978
|
+
icon: typeIcons[etype],
|
|
79979
|
+
fixedWidth: true
|
|
79980
|
+
}
|
|
79981
|
+
),
|
|
79982
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: getTypeLabelFromProfile(etype) })
|
|
79983
|
+
]
|
|
79984
|
+
},
|
|
79985
|
+
idx
|
|
79986
|
+
)) });
|
|
79987
|
+
};
|
|
79988
|
+
const LinkedEntityCardHeader = ({ entity }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 w-full flex-col", children: [
|
|
79989
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79990
|
+
Typography.Text,
|
|
79991
|
+
{
|
|
79992
|
+
type: "secondary",
|
|
79993
|
+
style: { fontSize: "0.75rem" },
|
|
79994
|
+
className: "pb-1 mb-1 border-b border-black/20",
|
|
79995
|
+
children: decodeURIComponent(entity["@id"])
|
|
79996
|
+
}
|
|
79997
|
+
),
|
|
79998
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 items-center", children: [
|
|
79999
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-base flex flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderTypes, { types: entity["@type"] }) }),
|
|
80000
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { strong: true, children: entity.name })
|
|
80001
|
+
] })
|
|
80002
|
+
] });
|
|
80003
|
+
const DeletedLinkedEntityCard = ({
|
|
80004
|
+
entity,
|
|
80005
|
+
displayEntity,
|
|
80006
|
+
fieldCount,
|
|
80007
|
+
fields,
|
|
80008
|
+
readonly,
|
|
80009
|
+
onLoadEntity,
|
|
80010
|
+
onAcceptDelete,
|
|
80011
|
+
onRestore
|
|
80012
|
+
}) => {
|
|
80013
|
+
const [showDeletedFields, setShowDeletedFields] = useState(false);
|
|
80014
|
+
const deletedDiffRows = fields.map((field) => ({
|
|
80015
|
+
kind: "removed",
|
|
80016
|
+
propertyName: field.propertyName,
|
|
80017
|
+
label: field.label,
|
|
80018
|
+
value: field.previousValue
|
|
80019
|
+
}));
|
|
80020
|
+
if (showDeletedFields) {
|
|
80021
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80022
|
+
AiEntityDiffView,
|
|
80023
|
+
{
|
|
80024
|
+
entityId: entity["@id"],
|
|
80025
|
+
rows: deletedDiffRows,
|
|
80026
|
+
operation: "delete",
|
|
80027
|
+
readonly,
|
|
80028
|
+
onClose: () => setShowDeletedFields(false),
|
|
80029
|
+
onAccept: () => onAcceptDelete == null ? void 0 : onAcceptDelete(entity),
|
|
80030
|
+
onReject: () => onRestore == null ? void 0 : onRestore(entity)
|
|
80031
|
+
}
|
|
80032
|
+
);
|
|
80033
|
+
}
|
|
80034
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
80035
|
+
Card,
|
|
80036
|
+
{
|
|
80037
|
+
className: "describo-ai-entity-delete-card describo-ai-entity-reviewed-card",
|
|
80038
|
+
style: {
|
|
80039
|
+
backgroundColor: "#fef2f2",
|
|
80040
|
+
cursor: "pointer",
|
|
80041
|
+
transition: "background-color 0.2s",
|
|
80042
|
+
borderLeft: "3px solid #ef4444"
|
|
80043
|
+
},
|
|
80044
|
+
styles: { body: { padding: "22px 12px 8px" } },
|
|
80045
|
+
hoverable: true,
|
|
80046
|
+
onClick: () => onLoadEntity({ id: entity["@id"] }),
|
|
80047
|
+
children: [
|
|
80048
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge describo-ai-entity-status-badge", children: [
|
|
80049
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
|
|
80050
|
+
"AI delete"
|
|
80051
|
+
] }),
|
|
80052
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkedEntityCardHeader, { entity: displayEntity }),
|
|
80053
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-deleted-entity-controls", children: [
|
|
80054
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-deleted-entity-summary", children: [
|
|
80055
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
80056
|
+
fieldCount,
|
|
80057
|
+
" fields can be restored."
|
|
80058
|
+
] }),
|
|
80059
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showDeletedFields ? "Hide deleted fields" : "Show deleted fields", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80060
|
+
Button$1,
|
|
80061
|
+
{
|
|
80062
|
+
size: "small",
|
|
80063
|
+
className: "describo-ai-entity-delete-details-toggle",
|
|
80064
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
|
|
80065
|
+
"aria-label": showDeletedFields ? "Hide deleted AI fields" : "Show deleted AI fields",
|
|
80066
|
+
"aria-pressed": showDeletedFields,
|
|
80067
|
+
onClick: (event) => {
|
|
80068
|
+
event.stopPropagation();
|
|
80069
|
+
setShowDeletedFields((visible) => !visible);
|
|
80070
|
+
}
|
|
80071
|
+
}
|
|
80072
|
+
) })
|
|
80073
|
+
] }),
|
|
80074
|
+
!readonly && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-actions", children: [
|
|
80075
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Approve this AI deletion", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80076
|
+
Button$1,
|
|
80077
|
+
{
|
|
80078
|
+
size: "small",
|
|
80079
|
+
className: "describo-ai-action-approve",
|
|
80080
|
+
onClick: (event) => {
|
|
80081
|
+
event.stopPropagation();
|
|
80082
|
+
onAcceptDelete == null ? void 0 : onAcceptDelete(entity);
|
|
80083
|
+
},
|
|
80084
|
+
children: "Delete"
|
|
80085
|
+
}
|
|
80086
|
+
) }),
|
|
80087
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore this entity and mark the deletion reviewed", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80088
|
+
Button$1,
|
|
80089
|
+
{
|
|
80090
|
+
size: "small",
|
|
80091
|
+
className: "describo-ai-action-reject",
|
|
80092
|
+
onClick: (event) => {
|
|
80093
|
+
event.stopPropagation();
|
|
80094
|
+
onRestore == null ? void 0 : onRestore(entity);
|
|
80095
|
+
},
|
|
80096
|
+
children: "Restore"
|
|
80097
|
+
}
|
|
80098
|
+
) })
|
|
80099
|
+
] })
|
|
80100
|
+
] })
|
|
80101
|
+
]
|
|
80102
|
+
}
|
|
80103
|
+
);
|
|
80104
|
+
};
|
|
80105
|
+
const LinkedEntityAssociations = ({
|
|
80106
|
+
associations,
|
|
80107
|
+
onLoadEntity
|
|
80108
|
+
}) => {
|
|
80109
|
+
if (!associations.length) return null;
|
|
80110
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "mt-2 flex-col space-y-2 border-l-2 pl-1 border-solid border-slate-700", children: associations.map((association) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80111
|
+
Flex,
|
|
80112
|
+
{
|
|
80113
|
+
onClick: () => onLoadEntity({ id: association["@id"] }),
|
|
80114
|
+
className: "cursor-pointer",
|
|
80115
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "flex-row text-base border-solid border-black", children: [
|
|
80116
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-3 h-3 rounded-lg -4 mt-4" }),
|
|
80117
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-6 h-1 mt-5 -mx-1" }),
|
|
80118
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "bg-purple-200 hover:bg-cyan-200 flex flex-row p-2 rounded space-x-2", children: [
|
|
80119
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.property }),
|
|
80120
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}) }),
|
|
80121
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.name || association["@id"] }) })
|
|
80122
|
+
] })
|
|
80123
|
+
] })
|
|
80124
|
+
},
|
|
80125
|
+
association["@id"]
|
|
80126
|
+
)) });
|
|
80127
|
+
};
|
|
80128
|
+
const AiEntityReviewSummary = ({
|
|
80129
|
+
fieldCount,
|
|
80130
|
+
onReview,
|
|
80131
|
+
onDiff
|
|
80132
|
+
}) => {
|
|
80133
|
+
if (fieldCount <= 0) return null;
|
|
80134
|
+
const fieldLabel = fieldCount === 1 ? "field" : "fields";
|
|
80135
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-review-summary", children: [
|
|
80136
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-entity-review-meta", children: [
|
|
80137
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "describo-ai-entity-review-count", children: [
|
|
80138
|
+
fieldCount,
|
|
80139
|
+
" ",
|
|
80140
|
+
fieldLabel,
|
|
80141
|
+
" to review"
|
|
80142
|
+
] }),
|
|
80143
|
+
onDiff && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Show entity diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80144
|
+
Button$1,
|
|
80145
|
+
{
|
|
80146
|
+
className: "describo-ai-entity-diff-toggle",
|
|
80147
|
+
size: "small",
|
|
80148
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
|
|
80149
|
+
"aria-label": "Show AI entity diff",
|
|
80150
|
+
onClick: (event) => {
|
|
80151
|
+
event.stopPropagation();
|
|
80152
|
+
onDiff();
|
|
80153
|
+
}
|
|
80154
|
+
}
|
|
80155
|
+
) })
|
|
80156
|
+
] }),
|
|
80157
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80158
|
+
Button$1,
|
|
80159
|
+
{
|
|
80160
|
+
className: "describo-ai-entity-review-button",
|
|
80161
|
+
size: "small",
|
|
80162
|
+
onClick: (event) => {
|
|
80163
|
+
event.stopPropagation();
|
|
80164
|
+
onReview();
|
|
80165
|
+
},
|
|
80166
|
+
children: "Review entity"
|
|
80167
|
+
}
|
|
80168
|
+
)
|
|
80169
|
+
] });
|
|
80170
|
+
};
|
|
80171
|
+
const LinkedEntityCard = ({
|
|
80172
|
+
entity,
|
|
80173
|
+
displayEntity,
|
|
80174
|
+
hasPendingAiReview,
|
|
80175
|
+
hasAiTouchedEntity,
|
|
80176
|
+
pendingAiReviewFieldCount,
|
|
80177
|
+
readonly,
|
|
80178
|
+
onLoadEntity,
|
|
80179
|
+
onUnlinkEntity,
|
|
80180
|
+
onShowEntityDiff
|
|
80181
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
80182
|
+
Card,
|
|
80183
|
+
{
|
|
80184
|
+
className: `${hasPendingAiReview ? "describo-ai-entity-review-card" : ""} ${hasAiTouchedEntity ? "describo-ai-entity-reviewed-card" : ""}`,
|
|
80185
|
+
style: {
|
|
80186
|
+
backgroundColor: hasPendingAiReview ? "#e6f8ef" : "#e6f0ff",
|
|
80187
|
+
cursor: "pointer",
|
|
80188
|
+
transition: "background-color 0.2s",
|
|
80189
|
+
borderLeft: hasPendingAiReview ? "3px solid #38c88a" : "3px solid #409eff"
|
|
80190
|
+
},
|
|
80191
|
+
styles: { body: { padding: hasPendingAiReview ? "22px 12px 8px" : "8px 12px" } },
|
|
80192
|
+
hoverable: true,
|
|
80193
|
+
onClick: () => onLoadEntity({ id: entity["@id"] }),
|
|
80194
|
+
children: [
|
|
80195
|
+
hasPendingAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge describo-ai-entity-status-badge", children: [
|
|
80196
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
|
|
80197
|
+
"AI suggestion"
|
|
80198
|
+
] }),
|
|
80199
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", align: "middle", gap: 8, children: [
|
|
80200
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkedEntityCardHeader, { entity: displayEntity }),
|
|
80201
|
+
!readonly && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(UnlinkEntity, { entity, onUnlinkEntity }) })
|
|
80202
|
+
] }),
|
|
80203
|
+
hasAiTouchedEntity && !hasPendingAiReview && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80204
|
+
AiEditedFieldBadge,
|
|
80205
|
+
{
|
|
80206
|
+
className: "describo-ai-entity-edited-badge",
|
|
80207
|
+
title: "Entity was added by AI",
|
|
80208
|
+
ariaLabel: "Entity was added by AI"
|
|
80209
|
+
}
|
|
80210
|
+
),
|
|
80211
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80212
|
+
AiEntityReviewSummary,
|
|
80213
|
+
{
|
|
80214
|
+
fieldCount: hasPendingAiReview ? pendingAiReviewFieldCount : 0,
|
|
80215
|
+
onReview: () => onLoadEntity({ id: entity["@id"] }),
|
|
80216
|
+
onDiff: hasPendingAiReview ? onShowEntityDiff : void 0
|
|
80217
|
+
}
|
|
80218
|
+
)
|
|
80219
|
+
]
|
|
80220
|
+
}
|
|
80221
|
+
);
|
|
80222
|
+
const approvalIsApproved = (approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.approved) === true || (approvalRecord == null ? void 0 : approvalRecord.approved) === "true";
|
|
80223
|
+
const getApprovalEntities = (approvalData) => {
|
|
80224
|
+
if (!approvalData) return [];
|
|
80225
|
+
if (Array.isArray(approvalData)) return approvalData;
|
|
80226
|
+
if (Array.isArray(approvalData.items)) return approvalData.items;
|
|
80227
|
+
if (Array.isArray(approvalData.approval)) return [approvalData];
|
|
80228
|
+
return [];
|
|
80229
|
+
};
|
|
80230
|
+
const hasUrlScheme = (id2) => /^[a-z][a-z0-9+.-]*:\/\//i.test(id2);
|
|
80231
|
+
const stripLocalEntityIdPrefix = (id2) => {
|
|
80232
|
+
if (id2.startsWith("file://./")) return id2.slice("file://./".length);
|
|
80233
|
+
if (id2.startsWith("./")) return id2.slice("./".length);
|
|
80234
|
+
if (id2.startsWith("/")) return id2.slice(1);
|
|
80235
|
+
return id2;
|
|
80236
|
+
};
|
|
80237
|
+
const getEntityIdAliases = (id2) => {
|
|
80238
|
+
if (!id2) return [];
|
|
80239
|
+
const aliases = /* @__PURE__ */ new Set([id2]);
|
|
80240
|
+
const decodedId = decodeURI(id2);
|
|
80241
|
+
aliases.add(decodedId);
|
|
80242
|
+
const isLocalFileUrl = decodedId.startsWith("file://./");
|
|
80243
|
+
const isLocalPath = !hasUrlScheme(decodedId) || isLocalFileUrl;
|
|
80244
|
+
if (decodedId !== "./" && isLocalPath) {
|
|
80245
|
+
const localPath = stripLocalEntityIdPrefix(decodedId);
|
|
80246
|
+
if (localPath) {
|
|
80247
|
+
aliases.add(localPath);
|
|
80248
|
+
aliases.add(`./${localPath}`);
|
|
80249
|
+
aliases.add(`file://./${localPath}`);
|
|
80250
|
+
}
|
|
80251
|
+
}
|
|
80252
|
+
return Array.from(aliases);
|
|
80253
|
+
};
|
|
80254
|
+
const entityIdsMatch = (left, right) => {
|
|
80255
|
+
if (!left || !right) return false;
|
|
80256
|
+
const rightAliases = new Set(getEntityIdAliases(right));
|
|
80257
|
+
return getEntityIdAliases(left).some((alias) => rightAliases.has(alias));
|
|
80258
|
+
};
|
|
80259
|
+
const isPendingEntityDeleteApproval = (entityApproval) => {
|
|
80260
|
+
const approvalRecords = entityApproval == null ? void 0 : entityApproval.approval;
|
|
80261
|
+
if (!Array.isArray(approvalRecords) || approvalRecords.length === 0) return false;
|
|
80262
|
+
return approvalRecords.every((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete") && approvalRecords.some((approvalRecord) => !approvalIsApproved(approvalRecord));
|
|
80263
|
+
};
|
|
80264
|
+
const getDeletedEntityFromApproval = (entityApproval) => {
|
|
80265
|
+
if (!(entityApproval == null ? void 0 : entityApproval["@id"]) || !isPendingEntityDeleteApproval(entityApproval)) return void 0;
|
|
80266
|
+
const deletedEntity = entityApproval.approval.reduce((entity, approvalRecord) => {
|
|
80267
|
+
const propertyName2 = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
80268
|
+
if (!propertyName2 || (approvalRecord == null ? void 0 : approvalRecord.operation) !== "delete") return entity;
|
|
80269
|
+
if (!propertyValueHasContent(approvalRecord.previousValue)) return entity;
|
|
80270
|
+
if (propertyName2 === "@id") {
|
|
80271
|
+
entity["@id"] = approvalRecord.previousValue;
|
|
80272
|
+
} else if (propertyName2 === "@type") {
|
|
80273
|
+
entity["@type"] = [].concat(approvalRecord.previousValue);
|
|
80274
|
+
} else {
|
|
80275
|
+
entity[propertyName2] = approvalRecord.previousValue;
|
|
80276
|
+
}
|
|
80277
|
+
return entity;
|
|
80278
|
+
}, {
|
|
80279
|
+
"@id": entityApproval["@id"],
|
|
80280
|
+
"@type": ["Thing"],
|
|
80281
|
+
name: entityApproval["@id"],
|
|
80282
|
+
__aiDeletedEntity: true
|
|
80283
|
+
});
|
|
80284
|
+
if (!propertyValueHasContent(deletedEntity.name)) {
|
|
80285
|
+
deletedEntity.name = deletedEntity["@id"];
|
|
80286
|
+
}
|
|
80287
|
+
return deletedEntity;
|
|
80288
|
+
};
|
|
80289
|
+
const getPendingDeletedEntitiesForReverseProperty = (approvalData, sourceEntityId, property) => {
|
|
80290
|
+
if (!sourceEntityId || !property) return [];
|
|
80291
|
+
return getApprovalEntities(approvalData).map(getDeletedEntityFromApproval).filter(Boolean).filter((deletedEntity) => {
|
|
80292
|
+
var _a2;
|
|
80293
|
+
const reverseValue = (_a2 = deletedEntity == null ? void 0 : deletedEntity["@reverse"]) == null ? void 0 : _a2[property];
|
|
80294
|
+
if (!reverseValue) return false;
|
|
80295
|
+
return [].concat(reverseValue).some((sourceRef) => entityIdsMatch(sourceRef == null ? void 0 : sourceRef["@id"], sourceEntityId));
|
|
80296
|
+
});
|
|
80297
|
+
};
|
|
80298
|
+
const getDeletedEntityReviewTarget = (entityApproval) => {
|
|
80299
|
+
const deletedEntity = getDeletedEntityFromApproval(entityApproval);
|
|
80300
|
+
const reverse = deletedEntity == null ? void 0 : deletedEntity["@reverse"];
|
|
80301
|
+
if (!reverse || typeof reverse !== "object") return void 0;
|
|
80302
|
+
for (const [property, sourceRefs] of Object.entries(reverse)) {
|
|
80303
|
+
const sourceRef = [].concat(sourceRefs).find((ref) => typeof (ref == null ? void 0 : ref["@id"]) === "string" && ref["@id"].length > 0);
|
|
80304
|
+
if (sourceRef == null ? void 0 : sourceRef["@id"]) {
|
|
80305
|
+
return {
|
|
80306
|
+
entityId: sourceRef["@id"],
|
|
80307
|
+
property
|
|
80308
|
+
};
|
|
80309
|
+
}
|
|
80310
|
+
}
|
|
80311
|
+
return void 0;
|
|
80312
|
+
};
|
|
80313
|
+
const getPendingDeletedEntityReversePropertiesForSource = (approvalData, sourceEntityId) => {
|
|
80314
|
+
if (!sourceEntityId) return [];
|
|
80315
|
+
return Array.from(new Set(
|
|
80316
|
+
getApprovalEntities(approvalData).map(getDeletedEntityFromApproval).filter(Boolean).flatMap((deletedEntity) => Object.entries((deletedEntity == null ? void 0 : deletedEntity["@reverse"]) ?? {}).filter(([, sourceRefs]) => [].concat(sourceRefs).some((sourceRef) => entityIdsMatch(sourceRef == null ? void 0 : sourceRef["@id"], sourceEntityId))).map(([property]) => property))
|
|
80317
|
+
));
|
|
80318
|
+
};
|
|
80319
|
+
const getEntityApproval = (approvalData, entityId) => {
|
|
80320
|
+
if (!entityId) return void 0;
|
|
80321
|
+
return getApprovalEntities(approvalData).find((item) => entityIdsMatch(item == null ? void 0 : item["@id"], entityId));
|
|
80322
|
+
};
|
|
80323
|
+
const getEntityApprovalRecords = (approvalData, entityId, property) => {
|
|
80324
|
+
if (!entityId || !property) return [];
|
|
80325
|
+
const entityApproval = getEntityApproval(approvalData, entityId);
|
|
80326
|
+
if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
|
|
80327
|
+
return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === property);
|
|
80328
|
+
};
|
|
80329
|
+
const getPendingEntityApprovalRecords = (approvalData, entityId) => {
|
|
80330
|
+
const entityApproval = getEntityApproval(approvalData, entityId);
|
|
80331
|
+
if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
|
|
80332
|
+
const approvedPropertyNames = new Set(
|
|
80333
|
+
entityApproval.approval.filter(approvalIsApproved).map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((propertyName2) => typeof propertyName2 === "string" && propertyName2.length > 0)
|
|
80334
|
+
);
|
|
80335
|
+
return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) && !approvalIsApproved(approvalRecord) && !approvedPropertyNames.has(approvalRecord.propertyName));
|
|
80336
|
+
};
|
|
80337
|
+
const getPendingEntityApprovalFieldCount = (approvalData, entityId) => new Set(
|
|
80338
|
+
getPendingEntityApprovalRecords(approvalData, entityId).map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((propertyName2) => typeof propertyName2 === "string" && propertyName2.length > 0)
|
|
80339
|
+
).size;
|
|
80340
|
+
const getPendingApprovalEntities = (approvalData) => getApprovalEntities(approvalData).filter((entityApproval) => getPendingEntityApprovalRecords(approvalData, entityApproval == null ? void 0 : entityApproval["@id"]).length > 0);
|
|
80341
|
+
const getPendingApprovalFieldCount = (approvalData, excludedEntityId) => getPendingApprovalEntities(approvalData).reduce((count, entityApproval) => {
|
|
80342
|
+
const entityId = entityApproval == null ? void 0 : entityApproval["@id"];
|
|
80343
|
+
if (excludedEntityId && entityIdsMatch(entityId, excludedEntityId)) return count;
|
|
80344
|
+
return count + getPendingEntityApprovalFieldCount(approvalData, entityId);
|
|
80345
|
+
}, 0);
|
|
80346
|
+
const getApprovedEntityApprovalRecords = (approvalData, entityId) => {
|
|
80347
|
+
const entityApproval = getEntityApproval(approvalData, entityId);
|
|
80348
|
+
if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
|
|
80349
|
+
return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) && approvalIsApproved(approvalRecord));
|
|
80350
|
+
};
|
|
80351
|
+
const getApprovedEntityApprovalFieldCount = (approvalData, entityId) => new Set(
|
|
80352
|
+
getApprovedEntityApprovalRecords(approvalData, entityId).map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((propertyName2) => typeof propertyName2 === "string" && propertyName2.length > 0)
|
|
80353
|
+
).size;
|
|
80354
|
+
const normaliseComparableValue = (value) => {
|
|
80355
|
+
if (Array.isArray(value)) {
|
|
80356
|
+
return value.map(normaliseComparableValue);
|
|
80357
|
+
}
|
|
80358
|
+
if (lodashExports.isPlainObject(value)) {
|
|
80359
|
+
return Object.keys(value).sort().reduce((acc, key) => {
|
|
80360
|
+
acc[key] = normaliseComparableValue(value[key]);
|
|
80361
|
+
return acc;
|
|
80362
|
+
}, {});
|
|
80363
|
+
}
|
|
80364
|
+
return value;
|
|
80365
|
+
};
|
|
80366
|
+
const valuesAreEqual = (left, right) => JSON.stringify(normaliseComparableValue(left)) === JSON.stringify(normaliseComparableValue(right));
|
|
80367
|
+
const propertyValueHasContent = (value) => {
|
|
80368
|
+
if (Array.isArray(value)) {
|
|
80369
|
+
return value.some(propertyValueHasContent);
|
|
80370
|
+
}
|
|
80371
|
+
return value !== void 0 && value !== null;
|
|
80372
|
+
};
|
|
80373
|
+
const entityHasPropertyValue = (entity, property) => Object.prototype.hasOwnProperty.call(entity ?? {}, property) && propertyValueHasContent(entity == null ? void 0 : entity[property]);
|
|
79787
80374
|
const RenderLinkedItem = ({
|
|
79788
80375
|
entity,
|
|
79789
80376
|
property,
|
|
79790
80377
|
readonly,
|
|
79791
80378
|
onLoadEntity,
|
|
79792
|
-
onUnlinkEntity
|
|
80379
|
+
onUnlinkEntity,
|
|
80380
|
+
onAcceptAiEntityDelete,
|
|
80381
|
+
onRestoreAiDeletedEntity,
|
|
80382
|
+
onAcceptAiEntityEdit,
|
|
80383
|
+
onRejectAiEntityEdit
|
|
79793
80384
|
}) => {
|
|
79794
|
-
var _a2, _b;
|
|
80385
|
+
var _a2, _b, _c, _d;
|
|
79795
80386
|
const state = useStateStore();
|
|
79796
80387
|
const crateManager = useContext(CrateManagerContext);
|
|
79797
80388
|
const profileManager = useContext(ProfileManagerContext);
|
|
80389
|
+
const approvalContext = useContext(RoCrateApprovalContext);
|
|
79798
80390
|
const [associations, setAssociations] = useState([]);
|
|
80391
|
+
const [showAiEntityDiff, setShowAiEntityDiff] = useState(false);
|
|
79799
80392
|
const effectiveEntity = useMemo$1(() => {
|
|
79800
80393
|
const hasTypes = Boolean(entity == null ? void 0 : entity["@type"]);
|
|
79801
80394
|
const hasName = Boolean(entity == null ? void 0 : entity.name);
|
|
@@ -79875,6 +80468,90 @@ const RenderLinkedItem = ({
|
|
|
79875
80468
|
name: (effectiveEntity == null ? void 0 : effectiveEntity.name) || entity["@id"]
|
|
79876
80469
|
};
|
|
79877
80470
|
}, [effectiveEntity, entity]);
|
|
80471
|
+
const pendingAiReviewFieldCount = useMemo$1(() => getPendingEntityApprovalFieldCount(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
|
|
80472
|
+
const isPendingAiEntityDelete = useMemo$1(() => Boolean((entity == null ? void 0 : entity.__aiDeletedEntity) && isPendingEntityDeleteApproval(
|
|
80473
|
+
getEntityApproval(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"])
|
|
80474
|
+
)), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
|
|
80475
|
+
const visiblePendingAiReviewFieldCount = useMemo$1(() => {
|
|
80476
|
+
if (!isPendingAiEntityDelete) return pendingAiReviewFieldCount;
|
|
80477
|
+
return getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@reverse").length;
|
|
80478
|
+
}, [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, isPendingAiEntityDelete, pendingAiReviewFieldCount]);
|
|
80479
|
+
const deletedEntityFieldRows = useMemo$1(() => {
|
|
80480
|
+
if (!isPendingAiEntityDelete) return [];
|
|
80481
|
+
return getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete" && (approvalRecord == null ? void 0 : approvalRecord.propertyName) && approvalRecord.propertyName !== "@reverse");
|
|
80482
|
+
}, [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, isPendingAiEntityDelete]);
|
|
80483
|
+
const getDeletedFieldLabel = (fieldName) => {
|
|
80484
|
+
var _a3, _b2;
|
|
80485
|
+
if (fieldName === "name") return "Name";
|
|
80486
|
+
if (fieldName === "@type") return "@type";
|
|
80487
|
+
return ((_b2 = (_a3 = profileManager == null ? void 0 : profileManager.getPropertyDefinition({
|
|
80488
|
+
property: fieldName,
|
|
80489
|
+
entity: effectiveEntity
|
|
80490
|
+
})) == null ? void 0 : _a3.propertyDefinition) == null ? void 0 : _b2.label) || fieldName;
|
|
80491
|
+
};
|
|
80492
|
+
const deletedEntityFields = useMemo$1(() => deletedEntityFieldRows.map((approvalRecord) => ({
|
|
80493
|
+
label: getDeletedFieldLabel(approvalRecord.propertyName),
|
|
80494
|
+
propertyName: approvalRecord.propertyName,
|
|
80495
|
+
previousValue: approvalRecord.previousValue
|
|
80496
|
+
})), [deletedEntityFieldRows, effectiveEntity, profileManager]);
|
|
80497
|
+
const reviewedAiEditFieldCount = useMemo$1(() => getApprovedEntityApprovalFieldCount(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
|
|
80498
|
+
const hasReviewedAiEdits = reviewedAiEditFieldCount > 0;
|
|
80499
|
+
const hasPendingAiReview = pendingAiReviewFieldCount > 0 && !hasReviewedAiEdits;
|
|
80500
|
+
const hasAiTouchedEntity = hasPendingAiReview || hasReviewedAiEdits;
|
|
80501
|
+
const getEntityDiffLabel = (fieldName) => {
|
|
80502
|
+
var _a3, _b2;
|
|
80503
|
+
if (fieldName === "@id") return "@id";
|
|
80504
|
+
if (fieldName === "@type") return "type";
|
|
80505
|
+
if (fieldName === "name") return "name";
|
|
80506
|
+
return ((_b2 = (_a3 = profileManager == null ? void 0 : profileManager.getPropertyDefinition({
|
|
80507
|
+
property: fieldName,
|
|
80508
|
+
entity: effectiveEntity
|
|
80509
|
+
})) == null ? void 0 : _a3.propertyDefinition) == null ? void 0 : _b2.label) || fieldName;
|
|
80510
|
+
};
|
|
80511
|
+
const pendingAiEntityDiffRecords = useMemo$1(() => getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity["@id"]).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@reverse"), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity]);
|
|
80512
|
+
const aiEntityDiffRows = useMemo$1(() => {
|
|
80513
|
+
const contextRows = [
|
|
80514
|
+
{
|
|
80515
|
+
kind: "context",
|
|
80516
|
+
propertyName: "@id",
|
|
80517
|
+
label: "@id",
|
|
80518
|
+
value: entity["@id"]
|
|
80519
|
+
}
|
|
80520
|
+
];
|
|
80521
|
+
if (effectiveEntity == null ? void 0 : effectiveEntity["@type"]) {
|
|
80522
|
+
contextRows.push({
|
|
80523
|
+
kind: "context",
|
|
80524
|
+
propertyName: "@type",
|
|
80525
|
+
label: "type",
|
|
80526
|
+
value: effectiveEntity["@type"]
|
|
80527
|
+
});
|
|
80528
|
+
}
|
|
80529
|
+
const changedRows = pendingAiEntityDiffRecords.flatMap((approvalRecord) => {
|
|
80530
|
+
const propertyName2 = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
80531
|
+
if (!propertyName2) return [];
|
|
80532
|
+
const label = getEntityDiffLabel(propertyName2);
|
|
80533
|
+
const currentValue = propertyName2 === "@id" ? entity["@id"] : effectiveEntity == null ? void 0 : effectiveEntity[propertyName2];
|
|
80534
|
+
const rows = [];
|
|
80535
|
+
if ((approvalRecord == null ? void 0 : approvalRecord.operation) !== "add") {
|
|
80536
|
+
rows.push({
|
|
80537
|
+
kind: "removed",
|
|
80538
|
+
propertyName: propertyName2,
|
|
80539
|
+
label,
|
|
80540
|
+
value: approvalRecord == null ? void 0 : approvalRecord.previousValue
|
|
80541
|
+
});
|
|
80542
|
+
}
|
|
80543
|
+
if ((approvalRecord == null ? void 0 : approvalRecord.operation) !== "delete") {
|
|
80544
|
+
rows.push({
|
|
80545
|
+
kind: "added",
|
|
80546
|
+
propertyName: propertyName2,
|
|
80547
|
+
label,
|
|
80548
|
+
value: currentValue
|
|
80549
|
+
});
|
|
80550
|
+
}
|
|
80551
|
+
return rows;
|
|
80552
|
+
});
|
|
80553
|
+
return [...contextRows, ...changedRows];
|
|
80554
|
+
}, [effectiveEntity, entity, pendingAiEntityDiffRecords, profileManager]);
|
|
79878
80555
|
if (showMap) {
|
|
79879
80556
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "describo-render-item-link py-1 rounded bg-blue-200 hover:text-black hover:bg-blue-300 hover:rounded-r-none", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { vertical: true, className: "space-y-2", children: [
|
|
79880
80557
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "p-2", children: [
|
|
@@ -79892,47 +80569,49 @@ const RenderLinkedItem = ({
|
|
|
79892
80569
|
className: "h-full min-w-0 flex-1",
|
|
79893
80570
|
style: { margin: (associations == null ? void 0 : associations.length) ? 8 : 0 },
|
|
79894
80571
|
children: [
|
|
79895
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79896
|
-
|
|
80572
|
+
showAiEntityDiff && hasPendingAiReview ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80573
|
+
AiEntityDiffView,
|
|
79897
80574
|
{
|
|
79898
|
-
|
|
79899
|
-
|
|
79900
|
-
|
|
79901
|
-
|
|
79902
|
-
|
|
79903
|
-
|
|
79904
|
-
|
|
79905
|
-
|
|
79906
|
-
|
|
79907
|
-
|
|
79908
|
-
|
|
79909
|
-
|
|
79910
|
-
|
|
79911
|
-
|
|
79912
|
-
|
|
79913
|
-
|
|
79914
|
-
|
|
79915
|
-
|
|
79916
|
-
|
|
80575
|
+
entityId: entity["@id"],
|
|
80576
|
+
rows: aiEntityDiffRows,
|
|
80577
|
+
readonly: Boolean(((_b = state.configuration) == null ? void 0 : _b.readonly) || readonly),
|
|
80578
|
+
onClose: () => setShowAiEntityDiff(false),
|
|
80579
|
+
onAccept: () => onAcceptAiEntityEdit == null ? void 0 : onAcceptAiEntityEdit(effectiveEntity),
|
|
80580
|
+
onReject: () => onRejectAiEntityEdit == null ? void 0 : onRejectAiEntityEdit(effectiveEntity)
|
|
80581
|
+
}
|
|
80582
|
+
) : isPendingAiEntityDelete ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80583
|
+
DeletedLinkedEntityCard,
|
|
80584
|
+
{
|
|
80585
|
+
entity,
|
|
80586
|
+
displayEntity: linkDisplayEntity,
|
|
80587
|
+
fieldCount: visiblePendingAiReviewFieldCount,
|
|
80588
|
+
fields: deletedEntityFields,
|
|
80589
|
+
readonly: Boolean((_c = state.configuration) == null ? void 0 : _c.readonly),
|
|
80590
|
+
onLoadEntity: handleLoadEntity,
|
|
80591
|
+
onAcceptDelete: onAcceptAiEntityDelete,
|
|
80592
|
+
onRestore: onRestoreAiDeletedEntity
|
|
80593
|
+
}
|
|
80594
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80595
|
+
LinkedEntityCard,
|
|
80596
|
+
{
|
|
80597
|
+
entity,
|
|
80598
|
+
displayEntity: linkDisplayEntity,
|
|
80599
|
+
hasPendingAiReview,
|
|
80600
|
+
hasAiTouchedEntity,
|
|
80601
|
+
pendingAiReviewFieldCount,
|
|
80602
|
+
readonly: Boolean(((_d = state.configuration) == null ? void 0 : _d.readonly) || readonly),
|
|
80603
|
+
onLoadEntity: handleLoadEntity,
|
|
80604
|
+
onUnlinkEntity: handleUnlinkEntity,
|
|
80605
|
+
onShowEntityDiff: () => setShowAiEntityDiff(true)
|
|
79917
80606
|
}
|
|
79918
80607
|
),
|
|
79919
|
-
|
|
79920
|
-
|
|
80608
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80609
|
+
LinkedEntityAssociations,
|
|
79921
80610
|
{
|
|
79922
|
-
|
|
79923
|
-
|
|
79924
|
-
|
|
79925
|
-
|
|
79926
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "bg-slate-700 w-6 h-1 mt-5 -mx-1" }),
|
|
79927
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { className: "bg-purple-200 hover:bg-cyan-200 flex flex-row p-2 rounded space-x-2", children: [
|
|
79928
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.property }),
|
|
79929
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}) }),
|
|
79930
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { className: "flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { children: association.name || association["@id"] }) })
|
|
79931
|
-
] })
|
|
79932
|
-
] })
|
|
79933
|
-
},
|
|
79934
|
-
association["@id"]
|
|
79935
|
-
)) })
|
|
80611
|
+
associations,
|
|
80612
|
+
onLoadEntity: handleLoadEntity
|
|
80613
|
+
}
|
|
80614
|
+
)
|
|
79936
80615
|
]
|
|
79937
80616
|
}
|
|
79938
80617
|
) });
|
|
@@ -79944,7 +80623,11 @@ const PaginateLinkedEntities = ({
|
|
|
79944
80623
|
className = "",
|
|
79945
80624
|
onLoadEntity,
|
|
79946
80625
|
onUnlinkEntity,
|
|
79947
|
-
onPageChange
|
|
80626
|
+
onPageChange,
|
|
80627
|
+
onAcceptAiEntityDelete,
|
|
80628
|
+
onRestoreAiDeletedEntity,
|
|
80629
|
+
onAcceptAiEntityEdit,
|
|
80630
|
+
onRejectAiEntityEdit
|
|
79948
80631
|
}) => {
|
|
79949
80632
|
var _a2, _b;
|
|
79950
80633
|
const { t: t2 } = useTranslation();
|
|
@@ -80026,14 +80709,18 @@ const PaginateLinkedEntities = ({
|
|
|
80026
80709
|
),
|
|
80027
80710
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "primary", onClick: filterAndChunkEntitiesForDisplay, children: t2("search") || "Search" })
|
|
80028
80711
|
] }) }) }),
|
|
80029
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row flex-wrap pt-2", style: { gap: 8 }, children: displayEntities.map((entity) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-72 flex-[1_1_360px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80712
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row flex-wrap items-start pt-2", style: { gap: 8 }, children: displayEntities.map((entity) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-72 flex-[1_1_360px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80030
80713
|
RenderLinkedItem,
|
|
80031
80714
|
{
|
|
80032
80715
|
entity: entity.value,
|
|
80033
80716
|
property,
|
|
80034
80717
|
readonly,
|
|
80035
80718
|
onLoadEntity,
|
|
80036
|
-
onUnlinkEntity
|
|
80719
|
+
onUnlinkEntity,
|
|
80720
|
+
onAcceptAiEntityDelete,
|
|
80721
|
+
onRestoreAiDeletedEntity,
|
|
80722
|
+
onAcceptAiEntityEdit,
|
|
80723
|
+
onRejectAiEntityEdit
|
|
80037
80724
|
}
|
|
80038
80725
|
) }, entity.value["@id"])) }),
|
|
80039
80726
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row justify-center pt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -80067,7 +80754,7 @@ const DeleteProperty = ({
|
|
|
80067
80754
|
variant: "solid",
|
|
80068
80755
|
color: "red",
|
|
80069
80756
|
className: "describo-delete-property",
|
|
80070
|
-
icon: type4 === "delete" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
80757
|
+
icon: type4 === "delete" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, {})
|
|
80071
80758
|
}
|
|
80072
80759
|
);
|
|
80073
80760
|
};
|
|
@@ -80112,7 +80799,7 @@ const AddControl = ({
|
|
|
80112
80799
|
type: "primary",
|
|
80113
80800
|
size: "middle",
|
|
80114
80801
|
className: "focus:outline-none focus:border-2 focus:border-green-600",
|
|
80115
|
-
icon: !selectedType || selectedType !== type4 ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
80802
|
+
icon: !selectedType || selectedType !== type4 ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, {}),
|
|
80116
80803
|
children: [
|
|
80117
80804
|
" ",
|
|
80118
80805
|
getTypeLabelFromProfile(type4)
|
|
@@ -80126,7 +80813,7 @@ const AddControl = ({
|
|
|
80126
80813
|
type: "primary",
|
|
80127
80814
|
size: "middle",
|
|
80128
80815
|
className: "focus:outline-none focus:border-2 focus:border-green-600",
|
|
80129
|
-
icon: !selectedType || selectedType !== "bulkAdd" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$1, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
80816
|
+
icon: !selectedType || selectedType !== "bulkAdd" ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$1, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$A, {}),
|
|
80130
80817
|
children: " Bulk Add"
|
|
80131
80818
|
}
|
|
80132
80819
|
) })
|
|
@@ -81274,7 +81961,7 @@ const AutoComplete = ({ type: type4, onLinkEntity, onCreateEntity }) => {
|
|
|
81274
81961
|
variant: "solid",
|
|
81275
81962
|
color: "green",
|
|
81276
81963
|
block: true,
|
|
81277
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
81964
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
|
|
81278
81965
|
children: [
|
|
81279
81966
|
t2("create_new_of_type", { type: entity["@type"] }),
|
|
81280
81967
|
": ",
|
|
@@ -81411,7 +82098,7 @@ const BulkAdd = ({ types: types2, primitives, onCreateEntity }) => {
|
|
|
81411
82098
|
variant: "solid",
|
|
81412
82099
|
color: "red",
|
|
81413
82100
|
onClick: () => deleteRow(idx),
|
|
81414
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
82101
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, {})
|
|
81415
82102
|
}
|
|
81416
82103
|
)
|
|
81417
82104
|
] }) }, idx)),
|
|
@@ -81421,7 +82108,7 @@ const BulkAdd = ({ types: types2, primitives, onCreateEntity }) => {
|
|
|
81421
82108
|
{
|
|
81422
82109
|
type: "primary",
|
|
81423
82110
|
onClick: addRow,
|
|
81424
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
82111
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
|
|
81425
82112
|
children: "Add row"
|
|
81426
82113
|
}
|
|
81427
82114
|
),
|
|
@@ -81658,10 +82345,15 @@ const Add = ({
|
|
|
81658
82345
|
const DisplayPropertyName = ({
|
|
81659
82346
|
property,
|
|
81660
82347
|
label,
|
|
81661
|
-
className = ""
|
|
82348
|
+
className = "",
|
|
81662
82349
|
// Default to empty string
|
|
82350
|
+
aiEdited = false,
|
|
82351
|
+
aiEditedVariant = "edited"
|
|
81663
82352
|
}) => {
|
|
81664
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
82353
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `describo-property-name describo-property-name-with-ai ${className}`, children: [
|
|
82354
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: label || property }),
|
|
82355
|
+
aiEdited && /* @__PURE__ */ jsxRuntimeExports.jsx(AiEditedFieldBadge, { variant: aiEditedVariant })
|
|
82356
|
+
] });
|
|
81665
82357
|
};
|
|
81666
82358
|
const EntityProperty = ({
|
|
81667
82359
|
entity,
|
|
@@ -81670,20 +82362,28 @@ const EntityProperty = ({
|
|
|
81670
82362
|
highlightRequired = false,
|
|
81671
82363
|
savedProperty = false,
|
|
81672
82364
|
showHelp = true,
|
|
82365
|
+
aiEdited = false,
|
|
82366
|
+
aiEditedVariant = "edited",
|
|
81673
82367
|
onLoadEntity,
|
|
81674
82368
|
onCreateProperty,
|
|
81675
82369
|
onCreateEntity,
|
|
81676
82370
|
onLinkEntity,
|
|
81677
82371
|
onSaveProperty,
|
|
81678
82372
|
onDeleteProperty,
|
|
81679
|
-
onUnlinkEntity
|
|
82373
|
+
onUnlinkEntity,
|
|
82374
|
+
onAcceptAiEntityDelete,
|
|
82375
|
+
onRestoreAiDeletedEntity,
|
|
82376
|
+
onAcceptAiEntityEdit,
|
|
82377
|
+
onRejectAiEntityEdit
|
|
81680
82378
|
}) => {
|
|
81681
82379
|
var _a2, _b;
|
|
81682
82380
|
const { t: t2 } = useTranslation();
|
|
81683
82381
|
const profileManager = useContext(ProfileManagerContext);
|
|
81684
82382
|
const crateManager = useContext(CrateManagerContext);
|
|
82383
|
+
const approvalContext = useContext(RoCrateApprovalContext);
|
|
81685
82384
|
const state = useStateStore();
|
|
81686
82385
|
const propertyRef = useRef(null);
|
|
82386
|
+
const [showAiDiff, setShowAiDiff] = useState(false);
|
|
81687
82387
|
const propertyDefinition = (_a2 = profileManager == null ? void 0 : profileManager.getPropertyDefinition({
|
|
81688
82388
|
property,
|
|
81689
82389
|
entity
|
|
@@ -81692,7 +82392,6 @@ const EntityProperty = ({
|
|
|
81692
82392
|
const isRequired = propertyDefinition == null ? void 0 : propertyDefinition.required;
|
|
81693
82393
|
const isNotValue = (propertyDefinition == null ? void 0 : propertyDefinition.type) !== "Value";
|
|
81694
82394
|
const profileWarnMissingProperty = profileManager == null ? void 0 : profileManager.profile.warnMissingProperty;
|
|
81695
|
-
const showAddControl = !(propertyDefinition == null ? void 0 : propertyDefinition.readonly) && ((propertyDefinition == null ? void 0 : propertyDefinition.multiple) || !(values == null ? void 0 : values.length));
|
|
81696
82395
|
const simpleInstances = useMemo$1(() => {
|
|
81697
82396
|
const simpleInsts = (propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) === true ? values.length === 0 ? values : [values] : values;
|
|
81698
82397
|
return simpleInsts.map((v2, i) => {
|
|
@@ -81711,6 +82410,29 @@ const EntityProperty = ({
|
|
|
81711
82410
|
["value.@id"]
|
|
81712
82411
|
);
|
|
81713
82412
|
}, [values]);
|
|
82413
|
+
const renderedLinkInstances = useMemo$1(() => {
|
|
82414
|
+
const deletedEntities = getPendingDeletedEntitiesForReverseProperty(
|
|
82415
|
+
approvalContext == null ? void 0 : approvalContext.roCrateApproval,
|
|
82416
|
+
entity == null ? void 0 : entity["@id"],
|
|
82417
|
+
property
|
|
82418
|
+
);
|
|
82419
|
+
if (!deletedEntities.length) return linkInstances;
|
|
82420
|
+
const linkedEntityIds = linkInstances.map((instance2) => {
|
|
82421
|
+
var _a3;
|
|
82422
|
+
return (_a3 = instance2.value) == null ? void 0 : _a3["@id"];
|
|
82423
|
+
}).filter((id2) => typeof id2 === "string" && id2.length > 0);
|
|
82424
|
+
const deletedLinkInstances = deletedEntities.filter((deletedEntity) => !linkedEntityIds.some((linkedEntityId) => entityIdsMatch(linkedEntityId, deletedEntity == null ? void 0 : deletedEntity["@id"]))).map((deletedEntity, idx) => ({
|
|
82425
|
+
idx: -1 - idx,
|
|
82426
|
+
value: deletedEntity
|
|
82427
|
+
}));
|
|
82428
|
+
return lodashExports.orderBy(
|
|
82429
|
+
[...linkInstances, ...deletedLinkInstances],
|
|
82430
|
+
[(instance2) => {
|
|
82431
|
+
var _a3;
|
|
82432
|
+
return ((_a3 = instance2.value) == null ? void 0 : _a3.__aiDeletedEntity) ? 0 : 1;
|
|
82433
|
+
}, "value.@id"]
|
|
82434
|
+
);
|
|
82435
|
+
}, [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, linkInstances, property]);
|
|
81714
82436
|
const scrollToPropertyTop = useCallback(() => {
|
|
81715
82437
|
var _a3;
|
|
81716
82438
|
(_a3 = propertyRef.current) == null ? void 0 : _a3.scrollIntoView({
|
|
@@ -81718,12 +82440,96 @@ const EntityProperty = ({
|
|
|
81718
82440
|
behavior: "auto"
|
|
81719
82441
|
});
|
|
81720
82442
|
}, []);
|
|
82443
|
+
const approvalRecords = useMemo$1(() => getEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity == null ? void 0 : entity["@id"], property), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, entity, property]);
|
|
82444
|
+
const unapprovedApprovalRecord = approvalRecords.find((approvalRecord) => !approvalIsApproved(approvalRecord));
|
|
82445
|
+
const isAiDelete = (unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.operation) === "delete";
|
|
82446
|
+
const hasDeletedPreviousValue = isAiDelete && (unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue) !== void 0;
|
|
82447
|
+
const hasCurrentPropertyValue = entityHasPropertyValue(entity, property);
|
|
82448
|
+
const renderedSimpleInstances = useMemo$1(() => {
|
|
82449
|
+
if (isAiDelete && !hasCurrentPropertyValue && hasDeletedPreviousValue) {
|
|
82450
|
+
if (Array.isArray(unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue) && (propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) !== true) {
|
|
82451
|
+
return unapprovedApprovalRecord.previousValue.map((value, idx) => ({ idx, value }));
|
|
82452
|
+
}
|
|
82453
|
+
return [{ idx: 0, value: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue }];
|
|
82454
|
+
}
|
|
82455
|
+
if (simpleInstances.length > 0) return simpleInstances;
|
|
82456
|
+
if (!hasDeletedPreviousValue) return simpleInstances;
|
|
82457
|
+
if (Array.isArray(unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue) && (propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues) !== true) {
|
|
82458
|
+
return unapprovedApprovalRecord.previousValue.map((value, idx) => ({ idx, value }));
|
|
82459
|
+
}
|
|
82460
|
+
return [{ idx: 0, value: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue }];
|
|
82461
|
+
}, [
|
|
82462
|
+
hasDeletedPreviousValue,
|
|
82463
|
+
hasCurrentPropertyValue,
|
|
82464
|
+
isAiDelete,
|
|
82465
|
+
propertyDefinition == null ? void 0 : propertyDefinition.handlesMultipleValues,
|
|
82466
|
+
simpleInstances,
|
|
82467
|
+
unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue
|
|
82468
|
+
]);
|
|
82469
|
+
const showAiReview = Boolean(unapprovedApprovalRecord && renderedSimpleInstances.length > 0);
|
|
82470
|
+
const previousValueDiffers = showAiReview && !valuesAreEqual(unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue, entity == null ? void 0 : entity[property]);
|
|
82471
|
+
const showAiDiffToggle = Boolean(showAiReview && previousValueDiffers);
|
|
82472
|
+
const showAddControl = !showAiReview && !(propertyDefinition == null ? void 0 : propertyDefinition.readonly) && ((propertyDefinition == null ? void 0 : propertyDefinition.multiple) || !(values == null ? void 0 : values.length));
|
|
82473
|
+
const markAiSuggestionApproved = useCallback(() => {
|
|
82474
|
+
var _a3;
|
|
82475
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
82476
|
+
entityId: entity == null ? void 0 : entity["@id"],
|
|
82477
|
+
propertyName: property,
|
|
82478
|
+
decision: "accept",
|
|
82479
|
+
value: entity == null ? void 0 : entity[property]
|
|
82480
|
+
});
|
|
82481
|
+
}, [approvalContext, entity, property]);
|
|
82482
|
+
const handleSaveProperty = useCallback((data) => {
|
|
82483
|
+
var _a3;
|
|
82484
|
+
if (approvalRecords.length > 0) {
|
|
82485
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
82486
|
+
entityId: entity == null ? void 0 : entity["@id"],
|
|
82487
|
+
propertyName: property,
|
|
82488
|
+
decision: "manual-edit",
|
|
82489
|
+
value: data == null ? void 0 : data.value
|
|
82490
|
+
});
|
|
82491
|
+
}
|
|
82492
|
+
if (isAiDelete && !hasCurrentPropertyValue) {
|
|
82493
|
+
onCreateProperty(data);
|
|
82494
|
+
return;
|
|
82495
|
+
}
|
|
82496
|
+
onSaveProperty(data);
|
|
82497
|
+
}, [approvalContext, approvalRecords.length, entity, hasCurrentPropertyValue, isAiDelete, onCreateProperty, onSaveProperty, property]);
|
|
82498
|
+
const handleApproveAiSuggestion = useCallback(() => {
|
|
82499
|
+
markAiSuggestionApproved();
|
|
82500
|
+
}, [markAiSuggestionApproved]);
|
|
82501
|
+
const handleRejectAiSuggestion = useCallback((idx) => {
|
|
82502
|
+
var _a3;
|
|
82503
|
+
if (!unapprovedApprovalRecord || !previousValueDiffers) return;
|
|
82504
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
82505
|
+
entityId: entity == null ? void 0 : entity["@id"],
|
|
82506
|
+
propertyName: property,
|
|
82507
|
+
decision: "reject",
|
|
82508
|
+
value: unapprovedApprovalRecord.previousValue
|
|
82509
|
+
});
|
|
82510
|
+
if (isAiDelete && !hasCurrentPropertyValue) {
|
|
82511
|
+
onCreateProperty({
|
|
82512
|
+
property,
|
|
82513
|
+
value: unapprovedApprovalRecord.previousValue
|
|
82514
|
+
});
|
|
82515
|
+
return;
|
|
82516
|
+
}
|
|
82517
|
+
onSaveProperty({
|
|
82518
|
+
property,
|
|
82519
|
+
value: unapprovedApprovalRecord.previousValue,
|
|
82520
|
+
idx
|
|
82521
|
+
});
|
|
82522
|
+
}, [approvalContext, entity, hasCurrentPropertyValue, isAiDelete, onCreateProperty, onSaveProperty, previousValueDiffers, property, unapprovedApprovalRecord]);
|
|
81721
82523
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
81722
82524
|
"div",
|
|
81723
82525
|
{
|
|
81724
82526
|
ref: propertyRef,
|
|
81725
|
-
className: `flex flex-row flex-grow ${showHelp ? "p-2" : "px-2 py-1 describo-property-compact"} describo-property-background ${highlightRequired && isRequired && !isValid ? "bg-red-200" : ""} ${savedProperty ? "bg-green-100 transition-colors duration-1000" : ""} describo-property describo-property-name-${property}`,
|
|
82527
|
+
className: `flex flex-row flex-grow ${showHelp ? "p-2" : "px-2 py-1 describo-property-compact"} describo-property-background ${highlightRequired && isRequired && !isValid ? "bg-red-200" : ""} ${savedProperty ? "bg-green-100 transition-colors duration-1000" : ""} ${showAiReview ? `describo-ai-review ${isAiDelete ? "describo-ai-delete" : "describo-ai-suggestion"}` : ""} describo-property describo-property-name-${property}`,
|
|
81726
82528
|
children: [
|
|
82529
|
+
showAiReview && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-suggestion-badge", children: [
|
|
82530
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-suggestion-badge-icon", children: "✦" }),
|
|
82531
|
+
isAiDelete ? "AI delete" : "AI suggestion"
|
|
82532
|
+
] }),
|
|
81727
82533
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-32 w-1/3 xl:w-1/5 flex flex-col describo-property-heading", children: [
|
|
81728
82534
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row items-center", children: [
|
|
81729
82535
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -81731,7 +82537,9 @@ const EntityProperty = ({
|
|
|
81731
82537
|
{
|
|
81732
82538
|
property,
|
|
81733
82539
|
label: propertyDefinition == null ? void 0 : propertyDefinition.label,
|
|
81734
|
-
className: `inline-block ${isRequired && !isValid ? "text-red-600" : ""}
|
|
82540
|
+
className: `inline-block ${isRequired && !isValid ? "text-red-600" : ""}`,
|
|
82541
|
+
aiEdited,
|
|
82542
|
+
aiEditedVariant
|
|
81735
82543
|
}
|
|
81736
82544
|
),
|
|
81737
82545
|
isRequired && !isValid && /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { status: "error", dot: true, className: "animate-pulse ml-2" })
|
|
@@ -81744,10 +82552,17 @@ const EntityProperty = ({
|
|
|
81744
82552
|
] })
|
|
81745
82553
|
] }),
|
|
81746
82554
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-2/3 xl:w-4/5 flex flex-col flex-grow describo-property-value", children: [
|
|
81747
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col space-y-1", children:
|
|
81748
|
-
var _a3, _b2;
|
|
81749
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: (propertyDefinition == null ? void 0 : propertyDefinition.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-property-value-readonly", children: instance2.value }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className:
|
|
81750
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82555
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col space-y-1", children: renderedSimpleInstances.map((instance2) => {
|
|
82556
|
+
var _a3, _b2, _c, _d;
|
|
82557
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: (propertyDefinition == null ? void 0 : propertyDefinition.readonly) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: showAiReview ? "describo-property-value-readonly describo-ai-field-control" : "describo-property-value-readonly", children: instance2.value }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex flex-row gap-2 ${showAiReview ? "describo-ai-field-row" : ""}`, children: [
|
|
82558
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-grow min-w-0 ${showAiReview ? "describo-ai-field-control" : ""}`, children: showAiDiff && showAiDiffToggle ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82559
|
+
AiFieldDiffView,
|
|
82560
|
+
{
|
|
82561
|
+
previousValue: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.previousValue,
|
|
82562
|
+
currentValue: instance2.value,
|
|
82563
|
+
operation: unapprovedApprovalRecord == null ? void 0 : unapprovedApprovalRecord.operation
|
|
82564
|
+
}
|
|
82565
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81751
82566
|
EntityPropertyInstance,
|
|
81752
82567
|
{
|
|
81753
82568
|
className: "flex-grow",
|
|
@@ -81755,11 +82570,42 @@ const EntityProperty = ({
|
|
|
81755
82570
|
value: instance2.value,
|
|
81756
82571
|
idx: instance2.idx,
|
|
81757
82572
|
definition: propertyDefinition,
|
|
81758
|
-
onSaveProperty,
|
|
82573
|
+
onSaveProperty: handleSaveProperty,
|
|
81759
82574
|
onCreateEntity
|
|
81760
82575
|
}
|
|
81761
|
-
),
|
|
81762
|
-
|
|
82576
|
+
) }),
|
|
82577
|
+
showAiReview && instance2.idx === ((_a3 = renderedSimpleInstances[0]) == null ? void 0 : _a3.idx) && !((_b2 = state.configuration) == null ? void 0 : _b2.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-actions", children: [
|
|
82578
|
+
showAiDiffToggle && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiDiff ? "Hide diff" : "Show diff", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82579
|
+
Button$1,
|
|
82580
|
+
{
|
|
82581
|
+
size: "middle",
|
|
82582
|
+
className: "describo-ai-action-diff",
|
|
82583
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
|
|
82584
|
+
"aria-label": showAiDiff ? "Hide AI diff" : "Show AI diff",
|
|
82585
|
+
"aria-pressed": showAiDiff,
|
|
82586
|
+
onClick: () => setShowAiDiff((visible) => !visible)
|
|
82587
|
+
}
|
|
82588
|
+
) }),
|
|
82589
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: isAiDelete ? "Approve this AI deletion" : "Approve this AI-suggested value", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82590
|
+
Button$1,
|
|
82591
|
+
{
|
|
82592
|
+
size: "middle",
|
|
82593
|
+
className: "describo-ai-action-approve",
|
|
82594
|
+
onClick: handleApproveAiSuggestion,
|
|
82595
|
+
children: isAiDelete ? "Delete" : "Accept"
|
|
82596
|
+
}
|
|
82597
|
+
) }),
|
|
82598
|
+
previousValueDiffers && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore the previous value and mark this suggestion reviewed", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82599
|
+
Button$1,
|
|
82600
|
+
{
|
|
82601
|
+
size: "middle",
|
|
82602
|
+
className: "describo-ai-action-reject",
|
|
82603
|
+
onClick: () => handleRejectAiSuggestion(instance2.idx),
|
|
82604
|
+
children: isAiDelete ? "Restore" : "Reject"
|
|
82605
|
+
}
|
|
82606
|
+
) })
|
|
82607
|
+
] }),
|
|
82608
|
+
isNotValue && !showAiReview && !((_c = state.configuration) == null ? void 0 : _c.readonly) && (instance2.value || instance2.value === false) && !((_d = instance2.value) == null ? void 0 : _d["@id"]) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81763
82609
|
DeleteProperty,
|
|
81764
82610
|
{
|
|
81765
82611
|
type: "delete",
|
|
@@ -81769,16 +82615,20 @@ const EntityProperty = ({
|
|
|
81769
82615
|
)
|
|
81770
82616
|
] }) }, instance2.idx);
|
|
81771
82617
|
}) }),
|
|
81772
|
-
|
|
82618
|
+
renderedLinkInstances.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81773
82619
|
PaginateLinkedEntities,
|
|
81774
82620
|
{
|
|
81775
|
-
className:
|
|
81776
|
-
entities:
|
|
82621
|
+
className: renderedSimpleInstances.length && renderedLinkInstances.length ? "mt-2" : "",
|
|
82622
|
+
entities: renderedLinkInstances,
|
|
81777
82623
|
property,
|
|
81778
82624
|
readonly: propertyDefinition == null ? void 0 : propertyDefinition.readonly,
|
|
81779
82625
|
onLoadEntity,
|
|
81780
82626
|
onUnlinkEntity,
|
|
81781
|
-
onPageChange: scrollToPropertyTop
|
|
82627
|
+
onPageChange: scrollToPropertyTop,
|
|
82628
|
+
onAcceptAiEntityDelete,
|
|
82629
|
+
onRestoreAiDeletedEntity,
|
|
82630
|
+
onAcceptAiEntityEdit,
|
|
82631
|
+
onRejectAiEntityEdit
|
|
81782
82632
|
}
|
|
81783
82633
|
),
|
|
81784
82634
|
showAddControl && !((_b = state.configuration) == null ? void 0 : _b.readonly) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -81880,9 +82730,9 @@ const DialogAddProperty = ({
|
|
|
81880
82730
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { vertical: true, children: [
|
|
81881
82731
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 6, className: "describo-add-property-row-header", children: [
|
|
81882
82732
|
item.label ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { className: "describo-add-property-row-name", children: item.label }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { className: "describo-add-property-row-name", children: item.name }),
|
|
81883
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
82733
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}),
|
|
81884
82734
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { className: "describo-add-property-row-type", children: renderPropertyType(item.type) }),
|
|
81885
|
-
isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
82735
|
+
isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$v, { className: "describo-add-property-row-check" })
|
|
81886
82736
|
] }),
|
|
81887
82737
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", className: "describo-add-property-row-help", children: item.help })
|
|
81888
82738
|
] })
|
|
@@ -107098,6 +107948,26 @@ const DialogPreviewCrate = ({ onClose, open }) => {
|
|
|
107098
107948
|
}
|
|
107099
107949
|
);
|
|
107100
107950
|
};
|
|
107951
|
+
const ItemLink = ({ entity, onLoadEntity, className }) => {
|
|
107952
|
+
const handleLoadEntity = () => {
|
|
107953
|
+
onLoadEntity({ id: entity["@id"] });
|
|
107954
|
+
};
|
|
107955
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex min-w-0 w-full flex-col ${className || ""}`, onClick: handleLoadEntity, children: [
|
|
107956
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
107957
|
+
Typography.Text,
|
|
107958
|
+
{
|
|
107959
|
+
type: "secondary",
|
|
107960
|
+
style: { fontSize: "0.75rem" },
|
|
107961
|
+
className: "pb-1 mb-1 border-b border-black/20",
|
|
107962
|
+
children: decodeURIComponent(entity["@id"])
|
|
107963
|
+
}
|
|
107964
|
+
),
|
|
107965
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row space-x-2 items-center", children: [
|
|
107966
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-base flex flex-row space-x-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderTypes, { types: entity["@type"] }) }),
|
|
107967
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { strong: true, children: entity.name })
|
|
107968
|
+
] })
|
|
107969
|
+
] });
|
|
107970
|
+
};
|
|
107101
107971
|
const DialogBrowseEntities = ({
|
|
107102
107972
|
onClose,
|
|
107103
107973
|
open,
|
|
@@ -107105,6 +107975,7 @@ const DialogBrowseEntities = ({
|
|
|
107105
107975
|
}) => {
|
|
107106
107976
|
const { t: t2 } = useTranslation();
|
|
107107
107977
|
const crateManager = useContext(CrateManagerContext);
|
|
107978
|
+
const approvalContext = useContext(RoCrateApprovalContext);
|
|
107108
107979
|
const [data, setData] = useState({
|
|
107109
107980
|
filterInputModel: "",
|
|
107110
107981
|
pageSize: 10,
|
|
@@ -107205,30 +108076,61 @@ const DialogBrowseEntities = ({
|
|
|
107205
108076
|
)
|
|
107206
108077
|
] })
|
|
107207
108078
|
] }),
|
|
107208
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow", children: entities.map((entity) =>
|
|
107209
|
-
|
|
107210
|
-
|
|
107211
|
-
|
|
107212
|
-
|
|
107213
|
-
|
|
107214
|
-
|
|
107215
|
-
|
|
107216
|
-
|
|
107217
|
-
|
|
107218
|
-
|
|
107219
|
-
|
|
107220
|
-
|
|
107221
|
-
|
|
107222
|
-
|
|
108079
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow", children: entities.map((entity) => (() => {
|
|
108080
|
+
const pendingFieldCount = getPendingEntityApprovalFieldCount(
|
|
108081
|
+
approvalContext == null ? void 0 : approvalContext.roCrateApproval,
|
|
108082
|
+
entity["@id"]
|
|
108083
|
+
);
|
|
108084
|
+
const approvedFieldCount = getApprovedEntityApprovalFieldCount(
|
|
108085
|
+
approvalContext == null ? void 0 : approvalContext.roCrateApproval,
|
|
108086
|
+
entity["@id"]
|
|
108087
|
+
);
|
|
108088
|
+
const hasReviewedAiEdits = approvedFieldCount > 0;
|
|
108089
|
+
const hasPendingAiReview = pendingFieldCount > 0 && !hasReviewedAiEdits;
|
|
108090
|
+
const hasAiTouchedEntity = hasPendingAiReview || hasReviewedAiEdits;
|
|
108091
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
108092
|
+
Card,
|
|
108093
|
+
{
|
|
108094
|
+
className: `${hasPendingAiReview ? "describo-ai-entity-review-card" : ""} ${hasAiTouchedEntity ? "describo-ai-entity-reviewed-card" : ""}`,
|
|
108095
|
+
style: {
|
|
108096
|
+
backgroundColor: hasPendingAiReview ? "#e6f8ef" : "#e6f0ff",
|
|
108097
|
+
cursor: "pointer",
|
|
108098
|
+
transition: "background-color 0.2s",
|
|
108099
|
+
borderLeft: hasPendingAiReview ? "3px solid #38c88a" : "3px solid #409eff"
|
|
108100
|
+
},
|
|
108101
|
+
hoverable: true,
|
|
108102
|
+
children: [
|
|
108103
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108104
|
+
Card.Meta,
|
|
108105
|
+
{
|
|
108106
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108107
|
+
ItemLink,
|
|
108108
|
+
{
|
|
108109
|
+
entity,
|
|
108110
|
+
onLoadEntity: () => handleLoadEntity(entity)
|
|
108111
|
+
}
|
|
108112
|
+
)
|
|
108113
|
+
}
|
|
108114
|
+
),
|
|
108115
|
+
hasAiTouchedEntity && !hasPendingAiReview && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108116
|
+
AiEditedFieldBadge,
|
|
108117
|
+
{
|
|
108118
|
+
className: "describo-ai-entity-edited-badge",
|
|
108119
|
+
title: "Entity was added by AI",
|
|
108120
|
+
ariaLabel: "Entity was added by AI"
|
|
108121
|
+
}
|
|
108122
|
+
),
|
|
108123
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
108124
|
+
AiEntityReviewSummary,
|
|
107223
108125
|
{
|
|
107224
|
-
|
|
107225
|
-
|
|
108126
|
+
fieldCount: hasPendingAiReview ? pendingFieldCount : 0,
|
|
108127
|
+
onReview: () => handleLoadEntity(entity)
|
|
107226
108128
|
}
|
|
107227
108129
|
)
|
|
107228
|
-
|
|
107229
|
-
|
|
107230
|
-
}
|
|
107231
|
-
|
|
108130
|
+
]
|
|
108131
|
+
}
|
|
108132
|
+
) }, entity["@id"]);
|
|
108133
|
+
})()) })
|
|
107232
108134
|
] }) })
|
|
107233
108135
|
}
|
|
107234
108136
|
);
|
|
@@ -107381,7 +108283,7 @@ const RenderControls = ({
|
|
|
107381
108283
|
{
|
|
107382
108284
|
onClick: handleBack,
|
|
107383
108285
|
type: "primary",
|
|
107384
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108286
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$b, {}),
|
|
107385
108287
|
disabled: !canGoBack
|
|
107386
108288
|
}
|
|
107387
108289
|
),
|
|
@@ -107399,7 +108301,7 @@ const RenderControls = ({
|
|
|
107399
108301
|
{
|
|
107400
108302
|
onClick: handleForward,
|
|
107401
108303
|
type: "primary",
|
|
107402
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108304
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$a, {}),
|
|
107403
108305
|
disabled: !canGoForward
|
|
107404
108306
|
}
|
|
107405
108307
|
)
|
|
@@ -107409,7 +108311,7 @@ const RenderControls = ({
|
|
|
107409
108311
|
{
|
|
107410
108312
|
onClick: () => toggle("addProperty"),
|
|
107411
108313
|
type: "primary",
|
|
107412
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108314
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
|
|
107413
108315
|
children: t2("add_label")
|
|
107414
108316
|
}
|
|
107415
108317
|
),
|
|
@@ -107418,7 +108320,7 @@ const RenderControls = ({
|
|
|
107418
108320
|
{
|
|
107419
108321
|
onClick: () => toggle("editContext"),
|
|
107420
108322
|
type: "primary",
|
|
107421
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108323
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$f, {}),
|
|
107422
108324
|
children: t2("edit_context_label")
|
|
107423
108325
|
}
|
|
107424
108326
|
),
|
|
@@ -107427,7 +108329,7 @@ const RenderControls = ({
|
|
|
107427
108329
|
{
|
|
107428
108330
|
onClick: () => toggle("previewCrate"),
|
|
107429
108331
|
type: "primary",
|
|
107430
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108332
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$k, {}),
|
|
107431
108333
|
children: t2("preview_label")
|
|
107432
108334
|
}
|
|
107433
108335
|
),
|
|
@@ -107436,7 +108338,7 @@ const RenderControls = ({
|
|
|
107436
108338
|
{
|
|
107437
108339
|
onClick: () => toggle("browseEntities"),
|
|
107438
108340
|
type: "primary",
|
|
107439
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108341
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$9, {}),
|
|
107440
108342
|
children: t2("browse_entities_label")
|
|
107441
108343
|
}
|
|
107442
108344
|
),
|
|
@@ -107471,7 +108373,7 @@ const RenderControls = ({
|
|
|
107471
108373
|
color: "red",
|
|
107472
108374
|
variant: "solid",
|
|
107473
108375
|
danger: true,
|
|
107474
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
108376
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, {}),
|
|
107475
108377
|
children: entity.etype !== "File" && t2("delete_entity_label")
|
|
107476
108378
|
}
|
|
107477
108379
|
)
|
|
@@ -109596,16 +110498,19 @@ const QuickSettingsHeader = ({
|
|
|
109596
110498
|
showFieldHelp,
|
|
109597
110499
|
fieldTitleFilter,
|
|
109598
110500
|
hideEmptyFields,
|
|
110501
|
+
showAiEditedFields,
|
|
110502
|
+
aiEditedFieldCount = 0,
|
|
109599
110503
|
onToggleFieldHelp,
|
|
109600
110504
|
onFieldTitleFilterChange,
|
|
109601
|
-
onToggleEmptyFields
|
|
110505
|
+
onToggleEmptyFields,
|
|
110506
|
+
onToggleAiEditedFields
|
|
109602
110507
|
}) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-quick-settings-header", role: "region", "aria-label": "Quick filter settings", children: [
|
|
109603
110508
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-quick-settings-actions", "aria-label": "Field display settings", children: [
|
|
109604
110509
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showFieldHelp ? "Hide field help" : "Show field help", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
109605
110510
|
Button$1,
|
|
109606
110511
|
{
|
|
109607
110512
|
type: showFieldHelp ? "default" : "primary",
|
|
109608
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
110513
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$l, {}),
|
|
109609
110514
|
"aria-label": showFieldHelp ? "Hide field help" : "Show field help",
|
|
109610
110515
|
"aria-pressed": !showFieldHelp,
|
|
109611
110516
|
onClick: onToggleFieldHelp
|
|
@@ -109620,6 +110525,18 @@ const QuickSettingsHeader = ({
|
|
|
109620
110525
|
"aria-pressed": hideEmptyFields,
|
|
109621
110526
|
onClick: onToggleEmptyFields
|
|
109622
110527
|
}
|
|
110528
|
+
) }),
|
|
110529
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: showAiEditedFields ? "Show all fields" : "Show AI-edited fields", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110530
|
+
Button$1,
|
|
110531
|
+
{
|
|
110532
|
+
type: showAiEditedFields ? "primary" : "default",
|
|
110533
|
+
className: "describo-ai-edited-filter-button",
|
|
110534
|
+
"aria-label": showAiEditedFields ? "Show all fields" : "Show AI-edited fields",
|
|
110535
|
+
"aria-pressed": showAiEditedFields,
|
|
110536
|
+
disabled: aiEditedFieldCount === 0,
|
|
110537
|
+
onClick: onToggleAiEditedFields,
|
|
110538
|
+
children: "✦"
|
|
110539
|
+
}
|
|
109623
110540
|
) })
|
|
109624
110541
|
] }),
|
|
109625
110542
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -109631,11 +110548,109 @@ const QuickSettingsHeader = ({
|
|
|
109631
110548
|
"aria-label": "Filter fields by name or value",
|
|
109632
110549
|
onChange: (event) => onFieldTitleFilterChange(event.target.value),
|
|
109633
110550
|
allowClear: {
|
|
109634
|
-
clearIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
110551
|
+
clearIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$B, { "aria-label": "Clear field filter" })
|
|
109635
110552
|
}
|
|
109636
110553
|
}
|
|
109637
110554
|
)
|
|
109638
110555
|
] });
|
|
110556
|
+
const AiApprovalStepperHeader = ({
|
|
110557
|
+
activeIndex,
|
|
110558
|
+
pendingCount,
|
|
110559
|
+
activePropertyLabel,
|
|
110560
|
+
remainingEntityCount = 0,
|
|
110561
|
+
remainingFieldCount = 0,
|
|
110562
|
+
readonly = false,
|
|
110563
|
+
canGoPrevious,
|
|
110564
|
+
canGoNext,
|
|
110565
|
+
onPrevious,
|
|
110566
|
+
onNext,
|
|
110567
|
+
onAcceptAll,
|
|
110568
|
+
onRejectAll,
|
|
110569
|
+
onReviewNextEntity
|
|
110570
|
+
}) => {
|
|
110571
|
+
if (!pendingCount && !remainingEntityCount) return null;
|
|
110572
|
+
if (!pendingCount) {
|
|
110573
|
+
const entityLabel = remainingEntityCount === 1 ? "entity" : "entities";
|
|
110574
|
+
const fieldLabel = remainingFieldCount === 1 ? "field" : "fields";
|
|
110575
|
+
const remainingMessage = `${remainingFieldCount} AI ${fieldLabel} still need review in ${remainingEntityCount} other ${entityLabel}`;
|
|
110576
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-bar describo-ai-confirm-bar-remaining", role: "status", "aria-label": "AI changes remaining", children: [
|
|
110577
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-message", children: [
|
|
110578
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-confirm-spark", children: "✦" }),
|
|
110579
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: remainingMessage })
|
|
110580
|
+
] }),
|
|
110581
|
+
onReviewNextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "describo-ai-confirm-controls", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110582
|
+
Button$1,
|
|
110583
|
+
{
|
|
110584
|
+
className: "describo-ai-review-next-entity",
|
|
110585
|
+
onClick: onReviewNextEntity,
|
|
110586
|
+
children: "Review next"
|
|
110587
|
+
}
|
|
110588
|
+
) })
|
|
110589
|
+
] });
|
|
110590
|
+
}
|
|
110591
|
+
const stepLabel = `${Math.min(activeIndex + 1, pendingCount)}/${pendingCount}`;
|
|
110592
|
+
const message = activePropertyLabel ? `AI changes need review: ${activePropertyLabel}` : "AI changes need review";
|
|
110593
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-bar", role: "region", "aria-label": "AI change review", children: [
|
|
110594
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-message", children: [
|
|
110595
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-confirm-spark", children: "✦" }),
|
|
110596
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: message })
|
|
110597
|
+
] }),
|
|
110598
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-confirm-controls", children: [
|
|
110599
|
+
onReviewNextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: remainingEntityCount > 0 ? "Review the next entity with pending AI changes" : "No other entities need AI review", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110600
|
+
Button$1,
|
|
110601
|
+
{
|
|
110602
|
+
className: "describo-ai-review-next-entity",
|
|
110603
|
+
disabled: remainingEntityCount === 0,
|
|
110604
|
+
onClick: onReviewNextEntity,
|
|
110605
|
+
children: "Review next"
|
|
110606
|
+
}
|
|
110607
|
+
) }),
|
|
110608
|
+
!readonly && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
110609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Accept every pending AI change in this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110610
|
+
Button$1,
|
|
110611
|
+
{
|
|
110612
|
+
className: "describo-ai-bulk-action describo-ai-bulk-accept",
|
|
110613
|
+
onClick: onAcceptAll,
|
|
110614
|
+
children: "Accept all"
|
|
110615
|
+
}
|
|
110616
|
+
) }),
|
|
110617
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Restore previous values for every pending AI change in this entity", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110618
|
+
Button$1,
|
|
110619
|
+
{
|
|
110620
|
+
className: "describo-ai-bulk-action describo-ai-bulk-reject",
|
|
110621
|
+
onClick: onRejectAll,
|
|
110622
|
+
children: "Reject all"
|
|
110623
|
+
}
|
|
110624
|
+
) })
|
|
110625
|
+
] }),
|
|
110626
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "describo-ai-stepper", "aria-label": "Pending AI field navigation", children: [
|
|
110627
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Previous pending field", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110628
|
+
Button$1,
|
|
110629
|
+
{
|
|
110630
|
+
type: "text",
|
|
110631
|
+
size: "small",
|
|
110632
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
|
|
110633
|
+
"aria-label": "Previous pending AI field",
|
|
110634
|
+
disabled: !canGoPrevious,
|
|
110635
|
+
onClick: onPrevious
|
|
110636
|
+
}
|
|
110637
|
+
) }),
|
|
110638
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "describo-ai-step-count", children: stepLabel }),
|
|
110639
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip2, { title: "Next pending field", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
110640
|
+
Button$1,
|
|
110641
|
+
{
|
|
110642
|
+
type: "text",
|
|
110643
|
+
size: "small",
|
|
110644
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {}),
|
|
110645
|
+
"aria-label": "Next pending AI field",
|
|
110646
|
+
disabled: !canGoNext,
|
|
110647
|
+
onClick: onNext
|
|
110648
|
+
}
|
|
110649
|
+
) })
|
|
110650
|
+
] })
|
|
110651
|
+
] })
|
|
110652
|
+
] });
|
|
110653
|
+
};
|
|
109639
110654
|
var _baseDifference;
|
|
109640
110655
|
var hasRequired_baseDifference;
|
|
109641
110656
|
function require_baseDifference() {
|
|
@@ -111307,11 +112322,12 @@ const clearPendingAddedProfileTabKeys = (entityId) => {
|
|
|
111307
112322
|
}
|
|
111308
112323
|
};
|
|
111309
112324
|
const RenderEntity = forwardRef((props, ref) => {
|
|
111310
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
112325
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
111311
112326
|
const { entity, onLoadEntity, onSaveCrate, onSaveEntityTemplate, onWarning, onError, onAddNewProfileRequest, onRemoveProfile } = props;
|
|
111312
112327
|
const state = useStateStore();
|
|
111313
112328
|
const profileManager = useContext(ProfileManagerContext);
|
|
111314
112329
|
const crateManager = useContext(CrateManagerContext);
|
|
112330
|
+
const approvalContext = useContext(RoCrateApprovalContext);
|
|
111315
112331
|
const { t: t2 } = useTranslation();
|
|
111316
112332
|
const [contextEntity, setContextEntity] = useState(entity);
|
|
111317
112333
|
const [activeTab, setActiveTab] = useState("about");
|
|
@@ -111327,6 +112343,8 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111327
112343
|
const [showFieldHelp, setShowFieldHelp] = useState(true);
|
|
111328
112344
|
const [fieldTitleFilter, setFieldTitleFilter] = useState("");
|
|
111329
112345
|
const [hideEmptyFields, setHideEmptyFields] = useState(false);
|
|
112346
|
+
const [showAiEditedFields, setShowAiEditedFields] = useState(false);
|
|
112347
|
+
const [selectedAiApprovalIndex, setSelectedAiApprovalIndex] = useState(0);
|
|
111330
112348
|
const [iconView, setIconView] = useState(false);
|
|
111331
112349
|
const [hoveredTabKey, setHoveredTabKey] = useState(null);
|
|
111332
112350
|
const initialTabPaneWidth = useMemo$1(() => {
|
|
@@ -111353,8 +112371,49 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111353
112371
|
const restoreInProgressRef = useRef(false);
|
|
111354
112372
|
const pendingAddedProfileSelectionRef = useRef(null);
|
|
111355
112373
|
const pendingAddedPropertyRef = useRef(null);
|
|
112374
|
+
const pendingAiScrollPropertyRef = useRef(null);
|
|
112375
|
+
const lastAutoNavigatedAiApprovalRef = useRef(null);
|
|
111356
112376
|
const [tabRailScrollState, setTabRailScrollState] = useState({ canScrollUp: false, canScrollDown: false });
|
|
111357
112377
|
const debugScroll = (...args) => console.log("[recrate-scroll-debug]", ...args);
|
|
112378
|
+
const pendingAiApprovals = useMemo$1(() => getPendingEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
|
|
112379
|
+
const pendingAiApprovalProperties = useMemo$1(() => pendingAiApprovals.map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((property) => typeof property === "string" && property.length > 0), [pendingAiApprovals]);
|
|
112380
|
+
const pendingDeletedEntityReviewProperties = useMemo$1(() => getPendingDeletedEntityReversePropertiesForSource(
|
|
112381
|
+
approvalContext == null ? void 0 : approvalContext.roCrateApproval,
|
|
112382
|
+
contextEntity == null ? void 0 : contextEntity["@id"]
|
|
112383
|
+
), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
|
|
112384
|
+
const approvedAiApprovals = useMemo$1(() => getApprovedEntityApprovalRecords(approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
|
|
112385
|
+
const approvedAiApprovalProperties = useMemo$1(() => Array.from(new Set(
|
|
112386
|
+
approvedAiApprovals.map((approvalRecord) => approvalRecord == null ? void 0 : approvalRecord.propertyName).filter((property) => typeof property === "string" && property.length > 0)
|
|
112387
|
+
)), [approvedAiApprovals]);
|
|
112388
|
+
const selectedAiApproval = pendingAiApprovals[selectedAiApprovalIndex] ?? pendingAiApprovals[0];
|
|
112389
|
+
const selectedAiApprovalProperty = selectedAiApproval == null ? void 0 : selectedAiApproval.propertyName;
|
|
112390
|
+
const pendingOtherAiApprovalEntities = useMemo$1(() => getPendingApprovalEntities(approvalContext == null ? void 0 : approvalContext.roCrateApproval).filter((entityApproval) => !entityIdsMatch(entityApproval == null ? void 0 : entityApproval["@id"], contextEntity == null ? void 0 : contextEntity["@id"])), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
|
|
112391
|
+
const pendingOtherAiApprovalFieldCount = useMemo$1(() => getPendingApprovalFieldCount(approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]), [approvalContext == null ? void 0 : approvalContext.roCrateApproval, contextEntity == null ? void 0 : contextEntity["@id"]]);
|
|
112392
|
+
const handleReviewNextAiApprovalEntity = useCallback(() => {
|
|
112393
|
+
for (const entityApproval of pendingOtherAiApprovalEntities) {
|
|
112394
|
+
const nextEntityId = entityApproval == null ? void 0 : entityApproval["@id"];
|
|
112395
|
+
if (!nextEntityId) continue;
|
|
112396
|
+
if (isPendingEntityDeleteApproval(entityApproval)) {
|
|
112397
|
+
const reviewTarget = getDeletedEntityReviewTarget(entityApproval);
|
|
112398
|
+
if (!reviewTarget) continue;
|
|
112399
|
+
const targetEntity = crateManager == null ? void 0 : crateManager.getEntity({
|
|
112400
|
+
id: reviewTarget.entityId,
|
|
112401
|
+
link: false,
|
|
112402
|
+
materialise: false
|
|
112403
|
+
});
|
|
112404
|
+
if (!targetEntity) continue;
|
|
112405
|
+
setFieldTitleFilter("");
|
|
112406
|
+
if (hideEmptyFields) {
|
|
112407
|
+
setHideEmptyFields(false);
|
|
112408
|
+
}
|
|
112409
|
+
pendingAiScrollPropertyRef.current = reviewTarget.property;
|
|
112410
|
+
onLoadEntity({ id: reviewTarget.entityId });
|
|
112411
|
+
return;
|
|
112412
|
+
}
|
|
112413
|
+
onLoadEntity({ id: nextEntityId });
|
|
112414
|
+
return;
|
|
112415
|
+
}
|
|
112416
|
+
}, [crateManager, hideEmptyFields, onLoadEntity, pendingOtherAiApprovalEntities]);
|
|
111358
112417
|
const getVisibleContextMarkers = (selector, dataAttribute) => {
|
|
111359
112418
|
const source = activeContentRef.current;
|
|
111360
112419
|
if (!source) return [];
|
|
@@ -111505,15 +112564,32 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111505
112564
|
setFieldTitleFilter("");
|
|
111506
112565
|
init2({ entity });
|
|
111507
112566
|
}, [entity]);
|
|
112567
|
+
useEffect(() => {
|
|
112568
|
+
if (!pendingAiApprovals.length) {
|
|
112569
|
+
setSelectedAiApprovalIndex(0);
|
|
112570
|
+
return;
|
|
112571
|
+
}
|
|
112572
|
+
setSelectedAiApprovalIndex((currentIndex) => Math.min(currentIndex, pendingAiApprovals.length - 1));
|
|
112573
|
+
}, [pendingAiApprovals.length]);
|
|
112574
|
+
useEffect(() => {
|
|
112575
|
+
if (approvedAiApprovalProperties.length === 0) {
|
|
112576
|
+
setShowAiEditedFields(false);
|
|
112577
|
+
}
|
|
112578
|
+
}, [approvedAiApprovalProperties.length]);
|
|
111508
112579
|
useEffect(() => {
|
|
111509
112580
|
if (profileManager && profileManager.$key) {
|
|
112581
|
+
if (entity == null ? void 0 : entity.__aiDeletedEntity) {
|
|
112582
|
+
init2({ entity });
|
|
112583
|
+
return;
|
|
112584
|
+
}
|
|
111510
112585
|
const entityObj = crateManager.getEntity({ id: entity["@id"], link: false, materialise: false });
|
|
112586
|
+
if (!entityObj) return;
|
|
111511
112587
|
init2({ entity: entityObj });
|
|
111512
112588
|
}
|
|
111513
112589
|
}, [profileManager == null ? void 0 : profileManager.$key]);
|
|
111514
112590
|
const init2 = ({ entity: entity2, extraPropertiesOverride }) => {
|
|
111515
112591
|
var _a3, _b2, _c2, _d2, _e3, _f2;
|
|
111516
|
-
if (!entity2["@id"]) return;
|
|
112592
|
+
if (!(entity2 == null ? void 0 : entity2["@id"])) return;
|
|
111517
112593
|
const latestEntry = state.editorState.latest();
|
|
111518
112594
|
const isCurrentHistoryEntity = (latestEntry == null ? void 0 : latestEntry.id) === entity2["@id"];
|
|
111519
112595
|
const layout = applyLayout({
|
|
@@ -111529,7 +112605,8 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111529
112605
|
const navState = isCurrentHistoryEntity ? latestEntry == null ? void 0 : latestEntry.navigationState : state.editorState.getNavigationState(entity2["@id"]);
|
|
111530
112606
|
const tabNames = layout.tabs.map((tab) => tab.name);
|
|
111531
112607
|
const fallbackTab = tabNames.includes("about") ? "about" : tabNames[0] ?? "about";
|
|
111532
|
-
const
|
|
112608
|
+
const currentTabStillValid = layout.renderTabs && (contextEntity == null ? void 0 : contextEntity["@id"]) === entity2["@id"] && tabNames.includes(activeTab);
|
|
112609
|
+
const restoredTab = currentTabStillValid ? activeTab : layout.renderTabs && (navState == null ? void 0 : navState.activeTab) && tabNames.includes(navState.activeTab) ? navState.activeTab : fallbackTab;
|
|
111533
112610
|
const pendingAddedProfileSelection = pendingAddedProfileSelectionRef.current;
|
|
111534
112611
|
const pendingAddedProfileTabKeys = Array.isArray((_a3 = navState == null ? void 0 : navState.uiState) == null ? void 0 : _a3.pendingAddedProfileTabKeys) ? navState.uiState.pendingAddedProfileTabKeys : readPendingAddedProfileTabKeys(entity2["@id"]);
|
|
111535
112612
|
let nextActiveTab = restoredTab;
|
|
@@ -111616,7 +112693,12 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111616
112693
|
}
|
|
111617
112694
|
};
|
|
111618
112695
|
const refresh = () => {
|
|
112696
|
+
if (entity == null ? void 0 : entity.__aiDeletedEntity) {
|
|
112697
|
+
init2({ entity });
|
|
112698
|
+
return;
|
|
112699
|
+
}
|
|
111619
112700
|
const entityObj = crateManager.getEntity({ id: entity["@id"], link: false, materialise: false });
|
|
112701
|
+
if (!entityObj) return;
|
|
111620
112702
|
init2({ entity: entityObj });
|
|
111621
112703
|
};
|
|
111622
112704
|
const handleLoadEntityWithContext = (params) => {
|
|
@@ -111638,6 +112720,11 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111638
112720
|
state.editorState.update({ id: activeEntityId, tab: tabName });
|
|
111639
112721
|
state.editorState.updateNavigationState({ activeTab: tabName });
|
|
111640
112722
|
};
|
|
112723
|
+
const saveCratePreservingView = () => {
|
|
112724
|
+
saveTabToState(activeTab);
|
|
112725
|
+
captureViewContext(activeTab);
|
|
112726
|
+
onSaveCrate();
|
|
112727
|
+
};
|
|
111641
112728
|
useEffect(() => {
|
|
111642
112729
|
if (entity == null ? void 0 : entity["@id"]) {
|
|
111643
112730
|
refresh();
|
|
@@ -111902,7 +112989,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111902
112989
|
if (data.property === "@id" && (updatedEntity == null ? void 0 : updatedEntity["@id"])) {
|
|
111903
112990
|
state.editorState.replaceId({ id: entity["@id"], newId: updatedEntity["@id"] });
|
|
111904
112991
|
}
|
|
111905
|
-
|
|
112992
|
+
saveCratePreservingView();
|
|
111906
112993
|
notifySave(data.property);
|
|
111907
112994
|
} catch (error2) {
|
|
111908
112995
|
console.error(error2);
|
|
@@ -111928,7 +113015,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111928
113015
|
});
|
|
111929
113016
|
}
|
|
111930
113017
|
refresh();
|
|
111931
|
-
|
|
113018
|
+
saveCratePreservingView();
|
|
111932
113019
|
notifySave(data.property);
|
|
111933
113020
|
} catch (error2) {
|
|
111934
113021
|
onError();
|
|
@@ -111949,7 +113036,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111949
113036
|
onWarning();
|
|
111950
113037
|
}
|
|
111951
113038
|
refresh();
|
|
111952
|
-
|
|
113039
|
+
saveCratePreservingView();
|
|
111953
113040
|
return data.json["@id"];
|
|
111954
113041
|
} catch (error2) {
|
|
111955
113042
|
onError();
|
|
@@ -111965,7 +113052,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111965
113052
|
value: { "@id": data.json["@id"] }
|
|
111966
113053
|
});
|
|
111967
113054
|
refresh();
|
|
111968
|
-
|
|
113055
|
+
saveCratePreservingView();
|
|
111969
113056
|
} catch (error2) {
|
|
111970
113057
|
onError();
|
|
111971
113058
|
}
|
|
@@ -111978,7 +113065,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111978
113065
|
idx: data.idx
|
|
111979
113066
|
});
|
|
111980
113067
|
refresh();
|
|
111981
|
-
|
|
113068
|
+
saveCratePreservingView();
|
|
111982
113069
|
} catch (error2) {
|
|
111983
113070
|
onError();
|
|
111984
113071
|
}
|
|
@@ -111991,7 +113078,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
111991
113078
|
value: { "@id": data.tgtEntityId }
|
|
111992
113079
|
});
|
|
111993
113080
|
refresh();
|
|
111994
|
-
|
|
113081
|
+
saveCratePreservingView();
|
|
111995
113082
|
} catch (error2) {
|
|
111996
113083
|
console.error(error2);
|
|
111997
113084
|
onError();
|
|
@@ -112001,7 +113088,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112001
113088
|
try {
|
|
112002
113089
|
crateManager.deleteEntity({ id: data.id });
|
|
112003
113090
|
handleLoadEntityWithContext({ id: "./" });
|
|
112004
|
-
|
|
113091
|
+
saveCratePreservingView();
|
|
112005
113092
|
} catch (error2) {
|
|
112006
113093
|
onError();
|
|
112007
113094
|
}
|
|
@@ -112009,7 +113096,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112009
113096
|
const handleUpdateContext = (context) => {
|
|
112010
113097
|
try {
|
|
112011
113098
|
crateManager.setContext(context);
|
|
112012
|
-
|
|
113099
|
+
saveCratePreservingView();
|
|
112013
113100
|
} catch (error2) {
|
|
112014
113101
|
onError();
|
|
112015
113102
|
}
|
|
@@ -112031,7 +113118,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112031
113118
|
{
|
|
112032
113119
|
type: "default",
|
|
112033
113120
|
shape: "circle",
|
|
112034
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113121
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
|
|
112035
113122
|
"aria-label": "Add Profile",
|
|
112036
113123
|
"aria-controls": "add-property-panel",
|
|
112037
113124
|
"aria-expanded": showAddPanel,
|
|
@@ -112051,7 +113138,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112051
113138
|
{
|
|
112052
113139
|
type: iconView ? "primary" : "default",
|
|
112053
113140
|
shape: "circle",
|
|
112054
|
-
icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113141
|
+
icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$c, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
|
|
112055
113142
|
"aria-pressed": iconView,
|
|
112056
113143
|
onClick: (e3) => {
|
|
112057
113144
|
e3.stopPropagation();
|
|
@@ -112084,7 +113171,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112084
113171
|
{
|
|
112085
113172
|
type: iconView ? "primary" : "default",
|
|
112086
113173
|
shape: "circle",
|
|
112087
|
-
icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113174
|
+
icon: iconView ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$c, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
|
|
112088
113175
|
"aria-pressed": iconView,
|
|
112089
113176
|
onClick: (e3) => {
|
|
112090
113177
|
e3.stopPropagation();
|
|
@@ -112097,7 +113184,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112097
113184
|
{
|
|
112098
113185
|
type: "default",
|
|
112099
113186
|
shape: "circle",
|
|
112100
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113187
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$q, {}),
|
|
112101
113188
|
"aria-label": "Add Profile",
|
|
112102
113189
|
"aria-controls": "add-property-panel",
|
|
112103
113190
|
"aria-expanded": showAddPanel,
|
|
@@ -112162,7 +113249,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112162
113249
|
e3.stopPropagation();
|
|
112163
113250
|
handleRemoveProfile(tab);
|
|
112164
113251
|
},
|
|
112165
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113252
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$g, { style: { color: "oklch(57.7% 0.245 27.325)" } })
|
|
112166
113253
|
}
|
|
112167
113254
|
)
|
|
112168
113255
|
] })
|
|
@@ -112182,7 +113269,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112182
113269
|
shape: "circle",
|
|
112183
113270
|
size: "small",
|
|
112184
113271
|
className: "describo-tab-rail-scroll-button describo-tab-rail-scroll-button-up",
|
|
112185
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113272
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$p, {}),
|
|
112186
113273
|
"aria-label": "Scroll profile tabs up",
|
|
112187
113274
|
onClick: () => scrollTabRail("up")
|
|
112188
113275
|
}
|
|
@@ -112194,7 +113281,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112194
113281
|
shape: "circle",
|
|
112195
113282
|
size: "small",
|
|
112196
113283
|
className: "describo-tab-rail-scroll-button describo-tab-rail-scroll-button-down",
|
|
112197
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113284
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$u, {}),
|
|
112198
113285
|
"aria-label": "Scroll profile tabs down",
|
|
112199
113286
|
onClick: () => scrollTabRail("down")
|
|
112200
113287
|
}
|
|
@@ -112208,11 +113295,390 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112208
113295
|
showFieldHelp,
|
|
112209
113296
|
fieldTitleFilter,
|
|
112210
113297
|
hideEmptyFields,
|
|
113298
|
+
showAiEditedFields,
|
|
113299
|
+
aiEditedFieldCount: approvedAiApprovalProperties.length,
|
|
112211
113300
|
onToggleFieldHelp: () => setShowFieldHelp((visible) => !visible),
|
|
112212
113301
|
onFieldTitleFilterChange: setFieldTitleFilter,
|
|
112213
|
-
onToggleEmptyFields: () => setHideEmptyFields((hidden) => !hidden)
|
|
113302
|
+
onToggleEmptyFields: () => setHideEmptyFields((hidden) => !hidden),
|
|
113303
|
+
onToggleAiEditedFields: () => setShowAiEditedFields((visible) => !visible)
|
|
112214
113304
|
}
|
|
112215
113305
|
) : null;
|
|
113306
|
+
const findPropertyElement = (property) => {
|
|
113307
|
+
var _a3;
|
|
113308
|
+
return Array.from(((_a3 = activeContentRef.current) == null ? void 0 : _a3.querySelectorAll("[data-recrate-property]")) ?? []).find((element) => element.dataset.recrateProperty === property);
|
|
113309
|
+
};
|
|
113310
|
+
const scrollToAiApprovalProperty = useCallback((property) => {
|
|
113311
|
+
let attempts = 0;
|
|
113312
|
+
let timerId = 0;
|
|
113313
|
+
let rafId = 0;
|
|
113314
|
+
const maxAttempts = 30;
|
|
113315
|
+
const attemptScroll = () => {
|
|
113316
|
+
attempts += 1;
|
|
113317
|
+
const propertyElement = findPropertyElement(property);
|
|
113318
|
+
const viewport = activeContentRef.current;
|
|
113319
|
+
if (propertyElement && viewport) {
|
|
113320
|
+
const viewportRect = viewport.getBoundingClientRect();
|
|
113321
|
+
const propertyRect = propertyElement.getBoundingClientRect();
|
|
113322
|
+
const targetTop = viewport.scrollTop + propertyRect.top - viewportRect.top - 8;
|
|
113323
|
+
const maxScrollable = Math.max(0, viewport.scrollHeight - viewport.clientHeight);
|
|
113324
|
+
viewport.scrollTo({
|
|
113325
|
+
top: Math.max(0, Math.min(targetTop, maxScrollable)),
|
|
113326
|
+
behavior: "smooth"
|
|
113327
|
+
});
|
|
113328
|
+
return;
|
|
113329
|
+
}
|
|
113330
|
+
if (attempts < maxAttempts) {
|
|
113331
|
+
timerId = window.setTimeout(() => {
|
|
113332
|
+
rafId = window.requestAnimationFrame(attemptScroll);
|
|
113333
|
+
}, 50);
|
|
113334
|
+
}
|
|
113335
|
+
};
|
|
113336
|
+
rafId = window.requestAnimationFrame(attemptScroll);
|
|
113337
|
+
return () => {
|
|
113338
|
+
window.cancelAnimationFrame(rafId);
|
|
113339
|
+
window.clearTimeout(timerId);
|
|
113340
|
+
};
|
|
113341
|
+
}, []);
|
|
113342
|
+
const navigateToAiApproval = useCallback((index2) => {
|
|
113343
|
+
if (!pendingAiApprovals.length) return;
|
|
113344
|
+
if (index2 < 0 || index2 >= pendingAiApprovals.length) return;
|
|
113345
|
+
const approvalRecord = pendingAiApprovals[index2];
|
|
113346
|
+
const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
113347
|
+
if (!property) return;
|
|
113348
|
+
setSelectedAiApprovalIndex(index2);
|
|
113349
|
+
setFieldTitleFilter("");
|
|
113350
|
+
if (!hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]) && hideEmptyFields) {
|
|
113351
|
+
setHideEmptyFields(false);
|
|
113352
|
+
}
|
|
113353
|
+
pendingAiScrollPropertyRef.current = property;
|
|
113354
|
+
const propertyTab = renderTabs ? findTabForProperty(tabs, property) : null;
|
|
113355
|
+
if ((propertyTab == null ? void 0 : propertyTab.name) && propertyTab.name !== activeTab) {
|
|
113356
|
+
captureViewContext(activeTab);
|
|
113357
|
+
setActiveTab(propertyTab.name);
|
|
113358
|
+
saveTabToState(propertyTab.name);
|
|
113359
|
+
}
|
|
113360
|
+
window.setTimeout(() => scrollToAiApprovalProperty(property), 0);
|
|
113361
|
+
window.setTimeout(() => scrollToAiApprovalProperty(property), 120);
|
|
113362
|
+
}, [
|
|
113363
|
+
activeTab,
|
|
113364
|
+
contextEntity,
|
|
113365
|
+
hideEmptyFields,
|
|
113366
|
+
pendingAiApprovals,
|
|
113367
|
+
renderTabs,
|
|
113368
|
+
scrollToAiApprovalProperty,
|
|
113369
|
+
tabs
|
|
113370
|
+
]);
|
|
113371
|
+
useEffect(() => {
|
|
113372
|
+
var _a3;
|
|
113373
|
+
const entityId = contextEntity == null ? void 0 : contextEntity["@id"];
|
|
113374
|
+
const firstPendingProperty = (_a3 = pendingAiApprovals[0]) == null ? void 0 : _a3.propertyName;
|
|
113375
|
+
if (!entityId || !firstPendingProperty) {
|
|
113376
|
+
lastAutoNavigatedAiApprovalRef.current = null;
|
|
113377
|
+
return;
|
|
113378
|
+
}
|
|
113379
|
+
const autoNavigationKey = `${entityId}:${firstPendingProperty}`;
|
|
113380
|
+
if (lastAutoNavigatedAiApprovalRef.current === autoNavigationKey) return;
|
|
113381
|
+
lastAutoNavigatedAiApprovalRef.current = autoNavigationKey;
|
|
113382
|
+
navigateToAiApproval(0);
|
|
113383
|
+
}, [contextEntity == null ? void 0 : contextEntity["@id"], navigateToAiApproval, pendingAiApprovals]);
|
|
113384
|
+
useEffect(() => {
|
|
113385
|
+
const pendingProperty = pendingAiScrollPropertyRef.current;
|
|
113386
|
+
if (!pendingProperty) return;
|
|
113387
|
+
const propertyTab = renderTabs ? findTabForProperty(tabs, pendingProperty) : null;
|
|
113388
|
+
if ((propertyTab == null ? void 0 : propertyTab.name) && propertyTab.name !== activeTab) {
|
|
113389
|
+
setActiveTab(propertyTab.name);
|
|
113390
|
+
saveTabToState(propertyTab.name);
|
|
113391
|
+
return;
|
|
113392
|
+
}
|
|
113393
|
+
const cancelScroll = scrollToAiApprovalProperty(pendingProperty);
|
|
113394
|
+
pendingAiScrollPropertyRef.current = null;
|
|
113395
|
+
return cancelScroll;
|
|
113396
|
+
}, [activeTab, contextEntity == null ? void 0 : contextEntity["@id"], renderTabs, selectedAiApprovalIndex, tabs, scrollToAiApprovalProperty]);
|
|
113397
|
+
const isEntityReference2 = (value) => Boolean(value && typeof value === "object" && typeof value["@id"] === "string");
|
|
113398
|
+
const restoreNonCoreApprovalValue = (approvalRecord) => {
|
|
113399
|
+
const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
113400
|
+
if (!property) return;
|
|
113401
|
+
if (entityHasPropertyValue(contextEntity, property)) {
|
|
113402
|
+
crateManager.deleteProperty({ id: entity["@id"], property });
|
|
113403
|
+
}
|
|
113404
|
+
const previousValue = approvalRecord == null ? void 0 : approvalRecord.previousValue;
|
|
113405
|
+
if (!propertyValueHasContent(previousValue)) return;
|
|
113406
|
+
const previousValues = Array.isArray(previousValue) ? previousValue : [previousValue];
|
|
113407
|
+
if (previousValues.length === 0) return;
|
|
113408
|
+
if (previousValues.every(isEntityReference2)) {
|
|
113409
|
+
previousValues.forEach((value) => {
|
|
113410
|
+
crateManager.setProperty({ id: entity["@id"], property, value });
|
|
113411
|
+
});
|
|
113412
|
+
return;
|
|
113413
|
+
}
|
|
113414
|
+
crateManager.updateProperty({
|
|
113415
|
+
id: entity["@id"],
|
|
113416
|
+
property,
|
|
113417
|
+
value: previousValues
|
|
113418
|
+
});
|
|
113419
|
+
};
|
|
113420
|
+
const restoreApprovalValue = (approvalRecord) => {
|
|
113421
|
+
const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
113422
|
+
if (!property) return;
|
|
113423
|
+
if (["@id", "@type", "name"].includes(property)) {
|
|
113424
|
+
if (propertyValueHasContent(approvalRecord == null ? void 0 : approvalRecord.previousValue)) {
|
|
113425
|
+
crateManager.updateProperty({
|
|
113426
|
+
id: entity["@id"],
|
|
113427
|
+
property,
|
|
113428
|
+
value: approvalRecord.previousValue
|
|
113429
|
+
});
|
|
113430
|
+
}
|
|
113431
|
+
return;
|
|
113432
|
+
}
|
|
113433
|
+
restoreNonCoreApprovalValue(approvalRecord);
|
|
113434
|
+
};
|
|
113435
|
+
const restoreEntityApprovalValue = (targetEntity, approvalRecord) => {
|
|
113436
|
+
const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
113437
|
+
const entityId = targetEntity == null ? void 0 : targetEntity["@id"];
|
|
113438
|
+
if (!entityId || !property || property === "@reverse") return;
|
|
113439
|
+
const previousValue = approvalRecord == null ? void 0 : approvalRecord.previousValue;
|
|
113440
|
+
if (["@id", "@type", "name"].includes(property)) {
|
|
113441
|
+
if (propertyValueHasContent(previousValue)) {
|
|
113442
|
+
crateManager.updateProperty({
|
|
113443
|
+
id: entityId,
|
|
113444
|
+
property,
|
|
113445
|
+
value: previousValue
|
|
113446
|
+
});
|
|
113447
|
+
}
|
|
113448
|
+
return;
|
|
113449
|
+
}
|
|
113450
|
+
if (entityHasPropertyValue(targetEntity, property)) {
|
|
113451
|
+
crateManager.deleteProperty({ id: entityId, property });
|
|
113452
|
+
}
|
|
113453
|
+
if (!propertyValueHasContent(previousValue)) return;
|
|
113454
|
+
const previousValues = Array.isArray(previousValue) ? previousValue : [previousValue];
|
|
113455
|
+
if (previousValues.length === 0) return;
|
|
113456
|
+
if (previousValues.every(isEntityReference2)) {
|
|
113457
|
+
previousValues.forEach((value) => {
|
|
113458
|
+
crateManager.setProperty({ id: entityId, property, value });
|
|
113459
|
+
});
|
|
113460
|
+
return;
|
|
113461
|
+
}
|
|
113462
|
+
crateManager.updateProperty({
|
|
113463
|
+
id: entityId,
|
|
113464
|
+
property,
|
|
113465
|
+
value: previousValues
|
|
113466
|
+
});
|
|
113467
|
+
};
|
|
113468
|
+
const getPendingApprovalForProperty = (property) => pendingAiApprovals.find((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === property);
|
|
113469
|
+
const propertyHasApprovalRecord = (property) => pendingAiApprovalProperties.includes(property) || approvedAiApprovalProperties.includes(property);
|
|
113470
|
+
const handleApproveAiProperty = (property) => {
|
|
113471
|
+
var _a3;
|
|
113472
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113473
|
+
entityId: entity["@id"],
|
|
113474
|
+
propertyName: property,
|
|
113475
|
+
decision: "accept",
|
|
113476
|
+
value: contextEntity == null ? void 0 : contextEntity[property]
|
|
113477
|
+
});
|
|
113478
|
+
};
|
|
113479
|
+
const handleRejectAiProperty = (approvalRecord) => {
|
|
113480
|
+
var _a3;
|
|
113481
|
+
try {
|
|
113482
|
+
if (!(approvalRecord == null ? void 0 : approvalRecord.propertyName) || !propertyValueHasContent(approvalRecord.previousValue)) return;
|
|
113483
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113484
|
+
entityId: entity["@id"],
|
|
113485
|
+
propertyName: approvalRecord.propertyName,
|
|
113486
|
+
decision: "reject",
|
|
113487
|
+
value: approvalRecord.previousValue
|
|
113488
|
+
});
|
|
113489
|
+
crateManager.updateProperty({
|
|
113490
|
+
id: entity["@id"],
|
|
113491
|
+
property: approvalRecord.propertyName,
|
|
113492
|
+
value: approvalRecord.previousValue
|
|
113493
|
+
});
|
|
113494
|
+
refresh();
|
|
113495
|
+
saveCratePreservingView();
|
|
113496
|
+
notifySave(approvalRecord.propertyName);
|
|
113497
|
+
} catch (error2) {
|
|
113498
|
+
console.error(error2);
|
|
113499
|
+
onError();
|
|
113500
|
+
}
|
|
113501
|
+
};
|
|
113502
|
+
const handleUpdateCoreProperty = (data) => {
|
|
113503
|
+
var _a3;
|
|
113504
|
+
if (propertyHasApprovalRecord(data.property)) {
|
|
113505
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalPropertyApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113506
|
+
entityId: entity["@id"],
|
|
113507
|
+
propertyName: data.property,
|
|
113508
|
+
decision: "manual-edit",
|
|
113509
|
+
value: data.value
|
|
113510
|
+
});
|
|
113511
|
+
}
|
|
113512
|
+
handleUpdateEntity(data);
|
|
113513
|
+
};
|
|
113514
|
+
const getCoreAiReviewProps = (property) => {
|
|
113515
|
+
const approvalRecord = getPendingApprovalForProperty(property);
|
|
113516
|
+
if (!approvalRecord) return void 0;
|
|
113517
|
+
return {
|
|
113518
|
+
operation: approvalRecord.operation,
|
|
113519
|
+
previousValue: approvalRecord.previousValue,
|
|
113520
|
+
previousValueDiffers: !valuesAreEqual(approvalRecord.previousValue, contextEntity == null ? void 0 : contextEntity[property]),
|
|
113521
|
+
onApprove: () => handleApproveAiProperty(property),
|
|
113522
|
+
onReject: () => handleRejectAiProperty(approvalRecord)
|
|
113523
|
+
};
|
|
113524
|
+
};
|
|
113525
|
+
const handleAcceptAllAiApprovals = () => {
|
|
113526
|
+
var _a3;
|
|
113527
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113528
|
+
entityId: entity["@id"],
|
|
113529
|
+
decision: "accept"
|
|
113530
|
+
});
|
|
113531
|
+
};
|
|
113532
|
+
const handleAcceptAiEntityEdit = (editedEntity) => {
|
|
113533
|
+
var _a3;
|
|
113534
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113535
|
+
entityId: editedEntity == null ? void 0 : editedEntity["@id"],
|
|
113536
|
+
decision: "accept",
|
|
113537
|
+
value: editedEntity
|
|
113538
|
+
});
|
|
113539
|
+
};
|
|
113540
|
+
const handleRejectAiEntityEdit = (editedEntity) => {
|
|
113541
|
+
var _a3;
|
|
113542
|
+
try {
|
|
113543
|
+
const entityId = editedEntity == null ? void 0 : editedEntity["@id"];
|
|
113544
|
+
if (!entityId) return;
|
|
113545
|
+
const targetEntity = crateManager.getEntity({
|
|
113546
|
+
id: entityId,
|
|
113547
|
+
link: false,
|
|
113548
|
+
materialise: false
|
|
113549
|
+
});
|
|
113550
|
+
if (!targetEntity) return;
|
|
113551
|
+
const approvalRecords = getPendingEntityApprovalRecords(
|
|
113552
|
+
approvalContext == null ? void 0 : approvalContext.roCrateApproval,
|
|
113553
|
+
entityId
|
|
113554
|
+
).filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@reverse");
|
|
113555
|
+
const restoredValues = approvalRecords.reduce((acc, approvalRecord) => {
|
|
113556
|
+
if (approvalRecord == null ? void 0 : approvalRecord.propertyName) {
|
|
113557
|
+
acc[approvalRecord.propertyName] = approvalRecord.previousValue;
|
|
113558
|
+
}
|
|
113559
|
+
return acc;
|
|
113560
|
+
}, {});
|
|
113561
|
+
approvalRecords.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) !== "@id").forEach((approvalRecord) => restoreEntityApprovalValue(targetEntity, approvalRecord));
|
|
113562
|
+
approvalRecords.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === "@id").forEach((approvalRecord) => restoreEntityApprovalValue(targetEntity, approvalRecord));
|
|
113563
|
+
if (entityIdsMatch(entityId, entity == null ? void 0 : entity["@id"])) {
|
|
113564
|
+
refresh();
|
|
113565
|
+
}
|
|
113566
|
+
saveCratePreservingView();
|
|
113567
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113568
|
+
entityId,
|
|
113569
|
+
decision: "reject",
|
|
113570
|
+
value: restoredValues
|
|
113571
|
+
});
|
|
113572
|
+
} catch (error2) {
|
|
113573
|
+
console.error(error2);
|
|
113574
|
+
onError();
|
|
113575
|
+
}
|
|
113576
|
+
};
|
|
113577
|
+
const handleRejectAllAiApprovals = () => {
|
|
113578
|
+
var _a3;
|
|
113579
|
+
try {
|
|
113580
|
+
const restoredValues = pendingAiApprovals.reduce((acc, approvalRecord) => {
|
|
113581
|
+
if (approvalRecord == null ? void 0 : approvalRecord.propertyName) {
|
|
113582
|
+
acc[approvalRecord.propertyName] = approvalRecord.previousValue;
|
|
113583
|
+
}
|
|
113584
|
+
restoreApprovalValue(approvalRecord);
|
|
113585
|
+
return acc;
|
|
113586
|
+
}, {});
|
|
113587
|
+
refresh();
|
|
113588
|
+
saveCratePreservingView();
|
|
113589
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113590
|
+
entityId: entity["@id"],
|
|
113591
|
+
decision: "reject",
|
|
113592
|
+
value: restoredValues
|
|
113593
|
+
});
|
|
113594
|
+
} catch (error2) {
|
|
113595
|
+
console.error(error2);
|
|
113596
|
+
onError();
|
|
113597
|
+
}
|
|
113598
|
+
};
|
|
113599
|
+
const getPendingDeletedEntityApprovalRecords = (deletedEntity) => {
|
|
113600
|
+
const entityApproval = getEntityApproval(approvalContext == null ? void 0 : approvalContext.roCrateApproval, deletedEntity == null ? void 0 : deletedEntity["@id"]);
|
|
113601
|
+
if (!Array.isArray(entityApproval == null ? void 0 : entityApproval.approval)) return [];
|
|
113602
|
+
return entityApproval.approval.filter((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete" && !approvalIsApproved(approvalRecord));
|
|
113603
|
+
};
|
|
113604
|
+
const buildRestoredDeletedEntity = (deletedEntity, approvalRecords) => {
|
|
113605
|
+
const restoredEntity = approvalRecords.reduce((acc, approvalRecord) => {
|
|
113606
|
+
const property = approvalRecord == null ? void 0 : approvalRecord.propertyName;
|
|
113607
|
+
if (!property || property === "@reverse" || (approvalRecord == null ? void 0 : approvalRecord.operation) !== "delete") return acc;
|
|
113608
|
+
if (!propertyValueHasContent(approvalRecord.previousValue)) return acc;
|
|
113609
|
+
if (property === "@id") {
|
|
113610
|
+
acc["@id"] = approvalRecord.previousValue;
|
|
113611
|
+
} else if (property === "@type") {
|
|
113612
|
+
acc["@type"] = [].concat(approvalRecord.previousValue);
|
|
113613
|
+
} else {
|
|
113614
|
+
acc[property] = approvalRecord.previousValue;
|
|
113615
|
+
}
|
|
113616
|
+
return acc;
|
|
113617
|
+
}, {
|
|
113618
|
+
"@id": deletedEntity == null ? void 0 : deletedEntity["@id"],
|
|
113619
|
+
"@type": (deletedEntity == null ? void 0 : deletedEntity["@type"]) ?? ["Thing"],
|
|
113620
|
+
name: (deletedEntity == null ? void 0 : deletedEntity.name) ?? (deletedEntity == null ? void 0 : deletedEntity["@id"])
|
|
113621
|
+
});
|
|
113622
|
+
if (!propertyValueHasContent(restoredEntity.name)) {
|
|
113623
|
+
restoredEntity.name = restoredEntity["@id"];
|
|
113624
|
+
}
|
|
113625
|
+
return restoredEntity;
|
|
113626
|
+
};
|
|
113627
|
+
const restoreDeletedEntityReverseConnections = (restoredEntityId, approvalRecords) => {
|
|
113628
|
+
var _a3;
|
|
113629
|
+
const reverseConnections = (_a3 = approvalRecords.find((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === "@reverse" && (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete")) == null ? void 0 : _a3.previousValue;
|
|
113630
|
+
if (!reverseConnections || typeof reverseConnections !== "object") return;
|
|
113631
|
+
Object.entries(reverseConnections).forEach(([property, sourceRefs]) => {
|
|
113632
|
+
const refs = Array.isArray(sourceRefs) ? sourceRefs : [sourceRefs];
|
|
113633
|
+
refs.forEach((sourceRef) => {
|
|
113634
|
+
const sourceId = sourceRef == null ? void 0 : sourceRef["@id"];
|
|
113635
|
+
if (!sourceId) return;
|
|
113636
|
+
crateManager.setProperty({
|
|
113637
|
+
id: sourceId,
|
|
113638
|
+
property,
|
|
113639
|
+
value: { "@id": restoredEntityId }
|
|
113640
|
+
});
|
|
113641
|
+
});
|
|
113642
|
+
});
|
|
113643
|
+
};
|
|
113644
|
+
const handleAcceptAiEntityDelete = (deletedEntity = contextEntity, navigateToRoot = false) => {
|
|
113645
|
+
var _a3;
|
|
113646
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113647
|
+
entityId: deletedEntity == null ? void 0 : deletedEntity["@id"],
|
|
113648
|
+
decision: "accept"
|
|
113649
|
+
});
|
|
113650
|
+
if (navigateToRoot) {
|
|
113651
|
+
onLoadEntity({ id: "./" });
|
|
113652
|
+
}
|
|
113653
|
+
};
|
|
113654
|
+
const handleRestoreAiDeletedEntity = (deletedEntity = contextEntity, navigateToRestored = false) => {
|
|
113655
|
+
var _a3;
|
|
113656
|
+
try {
|
|
113657
|
+
const approvalRecords = getPendingDeletedEntityApprovalRecords(deletedEntity);
|
|
113658
|
+
const restoredEntity = buildRestoredDeletedEntity(deletedEntity, approvalRecords);
|
|
113659
|
+
crateManager.addEntity(restoredEntity);
|
|
113660
|
+
restoreDeletedEntityReverseConnections(restoredEntity["@id"], approvalRecords);
|
|
113661
|
+
const nextEntityId = navigateToRestored ? restoredEntity["@id"] : entity["@id"];
|
|
113662
|
+
const nextEntity = crateManager.getEntity({
|
|
113663
|
+
id: nextEntityId,
|
|
113664
|
+
link: false,
|
|
113665
|
+
materialise: false
|
|
113666
|
+
});
|
|
113667
|
+
if (nextEntity) init2({ entity: nextEntity });
|
|
113668
|
+
saveCratePreservingView();
|
|
113669
|
+
(_a3 = approvalContext == null ? void 0 : approvalContext.markApprovalEntityApproved) == null ? void 0 : _a3.call(approvalContext, {
|
|
113670
|
+
entityId: deletedEntity == null ? void 0 : deletedEntity["@id"],
|
|
113671
|
+
decision: "reject",
|
|
113672
|
+
value: restoredEntity
|
|
113673
|
+
});
|
|
113674
|
+
if (navigateToRestored) {
|
|
113675
|
+
onLoadEntity({ id: restoredEntity["@id"], updateState: false });
|
|
113676
|
+
}
|
|
113677
|
+
} catch (error2) {
|
|
113678
|
+
console.error(error2);
|
|
113679
|
+
onError();
|
|
113680
|
+
}
|
|
113681
|
+
};
|
|
112216
113682
|
const hasFieldValue = (value) => {
|
|
112217
113683
|
if (Array.isArray(value)) {
|
|
112218
113684
|
return value.some(hasFieldValue);
|
|
@@ -112225,6 +113691,9 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112225
113691
|
}
|
|
112226
113692
|
return true;
|
|
112227
113693
|
};
|
|
113694
|
+
const fieldHasPendingAiApproval = (property) => pendingAiApprovalProperties.includes(property) || pendingDeletedEntityReviewProperties.includes(property);
|
|
113695
|
+
const fieldWasAiEdited = (property) => approvedAiApprovalProperties.includes(property);
|
|
113696
|
+
const fieldAiEditedVariant = (property) => approvedAiApprovals.some((approvalRecord) => (approvalRecord == null ? void 0 : approvalRecord.propertyName) === property && (approvalRecord == null ? void 0 : approvalRecord.operation) === "delete") ? "deleted" : "edited";
|
|
112228
113697
|
const getFieldTitle = (property, label) => {
|
|
112229
113698
|
var _a3, _b2;
|
|
112230
113699
|
if (label) return label;
|
|
@@ -112279,8 +113748,14 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112279
113748
|
].join(" ").toLowerCase();
|
|
112280
113749
|
return fieldText.includes(filter2);
|
|
112281
113750
|
};
|
|
112282
|
-
const shouldRenderCoreField = (property, label) => matchesFieldFilter(property, label);
|
|
112283
|
-
const shouldRenderField = (property, label) => matchesFieldFilter(property, label) && (!hideEmptyFields || hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]));
|
|
113751
|
+
const shouldRenderCoreField = (property, label) => matchesFieldFilter(property, label) && (!showAiEditedFields || fieldWasAiEdited(property));
|
|
113752
|
+
const shouldRenderField = (property, label) => matchesFieldFilter(property, label) && (!showAiEditedFields || fieldWasAiEdited(property)) && (fieldHasPendingAiApproval(property) || !hideEmptyFields || hasFieldValue(contextEntity == null ? void 0 : contextEntity[property]));
|
|
113753
|
+
const entityPropertyNames = useMemo$1(() => Array.from(/* @__PURE__ */ new Set([
|
|
113754
|
+
...Object.keys(contextEntity ?? {}),
|
|
113755
|
+
...pendingAiApprovalProperties,
|
|
113756
|
+
...pendingDeletedEntityReviewProperties,
|
|
113757
|
+
...approvedAiApprovalProperties
|
|
113758
|
+
])).sort(), [approvedAiApprovalProperties, contextEntity, pendingAiApprovalProperties, pendingDeletedEntityReviewProperties]);
|
|
112284
113759
|
const editorScrollClassName = `describo-editor-scroll ${quickSettingsVisible ? "px-3 pb-3 pt-0" : "p-3"}`;
|
|
112285
113760
|
if (!entity || !entity["@id"]) {
|
|
112286
113761
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "No entity selected" });
|
|
@@ -112308,7 +113783,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112308
113783
|
style: { marginRight: 8 },
|
|
112309
113784
|
onClick: () => setQuickSettingsVisible((visible) => !visible),
|
|
112310
113785
|
type: quickSettingsVisible ? "primary" : "default",
|
|
112311
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$
|
|
113786
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$8, {}),
|
|
112312
113787
|
"aria-label": "Quick filter settings",
|
|
112313
113788
|
"aria-pressed": quickSettingsVisible
|
|
112314
113789
|
}
|
|
@@ -112328,13 +113803,31 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112328
113803
|
}
|
|
112329
113804
|
)
|
|
112330
113805
|
] }),
|
|
112331
|
-
|
|
113806
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113807
|
+
AiApprovalStepperHeader,
|
|
113808
|
+
{
|
|
113809
|
+
activeIndex: selectedAiApprovalIndex,
|
|
113810
|
+
pendingCount: pendingAiApprovals.length,
|
|
113811
|
+
activePropertyLabel: selectedAiApprovalProperty ? getFieldTitle(selectedAiApprovalProperty) : void 0,
|
|
113812
|
+
remainingEntityCount: pendingOtherAiApprovalEntities.length,
|
|
113813
|
+
remainingFieldCount: pendingOtherAiApprovalFieldCount,
|
|
113814
|
+
readonly: (_c = state.configuration) == null ? void 0 : _c.readonly,
|
|
113815
|
+
canGoPrevious: selectedAiApprovalIndex > 0,
|
|
113816
|
+
canGoNext: selectedAiApprovalIndex < pendingAiApprovals.length - 1,
|
|
113817
|
+
onPrevious: () => navigateToAiApproval(selectedAiApprovalIndex - 1),
|
|
113818
|
+
onNext: () => navigateToAiApproval(selectedAiApprovalIndex + 1),
|
|
113819
|
+
onAcceptAll: handleAcceptAllAiApprovals,
|
|
113820
|
+
onRejectAll: handleRejectAllAiApprovals,
|
|
113821
|
+
onReviewNextEntity: handleReviewNextAiApprovalEntity
|
|
113822
|
+
}
|
|
113823
|
+
),
|
|
113824
|
+
!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) => {
|
|
112332
113825
|
var _a3;
|
|
112333
113826
|
const w2 = ((_a3 = state.configuration) == null ? void 0 : _a3.tabLocation) === "left" ? sizes2[0] : sizes2[1];
|
|
112334
113827
|
setTabPaneWidth(w2);
|
|
112335
113828
|
persistTabWidth(w2);
|
|
112336
113829
|
}, children: [
|
|
112337
|
-
((
|
|
113830
|
+
((_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: [
|
|
112338
113831
|
renderProfileActionRail(),
|
|
112339
113832
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute right-0 top-0 bottom-0 w-1 bg-slate-300 opacity-0 group-hover:opacity-100" })
|
|
112340
113833
|
] }) }),
|
|
@@ -112344,11 +113837,20 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112344
113837
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112345
113838
|
"div",
|
|
112346
113839
|
{
|
|
112347
|
-
|
|
112348
|
-
|
|
113840
|
+
"data-recrate-property": "@id",
|
|
113841
|
+
className: `flex-grow describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded p-1 my-1" : ""} ${selectedAiApprovalProperty === "@id" ? "describo-ai-review-current" : ""}`,
|
|
113842
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113843
|
+
EntityId,
|
|
113844
|
+
{
|
|
113845
|
+
entity: contextEntity,
|
|
113846
|
+
onUpdate: handleUpdateCoreProperty,
|
|
113847
|
+
aiEdited: fieldWasAiEdited("@id"),
|
|
113848
|
+
aiEditedVariant: fieldAiEditedVariant("@id")
|
|
113849
|
+
}
|
|
113850
|
+
)
|
|
112349
113851
|
}
|
|
112350
113852
|
),
|
|
112351
|
-
!((
|
|
113853
|
+
!((_g = state.configuration) == null ? void 0 : _g.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112352
113854
|
"button",
|
|
112353
113855
|
{
|
|
112354
113856
|
className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",
|
|
@@ -112357,7 +113859,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112357
113859
|
}
|
|
112358
113860
|
)
|
|
112359
113861
|
] }),
|
|
112360
|
-
!shouldRenderCoreField("@id") && !((
|
|
113862
|
+
!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: [
|
|
112361
113863
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
|
|
112362
113864
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112363
113865
|
"button",
|
|
@@ -112368,21 +113870,40 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112368
113870
|
}
|
|
112369
113871
|
)
|
|
112370
113872
|
] }),
|
|
112371
|
-
shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `my-2 p-2 describo-property describo-property-name-type`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113873
|
+
shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `my-2 p-2 describo-property describo-property-name-type ${selectedAiApprovalProperty === "@type" ? "describo-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113874
|
+
EntityType,
|
|
113875
|
+
{
|
|
113876
|
+
entity: contextEntity,
|
|
113877
|
+
onUpdateEntity: handleUpdateCoreProperty,
|
|
113878
|
+
aiEdited: fieldWasAiEdited("@type"),
|
|
113879
|
+
aiEditedVariant: fieldAiEditedVariant("@type")
|
|
113880
|
+
}
|
|
113881
|
+
) }),
|
|
112372
113882
|
shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112373
113883
|
"div",
|
|
112374
113884
|
{
|
|
113885
|
+
"data-recrate-property": "name",
|
|
112375
113886
|
className: `my-2 p-2 describo-property describo-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded" : ""}`,
|
|
112376
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113887
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113888
|
+
EntityName,
|
|
113889
|
+
{
|
|
113890
|
+
entity: contextEntity,
|
|
113891
|
+
onUpdate: handleUpdateCoreProperty,
|
|
113892
|
+
showHelp: showFieldHelp,
|
|
113893
|
+
aiEdited: fieldWasAiEdited("name"),
|
|
113894
|
+
aiEditedVariant: fieldAiEditedVariant("name"),
|
|
113895
|
+
aiReview: getCoreAiReviewProps("name")
|
|
113896
|
+
}
|
|
113897
|
+
)
|
|
112377
113898
|
}
|
|
112378
113899
|
),
|
|
112379
|
-
|
|
113900
|
+
entityPropertyNames.map((property) => {
|
|
112380
113901
|
if (!["@id", "@type", "name", "@reverse"].includes(property) && shouldRenderField(property)) {
|
|
112381
113902
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112382
113903
|
"div",
|
|
112383
113904
|
{
|
|
112384
113905
|
"data-recrate-property": property,
|
|
112385
|
-
className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""}`,
|
|
113906
|
+
className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === property ? "describo-ai-review-current" : ""}`,
|
|
112386
113907
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112387
113908
|
EntityProperty,
|
|
112388
113909
|
{
|
|
@@ -112392,13 +113913,19 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112392
113913
|
highlightRequired: highlightRequiredProperties,
|
|
112393
113914
|
savedProperty: savedProperty === property,
|
|
112394
113915
|
showHelp: showFieldHelp,
|
|
113916
|
+
aiEdited: fieldWasAiEdited(property),
|
|
113917
|
+
aiEditedVariant: fieldAiEditedVariant(property),
|
|
112395
113918
|
onLoadEntity: handleLoadEntityWithContext,
|
|
112396
113919
|
onCreateEntity: handleCreateEntity,
|
|
112397
113920
|
onLinkEntity: handleLinkEntity,
|
|
112398
113921
|
onUnlinkEntity: handleUnlinkEntity,
|
|
112399
113922
|
onCreateProperty: handleCreateProperty,
|
|
112400
113923
|
onSaveProperty: handleUpdateEntity,
|
|
112401
|
-
onDeleteProperty: handleDeleteProperty
|
|
113924
|
+
onDeleteProperty: handleDeleteProperty,
|
|
113925
|
+
onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
|
|
113926
|
+
onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
|
|
113927
|
+
onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
|
|
113928
|
+
onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
|
|
112402
113929
|
}
|
|
112403
113930
|
)
|
|
112404
113931
|
},
|
|
@@ -112408,11 +113935,11 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112408
113935
|
return null;
|
|
112409
113936
|
})
|
|
112410
113937
|
] }) }),
|
|
112411
|
-
((
|
|
113938
|
+
((_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: [
|
|
112412
113939
|
renderProfileActionRail(),
|
|
112413
113940
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-slate-300 opacity-0 group-hover:opacity-100" })
|
|
112414
113941
|
] }) })
|
|
112415
|
-
] }, `untabbed-${(
|
|
113942
|
+
] }, `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: {
|
|
112416
113943
|
flexDirection: "column",
|
|
112417
113944
|
height: scrollViewportHeight ? `${scrollViewportHeight}px` : "calc(100vh - 200px)"
|
|
112418
113945
|
}, children: [
|
|
@@ -112434,11 +113961,20 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112434
113961
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112435
113962
|
"div",
|
|
112436
113963
|
{
|
|
112437
|
-
|
|
112438
|
-
|
|
113964
|
+
"data-recrate-property": "@id",
|
|
113965
|
+
className: `flex-grow describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded p-1 my-1" : ""} ${selectedAiApprovalProperty === "@id" ? "describo-ai-review-current" : ""}`,
|
|
113966
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113967
|
+
EntityId,
|
|
113968
|
+
{
|
|
113969
|
+
entity: contextEntity,
|
|
113970
|
+
onUpdate: handleUpdateCoreProperty,
|
|
113971
|
+
aiEdited: fieldWasAiEdited("@id"),
|
|
113972
|
+
aiEditedVariant: fieldAiEditedVariant("@id")
|
|
113973
|
+
}
|
|
113974
|
+
)
|
|
112439
113975
|
}
|
|
112440
113976
|
),
|
|
112441
|
-
!((
|
|
113977
|
+
!((_k = state.configuration) == null ? void 0 : _k.readonly) && missingRequiredData && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112442
113978
|
"button",
|
|
112443
113979
|
{
|
|
112444
113980
|
className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",
|
|
@@ -112447,7 +113983,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112447
113983
|
}
|
|
112448
113984
|
)
|
|
112449
113985
|
] }),
|
|
112450
|
-
!shouldRenderCoreField("@id") && !((
|
|
113986
|
+
!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: [
|
|
112451
113987
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow" }),
|
|
112452
113988
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112453
113989
|
"button",
|
|
@@ -112458,21 +113994,40 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112458
113994
|
}
|
|
112459
113995
|
)
|
|
112460
113996
|
] }),
|
|
112461
|
-
shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `my-2 p-2 describo-property describo-property-name-type`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113997
|
+
shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `my-2 p-2 describo-property describo-property-name-type ${selectedAiApprovalProperty === "@type" ? "describo-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113998
|
+
EntityType,
|
|
113999
|
+
{
|
|
114000
|
+
entity: contextEntity,
|
|
114001
|
+
onUpdateEntity: handleUpdateCoreProperty,
|
|
114002
|
+
aiEdited: fieldWasAiEdited("@type"),
|
|
114003
|
+
aiEditedVariant: fieldAiEditedVariant("@type")
|
|
114004
|
+
}
|
|
114005
|
+
) }),
|
|
112462
114006
|
shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112463
114007
|
"div",
|
|
112464
114008
|
{
|
|
114009
|
+
"data-recrate-property": "name",
|
|
112465
114010
|
className: `my-2 p-2 describo-property describo-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded p-1 my-1" : ""}`,
|
|
112466
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
114011
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
114012
|
+
EntityName,
|
|
114013
|
+
{
|
|
114014
|
+
entity: contextEntity,
|
|
114015
|
+
onUpdate: handleUpdateCoreProperty,
|
|
114016
|
+
showHelp: showFieldHelp,
|
|
114017
|
+
aiEdited: fieldWasAiEdited("name"),
|
|
114018
|
+
aiEditedVariant: fieldAiEditedVariant("name"),
|
|
114019
|
+
aiReview: getCoreAiReviewProps("name")
|
|
114020
|
+
}
|
|
114021
|
+
)
|
|
112467
114022
|
}
|
|
112468
114023
|
),
|
|
112469
|
-
|
|
114024
|
+
entityPropertyNames.map((property) => {
|
|
112470
114025
|
if (!["@id", "@type", "name", "@reverse"].includes(property) && shouldRenderField(property)) {
|
|
112471
114026
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112472
114027
|
"div",
|
|
112473
114028
|
{
|
|
112474
114029
|
"data-recrate-property": property,
|
|
112475
|
-
className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""}`,
|
|
114030
|
+
className: `${showFieldHelp ? "my-2" : "my-1"} hover:bg-sky-100 ${savedProperty === property ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === property ? "describo-ai-review-current" : ""}`,
|
|
112476
114031
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112477
114032
|
EntityProperty,
|
|
112478
114033
|
{
|
|
@@ -112482,13 +114037,19 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112482
114037
|
highlightRequired: highlightRequiredProperties,
|
|
112483
114038
|
savedProperty: savedProperty === property,
|
|
112484
114039
|
showHelp: showFieldHelp,
|
|
114040
|
+
aiEdited: fieldWasAiEdited(property),
|
|
114041
|
+
aiEditedVariant: fieldAiEditedVariant(property),
|
|
112485
114042
|
onLoadEntity: handleLoadEntityWithContext,
|
|
112486
114043
|
onCreateEntity: handleCreateEntity,
|
|
112487
114044
|
onLinkEntity: handleLinkEntity,
|
|
112488
114045
|
onUnlinkEntity: handleUnlinkEntity,
|
|
112489
114046
|
onCreateProperty: handleCreateProperty,
|
|
112490
114047
|
onSaveProperty: handleUpdateEntity,
|
|
112491
|
-
onDeleteProperty: handleDeleteProperty
|
|
114048
|
+
onDeleteProperty: handleDeleteProperty,
|
|
114049
|
+
onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
|
|
114050
|
+
onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
|
|
114051
|
+
onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
|
|
114052
|
+
onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
|
|
112492
114053
|
}
|
|
112493
114054
|
)
|
|
112494
114055
|
},
|
|
@@ -112511,7 +114072,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112511
114072
|
] }) }),
|
|
112512
114073
|
/* @__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: [
|
|
112513
114074
|
renderQuickSettingsHeader(),
|
|
112514
|
-
!((
|
|
114075
|
+
!((_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(
|
|
112515
114076
|
"button",
|
|
112516
114077
|
{
|
|
112517
114078
|
className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded text-sm",
|
|
@@ -112523,25 +114084,53 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112523
114084
|
shouldRenderCoreField("@id") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112524
114085
|
"div",
|
|
112525
114086
|
{
|
|
112526
|
-
|
|
112527
|
-
|
|
114087
|
+
"data-recrate-property": "@id",
|
|
114088
|
+
className: `p-2 describo-property describo-property-name-id ${savedProperty === "@id" ? "bg-green-200 rounded" : ""} ${selectedAiApprovalProperty === "@id" ? "describo-ai-review-current" : ""}`,
|
|
114089
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
114090
|
+
EntityId,
|
|
114091
|
+
{
|
|
114092
|
+
entity: contextEntity,
|
|
114093
|
+
onUpdate: handleUpdateCoreProperty,
|
|
114094
|
+
aiEdited: fieldWasAiEdited("@id"),
|
|
114095
|
+
aiEditedVariant: fieldAiEditedVariant("@id")
|
|
114096
|
+
}
|
|
114097
|
+
)
|
|
112528
114098
|
}
|
|
112529
114099
|
),
|
|
112530
|
-
shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
114100
|
+
shouldRenderCoreField("@type") && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-recrate-property": "@type", className: `p-2 describo-property describo-property-name-type ${selectedAiApprovalProperty === "@type" ? "describo-ai-review-current" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
114101
|
+
EntityType,
|
|
114102
|
+
{
|
|
114103
|
+
entity: contextEntity,
|
|
114104
|
+
onUpdateEntity: handleUpdateCoreProperty,
|
|
114105
|
+
aiEdited: fieldWasAiEdited("@type"),
|
|
114106
|
+
aiEditedVariant: fieldAiEditedVariant("@type")
|
|
114107
|
+
}
|
|
114108
|
+
) }),
|
|
112531
114109
|
shouldRenderCoreField("name") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112532
114110
|
"div",
|
|
112533
114111
|
{
|
|
114112
|
+
"data-recrate-property": "name",
|
|
112534
114113
|
className: `p-2 describo-property describo-property-name-name ${savedProperty === "name" ? "bg-green-200 rounded" : ""}`,
|
|
112535
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
114114
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
114115
|
+
EntityName,
|
|
114116
|
+
{
|
|
114117
|
+
entity: contextEntity,
|
|
114118
|
+
onUpdate: handleUpdateCoreProperty,
|
|
114119
|
+
showHelp: showFieldHelp,
|
|
114120
|
+
aiEdited: fieldWasAiEdited("name"),
|
|
114121
|
+
aiEditedVariant: fieldAiEditedVariant("name"),
|
|
114122
|
+
aiReview: getCoreAiReviewProps("name")
|
|
114123
|
+
}
|
|
114124
|
+
)
|
|
112536
114125
|
}
|
|
112537
114126
|
),
|
|
112538
|
-
(
|
|
114127
|
+
(_o = tabs.find((tab) => tab.name === "about")) == null ? void 0 : _o.inputs.map((input) => {
|
|
112539
114128
|
if (!["@id", "@type", "name", "@reverse"].includes(input.name) && shouldRenderField(input.name, input.label)) {
|
|
112540
114129
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112541
114130
|
"div",
|
|
112542
114131
|
{
|
|
112543
114132
|
"data-recrate-property": input.name,
|
|
112544
|
-
className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""}`,
|
|
114133
|
+
className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === input.name ? "describo-ai-review-current" : ""}`,
|
|
112545
114134
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112546
114135
|
EntityProperty,
|
|
112547
114136
|
{
|
|
@@ -112551,13 +114140,19 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112551
114140
|
highlightRequired: highlightRequiredProperties,
|
|
112552
114141
|
savedProperty: savedProperty === input.name,
|
|
112553
114142
|
showHelp: showFieldHelp,
|
|
114143
|
+
aiEdited: fieldWasAiEdited(input.name),
|
|
114144
|
+
aiEditedVariant: fieldAiEditedVariant(input.name),
|
|
112554
114145
|
onLoadEntity: handleLoadEntityWithContext,
|
|
112555
114146
|
onCreateEntity: handleCreateEntity,
|
|
112556
114147
|
onLinkEntity: handleLinkEntity,
|
|
112557
114148
|
onUnlinkEntity: handleUnlinkEntity,
|
|
112558
114149
|
onCreateProperty: handleCreateProperty,
|
|
112559
114150
|
onSaveProperty: handleUpdateEntity,
|
|
112560
|
-
onDeleteProperty: handleDeleteProperty
|
|
114151
|
+
onDeleteProperty: handleDeleteProperty,
|
|
114152
|
+
onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
|
|
114153
|
+
onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
|
|
114154
|
+
onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
|
|
114155
|
+
onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
|
|
112561
114156
|
}
|
|
112562
114157
|
)
|
|
112563
114158
|
},
|
|
@@ -112575,7 +114170,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112575
114170
|
"div",
|
|
112576
114171
|
{
|
|
112577
114172
|
"data-recrate-property": input.name,
|
|
112578
|
-
className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""}`,
|
|
114173
|
+
className: `${showFieldHelp ? "p-2" : "px-2 py-1"} hover:bg-sky-100 ${savedProperty === input.name ? "bg-green-200 hover:bg-green-200" : ""} ${selectedAiApprovalProperty === input.name ? "describo-ai-review-current" : ""}`,
|
|
112579
114174
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112580
114175
|
EntityProperty,
|
|
112581
114176
|
{
|
|
@@ -112585,13 +114180,19 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112585
114180
|
highlightRequired: highlightRequiredProperties,
|
|
112586
114181
|
savedProperty: savedProperty === input.name,
|
|
112587
114182
|
showHelp: showFieldHelp,
|
|
114183
|
+
aiEdited: fieldWasAiEdited(input.name),
|
|
114184
|
+
aiEditedVariant: fieldAiEditedVariant(input.name),
|
|
112588
114185
|
onLoadEntity: handleLoadEntityWithContext,
|
|
112589
114186
|
onCreateEntity: handleCreateEntity,
|
|
112590
114187
|
onLinkEntity: handleLinkEntity,
|
|
112591
114188
|
onUnlinkEntity: handleUnlinkEntity,
|
|
112592
114189
|
onCreateProperty: handleCreateProperty,
|
|
112593
114190
|
onSaveProperty: handleUpdateEntity,
|
|
112594
|
-
onDeleteProperty: handleDeleteProperty
|
|
114191
|
+
onDeleteProperty: handleDeleteProperty,
|
|
114192
|
+
onAcceptAiEntityDelete: (deletedEntity) => handleAcceptAiEntityDelete(deletedEntity),
|
|
114193
|
+
onRestoreAiDeletedEntity: (deletedEntity) => handleRestoreAiDeletedEntity(deletedEntity),
|
|
114194
|
+
onAcceptAiEntityEdit: (editedEntity) => handleAcceptAiEntityEdit(editedEntity),
|
|
114195
|
+
onRejectAiEntityEdit: (editedEntity) => handleRejectAiEntityEdit(editedEntity)
|
|
112595
114196
|
}
|
|
112596
114197
|
)
|
|
112597
114198
|
},
|
|
@@ -112604,7 +114205,7 @@ const RenderEntity = forwardRef((props, ref) => {
|
|
|
112604
114205
|
return null;
|
|
112605
114206
|
})
|
|
112606
114207
|
] }) })
|
|
112607
|
-
] }, `tabbed-${(
|
|
114208
|
+
] }, `tabbed-${(_p = state.configuration) == null ? void 0 : _p.tabLocation}-${iconView ? "icon" : "label"}`) })
|
|
112608
114209
|
] }),
|
|
112609
114210
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112610
114211
|
Drawer2,
|
|
@@ -120954,13 +122555,126 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
|
|
|
120954
122555
|
}) : null
|
|
120955
122556
|
);
|
|
120956
122557
|
var CacheProvider = EmotionCacheContext.Provider;
|
|
120957
|
-
const version = "0.1.
|
|
122558
|
+
const version = "0.1.32-test2";
|
|
120958
122559
|
const pkg = {
|
|
120959
122560
|
version
|
|
120960
122561
|
};
|
|
120961
122562
|
const antdCache = createScopedCache("recrate");
|
|
122563
|
+
const markApprovalRecordsApproved = (approvalState, entityId, propertyName2, decision) => {
|
|
122564
|
+
const approvalRecords = [];
|
|
122565
|
+
let changed = false;
|
|
122566
|
+
const shouldRemove = decision === "reject" || decision === "manual-edit";
|
|
122567
|
+
const hasApprovalRecords = (entityApproval) => Array.isArray(entityApproval == null ? void 0 : entityApproval.approval) && entityApproval.approval.length > 0;
|
|
122568
|
+
const updateEntityApproval = (entityApproval) => {
|
|
122569
|
+
if (!entityApproval || !entityIdsMatch(entityApproval["@id"], entityId) || !Array.isArray(entityApproval.approval)) {
|
|
122570
|
+
return entityApproval;
|
|
122571
|
+
}
|
|
122572
|
+
let entityChanged = false;
|
|
122573
|
+
const nextApprovalRecords = entityApproval.approval.flatMap((approvalRecord) => {
|
|
122574
|
+
if ((approvalRecord == null ? void 0 : approvalRecord.propertyName) !== propertyName2) {
|
|
122575
|
+
return [approvalRecord];
|
|
122576
|
+
}
|
|
122577
|
+
if (shouldRemove) {
|
|
122578
|
+
approvalRecords.push(approvalRecord);
|
|
122579
|
+
entityChanged = true;
|
|
122580
|
+
return [];
|
|
122581
|
+
}
|
|
122582
|
+
const nextApprovalRecord = { ...approvalRecord, approved: true };
|
|
122583
|
+
approvalRecords.push(nextApprovalRecord);
|
|
122584
|
+
if (approvalRecord.approved !== true) {
|
|
122585
|
+
entityChanged = true;
|
|
122586
|
+
}
|
|
122587
|
+
return [nextApprovalRecord];
|
|
122588
|
+
});
|
|
122589
|
+
if (!entityChanged) return entityApproval;
|
|
122590
|
+
changed = true;
|
|
122591
|
+
return {
|
|
122592
|
+
...entityApproval,
|
|
122593
|
+
approval: nextApprovalRecords
|
|
122594
|
+
};
|
|
122595
|
+
};
|
|
122596
|
+
if (Array.isArray(approvalState)) {
|
|
122597
|
+
const nextApprovalState = approvalState.map(updateEntityApproval).filter(hasApprovalRecords);
|
|
122598
|
+
return { nextApprovalState, approvalRecords, changed };
|
|
122599
|
+
}
|
|
122600
|
+
if (approvalState && typeof approvalState === "object") {
|
|
122601
|
+
if (Array.isArray(approvalState.approval)) {
|
|
122602
|
+
const nextApprovalState = updateEntityApproval(approvalState);
|
|
122603
|
+
return {
|
|
122604
|
+
nextApprovalState: hasApprovalRecords(nextApprovalState) ? nextApprovalState : void 0,
|
|
122605
|
+
approvalRecords,
|
|
122606
|
+
changed
|
|
122607
|
+
};
|
|
122608
|
+
}
|
|
122609
|
+
if (Array.isArray(approvalState.items)) {
|
|
122610
|
+
const nextItems = approvalState.items.map(updateEntityApproval).filter(hasApprovalRecords);
|
|
122611
|
+
return {
|
|
122612
|
+
nextApprovalState: changed ? { ...approvalState, items: nextItems } : approvalState,
|
|
122613
|
+
approvalRecords,
|
|
122614
|
+
changed
|
|
122615
|
+
};
|
|
122616
|
+
}
|
|
122617
|
+
}
|
|
122618
|
+
return { nextApprovalState: approvalState, approvalRecords, changed };
|
|
122619
|
+
};
|
|
122620
|
+
const markEntityApprovalRecordsApproved = (approvalState, entityId, decision) => {
|
|
122621
|
+
const approvalRecords = [];
|
|
122622
|
+
let changed = false;
|
|
122623
|
+
const shouldRemove = decision === "reject" || decision === "manual-edit";
|
|
122624
|
+
const hasApprovalRecords = (entityApproval) => Array.isArray(entityApproval == null ? void 0 : entityApproval.approval) && entityApproval.approval.length > 0;
|
|
122625
|
+
const updateEntityApproval = (entityApproval) => {
|
|
122626
|
+
if (!entityApproval || !entityIdsMatch(entityApproval["@id"], entityId) || !Array.isArray(entityApproval.approval)) {
|
|
122627
|
+
return entityApproval;
|
|
122628
|
+
}
|
|
122629
|
+
let entityChanged = false;
|
|
122630
|
+
const nextApprovalRecords = entityApproval.approval.flatMap((approvalRecord) => {
|
|
122631
|
+
if ((approvalRecord == null ? void 0 : approvalRecord.approved) === true || (approvalRecord == null ? void 0 : approvalRecord.approved) === "true") {
|
|
122632
|
+
return [approvalRecord];
|
|
122633
|
+
}
|
|
122634
|
+
if (shouldRemove) {
|
|
122635
|
+
approvalRecords.push(approvalRecord);
|
|
122636
|
+
entityChanged = true;
|
|
122637
|
+
return [];
|
|
122638
|
+
}
|
|
122639
|
+
const nextApprovalRecord = { ...approvalRecord, approved: true };
|
|
122640
|
+
approvalRecords.push(nextApprovalRecord);
|
|
122641
|
+
entityChanged = true;
|
|
122642
|
+
return [nextApprovalRecord];
|
|
122643
|
+
});
|
|
122644
|
+
if (!entityChanged) return entityApproval;
|
|
122645
|
+
changed = true;
|
|
122646
|
+
return {
|
|
122647
|
+
...entityApproval,
|
|
122648
|
+
approval: nextApprovalRecords
|
|
122649
|
+
};
|
|
122650
|
+
};
|
|
122651
|
+
if (Array.isArray(approvalState)) {
|
|
122652
|
+
const nextApprovalState = approvalState.map(updateEntityApproval).filter(hasApprovalRecords);
|
|
122653
|
+
return { nextApprovalState, approvalRecords, changed };
|
|
122654
|
+
}
|
|
122655
|
+
if (approvalState && typeof approvalState === "object") {
|
|
122656
|
+
if (Array.isArray(approvalState.approval)) {
|
|
122657
|
+
const nextApprovalState = updateEntityApproval(approvalState);
|
|
122658
|
+
return {
|
|
122659
|
+
nextApprovalState: hasApprovalRecords(nextApprovalState) ? nextApprovalState : void 0,
|
|
122660
|
+
approvalRecords,
|
|
122661
|
+
changed
|
|
122662
|
+
};
|
|
122663
|
+
}
|
|
122664
|
+
if (Array.isArray(approvalState.items)) {
|
|
122665
|
+
const nextItems = approvalState.items.map(updateEntityApproval).filter(hasApprovalRecords);
|
|
122666
|
+
return {
|
|
122667
|
+
nextApprovalState: changed ? { ...approvalState, items: nextItems } : approvalState,
|
|
122668
|
+
approvalRecords,
|
|
122669
|
+
changed
|
|
122670
|
+
};
|
|
122671
|
+
}
|
|
122672
|
+
}
|
|
122673
|
+
return { nextApprovalState: approvalState, approvalRecords, changed };
|
|
122674
|
+
};
|
|
120962
122675
|
const ProfileManagerContext = React__default.createContext(null);
|
|
120963
122676
|
const CrateManagerContext = React__default.createContext(null);
|
|
122677
|
+
const RoCrateApprovalContext = React__default.createContext(null);
|
|
120964
122678
|
const LookupsContext = React__default.createContext(null);
|
|
120965
122679
|
function DescriboCrateBuilder(props) {
|
|
120966
122680
|
const { stateScopeKey } = props;
|
|
@@ -120969,6 +122683,7 @@ function DescriboCrateBuilder(props) {
|
|
|
120969
122683
|
function DescriboCrateBuilderInner(props) {
|
|
120970
122684
|
const {
|
|
120971
122685
|
crate,
|
|
122686
|
+
roCrateApproval,
|
|
120972
122687
|
profile,
|
|
120973
122688
|
entityId,
|
|
120974
122689
|
lookup,
|
|
@@ -120994,6 +122709,7 @@ function DescriboCrateBuilderInner(props) {
|
|
|
120994
122709
|
onWarning,
|
|
120995
122710
|
onNavigation,
|
|
120996
122711
|
onSaveCrate,
|
|
122712
|
+
onSaveRoCrateApproval,
|
|
120997
122713
|
onSaveEntityTemplate,
|
|
120998
122714
|
onAddNewProfileRequest,
|
|
120999
122715
|
onRemoveProfile
|
|
@@ -121004,10 +122720,58 @@ function DescriboCrateBuilderInner(props) {
|
|
|
121004
122720
|
const [cm, setCm] = useState(null);
|
|
121005
122721
|
const [pm, setPm] = useState(null);
|
|
121006
122722
|
const [lookups, setLookups] = useState(null);
|
|
122723
|
+
const [approvalState, setApprovalState] = useState(roCrateApproval);
|
|
121007
122724
|
const state = useStateStore();
|
|
121008
122725
|
const renderEntityRef = useRef(null);
|
|
121009
122726
|
const keys2 = useRef({ cm: 0, pm: 0, lookups: 0 });
|
|
121010
122727
|
const lastHandledEntityIdRef = useRef(void 0);
|
|
122728
|
+
useEffect(() => {
|
|
122729
|
+
setApprovalState(roCrateApproval);
|
|
122730
|
+
}, [roCrateApproval]);
|
|
122731
|
+
const markApprovalPropertyApproved = useCallback((params) => {
|
|
122732
|
+
const { entityId: entityId2, propertyName: propertyName2, decision, value } = params;
|
|
122733
|
+
if (!entityId2 || !propertyName2) return;
|
|
122734
|
+
const { nextApprovalState, approvalRecords, changed } = markApprovalRecordsApproved(
|
|
122735
|
+
approvalState,
|
|
122736
|
+
entityId2,
|
|
122737
|
+
propertyName2,
|
|
122738
|
+
decision
|
|
122739
|
+
);
|
|
122740
|
+
if (!changed && approvalRecords.length === 0) return;
|
|
122741
|
+
setApprovalState(nextApprovalState);
|
|
122742
|
+
onSaveRoCrateApproval == null ? void 0 : onSaveRoCrateApproval({
|
|
122743
|
+
roCrateApproval: nextApprovalState,
|
|
122744
|
+
entityId: entityId2,
|
|
122745
|
+
propertyName: propertyName2,
|
|
122746
|
+
decision,
|
|
122747
|
+
approvalRecords,
|
|
122748
|
+
value
|
|
122749
|
+
});
|
|
122750
|
+
}, [approvalState, onSaveRoCrateApproval]);
|
|
122751
|
+
const markApprovalEntityApproved = useCallback((params) => {
|
|
122752
|
+
const { entityId: entityId2, decision, value } = params;
|
|
122753
|
+
if (!entityId2) return;
|
|
122754
|
+
const { nextApprovalState, approvalRecords, changed } = markEntityApprovalRecordsApproved(
|
|
122755
|
+
approvalState,
|
|
122756
|
+
entityId2,
|
|
122757
|
+
decision
|
|
122758
|
+
);
|
|
122759
|
+
if (!changed && approvalRecords.length === 0) return;
|
|
122760
|
+
setApprovalState(nextApprovalState);
|
|
122761
|
+
onSaveRoCrateApproval == null ? void 0 : onSaveRoCrateApproval({
|
|
122762
|
+
roCrateApproval: nextApprovalState,
|
|
122763
|
+
entityId: entityId2,
|
|
122764
|
+
propertyName: "*",
|
|
122765
|
+
decision,
|
|
122766
|
+
approvalRecords,
|
|
122767
|
+
value
|
|
122768
|
+
});
|
|
122769
|
+
}, [approvalState, onSaveRoCrateApproval]);
|
|
122770
|
+
const approvalContextValue = useMemo$1(() => ({
|
|
122771
|
+
roCrateApproval: approvalState,
|
|
122772
|
+
markApprovalPropertyApproved,
|
|
122773
|
+
markApprovalEntityApproved
|
|
122774
|
+
}), [approvalState, markApprovalEntityApproved, markApprovalPropertyApproved]);
|
|
121011
122775
|
const configuration = useMemo$1(() => {
|
|
121012
122776
|
const config2 = {
|
|
121013
122777
|
enableContextEditor,
|
|
@@ -121147,7 +122911,7 @@ function DescriboCrateBuilderInner(props) {
|
|
|
121147
122911
|
console.error("Error in handleSetCurrentEntity:", error22);
|
|
121148
122912
|
onError == null ? void 0 : onError({ error: "Failed to set entity" });
|
|
121149
122913
|
}
|
|
121150
|
-
}, [cm, onNavigation]);
|
|
122914
|
+
}, [cm, onNavigation, state.editorState]);
|
|
121151
122915
|
const handleAddProfileRequest = useCallback((requested) => {
|
|
121152
122916
|
try {
|
|
121153
122917
|
onAddNewProfileRequest == null ? void 0 : onAddNewProfileRequest(requested);
|
|
@@ -121199,7 +122963,7 @@ function DescriboCrateBuilderInner(props) {
|
|
|
121199
122963
|
onSaveCrate == null ? void 0 : onSaveCrate({ crate: exported, entityId: currentEntityId });
|
|
121200
122964
|
};
|
|
121201
122965
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate", children: [
|
|
121202
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CacheProvider, { value: antdCache, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, { className: "recrate-ant", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileManagerContext.Provider, { value: pm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrateManagerContext.Provider, { value: cm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LookupsContext.Provider, { value: lookups, children: ready && !error2 && contextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
122966
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CacheProvider, { value: antdCache, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, { className: "recrate-ant", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileManagerContext.Provider, { value: pm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrateManagerContext.Provider, { value: cm, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RoCrateApprovalContext.Provider, { value: approvalContextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LookupsContext.Provider, { value: lookups, children: ready && !error2 && contextEntity && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
121203
122967
|
RenderEntity,
|
|
121204
122968
|
{
|
|
121205
122969
|
ref: renderEntityRef,
|
|
@@ -121212,7 +122976,7 @@ function DescriboCrateBuilderInner(props) {
|
|
|
121212
122976
|
onAddNewProfileRequest: handleAddProfileRequest,
|
|
121213
122977
|
onRemoveProfile
|
|
121214
122978
|
}
|
|
121215
|
-
) }) }) }) }) }) }),
|
|
122979
|
+
) }) }) }) }) }) }) }),
|
|
121216
122980
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pointer-events-none fixed bottom-2 right-2 z-50 text-xs text-gray-400", children: [
|
|
121217
122981
|
"v",
|
|
121218
122982
|
pkg.version
|