@flowgram.ai/document 0.2.23 → 0.2.24
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/dist/esm/index.js +26 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +20 -3
- package/dist/index.d.ts +20 -3
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/esm/index.js
CHANGED
|
@@ -29,6 +29,8 @@ var FlowNodeBaseType = /* @__PURE__ */ ((FlowNodeBaseType2) => {
|
|
|
29
29
|
FlowNodeBaseType2["MULTI_OUTPUTS"] = "multiOutputs";
|
|
30
30
|
FlowNodeBaseType2["INPUT"] = "input";
|
|
31
31
|
FlowNodeBaseType2["OUTPUT"] = "output";
|
|
32
|
+
FlowNodeBaseType2["SLOT"] = "slot";
|
|
33
|
+
FlowNodeBaseType2["SLOT_BLOCK"] = "slotBlock";
|
|
32
34
|
return FlowNodeBaseType2;
|
|
33
35
|
})(FlowNodeBaseType || {});
|
|
34
36
|
var FlowNodeSplitType = /* @__PURE__ */ ((FlowNodeSplitType2) => {
|
|
@@ -1063,6 +1065,19 @@ var FlowNodeEntity = class extends Entity {
|
|
|
1063
1065
|
get bounds() {
|
|
1064
1066
|
return this.transform.bounds;
|
|
1065
1067
|
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Check node extend type
|
|
1070
|
+
*/
|
|
1071
|
+
isExtend(parentType) {
|
|
1072
|
+
return this.document.isExtend(this.flowNodeType, parentType);
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Check node type
|
|
1076
|
+
* @param parentType
|
|
1077
|
+
*/
|
|
1078
|
+
isTypeOrExtendType(parentType) {
|
|
1079
|
+
return this.document.isTypeOrExtendType(this.flowNodeType, parentType);
|
|
1080
|
+
}
|
|
1066
1081
|
};
|
|
1067
1082
|
FlowNodeEntity.type = "FlowNodeEntity";
|
|
1068
1083
|
((FlowNodeEntity2) => {
|
|
@@ -1947,10 +1962,18 @@ var FlowDocument = class {
|
|
|
1947
1962
|
/**
|
|
1948
1963
|
* Check node extend
|
|
1949
1964
|
* @param currentType
|
|
1950
|
-
* @param
|
|
1965
|
+
* @param extendType
|
|
1966
|
+
*/
|
|
1967
|
+
isExtend(currentType, extendType) {
|
|
1968
|
+
return (this.getNodeRegistry(currentType).__extends__ || []).includes(extendType);
|
|
1969
|
+
}
|
|
1970
|
+
/**
|
|
1971
|
+
* Check node type
|
|
1972
|
+
* @param currentType
|
|
1973
|
+
* @param extendType
|
|
1951
1974
|
*/
|
|
1952
|
-
|
|
1953
|
-
return
|
|
1975
|
+
isTypeOrExtendType(currentType, extendType) {
|
|
1976
|
+
return currentType === extendType || this.isExtend(currentType, extendType);
|
|
1954
1977
|
}
|
|
1955
1978
|
/**
|
|
1956
1979
|
* 导出数据,可以重载
|