{ "argumentSchema": { "properties": { "code": { "default": "import { computed, Default, handler, NAME, pattern, UI, Writable } from \"commonfabric\";\n\ninterface Input {\n value: number | Default<0>;\n}\n\nconst increment = handler }>((_, state) => {\n state.value.set(state.value.get() + 1);\n});\n\nconst decrement = handler }>((_, state) => {\n state.value.set(state.value.get() - 1);\n});\n\nexport default pattern(({ value }) => {\n return {\n [NAME]: computed(() => `Simple counter: ${value}`),\n [UI]: (\n
\n -\n {value}\n +\n
\n ),\n value,\n };\n});\n", "type": "string" } }, "required": [ "code" ], "type": "object" }, "pattern": "compiler.tsx", "resultSchema": { "$defs": { "JSXElement": { "anyOf": [ { "$ref": "https://commonfabric.org/schemas/vnode.json" }, { "$ref": "#/$defs/UIRenderable" }, { "properties": {}, "type": "object" } ] }, "UIRenderable": { "properties": { "$UI": { "$ref": "https://commonfabric.org/schemas/vnode.json" } }, "required": [ "$UI" ], "type": "object" } }, "properties": { "$NAME": { "enum": [ "My First Compiler" ], "type": "string" }, "$UI": { "$ref": "#/$defs/JSXElement" }, "code": { "type": "string" }, "updateCode": { "asCell": [ "stream" ], "properties": { "code": { "type": "string" } }, "required": [ "code" ], "type": "object" }, "visit": { "asCell": [ "stream" ], "type": "unknown" } }, "required": [ "$NAME", "$UI", "code", "updateCode", "visit" ], "type": "object" } }