@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.umd.js CHANGED
@@ -2047,7 +2047,7 @@
2047
2047
  var ys = arrObjKeys(obj, inspect2);
2048
2048
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2049
2049
  var protoTag = obj instanceof Object ? "" : "null prototype";
2050
- var stringTag = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
2050
+ var stringTag = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
2051
2051
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
2052
2052
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
2053
2053
  if (ys.length === 0) {
@@ -2072,25 +2072,25 @@
2072
2072
  return !toStringTag$1 || !(typeof obj === "object" && (toStringTag$1 in obj || typeof obj[toStringTag$1] !== "undefined"));
2073
2073
  }
2074
2074
  function isArray$4(obj) {
2075
- return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
2075
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
2076
2076
  }
2077
2077
  function isDate$1(obj) {
2078
- return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
2078
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
2079
2079
  }
2080
2080
  function isRegExp$2(obj) {
2081
- return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
2081
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
2082
2082
  }
2083
2083
  function isError(obj) {
2084
- return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
2084
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
2085
2085
  }
2086
2086
  function isString$2(obj) {
2087
- return toStr$1(obj) === "[object String]" && canTrustToString(obj);
2087
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
2088
2088
  }
2089
2089
  function isNumber$1(obj) {
2090
- return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
2090
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
2091
2091
  }
2092
2092
  function isBoolean$1(obj) {
2093
- return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
2093
+ return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
2094
2094
  }
2095
2095
  function isSymbol(obj) {
2096
2096
  if (hasShammedSymbols) {
@@ -2126,7 +2126,7 @@
2126
2126
  function has$3(obj, key) {
2127
2127
  return hasOwn$1.call(obj, key);
2128
2128
  }
2129
- function toStr$1(obj) {
2129
+ function toStr(obj) {
2130
2130
  return objectToString.call(obj);
2131
2131
  }
2132
2132
  function nameOf(f) {
@@ -2435,7 +2435,7 @@
2435
2435
  var uri = URIError;
2436
2436
  var abs$2 = Math.abs;
2437
2437
  var floor$1 = Math.floor;
2438
- var max$2 = Math.max;
2438
+ var max$1 = Math.max;
2439
2439
  var min$1 = Math.min;
2440
2440
  var pow$1 = Math.pow;
2441
2441
  var round$2 = Math.round;
@@ -2564,78 +2564,99 @@
2564
2564
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
2565
2565
  return Object_getPrototypeOf;
2566
2566
  }
2567
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
2568
- var toStr = Object.prototype.toString;
2569
- var max$1 = Math.max;
2570
- var funcType = "[object Function]";
2571
- var concatty = function concatty2(a, b) {
2572
- var arr = [];
2573
- for (var i = 0; i < a.length; i += 1) {
2574
- arr[i] = a[i];
2575
- }
2576
- for (var j2 = 0; j2 < b.length; j2 += 1) {
2577
- arr[j2 + a.length] = b[j2];
2578
- }
2579
- return arr;
2580
- };
2581
- var slicy = function slicy2(arrLike, offset) {
2582
- var arr = [];
2583
- for (var i = offset, j2 = 0; i < arrLike.length; i += 1, j2 += 1) {
2584
- arr[j2] = arrLike[i];
2585
- }
2586
- return arr;
2587
- };
2588
- var joiny = function(arr, joiner) {
2589
- var str = "";
2590
- for (var i = 0; i < arr.length; i += 1) {
2591
- str += arr[i];
2592
- if (i + 1 < arr.length) {
2593
- str += joiner;
2567
+ var implementation;
2568
+ var hasRequiredImplementation;
2569
+ function requireImplementation() {
2570
+ if (hasRequiredImplementation) return implementation;
2571
+ hasRequiredImplementation = 1;
2572
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
2573
+ var toStr2 = Object.prototype.toString;
2574
+ var max2 = Math.max;
2575
+ var funcType = "[object Function]";
2576
+ var concatty = function concatty2(a, b) {
2577
+ var arr = [];
2578
+ for (var i = 0; i < a.length; i += 1) {
2579
+ arr[i] = a[i];
2594
2580
  }
2595
- }
2596
- return str;
2597
- };
2598
- var implementation$1 = function bind2(that) {
2599
- var target = this;
2600
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
2601
- throw new TypeError(ERROR_MESSAGE + target);
2602
- }
2603
- var args = slicy(arguments, 1);
2604
- var bound;
2605
- var binder = function() {
2606
- if (this instanceof bound) {
2607
- var result = target.apply(
2608
- this,
2609
- concatty(args, arguments)
2610
- );
2611
- if (Object(result) === result) {
2612
- return result;
2581
+ for (var j2 = 0; j2 < b.length; j2 += 1) {
2582
+ arr[j2 + a.length] = b[j2];
2583
+ }
2584
+ return arr;
2585
+ };
2586
+ var slicy = function slicy2(arrLike, offset) {
2587
+ var arr = [];
2588
+ for (var i = offset, j2 = 0; i < arrLike.length; i += 1, j2 += 1) {
2589
+ arr[j2] = arrLike[i];
2590
+ }
2591
+ return arr;
2592
+ };
2593
+ var joiny = function(arr, joiner) {
2594
+ var str = "";
2595
+ for (var i = 0; i < arr.length; i += 1) {
2596
+ str += arr[i];
2597
+ if (i + 1 < arr.length) {
2598
+ str += joiner;
2613
2599
  }
2614
- return this;
2615
2600
  }
2616
- return target.apply(
2617
- that,
2618
- concatty(args, arguments)
2619
- );
2601
+ return str;
2620
2602
  };
2621
- var boundLength = max$1(0, target.length - args.length);
2622
- var boundArgs = [];
2623
- for (var i = 0; i < boundLength; i++) {
2624
- boundArgs[i] = "$" + i;
2625
- }
2626
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
2627
- if (target.prototype) {
2628
- var Empty2 = function Empty3() {
2603
+ implementation = function bind2(that) {
2604
+ var target = this;
2605
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
2606
+ throw new TypeError(ERROR_MESSAGE + target);
2607
+ }
2608
+ var args = slicy(arguments, 1);
2609
+ var bound;
2610
+ var binder = function() {
2611
+ if (this instanceof bound) {
2612
+ var result = target.apply(
2613
+ this,
2614
+ concatty(args, arguments)
2615
+ );
2616
+ if (Object(result) === result) {
2617
+ return result;
2618
+ }
2619
+ return this;
2620
+ }
2621
+ return target.apply(
2622
+ that,
2623
+ concatty(args, arguments)
2624
+ );
2629
2625
  };
2630
- Empty2.prototype = target.prototype;
2631
- bound.prototype = new Empty2();
2632
- Empty2.prototype = null;
2633
- }
2634
- return bound;
2635
- };
2636
- var implementation = implementation$1;
2637
- var functionBind = Function.prototype.bind || implementation;
2638
- var functionCall = Function.prototype.call;
2626
+ var boundLength = max2(0, target.length - args.length);
2627
+ var boundArgs = [];
2628
+ for (var i = 0; i < boundLength; i++) {
2629
+ boundArgs[i] = "$" + i;
2630
+ }
2631
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
2632
+ if (target.prototype) {
2633
+ var Empty2 = function Empty3() {
2634
+ };
2635
+ Empty2.prototype = target.prototype;
2636
+ bound.prototype = new Empty2();
2637
+ Empty2.prototype = null;
2638
+ }
2639
+ return bound;
2640
+ };
2641
+ return implementation;
2642
+ }
2643
+ var functionBind;
2644
+ var hasRequiredFunctionBind;
2645
+ function requireFunctionBind() {
2646
+ if (hasRequiredFunctionBind) return functionBind;
2647
+ hasRequiredFunctionBind = 1;
2648
+ var implementation2 = requireImplementation();
2649
+ functionBind = Function.prototype.bind || implementation2;
2650
+ return functionBind;
2651
+ }
2652
+ var functionCall;
2653
+ var hasRequiredFunctionCall;
2654
+ function requireFunctionCall() {
2655
+ if (hasRequiredFunctionCall) return functionCall;
2656
+ hasRequiredFunctionCall = 1;
2657
+ functionCall = Function.prototype.call;
2658
+ return functionCall;
2659
+ }
2639
2660
  var functionApply;
2640
2661
  var hasRequiredFunctionApply;
2641
2662
  function requireFunctionApply() {
@@ -2645,14 +2666,14 @@
2645
2666
  return functionApply;
2646
2667
  }
2647
2668
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
2648
- var bind$3 = functionBind;
2669
+ var bind$3 = requireFunctionBind();
2649
2670
  var $apply$1 = requireFunctionApply();
2650
- var $call$2 = functionCall;
2671
+ var $call$2 = requireFunctionCall();
2651
2672
  var $reflectApply = reflectApply;
2652
2673
  var actualApply = $reflectApply || bind$3.call($call$2, $apply$1);
2653
- var bind$2 = functionBind;
2674
+ var bind$2 = requireFunctionBind();
2654
2675
  var $TypeError$4 = type$2;
2655
- var $call$1 = functionCall;
2676
+ var $call$1 = requireFunctionCall();
2656
2677
  var $actualApply = actualApply;
2657
2678
  var callBindApplyHelpers = function callBindBasic2(args) {
2658
2679
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -2718,7 +2739,7 @@
2718
2739
  hasRequiredHasown = 1;
2719
2740
  var call2 = Function.prototype.call;
2720
2741
  var $hasOwn = Object.prototype.hasOwnProperty;
2721
- var bind2 = functionBind;
2742
+ var bind2 = requireFunctionBind();
2722
2743
  hasown = bind2.call(call2, $hasOwn);
2723
2744
  return hasown;
2724
2745
  }
@@ -2733,7 +2754,7 @@
2733
2754
  var $URIError = uri;
2734
2755
  var abs$1 = abs$2;
2735
2756
  var floor = floor$1;
2736
- var max = max$2;
2757
+ var max = max$1;
2737
2758
  var min = min$1;
2738
2759
  var pow = pow$1;
2739
2760
  var round$1 = round$2;
@@ -2767,7 +2788,7 @@
2767
2788
  var $ObjectGPO = requireObject_getPrototypeOf();
2768
2789
  var $ReflectGPO = requireReflect_getPrototypeOf();
2769
2790
  var $apply = requireFunctionApply();
2770
- var $call = functionCall;
2791
+ var $call = requireFunctionCall();
2771
2792
  var needsEval = {};
2772
2793
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
2773
2794
  var INTRINSICS = {
@@ -2938,7 +2959,7 @@
2938
2959
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2939
2960
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2940
2961
  };
2941
- var bind$1 = functionBind;
2962
+ var bind$1 = requireFunctionBind();
2942
2963
  var hasOwn = requireHasown();
2943
2964
  var $concat = bind$1.call($call, Array.prototype.concat);
2944
2965
  var $spliceApply = bind$1.call($apply, Array.prototype.splice);
@@ -4138,10 +4159,12 @@
4138
4159
  const { urls, startIndex = 0 } = config.params || {};
4139
4160
  if (!urls || !urls.length) return;
4140
4161
  };
4141
- const handleUpdateLocalData = async (config, { setValues }) => {
4162
+ const handleUpdateLocalData = async (config, { setValues, extra }) => {
4163
+ var _a, _b;
4142
4164
  if (!setValues) return;
4143
4165
  const { updateKey, value } = config.params;
4144
- const key = updateKey;
4166
+ const key = updateKey || (extra == null ? void 0 : extra.key);
4167
+ const targetValue = value !== void 0 && value !== "" ? value : (_b = (_a = extra == null ? void 0 : extra.payload) == null ? void 0 : _a.value) != null ? _b : value;
4145
4168
  const ok = await confirmIfNeeded(config.params);
4146
4169
  if (!ok) return;
4147
4170
  setValues((prev2) => {
@@ -4149,16 +4172,16 @@
4149
4172
  const isOldEmpty = oldValue === void 0 || oldValue === null || oldValue === "" || typeof oldValue === "object" && Object.keys(oldValue).length === 0;
4150
4173
  if (isOldEmpty) {
4151
4174
  return __spreadProps$p(__spreadValues$r({}, prev2 || {}), {
4152
- [key]: value
4175
+ [key]: targetValue
4153
4176
  });
4154
4177
  }
4155
- if (typeof oldValue === "object" && typeof value === "object" && !Array.isArray(oldValue) && !Array.isArray(value) && oldValue !== null && value !== null) {
4178
+ if (typeof oldValue === "object" && typeof targetValue === "object" && !Array.isArray(oldValue) && !Array.isArray(targetValue) && oldValue !== null && targetValue !== null) {
4156
4179
  return __spreadProps$p(__spreadValues$r({}, prev2 || {}), {
4157
- [key]: __spreadValues$r(__spreadValues$r({}, oldValue), value)
4180
+ [key]: __spreadValues$r(__spreadValues$r({}, oldValue), targetValue)
4158
4181
  });
4159
4182
  }
4160
4183
  return __spreadProps$p(__spreadValues$r({}, prev2 || {}), {
4161
- [key]: value
4184
+ [key]: targetValue
4162
4185
  });
4163
4186
  });
4164
4187
  };
@@ -4376,15 +4399,8 @@
4376
4399
  return a;
4377
4400
  };
4378
4401
  var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
4379
- const applySize = (props, scale = 1) => {
4380
- const style2 = { width: "100%" };
4381
- if (!props) return style2;
4382
- if (props.width != null) style2.width = runStyle(props.width, scale);
4383
- if (props.height != null) style2.height = runStyle(props.height, scale);
4384
- return style2;
4385
- };
4386
4402
  const baseContainerStyle = (props, scale = 1) => {
4387
- const style2 = __spreadValues$q(__spreadValues$q({}, applySize(props, scale)), (props == null ? void 0 : props.style) || {});
4403
+ const style2 = __spreadValues$q({}, (props == null ? void 0 : props.style) || {});
4388
4404
  return style2;
4389
4405
  };
4390
4406
  const childGapStyle = (index2, count, gap, horizontal, scale = 1) => {
@@ -4550,10 +4566,10 @@
4550
4566
  return style2;
4551
4567
  };
4552
4568
  const borderRadiusToStyle = (borderRadius, theme, scale = 1) => {
4553
- const borderRadiusMap = theme.borderRadius;
4569
+ const borderRadiusMap = (theme == null ? void 0 : theme.borderRadius) || {};
4554
4570
  const style2 = {};
4555
4571
  if (borderRadius) {
4556
- style2.borderRadius = borderRadiusMap[borderRadius] ? runStyle(borderRadiusMap[borderRadius], scale) : runStyle(borderRadius);
4572
+ style2.borderRadius = borderRadiusMap[borderRadius] ? runStyle(borderRadiusMap[borderRadius], scale) : runStyle(borderRadius, scale);
4557
4573
  }
4558
4574
  return style2;
4559
4575
  };
@@ -5193,8 +5209,8 @@
5193
5209
  "div",
5194
5210
  {
5195
5211
  style: __spreadProps$h(__spreadValues$j({}, buildItemContainerStyle(idx, count, props, true, scale)), {
5196
- flex: idx === 1 ? 1 : 0,
5197
- width: idx === 1 ? runStyle(props.leftWidth, scale) : "auto",
5212
+ flex: idx === 1 ? 1 : "none",
5213
+ width: idx === 0 ? runStyle(props == null ? void 0 : props.leftWidth) : "auto",
5198
5214
  flexDirection: "row"
5199
5215
  }),
5200
5216
  children: child
@@ -29582,11 +29598,17 @@
29582
29598
  };
29583
29599
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
29584
29600
  const InputRender = (props) => {
29585
- var _a;
29586
29601
  const { scale } = useResponsive();
29587
29602
  const { executeActions } = useAction$1();
29588
29603
  const { ref: ref2, onClick, onMouseEnter, onMouseLeave } = useForEditor(props);
29589
29604
  const style2 = baseContainerStyle(props, scale);
29605
+ const handleChange = (e) => {
29606
+ if (props.actions) {
29607
+ void executeActions(props.actions, {
29608
+ payload: { value: e.target.value }
29609
+ });
29610
+ }
29611
+ };
29590
29612
  const handleContainerClick = (e) => {
29591
29613
  if (props == null ? void 0 : props.actions) {
29592
29614
  void executeActions(props.actions);
@@ -29603,13 +29625,10 @@
29603
29625
  children: /* @__PURE__ */ jsxRuntime.jsx(
29604
29626
  Input,
29605
29627
  {
29606
- value: (_a = props.value) != null ? _a : "",
29607
29628
  placeholder: props.placeholder,
29608
- onChange: (e) => {
29609
- var _a2;
29610
- return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e.target.value);
29611
- },
29612
- style: { width: "100%" }
29629
+ onChange: handleChange,
29630
+ style: { width: "100%" },
29631
+ variant: "borderless"
29613
29632
  }
29614
29633
  )
29615
29634
  })
@@ -29700,11 +29719,16 @@
29700
29719
  const style2 = baseContainerStyle(props, scale);
29701
29720
  const valueStr = props.value != null ? String(props.value) : void 0;
29702
29721
  const handleContainerClick = (e) => {
29703
- if (props == null ? void 0 : props.actions) {
29704
- void executeActions(props.actions);
29705
- }
29706
29722
  onClick(e);
29707
29723
  };
29724
+ const handleChange = (e) => {
29725
+ var _a;
29726
+ const val = e.target.value;
29727
+ (_a = props.onChange) == null ? void 0 : _a.call(props, e);
29728
+ if (props.actions) {
29729
+ void executeActions(props.actions, { payload: { value: val } });
29730
+ }
29731
+ };
29708
29732
  return /* @__PURE__ */ jsxRuntime.jsx(
29709
29733
  "div",
29710
29734
  __spreadProps$7(__spreadValues$9({
@@ -29712,10 +29736,30 @@
29712
29736
  onClick: handleContainerClick,
29713
29737
  ref: ref2
29714
29738
  }, { onMouseEnter, onMouseLeave }), {
29715
- children: /* @__PURE__ */ jsxRuntime.jsx(Group$1, { onChange: props.onChange, value: valueStr, children: (props.options || []).map((opt) => {
29716
- const ov = String(opt.value);
29717
- return /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: ov, style: props.itemStyle, children: opt.label }, ov);
29718
- }) })
29739
+ children: /* @__PURE__ */ jsxRuntime.jsx(
29740
+ ConfigProvider,
29741
+ {
29742
+ theme: {
29743
+ token: {
29744
+ colorPrimary: "#1bb193"
29745
+ }
29746
+ },
29747
+ children: /* @__PURE__ */ jsxRuntime.jsx(
29748
+ Group$1,
29749
+ {
29750
+ onChange: handleChange,
29751
+ value: valueStr,
29752
+ defaultValue: props.defaultValue,
29753
+ optionType: "button",
29754
+ buttonStyle: "solid",
29755
+ children: (props.options || []).map((opt) => {
29756
+ const ov = String(opt.value);
29757
+ return /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: ov, style: props.itemStyle, children: opt.label }, ov);
29758
+ })
29759
+ }
29760
+ )
29761
+ }
29762
+ )
29719
29763
  })
29720
29764
  );
29721
29765
  };
@@ -34022,7 +34066,6 @@
34022
34066
  }),
34023
34067
  theme,
34024
34068
  onAction: (payload) => {
34025
- console.info("onAction", payload);
34026
34069
  },
34027
34070
  externalActions: props.externalActions
34028
34071
  }, props)