@babylonjs/smart-filters 1.0.13 → 8.19.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/dist/blockFoundation/aggregateBlock.d.ts +3 -3
- package/dist/blockFoundation/aggregateBlock.d.ts.map +1 -1
- package/dist/blockFoundation/aggregateBlock.js +1 -2
- package/dist/blockFoundation/aggregateBlock.js.map +1 -1
- package/dist/blockFoundation/baseBlock.d.ts +2 -2
- package/dist/blockFoundation/baseBlock.d.ts.map +1 -1
- package/dist/blockFoundation/baseBlock.js +5 -6
- package/dist/blockFoundation/baseBlock.js.map +1 -1
- package/dist/blockFoundation/customAggregateBlock.d.ts.map +1 -1
- package/dist/blockFoundation/customAggregateBlock.js +2 -2
- package/dist/blockFoundation/customAggregateBlock.js.map +1 -1
- package/dist/blockFoundation/customShaderBlock.d.ts +9 -0
- package/dist/blockFoundation/customShaderBlock.d.ts.map +1 -1
- package/dist/blockFoundation/customShaderBlock.js +47 -7
- package/dist/blockFoundation/customShaderBlock.js.map +1 -1
- package/dist/blockFoundation/disableableShaderBlock.d.ts.map +1 -1
- package/dist/blockFoundation/disableableShaderBlock.js +4 -4
- package/dist/blockFoundation/disableableShaderBlock.js.map +1 -1
- package/dist/blockFoundation/index.js +0 -2
- package/dist/blockFoundation/index.js.map +1 -1
- package/dist/blockFoundation/inputBlock.d.ts +8 -8
- package/dist/blockFoundation/inputBlock.d.ts.map +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.d.ts +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.d.ts.map +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.js +1 -1
- package/dist/blockFoundation/inputBlock.deserializer.js.map +1 -1
- package/dist/blockFoundation/inputBlock.js +7 -7
- package/dist/blockFoundation/inputBlock.js.map +1 -1
- package/dist/blockFoundation/inputBlock.serialization.types.d.ts.map +1 -1
- package/dist/blockFoundation/inputBlock.serializer.d.ts +1 -1
- package/dist/blockFoundation/inputBlock.serializer.js +26 -28
- package/dist/blockFoundation/inputBlock.serializer.js.map +1 -1
- package/dist/blockFoundation/outputBlock.d.ts +4 -9
- package/dist/blockFoundation/outputBlock.d.ts.map +1 -1
- package/dist/blockFoundation/outputBlock.js +13 -14
- package/dist/blockFoundation/outputBlock.js.map +1 -1
- package/dist/blockFoundation/shaderBlock.d.ts +4 -4
- package/dist/blockFoundation/shaderBlock.d.ts.map +1 -1
- package/dist/blockFoundation/shaderBlock.js +13 -19
- package/dist/blockFoundation/shaderBlock.js.map +1 -1
- package/dist/blockFoundation/textureOptions.d.ts +1 -1
- package/dist/blockFoundation/textureOptions.js +1 -1
- package/dist/command/command.d.ts +1 -1
- package/dist/command/command.js +1 -1
- package/dist/command/commandBuffer.d.ts +1 -1
- package/dist/command/commandBuffer.d.ts.map +1 -1
- package/dist/command/commandBuffer.js +2 -2
- package/dist/command/commandBufferDebugger.d.ts +2 -2
- package/dist/command/commandBufferDebugger.d.ts.map +1 -1
- package/dist/command/commandBufferDebugger.js +1 -1
- package/dist/command/commandBufferDebugger.js.map +1 -1
- package/dist/command/index.d.ts +3 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +5 -1
- package/dist/command/index.js.map +1 -1
- package/dist/connection/connectionPoint.d.ts +3 -3
- package/dist/connection/connectionPoint.d.ts.map +1 -1
- package/dist/connection/connectionPoint.js +2 -2
- package/dist/connection/connectionPoint.js.map +1 -1
- package/dist/connection/connectionPointCompatibilityState.d.ts +1 -1
- package/dist/connection/connectionPointCompatibilityState.js +1 -1
- package/dist/connection/connectionPointType.d.ts +3 -3
- package/dist/connection/connectionPointType.d.ts.map +1 -1
- package/dist/connection/connectionPointWithDefault.d.ts +3 -3
- package/dist/connection/connectionPointWithDefault.d.ts.map +1 -1
- package/dist/connection/connectionPointWithDefault.js.map +1 -1
- package/dist/connection/index.d.ts +2 -1
- package/dist/connection/index.d.ts.map +1 -1
- package/dist/connection/index.js +3 -3
- package/dist/connection/index.js.map +1 -1
- package/dist/editorUtils/editableInPropertyPage.d.ts +2 -2
- package/dist/editorUtils/editableInPropertyPage.d.ts.map +1 -1
- package/dist/editorUtils/editableInPropertyPage.js +2 -2
- package/dist/editorUtils/editableInPropertyPage.js.map +1 -1
- package/dist/editorUtils/index.d.ts +1 -0
- package/dist/editorUtils/index.d.ts.map +1 -1
- package/dist/editorUtils/index.js +2 -0
- package/dist/editorUtils/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/optimization/dependencyGraph.js.map +1 -1
- package/dist/optimization/optimizedShaderBlock.d.ts +4 -4
- package/dist/optimization/optimizedShaderBlock.d.ts.map +1 -1
- package/dist/optimization/optimizedShaderBlock.js.map +1 -1
- package/dist/optimization/smartFilterOptimizer.d.ts +2 -2
- package/dist/optimization/smartFilterOptimizer.d.ts.map +1 -1
- package/dist/optimization/smartFilterOptimizer.js +34 -57
- package/dist/optimization/smartFilterOptimizer.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/renderTargetGenerator.d.ts +1 -1
- package/dist/runtime/renderTargetGenerator.d.ts.map +1 -1
- package/dist/runtime/renderTargetGenerator.js +5 -7
- package/dist/runtime/renderTargetGenerator.js.map +1 -1
- package/dist/runtime/shaderRuntime.d.ts +7 -7
- package/dist/runtime/shaderRuntime.d.ts.map +1 -1
- package/dist/runtime/shaderRuntime.js +7 -8
- package/dist/runtime/shaderRuntime.js.map +1 -1
- package/dist/runtime/smartFilterRuntime.d.ts +3 -3
- package/dist/runtime/smartFilterRuntime.d.ts.map +1 -1
- package/dist/runtime/smartFilterRuntime.js.map +1 -1
- package/dist/runtime/strongRef.d.ts +1 -1
- package/dist/runtime/strongRef.js +1 -1
- package/dist/serialization/importCustomBlockDefinition.d.ts +1 -1
- package/dist/serialization/importCustomBlockDefinition.js +8 -9
- package/dist/serialization/importCustomBlockDefinition.js.map +1 -1
- package/dist/serialization/index.d.ts +1 -0
- package/dist/serialization/index.d.ts.map +1 -1
- package/dist/serialization/index.js +3 -0
- package/dist/serialization/index.js.map +1 -1
- package/dist/serialization/serializedBlockDefinition.d.ts +2 -2
- package/dist/serialization/serializedBlockDefinition.d.ts.map +1 -1
- package/dist/serialization/serializedShaderBlockDefinition.d.ts +1 -1
- package/dist/serialization/serializedShaderBlockDefinition.d.ts.map +1 -1
- package/dist/serialization/serializedSmartFilter.d.ts +1 -1
- package/dist/serialization/serializedSmartFilter.d.ts.map +1 -1
- package/dist/serialization/smartFilterDeserializer.d.ts +6 -6
- package/dist/serialization/smartFilterDeserializer.d.ts.map +1 -1
- package/dist/serialization/smartFilterDeserializer.js +9 -12
- package/dist/serialization/smartFilterDeserializer.js.map +1 -1
- package/dist/serialization/smartFilterSerializer.d.ts +2 -2
- package/dist/serialization/smartFilterSerializer.d.ts.map +1 -1
- package/dist/serialization/smartFilterSerializer.js +10 -13
- package/dist/serialization/smartFilterSerializer.js.map +1 -1
- package/dist/serialization/v1/defaultBlockSerializer.d.ts +2 -2
- package/dist/serialization/v1/defaultBlockSerializer.d.ts.map +1 -1
- package/dist/serialization/v1/defaultBlockSerializer.js +1 -1
- package/dist/serialization/v1/index.d.ts +1 -0
- package/dist/serialization/v1/index.d.ts.map +1 -1
- package/dist/serialization/v1/index.js +2 -0
- package/dist/serialization/v1/index.js.map +1 -1
- package/dist/serialization/v1/shaderBlockSerialization.types.d.ts +3 -3
- package/dist/serialization/v1/shaderBlockSerialization.types.d.ts.map +1 -1
- package/dist/serialization/v1/smartFilterSerialization.types.d.ts +2 -2
- package/dist/serialization/v1/smartFilterSerialization.types.d.ts.map +1 -1
- package/dist/smartFilter.d.ts +8 -8
- package/dist/smartFilter.d.ts.map +1 -1
- package/dist/smartFilter.js +6 -7
- package/dist/smartFilter.js.map +1 -1
- package/dist/utils/buildTools/buildShaders.d.ts +3 -2
- package/dist/utils/buildTools/buildShaders.d.ts.map +1 -1
- package/dist/utils/buildTools/buildShaders.js +7 -6
- package/dist/utils/buildTools/buildShaders.js.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts +4 -2
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoBlock.js +136 -141
- package/dist/utils/buildTools/convertGlslIntoBlock.js.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts +4 -4
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.js +55 -48
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.js.map +1 -1
- package/dist/utils/buildTools/convertShaders.d.ts +8 -5
- package/dist/utils/buildTools/convertShaders.d.ts.map +1 -1
- package/dist/utils/buildTools/convertShaders.js +38 -14
- package/dist/utils/buildTools/convertShaders.js.map +1 -1
- package/dist/utils/buildTools/shaderConverter.d.ts +4 -4
- package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
- package/dist/utils/buildTools/shaderConverter.js +17 -21
- package/dist/utils/buildTools/shaderConverter.js.map +1 -1
- package/dist/utils/buildTools/watchShaders.d.ts +3 -2
- package/dist/utils/buildTools/watchShaders.d.ts.map +1 -1
- package/dist/utils/buildTools/watchShaders.js +10 -8
- package/dist/utils/buildTools/watchShaders.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/renderTargetUtils.d.ts +3 -3
- package/dist/utils/renderTargetUtils.d.ts.map +1 -1
- package/dist/utils/renderTargetUtils.js +4 -4
- package/dist/utils/renderTargetUtils.js.map +1 -1
- package/dist/utils/shaderCodeUtils.d.ts +8 -8
- package/dist/utils/shaderCodeUtils.d.ts.map +1 -1
- package/dist/utils/shaderCodeUtils.js +16 -28
- package/dist/utils/shaderCodeUtils.js.map +1 -1
- package/dist/utils/textureLoaders.d.ts +2 -2
- package/dist/utils/textureLoaders.d.ts.map +1 -1
- package/dist/utils/textureLoaders.js +2 -3
- package/dist/utils/textureLoaders.js.map +1 -1
- package/dist/utils/textureUtils.d.ts +5 -5
- package/dist/utils/textureUtils.d.ts.map +1 -1
- package/dist/utils/textureUtils.js +1 -1
- package/dist/utils/textureUtils.js.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/license.md +21 -21
- package/package.json +13 -8
- package/src/blockFoundation/aggregateBlock.ts +148 -151
- package/src/blockFoundation/baseBlock.ts +339 -364
- package/src/blockFoundation/customAggregateBlock.ts +88 -104
- package/src/blockFoundation/customShaderBlock.ts +362 -326
- package/src/blockFoundation/disableableShaderBlock.ts +91 -100
- package/src/blockFoundation/index.ts +9 -9
- package/src/blockFoundation/inputBlock.deserializer.ts +72 -97
- package/src/blockFoundation/inputBlock.serialization.types.ts +126 -132
- package/src/blockFoundation/inputBlock.serializer.ts +150 -150
- package/src/blockFoundation/inputBlock.ts +181 -192
- package/src/blockFoundation/outputBlock.ts +144 -151
- package/src/blockFoundation/shaderBlock.ts +156 -163
- package/src/blockFoundation/textureOptions.ts +57 -57
- package/src/command/command.ts +59 -59
- package/src/command/commandBuffer.ts +71 -71
- package/src/command/commandBufferDebugger.ts +14 -14
- package/src/command/index.ts +7 -3
- package/src/connection/connectionPoint.ts +205 -214
- package/src/connection/connectionPointCompatibilityState.ts +31 -31
- package/src/connection/connectionPointType.ts +45 -45
- package/src/connection/connectionPointWithDefault.ts +27 -35
- package/src/connection/index.ts +8 -9
- package/src/editorUtils/editableInPropertyPage.ts +106 -106
- package/src/editorUtils/index.ts +3 -1
- package/src/index.ts +16 -15
- package/src/optimization/dependencyGraph.ts +96 -96
- package/src/optimization/index.ts +1 -1
- package/src/optimization/optimizedShaderBlock.ts +131 -134
- package/src/optimization/smartFilterOptimizer.ts +757 -825
- package/src/runtime/index.ts +8 -6
- package/src/runtime/renderTargetGenerator.ts +222 -248
- package/src/runtime/shaderRuntime.ts +174 -173
- package/src/runtime/smartFilterRuntime.ts +112 -112
- package/src/runtime/strongRef.ts +18 -18
- package/src/serialization/importCustomBlockDefinition.ts +86 -86
- package/src/serialization/index.ts +10 -7
- package/src/serialization/serializedBlockDefinition.ts +12 -12
- package/src/serialization/serializedShaderBlockDefinition.ts +7 -7
- package/src/serialization/serializedSmartFilter.ts +6 -6
- package/src/serialization/smartFilterDeserializer.ts +190 -220
- package/src/serialization/smartFilterSerializer.ts +110 -121
- package/src/serialization/v1/defaultBlockSerializer.ts +21 -21
- package/src/serialization/v1/index.ts +4 -2
- package/src/serialization/v1/shaderBlockSerialization.types.ts +85 -85
- package/src/serialization/v1/smartFilterSerialization.types.ts +129 -133
- package/src/smartFilter.ts +255 -260
- package/src/utils/buildTools/buildShaders.ts +14 -13
- package/src/utils/buildTools/convertGlslIntoBlock.ts +370 -385
- package/src/utils/buildTools/convertGlslIntoShaderProgram.ts +173 -172
- package/src/utils/buildTools/convertShaders.ts +65 -43
- package/src/utils/buildTools/recordVersionNumber.js +24 -0
- package/src/utils/buildTools/shaderConverter.ts +466 -478
- package/src/utils/buildTools/watchShaders.ts +44 -42
- package/src/utils/index.ts +4 -2
- package/src/utils/renderTargetUtils.ts +30 -35
- package/src/utils/shaderCodeUtils.ts +192 -207
- package/src/utils/textureLoaders.ts +31 -43
- package/src/utils/textureUtils.ts +28 -32
- package/src/version.ts +2 -2
- package/dist/utils/buildTools/determineVersion.d.ts +0 -36
- package/dist/utils/buildTools/determineVersion.d.ts.map +0 -1
- package/dist/utils/buildTools/determineVersion.js +0 -109
- package/dist/utils/buildTools/determineVersion.js.map +0 -1
- package/dist/utils/buildTools/versionUp.d.ts +0 -2
- package/dist/utils/buildTools/versionUp.d.ts.map +0 -1
- package/dist/utils/buildTools/versionUp.js +0 -53
- package/dist/utils/buildTools/versionUp.js.map +0 -1
- package/src/utils/buildTools/determineVersion.ts +0 -128
- package/src/utils/buildTools/versionUp.ts +0 -61
package/src/connection/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export { ConnectionPointDirection } from "./connectionPointDirection.js";
|
|
2
|
-
export { ConnectionPointType } from "./connectionPointType.js";
|
|
3
|
-
export { type ConnectionPointValue } from "./connectionPointType.js";
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./
|
|
8
|
-
export {
|
|
9
|
-
export { type RuntimeData } from "./connectionPoint.js";
|
|
1
|
+
export { ConnectionPointDirection } from "./connectionPointDirection.js";
|
|
2
|
+
export { ConnectionPointType } from "./connectionPointType.js";
|
|
3
|
+
export { type ConnectionPointValue } from "./connectionPointType.js";
|
|
4
|
+
export { ConnectionPointCompatibilityState, GetCompatibilityIssueMessage } from "./connectionPointCompatibilityState.js";
|
|
5
|
+
// Back compat for when camelCase was used
|
|
6
|
+
export { GetCompatibilityIssueMessage as getCompatibilityIssueMessage } from "./connectionPointCompatibilityState.js";
|
|
7
|
+
export { ConnectionPoint } from "./connectionPoint.js";
|
|
8
|
+
export { type RuntimeData } from "./connectionPoint.js";
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import type { Observable } from "
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Enum defining the type of properties that can be edited in the property pages in the node editor
|
|
5
|
-
*/
|
|
6
|
-
export enum PropertyTypeForEdition {
|
|
7
|
-
/** property is a boolean */
|
|
8
|
-
Boolean,
|
|
9
|
-
/** property is a float */
|
|
10
|
-
Float,
|
|
11
|
-
/** property is a int */
|
|
12
|
-
Int,
|
|
13
|
-
/** property is a Vector2 */
|
|
14
|
-
Vector2,
|
|
15
|
-
/** property is a list of values */
|
|
16
|
-
List,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Interface that defines an option in a variable of type list
|
|
21
|
-
*/
|
|
22
|
-
export interface IEditablePropertyListOption {
|
|
23
|
-
/** label of the option */
|
|
24
|
-
label: string;
|
|
25
|
-
/** value of the option */
|
|
26
|
-
value: number | string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Interface that defines the options available for an editable property
|
|
31
|
-
*/
|
|
32
|
-
export interface IEditablePropertyOption {
|
|
33
|
-
/** min value */
|
|
34
|
-
min?: number;
|
|
35
|
-
/** max value */
|
|
36
|
-
max?: number;
|
|
37
|
-
/** notifiers: indicates which actions to take when the property is changed */
|
|
38
|
-
notifiers?: {
|
|
39
|
-
/** the entity should be rebuilt */
|
|
40
|
-
rebuild?: boolean;
|
|
41
|
-
/** the preview should be updated */
|
|
42
|
-
update?: boolean;
|
|
43
|
-
/** the onPreviewCommandActivated observer of the preview manager should be triggered */
|
|
44
|
-
activatePreviewCommand?: boolean;
|
|
45
|
-
/** a callback to trigger */
|
|
46
|
-
callback?: () => boolean | undefined | void;
|
|
47
|
-
/** a callback to validate the property. Returns true if the property is ok, else false. If false, the rebuild/update/callback events won't be called */
|
|
48
|
-
onValidation?: (block: any, propertyName: string) => boolean;
|
|
49
|
-
};
|
|
50
|
-
/** a list of the options for a property of type list */
|
|
51
|
-
options?: IEditablePropertyListOption[] | Observable<IEditablePropertyListOption[]>;
|
|
52
|
-
/** whether the options' values should be treated as strings */
|
|
53
|
-
valuesAreStrings?: boolean;
|
|
54
|
-
/** If supplied, the sub property to read/write */
|
|
55
|
-
subPropertyName?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Interface that describes an editable property
|
|
60
|
-
*/
|
|
61
|
-
export interface IPropertyDescriptionForEdition {
|
|
62
|
-
/** name of the property */
|
|
63
|
-
propertyName: string;
|
|
64
|
-
/** display name of the property */
|
|
65
|
-
displayName: string;
|
|
66
|
-
/** type of the property */
|
|
67
|
-
type: PropertyTypeForEdition;
|
|
68
|
-
/** group of the property - all properties with the same group value will be displayed in a specific section */
|
|
69
|
-
groupName: string;
|
|
70
|
-
/** options for the property */
|
|
71
|
-
options: IEditablePropertyOption;
|
|
72
|
-
/** name of the class that contains the property */
|
|
73
|
-
className: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Decorator that flags a property in a node block as being editable
|
|
78
|
-
* @param displayName - the display name of the property
|
|
79
|
-
* @param propertyType - the type of the property
|
|
80
|
-
* @param groupName - the group name of the property
|
|
81
|
-
* @param options - the options of the property
|
|
82
|
-
* @returns the decorator
|
|
83
|
-
*/
|
|
84
|
-
export function
|
|
85
|
-
displayName: string,
|
|
86
|
-
propertyType: PropertyTypeForEdition = PropertyTypeForEdition.Boolean,
|
|
87
|
-
groupName: string = "PROPERTIES",
|
|
88
|
-
options?: IEditablePropertyOption
|
|
89
|
-
) {
|
|
90
|
-
return (target: any, propertyKey: string) => {
|
|
91
|
-
let propStore: IPropertyDescriptionForEdition[] = target._propStore;
|
|
92
|
-
if (!propStore) {
|
|
93
|
-
propStore = [];
|
|
94
|
-
target._propStore = propStore;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
propStore.push({
|
|
98
|
-
propertyName: propertyKey,
|
|
99
|
-
displayName: displayName,
|
|
100
|
-
type: propertyType,
|
|
101
|
-
groupName: groupName,
|
|
102
|
-
options: options ?? {},
|
|
103
|
-
className: target.constructor.name,
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
}
|
|
1
|
+
import type { Observable } from "core/Misc/observable.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enum defining the type of properties that can be edited in the property pages in the node editor
|
|
5
|
+
*/
|
|
6
|
+
export enum PropertyTypeForEdition {
|
|
7
|
+
/** property is a boolean */
|
|
8
|
+
Boolean,
|
|
9
|
+
/** property is a float */
|
|
10
|
+
Float,
|
|
11
|
+
/** property is a int */
|
|
12
|
+
Int,
|
|
13
|
+
/** property is a Vector2 */
|
|
14
|
+
Vector2,
|
|
15
|
+
/** property is a list of values */
|
|
16
|
+
List,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Interface that defines an option in a variable of type list
|
|
21
|
+
*/
|
|
22
|
+
export interface IEditablePropertyListOption {
|
|
23
|
+
/** label of the option */
|
|
24
|
+
label: string;
|
|
25
|
+
/** value of the option */
|
|
26
|
+
value: number | string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Interface that defines the options available for an editable property
|
|
31
|
+
*/
|
|
32
|
+
export interface IEditablePropertyOption {
|
|
33
|
+
/** min value */
|
|
34
|
+
min?: number;
|
|
35
|
+
/** max value */
|
|
36
|
+
max?: number;
|
|
37
|
+
/** notifiers: indicates which actions to take when the property is changed */
|
|
38
|
+
notifiers?: {
|
|
39
|
+
/** the entity should be rebuilt */
|
|
40
|
+
rebuild?: boolean;
|
|
41
|
+
/** the preview should be updated */
|
|
42
|
+
update?: boolean;
|
|
43
|
+
/** the onPreviewCommandActivated observer of the preview manager should be triggered */
|
|
44
|
+
activatePreviewCommand?: boolean;
|
|
45
|
+
/** a callback to trigger */
|
|
46
|
+
callback?: () => boolean | undefined | void;
|
|
47
|
+
/** a callback to validate the property. Returns true if the property is ok, else false. If false, the rebuild/update/callback events won't be called */
|
|
48
|
+
onValidation?: (block: any, propertyName: string) => boolean;
|
|
49
|
+
};
|
|
50
|
+
/** a list of the options for a property of type list */
|
|
51
|
+
options?: IEditablePropertyListOption[] | Observable<IEditablePropertyListOption[]>;
|
|
52
|
+
/** whether the options' values should be treated as strings */
|
|
53
|
+
valuesAreStrings?: boolean;
|
|
54
|
+
/** If supplied, the sub property to read/write */
|
|
55
|
+
subPropertyName?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Interface that describes an editable property
|
|
60
|
+
*/
|
|
61
|
+
export interface IPropertyDescriptionForEdition {
|
|
62
|
+
/** name of the property */
|
|
63
|
+
propertyName: string;
|
|
64
|
+
/** display name of the property */
|
|
65
|
+
displayName: string;
|
|
66
|
+
/** type of the property */
|
|
67
|
+
type: PropertyTypeForEdition;
|
|
68
|
+
/** group of the property - all properties with the same group value will be displayed in a specific section */
|
|
69
|
+
groupName: string;
|
|
70
|
+
/** options for the property */
|
|
71
|
+
options: IEditablePropertyOption;
|
|
72
|
+
/** name of the class that contains the property */
|
|
73
|
+
className: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Decorator that flags a property in a node block as being editable
|
|
78
|
+
* @param displayName - the display name of the property
|
|
79
|
+
* @param propertyType - the type of the property
|
|
80
|
+
* @param groupName - the group name of the property
|
|
81
|
+
* @param options - the options of the property
|
|
82
|
+
* @returns the decorator
|
|
83
|
+
*/
|
|
84
|
+
export function EditableInPropertyPage(
|
|
85
|
+
displayName: string,
|
|
86
|
+
propertyType: PropertyTypeForEdition = PropertyTypeForEdition.Boolean,
|
|
87
|
+
groupName: string = "PROPERTIES",
|
|
88
|
+
options?: IEditablePropertyOption
|
|
89
|
+
) {
|
|
90
|
+
return (target: any, propertyKey: string) => {
|
|
91
|
+
let propStore: IPropertyDescriptionForEdition[] = target._propStore;
|
|
92
|
+
if (!propStore) {
|
|
93
|
+
propStore = [];
|
|
94
|
+
target._propStore = propStore;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
propStore.push({
|
|
98
|
+
propertyName: propertyKey,
|
|
99
|
+
displayName: displayName,
|
|
100
|
+
type: propertyType,
|
|
101
|
+
groupName: groupName,
|
|
102
|
+
options: options ?? {},
|
|
103
|
+
className: target.constructor.name,
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
}
|
package/src/editorUtils/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
|
2
|
+
export * from "./command/index.js";
|
|
3
|
+
export * from "./connection/index.js";
|
|
4
|
+
export * from "./blockFoundation/index.js";
|
|
5
|
+
export * from "./editorUtils/index.js";
|
|
6
|
+
export * from "./optimization/index.js";
|
|
7
|
+
export * from "./runtime/index.js";
|
|
8
|
+
export * from "./serialization/index.js";
|
|
9
|
+
export * from "./utils/index.js";
|
|
10
|
+
|
|
11
|
+
export { type IDisposable } from "./IDisposable.js";
|
|
12
|
+
export { SmartFilter, type InitializationData } from "./smartFilter.js";
|
|
13
|
+
export * from "./version.js";
|
|
14
|
+
|
|
15
|
+
// So that users of the Smart Filters core can easily modify the logger settings (e.g. to change the logging level)
|
|
16
|
+
export { Logger } from "core/Misc/logger.js";
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { Logger } from "
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Implementation of a dependency graph.
|
|
5
|
-
*/
|
|
6
|
-
export class DependencyGraph<T> {
|
|
7
|
-
private _list: Set<T>;
|
|
8
|
-
private _dependOn: Map<T, Set<T>>;
|
|
9
|
-
private _requiredBy: Map<T, Set<T>>;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Creates a new instance of a dependency graph.
|
|
13
|
-
*/
|
|
14
|
-
constructor() {
|
|
15
|
-
this._list = new Set();
|
|
16
|
-
this._dependOn = new Map();
|
|
17
|
-
this._requiredBy = new Map();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Adds an element to the graph.
|
|
22
|
-
* @param element - The element to add to the graph.
|
|
23
|
-
*/
|
|
24
|
-
public addElement(element: T) {
|
|
25
|
-
if (this._list.has(element)) {
|
|
26
|
-
throw new Error(`Element "${element}" already added to the graph!`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
this._list.add(element);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Adds a dependency between two elements.
|
|
34
|
-
* @param element - The element that depends on another element.
|
|
35
|
-
* @param dependency - The element that is required by the element passed as the first parameter.
|
|
36
|
-
*/
|
|
37
|
-
public addDependency(element: T, dependency: T) {
|
|
38
|
-
if (!this._dependOn.has(element)) {
|
|
39
|
-
this._dependOn.set(element, new Set());
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!this._requiredBy.has(dependency)) {
|
|
43
|
-
this._requiredBy.set(dependency, new Set());
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
this._dependOn.get(element)!.add(dependency);
|
|
47
|
-
this._requiredBy.get(dependency)!.add(element);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Walks through the graph and calls the callback for each element.
|
|
52
|
-
* The elements that depend on other elements will be traversed after the elements they depend on.
|
|
53
|
-
* Note: the graph will be modified during the walk, so don't call walk twice on the same graph!
|
|
54
|
-
* @param callback - The callback to call for each element.
|
|
55
|
-
*/
|
|
56
|
-
public walk(callback: (element: T) => void) {
|
|
57
|
-
const toVisit: T[] = [];
|
|
58
|
-
|
|
59
|
-
// Collect all elements that have no dependency
|
|
60
|
-
for (const element of this._list) {
|
|
61
|
-
if (!this._dependOn.get(element)) {
|
|
62
|
-
toVisit.push(element);
|
|
63
|
-
this._list.delete(element);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Loop over all elements that have no dependency
|
|
68
|
-
while (toVisit.length > 0) {
|
|
69
|
-
const element = toVisit.shift()!;
|
|
70
|
-
|
|
71
|
-
callback(element);
|
|
72
|
-
|
|
73
|
-
this._list.delete(element);
|
|
74
|
-
|
|
75
|
-
const requiredBy = this._requiredBy.get(element);
|
|
76
|
-
if (requiredBy) {
|
|
77
|
-
for (const dependingElement of requiredBy) {
|
|
78
|
-
const dependencies = this._dependOn.get(dependingElement);
|
|
79
|
-
|
|
80
|
-
if (dependencies) {
|
|
81
|
-
dependencies.delete(element);
|
|
82
|
-
|
|
83
|
-
if (dependencies.size === 0) {
|
|
84
|
-
toVisit.push(dependingElement);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (this._list.size > 0) {
|
|
92
|
-
Logger.Error(JSON.stringify(this._list));
|
|
93
|
-
throw new Error("Circular dependency detected!");
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
1
|
+
import { Logger } from "core/Misc/logger.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Implementation of a dependency graph.
|
|
5
|
+
*/
|
|
6
|
+
export class DependencyGraph<T> {
|
|
7
|
+
private _list: Set<T>;
|
|
8
|
+
private _dependOn: Map<T, Set<T>>;
|
|
9
|
+
private _requiredBy: Map<T, Set<T>>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new instance of a dependency graph.
|
|
13
|
+
*/
|
|
14
|
+
constructor() {
|
|
15
|
+
this._list = new Set();
|
|
16
|
+
this._dependOn = new Map();
|
|
17
|
+
this._requiredBy = new Map();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Adds an element to the graph.
|
|
22
|
+
* @param element - The element to add to the graph.
|
|
23
|
+
*/
|
|
24
|
+
public addElement(element: T) {
|
|
25
|
+
if (this._list.has(element)) {
|
|
26
|
+
throw new Error(`Element "${element}" already added to the graph!`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this._list.add(element);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Adds a dependency between two elements.
|
|
34
|
+
* @param element - The element that depends on another element.
|
|
35
|
+
* @param dependency - The element that is required by the element passed as the first parameter.
|
|
36
|
+
*/
|
|
37
|
+
public addDependency(element: T, dependency: T) {
|
|
38
|
+
if (!this._dependOn.has(element)) {
|
|
39
|
+
this._dependOn.set(element, new Set());
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!this._requiredBy.has(dependency)) {
|
|
43
|
+
this._requiredBy.set(dependency, new Set());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this._dependOn.get(element)!.add(dependency);
|
|
47
|
+
this._requiredBy.get(dependency)!.add(element);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Walks through the graph and calls the callback for each element.
|
|
52
|
+
* The elements that depend on other elements will be traversed after the elements they depend on.
|
|
53
|
+
* Note: the graph will be modified during the walk, so don't call walk twice on the same graph!
|
|
54
|
+
* @param callback - The callback to call for each element.
|
|
55
|
+
*/
|
|
56
|
+
public walk(callback: (element: T) => void) {
|
|
57
|
+
const toVisit: T[] = [];
|
|
58
|
+
|
|
59
|
+
// Collect all elements that have no dependency
|
|
60
|
+
for (const element of this._list) {
|
|
61
|
+
if (!this._dependOn.get(element)) {
|
|
62
|
+
toVisit.push(element);
|
|
63
|
+
this._list.delete(element);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Loop over all elements that have no dependency
|
|
68
|
+
while (toVisit.length > 0) {
|
|
69
|
+
const element = toVisit.shift()!;
|
|
70
|
+
|
|
71
|
+
callback(element);
|
|
72
|
+
|
|
73
|
+
this._list.delete(element);
|
|
74
|
+
|
|
75
|
+
const requiredBy = this._requiredBy.get(element);
|
|
76
|
+
if (requiredBy) {
|
|
77
|
+
for (const dependingElement of requiredBy) {
|
|
78
|
+
const dependencies = this._dependOn.get(dependingElement);
|
|
79
|
+
|
|
80
|
+
if (dependencies) {
|
|
81
|
+
dependencies.delete(element);
|
|
82
|
+
|
|
83
|
+
if (dependencies.size === 0) {
|
|
84
|
+
toVisit.push(dependingElement);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (this._list.size > 0) {
|
|
92
|
+
Logger.Error(JSON.stringify(this._list));
|
|
93
|
+
throw new Error("Circular dependency detected!");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SmartFilterOptimizer } from "./smartFilterOptimizer.js";
|
|
1
|
+
export { SmartFilterOptimizer } from "./smartFilterOptimizer.js";
|