@vunk/plus 1.2.0 → 1.2.2

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.
@@ -927,9 +927,9 @@ function updateCSS(css, key) {
927
927
  return newNode;
928
928
  }
929
929
 
930
- function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$7(target, key, source[key]); }); } return target; }
930
+ function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$8(target, key, source[key]); }); } return target; }
931
931
 
932
- function _defineProperty$7(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
932
+ function _defineProperty$8(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
933
933
  function warn(valid, message) {
934
934
  // Support uglify
935
935
  if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
@@ -946,14 +946,14 @@ function isIconDefinition(target) {
946
946
  }
947
947
  function generate(node, key, rootProps) {
948
948
  if (!rootProps) {
949
- return h(node.tag, _objectSpread$7({
949
+ return h(node.tag, _objectSpread$8({
950
950
  key: key
951
951
  }, node.attrs), (node.children || []).map(function (child, index) {
952
952
  return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
953
953
  }));
954
954
  }
955
955
 
956
- return h(node.tag, _objectSpread$7({
956
+ return h(node.tag, _objectSpread$8({
957
957
  key: key
958
958
  }, rootProps, node.attrs), (node.children || []).map(function (child, index) {
959
959
  return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
@@ -1029,9 +1029,9 @@ function _objectWithoutProperties$1(source, excluded) { if (source == null) retu
1029
1029
 
1030
1030
  function _objectWithoutPropertiesLoose$1(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1031
1031
 
1032
- function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$6(target, key, source[key]); }); } return target; }
1032
+ function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$7(target, key, source[key]); }); } return target; }
1033
1033
 
1034
- function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1034
+ function _defineProperty$7(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1035
1035
  var twoToneColorPalette = reactive({
1036
1036
  primaryColor: '#333',
1037
1037
  secondaryColor: '#E6E6E6',
@@ -1047,11 +1047,11 @@ function setTwoToneColors(_ref) {
1047
1047
  }
1048
1048
 
1049
1049
  function getTwoToneColors() {
1050
- return _objectSpread$6({}, twoToneColorPalette);
1050
+ return _objectSpread$7({}, twoToneColorPalette);
1051
1051
  }
1052
1052
 
1053
1053
  var IconBase = function IconBase(props, context) {
1054
- var _props$context$attrs = _objectSpread$6({}, props, context.attrs),
1054
+ var _props$context$attrs = _objectSpread$7({}, props, context.attrs),
1055
1055
  icon = _props$context$attrs.icon,
1056
1056
  primaryColor = _props$context$attrs.primaryColor,
1057
1057
  secondaryColor = _props$context$attrs.secondaryColor,
@@ -1075,12 +1075,12 @@ var IconBase = function IconBase(props, context) {
1075
1075
  var target = icon;
1076
1076
 
1077
1077
  if (target && typeof target.icon === 'function') {
1078
- target = _objectSpread$6({}, target, {
1078
+ target = _objectSpread$7({}, target, {
1079
1079
  icon: target.icon(colors.primaryColor, colors.secondaryColor)
1080
1080
  });
1081
1081
  }
1082
1082
 
1083
- return generate(target.icon, "svg-".concat(target.name), _objectSpread$6({}, restProps, {
1083
+ return generate(target.icon, "svg-".concat(target.name), _objectSpread$7({}, restProps, {
1084
1084
  'data-icon': target.name,
1085
1085
  width: '1em',
1086
1086
  height: '1em',
@@ -1156,9 +1156,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
1156
1156
 
1157
1157
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1158
1158
 
1159
- function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$5(target, key, source[key]); }); } return target; }
1159
+ function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$6(target, key, source[key]); }); } return target; }
1160
1160
 
1161
- function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1161
+ function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1162
1162
 
1163
1163
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
1164
1164
 
@@ -1169,7 +1169,7 @@ setTwoToneColor(blue.primary);
1169
1169
  var Icon = function Icon(props, context) {
1170
1170
  var _classObj;
1171
1171
 
1172
- var _props$context$attrs = _objectSpread$5({}, props, context.attrs),
1172
+ var _props$context$attrs = _objectSpread$6({}, props, context.attrs),
1173
1173
  cls = _props$context$attrs["class"],
1174
1174
  icon = _props$context$attrs.icon,
1175
1175
  spin = _props$context$attrs.spin,
@@ -1183,7 +1183,7 @@ var Icon = function Icon(props, context) {
1183
1183
  prefixCls = _useInjectIconContext.prefixCls,
1184
1184
  rootClassName = _useInjectIconContext.rootClassName;
1185
1185
 
1186
- var classObj = (_classObj = {}, _defineProperty$5(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$5(_classObj, prefixCls.value, true), _defineProperty$5(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$5(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === 'loading'), _classObj);
1186
+ var classObj = (_classObj = {}, _defineProperty$6(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$6(_classObj, prefixCls.value, true), _defineProperty$6(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$6(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === 'loading'), _classObj);
1187
1187
  var iconTabIndex = tabindex;
1188
1188
 
1189
1189
  if (iconTabIndex === undefined && onClick) {
@@ -1200,7 +1200,7 @@ var Icon = function Icon(props, context) {
1200
1200
  primaryColor = _normalizeTwoToneColo2[0],
1201
1201
  secondaryColor = _normalizeTwoToneColo2[1];
1202
1202
 
1203
- return createVNode("span", _objectSpread$5({
1203
+ return createVNode("span", _objectSpread$6({
1204
1204
  "role": "img",
1205
1205
  "aria-label": icon.name
1206
1206
  }, restProps, {
@@ -1229,14 +1229,14 @@ Icon.setTwoToneColor = setTwoToneColor;
1229
1229
  // This icon file is generated automatically.
1230
1230
  var AudioMutedOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M682 455V311l-76 76v68c-.1 50.7-42 92.1-94 92a95.8 95.8 0 01-52-15l-54 55c29.1 22.4 65.9 36 106 36 93.8 0 170-75.1 170-168z" } }, { "tag": "path", "attrs": { "d": "M833 446h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254-63 0-120.7-23-165-61l-54 54a334.01 334.01 0 00179 81v102H326c-13.9 0-24.9 14.3-25 32v36c.1 4.4 2.9 8 6 8h408c3.2 0 6-3.6 6-8v-36c0-17.7-11-32-25-32H547V782c165.3-17.9 294-157.9 294-328 0-4.4-3.6-8-8-8zm13.1-377.7l-43.5-41.9a8 8 0 00-11.2.1l-129 129C634.3 101.2 577 64 511 64c-93.9 0-170 75.3-170 168v224c0 6.7.4 13.3 1.2 19.8l-68 68A252.33 252.33 0 01258 454c-.2-4.4-3.8-8-8-8h-60c-4.4 0-8 3.6-8 8 0 53 12.5 103 34.6 147.4l-137 137a8.03 8.03 0 000 11.3l42.7 42.7c3.1 3.1 8.2 3.1 11.3 0L846.2 79.8l.1-.1c3.1-3.2 3-8.3-.2-11.4zM417 401V232c0-50.6 41.9-92 94-92 46 0 84.1 32.3 92.3 74.7L417 401z" } }] }, "name": "audio-muted", "theme": "outlined" };
1231
1231
 
1232
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$4(target, key, source[key]); }); } return target; }
1232
+ function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$5(target, key, source[key]); }); } return target; }
1233
1233
 
1234
- function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1234
+ function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1235
1235
 
1236
1236
  var AudioMutedOutlined = function AudioMutedOutlined(props, context) {
1237
- var p = _objectSpread$4({}, props, context.attrs);
1237
+ var p = _objectSpread$5({}, props, context.attrs);
1238
1238
 
1239
- return createVNode(Icon, _objectSpread$4({}, p, {
1239
+ return createVNode(Icon, _objectSpread$5({}, p, {
1240
1240
  "icon": AudioMutedOutlined$1
1241
1241
  }), null);
1242
1242
  };
@@ -1247,14 +1247,14 @@ AudioMutedOutlined.inheritAttrs = false;
1247
1247
  // This icon file is generated automatically.
1248
1248
  var AudioOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z" } }] }, "name": "audio", "theme": "outlined" };
1249
1249
 
1250
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
1250
+ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$4(target, key, source[key]); }); } return target; }
1251
1251
 
1252
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1252
+ function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1253
1253
 
1254
1254
  var AudioOutlined = function AudioOutlined(props, context) {
1255
- var p = _objectSpread$3({}, props, context.attrs);
1255
+ var p = _objectSpread$4({}, props, context.attrs);
1256
1256
 
1257
- return createVNode(Icon, _objectSpread$3({}, p, {
1257
+ return createVNode(Icon, _objectSpread$4({}, p, {
1258
1258
  "icon": AudioOutlined$1
1259
1259
  }), null);
1260
1260
  };
@@ -1262,6 +1262,24 @@ var AudioOutlined = function AudioOutlined(props, context) {
1262
1262
  AudioOutlined.displayName = 'AudioOutlined';
1263
1263
  AudioOutlined.inheritAttrs = false;
1264
1264
 
1265
+ // This icon file is generated automatically.
1266
+ 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" };
1267
+
1268
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
1269
+
1270
+ function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1271
+
1272
+ var CloseOutlined = function CloseOutlined(props, context) {
1273
+ var p = _objectSpread$3({}, props, context.attrs);
1274
+
1275
+ return createVNode(Icon, _objectSpread$3({}, p, {
1276
+ "icon": CloseOutlined$1
1277
+ }), null);
1278
+ };
1279
+
1280
+ CloseOutlined.displayName = 'CloseOutlined';
1281
+ CloseOutlined.inheritAttrs = false;
1282
+
1265
1283
  // This icon file is generated automatically.
1266
1284
  var CloudUploadOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M518.3 459a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z" } }, { "tag": "path", "attrs": { "d": "M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z" } }] }, "name": "cloud-upload", "theme": "outlined" };
1267
1285
 
@@ -1316,4 +1334,4 @@ var SendOutlined = function SendOutlined(props, context) {
1316
1334
  SendOutlined.displayName = 'SendOutlined';
1317
1335
  SendOutlined.inheritAttrs = false;
1318
1336
 
1319
- export { AudioMutedOutlined as A, CloudUploadOutlined as C, LinkOutlined as L, SendOutlined as S, AudioOutlined as a };
1337
+ export { AudioMutedOutlined as A, CloseOutlined as C, LinkOutlined as L, SendOutlined as S, CloudUploadOutlined as a, AudioOutlined as b };
@@ -1,27 +1,27 @@
1
- import { defineComponent, renderSlot } from 'vue';
2
- import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
3
- import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
4
- import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
5
- import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
6
1
  import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
2
+ import CssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
3
+ import HtmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
4
+ import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
5
+ import TsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
6
+ import { defineComponent, renderSlot } from 'vue';
7
7
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
8
8
 
9
9
  var _sfc_main = defineComponent({
10
10
  name: "VkMonacoEnvironment",
11
11
  setup() {
12
- self.MonacoEnvironment = {
12
+ globalThis.MonacoEnvironment = {
13
13
  getWorker(_, label) {
14
14
  if (label === "json") {
15
- return new jsonWorker();
15
+ return new JsonWorker();
16
16
  }
17
17
  if (label === "css" || label === "scss" || label === "less") {
18
- return new cssWorker();
18
+ return new CssWorker();
19
19
  }
20
20
  if (label === "html" || label === "handlebars" || label === "razor") {
21
- return new htmlWorker();
21
+ return new HtmlWorker();
22
22
  }
23
23
  if (["typescript", "javascript"].includes(label)) {
24
- return new tsWorker();
24
+ return new TsWorker();
25
25
  }
26
26
  return new EditorWorker();
27
27
  }
@@ -1,3 +1,7 @@
1
+ .ant-sender-header-header{
2
+ display: flex;
3
+ justify-content: space-between;
4
+ }
1
5
  .vk-sender .ant-sender-content{
2
6
  display: grid;
3
7
  /* 两列 auto 1fr */
@@ -1,11 +1,27 @@
1
- import { defineComponent, ref, createVNode, resolveComponent, openBlock, createBlock, withCtx } from 'vue';
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, withDirectives, createElementVNode, mergeProps, toDisplayString, createVNode, renderSlot, vShow, ref, nextTick } from 'vue';
2
2
  import { useModelComputed, useDeferred } from '@vunk/core/composables';
3
3
  import { Button, Tooltip } from 'ant-design-vue';
4
4
  import { Sender, Attachments } from 'ant-design-x-vue';
5
- import { L as LinkOutlined, C as CloudUploadOutlined, S as SendOutlined } from '../SendOutlined.mjs';
5
+ import { noop } from '@vunk/shared/function';
6
+ import { ElCollapseTransition } from 'element-plus';
7
+ import { C as CloseOutlined, L as LinkOutlined, a as CloudUploadOutlined, S as SendOutlined } from '../SendOutlined.mjs';
6
8
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
7
9
 
8
10
  const props = {
11
+ /**
12
+ * @description v-model 绑定文件列表
13
+ */
14
+ fileList: {
15
+ type: Array,
16
+ default: void 0
17
+ },
18
+ /**
19
+ * @description 文件上传地址
20
+ */
21
+ action: {
22
+ type: String,
23
+ default: ""
24
+ },
9
25
  /**
10
26
  * @description v-model 绑定文本
11
27
  */
@@ -22,19 +38,110 @@ const props = {
22
38
  }
23
39
  };
24
40
  const emits = {
41
+ "update:fileList": (_) => true,
25
42
  "update:modelValue": (_) => true,
26
43
  "submit": (_) => true,
27
44
  "cancel": null
28
45
  };
29
46
 
47
+ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
48
+ name: "AXSenderHeader",
49
+ components: {
50
+ ElCollapseTransition,
51
+ AntButton: Button,
52
+ CloseOutlined
53
+ },
54
+ inheritAttrs: false,
55
+ props: {
56
+ modelValue: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ title: {
61
+ type: String,
62
+ default: "Sender"
63
+ },
64
+ contentRef: {
65
+ type: Function,
66
+ default: noop
67
+ }
68
+ },
69
+ emits: {
70
+ "update:modelValue": null
71
+ },
72
+ setup() {
73
+ return {};
74
+ }
75
+ });
76
+
77
+ const _hoisted_1 = { class: "ant-sender-header-header" };
78
+ const _hoisted_2 = { class: "ant-sender-header-header-title" };
79
+ const _hoisted_3 = { class: "ant-sender-header-header-close" };
80
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
81
+ const _component_CloseOutlined = resolveComponent("CloseOutlined");
82
+ const _component_AntButton = resolveComponent("AntButton");
83
+ const _component_ElCollapseTransition = resolveComponent("ElCollapseTransition");
84
+ return openBlock(), createBlock(_component_ElCollapseTransition, null, {
85
+ default: withCtx(() => [
86
+ withDirectives(createElementVNode(
87
+ "div",
88
+ mergeProps({ class: "ant-sender-header" }, _ctx.$attrs),
89
+ [
90
+ createElementVNode("div", _hoisted_1, [
91
+ createElementVNode(
92
+ "div",
93
+ _hoisted_2,
94
+ toDisplayString(_ctx.title),
95
+ 1
96
+ /* TEXT */
97
+ ),
98
+ createElementVNode("div", _hoisted_3, [
99
+ createVNode(_component_AntButton, {
100
+ type: "text",
101
+ size: "small",
102
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", false))
103
+ }, {
104
+ icon: withCtx(() => [
105
+ createVNode(_component_CloseOutlined)
106
+ ]),
107
+ _: 1
108
+ /* STABLE */
109
+ })
110
+ ])
111
+ ]),
112
+ createElementVNode(
113
+ "div",
114
+ {
115
+ ref: _ctx.contentRef,
116
+ class: "ant-sender-header-content"
117
+ },
118
+ [
119
+ renderSlot(_ctx.$slots, "default")
120
+ ],
121
+ 512
122
+ /* NEED_PATCH */
123
+ )
124
+ ],
125
+ 16
126
+ /* FULL_PROPS */
127
+ ), [
128
+ [vShow, _ctx.modelValue]
129
+ ])
130
+ ]),
131
+ _: 3
132
+ /* FORWARDED */
133
+ });
134
+ }
135
+ var SenderHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/sender/src/SenderHeader.vue"]]);
136
+
30
137
  var _sfc_main = /* @__PURE__ */ defineComponent({
31
138
  name: "VkSender",
32
139
  components: {
33
140
  Sender,
34
141
  LinkOutlined,
35
142
  AntButton: Button,
36
- SenderHeader: Sender.Header,
37
- Attachments
143
+ Attachments,
144
+ SenderHeader
38
145
  },
39
146
  props,
40
147
  emits,
@@ -91,20 +198,38 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
91
198
  };
92
199
  }
93
200
  };
94
- const fileList = ref([]);
95
- const attachmentsDef = useDeferred();
201
+ const theFileList = useModelComputed({
202
+ key: "fileList",
203
+ default: []
204
+ }, props2, emit);
205
+ const attachmentsRef = ref();
206
+ const attachmentWrapDef = useDeferred();
96
207
  const handlePasteFile = async file => {
97
208
  headerOpen.value = true;
98
- const attachmentsNode = await attachmentsDef.promise;
99
- attachmentsNode.upload(file);
209
+ const attachmentWrap = await attachmentWrapDef.promise;
210
+ await nextTick();
211
+ const fileInput = attachmentWrap.querySelector('input[type="file"]');
212
+ if (fileInput) {
213
+ const dataTransfer = new DataTransfer();
214
+ dataTransfer.items.add(file);
215
+ fileInput.files = dataTransfer.files;
216
+ fileInput.dispatchEvent(new Event("change", {
217
+ bubbles: true
218
+ }));
219
+ }
220
+ };
221
+ const handleChange = e => {
222
+ theFileList.value = e.fileList;
100
223
  };
101
224
  return {
102
225
  actionsRender,
103
226
  headerOpen,
104
227
  attachmentsPlaceholder,
105
228
  handlePasteFile,
106
- attachmentsResolve: attachmentsDef.resolve,
107
- fileList
229
+ attachmentsRef,
230
+ theFileList,
231
+ handleChange,
232
+ attachmentWrapResolve: attachmentWrapDef.resolve
108
233
  };
109
234
  }
110
235
  });
@@ -128,20 +253,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
128
253
  }, {
129
254
  header: withCtx(() => [
130
255
  createVNode(_component_SenderHeader, {
131
- open: _ctx.headerOpen,
132
- title: "\u6DFB\u52A0\u9644\u4EF6",
133
- onOpenChange: _cache[0] || (_cache[0] = (v) => _ctx.headerOpen = v)
256
+ modelValue: _ctx.headerOpen,
257
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.headerOpen = $event),
258
+ title: "\u9644\u4EF6",
259
+ "content-ref": _ctx.attachmentWrapResolve
134
260
  }, {
135
261
  default: withCtx(() => [
136
262
  createVNode(_component_Attachments, {
137
- ref: _ctx.attachmentsResolve,
263
+ ref: "attachmentsRef",
264
+ "file-list": _ctx.theFileList,
138
265
  placeholder: _ctx.attachmentsPlaceholder,
139
- "file-list": _ctx.fileList
140
- }, null, 8, ["placeholder", "file-list"])
266
+ action: _ctx.action,
267
+ multiple: "",
268
+ onChange: _ctx.handleChange
269
+ }, null, 8, ["file-list", "placeholder", "action", "onChange"])
141
270
  ]),
142
271
  _: 1
143
272
  /* STABLE */
144
- }, 8, ["open"])
273
+ }, 8, ["modelValue", "content-ref"])
145
274
  ]),
146
275
  prefix: withCtx(() => [
147
276
  createVNode(_component_AntButton, {