@univerjs/docs-drawing 0.3.0-alpha.0 → 0.3.0-nightly.202410101606

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/index.js CHANGED
@@ -1 +1 @@
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"),drawing=require("@univerjs/drawing"),_DocDrawingService=class _DocDrawingService extends drawing.UnitDrawingService{};__name(_DocDrawingService,"DocDrawingService");let DocDrawingService=_DocDrawingService;const IDocDrawingService=core.createIdentifier("univer.doc.plugin.doc-drawing.service");var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(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&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const DOCS_DRAWING_PLUGIN="DOC_DRAWING_PLUGIN";var _a;let DocDrawingLoadController=(_a=class extends core.Disposable{constructor(_commandService){super(),this._commandService=_commandService}},__name(_a,"DocDrawingLoadController"),_a);DocDrawingLoadController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Starting,DocDrawingLoadController),__decorateParam$1(0,core.ICommandService)],DocDrawingLoadController);var _a2;let DocDrawingController=(_a2=class extends core.Disposable{constructor(_docDrawingService,_drawingManagerService,_resourceManagerService,_univerInstanceService){super(),this._docDrawingService=_docDrawingService,this._drawingManagerService=_drawingManagerService,this._resourceManagerService=_resourceManagerService,this._univerInstanceService=_univerInstanceService,this._init()}_init(){this._initSnapshot()}_initSnapshot(){const toJson=__name(unitId=>{const doc=this._univerInstanceService.getUnit(unitId,core.UniverInstanceType.UNIVER_DOC);if(doc){const drawings=doc.getSnapshot().drawings,drawingOrder=doc.getSnapshot().drawingsOrder,data={data:drawings!=null?drawings:{},order:drawingOrder!=null?drawingOrder:[]};return JSON.stringify(data)}return""},"toJson"),parseJson=__name(json=>{if(!json)return{data:{},order:[]};try{return JSON.parse(json)}catch{return{data:{},order:[]}}},"parseJson");this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:DOCS_DRAWING_PLUGIN,businesses:[core.UniverInstanceType.UNIVER_DOC],toJson:__name(unitId=>toJson(unitId),"toJson"),parseJson:__name(json=>parseJson(json),"parseJson"),onUnLoad:__name(unitId=>{this._setDrawingDataForUnit(unitId,{data:{},order:[]})},"onUnLoad"),onLoad:__name((unitId,value)=>{var _a4,_b;this._setDrawingDataForUnit(unitId,{data:(_a4=value.data)!=null?_a4:{},order:(_b=value.order)!=null?_b:[]})},"onLoad")}))}_setDrawingDataForUnit(unitId,drawingMapItem){const documentDataModel=this._univerInstanceService.getUnit(unitId);documentDataModel!=null&&(documentDataModel.resetDrawing(drawingMapItem.data,drawingMapItem.order),this._initDataLoader(unitId))}_initDataLoader(unitId){const dataModel=this._univerInstanceService.getUnit(unitId,core.UniverInstanceType.UNIVER_DOC);if(!dataModel)return!1;const subUnitId=unitId,drawingDataModels=dataModel.getDrawings(),drawingOrderModel=dataModel.getDrawingsOrder();if(!drawingDataModels||!drawingOrderModel)return!1;Object.keys(drawingDataModels).forEach(drawingId=>{const drawingDataModel=drawingDataModels[drawingId];drawingDataModels[drawingId]={...drawingDataModel}});const subDrawings={[subUnitId]:{unitId,subUnitId,data:drawingDataModels,order:drawingOrderModel}};return this._docDrawingService.registerDrawingData(unitId,subDrawings),this._drawingManagerService.registerDrawingData(unitId,subDrawings),!0}},__name(_a2,"DocDrawingController"),_a2);DocDrawingController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Starting,DocDrawingController),__decorateParam$1(0,IDocDrawingService),__decorateParam$1(1,drawing.IDrawingManagerService),__decorateParam$1(2,core.IResourceManagerService),__decorateParam$1(3,core.IUniverInstanceService)],DocDrawingController);const PLUGIN_CONFIG_KEY="docs-drawing.config",defaultPluginConfig={};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"),_a3;exports.UniverDocsDrawingPlugin=(_a3=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[DocDrawingLoadController],[DocDrawingController],[DocDrawingService],[IDocDrawingService,{useClass:DocDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_a3,"UniverDocsDrawingPlugin"),__publicField(_a3,"pluginName",DOCS_DRAWING_PLUGIN),__publicField(_a3,"type",core.UniverInstanceType.UNIVER_DOC),_a3);exports.UniverDocsDrawingPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports.UniverDocsDrawingPlugin);exports.DOCS_DRAWING_PLUGIN=DOCS_DRAWING_PLUGIN;exports.DocDrawingService=DocDrawingService;exports.IDocDrawingService=IDocDrawingService;
1
+ 'use strict';function _0x2755(_0x37c2a0,_0x25968d){const _0x30b267=_0x30b2();return _0x2755=function(_0x275537,_0x23af0a){_0x275537=_0x275537-0x1c5;let _0x50cbe3=_0x30b267[_0x275537];return _0x50cbe3;},_0x2755(_0x37c2a0,_0x25968d);}const _0x279ef2=_0x2755;(function(_0xaea070,_0x4c31e1){const _0x56eb4d=_0x2755,_0xf8cd94=_0xaea070();while(!![]){try{const _0x35a9de=-parseInt(_0x56eb4d(0x1d7))/0x1*(-parseInt(_0x56eb4d(0x1ce))/0x2)+-parseInt(_0x56eb4d(0x1cb))/0x3*(parseInt(_0x56eb4d(0x1dc))/0x4)+-parseInt(_0x56eb4d(0x1de))/0x5+parseInt(_0x56eb4d(0x1c5))/0x6*(parseInt(_0x56eb4d(0x1ec))/0x7)+-parseInt(_0x56eb4d(0x204))/0x8*(parseInt(_0x56eb4d(0x200))/0x9)+-parseInt(_0x56eb4d(0x1f1))/0xa+parseInt(_0x56eb4d(0x1c8))/0xb*(parseInt(_0x56eb4d(0x1e8))/0xc);if(_0x35a9de===_0x4c31e1)break;else _0xf8cd94['push'](_0xf8cd94['shift']());}catch(_0x3a1bee){_0xf8cd94['push'](_0xf8cd94['shift']());}}}(_0x30b2,0x81155));var __defProp=Object['defineProperty'],__defNormalProp=(_0x5a9c7e,_0xb0c497,_0x2b0353)=>_0xb0c497 in _0x5a9c7e?__defProp(_0x5a9c7e,_0xb0c497,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2b0353}):_0x5a9c7e[_0xb0c497]=_0x2b0353,__name=(_0x2c9467,_0x46bb25)=>__defProp(_0x2c9467,'name',{'value':_0x46bb25,'configurable':!0x0}),__publicField=(_0x58b61a,_0x1d9235,_0x334007)=>__defNormalProp(_0x58b61a,typeof _0x1d9235!=_0x279ef2(0x1c9)?_0x1d9235+'':_0x1d9235,_0x334007);Object[_0x279ef2(0x1e1)](exports,Symbol[_0x279ef2(0x1e7)],{'value':_0x279ef2(0x1f8)});const core=require(_0x279ef2(0x1d5)),drawing=require(_0x279ef2(0x203)),PLUGIN_CONFIG_KEY=_0x279ef2(0x1fa),defaultPluginConfig={},_DocDrawingService=class _DocDrawingService extends drawing['UnitDrawingService']{};__name(_DocDrawingService,_0x279ef2(0x1f9));let DocDrawingService=_DocDrawingService;const IDocDrawingService=core[_0x279ef2(0x1ee)](_0x279ef2(0x1f7));var __defProp$1=Object[_0x279ef2(0x1e1)],__getOwnPropDesc$1=Object[_0x279ef2(0x206)],__decorateClass$1=__name((_0xc3bd1e,_0x36952e,_0x2b97d0,_0x2c191c)=>{const _0x4cce91=_0x279ef2;for(var _0x1c8c67=_0x2c191c>0x1?void 0x0:_0x2c191c?__getOwnPropDesc$1(_0x36952e,_0x2b97d0):_0x36952e,_0x1fd60f=_0xc3bd1e[_0x4cce91(0x202)]-0x1,_0x28a40d;_0x1fd60f>=0x0;_0x1fd60f--)(_0x28a40d=_0xc3bd1e[_0x1fd60f])&&(_0x1c8c67=(_0x2c191c?_0x28a40d(_0x36952e,_0x2b97d0,_0x1c8c67):_0x28a40d(_0x1c8c67))||_0x1c8c67);return _0x2c191c&&_0x1c8c67&&__defProp$1(_0x36952e,_0x2b97d0,_0x1c8c67),_0x1c8c67;},_0x279ef2(0x1ca)),__decorateParam$1=__name((_0x3373e5,_0x2e8cb7)=>(_0xebf171,_0x48830b)=>_0x2e8cb7(_0xebf171,_0x48830b,_0x3373e5),_0x279ef2(0x1f0));const DOCS_DRAWING_PLUGIN='DOC_DRAWING_PLUGIN';var _a;let DocDrawingController=(_a=class extends core['Disposable']{constructor(_0xc603a6,_0x2d6554,_0x40d24b,_0x2cc55f){const _0x38abfb=_0x279ef2;super(),this[_0x38abfb(0x1fd)]=_0xc603a6,this['_drawingManagerService']=_0x2d6554,this[_0x38abfb(0x1c6)]=_0x40d24b,this[_0x38abfb(0x1dd)]=_0x2cc55f,this['_init']();}['_init'](){this['_initSnapshot']();}[_0x279ef2(0x1d0)](){const _0x5740f7=_0x279ef2,_0x383607=__name(_0x17ff7e=>{const _0x25c2c7=_0x2755,_0x28d168=this[_0x25c2c7(0x1dd)][_0x25c2c7(0x1eb)](_0x17ff7e,core[_0x25c2c7(0x1d6)][_0x25c2c7(0x1d9)]);if(_0x28d168){const _0x5da900=_0x28d168[_0x25c2c7(0x1f5)]()['drawings'],_0x189b15=_0x28d168['getSnapshot']()['drawingsOrder'],_0x36f548={'data':_0x5da900!=null?_0x5da900:{},'order':_0x189b15!=null?_0x189b15:[]};return JSON['stringify'](_0x36f548);}return'';},'toJson'),_0x41e2aa=__name(_0x30acc3=>{const _0xaeb09a=_0x2755;if(!_0x30acc3)return{'data':{},'order':[]};try{return JSON[_0xaeb09a(0x1e5)](_0x30acc3);}catch{return{'data':{},'order':[]};}},_0x5740f7(0x1d8));this[_0x5740f7(0x1e9)](this[_0x5740f7(0x1c6)][_0x5740f7(0x1e0)]({'pluginName':DOCS_DRAWING_PLUGIN,'businesses':[core['UniverInstanceType']['UNIVER_DOC']],'toJson':__name(_0x4f6809=>_0x383607(_0x4f6809),_0x5740f7(0x1f6)),'parseJson':__name(_0x571f04=>_0x41e2aa(_0x571f04),'parseJson'),'onUnLoad':__name(_0x8b3206=>{this['_setDrawingDataForUnit'](_0x8b3206,{'data':{},'order':[]});},_0x5740f7(0x1c7)),'onLoad':__name((_0x14e15b,_0x48baa0)=>{const _0x4c6252=_0x5740f7;var _0x33a49e,_0x36b0dc;this['_setDrawingDataForUnit'](_0x14e15b,{'data':(_0x33a49e=_0x48baa0[_0x4c6252(0x1d4)])!=null?_0x33a49e:{},'order':(_0x36b0dc=_0x48baa0['order'])!=null?_0x36b0dc:[]});},'onLoad')}));}[_0x279ef2(0x1cd)](_0x825b1c,_0x5da0fb){const _0x22f22b=_0x279ef2,_0x3e7aa5=this['_univerInstanceService'][_0x22f22b(0x1eb)](_0x825b1c);_0x3e7aa5!=null&&(_0x3e7aa5[_0x22f22b(0x1cf)](_0x5da0fb[_0x22f22b(0x1d4)],_0x5da0fb[_0x22f22b(0x1d1)]),this[_0x22f22b(0x1fc)](_0x825b1c));}['_initDataLoader'](_0x3ada99){const _0x2a2d56=_0x279ef2,_0x1bafa2=this[_0x2a2d56(0x1dd)][_0x2a2d56(0x1eb)](_0x3ada99,core['UniverInstanceType']['UNIVER_DOC']);if(!_0x1bafa2)return!0x1;const _0x1ca363=_0x3ada99,_0x2f609d=_0x1bafa2['getDrawings'](),_0x5d2351=_0x1bafa2['getDrawingsOrder']();if(!_0x2f609d||!_0x5d2351)return!0x1;Object['keys'](_0x2f609d)[_0x2a2d56(0x205)](_0x27e9c3=>{const _0x5b3df5=_0x2f609d[_0x27e9c3];_0x2f609d[_0x27e9c3]={..._0x5b3df5};});const _0x2c3077={[_0x1ca363]:{'unitId':_0x3ada99,'subUnitId':_0x1ca363,'data':_0x2f609d,'order':_0x5d2351}};return this[_0x2a2d56(0x1fd)][_0x2a2d56(0x1ef)](_0x3ada99,_0x2c3077),this[_0x2a2d56(0x1fe)]['registerDrawingData'](_0x3ada99,_0x2c3077),!0x0;}},__name(_a,_0x279ef2(0x1e3)),_a);DocDrawingController=__decorateClass$1([__decorateParam$1(0x0,IDocDrawingService),__decorateParam$1(0x1,drawing[_0x279ef2(0x1cc)]),__decorateParam$1(0x2,core['IResourceManagerService']),__decorateParam$1(0x3,core[_0x279ef2(0x1d3)])],DocDrawingController);function _0x30b2(){const _0x1a3290=['toStringTag','3456852FqbQWo','disposeWithMe','_configService','getUnit','347788YtxZfL','_injector','createIdentifier','registerDrawingData','__decorateParam$1','2991570TDuVdR','UniverDocsDrawingPlugin','__decorateParam','_config','getSnapshot','toJson','univer.doc.plugin.doc-drawing.service','Module','DocDrawingService','docs-drawing.config','IDocDrawingService','_initDataLoader','_docDrawingService','_drawingManagerService','pluginName','567UxrYua','type','length','@univerjs/drawing','10016qXbsGu','forEach','getOwnPropertyDescriptor','36ISqsFu','_resourceManagerService','onUnLoad','55BTWkXv','symbol','__decorateClass$1','3IIdRjq','IDrawingManagerService','_setDrawingDataForUnit','341244edjivM','resetDrawing','_initSnapshot','order','Plugin','IUniverInstanceService','data','@univerjs/core','UniverInstanceType','6YzXLaR','parseJson','UNIVER_DOC','DOCS_DRAWING_PLUGIN','Inject','3749660ijEBJV','_univerInstanceService','4590090riDGVq','setConfig','registerPluginResource','defineProperty','__decorateClass','DocDrawingController','IConfigService','parse','Injector'];_0x30b2=function(){return _0x1a3290;};return _0x30b2();}var __defProp2=Object['defineProperty'],__getOwnPropDesc=Object[_0x279ef2(0x206)],__decorateClass=__name((_0x3d92b5,_0x499bc4,_0x145b0b,_0x312b44)=>{for(var _0x40af43=_0x312b44>0x1?void 0x0:_0x312b44?__getOwnPropDesc(_0x499bc4,_0x145b0b):_0x499bc4,_0x55a3f3=_0x3d92b5['length']-0x1,_0x40fdbe;_0x55a3f3>=0x0;_0x55a3f3--)(_0x40fdbe=_0x3d92b5[_0x55a3f3])&&(_0x40af43=(_0x312b44?_0x40fdbe(_0x499bc4,_0x145b0b,_0x40af43):_0x40fdbe(_0x40af43))||_0x40af43);return _0x312b44&&_0x40af43&&__defProp2(_0x499bc4,_0x145b0b,_0x40af43),_0x40af43;},_0x279ef2(0x1e2)),__decorateParam=__name((_0x2f8be7,_0x3a4647)=>(_0x3302f1,_0x4b2ac6)=>_0x3a4647(_0x3302f1,_0x4b2ac6,_0x2f8be7),_0x279ef2(0x1f3)),_a2;exports['UniverDocsDrawingPlugin']=(_a2=class extends core[_0x279ef2(0x1d2)]{constructor(_0x224a13=defaultPluginConfig,_0x214878,_0xb5c4e3){const _0x411233=_0x279ef2;super(),this[_0x411233(0x1f4)]=_0x224a13,this[_0x411233(0x1ed)]=_0x214878,this[_0x411233(0x1ea)]=_0xb5c4e3;const {..._0x195037}=this[_0x411233(0x1f4)];this['_configService'][_0x411233(0x1df)](PLUGIN_CONFIG_KEY,_0x195037);}['onStarting'](){const _0x24a4cb=_0x279ef2;[[DocDrawingController],[DocDrawingService],[IDocDrawingService,{'useClass':DocDrawingService}]][_0x24a4cb(0x205)](_0x750eb8=>this['_injector']['add'](_0x750eb8)),this[_0x24a4cb(0x1ed)]['get'](DocDrawingController);}},__name(_a2,_0x279ef2(0x1f2)),__publicField(_a2,_0x279ef2(0x1ff),DOCS_DRAWING_PLUGIN),__publicField(_a2,_0x279ef2(0x201),core['UniverInstanceType']['UNIVER_DOC']),_a2),exports[_0x279ef2(0x1f2)]=__decorateClass([__decorateParam(0x1,core[_0x279ef2(0x1db)](core[_0x279ef2(0x1e6)])),__decorateParam(0x2,core[_0x279ef2(0x1e4)])],exports[_0x279ef2(0x1f2)]),exports[_0x279ef2(0x1da)]=DOCS_DRAWING_PLUGIN,exports[_0x279ef2(0x1f9)]=DocDrawingService,exports[_0x279ef2(0x1fb)]=IDocDrawingService;
package/lib/es/index.js CHANGED
@@ -1,135 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
- var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { createIdentifier, OnLifecycle, LifecycleStages, Disposable, ICommandService, UniverInstanceType, IResourceManagerService, IUniverInstanceService, Plugin, Inject, Injector, IConfigService } from "@univerjs/core";
6
- import { UnitDrawingService, IDrawingManagerService } from "@univerjs/drawing";
7
- const _DocDrawingService = class _DocDrawingService extends UnitDrawingService {
8
- };
9
- __name(_DocDrawingService, "DocDrawingService");
10
- let DocDrawingService = _DocDrawingService;
11
- const IDocDrawingService = createIdentifier("univer.doc.plugin.doc-drawing.service");
12
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
13
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
14
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
15
- return kind && result && __defProp$1(target, key, result), result;
16
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1");
17
- const DOCS_DRAWING_PLUGIN = "DOC_DRAWING_PLUGIN";
18
- var _a;
19
- let DocDrawingLoadController = (_a = class extends Disposable {
20
- constructor(_commandService) {
21
- super(), this._commandService = _commandService;
22
- }
23
- }, __name(_a, "DocDrawingLoadController"), _a);
24
- DocDrawingLoadController = __decorateClass$1([
25
- OnLifecycle(LifecycleStages.Starting, DocDrawingLoadController),
26
- __decorateParam$1(0, ICommandService)
27
- ], DocDrawingLoadController);
28
- var _a2;
29
- let DocDrawingController = (_a2 = class extends Disposable {
30
- constructor(_docDrawingService, _drawingManagerService, _resourceManagerService, _univerInstanceService) {
31
- super(), this._docDrawingService = _docDrawingService, this._drawingManagerService = _drawingManagerService, this._resourceManagerService = _resourceManagerService, this._univerInstanceService = _univerInstanceService, this._init();
32
- }
33
- _init() {
34
- this._initSnapshot();
35
- }
36
- _initSnapshot() {
37
- const toJson = /* @__PURE__ */ __name((unitId) => {
38
- const doc = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
39
- if (doc) {
40
- const drawings = doc.getSnapshot().drawings, drawingOrder = doc.getSnapshot().drawingsOrder, data = {
41
- data: drawings != null ? drawings : {},
42
- order: drawingOrder != null ? drawingOrder : []
43
- };
44
- return JSON.stringify(data);
45
- }
46
- return "";
47
- }, "toJson"), parseJson = /* @__PURE__ */ __name((json) => {
48
- if (!json)
49
- return { data: {}, order: [] };
50
- try {
51
- return JSON.parse(json);
52
- } catch {
53
- return { data: {}, order: [] };
54
- }
55
- }, "parseJson");
56
- this.disposeWithMe(
57
- this._resourceManagerService.registerPluginResource({
58
- pluginName: DOCS_DRAWING_PLUGIN,
59
- businesses: [UniverInstanceType.UNIVER_DOC],
60
- toJson: /* @__PURE__ */ __name((unitId) => toJson(unitId), "toJson"),
61
- parseJson: /* @__PURE__ */ __name((json) => parseJson(json), "parseJson"),
62
- onUnLoad: /* @__PURE__ */ __name((unitId) => {
63
- this._setDrawingDataForUnit(unitId, { data: {}, order: [] });
64
- }, "onUnLoad"),
65
- onLoad: /* @__PURE__ */ __name((unitId, value) => {
66
- var _a4, _b;
67
- this._setDrawingDataForUnit(unitId, { data: (_a4 = value.data) != null ? _a4 : {}, order: (_b = value.order) != null ? _b : [] });
68
- }, "onLoad")
69
- })
70
- );
71
- }
72
- _setDrawingDataForUnit(unitId, drawingMapItem) {
73
- const documentDataModel = this._univerInstanceService.getUnit(unitId);
74
- documentDataModel != null && (documentDataModel.resetDrawing(drawingMapItem.data, drawingMapItem.order), this._initDataLoader(unitId));
75
- }
76
- _initDataLoader(unitId) {
77
- const dataModel = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
78
- if (!dataModel)
79
- return !1;
80
- const subUnitId = unitId, drawingDataModels = dataModel.getDrawings(), drawingOrderModel = dataModel.getDrawingsOrder();
81
- if (!drawingDataModels || !drawingOrderModel)
82
- return !1;
83
- Object.keys(drawingDataModels).forEach((drawingId) => {
84
- const drawingDataModel = drawingDataModels[drawingId];
85
- drawingDataModels[drawingId] = { ...drawingDataModel };
86
- });
87
- const subDrawings = {
88
- [subUnitId]: {
89
- unitId,
90
- subUnitId,
91
- data: drawingDataModels,
92
- order: drawingOrderModel
93
- }
94
- };
95
- return this._docDrawingService.registerDrawingData(unitId, subDrawings), this._drawingManagerService.registerDrawingData(unitId, subDrawings), !0;
96
- }
97
- }, __name(_a2, "DocDrawingController"), _a2);
98
- DocDrawingController = __decorateClass$1([
99
- OnLifecycle(LifecycleStages.Starting, DocDrawingController),
100
- __decorateParam$1(0, IDocDrawingService),
101
- __decorateParam$1(1, IDrawingManagerService),
102
- __decorateParam$1(2, IResourceManagerService),
103
- __decorateParam$1(3, IUniverInstanceService)
104
- ], DocDrawingController);
105
- const PLUGIN_CONFIG_KEY = "docs-drawing.config", defaultPluginConfig = {};
106
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
107
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
108
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
109
- return kind && result && __defProp2(target, key, result), result;
110
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a3;
111
- let UniverDocsDrawingPlugin = (_a3 = class extends Plugin {
112
- constructor(_config = defaultPluginConfig, _injector, _configService) {
113
- super(), this._config = _config, this._injector = _injector, this._configService = _configService;
114
- const { ...rest } = this._config;
115
- this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
116
- }
117
- onStarting() {
118
- [
119
- [DocDrawingLoadController],
120
- [DocDrawingController],
121
- [DocDrawingService],
122
- [IDocDrawingService, { useClass: DocDrawingService }]
123
- ].forEach((dependency) => this._injector.add(dependency));
124
- }
125
- }, __name(_a3, "UniverDocsDrawingPlugin"), __publicField(_a3, "pluginName", DOCS_DRAWING_PLUGIN), __publicField(_a3, "type", UniverInstanceType.UNIVER_DOC), _a3);
126
- UniverDocsDrawingPlugin = __decorateClass([
127
- __decorateParam(1, Inject(Injector)),
128
- __decorateParam(2, IConfigService)
129
- ], UniverDocsDrawingPlugin);
130
- export {
131
- DOCS_DRAWING_PLUGIN,
132
- DocDrawingService,
133
- IDocDrawingService,
134
- UniverDocsDrawingPlugin
135
- };
1
+ function _0x2ac2(_0x13f710,_0x96f063){const _0x5d3d5b=_0x5d3d();return _0x2ac2=function(_0x2ac241,_0x4356fe){_0x2ac241=_0x2ac241-0x174;let _0xe9dbbd=_0x5d3d5b[_0x2ac241];return _0xe9dbbd;},_0x2ac2(_0x13f710,_0x96f063);}const _0x3c5e3a=_0x2ac2;(function(_0x4a7b5e,_0x4f6990){const _0x447405=_0x2ac2,_0x4e5027=_0x4a7b5e();while(!![]){try{const _0xd5b110=-parseInt(_0x447405(0x187))/0x1+-parseInt(_0x447405(0x192))/0x2+parseInt(_0x447405(0x17a))/0x3+-parseInt(_0x447405(0x181))/0x4*(parseInt(_0x447405(0x1a6))/0x5)+-parseInt(_0x447405(0x189))/0x6+parseInt(_0x447405(0x18c))/0x7+parseInt(_0x447405(0x19f))/0x8*(parseInt(_0x447405(0x1a4))/0x9);if(_0xd5b110===_0x4f6990)break;else _0x4e5027['push'](_0x4e5027['shift']());}catch(_0x3b82a8){_0x4e5027['push'](_0x4e5027['shift']());}}}(_0x5d3d,0x3e058));var __defProp=Object[_0x3c5e3a(0x179)],__defNormalProp=(_0x14ed74,_0x4fbd64,_0x1eb23b)=>_0x4fbd64 in _0x14ed74?__defProp(_0x14ed74,_0x4fbd64,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1eb23b}):_0x14ed74[_0x4fbd64]=_0x1eb23b,__name=(_0x4460a9,_0x3552df)=>__defProp(_0x4460a9,'name',{'value':_0x3552df,'configurable':!0x0}),__publicField=(_0xd550df,_0x2a95f5,_0x586383)=>__defNormalProp(_0xd550df,typeof _0x2a95f5!='symbol'?_0x2a95f5+'':_0x2a95f5,_0x586383);import{createIdentifier,Disposable,UniverInstanceType,IResourceManagerService,IUniverInstanceService,Plugin,Inject,Injector,IConfigService}from'@univerjs/core';import{UnitDrawingService,IDrawingManagerService}from'@univerjs/drawing';const PLUGIN_CONFIG_KEY=_0x3c5e3a(0x17d),defaultPluginConfig={},_DocDrawingService=class _DocDrawingService extends UnitDrawingService{};__name(_DocDrawingService,_0x3c5e3a(0x185));let DocDrawingService=_DocDrawingService;const IDocDrawingService=createIdentifier('univer.doc.plugin.doc-drawing.service');var __defProp$1=Object['defineProperty'],__getOwnPropDesc$1=Object[_0x3c5e3a(0x1a0)],__decorateClass$1=__name((_0x3ea184,_0x1689cc,_0x5b55f7,_0x314515)=>{const _0x21ef6a=_0x3c5e3a;for(var _0x21cc02=_0x314515>0x1?void 0x0:_0x314515?__getOwnPropDesc$1(_0x1689cc,_0x5b55f7):_0x1689cc,_0x142b14=_0x3ea184[_0x21ef6a(0x17b)]-0x1,_0x5b3a43;_0x142b14>=0x0;_0x142b14--)(_0x5b3a43=_0x3ea184[_0x142b14])&&(_0x21cc02=(_0x314515?_0x5b3a43(_0x1689cc,_0x5b55f7,_0x21cc02):_0x5b3a43(_0x21cc02))||_0x21cc02);return _0x314515&&_0x21cc02&&__defProp$1(_0x1689cc,_0x5b55f7,_0x21cc02),_0x21cc02;},_0x3c5e3a(0x196)),__decorateParam$1=__name((_0x492d5f,_0x4f9418)=>(_0x44f013,_0x150070)=>_0x4f9418(_0x44f013,_0x150070,_0x492d5f),_0x3c5e3a(0x193));const DOCS_DRAWING_PLUGIN=_0x3c5e3a(0x17f);var _a;let DocDrawingController=(_a=class extends Disposable{constructor(_0x35ce11,_0x4e76b4,_0x53525a,_0x4a35a2){const _0x470d71=_0x3c5e3a;super(),this[_0x470d71(0x1a5)]=_0x35ce11,this['_drawingManagerService']=_0x4e76b4,this[_0x470d71(0x195)]=_0x53525a,this['_univerInstanceService']=_0x4a35a2,this[_0x470d71(0x188)]();}[_0x3c5e3a(0x188)](){const _0x2ac034=_0x3c5e3a;this[_0x2ac034(0x183)]();}[_0x3c5e3a(0x183)](){const _0x5cf305=_0x3c5e3a,_0x54ea7b=__name(_0x319ed3=>{const _0x55c309=_0x2ac2,_0x2c6f4c=this[_0x55c309(0x18e)][_0x55c309(0x18f)](_0x319ed3,UniverInstanceType[_0x55c309(0x177)]);if(_0x2c6f4c){const _0x4eedc9=_0x2c6f4c[_0x55c309(0x18a)]()[_0x55c309(0x191)],_0x24dd42=_0x2c6f4c[_0x55c309(0x18a)]()[_0x55c309(0x190)],_0x266fcb={'data':_0x4eedc9!=null?_0x4eedc9:{},'order':_0x24dd42!=null?_0x24dd42:[]};return JSON[_0x55c309(0x176)](_0x266fcb);}return'';},_0x5cf305(0x1a3)),_0x5a18b2=__name(_0xa06563=>{const _0x2ced4b=_0x5cf305;if(!_0xa06563)return{'data':{},'order':[]};try{return JSON[_0x2ced4b(0x17e)](_0xa06563);}catch{return{'data':{},'order':[]};}},_0x5cf305(0x178));this[_0x5cf305(0x18b)](this['_resourceManagerService'][_0x5cf305(0x19c)]({'pluginName':DOCS_DRAWING_PLUGIN,'businesses':[UniverInstanceType[_0x5cf305(0x177)]],'toJson':__name(_0xa6bd69=>_0x54ea7b(_0xa6bd69),_0x5cf305(0x1a3)),'parseJson':__name(_0x36b235=>_0x5a18b2(_0x36b235),'parseJson'),'onUnLoad':__name(_0x331907=>{const _0x866d58=_0x5cf305;this[_0x866d58(0x18d)](_0x331907,{'data':{},'order':[]});},_0x5cf305(0x19d)),'onLoad':__name((_0x5b27dd,_0x281e83)=>{const _0x51ebfc=_0x5cf305;var _0x2ca084,_0x2b306b;this[_0x51ebfc(0x18d)](_0x5b27dd,{'data':(_0x2ca084=_0x281e83['data'])!=null?_0x2ca084:{},'order':(_0x2b306b=_0x281e83[_0x51ebfc(0x1a1)])!=null?_0x2b306b:[]});},_0x5cf305(0x194))}));}[_0x3c5e3a(0x18d)](_0x252644,_0x4f0121){const _0x7801aa=_0x3c5e3a,_0x1f2fc8=this[_0x7801aa(0x18e)][_0x7801aa(0x18f)](_0x252644);_0x1f2fc8!=null&&(_0x1f2fc8[_0x7801aa(0x1a2)](_0x4f0121['data'],_0x4f0121[_0x7801aa(0x1a1)]),this[_0x7801aa(0x1a7)](_0x252644));}[_0x3c5e3a(0x1a7)](_0x3470dd){const _0x5b4ebf=_0x3c5e3a,_0x4d9df6=this['_univerInstanceService'][_0x5b4ebf(0x18f)](_0x3470dd,UniverInstanceType[_0x5b4ebf(0x177)]);if(!_0x4d9df6)return!0x1;const _0x69cb28=_0x3470dd,_0x13227d=_0x4d9df6[_0x5b4ebf(0x1a8)](),_0x52242a=_0x4d9df6['getDrawingsOrder']();if(!_0x13227d||!_0x52242a)return!0x1;Object[_0x5b4ebf(0x180)](_0x13227d)[_0x5b4ebf(0x198)](_0x56d6d4=>{const _0x53f283=_0x13227d[_0x56d6d4];_0x13227d[_0x56d6d4]={..._0x53f283};});const _0x216ee7={[_0x69cb28]:{'unitId':_0x3470dd,'subUnitId':_0x69cb28,'data':_0x13227d,'order':_0x52242a}};return this[_0x5b4ebf(0x1a5)][_0x5b4ebf(0x19b)](_0x3470dd,_0x216ee7),this['_drawingManagerService'][_0x5b4ebf(0x19b)](_0x3470dd,_0x216ee7),!0x0;}},__name(_a,_0x3c5e3a(0x175)),_a);DocDrawingController=__decorateClass$1([__decorateParam$1(0x0,IDocDrawingService),__decorateParam$1(0x1,IDrawingManagerService),__decorateParam$1(0x2,IResourceManagerService),__decorateParam$1(0x3,IUniverInstanceService)],DocDrawingController);var __defProp2=Object['defineProperty'],__getOwnPropDesc=Object[_0x3c5e3a(0x1a0)],__decorateClass=__name((_0x508922,_0x35bde4,_0x259e96,_0x597c90)=>{const _0x14ee74=_0x3c5e3a;for(var _0x20c875=_0x597c90>0x1?void 0x0:_0x597c90?__getOwnPropDesc(_0x35bde4,_0x259e96):_0x35bde4,_0x281d84=_0x508922[_0x14ee74(0x17b)]-0x1,_0x5b4141;_0x281d84>=0x0;_0x281d84--)(_0x5b4141=_0x508922[_0x281d84])&&(_0x20c875=(_0x597c90?_0x5b4141(_0x35bde4,_0x259e96,_0x20c875):_0x5b4141(_0x20c875))||_0x20c875);return _0x597c90&&_0x20c875&&__defProp2(_0x35bde4,_0x259e96,_0x20c875),_0x20c875;},_0x3c5e3a(0x19e)),__decorateParam=__name((_0x56e73f,_0x24338c)=>(_0x1111df,_0x50da76)=>_0x24338c(_0x1111df,_0x50da76,_0x56e73f),'__decorateParam'),_a2;let UniverDocsDrawingPlugin=(_a2=class extends Plugin{constructor(_0x1763cb=defaultPluginConfig,_0x591296,_0x42f5bd){const _0x143490=_0x3c5e3a;super(),this[_0x143490(0x197)]=_0x1763cb,this['_injector']=_0x591296,this[_0x143490(0x17c)]=_0x42f5bd;const {..._0x53e26f}=this['_config'];this[_0x143490(0x17c)]['setConfig'](PLUGIN_CONFIG_KEY,_0x53e26f);}[_0x3c5e3a(0x184)](){const _0x4b6915=_0x3c5e3a;[[DocDrawingController],[DocDrawingService],[IDocDrawingService,{'useClass':DocDrawingService}]][_0x4b6915(0x198)](_0x4f8f09=>this[_0x4b6915(0x19a)][_0x4b6915(0x186)](_0x4f8f09)),this[_0x4b6915(0x19a)][_0x4b6915(0x182)](DocDrawingController);}},__name(_a2,_0x3c5e3a(0x174)),__publicField(_a2,_0x3c5e3a(0x199),DOCS_DRAWING_PLUGIN),__publicField(_a2,'type',UniverInstanceType[_0x3c5e3a(0x177)]),_a2);UniverDocsDrawingPlugin=__decorateClass([__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,IConfigService)],UniverDocsDrawingPlugin);export{DOCS_DRAWING_PLUGIN,DocDrawingService,IDocDrawingService,UniverDocsDrawingPlugin};function _0x5d3d(){const _0x593098=['pluginName','_injector','registerDrawingData','registerPluginResource','onUnLoad','__decorateClass','6246520oAIdWX','getOwnPropertyDescriptor','order','resetDrawing','toJson','9dqMByD','_docDrawingService','15XwfBmq','_initDataLoader','getDrawings','UniverDocsDrawingPlugin','DocDrawingController','stringify','UNIVER_DOC','parseJson','defineProperty','435687fFTnGZ','length','_configService','docs-drawing.config','parse','DOC_DRAWING_PLUGIN','keys','456788ZcwXft','get','_initSnapshot','onStarting','DocDrawingService','add','161224HCANtI','_init','1760808ymiees','getSnapshot','disposeWithMe','3373328irlaJv','_setDrawingDataForUnit','_univerInstanceService','getUnit','drawingsOrder','drawings','713250UuauWh','__decorateParam$1','onLoad','_resourceManagerService','__decorateClass$1','_config','forEach'];_0x5d3d=function(){return _0x593098;};return _0x5d3d();}
@@ -1,4 +1,4 @@
1
- import { Disposable, ICommandService, IResourceManagerService, IUniverInstanceService, IDocumentData } from '@univerjs/core';
1
+ import { IDocumentData, Disposable, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IDrawingManagerService } from '@univerjs/drawing';
3
3
  import { IDocDrawingService } from '../services/doc-drawing.service';
4
4
  export declare const DOCS_DRAWING_PLUGIN = "DOC_DRAWING_PLUGIN";
@@ -6,10 +6,6 @@ export interface IDocDrawingModel {
6
6
  drawings?: IDocumentData['drawings'];
7
7
  drawingsOrder?: IDocumentData['drawingsOrder'];
8
8
  }
9
- export declare class DocDrawingLoadController extends Disposable {
10
- private readonly _commandService;
11
- constructor(_commandService: ICommandService);
12
- }
13
9
  export declare class DocDrawingController extends Disposable {
14
10
  private readonly _docDrawingService;
15
11
  private readonly _drawingManagerService;
@@ -1,5 +1,5 @@
1
- import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
1
  import { IUniverDocsDrawingConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
3
  export declare class UniverDocsDrawingPlugin extends Plugin {
4
4
  private readonly _config;
5
5
  _injector: Injector;
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverDocsDrawing={},global.UniverCore,global.UniverDrawing))})(this,function(exports2,core,drawing){"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);var _a,_b,_c;const _DocDrawingService=class _DocDrawingService extends drawing.UnitDrawingService{};__name(_DocDrawingService,"DocDrawingService");let DocDrawingService=_DocDrawingService;const IDocDrawingService=core.createIdentifier("univer.doc.plugin.doc-drawing.service");var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(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&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const DOCS_DRAWING_PLUGIN="DOC_DRAWING_PLUGIN";let DocDrawingLoadController=(_a=class extends core.Disposable{constructor(_commandService){super(),this._commandService=_commandService}},__name(_a,"DocDrawingLoadController"),_a);DocDrawingLoadController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Starting,DocDrawingLoadController),__decorateParam$1(0,core.ICommandService)],DocDrawingLoadController);let DocDrawingController=(_b=class extends core.Disposable{constructor(_docDrawingService,_drawingManagerService,_resourceManagerService,_univerInstanceService){super(),this._docDrawingService=_docDrawingService,this._drawingManagerService=_drawingManagerService,this._resourceManagerService=_resourceManagerService,this._univerInstanceService=_univerInstanceService,this._init()}_init(){this._initSnapshot()}_initSnapshot(){const toJson=__name(unitId=>{const doc=this._univerInstanceService.getUnit(unitId,core.UniverInstanceType.UNIVER_DOC);if(doc){const drawings=doc.getSnapshot().drawings,drawingOrder=doc.getSnapshot().drawingsOrder,data={data:drawings!=null?drawings:{},order:drawingOrder!=null?drawingOrder:[]};return JSON.stringify(data)}return""},"toJson"),parseJson=__name(json=>{if(!json)return{data:{},order:[]};try{return JSON.parse(json)}catch{return{data:{},order:[]}}},"parseJson");this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:DOCS_DRAWING_PLUGIN,businesses:[core.UniverInstanceType.UNIVER_DOC],toJson:__name(unitId=>toJson(unitId),"toJson"),parseJson:__name(json=>parseJson(json),"parseJson"),onUnLoad:__name(unitId=>{this._setDrawingDataForUnit(unitId,{data:{},order:[]})},"onUnLoad"),onLoad:__name((unitId,value)=>{var _a2,_b2;this._setDrawingDataForUnit(unitId,{data:(_a2=value.data)!=null?_a2:{},order:(_b2=value.order)!=null?_b2:[]})},"onLoad")}))}_setDrawingDataForUnit(unitId,drawingMapItem){const documentDataModel=this._univerInstanceService.getUnit(unitId);documentDataModel!=null&&(documentDataModel.resetDrawing(drawingMapItem.data,drawingMapItem.order),this._initDataLoader(unitId))}_initDataLoader(unitId){const dataModel=this._univerInstanceService.getUnit(unitId,core.UniverInstanceType.UNIVER_DOC);if(!dataModel)return!1;const subUnitId=unitId,drawingDataModels=dataModel.getDrawings(),drawingOrderModel=dataModel.getDrawingsOrder();if(!drawingDataModels||!drawingOrderModel)return!1;Object.keys(drawingDataModels).forEach(drawingId=>{const drawingDataModel=drawingDataModels[drawingId];drawingDataModels[drawingId]={...drawingDataModel}});const subDrawings={[subUnitId]:{unitId,subUnitId,data:drawingDataModels,order:drawingOrderModel}};return this._docDrawingService.registerDrawingData(unitId,subDrawings),this._drawingManagerService.registerDrawingData(unitId,subDrawings),!0}},__name(_b,"DocDrawingController"),_b);DocDrawingController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Starting,DocDrawingController),__decorateParam$1(0,IDocDrawingService),__decorateParam$1(1,drawing.IDrawingManagerService),__decorateParam$1(2,core.IResourceManagerService),__decorateParam$1(3,core.IUniverInstanceService)],DocDrawingController);const PLUGIN_CONFIG_KEY="docs-drawing.config",defaultPluginConfig={};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");exports2.UniverDocsDrawingPlugin=(_c=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[DocDrawingLoadController],[DocDrawingController],[DocDrawingService],[IDocDrawingService,{useClass:DocDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_c,"UniverDocsDrawingPlugin"),__publicField(_c,"pluginName",DOCS_DRAWING_PLUGIN),__publicField(_c,"type",core.UniverInstanceType.UNIVER_DOC),_c),exports2.UniverDocsDrawingPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports2.UniverDocsDrawingPlugin),exports2.DOCS_DRAWING_PLUGIN=DOCS_DRAWING_PLUGIN,exports2.DocDrawingService=DocDrawingService,exports2.IDocDrawingService=IDocDrawingService,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
1
+ function _0x10a0(_0x21e296,_0x566944){const _0x3f9ee5=_0x3f9e();return _0x10a0=function(_0x10a0c6,_0x1a8329){_0x10a0c6=_0x10a0c6-0x73;let _0x186986=_0x3f9ee5[_0x10a0c6];return _0x186986;},_0x10a0(_0x21e296,_0x566944);}function _0x3f9e(){const _0xb76ecf=['IConfigService','_univerInstanceService','IDrawingManagerService','877010hpjtmD','UNIVER_DOC','stringify','_configService','amd','181299QbTSlU','__decorateClass$1','DOCS_DRAWING_PLUGIN','Disposable','633234mosfic','getDrawings','88igIIZj','__decorateParam$1','onUnLoad','_config','__decorateParam','_docDrawingService','_setDrawingDataForUnit','data','Inject','onLoad','getOwnPropertyDescriptor','IUniverInstanceService','univer.doc.plugin.doc-drawing.service','IDocDrawingService','18rTaixD','docs-drawing.config','type','symbol','object','DocDrawingController','parse','UniverDocsDrawingPlugin','11192rbiljp','_resourceManagerService','Module','UniverInstanceType','4024XPhUAa','5712960tLSThw','26AhpFvn','keys','790JNNioG','_drawingManagerService','length','defineProperty','IResourceManagerService','toJson','_initDataLoader','@univerjs/drawing','order','8766rmbArz','_init','getUnit','registerDrawingData','994778ImZsBN','createIdentifier','@univerjs/core','resetDrawing','UniverCore','function','toStringTag','__decorateClass','_injector','get','_initSnapshot','1BQemPN','forEach','UnitDrawingService','add','drawingsOrder','DocDrawingService','drawings','Plugin','parseJson'];_0x3f9e=function(){return _0xb76ecf;};return _0x3f9e();}(function(_0x1ae169,_0x20417d){const _0x2ccf6a=_0x10a0,_0x18a598=_0x1ae169();while(!![]){try{const _0x235762=parseInt(_0x2ccf6a(0x86))/0x1*(-parseInt(_0x2ccf6a(0x7b))/0x2)+parseInt(_0x2ccf6a(0x97))/0x3+parseInt(_0x2ccf6a(0xb3))/0x4*(-parseInt(_0x2ccf6a(0xbb))/0x5)+parseInt(_0x2ccf6a(0xab))/0x6*(parseInt(_0x2ccf6a(0x9b))/0x7)+parseInt(_0x2ccf6a(0xb7))/0x8*(-parseInt(_0x2ccf6a(0x77))/0x9)+-parseInt(_0x2ccf6a(0x92))/0xa*(-parseInt(_0x2ccf6a(0x9d))/0xb)+-parseInt(_0x2ccf6a(0xb8))/0xc*(-parseInt(_0x2ccf6a(0xb9))/0xd);if(_0x235762===_0x20417d)break;else _0x18a598['push'](_0x18a598['shift']());}catch(_0x558fdb){_0x18a598['push'](_0x18a598['shift']());}}}(_0x3f9e,0x87ca0),function(_0x1d666b,_0x43b5fd){const _0x1a476b=_0x10a0;typeof exports==_0x1a476b(0xaf)&&typeof module<'u'?_0x43b5fd(exports,require(_0x1a476b(0x7d)),require('@univerjs/drawing')):typeof define==_0x1a476b(0x80)&&define[_0x1a476b(0x96)]?define(['exports','@univerjs/core',_0x1a476b(0x75)],_0x43b5fd):(_0x1d666b=typeof globalThis<'u'?globalThis:_0x1d666b||self,_0x43b5fd(_0x1d666b['UniverDocsDrawing']={},_0x1d666b[_0x1a476b(0x7f)],_0x1d666b['UniverDrawing']));}(this,function(_0x37698e,_0x146439,_0x38d683){'use strict';const _0x271460=_0x10a0;var _0x7a85a7=Object['defineProperty'],_0x1a0fbb=(_0x335cfb,_0x309479,_0x4d92fe)=>_0x309479 in _0x335cfb?_0x7a85a7(_0x335cfb,_0x309479,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4d92fe}):_0x335cfb[_0x309479]=_0x4d92fe,_0x306d47=(_0x236286,_0x351e61)=>_0x7a85a7(_0x236286,'name',{'value':_0x351e61,'configurable':!0x0}),_0x87c960=(_0x341bcd,_0x4fb658,_0x4be401)=>_0x1a0fbb(_0x341bcd,typeof _0x4fb658!=_0x271460(0xae)?_0x4fb658+'':_0x4fb658,_0x4be401),_0x512209,_0x532148;const _0x59148b=_0x271460(0xac),_0x11772b={},_0x57379e=class _0x20bdbc extends _0x38d683[_0x271460(0x88)]{};_0x306d47(_0x57379e,_0x271460(0x8b));let _0x18c66b=_0x57379e;const _0x541a78=_0x146439[_0x271460(0x7c)](_0x271460(0xa9));var _0x1c501e=Object['defineProperty'],_0x3a31f2=Object[_0x271460(0xa7)],_0x3ae4fa=_0x306d47((_0x561442,_0x308c53,_0x2503f6,_0x47e12e)=>{const _0x16a921=_0x271460;for(var _0x1fb43c=_0x47e12e>0x1?void 0x0:_0x47e12e?_0x3a31f2(_0x308c53,_0x2503f6):_0x308c53,_0x3f340a=_0x561442[_0x16a921(0xbd)]-0x1,_0x3090d1;_0x3f340a>=0x0;_0x3f340a--)(_0x3090d1=_0x561442[_0x3f340a])&&(_0x1fb43c=(_0x47e12e?_0x3090d1(_0x308c53,_0x2503f6,_0x1fb43c):_0x3090d1(_0x1fb43c))||_0x1fb43c);return _0x47e12e&&_0x1fb43c&&_0x1c501e(_0x308c53,_0x2503f6,_0x1fb43c),_0x1fb43c;},_0x271460(0x98)),_0x1b0b4d=_0x306d47((_0x5d6a96,_0xf409cb)=>(_0x112066,_0x511d7c)=>_0xf409cb(_0x112066,_0x511d7c,_0x5d6a96),_0x271460(0x9e));const _0x14d497='DOC_DRAWING_PLUGIN';let _0x3f271a=(_0x512209=class extends _0x146439[_0x271460(0x9a)]{constructor(_0x5459d5,_0x37dac4,_0xf1d22c,_0x1b6a46){const _0x4628ba=_0x271460;super(),this['_docDrawingService']=_0x5459d5,this[_0x4628ba(0xbc)]=_0x37dac4,this[_0x4628ba(0xb4)]=_0xf1d22c,this[_0x4628ba(0x90)]=_0x1b6a46,this[_0x4628ba(0x78)]();}['_init'](){const _0x3b469a=_0x271460;this[_0x3b469a(0x85)]();}['_initSnapshot'](){const _0x2e1932=_0x271460,_0x8bb24b=_0x306d47(_0x198016=>{const _0x3610ba=_0x10a0,_0xcc81cd=this['_univerInstanceService'][_0x3610ba(0x79)](_0x198016,_0x146439[_0x3610ba(0xb6)]['UNIVER_DOC']);if(_0xcc81cd){const _0x3706c2=_0xcc81cd['getSnapshot']()[_0x3610ba(0x8c)],_0x192479=_0xcc81cd['getSnapshot']()[_0x3610ba(0x8a)],_0x4dc2a4={'data':_0x3706c2!=null?_0x3706c2:{},'order':_0x192479!=null?_0x192479:[]};return JSON[_0x3610ba(0x94)](_0x4dc2a4);}return'';},_0x2e1932(0x73)),_0xf22995=_0x306d47(_0x2fdd92=>{const _0x1c99ec=_0x2e1932;if(!_0x2fdd92)return{'data':{},'order':[]};try{return JSON[_0x1c99ec(0xb1)](_0x2fdd92);}catch{return{'data':{},'order':[]};}},_0x2e1932(0x8e));this['disposeWithMe'](this[_0x2e1932(0xb4)]['registerPluginResource']({'pluginName':_0x14d497,'businesses':[_0x146439['UniverInstanceType'][_0x2e1932(0x93)]],'toJson':_0x306d47(_0x2f07ac=>_0x8bb24b(_0x2f07ac),_0x2e1932(0x73)),'parseJson':_0x306d47(_0x1ad0a6=>_0xf22995(_0x1ad0a6),_0x2e1932(0x8e)),'onUnLoad':_0x306d47(_0x278db2=>{const _0x5405bd=_0x2e1932;this[_0x5405bd(0xa3)](_0x278db2,{'data':{},'order':[]});},_0x2e1932(0x9f)),'onLoad':_0x306d47((_0x23a0c9,_0x5f54cc)=>{const _0x2c3e4c=_0x2e1932;var _0x3af9ec,_0x1de22d;this['_setDrawingDataForUnit'](_0x23a0c9,{'data':(_0x3af9ec=_0x5f54cc[_0x2c3e4c(0xa4)])!=null?_0x3af9ec:{},'order':(_0x1de22d=_0x5f54cc[_0x2c3e4c(0x76)])!=null?_0x1de22d:[]});},_0x2e1932(0xa6))}));}[_0x271460(0xa3)](_0x52e8dc,_0x36c56d){const _0x28ea11=_0x271460,_0x421239=this[_0x28ea11(0x90)][_0x28ea11(0x79)](_0x52e8dc);_0x421239!=null&&(_0x421239[_0x28ea11(0x7e)](_0x36c56d[_0x28ea11(0xa4)],_0x36c56d[_0x28ea11(0x76)]),this[_0x28ea11(0x74)](_0x52e8dc));}[_0x271460(0x74)](_0x211dc5){const _0x20ba7f=_0x271460,_0x50b12f=this[_0x20ba7f(0x90)][_0x20ba7f(0x79)](_0x211dc5,_0x146439[_0x20ba7f(0xb6)][_0x20ba7f(0x93)]);if(!_0x50b12f)return!0x1;const _0x4bec3e=_0x211dc5,_0xdfca28=_0x50b12f[_0x20ba7f(0x9c)](),_0x4db6e8=_0x50b12f['getDrawingsOrder']();if(!_0xdfca28||!_0x4db6e8)return!0x1;Object[_0x20ba7f(0xba)](_0xdfca28)[_0x20ba7f(0x87)](_0xa128f4=>{const _0x20b2f3=_0xdfca28[_0xa128f4];_0xdfca28[_0xa128f4]={..._0x20b2f3};});const _0x3fe78e={[_0x4bec3e]:{'unitId':_0x211dc5,'subUnitId':_0x4bec3e,'data':_0xdfca28,'order':_0x4db6e8}};return this[_0x20ba7f(0xa2)][_0x20ba7f(0x7a)](_0x211dc5,_0x3fe78e),this[_0x20ba7f(0xbc)][_0x20ba7f(0x7a)](_0x211dc5,_0x3fe78e),!0x0;}},_0x306d47(_0x512209,_0x271460(0xb0)),_0x512209);_0x3f271a=_0x3ae4fa([_0x1b0b4d(0x0,_0x541a78),_0x1b0b4d(0x1,_0x38d683[_0x271460(0x91)]),_0x1b0b4d(0x2,_0x146439[_0x271460(0xbf)]),_0x1b0b4d(0x3,_0x146439[_0x271460(0xa8)])],_0x3f271a);var _0x1619eb=Object[_0x271460(0xbe)],_0x53b847=Object[_0x271460(0xa7)],_0x4ae72e=_0x306d47((_0x76b41f,_0x3e78a7,_0x4f4a4e,_0x5bc6ea)=>{const _0x1ec5fa=_0x271460;for(var _0x451d43=_0x5bc6ea>0x1?void 0x0:_0x5bc6ea?_0x53b847(_0x3e78a7,_0x4f4a4e):_0x3e78a7,_0x39f979=_0x76b41f[_0x1ec5fa(0xbd)]-0x1,_0x994456;_0x39f979>=0x0;_0x39f979--)(_0x994456=_0x76b41f[_0x39f979])&&(_0x451d43=(_0x5bc6ea?_0x994456(_0x3e78a7,_0x4f4a4e,_0x451d43):_0x994456(_0x451d43))||_0x451d43);return _0x5bc6ea&&_0x451d43&&_0x1619eb(_0x3e78a7,_0x4f4a4e,_0x451d43),_0x451d43;},_0x271460(0x82)),_0x3721dd=_0x306d47((_0x2cfcdf,_0x3f09ba)=>(_0x1aba28,_0x451c3d)=>_0x3f09ba(_0x1aba28,_0x451c3d,_0x2cfcdf),_0x271460(0xa1));_0x37698e[_0x271460(0xb2)]=(_0x532148=class extends _0x146439[_0x271460(0x8d)]{constructor(_0x5ac4d6=_0x11772b,_0x23e1e8,_0xd5de37){const _0x50b8bf=_0x271460;super(),this[_0x50b8bf(0xa0)]=_0x5ac4d6,this[_0x50b8bf(0x83)]=_0x23e1e8,this[_0x50b8bf(0x95)]=_0xd5de37;const {..._0x2d9ba5}=this[_0x50b8bf(0xa0)];this[_0x50b8bf(0x95)]['setConfig'](_0x59148b,_0x2d9ba5);}['onStarting'](){const _0x3e5439=_0x271460;[[_0x3f271a],[_0x18c66b],[_0x541a78,{'useClass':_0x18c66b}]][_0x3e5439(0x87)](_0x287d1f=>this[_0x3e5439(0x83)][_0x3e5439(0x89)](_0x287d1f)),this[_0x3e5439(0x83)][_0x3e5439(0x84)](_0x3f271a);}},_0x306d47(_0x532148,'UniverDocsDrawingPlugin'),_0x87c960(_0x532148,'pluginName',_0x14d497),_0x87c960(_0x532148,_0x271460(0xad),_0x146439[_0x271460(0xb6)][_0x271460(0x93)]),_0x532148),_0x37698e[_0x271460(0xb2)]=_0x4ae72e([_0x3721dd(0x1,_0x146439[_0x271460(0xa5)](_0x146439['Injector'])),_0x3721dd(0x2,_0x146439[_0x271460(0x8f)])],_0x37698e[_0x271460(0xb2)]),_0x37698e[_0x271460(0x99)]=_0x14d497,_0x37698e[_0x271460(0x8b)]=_0x18c66b,_0x37698e[_0x271460(0xaa)]=_0x541a78,Object[_0x271460(0xbe)](_0x37698e,Symbol[_0x271460(0x81)],{'value':_0x271460(0xb5)});}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/docs-drawing",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0-nightly.202410101606",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -44,18 +44,18 @@
44
44
  "lib"
45
45
  ],
46
46
  "peerDependencies": {
47
- "@univerjs/drawing": "0.3.0-alpha.0",
48
- "@univerjs/core": "0.3.0-alpha.0"
47
+ "@univerjs/core": "0.3.0-nightly.202410101606",
48
+ "@univerjs/drawing": "0.3.0-nightly.202410101606"
49
49
  },
50
50
  "dependencies": {
51
- "@univerjs/core": "0.3.0-alpha.0",
52
- "@univerjs/drawing": "0.3.0-alpha.0"
51
+ "@univerjs/drawing": "0.3.0-nightly.202410101606",
52
+ "@univerjs/core": "0.3.0-nightly.202410101606"
53
53
  },
54
54
  "devDependencies": {
55
55
  "typescript": "^5.6.2",
56
56
  "vite": "^5.4.8",
57
57
  "vitest": "^2.1.1",
58
- "@univerjs-infra/shared": "0.3.0-alpha.0"
58
+ "@univerjs-infra/shared": "0.3.0"
59
59
  },
60
60
  "univerSpace": {
61
61
  ".": {
@@ -75,7 +75,6 @@
75
75
  "test:watch": "vitest",
76
76
  "coverage": "vitest run --coverage",
77
77
  "lint:types": "tsc --noEmit",
78
- "build": "tsc && vite build",
79
- "sync:cnpm": "cnpm sync"
78
+ "build": "tsc && vite build"
80
79
  }
81
80
  }
package/LICENSE DELETED
@@ -1,176 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS