@univerjs/docs-ui 0.4.2 → 0.5.0-beta.0

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.
Files changed (47) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +14 -14
  3. package/lib/cjs/locale/en-US.js +1 -0
  4. package/lib/cjs/locale/fa-IR.js +1 -0
  5. package/lib/cjs/locale/ru-RU.js +1 -0
  6. package/lib/cjs/locale/vi-VN.js +1 -0
  7. package/lib/cjs/locale/zh-CN.js +1 -0
  8. package/lib/cjs/locale/zh-TW.js +1 -0
  9. package/lib/es/facade.js +106 -0
  10. package/lib/es/index.js +7454 -7611
  11. package/lib/es/locale/en-US.js +85 -0
  12. package/lib/es/locale/fa-IR.js +85 -0
  13. package/lib/es/locale/ru-RU.js +85 -0
  14. package/lib/es/locale/vi-VN.js +85 -0
  15. package/lib/es/locale/zh-CN.js +85 -0
  16. package/lib/es/locale/zh-TW.js +85 -0
  17. package/lib/types/basics/paragraph.d.ts +4 -85
  18. package/lib/types/basics/selection.d.ts +2 -0
  19. package/lib/types/commands/commands/core-editing.command.d.ts +0 -1
  20. package/lib/types/commands/commands/doc-select-all.command.d.ts +5 -0
  21. package/lib/types/commands/commands/inline-format.command.d.ts +3 -1
  22. package/lib/types/controllers/doc-header-footer.controller.d.ts +0 -1
  23. package/lib/types/facade/f-document.d.ts +34 -0
  24. package/lib/types/facade/f-univer.d.ts +34 -0
  25. package/lib/types/facade/index.d.ts +17 -0
  26. package/lib/types/index.d.ts +2 -4
  27. package/lib/types/services/doc-menu-style.service.d.ts +6 -2
  28. package/lib/types/services/doc-popup-manager.service.d.ts +3 -3
  29. package/lib/types/services/editor/editor-manager.service.d.ts +63 -0
  30. package/lib/umd/facade.js +1 -0
  31. package/lib/umd/index.js +14 -14
  32. package/lib/umd/locale/en-US.js +1 -0
  33. package/lib/umd/locale/fa-IR.js +1 -0
  34. package/lib/umd/locale/ru-RU.js +1 -0
  35. package/lib/umd/locale/vi-VN.js +1 -0
  36. package/lib/umd/locale/zh-CN.js +1 -0
  37. package/lib/umd/locale/zh-TW.js +1 -0
  38. package/package.json +38 -21
  39. package/lib/locale/en-US.json +0 -82
  40. package/lib/locale/fa-IR.json +0 -82
  41. package/lib/locale/ru-RU.json +0 -82
  42. package/lib/locale/vi-VN.json +0 -82
  43. package/lib/locale/zh-CN.json +0 -82
  44. package/lib/locale/zh-TW.json +0 -82
  45. package/lib/types/basics/custom-range-factory.d.ts +0 -25
  46. package/lib/types/basics/replace.d.ts +0 -20
  47. package/lib/types/commands/operations/select-all.operation.d.ts +0 -5
@@ -0,0 +1 @@
1
+ "use strict";var m=Object.defineProperty;var v=(s,e,t)=>e in s?m(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var u=(s,e,t)=>v(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@univerjs/core"),d=require("@univerjs/docs-ui"),h=require("@univerjs/engine-render");var _=Object.defineProperty,g=Object.getOwnPropertyDescriptor,I=(s,e,t,n)=>{for(var r=n>1?void 0:n?g(e,t):e,i=s.length-1,o;i>=0;i--)(o=s[i])&&(r=(n?o(e,t,r):o(r))||r);return n&&r&&_(e,t,r),r},a=(s,e)=>(t,n)=>e(t,n,s);exports.FDocument=class{constructor(e,t,n,r,i,o){u(this,"id");this._documentDataModel=e,this._injector=t,this._univerInstanceService=n,this._commandService=r,this._resourceManagerService=i,this._renderManagerService=o,this.id=this._documentDataModel.getUnitId()}getId(){return this._documentDataModel.getUnitId()}getName(){return this.getSnapshot().title||""}getSnapshot(){const e=this._resourceManagerService.getResourcesByType(this.id,c.UniverInstanceType.UNIVER_DOC),t=this._documentDataModel.getSnapshot();return t.resources=e,t}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(c.UndoCommand.id)}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(c.RedoCommand.id)}appendText(e){const t=this.id,{body:n}=this.getSnapshot();if(!n)throw new Error("The document body is empty");const r=n.dataStream.length-2,i={startOffset:r,endOffset:r,collapsed:!0,segmentId:""},{segmentId:o}=i;return this._commandService.executeCommand(d.InsertCommand.id,{unitId:t,body:{dataStream:e},range:i,segmentId:o})}setSelection(e,t){var r;const n=(r=this._renderManagerService.getRenderById(this.getId()))==null?void 0:r.with(d.DocSelectionRenderService);n==null||n.removeAllRanges(),n==null||n.addDocRanges([{startOffset:e,endOffset:t,rangeType:c.DOC_RANGE_TYPE.TEXT}],!0)}};exports.FDocument=I([a(1,c.Inject(c.Injector)),a(2,c.IUniverInstanceService),a(3,c.ICommandService),a(4,c.IResourceManagerService),a(5,h.IRenderManagerService)],exports.FDocument);class D extends c.FUniver{createUniverDoc(e){const t=this._univerInstanceService.createUnit(c.UniverInstanceType.UNIVER_DOC,e);return this._injector.createInstance(exports.FDocument,t)}getActiveDocument(){const e=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_DOC);return e?this._injector.createInstance(exports.FDocument,e):null}getUniverDoc(e){const t=this._univerInstanceService.getUniverDocInstance(e);return t?this._injector.createInstance(exports.FDocument,t):null}}c.FUniver.extend(D);