@babylonjs/smart-filters 0.4.0-alpha → 0.4.2-alpha
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/blocks/outputBlock.d.ts.map +1 -1
- package/dist/blocks/outputBlock.js +1 -0
- package/dist/blocks/outputBlock.js.map +1 -1
- package/dist/editorUtils/editableInPropertyPage.d.ts +76 -0
- package/dist/editorUtils/editableInPropertyPage.d.ts.map +1 -0
- package/dist/editorUtils/editableInPropertyPage.js +41 -0
- package/dist/editorUtils/editableInPropertyPage.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/blocks/outputBlock.ts +1 -0
- package/src/editorUtils/editableInPropertyPage.ts +101 -0
- package/src/index.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/outputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMvF;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACtC;;OAEG;IACH,OAAuB,SAAS,SAAiB;IAEjD;;;OAGG;IACH,SAAgB,KAAK,uFAA6D;IAElF;;;OAGG;IACI,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAQ;IAEjE;;;OAGG;gBACS,WAAW,EAAE,WAAW;IAIpC;;OAEG;IACa,iBAAiB,IAAI,IAAI;IAQzC;;OAEG;IACa,oBAAoB,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"outputBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/outputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMvF;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACtC;;OAEG;IACH,OAAuB,SAAS,SAAiB;IAEjD;;;OAGG;IACH,SAAgB,KAAK,uFAA6D;IAElF;;;OAGG;IACI,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAQ;IAEjE;;;OAGG;gBACS,WAAW,EAAE,WAAW;IAIpC;;OAEG;IACa,iBAAiB,IAAI,IAAI;IAQzC;;OAEG;IACa,oBAAoB,IAAI,IAAI;IAS5C;;;;OAIG;IACa,qCAAqC,CACjD,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,OAAO,GACrB,IAAI;CAmBV"}
|
|
@@ -46,6 +46,7 @@ export class OutputBlock extends BaseBlock {
|
|
|
46
46
|
block.propagateRuntimeData();
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
+
this._confirmRuntimeDataSupplied(this.input);
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
52
|
* Generates the commands needed to execute the block at runtime and gathers promises for initialization work
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputBlock.js","sourceRoot":"","sources":["../../src/blocks/outputBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EA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kB,GAAG,IAAI,aAAa,CACxC,OAAO,CAAC,cAAc,EACtB,aAAa,EACb,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAClD,CAAC;YACF,kBAAkB,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;YAChF,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;YAE7C,0BAA0B,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAExF,KAAK,CAAC,qCAAqC,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;QACjF,CAAC;IACL,CAAC;;AA1ED;;GAEG;AACoB,qBAAS,GAAG,aAAa,AAAhB,CAAiB;AA0ErD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,aAAa;IAG3C;;;OAGG;IACH,YAAY,YAAsD;QAC9D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACa,IAAI,CAAC,MAAc;QAC/B,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;CACJ"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Observable } from "@babylonjs/core/Misc/observable";
|
|
2
|
+
/**
|
|
3
|
+
* Enum defining the type of properties that can be edited in the property pages in the node editor
|
|
4
|
+
*/
|
|
5
|
+
export declare enum PropertyTypeForEdition {
|
|
6
|
+
/** property is a boolean */
|
|
7
|
+
Boolean = 0,
|
|
8
|
+
/** property is a float */
|
|
9
|
+
Float = 1,
|
|
10
|
+
/** property is a int */
|
|
11
|
+
Int = 2,
|
|
12
|
+
/** property is a Vector2 */
|
|
13
|
+
Vector2 = 3,
|
|
14
|
+
/** property is a list of values */
|
|
15
|
+
List = 4
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Interface that defines an option in a variable of type list
|
|
19
|
+
*/
|
|
20
|
+
export interface IEditablePropertyListOption {
|
|
21
|
+
/** label of the option */
|
|
22
|
+
label: string;
|
|
23
|
+
/** value of the option */
|
|
24
|
+
value: number | string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Interface that defines the options available for an editable property
|
|
28
|
+
*/
|
|
29
|
+
export interface IEditablePropertyOption {
|
|
30
|
+
/** min value */
|
|
31
|
+
min?: number;
|
|
32
|
+
/** max value */
|
|
33
|
+
max?: number;
|
|
34
|
+
/** notifiers: indicates which actions to take when the property is changed */
|
|
35
|
+
notifiers?: {
|
|
36
|
+
/** the entity should be rebuilt */
|
|
37
|
+
rebuild?: boolean;
|
|
38
|
+
/** the preview should be updated */
|
|
39
|
+
update?: boolean;
|
|
40
|
+
/** the onPreviewCommandActivated observer of the preview manager should be triggered */
|
|
41
|
+
activatePreviewCommand?: boolean;
|
|
42
|
+
/** a callback to trigger */
|
|
43
|
+
callback?: () => boolean | undefined | void;
|
|
44
|
+
/** 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 */
|
|
45
|
+
onValidation?: (block: any, propertyName: string) => boolean;
|
|
46
|
+
};
|
|
47
|
+
/** a list of the options for a property of type list */
|
|
48
|
+
options?: IEditablePropertyListOption[] | Observable<IEditablePropertyListOption[]>;
|
|
49
|
+
/** whether the options' values should be treated as strings */
|
|
50
|
+
valuesAreStrings?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Interface that describes an editable property
|
|
54
|
+
*/
|
|
55
|
+
export interface IPropertyDescriptionForEdition {
|
|
56
|
+
/** name of the property */
|
|
57
|
+
propertyName: string;
|
|
58
|
+
/** display name of the property */
|
|
59
|
+
displayName: string;
|
|
60
|
+
/** type of the property */
|
|
61
|
+
type: PropertyTypeForEdition;
|
|
62
|
+
/** group of the property - all properties with the same group value will be displayed in a specific section */
|
|
63
|
+
groupName: string;
|
|
64
|
+
/** options for the property */
|
|
65
|
+
options: IEditablePropertyOption;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Decorator that flags a property in a node block as being editable
|
|
69
|
+
* @param displayName - the display name of the property
|
|
70
|
+
* @param propertyType - the type of the property
|
|
71
|
+
* @param groupName - the group name of the property
|
|
72
|
+
* @param options - the options of the property
|
|
73
|
+
* @returns the decorator
|
|
74
|
+
*/
|
|
75
|
+
export declare function editableInPropertyPage(displayName: string, propertyType?: PropertyTypeForEdition, groupName?: string, options?: IEditablePropertyOption): (target: any, propertyKey: string) => void;
|
|
76
|
+
//# sourceMappingURL=editableInPropertyPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editableInPropertyPage.d.ts","sourceRoot":"","sources":["../../src/editorUtils/editableInPropertyPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE;;GAEG;AACH,oBAAY,sBAAsB;IAC9B,4BAA4B;IAC5B,OAAO,IAAA;IACP,0BAA0B;IAC1B,KAAK,IAAA;IACL,wBAAwB;IACxB,GAAG,IAAA;IACH,4BAA4B;IAC5B,OAAO,IAAA;IACP,mCAAmC;IACnC,IAAI,IAAA;CACP;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,gBAAgB;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,SAAS,CAAC,EAAE;QACR,mCAAmC;QACnC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,oCAAoC;QACpC,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,wFAAwF;QACxF,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,4BAA4B;QAC5B,QAAQ,CAAC,EAAE,MAAM,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;QAC5C,wJAAwJ;QACxJ,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;KAChE,CAAC;IACF,wDAAwD;IACxD,OAAO,CAAC,EAAE,2BAA2B,EAAE,GAAG,UAAU,CAAC,2BAA2B,EAAE,CAAC,CAAC;IACpF,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC3C,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,+GAA+G;IAC/G,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,OAAO,EAAE,uBAAuB,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAClC,WAAW,EAAE,MAAM,EACnB,YAAY,GAAE,sBAAuD,EACrE,SAAS,GAAE,MAAqB,EAChC,OAAO,CAAC,EAAE,uBAAuB,YAEjB,GAAG,eAAe,MAAM,UAe3C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum defining the type of properties that can be edited in the property pages in the node editor
|
|
3
|
+
*/
|
|
4
|
+
export var PropertyTypeForEdition;
|
|
5
|
+
(function (PropertyTypeForEdition) {
|
|
6
|
+
/** property is a boolean */
|
|
7
|
+
PropertyTypeForEdition[PropertyTypeForEdition["Boolean"] = 0] = "Boolean";
|
|
8
|
+
/** property is a float */
|
|
9
|
+
PropertyTypeForEdition[PropertyTypeForEdition["Float"] = 1] = "Float";
|
|
10
|
+
/** property is a int */
|
|
11
|
+
PropertyTypeForEdition[PropertyTypeForEdition["Int"] = 2] = "Int";
|
|
12
|
+
/** property is a Vector2 */
|
|
13
|
+
PropertyTypeForEdition[PropertyTypeForEdition["Vector2"] = 3] = "Vector2";
|
|
14
|
+
/** property is a list of values */
|
|
15
|
+
PropertyTypeForEdition[PropertyTypeForEdition["List"] = 4] = "List";
|
|
16
|
+
})(PropertyTypeForEdition || (PropertyTypeForEdition = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Decorator that flags a property in a node block as being editable
|
|
19
|
+
* @param displayName - the display name of the property
|
|
20
|
+
* @param propertyType - the type of the property
|
|
21
|
+
* @param groupName - the group name of the property
|
|
22
|
+
* @param options - the options of the property
|
|
23
|
+
* @returns the decorator
|
|
24
|
+
*/
|
|
25
|
+
export function editableInPropertyPage(displayName, propertyType = PropertyTypeForEdition.Boolean, groupName = "PROPERTIES", options) {
|
|
26
|
+
return (target, propertyKey) => {
|
|
27
|
+
let propStore = target._propStore;
|
|
28
|
+
if (!propStore) {
|
|
29
|
+
propStore = [];
|
|
30
|
+
target._propStore = propStore;
|
|
31
|
+
}
|
|
32
|
+
propStore.push({
|
|
33
|
+
propertyName: propertyKey,
|
|
34
|
+
displayName: displayName,
|
|
35
|
+
type: propertyType,
|
|
36
|
+
groupName: groupName,
|
|
37
|
+
options: options !== null && options !== void 0 ? options : {},
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=editableInPropertyPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editableInPropertyPage.js","sourceRoot":"","sources":["../../src/editorUtils/editableInPropertyPage.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,sBAWX;AAXD,WAAY,sBAAsB;IAC9B,4BAA4B;IAC5B,yEAAO,CAAA;IACP,0BAA0B;IAC1B,qEAAK,CAAA;IACL,wBAAwB;IACxB,iEAAG,CAAA;IACH,4BAA4B;IAC5B,yEAAO,CAAA;IACP,mCAAmC;IACnC,mEAAI,CAAA;AACR,CAAC,EAXW,sBAAsB,KAAtB,sBAAsB,QAWjC;AAuDD;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAClC,WAAmB,EACnB,eAAuC,sBAAsB,CAAC,OAAO,EACrE,YAAoB,YAAY,EAChC,OAAiC;IAEjC,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACxC,IAAI,SAAS,GAAqC,MAAM,CAAC,UAAU,CAAC;QACpE,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,SAAS,GAAG,EAAE,CAAC;YACf,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;QAClC,CAAC;QAED,SAAS,CAAC,IAAI,CAAC;YACX,YAAY,EAAE,WAAW;YACzB,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;SACzB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ export { type IDisableableBlock } from "./blocks/disableableShaderBlock.js";
|
|
|
22
22
|
export { type SmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
|
|
23
23
|
export { InternalSmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
|
|
24
24
|
export { RenderTargetGenerator } from "./runtime/renderTargetGenerator.js";
|
|
25
|
-
export { SmartFilter } from "./smartFilter.js";
|
|
25
|
+
export { SmartFilter, type InitializationData } from "./smartFilter.js";
|
|
26
26
|
export { SmartFilterOptimizer } from "./optimization/smartFilterOptimizer.js";
|
|
27
27
|
export * from "./utils/textureLoaders.js";
|
|
28
28
|
export * from "./serialization/index.js";
|
|
29
|
+
export * from "./editorUtils/editableInPropertyPage.js";
|
|
29
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts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AE,MAAM,oCAAoC,CAAC;AACrH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yCAAyC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -26,4 +26,5 @@ export { SmartFilter } from "./smartFilter.js";
|
|
|
26
26
|
export { SmartFilterOptimizer } from "./optimization/smartFilterOptimizer.js";
|
|
27
27
|
export * from "./utils/textureLoaders.js";
|
|
28
28
|
export * from "./serialization/index.js";
|
|
29
|
+
export * from "./editorUtils/editableInPropertyPage.js";
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAkB,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,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|
1
|
+
import type { Observable } from "@babylonjs/core/Misc/observable";
|
|
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
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Interface that describes an editable property
|
|
58
|
+
*/
|
|
59
|
+
export interface IPropertyDescriptionForEdition {
|
|
60
|
+
/** name of the property */
|
|
61
|
+
propertyName: string;
|
|
62
|
+
/** display name of the property */
|
|
63
|
+
displayName: string;
|
|
64
|
+
/** type of the property */
|
|
65
|
+
type: PropertyTypeForEdition;
|
|
66
|
+
/** group of the property - all properties with the same group value will be displayed in a specific section */
|
|
67
|
+
groupName: string;
|
|
68
|
+
/** options for the property */
|
|
69
|
+
options: IEditablePropertyOption;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Decorator that flags a property in a node block as being editable
|
|
74
|
+
* @param displayName - the display name of the property
|
|
75
|
+
* @param propertyType - the type of the property
|
|
76
|
+
* @param groupName - the group name of the property
|
|
77
|
+
* @param options - the options of the property
|
|
78
|
+
* @returns the decorator
|
|
79
|
+
*/
|
|
80
|
+
export function editableInPropertyPage(
|
|
81
|
+
displayName: string,
|
|
82
|
+
propertyType: PropertyTypeForEdition = PropertyTypeForEdition.Boolean,
|
|
83
|
+
groupName: string = "PROPERTIES",
|
|
84
|
+
options?: IEditablePropertyOption
|
|
85
|
+
) {
|
|
86
|
+
return (target: any, propertyKey: string) => {
|
|
87
|
+
let propStore: IPropertyDescriptionForEdition[] = target._propStore;
|
|
88
|
+
if (!propStore) {
|
|
89
|
+
propStore = [];
|
|
90
|
+
target._propStore = propStore;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
propStore.push({
|
|
94
|
+
propertyName: propertyKey,
|
|
95
|
+
displayName: displayName,
|
|
96
|
+
type: propertyType,
|
|
97
|
+
groupName: groupName,
|
|
98
|
+
options: options ?? {},
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -30,8 +30,9 @@ export { type SmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
|
|
|
30
30
|
export { InternalSmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
|
|
31
31
|
export { RenderTargetGenerator } from "./runtime/renderTargetGenerator.js";
|
|
32
32
|
|
|
33
|
-
export { SmartFilter } from "./smartFilter.js";
|
|
33
|
+
export { SmartFilter, type InitializationData } from "./smartFilter.js";
|
|
34
34
|
|
|
35
35
|
export { SmartFilterOptimizer } from "./optimization/smartFilterOptimizer.js";
|
|
36
36
|
export * from "./utils/textureLoaders.js";
|
|
37
37
|
export * from "./serialization/index.js";
|
|
38
|
+
export * from "./editorUtils/editableInPropertyPage.js";
|