@ones-editor/editor 2.2.12-beta.2 → 2.2.12-beta.4

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.js CHANGED
@@ -5076,74 +5076,113 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
5076
5076
  justify-content: start;
5077
5077
  }
5078
5078
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office].hover [data-type=block-content] {
5079
- border-radius: 3px;
5079
+ border-radius: 6px;
5080
5080
  }
5081
5081
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] {
5082
- max-width: 360px;
5083
- height: 48px;
5082
+ max-width: 100%;
5084
5083
  cursor: pointer;
5085
5084
  }
5086
5085
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root {
5087
5086
  display: flex;
5088
- align-items: center;
5089
- max-width: 100%;
5090
- background-color: #f5f6f7;
5091
- border-radius: 3px;
5087
+ align-items: flex-start;
5088
+ width: 100%;
5089
+ background-color: #ffffff;
5090
+ border-radius: 6px;
5091
+ border: 1px solid #DFE1E5;
5092
+ padding: 10px;
5092
5093
  }
5093
5094
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root::before {
5094
5095
  border-radius: 3px;
5095
5096
  }
5097
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root:hover {
5098
+ background-color: rgba(0, 36, 90, 0.04);
5099
+ }
5096
5100
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details {
5097
5101
  display: flex;
5098
5102
  flex-direction: column;
5099
5103
  justify-content: center;
5100
5104
  font-size: 14px;
5101
- flex-grow: 1;
5105
+ flex: 1;
5106
+ min-width: 0;
5102
5107
  }
5103
5108
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name {
5104
- color: #1f2329;
5105
- max-width: 185px;
5109
+ color: #2D2D2E;
5110
+ max-width: 100%;
5106
5111
  display: flex;
5107
5112
  flex-direction: row;
5108
5113
  align-items: center;
5109
5114
  white-space: nowrap;
5115
+ font-size: 14px;
5116
+ }
5117
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name-pre {
5118
+ text-overflow: ellipsis;
5119
+ overflow: hidden;
5110
5120
  }
5111
- div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-size {
5112
- color: #646a73;
5121
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info {
5122
+ display: flex;
5123
+ flex-direction: row;
5124
+ align-items: center;
5125
+ margin-top: 5px;
5126
+ color: #87888A;
5113
5127
  font-size: 12px;
5114
- margin-top: 2px;
5115
5128
  }
5116
- div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-details .file-name-pre {
5129
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .file-creator {
5130
+ max-width: 80px;
5131
+ white-space: nowrap;
5132
+ overflow: hidden;
5117
5133
  text-overflow: ellipsis;
5134
+ }
5135
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .uploaded-time {
5136
+ margin-left: 5px;
5137
+ white-space: nowrap;
5118
5138
  overflow: hidden;
5139
+ text-overflow: ellipsis;
5140
+ }
5141
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .file-size {
5142
+ margin-left: 15px;
5143
+ flex-shrink: 0;
5144
+ }
5145
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions {
5146
+ align-self: center;
5147
+ display: flex;
5148
+ column-gap: 15px;
5149
+ margin-right: 10px;
5150
+ margin-left: 5px;
5119
5151
  }
5120
5152
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button {
5121
- width: 34px;
5122
- height: 34px;
5123
- background-color: #ffffff;
5124
- border: 1px solid #dee0e3;
5125
- border-radius: 50%;
5126
- margin: 0 8px;
5127
5153
  padding: 0;
5128
- background-repeat: no-repeat;
5129
- background-position: 50%;
5154
+ border: 0;
5155
+ background-color: transparent;
5130
5156
  cursor: pointer;
5131
5157
  display: flex;
5132
5158
  align-items: center;
5133
5159
  justify-content: center;
5134
5160
  flex-shrink: 0;
5161
+ color: #2D2D2E;
5135
5162
  }
5136
5163
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button svg {
5137
5164
  width: 16px;
5138
5165
  height: 16px;
5166
+ margin-right: 5px;
5167
+ color: inherit;
5168
+ }
5169
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button:hover {
5170
+ color: #0064FF;
5171
+ }
5172
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button:hover svg {
5173
+ color: #0064FF;
5174
+ }
5175
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions button.disabled {
5176
+ cursor: not-allowed;
5177
+ opacity: 0.5;
5178
+ color: #2D2D2E;
5139
5179
  }
5140
5180
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-icon {
5141
5181
  display: flex;
5142
5182
  flex-direction: row;
5143
5183
  align-items: center;
5144
- width: 36px;
5145
- height: 36px;
5146
- margin: 6px 6px 6px 12px;
5184
+ margin-right: 10px;
5185
+ transform: translateY(3px);
5147
5186
  }
5148
5187
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-icon > svg {
5149
5188
  width: 24px;
@@ -8162,6 +8201,13 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-embe
8162
8201
  }
8163
8202
  .video-tooltip-align-style-section .style-icon.active {
8164
8203
  color: blue;
8204
+ }.editor-command-bar-root .editor-command-bar .command-item .ask-ai {
8205
+ display: flex;
8206
+ align-items: center;
8207
+ }
8208
+ .editor-command-bar-root .editor-command-bar .command-item .ask-ai .button-text {
8209
+ margin-left: 5px;
8210
+ margin-right: 5px;
8165
8211
  }`)),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
8166
8212
  var __defProp = Object.defineProperty;
8167
8213
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -47695,8 +47741,23 @@ ${codeText}
47695
47741
  }
47696
47742
  }
47697
47743
  }
47744
+ function getBlockAllItemIds(commands) {
47745
+ const result2 = [];
47746
+ function recurse(items) {
47747
+ items.forEach((command) => {
47748
+ var _a;
47749
+ result2.push(command.id);
47750
+ if ((_a = command.children) == null ? void 0 : _a.length) {
47751
+ recurse(command.children);
47752
+ }
47753
+ });
47754
+ }
47755
+ recurse(commands);
47756
+ return result2;
47757
+ }
47698
47758
  for (let i = 0; i < blockCommands.length; i++) {
47699
- if (blockCommands[i].commands.find((c) => c.id === item.id)) {
47759
+ const commandIds = getBlockAllItemIds(blockCommands[i].commands);
47760
+ if (commandIds.find((id) => id === item.id)) {
47700
47761
  blockCommands[i].executeCommand(editor, block, item, child);
47701
47762
  return;
47702
47763
  }
@@ -69166,6 +69227,9 @@ ${codeText}
69166
69227
  };
69167
69228
  }
69168
69229
  getTextCommands(editor, range) {
69230
+ if (isSelectedTitleBlock(editor)) {
69231
+ return [];
69232
+ }
69169
69233
  if (range.isCollapsed()) {
69170
69234
  return [];
69171
69235
  }
@@ -75605,7 +75669,7 @@ ${content}
75605
75669
  return null;
75606
75670
  }
75607
75671
  }
75608
- const toolbar = "";
75672
+ const toolbar$1 = "";
75609
75673
  const logger$D = getLogger("ReAuthToolbar");
75610
75674
  class ReAuthToolbar {
75611
75675
  constructor(editor) {
@@ -76326,7 +76390,7 @@ ${content}
76326
76390
  return FilePreviewType2;
76327
76391
  })(FilePreviewType || {});
76328
76392
  const AttachIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.49669 1C4.80282 1 3.0118 2.3515 3.0118 3.76237L3 10.6206M6.49669 1C8.41943 1 10.0154 2.60058 10.0154 4.17342M6.49669 1C7.43289 1 8.28684 1.42118 8.90405 1.96796C9.50746 2.50252 10.0154 3.29036 10.0154 4.17342M10.0154 4.17342L10.0154 9.61446C10.0154 10.4166 9.23033 11.2316 8 11.2316C6.91283 11.2316 6.01026 10.5735 6.01026 9.87981L5.98457 5.04102M3 10.6206C3 13.1126 5.38055 15 8 15M3 10.6206C3 12.9301 5.13252 15 8 15M8 15C10.6194 15 13 13.1988 13 10.7068M8 15C10.8675 15 13 13.0162 13 10.7068M13 10.7068V5.04102" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>\n<path d="M13 4V10C13 12.7614 10.7614 15 8 15C5.23858 15 3 12.7614 3 10V4.5" stroke="currentColor"/>\n<path d="M10 9V4.5C10 2.567 8.433 1 6.5 1C4.567 1 3 2.567 3 4.5" stroke="currentColor"/>\n<path d="M10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9V4" stroke="currentColor"/>\n</svg>';
76329
- const DownloadIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 8.94336L2 12.9434C2 13.4956 2.44772 13.9434 3 13.9434L13 13.9434C13.5523 13.9434 14 13.4956 14 12.9434L14 8.94336" stroke="#606060"/>\n<path d="M4.015 5.4597L8.00002 9.44472L11.9835 5.4597" stroke="#606060"/>\n<path d="M7.99994 9.44471L8 0" stroke="#606060"/>\n</svg>\n';
76393
+ const DownloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16" >\n <path stroke="currentColor" d="M2 9.943v4a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-4" />\n <path stroke="currentColor" d="M4.015 6.46 8 10.445l3.983-3.985M8 10.445V1" />\n <path stroke="currentColor" d="M2 9.943v4a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-4" />\n <path stroke="currentColor" d="M4.015 6.46 8 10.445l3.983-3.985M8 10.445V1" />\n</svg>';
76330
76394
  const ToLinkIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="0.5" y="5.5" width="5" height="5" rx="1" stroke="currentColor"/>\n<path d="M0 2.5L16 2.5" stroke="currentColor"/>\n<path d="M0 13.5L16 13.5" stroke="currentColor"/>\n<path d="M8 8L16 8" stroke="currentColor"/>\n</svg>\n';
76331
76395
  const ToCardIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="0.5" y="5.5" width="15" height="5" rx="1" stroke="currentColor"/>\n<path d="M0 2.5L16 2.5" stroke="currentColor"/>\n<path d="M0 13.5L16 13.5" stroke="currentColor"/>\n</svg>\n';
76332
76396
  const fileBoxStyle = "";
@@ -76426,7 +76490,9 @@ ${content}
76426
76490
  previewType: FilePreviewType.Card,
76427
76491
  fileName: boxData.fileName,
76428
76492
  fileSize: boxData.fileSize,
76429
- fileType: boxData.fileType
76493
+ fileType: boxData.fileType,
76494
+ created: boxData.created,
76495
+ creator: boxData.creator
76430
76496
  };
76431
76497
  if (offset.start === 0) {
76432
76498
  if (getBlockTextLength$6(editor, block) === 1) {
@@ -76524,6 +76590,7 @@ ${content}
76524
76590
  toStandardText,
76525
76591
  getResources: getResources$1
76526
76592
  };
76593
+ const CopilotIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">\n <g clip-path="url(#clip0_1985_35427)">\n <g filter="url(#filter0_i_1985_35427)">\n <path d="M16 8.5C16 12.9183 12.4183 16.5 8 16.5C3.58172 16.5 0 12.9183 0 8.5C0 4.08172 3.58172 0.5 8 0.5C12.4183 0.5 16 4.08172 16 8.5ZM4 8.5C4 10.7091 5.79086 12.5 8 12.5C10.2091 12.5 12 10.7091 12 8.5C12 6.29086 10.2091 4.5 8 4.5C5.79086 4.5 4 6.29086 4 8.5Z" fill="url(#paint0_linear_1985_35427)"/>\n </g>\n </g>\n <defs>\n <filter id="filter0_i_1985_35427" x="0" y="0.5" width="16" height="16.4" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feMorphology radius="0.399999" operator="erode" in="SourceAlpha" result="effect1_innerShadow_1985_35427"/>\n <feOffset dy="0.399999"/>\n <feGaussianBlur stdDeviation="0.999998"/>\n <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n <feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0"/>\n <feBlend mode="normal" in2="shape" result="effect1_innerShadow_1985_35427"/>\n </filter>\n <linearGradient id="paint0_linear_1985_35427" x1="15.9116" y1="8.4558" x2="-5.82481e-07" y2="8.4558" gradientUnits="userSpaceOnUse">\n <stop stop-color="#02F563"/>\n <stop offset="0.997672" stop-color="#2BFFE6"/>\n </linearGradient>\n <clipPath id="clip0_1985_35427">\n <rect width="16" height="16" fill="white" transform="translate(0 0.5)"/>\n </clipPath>\n </defs>\n</svg>';
76527
76594
  const DwgFileIcon = '<svg width="48" height="48" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 1C13.5 2.5 14 3 16 5V15.6087C16 15.7914 15.9638 15.9723 15.8934 16.1411C15.8231 16.3099 15.7199 16.4633 15.5899 16.5925C15.4599 16.7217 15.3056 16.8242 15.1358 16.8941C14.9659 16.964 14.7838 17 14.6 17H3.4C3.21615 17 3.0341 16.964 2.86424 16.8941C2.69439 16.8242 2.54005 16.7217 2.41005 16.5925C2.28005 16.4633 2.17693 16.3099 2.10657 16.1411C2.03621 15.9723 2 15.7914 2 15.6087V2.3913C2 2.2086 2.03621 2.02768 2.10657 1.85888C2.17693 1.69007 2.28005 1.5367 2.41005 1.4075C2.54005 1.27831 2.69439 1.17583 2.86424 1.10591C3.0341 1.03599 3.21615 1 3.4 1H12Z" fill="#FFBE5A"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 7.5V11.1H8.7C9.69411 11.1 10.5 10.2941 10.5 9.3C10.5 8.30589 9.69411 7.5 8.7 7.5H7.5ZM7 6C6.44772 6 6 6.44771 6 7V11.6C6 12.1523 6.44772 12.6 7 12.6H8.7C10.5225 12.6 12 11.1225 12 9.3C12 7.47746 10.5225 6 8.7 6H7Z" fill="white"/>\n<path d="M12 1L14 3L16 5H13.3333C12.9797 5 12.6406 4.84675 12.3905 4.57397C12.1405 4.30119 12 3.93122 12 3.54546V1Z" fill="#FFD89C"/>\n</svg>';
76528
76595
  const RvtFileIcon = '<svg width="48" height="48" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 1C13.5 2.5 14 3 16 5V15.6087C16 15.7914 15.9638 15.9723 15.8934 16.1411C15.8231 16.3099 15.7199 16.4633 15.5899 16.5925C15.4599 16.7217 15.3056 16.8242 15.1358 16.8941C14.9659 16.964 14.7838 17 14.6 17H3.4C3.21615 17 3.0341 16.964 2.86424 16.8941C2.69439 16.8242 2.54005 16.7217 2.41005 16.5925C2.28005 16.4633 2.17693 16.3099 2.10657 16.1411C2.03621 15.9723 2 15.7914 2 15.6087V2.3913C2 2.2086 2.03621 2.02768 2.10657 1.85888C2.17693 1.69007 2.28005 1.5367 2.41005 1.4075C2.54005 1.27831 2.69439 1.17583 2.86424 1.10591C3.0341 1.03599 3.21615 1 3.4 1H12Z" fill="#6B77F3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 6.90039V8.70039H9.6C10.0971 8.70039 10.5 8.29745 10.5 7.80039C10.5 7.30333 10.0971 6.90039 9.6 6.90039H7.5ZM7 5.40039C6.44772 5.40039 6 5.84811 6 6.40039V7.0504V9.20039V12.1504C6 12.3989 6.20147 12.6004 6.45 12.6004C6.69853 12.6004 6.9 12.3989 6.9 12.1504V10.1955C6.93289 10.1987 6.96625 10.2004 7 10.2004H9.6C9.6944 10.2004 9.78753 10.1949 9.87909 10.1843L11.1521 12.3892C11.2764 12.6045 11.5516 12.6782 11.7668 12.554C11.982 12.4297 12.0558 12.1545 11.9315 11.9392L10.7564 9.90392C11.4977 9.4955 12 8.7066 12 7.80039C12 6.47491 10.9255 5.40039 9.6 5.40039H7Z" fill="white"/>\n<path d="M12 1L14 3L16 5H13.3333C12.9797 5 12.6406 4.84675 12.3905 4.57397C12.1405 4.30119 12 3.93122 12 3.54546V1Z" fill="#B5BBF9"/>\n</svg>';
76529
76596
  const SkpFileIcon = '<svg width="48" height="48" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 1C13.5 2.5 14 3 16 5V15.6087C16 15.7914 15.9638 15.9723 15.8934 16.1411C15.8231 16.3099 15.72 16.4633 15.5899 16.5925C15.4599 16.7217 15.3056 16.8242 15.1358 16.8941C14.9659 16.964 14.7838 17 14.6 17H3.4C3.21615 17 3.0341 16.964 2.86424 16.8941C2.69439 16.8242 2.54005 16.7217 2.41005 16.5925C2.28005 16.4633 2.17693 16.3099 2.10657 16.1411C2.03621 15.9723 2 15.7914 2 15.6087V2.3913C2 2.2086 2.03621 2.02768 2.10657 1.85888C2.17693 1.69007 2.28005 1.5367 2.41005 1.4075C2.54005 1.27831 2.69439 1.17583 2.86424 1.10591C3.0341 1.03599 3.21615 1 3.4 1H12Z" fill="#9773E3"/>\n<path d="M12 1L14 3L16 5H13.3333C12.9797 5 12.6406 4.84675 12.3905 4.57397C12.1405 4.30119 12 3.93122 12 3.54546V1Z" fill="#D8CAF4"/>\n<path d="M10.6499 6.375H8.21241C7.48753 6.375 6.8999 6.96263 6.8999 7.68751V7.68751C6.8999 8.41239 7.48753 9.00001 8.21241 9.00001H9.79277" stroke="white" stroke-width="1.2" stroke-linecap="round"/>\n<path d="M7.27488 11.025C6.94351 11.025 6.67488 11.2936 6.67488 11.625C6.67488 11.9564 6.94351 12.225 7.27488 12.225V11.025ZM9.71239 11.025H7.27488V12.225H9.71239V11.025ZM8.39989 9.59999H9.7124V8.39999H8.39989V9.59999ZM9.7124 9.59999C10.1059 9.59999 10.4249 9.91899 10.4249 10.3125H11.6249C11.6249 9.25624 10.7686 8.39999 9.7124 8.39999V9.59999ZM9.71239 12.225C10.7686 12.225 11.6249 11.3687 11.6249 10.3125H10.4249C10.4249 10.706 10.1059 11.025 9.71239 11.025V12.225Z" fill="white"/>\n</svg>';
@@ -76575,8 +76642,8 @@ ${content}
76575
76642
  return UnknownFileIcon;
76576
76643
  }
76577
76644
  async function renderFileCard(editor, content, data2) {
76578
- var _a;
76579
- const { fileName, fileType, fileSize } = data2;
76645
+ var _a, _b;
76646
+ const { fileName, fileType, fileSize, created, creator, src } = data2;
76580
76647
  const card = createElement("div", ["card-root"], content);
76581
76648
  const icon = createElement("div", ["file-icon"], card);
76582
76649
  const { renderFileCardIcon } = ((_a = editor.options.componentsOptions) == null ? void 0 : _a.file) || {};
@@ -76600,15 +76667,34 @@ ${content}
76600
76667
  } else {
76601
76668
  nameElement.textContent = fileName;
76602
76669
  }
76603
- createElement("div", ["file-size"], detail, formatBytes(fileSize));
76670
+ const infos = createElement("div", ["file-info"], detail);
76671
+ if (creator) {
76672
+ createElement("div", ["file-creator"], infos, creator);
76673
+ }
76674
+ if (created) {
76675
+ const timeText = i18n$1.t("file.uploadedTime", { time: formatDate(new Date(created), "YYYY-MM-DD hh:mm") });
76676
+ createElement("div", ["uploaded-time"], infos, timeText);
76677
+ }
76678
+ createElement("div", ["file-size"], infos, formatBytes(fileSize));
76604
76679
  const actions2 = createElement("div", ["file-actions"], card);
76605
76680
  const options = editor.getComponentOptions("file");
76681
+ let copilotButton;
76682
+ const checkCopilotMethod = (_b = editor.getComponentOptions("custom")) == null ? void 0 : _b.checkCopilotReadyItem;
76683
+ if (checkCopilotMethod) {
76684
+ const copilotEnabled = checkCopilotMethod(src);
76685
+ if (copilotEnabled) {
76686
+ copilotButton = createElement("button", ["copilot"], actions2);
76687
+ copilotButton.innerHTML = CopilotIcon;
76688
+ createElement("span", [], copilotButton, i18n$1.t("file.askAi"));
76689
+ }
76690
+ }
76606
76691
  let downloadButton;
76607
76692
  if (options.canDownload) {
76608
76693
  downloadButton = createElement("button", ["download"], actions2);
76609
76694
  downloadButton.innerHTML = DownloadIcon;
76695
+ createElement("span", [], downloadButton, i18n$1.t("file.commands.download"));
76610
76696
  }
76611
- return { card, downloadButton };
76697
+ return { card, downloadButton, copilotButton };
76612
76698
  }
76613
76699
  const fileCardStyle = "";
76614
76700
  function downloadFile(editor, block) {
@@ -76627,7 +76713,7 @@ ${content}
76627
76713
  async function createEmbedContent$7(editor, content, blockData) {
76628
76714
  const { embedData } = blockData;
76629
76715
  const fileData = embedData;
76630
- const { card, downloadButton } = await renderFileCard(editor, content, fileData);
76716
+ const { card, downloadButton, copilotButton } = await renderFileCard(editor, content, fileData);
76631
76717
  if (downloadButton) {
76632
76718
  editor.domEvents.addEventListener(downloadButton, "click", (editor2, event) => {
76633
76719
  if (!event.target) {
@@ -76640,6 +76726,21 @@ ${content}
76640
76726
  downloadFile(editor2, block);
76641
76727
  });
76642
76728
  }
76729
+ if (copilotButton) {
76730
+ editor.domEvents.addEventListener(copilotButton, "click", (editor2, event) => {
76731
+ if (!event.target) {
76732
+ return;
76733
+ }
76734
+ const block = getParentBlock(event.target);
76735
+ if (!block) {
76736
+ return;
76737
+ }
76738
+ const options = editor2.options.componentsOptions.file;
76739
+ if (options == null ? void 0 : options.onClick) {
76740
+ options.onClick(editor2, block, event, "ask-copilot");
76741
+ }
76742
+ });
76743
+ }
76643
76744
  editor.domEvents.addEventListener(card, "click", (editor2, event) => {
76644
76745
  if (!event.target) {
76645
76746
  return;
@@ -76726,6 +76827,7 @@ ${content}
76726
76827
  id: genId(),
76727
76828
  box: true,
76728
76829
  type: "file",
76830
+ creator: fileData.creator,
76729
76831
  created: Date.now(),
76730
76832
  src: fileData.src,
76731
76833
  fileName: fileData.fileName,
@@ -76823,7 +76925,10 @@ ${content}
76823
76925
  toCard: "\u8F6C\u4E3A\u5361\u7247",
76824
76926
  comment: "\u6DFB\u52A0\u6279\u6CE8",
76825
76927
  preview: "\u9884\u89C8"
76826
- }
76928
+ },
76929
+ uploadedTime: "\u4E0A\u4F20\u4E8E { time }",
76930
+ askAi: "\u8BE2\u95EE Copilot",
76931
+ aiNotSupportedByType: "\u5F53\u524D\u6587\u4EF6\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u8BE2\u95EE Copilot"
76827
76932
  }
76828
76933
  };
76829
76934
  const enUS$e = {
@@ -76835,7 +76940,10 @@ ${content}
76835
76940
  toCard: "To Card",
76836
76941
  comment: "Add annotation",
76837
76942
  preview: "Preview"
76838
- }
76943
+ },
76944
+ uploadedTime: "uploaded at { time }",
76945
+ askAi: "Ask Copilot",
76946
+ aiNotSupportedByType: "\u5F53\u524D\u6587\u4EF6\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u8BE2\u95EE Copilot"
76839
76947
  }
76840
76948
  };
76841
76949
  const jaJP$e = {
@@ -76847,7 +76955,10 @@ ${content}
76847
76955
  toCard: "\u30AB\u30FC\u30C9\u306B\u5909\u63DB",
76848
76956
  comment: "\u6CE8\u91C8\u3092\u8FFD\u52A0",
76849
76957
  preview: "\u30D7\u30EC\u30D3\u30E5\u30FC"
76850
- }
76958
+ },
76959
+ uploadedTime: "\u304C {time} \u306B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u307E\u3057\u305F",
76960
+ askAi: "Copilot \u306B\u805E\u304F",
76961
+ aiNotSupportedByType: "\u5F53\u524D\u6587\u4EF6\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u8BE2\u95EE Copilot"
76851
76962
  }
76852
76963
  };
76853
76964
  i18n$1.mergeLang({
@@ -85695,6 +85806,7 @@ ${data2.flowchartText}
85695
85806
  function isReservedMediaSrc(src) {
85696
85807
  return src === ReservedMediaSrcType.Empty || src === ReservedMediaSrcType.Error;
85697
85808
  }
85809
+ const toolbar = "";
85698
85810
  const logger$8 = getLogger("media");
85699
85811
  class Media extends tinyTypedEmitter.TypedEmitter {
85700
85812
  constructor(options) {
@@ -88283,7 +88395,7 @@ ${data2.flowchartText}
88283
88395
  }
88284
88396
  }
88285
88397
  });
88286
- editor.version = "2.2.12-beta.2";
88398
+ editor.version = "2.2.12-beta.4";
88287
88399
  return editor;
88288
88400
  }
88289
88401
  function isDoc(doc2) {
@@ -88378,7 +88490,7 @@ ${data2.flowchartText}
88378
88490
  });
88379
88491
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
88380
88492
  OnesEditorToolbar.register(editor);
88381
- editor.version = "2.2.12-beta.2";
88493
+ editor.version = "2.2.12-beta.4";
88382
88494
  return editor;
88383
88495
  }
88384
88496
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.2.12-beta.2",
3
+ "version": "2.2.12-beta.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",