From 43aba4852a7481802cbe6580a5734f2b32088cbe Mon Sep 17 00:00:00 2001 From: Christian Hugo Date: Fri, 20 Mar 2026 20:04:04 +0100 Subject: [PATCH 1/2] 0.1.7 --- main-code/index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main-code/index.js b/main-code/index.js index a3a0b36..1465873 100644 --- a/main-code/index.js +++ b/main-code/index.js @@ -43,8 +43,8 @@ const initMain = async () => { : `/plugins/public/react/${tenant}/${viewName}_remote.js` : // TODO get the version from the plugin, for now hardcoded in any release timestamp - ? `http://localhost/sc_plugins/public/react@0.1.6/${tenant}/${viewName}_${timestamp}/${viewName}_remote.js` - : `http://localhost/sc_plugins/public/react@0.1.6/${tenant}/${viewName}_remote.js`, + ? `http://localhost/sc_plugins/public/react@0.1.7/${tenant}/${viewName}_${timestamp}/${viewName}_remote.js` + : `http://localhost/sc_plugins/public/react@0.1.7/${tenant}/${viewName}_remote.js`, }); } diff --git a/package.json b/package.json index d8da964..3bc9277 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@saltcorn/react", - "version": "0.1.6", + "version": "0.1.7", "description": "integrate React components in your Saltcorn application", "main": "index.js", "scripts": { From 91c09bca10ebba24b241f8b51270e3cce17cdc1e Mon Sep 17 00:00:00 2001 From: Christian Hugo Date: Sat, 21 Mar 2026 18:57:53 +0100 Subject: [PATCH 2/2] generate-view prompt and post-create cb --- common.js | 8 -------- react_view.js | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/common.js b/common.js index 01bcb90..4f8837b 100644 --- a/common.js +++ b/common.js @@ -1,13 +1,5 @@ -const Workflow = require("@saltcorn/data/models/workflow"); -const Form = require("@saltcorn/data/models/form"); -const Table = require("@saltcorn/data/models/table"); const View = require("@saltcorn/data/models/view"); -const { div, script } = require("@saltcorn/markup/tags"); const { getState } = require("@saltcorn/data/db/state"); -const { - stateFieldsToWhere, - readState, -} = require("@saltcorn/data/plugin-helper"); const db = require("@saltcorn/data/db"); const { spawn } = require("child_process"); diff --git a/react_view.js b/react_view.js index af0bdb4..68dbccd 100644 --- a/react_view.js +++ b/react_view.js @@ -10,6 +10,7 @@ const { buildSafeViewName, buildAndUpdateView, handleUserCode, + reactViewSystemPrompt, } = require("./common"); const get_state_fields = () => []; @@ -152,5 +153,13 @@ module.exports = { configuration_workflow, run, routes: { build_user_code }, + copilot_generate_view_prompt: async () => reactViewSystemPrompt, + copilot_post_create: async ({ name, configuration }) => { + await buildAndUpdateView( + configuration.user_code || defaultUserCode(configuration.table_id), + configuration.build_mode || "production", + name + ); + }, table_optional: true, };