@univerjs-pro/engine-formula 1.3.0 → 1.4.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.
@@ -32,6 +32,7 @@ export declare class FormulaDependencyProGenerator extends FormulaDependencyGene
32
32
  private readonly _forcedRecalculationNodeIndices;
33
33
  private _sharedFormulaCompressionMetrics;
34
34
  private _cacheDependencyTreeModelRangeList;
35
+ private _referenceContextChanged;
35
36
  dispose(): void;
36
37
  clearCalculatedDirty(nodeIndices: number[]): void;
37
38
  clearCachedCalculationNodeData(): void;
@@ -8,10 +8,10 @@ export { ExternalReferenceResourceController } from './controllers/external-refe
8
8
  export { FORMULA_REFERENCE_DATA_RPC_CHANNEL, FormulaReferenceDataRpcController } from './controllers/formula-reference-data-rpc.controller';
9
9
  export { ExternalReferenceOverlayModel } from './models/external-reference-overlay.model';
10
10
  export type { IExternalOverlayCellState } from './models/external-reference-overlay.model';
11
- export { createEmptyExternalReferenceResource, createExternalSyntheticUnitId, EXTERNAL_REFERENCE_SCHEMA_VERSION, ExternalReferenceModel, SHEET_EXTERNAL_DATA_PLUGIN, } from './models/external-reference.model';
11
+ export { createEmptyExternalReferenceResource, createExternalSyntheticUnitId, ExternalReferenceModel, SHEET_EXTERNAL_DATA_PLUGIN, } from './models/external-reference.model';
12
12
  export type { ExternalReferenceBindingResult, IExternalReferenceCachedCell, IExternalReferenceCachedSheet, IExternalReferenceCoverage, IExternalReferenceLink, IExternalReferenceResource, IExternalReferenceTable, IExternalReferenceTableColumn, } from './models/external-reference.model';
13
13
  export type { IFormulaLastValue } from './models/formula-last-value';
14
- export { HOST_EXTERNAL_REFERENCE_SCHEMA_VERSION, HostExternalReferenceModel, normalizeHostExternalReferenceQualifier, UNIVER_EXTERNAL_REFERENCE_PLUGIN, } from './models/host-external-reference.model';
14
+ export { HostExternalReferenceModel, normalizeHostExternalReferenceQualifier, UNIVER_EXTERNAL_REFERENCE_PLUGIN, } from './models/host-external-reference.model';
15
15
  export type { HostExternalReferenceBindingResult, IHostExternalReference, IHostExternalReferenceResource, } from './models/host-external-reference.model';
16
16
  export { UniverProFormulaEnginePlugin } from './plugin';
17
17
  export type { CalculateFormulaProService } from './services/calculate-formula.service';
@@ -1,7 +1,6 @@
1
1
  import type { FormulaUnitType } from '@univerjs/engine-formula';
2
2
  import { Disposable } from '@univerjs/core';
3
3
  export declare const SHEET_EXTERNAL_DATA_PLUGIN = "SHEET_EXTERNAL_DATA_PLUGIN";
4
- export declare const EXTERNAL_REFERENCE_SCHEMA_VERSION: 1;
5
4
  export interface IExternalReferenceCoverage {
6
5
  startRow: number;
7
6
  endRow: number;
@@ -62,7 +61,6 @@ export interface IExternalReferenceLink {
62
61
  };
63
62
  }
64
63
  export interface IExternalReferenceResource {
65
- schemaVersion: typeof EXTERNAL_REFERENCE_SCHEMA_VERSION;
66
64
  links: IExternalReferenceLink[];
67
65
  }
68
66
  export type ExternalReferenceBindingResult = {
@@ -80,7 +78,7 @@ export declare class ExternalReferenceModel extends Disposable {
80
78
  set(hostUnitId: string, resource: IExternalReferenceResource): boolean;
81
79
  serialize(hostUnitId: string): IExternalReferenceResource;
82
80
  get(hostUnitId: string): IExternalReferenceResource | undefined;
83
- getLoadError(hostUnitId: string): 'invalid-resource' | 'unsupported-version' | undefined;
81
+ getLoadError(hostUnitId: string): 'invalid-resource' | undefined;
84
82
  resolveBinding(hostUnitId: string, qualifier: string): ExternalReferenceBindingResult;
85
83
  renameLiveTarget(unitId: string, oldName: string, newName: string): Array<{
86
84
  hostUnitId: string;
@@ -5,7 +5,6 @@ import { Disposable } from '@univerjs/core';
5
5
  * The resource stores identity mappings only; it never stores Source formula data.
6
6
  */
7
7
  export declare const UNIVER_EXTERNAL_REFERENCE_PLUGIN = "UNIVER_EXTERNAL_REFERENCE_PLUGIN";
8
- export declare const HOST_EXTERNAL_REFERENCE_SCHEMA_VERSION: 1;
9
8
  /** One Host-owned mapping from a public formula qualifier to a stable Source Unit. */
10
9
  export interface IHostExternalReference {
11
10
  /** Source name used in formula text, without brackets or quotes. */
@@ -22,7 +21,6 @@ export interface IHostExternalReference {
22
21
  * Facade/command APIs for runtime writes instead of constructing those IDs.
23
22
  */
24
23
  export interface IHostExternalReferenceResource {
25
- schemaVersion: typeof HOST_EXTERNAL_REFERENCE_SCHEMA_VERSION;
26
24
  references: Record<string, IHostExternalReference>;
27
25
  }
28
26
  export type HostExternalReferenceBindingResult = {
@@ -32,7 +30,7 @@ export type HostExternalReferenceBindingResult = {
32
30
  } | {
33
31
  status: 'missing' | 'ambiguous';
34
32
  };
35
- export type HostExternalReferenceLoadError = 'invalid-resource' | 'unsupported-version';
33
+ export type HostExternalReferenceLoadError = 'invalid-resource';
36
34
  export declare function createEmptyHostExternalReferenceResource(): IHostExternalReferenceResource;
37
35
  export declare function isReservedExternalReferenceQualifier(qualifier: string): boolean;
38
36
  export declare function normalizeHostExternalReferenceQualifier(qualifier: string): string;
@@ -60,7 +60,7 @@ export interface IFormulaReferenceDataResponse {
60
60
  export interface IFormulaReferenceDataService {
61
61
  readData(request: IFormulaReferenceDataRequest): Promise<IFormulaReferenceDataResponse>;
62
62
  }
63
- export declare const IFormulaReferenceDataService: import("@wendellhu/redi").IdentifierDecorator<IFormulaReferenceDataService>;
63
+ export declare const IFormulaReferenceDataService: import("@univerjs/core").IdentifierDecorator<IFormulaReferenceDataService>;
64
64
  export interface IFormulaReferenceDataProvider {
65
65
  readonly id: string;
66
66
  readonly priority?: number;
@@ -71,7 +71,7 @@ export interface IFormulaReferenceDataProviderRegistry {
71
71
  register(provider: IFormulaReferenceDataProvider): IDisposable;
72
72
  getProviders(request: IFormulaReferenceDataRequest): IFormulaReferenceDataProvider[];
73
73
  }
74
- export declare const IFormulaReferenceDataProviderRegistry: import("@wendellhu/redi").IdentifierDecorator<IFormulaReferenceDataProviderRegistry>;
74
+ export declare const IFormulaReferenceDataProviderRegistry: import("@univerjs/core").IdentifierDecorator<IFormulaReferenceDataProviderRegistry>;
75
75
  export declare class FormulaReferenceDataProviderRegistry extends Disposable implements IFormulaReferenceDataProviderRegistry {
76
76
  private readonly _providers;
77
77
  register(provider: IFormulaReferenceDataProvider): IDisposable;
@@ -0,0 +1 @@
1
+ export { UniverProFormulaEnginePlugin } from './plugin';
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x370f(){var _0x42b2fd=['buildReference','@univerjs/engine-formula/facade','@univerjs/core/facade','FormulaReferenceType','7100490YbfsfA','removeExternalReference','upsertExternalReference','8623648pqVXrz','Formula\x20reference\x20authoring\x20requires\x20stable\x20Host\x20and\x20Source\x20Unit\x20IDs.','35484KQJCeN','UniverProEngineFormulaFacade','UNIVER_SHEET','107464upPPUZ','UpsertHostExternalReferenceCommand','function','Failed\x20to\x20bind\x20external\x20formula\x20reference\x20\x22','8474440aVPolv','buildFormulaReference','SHEET_RANGE','52GSJufQ','UniverProEngineFormula','FFormula','2469776IDGSTO','FEnum','syncExecuteCommand','unitId','UniverInstanceType','toStringTag','amd','UniverCoreFacade','UniverCore','defineProperty','RemoveHostExternalReferenceCommand','_commandService','formulaQualifier','Module','extend','45mCbrqI','18QLXrWf','3191041JcKZyo'];_0x370f=function(){return _0x42b2fd;};return _0x370f();}function _0x5cb9(_0x40091f,_0x5d2a2b){_0x40091f=_0x40091f-0x155;var _0x370ffe=_0x370f();var _0x5cb908=_0x370ffe[_0x40091f];return _0x5cb908;}(function(_0x370023,_0x230e57){var _0x18345e=_0x5cb9,_0x189cfa=_0x370023();while(!![]){try{var _0x6d4749=parseInt(_0x18345e(0x169))/0x1+parseInt(_0x18345e(0x173))/0x2+parseInt(_0x18345e(0x166))/0x3*(parseInt(_0x18345e(0x170))/0x4)+-parseInt(_0x18345e(0x16d))/0x5+parseInt(_0x18345e(0x15b))/0x6*(-parseInt(_0x18345e(0x15c))/0x7)+-parseInt(_0x18345e(0x164))/0x8+parseInt(_0x18345e(0x15a))/0x9*(parseInt(_0x18345e(0x161))/0xa);if(_0x6d4749===_0x230e57)break;else _0x189cfa['push'](_0x189cfa['shift']());}catch(_0x1b417a){_0x189cfa['push'](_0x189cfa['shift']());}}}(_0x370f,0xdd2c8),function(_0x9fab4c,_0x4f0a80){var _0x5403a2=_0x5cb9;typeof exports=='object'&&typeof module<'u'?_0x4f0a80(exports,require('@univerjs/engine-formula/facade'),require('@univerjs-pro/engine-formula'),require('@univerjs/core/facade'),require('@univerjs/core')):typeof define==_0x5403a2(0x16b)&&define[_0x5403a2(0x179)]?define(['exports',_0x5403a2(0x15e),'@univerjs-pro/engine-formula',_0x5403a2(0x15f),'@univerjs/core'],_0x4f0a80):(_0x9fab4c=typeof globalThis<'u'?globalThis:_0x9fab4c||self,_0x4f0a80(_0x9fab4c[_0x5403a2(0x167)]={},_0x9fab4c['UniverEngineFormulaFacade'],_0x9fab4c[_0x5403a2(0x171)],_0x9fab4c[_0x5403a2(0x17a)],_0x9fab4c[_0x5403a2(0x17b)]));}(this,function(_0x21c24b,_0x54cfb0,_0x27d21e,_0x55dbe9,_0x291469){var _0x4ce75f=_0x5cb9;Object[_0x4ce75f(0x17c)](_0x21c24b,Symbol[_0x4ce75f(0x178)],{'value':_0x4ce75f(0x158)});var _0x4f0de6=class extends _0x55dbe9[_0x4ce75f(0x174)]{get[_0x4ce75f(0x160)](){var _0x442253=_0x4ce75f;return _0x27d21e[_0x442253(0x160)];}};_0x55dbe9[_0x4ce75f(0x174)]['extend'](_0x4f0de6);var _0x5d5988=class extends _0x54cfb0[_0x4ce75f(0x172)]{[_0x4ce75f(0x15d)](_0x1e8566){var _0x25dd3e=_0x4ce75f;let {hostUnitId:_0x3e28c6,unit:_0x3da3e6,target:_0x181e1c}=_0x1e8566;if(!_0x3e28c6||!_0x3da3e6[_0x25dd3e(0x176)])throw Error(_0x25dd3e(0x165));if(_0x3da3e6['unitId']!==_0x3e28c6&&!this[_0x25dd3e(0x156)]['syncExecuteCommand'](_0x27d21e[_0x25dd3e(0x16a)]['id'],{'unitId':_0x3e28c6,'qualifier':_0x3da3e6[_0x25dd3e(0x157)],'sourceUnitId':_0x3da3e6[_0x25dd3e(0x176)],'sourceUnitType':_0x181e1c['kind']===_0x27d21e[_0x25dd3e(0x160)][_0x25dd3e(0x16f)]?_0x291469[_0x25dd3e(0x177)][_0x25dd3e(0x168)]:_0x291469[_0x25dd3e(0x177)]['UNIVER_BASE']}))throw Error(_0x25dd3e(0x16c)+_0x3da3e6[_0x25dd3e(0x157)]+'\x22.');return(0x0,_0x27d21e[_0x25dd3e(0x16e)])(_0x1e8566);}[_0x4ce75f(0x163)](_0x455189){var _0xb4965e=_0x4ce75f;return this[_0xb4965e(0x156)]['syncExecuteCommand'](_0x27d21e[_0xb4965e(0x16a)]['id'],_0x455189);}[_0x4ce75f(0x162)](_0x1b1b22){var _0x53538f=_0x4ce75f;return this['_commandService'][_0x53538f(0x175)](_0x27d21e[_0x53538f(0x155)]['id'],_0x1b1b22);}};_0x54cfb0[_0x4ce75f(0x172)][_0x4ce75f(0x159)](_0x5d5988),Object['defineProperty'](_0x21c24b,'FFormula',{'enumerable':!0x0,'get':function(){var _0x2445d1=_0x4ce75f;return _0x54cfb0[_0x2445d1(0x172)];}});}));
1
+ (function(_0x4993e9,_0x197d93){var _0x1d0dc5=_0x321d,_0x1bced3=_0x4993e9();while(!![]){try{var _0x1edf15=parseInt(_0x1d0dc5(0xec))/0x1+parseInt(_0x1d0dc5(0xfd))/0x2*(parseInt(_0x1d0dc5(0x10a))/0x3)+parseInt(_0x1d0dc5(0xff))/0x4+-parseInt(_0x1d0dc5(0x113))/0x5+parseInt(_0x1d0dc5(0x110))/0x6*(parseInt(_0x1d0dc5(0xf0))/0x7)+-parseInt(_0x1d0dc5(0xf7))/0x8+parseInt(_0x1d0dc5(0x102))/0x9*(-parseInt(_0x1d0dc5(0x10f))/0xa);if(_0x1edf15===_0x197d93)break;else _0x1bced3['push'](_0x1bced3['shift']());}catch(_0x20e3a4){_0x1bced3['push'](_0x1bced3['shift']());}}}(_0x464a,0x6184c),function(_0x9f21d1,_0xfe792f){var _0x286f02=_0x321d;typeof exports=='object'&&typeof module<'u'?_0xfe792f(exports,require('@univerjs/engine-formula/facade'),require('@univerjs-pro/engine-formula'),require('@univerjs/core/facade'),require('@univerjs/core')):typeof define==_0x286f02(0x108)&&define[_0x286f02(0xf4)]?define(['exports',_0x286f02(0xfa),_0x286f02(0x111),_0x286f02(0x106),_0x286f02(0xef)],_0xfe792f):(_0x9f21d1=typeof globalThis<'u'?globalThis:_0x9f21d1||self,_0xfe792f(_0x9f21d1[_0x286f02(0x10d)]={},_0x9f21d1[_0x286f02(0xf8)],_0x9f21d1['UniverProEngineFormula'],_0x9f21d1[_0x286f02(0xf1)],_0x9f21d1[_0x286f02(0x10c)]));}(this,function(_0xfd06c,_0x4a83d6,_0x1d6522,_0x2840ab,_0x51c40b){var _0x4b2e08=_0x321d;Object[_0x4b2e08(0xf5)](_0xfd06c,Symbol[_0x4b2e08(0x107)],{'value':_0x4b2e08(0x10e)});var _0x36c35c=class extends _0x2840ab['FEnum']{get[_0x4b2e08(0xf2)](){var _0x193a4c=_0x4b2e08;return _0x1d6522[_0x193a4c(0xf2)];}};_0x2840ab[_0x4b2e08(0xfb)][_0x4b2e08(0x100)](_0x36c35c);var _0x2f3e25=class extends _0x4a83d6[_0x4b2e08(0x112)]{['buildReference'](_0x44f9ac){var _0x29362f=_0x4b2e08;let {hostUnitId:_0x560bd4,unit:_0x3df927,target:_0x2a1752}=_0x44f9ac;if(!_0x560bd4||!_0x3df927['unitId'])throw Error(_0x29362f(0xf9));if(_0x3df927[_0x29362f(0x105)]!==_0x560bd4&&!this[_0x29362f(0x101)][_0x29362f(0x109)](_0x1d6522[_0x29362f(0xfc)]['id'],{'unitId':_0x560bd4,'qualifier':_0x3df927[_0x29362f(0x104)],'sourceUnitId':_0x3df927['unitId'],'sourceUnitType':_0x2a1752[_0x29362f(0x114)]===_0x1d6522[_0x29362f(0xf2)][_0x29362f(0x10b)]?_0x51c40b['UniverInstanceType'][_0x29362f(0xfe)]:_0x51c40b[_0x29362f(0xed)]['UNIVER_BASE']}))throw Error(_0x29362f(0xf6)+_0x3df927['formulaQualifier']+'\x22.');return(0x0,_0x1d6522[_0x29362f(0xee)])(_0x44f9ac);}[_0x4b2e08(0x103)](_0x957d60){var _0x121a70=_0x4b2e08;return this[_0x121a70(0x101)][_0x121a70(0x109)](_0x1d6522[_0x121a70(0xfc)]['id'],_0x957d60);}[_0x4b2e08(0xf3)](_0x45d140){var _0x186ee5=_0x4b2e08;return this[_0x186ee5(0x101)]['syncExecuteCommand'](_0x1d6522[_0x186ee5(0x115)]['id'],_0x45d140);}};_0x4a83d6['FFormula'][_0x4b2e08(0x100)](_0x2f3e25),Object['defineProperty'](_0xfd06c,'FFormula',{'enumerable':!0x0,'get':function(){return _0x4a83d6['FFormula'];}});}));function _0x321d(_0x7a2d79,_0x40623f){_0x7a2d79=_0x7a2d79-0xec;var _0x464a40=_0x464a();var _0x321dd8=_0x464a40[_0x7a2d79];return _0x321dd8;}function _0x464a(){var _0x28f7cb=['@univerjs-pro/engine-formula','FFormula','3339090hehxcf','kind','RemoveHostExternalReferenceCommand','245390Nsdjjl','UniverInstanceType','buildFormulaReference','@univerjs/core','14duVYSs','UniverCoreFacade','FormulaReferenceType','removeExternalReference','amd','defineProperty','Failed\x20to\x20bind\x20external\x20formula\x20reference\x20\x22','4486568NwJLrW','UniverEngineFormulaFacade','Formula\x20reference\x20authoring\x20requires\x20stable\x20Host\x20and\x20Source\x20Unit\x20IDs.','@univerjs/engine-formula/facade','FEnum','UpsertHostExternalReferenceCommand','7286yxPVto','UNIVER_SHEET','2072964UmzJIc','extend','_commandService','9vQplkW','upsertExternalReference','formulaQualifier','unitId','@univerjs/core/facade','toStringTag','function','syncExecuteCommand','603eQIFiy','SHEET_RANGE','UniverCore','UniverProEngineFormulaFacade','Module','365770zWHUzM','506334PNhXYC'];_0x464a=function(){return _0x28f7cb;};return _0x464a();}