@arpproject/recrate 0.1.15 → 0.1.17

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.
@@ -30,6 +30,7 @@ export interface DescriboCrateBuilderProps {
30
30
  }) => void;
31
31
  onSaveCrate?: (saveData: {
32
32
  crate: any;
33
+ entityId?: string;
33
34
  }) => void;
34
35
  onSaveEntityTemplate?: (entity: any) => void;
35
36
  onAddNewProfileRequest?: (requested: boolean) => void;
@@ -6164,7 +6164,7 @@ function genStyleUtils(config2) {
6164
6164
  };
6165
6165
  }
6166
6166
  const PresetColors = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
6167
- const version$2 = "5.29.1";
6167
+ const version$2 = "5.29.3";
6168
6168
  function isStableColor(color) {
6169
6169
  return color >= 0 && color <= 255;
6170
6170
  }
@@ -12413,20 +12413,25 @@ const InternalCompoundedButton = /* @__PURE__ */ React__default.forwardRef((prop
12413
12413
  const fullStyle = Object.assign(Object.assign({}, contextStyle), customStyle);
12414
12414
  const iconClasses = classNames(customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.icon, contextClassNames.icon);
12415
12415
  const iconStyle = Object.assign(Object.assign({}, (styles2 === null || styles2 === void 0 ? void 0 : styles2.icon) || {}), contextStyles.icon || {});
12416
- const iconNode = icon2 && !innerLoading ? /* @__PURE__ */ React__default.createElement(IconWrapper, {
12416
+ const iconWrapperElement = (child) => /* @__PURE__ */ React__default.createElement(IconWrapper, {
12417
12417
  prefixCls,
12418
12418
  className: iconClasses,
12419
12419
  style: iconStyle
12420
- }, icon2) : loading && typeof loading === "object" && loading.icon ? /* @__PURE__ */ React__default.createElement(IconWrapper, {
12421
- prefixCls,
12422
- className: iconClasses,
12423
- style: iconStyle
12424
- }, loading.icon) : /* @__PURE__ */ React__default.createElement(DefaultLoadingIcon, {
12420
+ }, child);
12421
+ const defaultLoadingIconElement = () => /* @__PURE__ */ React__default.createElement(DefaultLoadingIcon, {
12425
12422
  existIcon: !!icon2,
12426
12423
  prefixCls,
12427
12424
  loading: innerLoading,
12428
12425
  mount: isMountRef.current
12429
12426
  });
12427
+ let iconNode;
12428
+ if (icon2 && !innerLoading) {
12429
+ iconNode = iconWrapperElement(icon2);
12430
+ } else if (loading && typeof loading === "object" && loading.icon) {
12431
+ iconNode = iconWrapperElement(loading.icon);
12432
+ } else {
12433
+ iconNode = defaultLoadingIconElement();
12434
+ }
12430
12435
  const kids = children || children === 0 ? spaceChildren(children, needInserted && mergedInsertSpace) : null;
12431
12436
  if (linkButtonRestProps.href !== void 0) {
12432
12437
  return wrapCSSVar(/* @__PURE__ */ React__default.createElement("a", Object.assign({}, linkButtonRestProps, {
@@ -18400,18 +18405,18 @@ const genNoticeStyle = (token2) => {
18400
18405
  borderRadius: borderRadiusLG,
18401
18406
  overflow: "hidden",
18402
18407
  // Type-specific background colors
18403
- "&-success": {
18408
+ "&-success": colorSuccessBg ? {
18404
18409
  background: colorSuccessBg
18405
- },
18406
- "&-error": {
18410
+ } : {},
18411
+ "&-error": colorErrorBg ? {
18407
18412
  background: colorErrorBg
18408
- },
18409
- "&-info": {
18413
+ } : {},
18414
+ "&-info": colorInfoBg ? {
18410
18415
  background: colorInfoBg
18411
- },
18412
- "&-warning": {
18416
+ } : {},
18417
+ "&-warning": colorWarningBg ? {
18413
18418
  background: colorWarningBg
18414
- }
18419
+ } : {}
18415
18420
  },
18416
18421
  [`${noticeCls}-message`]: {
18417
18422
  color: colorTextHeading,
@@ -18592,10 +18597,13 @@ const genNotificationStyle = (token2) => {
18592
18597
  const prepareComponentToken$h = (token2) => ({
18593
18598
  zIndexPopup: token2.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
18594
18599
  width: 384,
18595
- colorSuccessBg: token2.colorSuccessBg,
18596
- colorErrorBg: token2.colorErrorBg,
18597
- colorInfoBg: token2.colorInfoBg,
18598
- colorWarningBg: token2.colorWarningBg
18600
+ // Fix notification background color issue
18601
+ // https://github.com/ant-design/ant-design/issues/55649
18602
+ // https://github.com/ant-design/ant-design/issues/56055
18603
+ colorSuccessBg: void 0,
18604
+ colorErrorBg: void 0,
18605
+ colorInfoBg: void 0,
18606
+ colorWarningBg: void 0
18599
18607
  });
18600
18608
  const prepareNotificationToken = (token2) => {
18601
18609
  const notificationPaddingVertical = token2.paddingMD;
@@ -41624,15 +41632,19 @@ const Input$1 = /* @__PURE__ */ forwardRef((props, ref) => {
41624
41632
  rootClassName,
41625
41633
  onChange: onChange2,
41626
41634
  classNames: classNames$1,
41627
- variant: customVariant
41628
- } = props, rest = __rest$q(props, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant"]);
41635
+ variant: customVariant,
41636
+ _skipAddonWarning
41637
+ } = props, rest = __rest$q(props, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant", "_skipAddonWarning"]);
41629
41638
  if (process.env.NODE_ENV !== "production") {
41630
41639
  const {
41631
41640
  deprecated
41632
41641
  } = devUseWarning("Input");
41633
- [["bordered", "variant"], ["addonAfter", "Space.Compact"], ["addonBefore", "Space.Compact"]].forEach(([prop, newProp]) => {
41634
- deprecated(!(prop in props), prop, newProp);
41635
- });
41642
+ deprecated(!("bordered" in props), "bordered", "variant");
41643
+ if (!_skipAddonWarning) {
41644
+ [["addonAfter", "Space.Compact"], ["addonBefore", "Space.Compact"]].forEach(([prop, newProp]) => {
41645
+ deprecated(!(prop in props), prop, newProp);
41646
+ });
41647
+ }
41636
41648
  }
41637
41649
  const {
41638
41650
  getPrefixCls,
@@ -45657,7 +45669,8 @@ const Search = /* @__PURE__ */ React.forwardRef((props, ref) => {
45657
45669
  addonAfter: button,
45658
45670
  suffix,
45659
45671
  onChange: onChange2,
45660
- disabled: disabled2
45672
+ disabled: disabled2,
45673
+ _skipAddonWarning: true
45661
45674
  });
45662
45675
  return /* @__PURE__ */ React.createElement(Input$1, Object.assign({
45663
45676
  ref: composeRef(inputRef, ref)
@@ -54411,7 +54424,7 @@ function requireLodash() {
54411
54424
  (function(module2, exports$1) {
54412
54425
  (function() {
54413
54426
  var undefined$1;
54414
- var VERSION = "4.17.21";
54427
+ var VERSION = "4.17.23";
54415
54428
  var LARGE_ARRAY_SIZE = 200;
54416
54429
  var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
54417
54430
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
@@ -56339,8 +56352,28 @@ function requireLodash() {
56339
56352
  }
56340
56353
  function baseUnset(object4, path2) {
56341
56354
  path2 = castPath(path2, object4);
56342
- object4 = parent(object4, path2);
56343
- return object4 == null || delete object4[toKey(last(path2))];
56355
+ var index2 = -1, length2 = path2.length;
56356
+ if (!length2) {
56357
+ return true;
56358
+ }
56359
+ var isRootPrimitive = object4 == null || typeof object4 !== "object" && typeof object4 !== "function";
56360
+ while (++index2 < length2) {
56361
+ var key = path2[index2];
56362
+ if (typeof key !== "string") {
56363
+ continue;
56364
+ }
56365
+ if (key === "__proto__" && !hasOwnProperty.call(object4, "__proto__")) {
56366
+ return false;
56367
+ }
56368
+ if (key === "constructor" && index2 + 1 < length2 && typeof path2[index2 + 1] === "string" && path2[index2 + 1] === "prototype") {
56369
+ if (isRootPrimitive && index2 === 0) {
56370
+ continue;
56371
+ }
56372
+ return false;
56373
+ }
56374
+ }
56375
+ var obj = parent(object4, path2);
56376
+ return obj == null || delete obj[toKey(last(path2))];
56344
56377
  }
56345
56378
  function baseUpdate(object4, path2, updater, customizer) {
56346
56379
  return baseSet(object4, path2, updater(baseGet(object4, path2)), customizer);
@@ -106585,7 +106618,6 @@ const RenderControls = ({
106585
106618
  }) => {
106586
106619
  var _a2, _b, _c, _d, _e2, _f;
106587
106620
  const { t: t2 } = useTranslation();
106588
- const profileManager = useContext(ProfileManagerContext);
106589
106621
  const state = useStateStore();
106590
106622
  const [dialogs, setDialogs] = useState({
106591
106623
  previewCrate: false,
@@ -106595,22 +106627,11 @@ const RenderControls = ({
106595
106627
  saveEntityAsTemplate: false,
106596
106628
  deleteConfirm: false
106597
106629
  });
106598
- const [definition, setDefinition] = useState({});
106599
106630
  const isRootDataset = useMemo$1(() => entity["@id"] === "./", [entity]);
106600
106631
  const isRootDescriptor = useMemo$1(
106601
106632
  () => entity["@id"] === "ro-crate-metadata.json" && entity["@type"].includes("CreativeWork"),
106602
106633
  [entity]
106603
106634
  );
106604
- useEffect(() => {
106605
- loadEntityDefinition();
106606
- }, [profileManager == null ? void 0 : profileManager.$key, entity["@id"]]);
106607
- const loadEntityDefinition = () => {
106608
- if (!(entity == null ? void 0 : entity["@type"]) || !(profileManager == null ? void 0 : profileManager.getTypeDefinition)) {
106609
- setDefinition("inherit");
106610
- } else {
106611
- setDefinition(profileManager.getTypeDefinition({ entity }));
106612
- }
106613
- };
106614
106635
  const toggle = (dialog) => {
106615
106636
  setDialogs((prev2) => {
106616
106637
  const newState = { ...prev2 };
@@ -106681,7 +106702,6 @@ const RenderControls = ({
106681
106702
  {
106682
106703
  onClick: () => toggle("addProperty"),
106683
106704
  type: "primary",
106684
- disabled: definition !== "inherit",
106685
106705
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$m, {}),
106686
106706
  children: t2("add_label")
106687
106707
  }
@@ -119500,7 +119520,7 @@ var EmotionCacheContext = /* @__PURE__ */ React.createContext(
119500
119520
  }) : null
119501
119521
  );
119502
119522
  var CacheProvider = EmotionCacheContext.Provider;
119503
- const version = "0.1.15";
119523
+ const version = "0.1.17";
119504
119524
  const pkg = {
119505
119525
  version
119506
119526
  };
@@ -119707,7 +119727,8 @@ function DescriboCrateBuilder(props) {
119707
119727
  cm.purgeUnlinkedEntities();
119708
119728
  }
119709
119729
  const exported = cm.exportCrate();
119710
- onSaveCrate == null ? void 0 : onSaveCrate({ crate: exported });
119730
+ const currentEntityId = typeof (contextEntity == null ? void 0 : contextEntity["@id"]) === "string" ? contextEntity["@id"] : void 0;
119731
+ onSaveCrate == null ? void 0 : onSaveCrate({ crate: exported, entityId: currentEntityId });
119711
119732
  };
119712
119733
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "recrate", children: [
119713
119734
  /* @__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(
package/dist/types.d.ts CHANGED
@@ -27,6 +27,7 @@ export type DescriboCrateBuilderProps = {
27
27
  onError?: (message: string) => void;
28
28
  onSaveCrate?: (saveData: {
29
29
  crate: JSONObject;
30
+ entityId?: string;
30
31
  }) => void;
31
32
  onSaveCrateAsTemplate?: (name: string, crate: JSONObject) => void;
32
33
  onSaveEntityAsTemplate?: (name: string, entity: JSONObject) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arpproject/recrate",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "main": "./dist/recrate.es.js",
6
6
  "module": "./dist/recrate.es.js",