openxiangda 1.0.42 → 1.0.43
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/README.md +48 -0
- package/package.json +1 -1
- package/packages/sdk/dist/components/index.cjs +2 -0
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.d.mts +4 -1071
- package/packages/sdk/dist/components/index.d.ts +4 -1071
- package/packages/sdk/dist/components/index.mjs +2 -0
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +47836 -92
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.css +5313 -0
- package/packages/sdk/dist/runtime/index.css.map +1 -0
- package/packages/sdk/dist/runtime/index.d.mts +161 -1
- package/packages/sdk/dist/runtime/index.d.ts +161 -1
- package/packages/sdk/dist/runtime/index.mjs +47016 -102
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/types-U26h_FIh.d.mts +1073 -0
- package/packages/sdk/dist/types-U26h_FIh.d.ts +1073 -0
- package/templates/sy-lowcode-app-workspace/src/dev/App.tsx +780 -28
- package/templates/sy-lowcode-app-workspace/src/runtime/builtin-overrides.tsx +8 -0
- package/templates/sy-lowcode-app-workspace/tsconfig.app.json +17 -1
- package/templates/sy-lowcode-app-workspace/vite.config.ts +81 -28
package/README.md
CHANGED
|
@@ -93,6 +93,54 @@ Create a new publishable app workspace with `openxiangda workspace init <dir>`.
|
|
|
93
93
|
|
|
94
94
|
New OpenXiangda code pages and form custom pages publish with `cssIsolation: "none"` by default, so Tailwind utilities and normal Ant Design styles apply without a `.sy-app-workspace` prefix. Explicit `namespace` and `shadow` settings are kept only for legacy compatibility.
|
|
95
95
|
|
|
96
|
+
OpenXiangda workspaces include a lightweight runtime preview for new user pages. `/view` remains the user-facing URL prefix, but local development does not enter the legacy `sy-lowcode-view` workbench checks; the Vite dev host mounts `src/pages/*` directly and sends SDK requests through the configured service proxy.
|
|
97
|
+
|
|
98
|
+
```env
|
|
99
|
+
OPENXIANGDA_BASE_URL=https://dev-lowcode.example.com
|
|
100
|
+
OPENXIANGDA_APP_TYPE=APP_XXXX
|
|
101
|
+
OPENXIANGDA_DEV_HOST=myapp.local
|
|
102
|
+
OPENXIANGDA_DEV_PORT=5174
|
|
103
|
+
APP_SERVICE_PREFIX=/service
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm run dev
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
When `OPENXIANGDA_BASE_URL` or `APP_PLATFORM_URL` is set, the workspace Vite server proxies `/service/*` to the platform backend with `changeOrigin`, `cookieDomainRewrite: ""`, and `cookiePathRewrite: "/"`. This keeps local browser requests same-origin and lets HttpOnly `access_token` / `refresh_token` cookies be saved on the local dev domain.
|
|
111
|
+
|
|
112
|
+
The dev host also calls the backend runtime route resolver for the current `/view/...` URL. Workbench code-page routes select and mount the matching local `src/pages/<page>/index.tsx`; built-in routes such as form submit, detail, process detail, data list, and file preview render the SDK default pages directly instead of accidentally mounting the first local page.
|
|
113
|
+
|
|
114
|
+
Built-in route defaults come from the `openxiangda` SDK: `StandardFormPage`, `FormSubmitTemplate`, `FormDetailTemplate`, `ProcessDetailTemplate`, and `DataManagementList`. Workspaces can override whole built-in pages from `src/runtime/builtin-overrides.tsx`; exact `formUuid` entries win before the `*` fallback.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import type { BuiltinRouteOverrides } from "openxiangda/runtime"
|
|
118
|
+
|
|
119
|
+
export const runtimeRouteOverrides: BuiltinRouteOverrides = {
|
|
120
|
+
"form-submit": {
|
|
121
|
+
customer: CustomerSubmitPage,
|
|
122
|
+
"*": SubmitShell,
|
|
123
|
+
},
|
|
124
|
+
"form-detail": {},
|
|
125
|
+
"process-detail": {},
|
|
126
|
+
"data-manage-list": {},
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
AI / Playwright verification should use real user identity, not a bypass mode. The backend exposes `POST /openxiangda-api/v1/apps/:appType/verification-login-links` for platform admins to create a short-lived, single-use `loginUrl` for a target user and redirect URI. Playwright can open the returned URL directly; the backend writes cookies and redirects back to the local or tenant `/view/...` page. Test users can be created with `POST /openxiangda-api/v1/apps/:appType/test-users`; they use the `__ox_ai_test__:<appType>:<key>` ID prefix and are intended to be used through verification login links.
|
|
131
|
+
|
|
132
|
+
An independent production user shell can call `resolveBrowserRuntimeRoute()` from `openxiangda/runtime` first. It posts the current `/view/...` path to `/openxiangda-api/v1/apps/:appType/runtime/routes/resolve`; the backend classifies the route as `custom-page`, `builtin-route`, `legacy-fallback`, or `not-found`. Code pages return backend-authorized bootstrap data directly, so the shell can pass that to `mountBrowserPageRuntime()` or mount with `createBrowserPageContext()` without reusing the legacy view workbench logic. Built-in routes can be rendered with `BuiltinRouteRenderer`, which loads form schema through the same `/service` proxy and keeps backend permission checks authoritative.
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import { resolveBrowserRuntimeRoute } from "openxiangda/runtime"
|
|
136
|
+
|
|
137
|
+
const route = await resolveBrowserRuntimeRoute({
|
|
138
|
+
appType: "APP_XXXX",
|
|
139
|
+
path: window.location.pathname,
|
|
140
|
+
search: window.location.search,
|
|
141
|
+
})
|
|
142
|
+
```
|
|
143
|
+
|
|
96
144
|
Local workspace state is authoritative. If the current folder has no `.openxiangda/state.json` app binding, create a new app instead of searching the platform for a similar app name:
|
|
97
145
|
|
|
98
146
|
```bash
|
package/package.json
CHANGED
|
@@ -48407,6 +48407,7 @@ var DataManagementList = ({
|
|
|
48407
48407
|
appType,
|
|
48408
48408
|
formUuid,
|
|
48409
48409
|
formInstanceId: String(getRecordId(activeRecord)),
|
|
48410
|
+
api,
|
|
48410
48411
|
inDrawer: true
|
|
48411
48412
|
}
|
|
48412
48413
|
) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_antd39.Empty, { description: "\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u8BE6\u60C5\u6A21\u677F" })
|
|
@@ -48435,6 +48436,7 @@ var DataManagementList = ({
|
|
|
48435
48436
|
mode: "submit",
|
|
48436
48437
|
appType,
|
|
48437
48438
|
formUuid,
|
|
48439
|
+
api,
|
|
48438
48440
|
inDrawer: true,
|
|
48439
48441
|
onSubmitSuccess: () => {
|
|
48440
48442
|
setSubmitOpen(false);
|