@univerjs/sheets-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.
- package/lib/cjs/facade.js +4 -9
- package/lib/cjs/index.js +328 -450
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/cjs/worker-Ds9TzMsD.js +248 -0
- package/lib/cjs/worker.js +9 -0
- package/lib/es/facade.js +4 -8
- package/lib/es/index.js +243 -365
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/es/worker-m5XIUFq5.js +177 -0
- package/lib/es/worker.js +3 -0
- package/lib/facade.js +4 -8
- package/lib/index.js +243 -365
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/controllers/update-formula.controller.d.ts +4 -0
- package/lib/types/index.d.ts +4 -1
- package/lib/types/plugin.d.ts +1 -12
- package/lib/types/services/remote/remote-register-function.service.d.ts +1 -1
- package/lib/types/worker.d.ts +28 -0
- package/lib/umd/index.js +1 -1
- package/lib/worker-m5XIUFq5.js +177 -0
- package/lib/worker.js +3 -0
- package/package.json +17 -12
package/lib/cjs/locale/ar-SA.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ar-SA.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "جارٍ تحليل الصيغ...",
|
|
4
4
|
calculating: "جارٍ حساب الصيغ...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "تم"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/ca-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ca-ES.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analitzant fórmules...",
|
|
4
4
|
calculating: "Calculant fórmules...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Fet"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/de-DE.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/de-DE.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Formeln werden analysiert...",
|
|
4
4
|
calculating: "Formeln werden berechnet...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Fertig"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/en-US.js
CHANGED
package/lib/cjs/locale/es-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/es-ES.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analizando fórmulas...",
|
|
4
4
|
calculating: "Calculando fórmulas...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Listo"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/fa-IR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fa-IR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "در حال تحلیل فرمولها...",
|
|
4
4
|
calculating: "در حال محاسبه فرمولها...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "انجام شد"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fr-FR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analyse des formules...",
|
|
4
4
|
calculating: "Calcul des formules...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Terminé"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/id-ID.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/id-ID.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Menganalisis rumus...",
|
|
4
4
|
calculating: "Menghitung rumus...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Selesai"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/it-IT.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/it-IT.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analisi delle formule...",
|
|
4
4
|
calculating: "Calcolo delle formule...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Completato"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/ja-JP.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ja-JP.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "数式を分析中...",
|
|
4
4
|
calculating: "数式を計算中...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完了"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/ko-KR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ko-KR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "수식 분석 중...",
|
|
4
4
|
calculating: "수식 계산 중...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "완료"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/pl-PL.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pl-PL.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analizowanie formuł...",
|
|
4
4
|
calculating: "Obliczanie formuł...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Gotowe"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/pt-BR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pt-BR.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analisando fórmulas...",
|
|
4
4
|
calculating: "Calculando fórmulas...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Concluído"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ru-RU.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Анализ формул...",
|
|
4
4
|
calculating: "Вычисление формул...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Готово"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/sk-SK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/sk-SK.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Analyzujú sa vzorce...",
|
|
4
4
|
calculating: "Počítajú sa vzorce...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Hotovo"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/vi-VN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/vi-VN.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "Đang phân tích công thức...",
|
|
4
4
|
calculating: "Đang tính toán công thức...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "Hoàn tất"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/zh-CN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-CN.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "正在分析公式...",
|
|
4
4
|
calculating: "正在计算公式...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完成"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/zh-HK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-HK.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "正在分析公式...",
|
|
4
4
|
calculating: "正在計算公式...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完成"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-TW.ts
|
|
2
2
|
const locale = { "sheets-formula": { progress: {
|
|
3
3
|
analyzing: "正在分析公式...",
|
|
4
4
|
calculating: "正在計算公式...",
|
|
@@ -7,5 +7,4 @@ const locale = { "sheets-formula": { progress: {
|
|
|
7
7
|
done: "完成"
|
|
8
8
|
} } };
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
module.exports = locale;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
let _univerjs_core = require("@univerjs/core");
|
|
2
|
+
let _univerjs_engine_formula = require("@univerjs/engine-formula");
|
|
3
|
+
let _univerjs_rpc = require("@univerjs/rpc");
|
|
4
|
+
let _univerjs_engine_formula_worker = require("@univerjs/engine-formula/worker");
|
|
5
|
+
|
|
6
|
+
// src/config/config.ts
|
|
7
|
+
/**
|
|
8
|
+
* Base configuration for the plugin.
|
|
9
|
+
*/
|
|
10
|
+
const PLUGIN_CONFIG_KEY_BASE = "sheets-formula.base.config";
|
|
11
|
+
const configSymbolBase = Symbol(PLUGIN_CONFIG_KEY_BASE);
|
|
12
|
+
let CalculationMode = /* @__PURE__ */ function(CalculationMode) {
|
|
13
|
+
/**
|
|
14
|
+
* Force calculation of all formulas
|
|
15
|
+
*/
|
|
16
|
+
CalculationMode[CalculationMode["FORCED"] = 0] = "FORCED";
|
|
17
|
+
/**
|
|
18
|
+
* Partial calculation, only cells with formulas but no v values are calculated
|
|
19
|
+
*/
|
|
20
|
+
CalculationMode[CalculationMode["WHEN_EMPTY"] = 1] = "WHEN_EMPTY";
|
|
21
|
+
/**
|
|
22
|
+
* All formulas are not calculated
|
|
23
|
+
*/
|
|
24
|
+
CalculationMode[CalculationMode["NO_CALCULATION"] = 2] = "NO_CALCULATION";
|
|
25
|
+
return CalculationMode;
|
|
26
|
+
}({});
|
|
27
|
+
const defaultPluginBaseConfig = {};
|
|
28
|
+
/**
|
|
29
|
+
* Remote configuration for the plugin.
|
|
30
|
+
*/
|
|
31
|
+
const PLUGIN_CONFIG_KEY_REMOTE = "sheets-formula.remote.config";
|
|
32
|
+
const configSymbolRemote = Symbol(PLUGIN_CONFIG_KEY_REMOTE);
|
|
33
|
+
const defaultPluginRemoteConfig = {};
|
|
34
|
+
/**
|
|
35
|
+
* Mobile configuration for the plugin.
|
|
36
|
+
*/
|
|
37
|
+
const PLUGIN_CONFIG_KEY_MOBILE = "sheets-formula.mobile.config";
|
|
38
|
+
const configSymbolMobile = Symbol(PLUGIN_CONFIG_KEY_MOBILE);
|
|
39
|
+
|
|
40
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
41
|
+
function __decorateParam(paramIndex, decorator) {
|
|
42
|
+
return function(target, key) {
|
|
43
|
+
decorator(target, key, paramIndex);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
48
|
+
function __decorate(decorators, target, key, desc) {
|
|
49
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
50
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
51
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
52
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
56
|
+
function _typeof(o) {
|
|
57
|
+
"@babel/helpers - typeof";
|
|
58
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
59
|
+
return typeof o;
|
|
60
|
+
} : function(o) {
|
|
61
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
62
|
+
}, _typeof(o);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
66
|
+
function toPrimitive(t, r) {
|
|
67
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
68
|
+
var e = t[Symbol.toPrimitive];
|
|
69
|
+
if (void 0 !== e) {
|
|
70
|
+
var i = e.call(t, r || "default");
|
|
71
|
+
if ("object" != _typeof(i)) return i;
|
|
72
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
73
|
+
}
|
|
74
|
+
return ("string" === r ? String : Number)(t);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
78
|
+
function toPropertyKey(t) {
|
|
79
|
+
var i = toPrimitive(t, "string");
|
|
80
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
84
|
+
function _defineProperty(e, r, t) {
|
|
85
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
86
|
+
value: t,
|
|
87
|
+
enumerable: !0,
|
|
88
|
+
configurable: !0,
|
|
89
|
+
writable: !0
|
|
90
|
+
}) : e[r] = t, e;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// package.json
|
|
94
|
+
var name = "@univerjs/sheets-formula";
|
|
95
|
+
var version = "1.4.0";
|
|
96
|
+
|
|
97
|
+
// src/services/remote/remote-register-function.service.ts
|
|
98
|
+
/**
|
|
99
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
100
|
+
*
|
|
101
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
102
|
+
* you may not use this file except in compliance with the License.
|
|
103
|
+
* You may obtain a copy of the License at
|
|
104
|
+
*
|
|
105
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
106
|
+
*
|
|
107
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
108
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
109
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
110
|
+
* See the License for the specific language governing permissions and
|
|
111
|
+
* limitations under the License.
|
|
112
|
+
*/
|
|
113
|
+
const RemoteRegisterFunctionServiceName = "sheets-formula.remote-register-function.service";
|
|
114
|
+
const IRemoteRegisterFunctionService = (0, _univerjs_core.createIdentifier)(RemoteRegisterFunctionServiceName);
|
|
115
|
+
let RemoteRegisterFunctionService = class RemoteRegisterFunctionService {
|
|
116
|
+
constructor(_functionService) {
|
|
117
|
+
this._functionService = _functionService;
|
|
118
|
+
}
|
|
119
|
+
async registerFunctions(serializedFuncs) {
|
|
120
|
+
rejectRemoteCustomFunctionRegistration(serializedFuncs);
|
|
121
|
+
}
|
|
122
|
+
async registerAsyncFunctions(serializedFuncs) {
|
|
123
|
+
rejectRemoteCustomFunctionRegistration(serializedFuncs);
|
|
124
|
+
}
|
|
125
|
+
async unregisterFunctions(names) {
|
|
126
|
+
this._functionService.unregisterExecutors(...names);
|
|
127
|
+
this._functionService.unregisterDescriptions(...names);
|
|
128
|
+
this._functionService.deleteFormulaAstCacheKey(...names);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
RemoteRegisterFunctionService = __decorate([__decorateParam(0, _univerjs_engine_formula.IFunctionService)], RemoteRegisterFunctionService);
|
|
132
|
+
function rejectRemoteCustomFunctionRegistration(serializedFuncs) {
|
|
133
|
+
if (serializedFuncs.length === 0) return;
|
|
134
|
+
throw new Error("Remote custom function registration is disabled because function deserialization over RPC is unsafe.");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// src/worker.ts
|
|
138
|
+
/**
|
|
139
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
140
|
+
*
|
|
141
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
142
|
+
* you may not use this file except in compliance with the License.
|
|
143
|
+
* You may obtain a copy of the License at
|
|
144
|
+
*
|
|
145
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
146
|
+
*
|
|
147
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
148
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
149
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
150
|
+
* See the License for the specific language governing permissions and
|
|
151
|
+
* limitations under the License.
|
|
152
|
+
*/
|
|
153
|
+
let UniverRemoteSheetsFormulaPlugin = class UniverRemoteSheetsFormulaPlugin extends _univerjs_core.Plugin {
|
|
154
|
+
constructor(_config = defaultPluginRemoteConfig, _injector, _configService) {
|
|
155
|
+
super();
|
|
156
|
+
this._config = _config;
|
|
157
|
+
this._injector = _injector;
|
|
158
|
+
this._configService = _configService;
|
|
159
|
+
const { ...rest } = (0, _univerjs_core.merge)({}, defaultPluginRemoteConfig, this._config);
|
|
160
|
+
this._configService.setConfig(PLUGIN_CONFIG_KEY_REMOTE, rest);
|
|
161
|
+
}
|
|
162
|
+
onStarting() {
|
|
163
|
+
this._injector.add([RemoteRegisterFunctionService]);
|
|
164
|
+
this._injector.get(_univerjs_rpc.IRPCChannelService).registerChannel(RemoteRegisterFunctionServiceName, (0, _univerjs_rpc.fromModule)(this._injector.get(RemoteRegisterFunctionService)));
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
_defineProperty(UniverRemoteSheetsFormulaPlugin, "pluginName", "SHEET_FORMULA_REMOTE_PLUGIN");
|
|
168
|
+
_defineProperty(UniverRemoteSheetsFormulaPlugin, "packageName", name);
|
|
169
|
+
_defineProperty(UniverRemoteSheetsFormulaPlugin, "version", version);
|
|
170
|
+
_defineProperty(UniverRemoteSheetsFormulaPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
171
|
+
UniverRemoteSheetsFormulaPlugin = __decorate([
|
|
172
|
+
(0, _univerjs_core.DependentOn)(_univerjs_engine_formula_worker.UniverFormulaEnginePlugin),
|
|
173
|
+
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
174
|
+
__decorateParam(2, _univerjs_core.IConfigService)
|
|
175
|
+
], UniverRemoteSheetsFormulaPlugin);
|
|
176
|
+
|
|
177
|
+
Object.defineProperty(exports, "CalculationMode", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function () {
|
|
180
|
+
return CalculationMode;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "IRemoteRegisterFunctionService", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function () {
|
|
186
|
+
return IRemoteRegisterFunctionService;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "PLUGIN_CONFIG_KEY_BASE", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function () {
|
|
192
|
+
return PLUGIN_CONFIG_KEY_BASE;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "RemoteRegisterFunctionService", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function () {
|
|
198
|
+
return RemoteRegisterFunctionService;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "RemoteRegisterFunctionServiceName", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function () {
|
|
204
|
+
return RemoteRegisterFunctionServiceName;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "UniverRemoteSheetsFormulaPlugin", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function () {
|
|
210
|
+
return UniverRemoteSheetsFormulaPlugin;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "__decorate", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function () {
|
|
216
|
+
return __decorate;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
Object.defineProperty(exports, "__decorateParam", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function () {
|
|
222
|
+
return __decorateParam;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "_defineProperty", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function () {
|
|
228
|
+
return _defineProperty;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
Object.defineProperty(exports, "defaultPluginBaseConfig", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function () {
|
|
234
|
+
return defaultPluginBaseConfig;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "name", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () {
|
|
240
|
+
return name;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
Object.defineProperty(exports, "version", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function () {
|
|
246
|
+
return version;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_worker = require("./worker-Ds9TzMsD.js");
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "UniverRemoteSheetsFormulaPlugin", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function () {
|
|
7
|
+
return require_worker.UniverRemoteSheetsFormulaPlugin;
|
|
8
|
+
}
|
|
9
|
+
});
|
package/lib/es/facade.js
CHANGED
|
@@ -5,7 +5,7 @@ import { CalculationMode, PLUGIN_CONFIG_KEY_BASE } from "@univerjs/sheets-formul
|
|
|
5
5
|
import { FEnum } from "@univerjs/core/facade";
|
|
6
6
|
import { FRange, FWorkbook } from "@univerjs/sheets/facade";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/facade/f-formula.ts
|
|
9
9
|
var FFormulaSheetsMixin = class extends FFormula {
|
|
10
10
|
/**
|
|
11
11
|
* Initialize the FUniver instance.
|
|
@@ -58,8 +58,7 @@ var FFormulaSheetsMixin = class extends FFormula {
|
|
|
58
58
|
};
|
|
59
59
|
FFormula.extend(FFormulaSheetsMixin);
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
//#region src/facade/f-enum.ts
|
|
61
|
+
// src/facade/f-enum.ts
|
|
63
62
|
/**
|
|
64
63
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
65
64
|
*
|
|
@@ -82,8 +81,7 @@ var FSheetsFormulaEnumMixin = class extends FEnum {
|
|
|
82
81
|
};
|
|
83
82
|
FEnum.extend(FSheetsFormulaEnumMixin);
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
//#region src/facade/f-workbook.ts
|
|
84
|
+
// src/facade/f-workbook.ts
|
|
87
85
|
var FWorkbookEngineFormulaMixin = class extends FWorkbook {
|
|
88
86
|
getAllFormulaError() {
|
|
89
87
|
const errors = [];
|
|
@@ -119,8 +117,7 @@ var FWorkbookEngineFormulaMixin = class extends FWorkbook {
|
|
|
119
117
|
};
|
|
120
118
|
FWorkbook.extend(FWorkbookEngineFormulaMixin);
|
|
121
119
|
|
|
122
|
-
|
|
123
|
-
//#region src/facade/f-range.ts
|
|
120
|
+
// src/facade/f-range.ts
|
|
124
121
|
/**
|
|
125
122
|
* @ignore
|
|
126
123
|
*/
|
|
@@ -156,5 +153,4 @@ var FRangeEngineFormulaMixin = class extends FRange {
|
|
|
156
153
|
};
|
|
157
154
|
FRange.extend(FRangeEngineFormulaMixin);
|
|
158
155
|
|
|
159
|
-
//#endregion
|
|
160
156
|
export { };
|