@univerjs-pro/pivot-cache 1.0.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.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @univerjs-pro/pivot-cache
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@univerjs-pro/pivot-cache?style=flat-square)](https://npmjs.com/package/@univerjs-pro/pivot-cache)
4
+ [![license](https://img.shields.io/npm/l/@univerjs-pro/pivot-cache?style=flat-square)](https://npmjs.com/package/@univerjs-pro/pivot-cache)
5
+ [![downloads](https://img.shields.io/npm/dm/@univerjs-pro/pivot-cache?style=flat-square)](https://npmjs.com/package/@univerjs-pro/pivot-cache)
6
+
7
+ `@univerjs-pro/pivot-cache` is part of Univer Pro. Host-neutral Pivot Cache references, provider contracts and registry shared by PivotTable and PivotChart.
8
+
9
+ ## Package Overview
10
+
11
+ | Package | UMD global | CSS | Locales | Facade entry |
12
+ | --- | --- | :---: | :---: | :---: |
13
+ | `@univerjs-pro/pivot-cache` | `UniverProPivotCache` | No | No | No |
14
+
15
+ ## Installation
16
+
17
+ ```sh
18
+ pnpm add @univerjs-pro/pivot-cache
19
+ # or
20
+ npm install @univerjs-pro/pivot-cache
21
+ ```
22
+
23
+ Keep all `@univerjs/*` and `@univerjs-pro/*` packages on the same version.
24
+
25
+ ## Usage
26
+
27
+ Host packages register a provider with `IPivotCacheProviderRegistry`. Consumers acquire a disposable cache handle; source changes are published through the handle's `changed$` observable. Releasing a handle does not remove another report's cache reference.
28
+
29
+ ## Integration Notes
30
+
31
+ The package has one standard root entry and no Chart, Drawing or host runtime dependency. `Unit`, `Embedded` and `Resource` identify reference formats; only registered providers can resolve them. Declaring a reference kind does not implement its loading or persistence behavior.
32
+
33
+ The public declarations reuse Pivot and Embed types through peer dependencies and RxJS observable types through the existing RxJS dependency. These type contracts do not load the host or chart runtimes.
34
+
35
+ ## Resources
36
+
37
+ - [Documentation](https://docs.univer.ai/guides/pro)
38
+ - [NPM package](https://npmjs.com/package/@univerjs-pro/pivot-cache)
@@ -0,0 +1 @@
1
+ var _0x4b95e2=_0x16ab;(function(_0x26025e,_0x27c625){var _0x1d4c18=_0x16ab,_0x4f386c=_0x26025e();while(!![]){try{var _0x245479=-parseInt(_0x1d4c18(0x180))/0x1*(parseInt(_0x1d4c18(0x17f))/0x2)+-parseInt(_0x1d4c18(0x1ab))/0x3+-parseInt(_0x1d4c18(0x1a6))/0x4*(-parseInt(_0x1d4c18(0x1a9))/0x5)+-parseInt(_0x1d4c18(0x18b))/0x6*(parseInt(_0x1d4c18(0x1a7))/0x7)+-parseInt(_0x1d4c18(0x19a))/0x8+parseInt(_0x1d4c18(0x185))/0x9*(-parseInt(_0x1d4c18(0x182))/0xa)+parseInt(_0x1d4c18(0x1a5))/0xb;if(_0x245479===_0x27c625)break;else _0x4f386c['push'](_0x4f386c['shift']());}catch(_0x3bbf8d){_0x4f386c['push'](_0x4f386c['shift']());}}}(_0x4bcb,0x50df9),Object[_0x4b95e2(0x192)](exports,Symbol[_0x4b95e2(0x18f)],{'value':'Module'}));let e=require('@univerjs/core');function t(_0x42c508){'@babel/helpers - typeof';var _0x1fb6ff=_0x4b95e2;return t=typeof Symbol=='function'&&typeof Symbol['iterator']==_0x1fb6ff(0x196)?function(_0x151ad8){return typeof _0x151ad8;}:function(_0x4521f7){var _0x3d05a6=_0x1fb6ff;return _0x4521f7&&typeof Symbol==_0x3d05a6(0x17c)&&_0x4521f7[_0x3d05a6(0x1aa)]===Symbol&&_0x4521f7!==Symbol[_0x3d05a6(0x19b)]?_0x3d05a6(0x196):typeof _0x4521f7;},t(_0x42c508);}function n(_0x318ff9,_0x1ca207){var _0x40d501=_0x4b95e2;if(t(_0x318ff9)!=_0x40d501(0x19f)||!_0x318ff9)return _0x318ff9;var _0xcb7bd7=_0x318ff9[Symbol[_0x40d501(0x188)]];if(_0xcb7bd7!==void 0x0){var _0x3831cd=_0xcb7bd7[_0x40d501(0x19c)](_0x318ff9,_0x1ca207||_0x40d501(0x189));if(t(_0x3831cd)!=_0x40d501(0x19f))return _0x3831cd;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x1ca207==='string'?String:Number)(_0x318ff9);}function r(_0x99306){var _0x46e439=_0x4b95e2,_0x3e8279=n(_0x99306,_0x46e439(0x191));return t(_0x3e8279)==_0x46e439(0x196)?_0x3e8279:_0x3e8279+'';}function i(_0x23359,_0x5782f5,_0x2ca04f){var _0x58a9cd=_0x4b95e2;return(_0x5782f5=r(_0x5782f5))in _0x23359?Object[_0x58a9cd(0x192)](_0x23359,_0x5782f5,{'value':_0x2ca04f,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x23359[_0x5782f5]=_0x2ca04f,_0x23359;}let a=function(_0x5f572c){var _0x1766a3=_0x4b95e2;return _0x5f572c[_0x1766a3(0x184)]=_0x1766a3(0x193),_0x5f572c[_0x1766a3(0x1a0)]=_0x1766a3(0x18a),_0x5f572c[_0x1766a3(0x19d)]=_0x1766a3(0x194),_0x5f572c;}({}),o=function(_0x4449e9){var _0xf0d55c=_0x4b95e2;return _0x4449e9[_0xf0d55c(0x181)]='PIVOT_CACHE_PROVIDER_NOT_REGISTERED',_0x4449e9['ProviderAlreadyRegistered']='PIVOT_CACHE_PROVIDER_ALREADY_REGISTERED',_0x4449e9[_0xf0d55c(0x195)]='PIVOT_CACHE_REFERENCE_INVALID',_0x4449e9['CacheNotFound']=_0xf0d55c(0x18e),_0x4449e9;}({});var s=class extends Error{constructor(_0x312a5b,_0x5fb6fe){var _0x22d132=_0x4b95e2;super(_0x312a5b),this[_0x22d132(0x187)]=_0x312a5b,this[_0x22d132(0x183)]=_0x5fb6fe,this[_0x22d132(0x19e)]='PivotCacheProviderError';}};function _0x16ab(_0x8fb3ed,_0x42577c){_0x8fb3ed=_0x8fb3ed-0x17b;var _0x4bcbcb=_0x4bcb();var _0x16ab19=_0x4bcbcb[_0x8fb3ed];return _0x16ab19;}const c=(0x0,e[_0x4b95e2(0x1a8)])(_0x4b95e2(0x197));var l=class extends e[_0x4b95e2(0x1ad)]{constructor(..._0x3e31bc){var _0x576003=_0x4b95e2;super(..._0x3e31bc),i(this,_0x576003(0x198),new Map());}[_0x4b95e2(0x1a2)](_0x44f635){var _0xb963c8=_0x4b95e2;if(this[_0xb963c8(0x198)][_0xb963c8(0x18c)](_0x44f635['kind']))throw new s(_0xb963c8(0x186),{'kind':_0x44f635[_0xb963c8(0x1ac)]});return this[_0xb963c8(0x198)][_0xb963c8(0x18d)](_0x44f635[_0xb963c8(0x1ac)],_0x44f635),(0x0,e['toDisposable'])(()=>{var _0x12e53f=_0xb963c8;this[_0x12e53f(0x198)][_0x12e53f(0x1a4)](_0x44f635[_0x12e53f(0x1ac)])===_0x44f635&&this[_0x12e53f(0x198)][_0x12e53f(0x1a1)](_0x44f635['kind']);});}[_0x4b95e2(0x17b)](_0x31b8e8){var _0x3a7bd1=_0x4b95e2;let _0x5d8e05=this[_0x3a7bd1(0x198)]['get'](_0x31b8e8['kind']);if(!_0x5d8e05)throw new s(_0x3a7bd1(0x17e),{'kind':_0x31b8e8[_0x3a7bd1(0x1ac)]});if(!_0x5d8e05['isReference'](_0x31b8e8))throw new s('PIVOT_CACHE_REFERENCE_INVALID',{'reference':_0x31b8e8});return _0x5d8e05['acquire'](_0x31b8e8);}[_0x4b95e2(0x199)](){var _0x4abf7d=_0x4b95e2;this[_0x4abf7d(0x198)]['clear'](),super[_0x4abf7d(0x199)]();}};exports[_0x4b95e2(0x1a3)]=c,exports['PivotCacheProviderError']=s,exports['PivotCacheProviderErrorCodeEnum']=o,exports[_0x4b95e2(0x17d)]=l,exports[_0x4b95e2(0x190)]=a;function _0x4bcb(){var _0x344e79=['_providers','dispose','631776BdoYgc','prototype','call','Resource','name','object','Embedded','delete','register','IPivotCacheProviderRegistry','get','19199708xkdlTQ','84444mFezdE','14AgYyiy','createIdentifier','145WOwzyp','constructor','1965561ARBbbP','kind','Disposable','acquire','function','PivotCacheProviderRegistry','PIVOT_CACHE_PROVIDER_NOT_REGISTERED','4WaKvtE','228176mFLTCL','ProviderNotRegistered','69290rVNeXF','details','Unit','801jfBVnU','PIVOT_CACHE_PROVIDER_ALREADY_REGISTERED','code','toPrimitive','default','embedded','657594WDJScC','has','set','PIVOT_CACHE_NOT_FOUND','toStringTag','PivotCacheReferenceKindEnum','string','defineProperty','unit','resource','ReferenceInvalid','symbol','univer-pro.pivot-cache.provider-registry'];_0x4bcb=function(){return _0x344e79;};return _0x4bcb();}
@@ -0,0 +1 @@
1
+ var _0x5d5f3e=_0x47e2;(function(_0x191887,_0x1c06ea){var _0x1feb9f=_0x47e2,_0x226198=_0x191887();while(!![]){try{var _0x2c833d=parseInt(_0x1feb9f(0x163))/0x1*(-parseInt(_0x1feb9f(0x15e))/0x2)+-parseInt(_0x1feb9f(0x17c))/0x3+parseInt(_0x1feb9f(0x167))/0x4*(parseInt(_0x1feb9f(0x165))/0x5)+parseInt(_0x1feb9f(0x161))/0x6*(parseInt(_0x1feb9f(0x166))/0x7)+parseInt(_0x1feb9f(0x177))/0x8+-parseInt(_0x1feb9f(0x15d))/0x9+-parseInt(_0x1feb9f(0x17e))/0xa*(-parseInt(_0x1feb9f(0x16d))/0xb);if(_0x2c833d===_0x1c06ea)break;else _0x226198['push'](_0x226198['shift']());}catch(_0x2fd4f5){_0x226198['push'](_0x226198['shift']());}}}(_0x278a,0x99872));import{Disposable as _0x42118c,createIdentifier as _0x38e561,toDisposable as _0x554aad}from'@univerjs/core';function r(_0x1d6e20){'@babel/helpers - typeof';var _0x25bd56=_0x47e2;return r=typeof Symbol=='function'&&typeof Symbol['iterator']==_0x25bd56(0x178)?function(_0x19ea71){return typeof _0x19ea71;}:function(_0x3b09f6){return _0x3b09f6&&typeof Symbol=='function'&&_0x3b09f6['constructor']===Symbol&&_0x3b09f6!==Symbol['prototype']?'symbol':typeof _0x3b09f6;},r(_0x1d6e20);}function _0x47e2(_0x41ad34,_0x5e94f9){_0x41ad34=_0x41ad34-0x158;var _0x278a64=_0x278a();var _0x47e2fc=_0x278a64[_0x41ad34];return _0x47e2fc;}function _0x278a(){var _0x490102=['1900Iofemr','name','call','ProviderAlreadyRegistered','clear','isReference','148653BRexcL','4QIQAjA','PIVOT_CACHE_PROVIDER_NOT_REGISTERED','delete','2678154gDGviZ','PIVOT_CACHE_REFERENCE_INVALID','310223WJrBVz','dispose','165LRgVva','7gUTRyw','21036GTRmdy','object','kind','string','PIVOT_CACHE_NOT_FOUND','PivotCacheProviderError','93698URVoSo','PIVOT_CACHE_PROVIDER_ALREADY_REGISTERED','_providers','toPrimitive','ProviderNotRegistered','univer-pro.pivot-cache.provider-registry','embedded','resource','has','Embedded','823184WCMORj','symbol','get','code','default','3226233plCaJY','defineProperty'];_0x278a=function(){return _0x490102;};return _0x278a();}function i(_0x3a4d08,_0xddde8f){var _0x3687b1=_0x47e2;if(r(_0x3a4d08)!=_0x3687b1(0x168)||!_0x3a4d08)return _0x3a4d08;var _0x2aade7=_0x3a4d08[Symbol[_0x3687b1(0x170)]];if(_0x2aade7!==void 0x0){var _0x13181a=_0x2aade7[_0x3687b1(0x159)](_0x3a4d08,_0xddde8f||_0x3687b1(0x17b));if(r(_0x13181a)!='object')return _0x13181a;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0xddde8f===_0x3687b1(0x16a)?String:Number)(_0x3a4d08);}function a(_0x4f5319){var _0x43e6fa=_0x47e2,_0x4d54be=i(_0x4f5319,_0x43e6fa(0x16a));return r(_0x4d54be)==_0x43e6fa(0x178)?_0x4d54be:_0x4d54be+'';}function o(_0x10ae61,_0x59b464,_0x2bdbed){var _0x4b1dd0=_0x47e2;return(_0x59b464=a(_0x59b464))in _0x10ae61?Object[_0x4b1dd0(0x17d)](_0x10ae61,_0x59b464,{'value':_0x2bdbed,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x10ae61[_0x59b464]=_0x2bdbed,_0x10ae61;}let s=function(_0x458a50){var _0x58cce9=_0x47e2;return _0x458a50['Unit']='unit',_0x458a50[_0x58cce9(0x176)]=_0x58cce9(0x173),_0x458a50['Resource']=_0x58cce9(0x174),_0x458a50;}({}),c=function(_0x3fafe7){var _0x359b4f=_0x47e2;return _0x3fafe7[_0x359b4f(0x171)]=_0x359b4f(0x15f),_0x3fafe7[_0x359b4f(0x15a)]=_0x359b4f(0x16e),_0x3fafe7['ReferenceInvalid']=_0x359b4f(0x162),_0x3fafe7['CacheNotFound']=_0x359b4f(0x16b),_0x3fafe7;}({});var l=class extends Error{constructor(_0x23d17e,_0x3ef42f){var _0x3e3503=_0x47e2;super(_0x23d17e),this[_0x3e3503(0x17a)]=_0x23d17e,this['details']=_0x3ef42f,this[_0x3e3503(0x158)]=_0x3e3503(0x16c);}};const u=_0x38e561(_0x5d5f3e(0x172));var d=class extends _0x42118c{constructor(..._0x37c9e6){super(..._0x37c9e6),o(this,'_providers',new Map());}['register'](_0x4518bf){var _0x219602=_0x5d5f3e;if(this['_providers'][_0x219602(0x175)](_0x4518bf['kind']))throw new l(_0x219602(0x16e),{'kind':_0x4518bf[_0x219602(0x169)]});return this[_0x219602(0x16f)]['set'](_0x4518bf[_0x219602(0x169)],_0x4518bf),_0x554aad(()=>{var _0x3a294e=_0x219602;this[_0x3a294e(0x16f)][_0x3a294e(0x179)](_0x4518bf[_0x3a294e(0x169)])===_0x4518bf&&this[_0x3a294e(0x16f)][_0x3a294e(0x160)](_0x4518bf['kind']);});}['acquire'](_0x2c0c72){var _0x21812b=_0x5d5f3e;let _0xf21b74=this[_0x21812b(0x16f)][_0x21812b(0x179)](_0x2c0c72[_0x21812b(0x169)]);if(!_0xf21b74)throw new l(_0x21812b(0x15f),{'kind':_0x2c0c72[_0x21812b(0x169)]});if(!_0xf21b74[_0x21812b(0x15c)](_0x2c0c72))throw new l(_0x21812b(0x162),{'reference':_0x2c0c72});return _0xf21b74['acquire'](_0x2c0c72);}[_0x5d5f3e(0x164)](){var _0x5eaef7=_0x5d5f3e;this['_providers'][_0x5eaef7(0x15b)](),super[_0x5eaef7(0x164)]();}};export{u as IPivotCacheProviderRegistry,l as PivotCacheProviderError,c as PivotCacheProviderErrorCodeEnum,d as PivotCacheProviderRegistry,s as PivotCacheReferenceKindEnum};
package/lib/index.js ADDED
@@ -0,0 +1 @@
1
+ var _0x5d5f3e=_0x47e2;(function(_0x191887,_0x1c06ea){var _0x1feb9f=_0x47e2,_0x226198=_0x191887();while(!![]){try{var _0x2c833d=parseInt(_0x1feb9f(0x163))/0x1*(-parseInt(_0x1feb9f(0x15e))/0x2)+-parseInt(_0x1feb9f(0x17c))/0x3+parseInt(_0x1feb9f(0x167))/0x4*(parseInt(_0x1feb9f(0x165))/0x5)+parseInt(_0x1feb9f(0x161))/0x6*(parseInt(_0x1feb9f(0x166))/0x7)+parseInt(_0x1feb9f(0x177))/0x8+-parseInt(_0x1feb9f(0x15d))/0x9+-parseInt(_0x1feb9f(0x17e))/0xa*(-parseInt(_0x1feb9f(0x16d))/0xb);if(_0x2c833d===_0x1c06ea)break;else _0x226198['push'](_0x226198['shift']());}catch(_0x2fd4f5){_0x226198['push'](_0x226198['shift']());}}}(_0x278a,0x99872));import{Disposable as _0x42118c,createIdentifier as _0x38e561,toDisposable as _0x554aad}from'@univerjs/core';function r(_0x1d6e20){'@babel/helpers - typeof';var _0x25bd56=_0x47e2;return r=typeof Symbol=='function'&&typeof Symbol['iterator']==_0x25bd56(0x178)?function(_0x19ea71){return typeof _0x19ea71;}:function(_0x3b09f6){return _0x3b09f6&&typeof Symbol=='function'&&_0x3b09f6['constructor']===Symbol&&_0x3b09f6!==Symbol['prototype']?'symbol':typeof _0x3b09f6;},r(_0x1d6e20);}function _0x47e2(_0x41ad34,_0x5e94f9){_0x41ad34=_0x41ad34-0x158;var _0x278a64=_0x278a();var _0x47e2fc=_0x278a64[_0x41ad34];return _0x47e2fc;}function _0x278a(){var _0x490102=['1900Iofemr','name','call','ProviderAlreadyRegistered','clear','isReference','148653BRexcL','4QIQAjA','PIVOT_CACHE_PROVIDER_NOT_REGISTERED','delete','2678154gDGviZ','PIVOT_CACHE_REFERENCE_INVALID','310223WJrBVz','dispose','165LRgVva','7gUTRyw','21036GTRmdy','object','kind','string','PIVOT_CACHE_NOT_FOUND','PivotCacheProviderError','93698URVoSo','PIVOT_CACHE_PROVIDER_ALREADY_REGISTERED','_providers','toPrimitive','ProviderNotRegistered','univer-pro.pivot-cache.provider-registry','embedded','resource','has','Embedded','823184WCMORj','symbol','get','code','default','3226233plCaJY','defineProperty'];_0x278a=function(){return _0x490102;};return _0x278a();}function i(_0x3a4d08,_0xddde8f){var _0x3687b1=_0x47e2;if(r(_0x3a4d08)!=_0x3687b1(0x168)||!_0x3a4d08)return _0x3a4d08;var _0x2aade7=_0x3a4d08[Symbol[_0x3687b1(0x170)]];if(_0x2aade7!==void 0x0){var _0x13181a=_0x2aade7[_0x3687b1(0x159)](_0x3a4d08,_0xddde8f||_0x3687b1(0x17b));if(r(_0x13181a)!='object')return _0x13181a;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0xddde8f===_0x3687b1(0x16a)?String:Number)(_0x3a4d08);}function a(_0x4f5319){var _0x43e6fa=_0x47e2,_0x4d54be=i(_0x4f5319,_0x43e6fa(0x16a));return r(_0x4d54be)==_0x43e6fa(0x178)?_0x4d54be:_0x4d54be+'';}function o(_0x10ae61,_0x59b464,_0x2bdbed){var _0x4b1dd0=_0x47e2;return(_0x59b464=a(_0x59b464))in _0x10ae61?Object[_0x4b1dd0(0x17d)](_0x10ae61,_0x59b464,{'value':_0x2bdbed,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x10ae61[_0x59b464]=_0x2bdbed,_0x10ae61;}let s=function(_0x458a50){var _0x58cce9=_0x47e2;return _0x458a50['Unit']='unit',_0x458a50[_0x58cce9(0x176)]=_0x58cce9(0x173),_0x458a50['Resource']=_0x58cce9(0x174),_0x458a50;}({}),c=function(_0x3fafe7){var _0x359b4f=_0x47e2;return _0x3fafe7[_0x359b4f(0x171)]=_0x359b4f(0x15f),_0x3fafe7[_0x359b4f(0x15a)]=_0x359b4f(0x16e),_0x3fafe7['ReferenceInvalid']=_0x359b4f(0x162),_0x3fafe7['CacheNotFound']=_0x359b4f(0x16b),_0x3fafe7;}({});var l=class extends Error{constructor(_0x23d17e,_0x3ef42f){var _0x3e3503=_0x47e2;super(_0x23d17e),this[_0x3e3503(0x17a)]=_0x23d17e,this['details']=_0x3ef42f,this[_0x3e3503(0x158)]=_0x3e3503(0x16c);}};const u=_0x38e561(_0x5d5f3e(0x172));var d=class extends _0x42118c{constructor(..._0x37c9e6){super(..._0x37c9e6),o(this,'_providers',new Map());}['register'](_0x4518bf){var _0x219602=_0x5d5f3e;if(this['_providers'][_0x219602(0x175)](_0x4518bf['kind']))throw new l(_0x219602(0x16e),{'kind':_0x4518bf[_0x219602(0x169)]});return this[_0x219602(0x16f)]['set'](_0x4518bf[_0x219602(0x169)],_0x4518bf),_0x554aad(()=>{var _0x3a294e=_0x219602;this[_0x3a294e(0x16f)][_0x3a294e(0x179)](_0x4518bf[_0x3a294e(0x169)])===_0x4518bf&&this[_0x3a294e(0x16f)][_0x3a294e(0x160)](_0x4518bf['kind']);});}['acquire'](_0x2c0c72){var _0x21812b=_0x5d5f3e;let _0xf21b74=this[_0x21812b(0x16f)][_0x21812b(0x179)](_0x2c0c72[_0x21812b(0x169)]);if(!_0xf21b74)throw new l(_0x21812b(0x15f),{'kind':_0x2c0c72[_0x21812b(0x169)]});if(!_0xf21b74[_0x21812b(0x15c)](_0x2c0c72))throw new l(_0x21812b(0x162),{'reference':_0x2c0c72});return _0xf21b74['acquire'](_0x2c0c72);}[_0x5d5f3e(0x164)](){var _0x5eaef7=_0x5d5f3e;this['_providers'][_0x5eaef7(0x15b)](),super[_0x5eaef7(0x164)]();}};export{u as IPivotCacheProviderRegistry,l as PivotCacheProviderError,c as PivotCacheProviderErrorCodeEnum,d as PivotCacheProviderRegistry,s as PivotCacheReferenceKindEnum};
@@ -0,0 +1,66 @@
1
+ import type { IResourceRef } from '@univerjs-pro/embed';
2
+ import type { DataFieldManager } from '@univerjs-pro/engine-pivot';
3
+ import type { IDisposable } from '@univerjs/core';
4
+ import type { Observable } from 'rxjs';
5
+ import { Disposable } from '@univerjs/core';
6
+ export declare enum PivotCacheReferenceKindEnum {
7
+ Unit = "unit",
8
+ Embedded = "embedded",
9
+ Resource = "resource"
10
+ }
11
+ export interface IPivotCacheReference {
12
+ readonly kind: PivotCacheReferenceKindEnum;
13
+ }
14
+ export interface IUnitPivotCacheReference extends IPivotCacheReference {
15
+ readonly kind: PivotCacheReferenceKindEnum.Unit;
16
+ readonly ownerUnitId: string;
17
+ readonly pivotCacheId: string;
18
+ }
19
+ export interface IEmbeddedPivotCacheReference extends IPivotCacheReference {
20
+ readonly kind: PivotCacheReferenceKindEnum.Embedded;
21
+ readonly resourceId: string;
22
+ }
23
+ export interface IResourcePivotCacheReference extends IPivotCacheReference {
24
+ readonly kind: PivotCacheReferenceKindEnum.Resource;
25
+ readonly ref: IResourceRef;
26
+ readonly pivotCacheId?: string;
27
+ }
28
+ export type PivotCacheReference = IUnitPivotCacheReference | IEmbeddedPivotCacheReference | IResourcePivotCacheReference;
29
+ export interface IPivotCacheChangedEvent {
30
+ readonly pivotCacheId: string;
31
+ readonly revision: number;
32
+ readonly dirtyFieldIds: readonly string[];
33
+ }
34
+ export interface IPivotCacheHandle extends IDisposable {
35
+ readonly pivotCacheId: string;
36
+ readonly revision: number;
37
+ readonly changed$: Observable<IPivotCacheChangedEvent>;
38
+ getDataFieldManager(): DataFieldManager;
39
+ }
40
+ export interface IPivotCacheProvider<TReference extends IPivotCacheReference = IPivotCacheReference> {
41
+ readonly kind: TReference['kind'];
42
+ isReference(reference: IPivotCacheReference): reference is TReference;
43
+ acquire(reference: TReference): IPivotCacheHandle;
44
+ }
45
+ export declare enum PivotCacheProviderErrorCodeEnum {
46
+ ProviderNotRegistered = "PIVOT_CACHE_PROVIDER_NOT_REGISTERED",
47
+ ProviderAlreadyRegistered = "PIVOT_CACHE_PROVIDER_ALREADY_REGISTERED",
48
+ ReferenceInvalid = "PIVOT_CACHE_REFERENCE_INVALID",
49
+ CacheNotFound = "PIVOT_CACHE_NOT_FOUND"
50
+ }
51
+ export declare class PivotCacheProviderError extends Error {
52
+ readonly code: PivotCacheProviderErrorCodeEnum;
53
+ readonly details?: unknown | undefined;
54
+ constructor(code: PivotCacheProviderErrorCodeEnum, details?: unknown | undefined);
55
+ }
56
+ export interface IPivotCacheProviderRegistry extends IDisposable {
57
+ register(provider: IPivotCacheProvider): IDisposable;
58
+ acquire(reference: IPivotCacheReference): IPivotCacheHandle;
59
+ }
60
+ export declare const IPivotCacheProviderRegistry: import("@wendellhu/redi").IdentifierDecorator<IPivotCacheProviderRegistry>;
61
+ export declare class PivotCacheProviderRegistry extends Disposable implements IPivotCacheProviderRegistry {
62
+ private readonly _providers;
63
+ register(provider: IPivotCacheProvider): IDisposable;
64
+ acquire(reference: IPivotCacheReference): IPivotCacheHandle;
65
+ dispose(): void;
66
+ }
@@ -0,0 +1,2 @@
1
+ export type { IEmbeddedPivotCacheReference, IPivotCacheChangedEvent, IPivotCacheHandle, IPivotCacheProvider, IPivotCacheReference, IUnitPivotCacheReference, PivotCacheReference, } from './cache';
2
+ export { IPivotCacheProviderRegistry, PivotCacheProviderError, PivotCacheProviderErrorCodeEnum, PivotCacheProviderRegistry, PivotCacheReferenceKindEnum, } from './cache';
@@ -0,0 +1 @@
1
+ function _0x4af2(_0x5b9112,_0x12ed05){_0x5b9112=_0x5b9112-0x1df;var _0x2fa4b5=_0x2fa4();var _0x4af223=_0x2fa4b5[_0x5b9112];return _0x4af223;}(function(_0x2b94ad,_0x1e0837){var _0x141cd1=_0x4af2,_0x28799a=_0x2b94ad();while(!![]){try{var _0x236c7a=parseInt(_0x141cd1(0x20f))/0x1*(parseInt(_0x141cd1(0x201))/0x2)+parseInt(_0x141cd1(0x1e3))/0x3+parseInt(_0x141cd1(0x20b))/0x4+parseInt(_0x141cd1(0x1df))/0x5+parseInt(_0x141cd1(0x213))/0x6*(-parseInt(_0x141cd1(0x207))/0x7)+-parseInt(_0x141cd1(0x1e1))/0x8*(parseInt(_0x141cd1(0x1fb))/0x9)+parseInt(_0x141cd1(0x1ef))/0xa*(-parseInt(_0x141cd1(0x205))/0xb);if(_0x236c7a===_0x1e0837)break;else _0x28799a['push'](_0x28799a['shift']());}catch(_0x99c3c1){_0x28799a['push'](_0x28799a['shift']());}}}(_0x2fa4,0x1af25),function(_0x12d405,_0x77b1a8){var _0x4e99db=_0x4af2;typeof exports==_0x4e99db(0x1f1)&&typeof module<'u'?_0x77b1a8(exports,require('@univerjs/core')):typeof define==_0x4e99db(0x1fa)&&define[_0x4e99db(0x206)]?define([_0x4e99db(0x1e0),_0x4e99db(0x1f8)],_0x77b1a8):(_0x12d405=typeof globalThis<'u'?globalThis:_0x12d405||self,_0x77b1a8(_0x12d405['UniverProPivotCache']={},_0x12d405[_0x4e99db(0x1eb)]));}(this,function(_0x447d74,_0x5ac933){var _0x1e5c81=_0x4af2;Object[_0x1e5c81(0x204)](_0x447d74,Symbol[_0x1e5c81(0x1ed)],{'value':'Module'});function _0x40d2f9(_0x3b601c){'@babel/helpers - typeof';var _0x300a83=_0x1e5c81;return _0x40d2f9=typeof Symbol==_0x300a83(0x1fa)&&typeof Symbol[_0x300a83(0x1ec)]==_0x300a83(0x1e6)?function(_0x2d7520){return typeof _0x2d7520;}:function(_0x34d4db){var _0x2f868f=_0x300a83;return _0x34d4db&&typeof Symbol=='function'&&_0x34d4db[_0x2f868f(0x215)]===Symbol&&_0x34d4db!==Symbol[_0x2f868f(0x208)]?'symbol':typeof _0x34d4db;},_0x40d2f9(_0x3b601c);}function _0x28e05a(_0x2185b9,_0x41ee59){var _0xc0591=_0x1e5c81;if(_0x40d2f9(_0x2185b9)!=_0xc0591(0x1f1)||!_0x2185b9)return _0x2185b9;var _0x5399f2=_0x2185b9[Symbol[_0xc0591(0x203)]];if(_0x5399f2!==void 0x0){var _0x1744f8=_0x5399f2[_0xc0591(0x1ee)](_0x2185b9,_0x41ee59||_0xc0591(0x1f3));if(_0x40d2f9(_0x1744f8)!=_0xc0591(0x1f1))return _0x1744f8;throw TypeError(_0xc0591(0x1f7));}return(_0x41ee59===_0xc0591(0x210)?String:Number)(_0x2185b9);}function _0x5b257d(_0x3546c5){var _0x5aaef5=_0x1e5c81,_0x2d049c=_0x28e05a(_0x3546c5,'string');return _0x40d2f9(_0x2d049c)==_0x5aaef5(0x1e6)?_0x2d049c:_0x2d049c+'';}function _0x333c54(_0x41b8b7,_0x3b09ce,_0x37de59){var _0x4f3bb9=_0x1e5c81;return(_0x3b09ce=_0x5b257d(_0x3b09ce))in _0x41b8b7?Object[_0x4f3bb9(0x204)](_0x41b8b7,_0x3b09ce,{'value':_0x37de59,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x41b8b7[_0x3b09ce]=_0x37de59,_0x41b8b7;}let _0x767703=function(_0x37c80a){var _0x253d97=_0x1e5c81;return _0x37c80a[_0x253d97(0x211)]=_0x253d97(0x1f6),_0x37c80a['Embedded']=_0x253d97(0x1e2),_0x37c80a[_0x253d97(0x1e4)]='resource',_0x37c80a;}({}),_0x3ec55e=function(_0x10a1da){var _0x330000=_0x1e5c81;return _0x10a1da[_0x330000(0x214)]='PIVOT_CACHE_PROVIDER_NOT_REGISTERED',_0x10a1da[_0x330000(0x1ea)]=_0x330000(0x1f2),_0x10a1da[_0x330000(0x1e5)]='PIVOT_CACHE_REFERENCE_INVALID',_0x10a1da['CacheNotFound']='PIVOT_CACHE_NOT_FOUND',_0x10a1da;}({});var _0x1a0df8=class extends Error{constructor(_0x231e7f,_0x14fbd9){var _0x485b3d=_0x1e5c81;super(_0x231e7f),this['code']=_0x231e7f,this['details']=_0x14fbd9,this[_0x485b3d(0x20c)]=_0x485b3d(0x20a);}};let _0x2facfe=(0x0,_0x5ac933['createIdentifier'])(_0x1e5c81(0x1e8));var _0x4eab31=class extends _0x5ac933[_0x1e5c81(0x1f9)]{constructor(..._0x1c1d22){var _0x3731ef=_0x1e5c81;super(..._0x1c1d22),_0x333c54(this,_0x3731ef(0x20e),new Map());}[_0x1e5c81(0x1fd)](_0x497759){var _0x4471c5=_0x1e5c81;if(this[_0x4471c5(0x20e)][_0x4471c5(0x20d)](_0x497759['kind']))throw new _0x1a0df8(_0x4471c5(0x1f2),{'kind':_0x497759[_0x4471c5(0x1e9)]});return this[_0x4471c5(0x20e)]['set'](_0x497759['kind'],_0x497759),(0x0,_0x5ac933['toDisposable'])(()=>{var _0x232670=_0x4471c5;this['_providers'][_0x232670(0x1f0)](_0x497759[_0x232670(0x1e9)])===_0x497759&&this[_0x232670(0x20e)][_0x232670(0x1ff)](_0x497759[_0x232670(0x1e9)]);});}[_0x1e5c81(0x1e7)](_0x4f7a72){var _0x1ccfb5=_0x1e5c81;let _0xb79287=this[_0x1ccfb5(0x20e)][_0x1ccfb5(0x1f0)](_0x4f7a72[_0x1ccfb5(0x1e9)]);if(!_0xb79287)throw new _0x1a0df8('PIVOT_CACHE_PROVIDER_NOT_REGISTERED',{'kind':_0x4f7a72[_0x1ccfb5(0x1e9)]});if(!_0xb79287[_0x1ccfb5(0x1fc)](_0x4f7a72))throw new _0x1a0df8(_0x1ccfb5(0x202),{'reference':_0x4f7a72});return _0xb79287[_0x1ccfb5(0x1e7)](_0x4f7a72);}[_0x1e5c81(0x1f5)](){var _0x39909f=_0x1e5c81;this['_providers'][_0x39909f(0x209)](),super[_0x39909f(0x1f5)]();}};_0x447d74[_0x1e5c81(0x212)]=_0x2facfe,_0x447d74[_0x1e5c81(0x20a)]=_0x1a0df8,_0x447d74[_0x1e5c81(0x1f4)]=_0x3ec55e,_0x447d74[_0x1e5c81(0x200)]=_0x4eab31,_0x447d74[_0x1e5c81(0x1fe)]=_0x767703;}));function _0x2fa4(){var _0xab4167=['unit','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','@univerjs/core','Disposable','function','516690cmnhiP','isReference','register','PivotCacheReferenceKindEnum','delete','PivotCacheProviderRegistry','2tzWxaI','PIVOT_CACHE_REFERENCE_INVALID','toPrimitive','defineProperty','968UsDhZv','amd','1099qfUnBx','prototype','clear','PivotCacheProviderError','129872WAOGRI','name','has','_providers','177983QMwECu','string','Unit','IPivotCacheProviderRegistry','4134pBGLLH','ProviderNotRegistered','constructor','49725JbGvtl','exports','8OPeakU','embedded','383160fwIeSY','Resource','ReferenceInvalid','symbol','acquire','univer-pro.pivot-cache.provider-registry','kind','ProviderAlreadyRegistered','UniverCore','iterator','toStringTag','call','8200ZToQSS','get','object','PIVOT_CACHE_PROVIDER_ALREADY_REGISTERED','default','PivotCacheProviderErrorCodeEnum','dispose'];_0x2fa4=function(){return _0xab4167;};return _0x2fa4();}
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@univerjs-pro/pivot-cache",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "description": "Host-neutral shared pivot cache contracts for Univer Pro.",
6
+ "author": "DreamNum Co., Ltd. <developer@univer.ai>",
7
+ "funding": {
8
+ "type": "opencollective",
9
+ "url": "https://opencollective.com/univer"
10
+ },
11
+ "homepage": "https://univer.ai",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/dream-num/univer-pro"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/dream-num/univer/issues"
18
+ },
19
+ "keywords": [
20
+ "univer",
21
+ "univer-pro",
22
+ "pivot",
23
+ "cache"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "import": "./lib/es/index.js",
28
+ "require": "./lib/cjs/index.js",
29
+ "types": "./lib/types/index.d.ts"
30
+ },
31
+ "./*": {
32
+ "import": "./lib/es/*",
33
+ "require": "./lib/cjs/*",
34
+ "types": "./lib/types/index.d.ts"
35
+ },
36
+ "./lib/*": "./lib/*"
37
+ },
38
+ "main": "./lib/es/index.js",
39
+ "types": "./lib/types/index.d.ts",
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "directories": {
44
+ "lib": "lib"
45
+ },
46
+ "files": [
47
+ "lib"
48
+ ],
49
+ "peerDependencies": {
50
+ "@univerjs-pro/embed": "1.0.0",
51
+ "@univerjs-pro/engine-pivot": "1.0.0"
52
+ },
53
+ "dependencies": {
54
+ "@univerjs/core": "1.0.0",
55
+ "rxjs": "7.8.2"
56
+ },
57
+ "devDependencies": {
58
+ "@univerjs-infra/shared": "1.0.0",
59
+ "@univerjs-pro/embed": "1.0.0",
60
+ "@univerjs-pro/engine-pivot": "1.0.0",
61
+ "rxjs": "7.8.2",
62
+ "typescript": "^6.0.3",
63
+ "vitest": "^5.0.0"
64
+ },
65
+ "scripts": {
66
+ "test": "vitest run",
67
+ "test:watch": "vitest",
68
+ "coverage": "vitest run --coverage",
69
+ "typecheck": "tsc --noEmit",
70
+ "build:bundle": "univer-cli build",
71
+ "build:types": "tsc -p tsconfig.node.json",
72
+ "build": "pnpm run build:bundle && pnpm run build:types"
73
+ },
74
+ "module": "./lib/es/index.js"
75
+ }