@babylonjs/smart-filters 0.7.11-alpha → 0.7.13-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/blockFoundation/outputBlock.d.ts +5 -0
- package/dist/blockFoundation/outputBlock.d.ts.map +1 -1
- package/dist/blockFoundation/outputBlock.js +30 -1
- package/dist/blockFoundation/outputBlock.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/serialization/importCustomBlockDefinition.js +1 -25
- package/dist/serialization/importCustomBlockDefinition.js.map +1 -1
- package/dist/utils/buildTools/buildShaders.js +1 -1
- package/dist/utils/buildTools/buildShaders.js.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts +7 -0
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts.map +1 -0
- package/dist/utils/buildTools/convertGlslIntoBlock.js +217 -0
- package/dist/utils/buildTools/convertGlslIntoBlock.js.map +1 -0
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts +26 -0
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts.map +1 -0
- package/dist/utils/buildTools/{convertShaderForHardcodedBlock.js → convertGlslIntoShaderProgram.js} +43 -30
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.js.map +1 -0
- package/dist/utils/buildTools/convertShaders.d.ts +13 -0
- package/dist/utils/buildTools/convertShaders.d.ts.map +1 -0
- package/dist/utils/buildTools/convertShaders.js +37 -0
- package/dist/utils/buildTools/convertShaders.js.map +1 -0
- package/dist/utils/buildTools/shaderConverter.d.ts +2 -1
- package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
- package/dist/utils/buildTools/shaderConverter.js +26 -1
- package/dist/utils/buildTools/shaderConverter.js.map +1 -1
- package/dist/utils/buildTools/watchShaders.js +2 -2
- package/dist/utils/buildTools/watchShaders.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -10
- package/readme.md +2 -0
- package/src/blockFoundation/outputBlock.ts +33 -1
- package/src/index.ts +0 -2
- package/src/serialization/importCustomBlockDefinition.ts +1 -26
- package/src/utils/buildTools/buildShaders.ts +1 -1
- package/src/utils/buildTools/convertGlslIntoBlock.ts +251 -0
- package/src/utils/buildTools/{convertShaderForHardcodedBlock.ts → convertGlslIntoShaderProgram.ts} +56 -35
- package/src/utils/buildTools/convertShaders.ts +42 -0
- package/src/utils/buildTools/shaderConverter.ts +28 -2
- package/src/utils/buildTools/watchShaders.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/blockFoundation/outputBlock.shader.d.ts +0 -13
- package/dist/blockFoundation/outputBlock.shader.d.ts.map +0 -1
- package/dist/blockFoundation/outputBlock.shader.js +0 -31
- package/dist/blockFoundation/outputBlock.shader.js.map +0 -1
- package/dist/blockRegistration/IBlockRegistration.d.ts +0 -36
- package/dist/blockRegistration/IBlockRegistration.d.ts.map +0 -1
- package/dist/blockRegistration/IBlockRegistration.js +0 -2
- package/dist/blockRegistration/IBlockRegistration.js.map +0 -1
- package/dist/blockRegistration/blockSerializers.d.ts +0 -13
- package/dist/blockRegistration/blockSerializers.d.ts.map +0 -1
- package/dist/blockRegistration/blockSerializers.js +0 -35
- package/dist/blockRegistration/blockSerializers.js.map +0 -1
- package/dist/blockRegistration/builtInBlockRegistrations.d.ts +0 -13
- package/dist/blockRegistration/builtInBlockRegistrations.d.ts.map +0 -1
- package/dist/blockRegistration/builtInBlockRegistrations.js +0 -266
- package/dist/blockRegistration/builtInBlockRegistrations.js.map +0 -1
- package/dist/blockRegistration/index.d.ts +0 -3
- package/dist/blockRegistration/index.d.ts.map +0 -1
- package/dist/blockRegistration/index.js +0 -3
- package/dist/blockRegistration/index.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.d.ts +0 -56
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.js +0 -66
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.d.ts +0 -13
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.js +0 -36
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.d.ts +0 -56
- package/dist/blocks/babylon/demo/effects/blurBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts +0 -29
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js +0 -16
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.js +0 -100
- package/dist/blocks/babylon/demo/effects/blurBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts +0 -8
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js +0 -28
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts +0 -118
- package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts +0 -25
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js +0 -15
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.js +0 -219
- package/dist/blocks/babylon/demo/effects/compositionBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts +0 -6
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js +0 -25
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/contrastBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/contrastBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/contrastBlock.js +0 -122
- package/dist/blocks/babylon/demo/effects/contrastBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/desaturateBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/desaturateBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/desaturateBlock.js +0 -107
- package/dist/blocks/babylon/demo/effects/desaturateBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts +0 -79
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts +0 -33
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js +0 -17
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js +0 -171
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts +0 -6
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js +0 -27
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/exposureBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/exposureBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/exposureBlock.js +0 -95
- package/dist/blocks/babylon/demo/effects/exposureBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.d.ts +0 -75
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.js +0 -121
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/index.d.ts +0 -15
- package/dist/blocks/babylon/demo/effects/index.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/index.js +0 -15
- package/dist/blocks/babylon/demo/effects/index.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js +0 -159
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.d.ts +0 -62
- package/dist/blocks/babylon/demo/effects/maskBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.js +0 -75
- package/dist/blocks/babylon/demo/effects/maskBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.d.ts +0 -14
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.js +0 -37
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.d.ts +0 -62
- package/dist/blocks/babylon/demo/effects/pixelateBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.js +0 -77
- package/dist/blocks/babylon/demo/effects/pixelateBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.d.ts +0 -15
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.js +0 -44
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/posterizeBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/posterizeBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/posterizeBlock.js +0 -108
- package/dist/blocks/babylon/demo/effects/posterizeBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts +0 -81
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.js +0 -103
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.d.ts +0 -18
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.js +0 -57
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/tintBlock.d.ts +0 -7
- package/dist/blocks/babylon/demo/effects/tintBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/tintBlock.js +0 -51
- package/dist/blocks/babylon/demo/effects/tintBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/transitions/index.d.ts +0 -2
- package/dist/blocks/babylon/demo/transitions/index.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/transitions/index.js +0 -2
- package/dist/blocks/babylon/demo/transitions/index.js.map +0 -1
- package/dist/blocks/babylon/demo/transitions/wipeBlock.d.ts +0 -69
- package/dist/blocks/babylon/demo/transitions/wipeBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/transitions/wipeBlock.js +0 -110
- package/dist/blocks/babylon/demo/transitions/wipeBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/utilities/index.d.ts +0 -2
- package/dist/blocks/babylon/demo/utilities/index.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/utilities/index.js +0 -2
- package/dist/blocks/babylon/demo/utilities/index.js.map +0 -1
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.d.ts +0 -58
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.js +0 -87
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.js.map +0 -1
- package/dist/blocks/blockNamespaces.d.ts +0 -5
- package/dist/blocks/blockNamespaces.d.ts.map +0 -1
- package/dist/blocks/blockNamespaces.js +0 -5
- package/dist/blocks/blockNamespaces.js.map +0 -1
- package/dist/blocks/blockTypes.d.ts +0 -22
- package/dist/blocks/blockTypes.d.ts.map +0 -1
- package/dist/blocks/blockTypes.js +0 -22
- package/dist/blocks/blockTypes.js.map +0 -1
- package/dist/blocks/index.d.ts +0 -6
- package/dist/blocks/index.d.ts.map +0 -1
- package/dist/blocks/index.js +0 -6
- package/dist/blocks/index.js.map +0 -1
- package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts +0 -13
- package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts.map +0 -1
- package/dist/utils/buildTools/convertShaderForHardcodedBlock.js.map +0 -1
- package/src/blockFoundation/outputBlock.fragment.glsl +0 -5
- package/src/blockFoundation/outputBlock.shader.ts +0 -33
- package/src/blockRegistration/IBlockRegistration.ts +0 -45
- package/src/blockRegistration/blockSerializers.ts +0 -52
- package/src/blockRegistration/builtInBlockRegistrations.ts +0 -390
- package/src/blockRegistration/index.ts +0 -2
- package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.fragment.glsl +0 -10
- package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.ts +0 -38
- package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.ts +0 -80
- package/src/blocks/babylon/demo/effects/blurBlock.deserializer.ts +0 -38
- package/src/blocks/babylon/demo/effects/blurBlock.serializer.ts +0 -32
- package/src/blocks/babylon/demo/effects/blurBlock.ts +0 -119
- package/src/blocks/babylon/demo/effects/compositionBlock.deserializer.ts +0 -32
- package/src/blocks/babylon/demo/effects/compositionBlock.serializer.ts +0 -29
- package/src/blocks/babylon/demo/effects/compositionBlock.ts +0 -293
- package/src/blocks/babylon/demo/effects/contrastBlock.ts +0 -152
- package/src/blocks/babylon/demo/effects/desaturateBlock.ts +0 -137
- package/src/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.ts +0 -47
- package/src/blocks/babylon/demo/effects/directionalBlurBlock.serializer.ts +0 -31
- package/src/blocks/babylon/demo/effects/directionalBlurBlock.ts +0 -193
- package/src/blocks/babylon/demo/effects/exposureBlock.ts +0 -120
- package/src/blocks/babylon/demo/effects/greenScreenBlock.ts +0 -152
- package/src/blocks/babylon/demo/effects/index.ts +0 -14
- package/src/blocks/babylon/demo/effects/kaleidoscopeBlock.ts +0 -186
- package/src/blocks/babylon/demo/effects/maskBlock.fragment.glsl +0 -10
- package/src/blocks/babylon/demo/effects/maskBlock.shader.ts +0 -39
- package/src/blocks/babylon/demo/effects/maskBlock.ts +0 -94
- package/src/blocks/babylon/demo/effects/pixelateBlock.fragment.glsl +0 -18
- package/src/blocks/babylon/demo/effects/pixelateBlock.shader.ts +0 -46
- package/src/blocks/babylon/demo/effects/pixelateBlock.ts +0 -101
- package/src/blocks/babylon/demo/effects/posterizeBlock.ts +0 -139
- package/src/blocks/babylon/demo/effects/spritesheetBlock.fragment.glsl +0 -26
- package/src/blocks/babylon/demo/effects/spritesheetBlock.shader.ts +0 -59
- package/src/blocks/babylon/demo/effects/spritesheetBlock.ts +0 -135
- package/src/blocks/babylon/demo/effects/tintBlock.ts +0 -52
- package/src/blocks/babylon/demo/transitions/index.ts +0 -1
- package/src/blocks/babylon/demo/transitions/wipeBlock.ts +0 -138
- package/src/blocks/babylon/demo/utilities/index.ts +0 -1
- package/src/blocks/babylon/demo/utilities/premultiplyAlphaBlock.ts +0 -106
- package/src/blocks/blockNamespaces.ts +0 -4
- package/src/blocks/blockTypes.ts +0 -21
- package/src/blocks/index.ts +0 -5
package/src/utils/buildTools/{convertShaderForHardcodedBlock.ts → convertGlslIntoShaderProgram.ts}
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
|
-
import
|
|
3
|
-
import { parseFragmentShader } from "./shaderConverter.js";
|
|
2
|
+
import { parseFragmentShader, type FragmentShaderInfo } from "./shaderConverter.js";
|
|
4
3
|
|
|
5
4
|
const TYPE_IMPORT_PATH = "@TYPE_IMPORT_PATH@";
|
|
6
5
|
const VERTEX_SHADER = "@VERTEX_SHADER@";
|
|
@@ -13,6 +12,8 @@ const FUNCTIONS = "@FUNCTIONS@";
|
|
|
13
12
|
const FUNCTION_NAME = "@FUNCTION_NAME@";
|
|
14
13
|
const FUNCTION_CODE = "@FUNCTION_CODE@";
|
|
15
14
|
const UNIFORM_NAMES = "@UNIFORM_NAMES@";
|
|
15
|
+
const EXPORT = "@EXPORT_SHADER_PROGRAM@";
|
|
16
|
+
const IMPORTS = "@IMPORT@";
|
|
16
17
|
|
|
17
18
|
const ConstsTemplate = `
|
|
18
19
|
const: \`${CONSTS_VALUE}\`,`;
|
|
@@ -29,12 +30,13 @@ const CodeLinePrefix = " ";
|
|
|
29
30
|
const UniformLinePrefix = " ";
|
|
30
31
|
const ConstLinePrefix = " ";
|
|
31
32
|
|
|
32
|
-
const
|
|
33
|
+
const ImportTemplate = `import type { ShaderProgram } from "${TYPE_IMPORT_PATH}";`;
|
|
34
|
+
const ShaderTemplate = `${IMPORTS}
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* The shader program for the block.
|
|
36
38
|
*/
|
|
37
|
-
|
|
39
|
+
${EXPORT}const shaderProgram: ShaderProgram = {
|
|
38
40
|
vertex: ${VERTEX_SHADER},
|
|
39
41
|
fragment: {
|
|
40
42
|
uniform: \`${UNIFORMS}\`,${CONSTS_PROPERTY}
|
|
@@ -49,7 +51,7 @@ export const shaderProgram: ShaderProgram = {
|
|
|
49
51
|
* The uniform names for this shader, to be used in the shader binding so
|
|
50
52
|
* that the names are always in sync.
|
|
51
53
|
*/
|
|
52
|
-
|
|
54
|
+
${EXPORT}const uniforms = {
|
|
53
55
|
${UNIFORM_NAMES}
|
|
54
56
|
};
|
|
55
57
|
`;
|
|
@@ -57,16 +59,51 @@ ${UNIFORM_NAMES}
|
|
|
57
59
|
const UniformNameLinePrefix = " ";
|
|
58
60
|
|
|
59
61
|
/**
|
|
60
|
-
* Converts a single shader to a .ts file which can be imported by a hardcoded block
|
|
62
|
+
* Converts a single shader to a .ts file which exports a ShaderProgram which can be imported by a hardcoded block
|
|
61
63
|
* @param fragmentShaderPath - The path to the fragment file for the shader
|
|
62
64
|
* @param importPath - The path to import the ShaderProgram type from
|
|
63
65
|
*/
|
|
64
|
-
export function
|
|
65
|
-
|
|
66
|
+
export function convertGlslIntoShaderProgram(fragmentShaderPath: string, importPath: string): void {
|
|
67
|
+
const { shaderProgramCode } = extractShaderProgramFromGlsl(fragmentShaderPath, importPath, true, true);
|
|
68
|
+
const shaderFile = fragmentShaderPath.replace(".glsl", ".ts");
|
|
69
|
+
fs.writeFileSync(shaderFile, shaderProgramCode);
|
|
70
|
+
}
|
|
66
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Extracts the shader program from a glsl file(s) and returns it as a string which can be written to a .ts file
|
|
74
|
+
* @param fragmentShaderPath - The path to the fragment file for the shader
|
|
75
|
+
* @param importPath - The path to import the ShaderProgram type from
|
|
76
|
+
* @param exportObjects - Whether to export the shaderProgram and uniforms objects
|
|
77
|
+
* @param includeImports - Whether to include the imports in the output
|
|
78
|
+
* @returns The string to write to the .ts file
|
|
79
|
+
*/
|
|
80
|
+
export function extractShaderProgramFromGlsl(
|
|
81
|
+
fragmentShaderPath: string,
|
|
82
|
+
importPath: string,
|
|
83
|
+
exportObjects: boolean,
|
|
84
|
+
includeImports: boolean
|
|
85
|
+
): {
|
|
86
|
+
/**
|
|
87
|
+
* The shader program code
|
|
88
|
+
*/
|
|
89
|
+
shaderProgramCode: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The FragmentShaderInfo
|
|
93
|
+
*/
|
|
94
|
+
fragmentShaderInfo: FragmentShaderInfo;
|
|
95
|
+
} {
|
|
67
96
|
// See if there is a corresponding vertex shader
|
|
68
97
|
let vertexShader: string | undefined = undefined;
|
|
69
|
-
|
|
98
|
+
let extensionToFind: string;
|
|
99
|
+
if (fragmentShaderPath.endsWith(".block.glsl")) {
|
|
100
|
+
extensionToFind = ".block.glsl";
|
|
101
|
+
} else if (fragmentShaderPath.endsWith(".fragment.glsl")) {
|
|
102
|
+
extensionToFind = ".fragment.glsl";
|
|
103
|
+
} else {
|
|
104
|
+
throw new Error("The shader file must end with .fragment.glsl or .block.glsl");
|
|
105
|
+
}
|
|
106
|
+
const vertexShaderPath = fragmentShaderPath.replace(extensionToFind, ".vertex.glsl");
|
|
70
107
|
if (fs.existsSync(vertexShaderPath)) {
|
|
71
108
|
vertexShader = fs.readFileSync(vertexShaderPath, "utf8");
|
|
72
109
|
}
|
|
@@ -78,8 +115,7 @@ export function convertShaderForHardcodedBlock(fragmentShaderPath: string, impor
|
|
|
78
115
|
const fragmentShader = fs.readFileSync(fragmentShaderPath, "utf8");
|
|
79
116
|
const fragmentShaderInfo = parseFragmentShader(fragmentShader);
|
|
80
117
|
|
|
81
|
-
//
|
|
82
|
-
const shaderFile = fragmentShaderPath.replace(".fragment.glsl", ".shader.ts");
|
|
118
|
+
// Generate the shader program code
|
|
83
119
|
const functionsSection: string[] = [];
|
|
84
120
|
for (const shaderFunction of fragmentShaderInfo.shaderCode.functions) {
|
|
85
121
|
functionsSection.push(
|
|
@@ -89,11 +125,12 @@ export function convertShaderForHardcodedBlock(fragmentShaderPath: string, impor
|
|
|
89
125
|
)
|
|
90
126
|
);
|
|
91
127
|
}
|
|
128
|
+
const imports = includeImports ? ImportTemplate.replace(TYPE_IMPORT_PATH, importPath) : "";
|
|
92
129
|
const finalContents = ShaderTemplate.replace(VERTEX_SHADER, vertexShader ? `\`${vertexShader}\`` : "undefined")
|
|
93
|
-
.replace(
|
|
130
|
+
.replace(IMPORTS, imports)
|
|
94
131
|
.replace(UNIFORMS, "\n" + addLinePrefixes(fragmentShaderInfo.shaderCode.uniform || "", UniformLinePrefix))
|
|
95
132
|
.replace(MAIN_FUNCTION_NAME, fragmentShaderInfo.shaderCode.mainFunctionName)
|
|
96
|
-
.replace(MAIN_INPUT_NAME, fragmentShaderInfo.shaderCode.mainInputTexture ||
|
|
133
|
+
.replace(MAIN_INPUT_NAME, fragmentShaderInfo.shaderCode.mainInputTexture || "")
|
|
97
134
|
.replace(
|
|
98
135
|
CONSTS_PROPERTY,
|
|
99
136
|
fragmentShaderInfo.shaderCode.const
|
|
@@ -110,29 +147,13 @@ export function convertShaderForHardcodedBlock(fragmentShaderPath: string, impor
|
|
|
110
147
|
fragmentShaderInfo.uniforms.map((u) => `${u.name}: "${u.name}",`).join("\n"),
|
|
111
148
|
UniformNameLinePrefix
|
|
112
149
|
)
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
fs.writeFileSync(shaderFile, finalContents);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Converts .fragment.glsl and vertex.glsl file pairs into .shader.ts files which export a ShaderProgram object.
|
|
120
|
-
* @param shaderPath - The path to the .glsl files to convert.
|
|
121
|
-
* @param importPath - The path to import the ShaderProgram type from.
|
|
122
|
-
*/
|
|
123
|
-
export function convertShaders(shaderPath: string, importPath: string) {
|
|
124
|
-
// Get all files in the path
|
|
125
|
-
const allFiles = fs.readdirSync(shaderPath, { withFileTypes: true, recursive: true });
|
|
126
|
-
|
|
127
|
-
// Find all fragment shaders (excluding the template)
|
|
128
|
-
const fragmentShaderFiles = allFiles.filter(
|
|
129
|
-
(file) => file.isFile() && file.name.endsWith(".fragment.glsl") && !file.name.endsWith("template.fragment.glsl")
|
|
130
|
-
);
|
|
150
|
+
)
|
|
151
|
+
.replace(new RegExp(EXPORT, "g"), exportObjects ? "export " : "");
|
|
131
152
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
153
|
+
return {
|
|
154
|
+
shaderProgramCode: finalContents,
|
|
155
|
+
fragmentShaderInfo,
|
|
156
|
+
};
|
|
136
157
|
}
|
|
137
158
|
|
|
138
159
|
/**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { convertGlslIntoShaderProgram } from "./convertGlslIntoShaderProgram.js";
|
|
4
|
+
import { convertGlslIntoBlock } from "./convertGlslIntoBlock.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Converts all GLSL files in a path into blocks for use in the build system.
|
|
8
|
+
* @param shaderPath - The path to the .glsl files to convert.
|
|
9
|
+
* @param importPath - The path to import the ShaderProgram type from.
|
|
10
|
+
*/
|
|
11
|
+
export function convertShaders(shaderPath: string, importPath: string) {
|
|
12
|
+
// Get all files in the path
|
|
13
|
+
const allFiles = fs.readdirSync(shaderPath, { withFileTypes: true, recursive: true });
|
|
14
|
+
|
|
15
|
+
// Find all shaders (files with .fragment.glsl or .block.glsl extensions)
|
|
16
|
+
const shaderFiles = allFiles.filter(
|
|
17
|
+
(file) => file.isFile() && (file.name.endsWith(".fragment.glsl") || file.name.endsWith(".block.glsl"))
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Convert all shaders
|
|
21
|
+
for (const shaderFile of shaderFiles) {
|
|
22
|
+
const fullPathAndFileName = path.join(shaderFile.path, shaderFile.name);
|
|
23
|
+
convertShader(fullPathAndFileName, importPath);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Converts a single GLSL file into a block class or a ShaderProgram for use in the build system.
|
|
29
|
+
* @param fullPathAndFileName - The full path and file name of the .glsl file to convert.
|
|
30
|
+
* @param importPath - The path to import the ShaderProgram type from.
|
|
31
|
+
*/
|
|
32
|
+
export function convertShader(fullPathAndFileName: string, importPath: string): void {
|
|
33
|
+
console.log(`\nProcessing shader: ${fullPathAndFileName}`);
|
|
34
|
+
|
|
35
|
+
if (fullPathAndFileName.endsWith(".fragment.glsl")) {
|
|
36
|
+
console.log("Generating a .ts file that exports a ShaderProgram.");
|
|
37
|
+
convertGlslIntoShaderProgram(fullPathAndFileName, importPath);
|
|
38
|
+
} else if (fullPathAndFileName.endsWith(".block.glsl")) {
|
|
39
|
+
console.log("Generating a .ts file that exports the block as a class.");
|
|
40
|
+
convertGlslIntoBlock(fullPathAndFileName, importPath);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Nullable } from "@babylonjs/core/types";
|
|
2
2
|
import type { ShaderCode, ShaderFunction } from "./shaderCode.types";
|
|
3
|
+
import { ConnectionPointType } from "../../connection/connectionPointType.js";
|
|
3
4
|
|
|
4
5
|
const GetFunctionNamesRegEx = /\S*\w+\s+(\w+)\s*\(/g;
|
|
5
6
|
|
|
@@ -31,7 +32,7 @@ export type UniformMetadata = {
|
|
|
31
32
|
/**
|
|
32
33
|
* The type string of the uniform
|
|
33
34
|
*/
|
|
34
|
-
type:
|
|
35
|
+
type: ConnectionPointType;
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* Optional properties of the uniform
|
|
@@ -106,9 +107,34 @@ export function parseFragmentShader(fragmentShader: string): FragmentShaderInfo
|
|
|
106
107
|
throw new Error(`Uniforms must have a name: '${uniformLine}'`);
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
// Convert to ConnectionPointType
|
|
111
|
+
let type: ConnectionPointType;
|
|
112
|
+
switch (uniformTypeString) {
|
|
113
|
+
case "float":
|
|
114
|
+
type = ConnectionPointType.Float;
|
|
115
|
+
break;
|
|
116
|
+
case "sampler2D":
|
|
117
|
+
type = ConnectionPointType.Texture;
|
|
118
|
+
break;
|
|
119
|
+
case "vec3":
|
|
120
|
+
type = ConnectionPointType.Color3;
|
|
121
|
+
break;
|
|
122
|
+
case "vec4":
|
|
123
|
+
type = ConnectionPointType.Color4;
|
|
124
|
+
break;
|
|
125
|
+
case "bool":
|
|
126
|
+
type = ConnectionPointType.Boolean;
|
|
127
|
+
break;
|
|
128
|
+
case "vec2":
|
|
129
|
+
type = ConnectionPointType.Vector2;
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
throw new Error(`Unsupported uniform type: '${uniformTypeString}'`);
|
|
133
|
+
}
|
|
134
|
+
|
|
109
135
|
uniforms.push({
|
|
110
136
|
name: uniformName,
|
|
111
|
-
type
|
|
137
|
+
type,
|
|
112
138
|
properties: annotationJSON ? JSON.parse(annotationJSON.replace("//", "").trim()) : undefined,
|
|
113
139
|
});
|
|
114
140
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @example node watchShaders.js <shaderPath> <importPath>
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { convertShaderForHardcodedBlock } from "./convertShaderForHardcodedBlock.js";
|
|
10
9
|
import { watch } from "chokidar";
|
|
11
10
|
import { extname } from "path";
|
|
11
|
+
import { convertShader } from "./convertShaders.js";
|
|
12
12
|
|
|
13
13
|
const externalArguments = process.argv.slice(2);
|
|
14
14
|
if (externalArguments.length >= 2 && externalArguments[0] && externalArguments[1]) {
|
|
@@ -29,7 +29,7 @@ if (externalArguments.length >= 2 && externalArguments[0] && externalArguments[1
|
|
|
29
29
|
// Wrap in try-catch to prevent the watcher from crashing
|
|
30
30
|
// if the new shader changes are invalid
|
|
31
31
|
try {
|
|
32
|
-
|
|
32
|
+
convertShader(file, importPath);
|
|
33
33
|
console.log(`Successfully updated shader ${file}`);
|
|
34
34
|
} catch (error) {
|
|
35
35
|
console.error(`Failed to convert shader ${file}: ${error}`);
|
package/src/version.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The version of the SmartFilter core. During publish, this file is overwritten by versionUp.ts with the same version that is used for the NPM publish.
|
|
3
3
|
*/
|
|
4
|
-
export const SmartFilterCoreVersion = "0.7.
|
|
4
|
+
export const SmartFilterCoreVersion = "0.7.13-alpha";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ShaderProgram } from "../utils/shaderCodeUtils";
|
|
2
|
-
/**
|
|
3
|
-
* The shader program for the block.
|
|
4
|
-
*/
|
|
5
|
-
export declare const shaderProgram: ShaderProgram;
|
|
6
|
-
/**
|
|
7
|
-
* The uniform names for this shader, to be used in the shader binding so
|
|
8
|
-
* that the names are always in sync.
|
|
9
|
-
*/
|
|
10
|
-
export declare const uniforms: {
|
|
11
|
-
input: string;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=outputBlock.shader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputBlock.shader.d.ts","sourceRoot":"","sources":["../../src/blockFoundation/outputBlock.shader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAmB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shader program for the block.
|
|
3
|
-
*/
|
|
4
|
-
export const shaderProgram = {
|
|
5
|
-
vertex: undefined,
|
|
6
|
-
fragment: {
|
|
7
|
-
uniform: `
|
|
8
|
-
uniform sampler2D _input_; // main`,
|
|
9
|
-
mainInputTexture: "_input_",
|
|
10
|
-
mainFunctionName: "_copy_",
|
|
11
|
-
functions: [
|
|
12
|
-
{
|
|
13
|
-
name: "_copy_",
|
|
14
|
-
code: `
|
|
15
|
-
vec4 _copy_(vec2 vUV) {
|
|
16
|
-
return texture2D(_input_, vUV);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
`,
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* The uniform names for this shader, to be used in the shader binding so
|
|
26
|
-
* that the names are always in sync.
|
|
27
|
-
*/
|
|
28
|
-
export const uniforms = {
|
|
29
|
-
input: "input",
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=outputBlock.shader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputBlock.shader.js","sourceRoot":"","sources":["../../src/blockFoundation/outputBlock.shader.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IACxC,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE;QACN,OAAO,EAAE;+CAC8B;QACvC,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,QAAQ;QAC1B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;;;;;qBAKD;aACR;SACJ;KACJ;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,KAAK,EAAE,OAAO;CACjB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ThinEngine } from "@babylonjs/core/Engines/thinEngine";
|
|
2
|
-
import type { SmartFilter } from "../smartFilter";
|
|
3
|
-
import type { BaseBlock } from "../blockFoundation";
|
|
4
|
-
import type { SmartFilterDeserializer, ISerializedBlockV1 } from "../serialization";
|
|
5
|
-
/**
|
|
6
|
-
* An object which describes a block definition, as well as a factory for creating a new instance of the block or
|
|
7
|
-
* deserializing it
|
|
8
|
-
*/
|
|
9
|
-
export interface IBlockRegistration {
|
|
10
|
-
/**
|
|
11
|
-
* The block type of the block
|
|
12
|
-
*/
|
|
13
|
-
blockType: string;
|
|
14
|
-
/**
|
|
15
|
-
* Creates an instance of the block, either fresh or deserialized from a serialized block
|
|
16
|
-
* @param smartFilter - The smart filter to create the block for
|
|
17
|
-
* @param engine - The engine to use for creating blocks
|
|
18
|
-
* @param smartFilterDeserializer - The deserializer to use for deserializing blocks
|
|
19
|
-
* @param serializedBlock - The serialized block to deserialize, if any
|
|
20
|
-
* @returns - A promise for a new instance of the block
|
|
21
|
-
*/
|
|
22
|
-
factory?: (smartFilter: SmartFilter, engine: ThinEngine, smartFilterDeserializer: SmartFilterDeserializer, serializedBlock?: ISerializedBlockV1) => Promise<BaseBlock>;
|
|
23
|
-
/**
|
|
24
|
-
* The namespace of the block
|
|
25
|
-
*/
|
|
26
|
-
namespace: string;
|
|
27
|
-
/**
|
|
28
|
-
* A tooltip for the block if displayed in an editor, for instance
|
|
29
|
-
*/
|
|
30
|
-
tooltip: string;
|
|
31
|
-
/**
|
|
32
|
-
* If true, this represents a custom block (not one that was programmatically included)
|
|
33
|
-
*/
|
|
34
|
-
isCustom?: boolean;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=IBlockRegistration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBlockRegistration.d.ts","sourceRoot":"","sources":["../../src/blockRegistration/IBlockRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEpF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CACN,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,UAAU,EAClB,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,CAAC,EAAE,kBAAkB,KACnC,OAAO,CAAC,SAAS,CAAC,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBlockRegistration.js","sourceRoot":"","sources":["../../src/blockRegistration/IBlockRegistration.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { IBlockSerializerV1 } from "../serialization/v1/smartFilterSerialization.types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Any blocks that do not need to make use of ISerializedBlockV1.data can use the default serialization and
|
|
4
|
-
* should go in this list. If the serializer needs to store additional info in ISerializedBlockV1.data (e.g.
|
|
5
|
-
* webcam source name), then it should be registered in additionalBlockSerializers below.
|
|
6
|
-
*/
|
|
7
|
-
export declare const blocksUsingDefaultSerialization: string[];
|
|
8
|
-
/**
|
|
9
|
-
* Any blocks which require serializing more information than just the connections should be registered here.
|
|
10
|
-
* They should make use of the ISerializedBlockV1.data field to store this information.
|
|
11
|
-
*/
|
|
12
|
-
export declare const additionalBlockSerializers: IBlockSerializerV1[];
|
|
13
|
-
//# sourceMappingURL=blockSerializers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blockSerializers.d.ts","sourceRoot":"","sources":["../../src/blockRegistration/blockSerializers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAkBhG;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,EAenD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,EAI1D,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { blurBlockSerializer } from "../blocks/babylon/demo/effects/blurBlock.serializer.js";
|
|
2
|
-
import { directionalBlurBlockSerializer } from "../blocks/babylon/demo/effects/directionalBlurBlock.serializer.js";
|
|
3
|
-
import { compositionBlockSerializer } from "../blocks/babylon/demo/effects/compositionBlock.serializer.js";
|
|
4
|
-
import { blackAndWhiteBlockType, pixelateBlockType, exposureBlockType, contrastBlockType, desaturateBlockType, posterizeBlockType, kaleidoscopeBlockType, greenScreenBlockType, maskBlockType, particleBlockType, spritesheetBlockType, tintBlockType, premultiplyAlphaBlockType, wipeBlockType, } from "../blocks/blockTypes.js";
|
|
5
|
-
/**
|
|
6
|
-
* Any blocks that do not need to make use of ISerializedBlockV1.data can use the default serialization and
|
|
7
|
-
* should go in this list. If the serializer needs to store additional info in ISerializedBlockV1.data (e.g.
|
|
8
|
-
* webcam source name), then it should be registered in additionalBlockSerializers below.
|
|
9
|
-
*/
|
|
10
|
-
export const blocksUsingDefaultSerialization = [
|
|
11
|
-
blackAndWhiteBlockType,
|
|
12
|
-
pixelateBlockType,
|
|
13
|
-
exposureBlockType,
|
|
14
|
-
contrastBlockType,
|
|
15
|
-
desaturateBlockType,
|
|
16
|
-
posterizeBlockType,
|
|
17
|
-
kaleidoscopeBlockType,
|
|
18
|
-
greenScreenBlockType,
|
|
19
|
-
maskBlockType,
|
|
20
|
-
particleBlockType,
|
|
21
|
-
spritesheetBlockType,
|
|
22
|
-
tintBlockType,
|
|
23
|
-
premultiplyAlphaBlockType,
|
|
24
|
-
wipeBlockType,
|
|
25
|
-
];
|
|
26
|
-
/**
|
|
27
|
-
* Any blocks which require serializing more information than just the connections should be registered here.
|
|
28
|
-
* They should make use of the ISerializedBlockV1.data field to store this information.
|
|
29
|
-
*/
|
|
30
|
-
export const additionalBlockSerializers = [
|
|
31
|
-
blurBlockSerializer,
|
|
32
|
-
directionalBlurBlockSerializer,
|
|
33
|
-
compositionBlockSerializer,
|
|
34
|
-
];
|
|
35
|
-
//# sourceMappingURL=blockSerializers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blockSerializers.js","sourceRoot":"","sources":["../../src/blockRegistration/blockSerializers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,mEAAmE,CAAC;AACnH,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAE3G,OAAO,EACH,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,yBAAyB,EACzB,aAAa,GAChB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAa;IACrD,sBAAsB;IACtB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,aAAa;IACb,iBAAiB;IACjB,oBAAoB;IACpB,aAAa;IACb,yBAAyB;IACzB,aAAa;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAyB;IAC5D,mBAAmB;IACnB,8BAA8B;IAC9B,0BAA0B;CAC7B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { IBlockRegistration } from "./IBlockRegistration.js";
|
|
2
|
-
/**
|
|
3
|
-
* The list of block registrations.
|
|
4
|
-
*
|
|
5
|
-
* Important notes:
|
|
6
|
-
* 1. Do not import the block code directly in this file. Instead, use dynamic imports to ensure that the block code
|
|
7
|
-
* is only loaded when needed.
|
|
8
|
-
* 2. If the deserializer is trivial (doesn't require consulting the serializedBlock.data), it can be implemented here
|
|
9
|
-
* 3. If the deserializer is non-trivial (needs serializedBlock.data), implement it in a separate file alongside the block
|
|
10
|
-
* in the form blockClassName.deserializer.ts
|
|
11
|
-
*/
|
|
12
|
-
export declare const builtInBlockRegistrations: IBlockRegistration[];
|
|
13
|
-
//# sourceMappingURL=builtInBlockRegistrations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builtInBlockRegistrations.d.ts","sourceRoot":"","sources":["../../src/blockRegistration/builtInBlockRegistrations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AA+BlE;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,EA2VzD,CAAC"}
|