@univerjs/docs-ui 0.5.4 → 0.5.5-experimental.20250123-34738ff
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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +23 -30
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +61 -58
- package/lib/es/index.js +7679 -7808
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/index.css +1 -1
- package/lib/types/basics/custom-decoration-factory.d.ts +1 -0
- package/lib/types/basics/paragraph.d.ts +1 -1
- package/lib/types/commands/commands/replace-content.command.d.ts +1 -0
- package/lib/types/components/list-type-picker/picker.d.ts +3 -4
- package/lib/types/controllers/doc-container-ui-controller.d.ts +1 -1
- package/lib/types/controllers/render-controllers/doc-editor-bridge.controller.d.ts +0 -3
- package/lib/types/facade/f-document.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +3 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/services/editor/editor-manager.service.d.ts +5 -177
- package/lib/types/services/editor/editor.d.ts +15 -77
- package/lib/types/services/selection/doc-selection-render.service.d.ts +7 -10
- package/lib/types/views/count-bar/CountBar.d.ts +16 -2
- package/lib/types/views/count-bar/ZoomSlider.d.ts +16 -2
- package/lib/types/views/doc-container/DocContainer.d.ts +5 -5
- package/lib/types/views/doc-footer/DocFooter.d.ts +16 -2
- package/lib/types/views/header-footer/panel/DocHeaderFooterOptions.d.ts +16 -2
- package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +16 -2
- package/lib/types/views/paragraph-setting/Setting.d.ts +1 -2
- package/lib/types/views/paragraph-setting/index.d.ts +16 -2
- package/lib/types/{commands/commands/__tests__/inline-format.command.spec.d.ts → views/rich-text-editor/hooks/index.d.ts} +2 -1
- package/lib/types/views/rich-text-editor/hooks/useEditor.d.ts +11 -0
- package/lib/types/views/rich-text-editor/hooks/useKeyboardEvent.d.ts +10 -0
- package/lib/types/views/rich-text-editor/hooks/useLeftAndRightArrow.d.ts +3 -0
- package/lib/types/views/rich-text-editor/hooks/useOnChange.d.ts +3 -0
- package/lib/types/views/rich-text-editor/index.d.ts +22 -0
- package/lib/types/views/table/create/TableCreate.d.ts +16 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +23 -30
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +12 -13
- package/LICENSE +0 -176
- package/lib/types/commands/commands/__tests__/clipboard.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/core-editing.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -34
- package/lib/types/commands/commands/__tests__/replace-content.command.spec.d.ts +0 -16
- package/lib/types/components/editor/TextEditor.d.ts +0 -36
- package/lib/types/components/range-selector/RangeSelector.d.ts +0 -24
package/lib/cjs/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),docsUi=require("@univerjs/docs-ui"),engineRender=require("@univerjs/engine-render");var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),_a;exports.FDocument=(_a=class{constructor(_documentDataModel,_injector,_univerInstanceService,_commandService,_resourceManagerService,_renderManagerService){__publicField(this,"id");this._documentDataModel=_documentDataModel,this._injector=_injector,this._univerInstanceService=_univerInstanceService,this._commandService=_commandService,this._resourceManagerService=_resourceManagerService,this._renderManagerService=_renderManagerService,this.id=this._documentDataModel.getUnitId()}getId(){return this._documentDataModel.getUnitId()}getName(){return this.getSnapshot().title||""}getSnapshot(){const resources=this._resourceManagerService.getResourcesByType(this.id,core.UniverInstanceType.UNIVER_DOC),snapshot=this._documentDataModel.getSnapshot();return snapshot.resources=resources,snapshot}undo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(core.UndoCommand.id)}redo(){return this._univerInstanceService.focusUnit(this.id),this._commandService.executeCommand(core.RedoCommand.id)}appendText(text){const unitId=this.id,{body}=this.getSnapshot();if(!body)throw new Error("The document body is empty");const lastPosition=body.dataStream.length-2,activeRange={startOffset:lastPosition,endOffset:lastPosition,collapsed:!0,segmentId:""},{segmentId}=activeRange;return this._commandService.executeCommand(docsUi.InsertCommand.id,{unitId,body:{dataStream:text},range:activeRange,segmentId})}setSelection(startOffset,endOffset){var _a2;const docSelectionRenderService=(_a2=this._renderManagerService.getRenderById(this.getId()))==null?void 0:_a2.with(docsUi.DocSelectionRenderService);docSelectionRenderService==null||docSelectionRenderService.removeAllRanges(),docSelectionRenderService==null||docSelectionRenderService.addDocRanges([{startOffset,endOffset,rangeType:core.DOC_RANGE_TYPE.TEXT}],!0)}},__name(_a,"FDocument"),_a);exports.FDocument=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IUniverInstanceService),__decorateParam(3,core.ICommandService),__decorateParam(4,core.IResourceManagerService),__decorateParam(5,engineRender.IRenderManagerService)],exports.FDocument);const _FUniverDocsMixin=class _FUniverDocsMixin extends core.FUniver{createUniverDoc(data){const document=this._univerInstanceService.createUnit(core.UniverInstanceType.UNIVER_DOC,data);return this._injector.createInstance(exports.FDocument,document)}getActiveDocument(){const document=this._univerInstanceService.getCurrentUnitForType(core.UniverInstanceType.UNIVER_DOC);return document?this._injector.createInstance(exports.FDocument,document):null}getUniverDoc(id){const document=this._univerInstanceService.getUniverDocInstance(id);return document?this._injector.createInstance(exports.FDocument,document):null}};__name(_FUniverDocsMixin,"FUniverDocsMixin");let FUniverDocsMixin=_FUniverDocsMixin;core.FUniver.extend(FUniverDocsMixin);
|