@ones-editor/editor 0.0.3-beta.91 → 0.0.3-beta.92

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
@@ -631,7 +631,7 @@ width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
631
631
  <g id="" stroke="none" stroke-width="1" fill-rule="evenodd">
632
632
  <path stroke="currentColor" d="M19.284802,16.9726267 C19.4891443,16.9726267 19.6594295,17.0421598 19.7956577,17.1812261 C19.9318859,17.3202923 20,17.4891585 20,17.6878246 C20,17.8921669 19.9318859,18.0624521 19.7956577,18.1986803 C19.6594295,18.3349085 19.4891443,18.4030226 19.284802,18.4030226 L19.284802,18.4030226 L4.71519796,18.4030226 C4.51653186,18.4030226 4.34766567,18.3349085 4.2085994,18.1986803 C4.06953313,18.0624521 4,17.8921669 4,17.6878246 C4,17.4891585 4.06953313,17.3202923 4.2085994,17.1812261 C4.34766567,17.0421598 4.51653186,16.9726267 4.71519796,16.9726267 L4.71519796,16.9726267 Z M18.2486798,8.56372925 C18.8324532,8.56372925 19.2702832,8.70711219 19.5621699,8.99387807 C19.8540566,9.28064395 20,9.71335319 20,10.2920058 L20,10.2920058 L20,13.1033356 C20,13.6819882 19.8540566,14.1159776 19.5621699,14.4053039 C19.2702832,14.6946302 18.8324532,14.8392933 18.2486798,14.8392933 L18.2486798,14.8392933 L5.75132021,14.8392933 C5.16754681,14.8392933 4.72971675,14.6946302 4.43783005,14.4053039 C4.14594335,14.1159776 4,13.6819882 4,13.1033356 L4,13.1033356 L4,10.2920058 C4,9.71335319 4.14594335,9.28064395 4.43783005,8.99387807 C4.72971675,8.70711219 5.16754681,8.56372925 5.75132021,8.56372925 L5.75132021,8.56372925 Z M18.1027364,9.81576957 L5.88958233,9.81576957 C5.68474956,9.81576957 5.52728437,9.86953818 5.41718675,9.97707538 C5.30708913,10.0846126 5.25204033,10.2459184 5.25204033,10.4609928 L5.25204033,10.4609928 L5.25204033,12.9343485 C5.25204033,13.149423 5.30708913,13.3107288 5.41718675,13.418266 C5.52728437,13.5258032 5.68474956,13.5795718 5.88958233,13.5795718 L5.88958233,13.5795718 L18.1027364,13.5795718 C18.3075692,13.5795718 18.4650344,13.5258032 18.575132,13.418266 C18.6852296,13.3107288 18.7402784,13.149423 18.7402784,12.9343485 L18.7402784,12.9343485 L18.7402784,10.4609928 C18.7402784,10.2459184 18.6852296,10.0846126 18.575132,9.97707538 C18.4650344,9.86953818 18.3075692,9.81576957 18.1027364,9.81576957 L18.1027364,9.81576957 Z M19.284802,5 C19.4891443,5 19.6594295,5.06953313 19.7956577,5.2085994 C19.9318859,5.34766567 20,5.51653186 20,5.71519796 C20,5.91954023 19.9318859,6.08982546 19.7956577,6.22605364 C19.6594295,6.36228182 19.4891443,6.43039591 19.284802,6.43039591 L19.284802,6.43039591 L4.71519796,6.43039591 C4.51653186,6.43039591 4.34766567,6.36228182 4.2085994,6.22605364 C4.06953313,6.08982546 4,5.91954023 4,5.71519796 C4,5.51653186 4.06953313,5.34766567 4.2085994,5.2085994 C4.34766567,5.06953313 4.51653186,5 4.71519796,5 L4.71519796,5 Z" fill-rule="nonzero"></path>
633
633
  </g>
634
- </svg>`,nq="";w("file-box");function S6(n,t){const e=n.getBoxData(t),o=n.doc.buildResourceUrl(e.src,{downloadFileName:e.fileName});Nl(o,e.fileName)}class a${constructor(t){h(this,"group","file-box-commands");h(this,"_commands",[{id:"download",name:"Download",icon:Df},{id:"to-link",name:"To link",icon:x6,states:["checked"]},{id:"to-card",name:"To card",icon:T6}]);this.editor=t}get commands(){return this.editor.readonly?this._commands.filter(t=>t.id!=="to-link"&&t.id!=="to-card"):this._commands}executeCommand(t,e,o,r){if(r.id==="to-card"){const i=j(e),s=q(i),l=X(e)+1,c=t.getBoxData(o),a=mo(e,o);t.undoManager.runInGroup(()=>{const d={src:c.src,previewType:I6.Card,fileName:c.fileName,fileSize:c.fileSize,fileType:c.fileType};a.start===0?G(t,e)===1?(t.deleteBlock(e),t.insertEmbed(s,l-1,"office",d)):(t.deleteTextFromBlock(e,a.start,1),t.insertEmbed(s,l-1,"office",d)):a.start===G(t,e)-1?(t.deleteTextFromBlock(e,a.start,1),t.insertEmbed(s,l,"office",d)):(t.deleteTextFromBlock(e,a.start,1),jr(t,e,a.start,{forceInsertAfter:!0}),t.insertEmbed(s,l,"office",d))})}else r.id==="download"&&S6(t,o)}}function u$(n,t,e,o){const r=o,i=b("a",["file-container"],e),s=b("span",["file-icon"],i);s.innerHTML=c$,b("span",["file-name"],i,r.fileName),i.setAttribute("data-file-id",r.id),i.setAttribute("data-file-src",r.src)}function d$(n,t,e){const o=n.options.componentsOptions.file;if(o!=null&&o.onClick){o.onClick(n,t,e);return}S6(n,t)}function h$(n,t){return{boxCommands:{"hovering-toolbar":new a$(n)}}}function f$(n,t,e,o){const r=t;return o==="html"?r.src?`<a href="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" >${r.fileName}</a>`:`[${r.fileName}]`:o==="markdown"?r.src?`[${r.fileName}](${n.doc.buildResourceUrl(r.src,{withToken:!0})})`:`[${r.fileName}]`:r.src?`[${r.fileName}](${n.doc.buildResourceUrl(r.src,{withToken:!0})})`:`[${r.fileName}]`}const D6={boxType:"file",updateBoxContent:u$,handleClickBox:d$,getBoxProperties:h$,convertTo:f$},m$=`<svg width="48" height="48" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
634
+ </svg>`,nq="";w("file-box");function S6(n,t){var i;const e=n.getBoxData(t),{onDownloadFile:o}=((i=n.options.componentsOptions)==null?void 0:i.file)||{};if(o){o(n,e);return}const r=n.doc.buildResourceUrl(e.src,{downloadFileName:e.fileName});Nl(r,e.fileName)}class a${constructor(t){h(this,"group","file-box-commands");h(this,"_commands",[{id:"download",name:"Download",icon:Df},{id:"to-link",name:"To link",icon:x6,states:["checked"]},{id:"to-card",name:"To card",icon:T6}]);this.editor=t}get commands(){return this.editor.readonly?this._commands.filter(t=>t.id!=="to-link"&&t.id!=="to-card"):this._commands}executeCommand(t,e,o,r){if(r.id==="to-card"){const i=j(e),s=q(i),l=X(e)+1,c=t.getBoxData(o),a=mo(e,o);t.undoManager.runInGroup(()=>{const d={src:c.src,previewType:I6.Card,fileName:c.fileName,fileSize:c.fileSize,fileType:c.fileType};a.start===0?G(t,e)===1?(t.deleteBlock(e),t.insertEmbed(s,l-1,"office",d)):(t.deleteTextFromBlock(e,a.start,1),t.insertEmbed(s,l-1,"office",d)):a.start===G(t,e)-1?(t.deleteTextFromBlock(e,a.start,1),t.insertEmbed(s,l,"office",d)):(t.deleteTextFromBlock(e,a.start,1),jr(t,e,a.start,{forceInsertAfter:!0}),t.insertEmbed(s,l,"office",d))})}else r.id==="download"&&S6(t,o)}}function u$(n,t,e,o){const r=o,i=b("a",["file-container"],e),s=b("span",["file-icon"],i);s.innerHTML=c$,b("span",["file-name"],i,r.fileName),i.setAttribute("data-file-id",r.id),i.setAttribute("data-file-src",r.src)}function d$(n,t,e){const o=n.options.componentsOptions.file;if(o!=null&&o.onClick){o.onClick(n,t,e);return}S6(n,t)}function h$(n,t){return{boxCommands:{"hovering-toolbar":new a$(n)}}}function f$(n,t,e,o){const r=t;return o==="html"?r.src?`<a href="${n.doc.buildResourceUrl(r.src,{withToken:!0})}" >${r.fileName}</a>`:`[${r.fileName}]`:o==="markdown"?r.src?`[${r.fileName}](${n.doc.buildResourceUrl(r.src,{withToken:!0})})`:`[${r.fileName}]`:r.src?`[${r.fileName}](${n.doc.buildResourceUrl(r.src,{withToken:!0})})`:`[${r.fileName}]`}const D6={boxType:"file",updateBoxContent:u$,handleClickBox:d$,getBoxProperties:h$,convertTo:f$},m$=`<svg width="48" height="48" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
635
635
  <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"/>
636
636
  <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"/>
637
637
  <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"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.3-beta.91",
3
+ "version": "0.0.3-beta.92",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",