@yklyklpackages/message-card 0.6.1 → 0.6.3

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/index.mjs CHANGED
@@ -2030,7 +2030,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
2030
2030
  var ys = arrObjKeys(obj, inspect2);
2031
2031
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2032
2032
  var protoTag = obj instanceof Object ? "" : "null prototype";
2033
- var stringTag = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
2033
+ var stringTag = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
2034
2034
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
2035
2035
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
2036
2036
  if (ys.length === 0) {
@@ -2055,25 +2055,25 @@ function canTrustToString(obj) {
2055
2055
  return !toStringTag$1 || !(typeof obj === "object" && (toStringTag$1 in obj || typeof obj[toStringTag$1] !== "undefined"));
2056
2056
  }
2057
2057
  function isArray$4(obj) {
2058
- return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
2058
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
2059
2059
  }
2060
2060
  function isDate$1(obj) {
2061
- return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
2061
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
2062
2062
  }
2063
2063
  function isRegExp$2(obj) {
2064
- return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
2064
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
2065
2065
  }
2066
2066
  function isError(obj) {
2067
- return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
2067
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
2068
2068
  }
2069
2069
  function isString$2(obj) {
2070
- return toStr$1(obj) === "[object String]" && canTrustToString(obj);
2070
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
2071
2071
  }
2072
2072
  function isNumber$1(obj) {
2073
- return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
2073
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
2074
2074
  }
2075
2075
  function isBoolean$1(obj) {
2076
- return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
2076
+ return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
2077
2077
  }
2078
2078
  function isSymbol(obj) {
2079
2079
  if (hasShammedSymbols) {
@@ -2109,7 +2109,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
2109
2109
  function has$3(obj, key) {
2110
2110
  return hasOwn$1.call(obj, key);
2111
2111
  }
2112
- function toStr$1(obj) {
2112
+ function toStr(obj) {
2113
2113
  return objectToString.call(obj);
2114
2114
  }
2115
2115
  function nameOf(f) {
@@ -2418,7 +2418,7 @@ var syntax = SyntaxError;
2418
2418
  var uri = URIError;
2419
2419
  var abs$2 = Math.abs;
2420
2420
  var floor$1 = Math.floor;
2421
- var max$2 = Math.max;
2421
+ var max$1 = Math.max;
2422
2422
  var min$1 = Math.min;
2423
2423
  var pow$1 = Math.pow;
2424
2424
  var round$2 = Math.round;
@@ -2547,78 +2547,99 @@ function requireObject_getPrototypeOf() {
2547
2547
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
2548
2548
  return Object_getPrototypeOf;
2549
2549
  }
2550
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
2551
- var toStr = Object.prototype.toString;
2552
- var max$1 = Math.max;
2553
- var funcType = "[object Function]";
2554
- var concatty = function concatty2(a, b) {
2555
- var arr = [];
2556
- for (var i = 0; i < a.length; i += 1) {
2557
- arr[i] = a[i];
2558
- }
2559
- for (var j2 = 0; j2 < b.length; j2 += 1) {
2560
- arr[j2 + a.length] = b[j2];
2561
- }
2562
- return arr;
2563
- };
2564
- var slicy = function slicy2(arrLike, offset) {
2565
- var arr = [];
2566
- for (var i = offset, j2 = 0; i < arrLike.length; i += 1, j2 += 1) {
2567
- arr[j2] = arrLike[i];
2568
- }
2569
- return arr;
2570
- };
2571
- var joiny = function(arr, joiner) {
2572
- var str = "";
2573
- for (var i = 0; i < arr.length; i += 1) {
2574
- str += arr[i];
2575
- if (i + 1 < arr.length) {
2576
- str += joiner;
2550
+ var implementation;
2551
+ var hasRequiredImplementation;
2552
+ function requireImplementation() {
2553
+ if (hasRequiredImplementation) return implementation;
2554
+ hasRequiredImplementation = 1;
2555
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
2556
+ var toStr2 = Object.prototype.toString;
2557
+ var max2 = Math.max;
2558
+ var funcType = "[object Function]";
2559
+ var concatty = function concatty2(a, b) {
2560
+ var arr = [];
2561
+ for (var i = 0; i < a.length; i += 1) {
2562
+ arr[i] = a[i];
2577
2563
  }
2578
- }
2579
- return str;
2580
- };
2581
- var implementation$1 = function bind(that) {
2582
- var target = this;
2583
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
2584
- throw new TypeError(ERROR_MESSAGE + target);
2585
- }
2586
- var args = slicy(arguments, 1);
2587
- var bound;
2588
- var binder = function() {
2589
- if (this instanceof bound) {
2590
- var result = target.apply(
2591
- this,
2592
- concatty(args, arguments)
2593
- );
2594
- if (Object(result) === result) {
2595
- return result;
2564
+ for (var j2 = 0; j2 < b.length; j2 += 1) {
2565
+ arr[j2 + a.length] = b[j2];
2566
+ }
2567
+ return arr;
2568
+ };
2569
+ var slicy = function slicy2(arrLike, offset) {
2570
+ var arr = [];
2571
+ for (var i = offset, j2 = 0; i < arrLike.length; i += 1, j2 += 1) {
2572
+ arr[j2] = arrLike[i];
2573
+ }
2574
+ return arr;
2575
+ };
2576
+ var joiny = function(arr, joiner) {
2577
+ var str = "";
2578
+ for (var i = 0; i < arr.length; i += 1) {
2579
+ str += arr[i];
2580
+ if (i + 1 < arr.length) {
2581
+ str += joiner;
2596
2582
  }
2597
- return this;
2598
2583
  }
2599
- return target.apply(
2600
- that,
2601
- concatty(args, arguments)
2602
- );
2584
+ return str;
2603
2585
  };
2604
- var boundLength = max$1(0, target.length - args.length);
2605
- var boundArgs = [];
2606
- for (var i = 0; i < boundLength; i++) {
2607
- boundArgs[i] = "$" + i;
2608
- }
2609
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
2610
- if (target.prototype) {
2611
- var Empty2 = function Empty3() {
2586
+ implementation = function bind2(that) {
2587
+ var target = this;
2588
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
2589
+ throw new TypeError(ERROR_MESSAGE + target);
2590
+ }
2591
+ var args = slicy(arguments, 1);
2592
+ var bound;
2593
+ var binder = function() {
2594
+ if (this instanceof bound) {
2595
+ var result = target.apply(
2596
+ this,
2597
+ concatty(args, arguments)
2598
+ );
2599
+ if (Object(result) === result) {
2600
+ return result;
2601
+ }
2602
+ return this;
2603
+ }
2604
+ return target.apply(
2605
+ that,
2606
+ concatty(args, arguments)
2607
+ );
2612
2608
  };
2613
- Empty2.prototype = target.prototype;
2614
- bound.prototype = new Empty2();
2615
- Empty2.prototype = null;
2616
- }
2617
- return bound;
2618
- };
2619
- var implementation = implementation$1;
2620
- var functionBind = Function.prototype.bind || implementation;
2621
- var functionCall = Function.prototype.call;
2609
+ var boundLength = max2(0, target.length - args.length);
2610
+ var boundArgs = [];
2611
+ for (var i = 0; i < boundLength; i++) {
2612
+ boundArgs[i] = "$" + i;
2613
+ }
2614
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
2615
+ if (target.prototype) {
2616
+ var Empty2 = function Empty3() {
2617
+ };
2618
+ Empty2.prototype = target.prototype;
2619
+ bound.prototype = new Empty2();
2620
+ Empty2.prototype = null;
2621
+ }
2622
+ return bound;
2623
+ };
2624
+ return implementation;
2625
+ }
2626
+ var functionBind;
2627
+ var hasRequiredFunctionBind;
2628
+ function requireFunctionBind() {
2629
+ if (hasRequiredFunctionBind) return functionBind;
2630
+ hasRequiredFunctionBind = 1;
2631
+ var implementation2 = requireImplementation();
2632
+ functionBind = Function.prototype.bind || implementation2;
2633
+ return functionBind;
2634
+ }
2635
+ var functionCall;
2636
+ var hasRequiredFunctionCall;
2637
+ function requireFunctionCall() {
2638
+ if (hasRequiredFunctionCall) return functionCall;
2639
+ hasRequiredFunctionCall = 1;
2640
+ functionCall = Function.prototype.call;
2641
+ return functionCall;
2642
+ }
2622
2643
  var functionApply;
2623
2644
  var hasRequiredFunctionApply;
2624
2645
  function requireFunctionApply() {
@@ -2628,14 +2649,14 @@ function requireFunctionApply() {
2628
2649
  return functionApply;
2629
2650
  }
2630
2651
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
2631
- var bind$3 = functionBind;
2652
+ var bind$3 = requireFunctionBind();
2632
2653
  var $apply$1 = requireFunctionApply();
2633
- var $call$2 = functionCall;
2654
+ var $call$2 = requireFunctionCall();
2634
2655
  var $reflectApply = reflectApply;
2635
2656
  var actualApply = $reflectApply || bind$3.call($call$2, $apply$1);
2636
- var bind$2 = functionBind;
2657
+ var bind$2 = requireFunctionBind();
2637
2658
  var $TypeError$4 = type$2;
2638
- var $call$1 = functionCall;
2659
+ var $call$1 = requireFunctionCall();
2639
2660
  var $actualApply = actualApply;
2640
2661
  var callBindApplyHelpers = function callBindBasic(args) {
2641
2662
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -2701,8 +2722,8 @@ function requireHasown() {
2701
2722
  hasRequiredHasown = 1;
2702
2723
  var call2 = Function.prototype.call;
2703
2724
  var $hasOwn = Object.prototype.hasOwnProperty;
2704
- var bind3 = functionBind;
2705
- hasown = bind3.call(call2, $hasOwn);
2725
+ var bind2 = requireFunctionBind();
2726
+ hasown = bind2.call(call2, $hasOwn);
2706
2727
  return hasown;
2707
2728
  }
2708
2729
  var undefined$1;
@@ -2716,7 +2737,7 @@ var $TypeError$3 = type$2;
2716
2737
  var $URIError = uri;
2717
2738
  var abs$1 = abs$2;
2718
2739
  var floor = floor$1;
2719
- var max = max$2;
2740
+ var max = max$1;
2720
2741
  var min = min$1;
2721
2742
  var pow = pow$1;
2722
2743
  var round$1 = round$2;
@@ -2750,7 +2771,7 @@ var getProto = requireGetProto();
2750
2771
  var $ObjectGPO = requireObject_getPrototypeOf();
2751
2772
  var $ReflectGPO = requireReflect_getPrototypeOf();
2752
2773
  var $apply = requireFunctionApply();
2753
- var $call = functionCall;
2774
+ var $call = requireFunctionCall();
2754
2775
  var needsEval = {};
2755
2776
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
2756
2777
  var INTRINSICS = {
@@ -2921,7 +2942,7 @@ var LEGACY_ALIASES = {
2921
2942
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2922
2943
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2923
2944
  };
2924
- var bind$1 = functionBind;
2945
+ var bind$1 = requireFunctionBind();
2925
2946
  var hasOwn = requireHasown();
2926
2947
  var $concat = bind$1.call($call, Array.prototype.concat);
2927
2948
  var $spliceApply = bind$1.call($apply, Array.prototype.splice);
@@ -4121,10 +4142,12 @@ const handleImagePreview = async (config) => {
4121
4142
  const { urls, startIndex = 0 } = config.params || {};
4122
4143
  if (!urls || !urls.length) return;
4123
4144
  };
4124
- const handleUpdateLocalData = async (config, { setValues }) => {
4145
+ const handleUpdateLocalData = async (config, { setValues, extra }) => {
4146
+ var _a, _b;
4125
4147
  if (!setValues) return;
4126
4148
  const { updateKey, value } = config.params;
4127
- const key = updateKey;
4149
+ const key = updateKey || (extra == null ? void 0 : extra.key);
4150
+ const targetValue = value !== void 0 && value !== "" ? value : (_b = (_a = extra == null ? void 0 : extra.payload) == null ? void 0 : _a.value) != null ? _b : value;
4128
4151
  const ok = await confirmIfNeeded(config.params);
4129
4152
  if (!ok) return;
4130
4153
  setValues((prev2) => {
@@ -4132,16 +4155,16 @@ const handleUpdateLocalData = async (config, { setValues }) => {
4132
4155
  const isOldEmpty = oldValue === void 0 || oldValue === null || oldValue === "" || typeof oldValue === "object" && Object.keys(oldValue).length === 0;
4133
4156
  if (isOldEmpty) {
4134
4157
  return __spreadProps$p(__spreadValues$r({}, prev2 || {}), {
4135
- [key]: value
4158
+ [key]: targetValue
4136
4159
  });
4137
4160
  }
4138
- if (typeof oldValue === "object" && typeof value === "object" && !Array.isArray(oldValue) && !Array.isArray(value) && oldValue !== null && value !== null) {
4161
+ if (typeof oldValue === "object" && typeof targetValue === "object" && !Array.isArray(oldValue) && !Array.isArray(targetValue) && oldValue !== null && targetValue !== null) {
4139
4162
  return __spreadProps$p(__spreadValues$r({}, prev2 || {}), {
4140
- [key]: __spreadValues$r(__spreadValues$r({}, oldValue), value)
4163
+ [key]: __spreadValues$r(__spreadValues$r({}, oldValue), targetValue)
4141
4164
  });
4142
4165
  }
4143
4166
  return __spreadProps$p(__spreadValues$r({}, prev2 || {}), {
4144
- [key]: value
4167
+ [key]: targetValue
4145
4168
  });
4146
4169
  });
4147
4170
  };
@@ -4359,15 +4382,8 @@ var __spreadValues$q = (a, b) => {
4359
4382
  return a;
4360
4383
  };
4361
4384
  var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
4362
- const applySize = (props, scale = 1) => {
4363
- const style2 = { width: "100%" };
4364
- if (!props) return style2;
4365
- if (props.width != null) style2.width = runStyle(props.width, scale);
4366
- if (props.height != null) style2.height = runStyle(props.height, scale);
4367
- return style2;
4368
- };
4369
4385
  const baseContainerStyle = (props, scale = 1) => {
4370
- const style2 = __spreadValues$q(__spreadValues$q({}, applySize(props, scale)), (props == null ? void 0 : props.style) || {});
4386
+ const style2 = __spreadValues$q({}, (props == null ? void 0 : props.style) || {});
4371
4387
  return style2;
4372
4388
  };
4373
4389
  const childGapStyle = (index2, count, gap, horizontal, scale = 1) => {
@@ -4533,10 +4549,10 @@ const backgroundToStyle = (background, theme) => {
4533
4549
  return style2;
4534
4550
  };
4535
4551
  const borderRadiusToStyle = (borderRadius, theme, scale = 1) => {
4536
- const borderRadiusMap = theme.borderRadius;
4552
+ const borderRadiusMap = (theme == null ? void 0 : theme.borderRadius) || {};
4537
4553
  const style2 = {};
4538
4554
  if (borderRadius) {
4539
- style2.borderRadius = borderRadiusMap[borderRadius] ? runStyle(borderRadiusMap[borderRadius], scale) : runStyle(borderRadius);
4555
+ style2.borderRadius = borderRadiusMap[borderRadius] ? runStyle(borderRadiusMap[borderRadius], scale) : runStyle(borderRadius, scale);
4540
4556
  }
4541
4557
  return style2;
4542
4558
  };
@@ -5176,8 +5192,8 @@ const TwoColumnLayout = ({
5176
5192
  "div",
5177
5193
  {
5178
5194
  style: __spreadProps$h(__spreadValues$j({}, buildItemContainerStyle(idx, count, props, true, scale)), {
5179
- flex: idx === 1 ? 1 : 0,
5180
- width: idx === 1 ? runStyle(props.leftWidth, scale) : "auto",
5195
+ flex: idx === 1 ? 1 : "none",
5196
+ width: idx === 0 ? runStyle(props == null ? void 0 : props.leftWidth) : "auto",
5181
5197
  flexDirection: "row"
5182
5198
  }),
5183
5199
  children: child
@@ -29565,11 +29581,17 @@ var __spreadValues$b = (a, b) => {
29565
29581
  };
29566
29582
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
29567
29583
  const InputRender = (props) => {
29568
- var _a;
29569
29584
  const { scale } = useResponsive();
29570
29585
  const { executeActions } = useAction$1();
29571
29586
  const { ref: ref2, onClick, onMouseEnter, onMouseLeave } = useForEditor(props);
29572
29587
  const style2 = baseContainerStyle(props, scale);
29588
+ const handleChange = (e) => {
29589
+ if (props.actions) {
29590
+ void executeActions(props.actions, {
29591
+ payload: { value: e.target.value }
29592
+ });
29593
+ }
29594
+ };
29573
29595
  const handleContainerClick = (e) => {
29574
29596
  if (props == null ? void 0 : props.actions) {
29575
29597
  void executeActions(props.actions);
@@ -29586,13 +29608,10 @@ const InputRender = (props) => {
29586
29608
  children: /* @__PURE__ */ jsx(
29587
29609
  Input2,
29588
29610
  {
29589
- value: (_a = props.value) != null ? _a : "",
29590
29611
  placeholder: props.placeholder,
29591
- onChange: (e) => {
29592
- var _a2;
29593
- return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e.target.value);
29594
- },
29595
- style: { width: "100%" }
29612
+ onChange: handleChange,
29613
+ style: { width: "100%" },
29614
+ variant: "borderless"
29596
29615
  }
29597
29616
  )
29598
29617
  })
@@ -29683,11 +29702,16 @@ const RadioRender = (props) => {
29683
29702
  const style2 = baseContainerStyle(props, scale);
29684
29703
  const valueStr = props.value != null ? String(props.value) : void 0;
29685
29704
  const handleContainerClick = (e) => {
29686
- if (props == null ? void 0 : props.actions) {
29687
- void executeActions(props.actions);
29688
- }
29689
29705
  onClick(e);
29690
29706
  };
29707
+ const handleChange = (e) => {
29708
+ var _a;
29709
+ const val = e.target.value;
29710
+ (_a = props.onChange) == null ? void 0 : _a.call(props, e);
29711
+ if (props.actions) {
29712
+ void executeActions(props.actions, { payload: { value: val } });
29713
+ }
29714
+ };
29691
29715
  return /* @__PURE__ */ jsx(
29692
29716
  "div",
29693
29717
  __spreadProps$7(__spreadValues$9({
@@ -29695,10 +29719,30 @@ const RadioRender = (props) => {
29695
29719
  onClick: handleContainerClick,
29696
29720
  ref: ref2
29697
29721
  }, { onMouseEnter, onMouseLeave }), {
29698
- children: /* @__PURE__ */ jsx(Group$1, { onChange: props.onChange, value: valueStr, children: (props.options || []).map((opt) => {
29699
- const ov = String(opt.value);
29700
- return /* @__PURE__ */ jsx(Radio, { value: ov, style: props.itemStyle, children: opt.label }, ov);
29701
- }) })
29722
+ children: /* @__PURE__ */ jsx(
29723
+ ConfigProvider,
29724
+ {
29725
+ theme: {
29726
+ token: {
29727
+ colorPrimary: "#1bb193"
29728
+ }
29729
+ },
29730
+ children: /* @__PURE__ */ jsx(
29731
+ Group$1,
29732
+ {
29733
+ onChange: handleChange,
29734
+ value: valueStr,
29735
+ defaultValue: props.defaultValue,
29736
+ optionType: "button",
29737
+ buttonStyle: "solid",
29738
+ children: (props.options || []).map((opt) => {
29739
+ const ov = String(opt.value);
29740
+ return /* @__PURE__ */ jsx(Radio, { value: ov, style: props.itemStyle, children: opt.label }, ov);
29741
+ })
29742
+ }
29743
+ )
29744
+ }
29745
+ )
29702
29746
  })
29703
29747
  );
29704
29748
  };
@@ -30497,7 +30541,7 @@ class CacheStorage {
30497
30541
  }
30498
30542
  }
30499
30543
  }
30500
- function bind2(fn, thisArg) {
30544
+ function bind(fn, thisArg) {
30501
30545
  return function wrap() {
30502
30546
  return fn.apply(thisArg, arguments);
30503
30547
  };
@@ -30635,7 +30679,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
30635
30679
  forEach(b, (val, key) => {
30636
30680
  if (thisArg && isFunction$1(val)) {
30637
30681
  Object.defineProperty(a, key, {
30638
- value: bind2(val, thisArg),
30682
+ value: bind(val, thisArg),
30639
30683
  writable: true,
30640
30684
  enumerable: true,
30641
30685
  configurable: true
@@ -32952,7 +32996,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
32952
32996
  });
32953
32997
  function createInstance(defaultConfig2) {
32954
32998
  const context = new Axios$1(defaultConfig2);
32955
- const instance = bind2(Axios$1.prototype.request, context);
32999
+ const instance = bind(Axios$1.prototype.request, context);
32956
33000
  utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
32957
33001
  utils$1.extend(instance, context, null, { allOwnKeys: true });
32958
33002
  instance.create = function create(instanceConfig) {
@@ -34005,7 +34049,6 @@ const MessageCard = (props) => {
34005
34049
  }),
34006
34050
  theme,
34007
34051
  onAction: (payload) => {
34008
- console.info("onAction", payload);
34009
34052
  },
34010
34053
  externalActions: props.externalActions
34011
34054
  }, props)