openxiangda 1.0.34 → 1.0.36

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.
Files changed (60) hide show
  1. package/README.md +18 -0
  2. package/lib/cli.js +410 -1
  3. package/lib/workspace-init.js +1 -0
  4. package/openxiangda-skills/SKILL.md +5 -3
  5. package/openxiangda-skills/references/best-practices.md +11 -6
  6. package/openxiangda-skills/references/component-guide.md +10 -11
  7. package/openxiangda-skills/references/connector-resources.md +3 -0
  8. package/openxiangda-skills/references/data-views.md +217 -0
  9. package/openxiangda-skills/references/forms/component-registry.md +4 -3
  10. package/openxiangda-skills/references/forms/form-schema.md +31 -2
  11. package/openxiangda-skills/references/pages/page-sdk.md +43 -0
  12. package/openxiangda-skills/references/style-system.md +14 -18
  13. package/openxiangda-skills/references/troubleshooting.md +13 -13
  14. package/openxiangda-skills/references/workspace-state.md +9 -0
  15. package/openxiangda-skills/skills/openxiangda-form/SKILL.md +3 -3
  16. package/openxiangda-skills/skills/openxiangda-page/SKILL.md +2 -2
  17. package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +1 -1
  18. package/package.json +1 -1
  19. package/packages/sdk/dist/components/index.cjs +944 -765
  20. package/packages/sdk/dist/components/index.cjs.map +1 -1
  21. package/packages/sdk/dist/components/index.d.mts +18 -2
  22. package/packages/sdk/dist/components/index.d.ts +18 -2
  23. package/packages/sdk/dist/components/index.mjs +938 -761
  24. package/packages/sdk/dist/components/index.mjs.map +1 -1
  25. package/packages/sdk/dist/runtime/index.cjs +114 -30
  26. package/packages/sdk/dist/runtime/index.cjs.map +1 -1
  27. package/packages/sdk/dist/runtime/index.d.mts +18 -1
  28. package/packages/sdk/dist/runtime/index.d.ts +18 -1
  29. package/packages/sdk/dist/runtime/index.mjs +114 -30
  30. package/packages/sdk/dist/runtime/index.mjs.map +1 -1
  31. package/packages/sdk/dist/styles/antd-theme.cjs +11 -3
  32. package/packages/sdk/dist/styles/antd-theme.cjs.map +1 -1
  33. package/packages/sdk/dist/styles/antd-theme.d.mts +2 -1
  34. package/packages/sdk/dist/styles/antd-theme.d.ts +2 -1
  35. package/packages/sdk/dist/styles/antd-theme.mjs +11 -3
  36. package/packages/sdk/dist/styles/antd-theme.mjs.map +1 -1
  37. package/packages/sdk/dist/styles/tailwind-preset.cjs +0 -1
  38. package/packages/sdk/dist/styles/tailwind-preset.cjs.map +1 -1
  39. package/packages/sdk/dist/styles/tailwind-preset.d.mts +0 -1
  40. package/packages/sdk/dist/styles/tailwind-preset.d.ts +0 -1
  41. package/packages/sdk/dist/styles/tailwind-preset.mjs +0 -1
  42. package/packages/sdk/dist/styles/tailwind-preset.mjs.map +1 -1
  43. package/packages/sdk/dist/styles/tokens.css +1 -0
  44. package/packages/sdk/src/build-source/scripts/build-forms.mjs +135 -50
  45. package/packages/sdk/src/build-source/scripts/build-pages.mjs +37 -10
  46. package/packages/sdk/src/build-source/scripts/register.mjs +2 -0
  47. package/packages/sdk/src/build-source/scripts/utils/form-api.mjs +1 -0
  48. package/packages/sdk/src/build-source/scripts/utils/load-config.mjs +3 -2
  49. package/packages/sdk/src/build-source/scripts/utils/register-payload.test.ts +2 -1
  50. package/packages/sdk/src/build-source/scripts/utils/tailwind-config.mjs +9 -7
  51. package/packages/sdk/src/build-source/scripts/utils/tailwind-config.test.ts +6 -4
  52. package/packages/sdk/src/build-source/src/cli.mjs +17 -0
  53. package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +3 -3
  54. package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +4 -3
  55. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.test.ts +1 -1
  56. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/schema.ts +36 -18
  57. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/schema.ts +36 -18
  58. package/templates/sy-lowcode-app-workspace/postcss.config.cjs +0 -15
  59. package/templates/sy-lowcode-app-workspace/src/main.tsx +1 -12
  60. package/templates/sy-lowcode-app-workspace/src/shared/form-schema.ts +0 -1
@@ -315,6 +315,20 @@ interface FormAdvancedSearchParams {
315
315
  order?: SearchSortItem | SearchSortItem[];
316
316
  instanceStatus?: InstanceStatus;
317
317
  }
318
+ interface DataViewQueryParams {
319
+ appType?: string;
320
+ fields?: string[];
321
+ filters?: SearchExpression | string;
322
+ conditionType?: SearchLogic;
323
+ searchKeyWord?: string;
324
+ currentPage?: number;
325
+ pageSize?: number;
326
+ order?: SearchSortItem | SearchSortItem[];
327
+ }
328
+ interface DataViewQueryResult<TItem = unknown> extends PageListResult<TItem> {
329
+ pageSize: number;
330
+ lastRefreshedAt?: string | null;
331
+ }
318
332
  interface FormExportParams extends FormAdvancedSearchParams {
319
333
  exportAll?: "y" | "n";
320
334
  embedImages?: "y" | "n";
@@ -847,6 +861,9 @@ interface PageSdk {
847
861
  dataSource: {
848
862
  run<TResult = unknown, TRaw = TResult>(name: string, params?: Record<string, unknown>): Promise<PageApiResponse<TResult, TRaw>>;
849
863
  };
864
+ dataView: {
865
+ query<T = unknown>(code: string, params?: DataViewQueryParams): Promise<PageApiResponse<DataViewQueryResult<T>>>;
866
+ };
850
867
  notification: {
851
868
  sendByType<T = SendNotificationResult>(params: SendNotificationByTypeParams): Promise<PageApiResponse<T>>;
852
869
  batchSendByType<T = SendNotificationResult>(params: BatchSendNotificationByTypeParams): Promise<PageApiResponse<T>>;
@@ -931,4 +948,4 @@ declare const usePageRoute: () => PageRouteInfo;
931
948
 
932
949
  declare const usePageSdk: () => PageSdk;
933
950
 
934
- export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PreviewNotificationTemplateParams, type ProcessApproveAction, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RoleListParams, type RoleUsersParams, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createPageSdk, createReactPage, useCurrentUser, useDataSource, useFormViewPermissions, useMessage, useModal, useNavigation, usePageContext, usePageProps, usePageRoute, usePageSdk };
951
+ export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type DataViewQueryParams, type DataViewQueryResult, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PreviewNotificationTemplateParams, type ProcessApproveAction, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RoleListParams, type RoleUsersParams, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createPageSdk, createReactPage, useCurrentUser, useDataSource, useFormViewPermissions, useMessage, useModal, useNavigation, usePageContext, usePageProps, usePageRoute, usePageSdk };
@@ -1030,6 +1030,31 @@ var createPageSdk = (context) => {
1030
1030
  }
1031
1031
  })
1032
1032
  };
1033
+ const dataView = {
1034
+ query: (code, params = {}) => {
1035
+ const dataViewCode = String(code || "").trim();
1036
+ if (!dataViewCode) {
1037
+ throw new Error("\u6570\u636E\u89C6\u56FE code \u4E0D\u80FD\u4E3A\u7A7A");
1038
+ }
1039
+ return request({
1040
+ path: buildAppPath(
1041
+ context,
1042
+ params.appType,
1043
+ `/v1/data-views/${encodePathSegment(dataViewCode)}/query.json`
1044
+ ),
1045
+ method: "post",
1046
+ body: {
1047
+ fields: params.fields,
1048
+ filters: serializeSearchExpression(params.filters),
1049
+ conditionType: params.conditionType,
1050
+ searchKeyWord: params.searchKeyWord,
1051
+ currentPage: params.currentPage,
1052
+ pageSize: params.pageSize,
1053
+ order: Array.isArray(params.order) ? params.order : params.order ? [params.order] : void 0
1054
+ }
1055
+ });
1056
+ }
1057
+ };
1033
1058
  const notification = {
1034
1059
  sendByType: (params) => request({
1035
1060
  path: buildOpenXiangdaAppPath(
@@ -1093,6 +1118,7 @@ var createPageSdk = (context) => {
1093
1118
  permission,
1094
1119
  process,
1095
1120
  notification,
1121
+ dataView,
1096
1122
  dataSource: {
1097
1123
  run: async (name, params = {}) => {
1098
1124
  const descriptor = (context.page.dataSources || []).find(
@@ -1106,6 +1132,27 @@ var createPageSdk = (context) => {
1106
1132
  runtimeParams.formUuid || descriptor.formUuid || ""
1107
1133
  ).trim();
1108
1134
  switch (descriptor.type) {
1135
+ case "dataView.query": {
1136
+ const dataViewCode = String(
1137
+ runtimeParams.code || runtimeParams.dataViewCode || descriptor.code || descriptor.dataViewCode || descriptor.viewCode || descriptor.key || ""
1138
+ ).trim();
1139
+ const queryParams = {
1140
+ ...descriptor.params && typeof descriptor.params === "object" ? descriptor.params : {},
1141
+ ...runtimeParams,
1142
+ fields: runtimeParams.fields || descriptor.fields,
1143
+ filters: mergeSearchExpressions(
1144
+ descriptor.defaultFilter,
1145
+ runtimeParams.filters
1146
+ )
1147
+ };
1148
+ delete queryParams.code;
1149
+ delete queryParams.dataViewCode;
1150
+ delete queryParams.viewCode;
1151
+ return dataView.query(
1152
+ dataViewCode,
1153
+ queryParams
1154
+ );
1155
+ }
1109
1156
  case "form.list":
1110
1157
  return form.advancedSearch({
1111
1158
  ...runtimeParams,
@@ -1184,8 +1231,7 @@ var PageProvider = ({
1184
1231
  };
1185
1232
 
1186
1233
  // packages/sdk/src/styles/antd-theme.ts
1187
- var antdTheme = {
1188
- cssVar: { prefix: "sy-ant" },
1234
+ var baseTheme = {
1189
1235
  hashed: false,
1190
1236
  token: {
1191
1237
  colorPrimary: "#1677ff",
@@ -1213,6 +1259,14 @@ var antdTheme = {
1213
1259
  Card: { paddingLG: 24 }
1214
1260
  }
1215
1261
  };
1262
+ var antdTheme = {
1263
+ ...baseTheme,
1264
+ cssVar: { prefix: "ant" }
1265
+ };
1266
+ var legacyAntdTheme = {
1267
+ ...baseTheme,
1268
+ cssVar: { prefix: "sy-ant" }
1269
+ };
1216
1270
 
1217
1271
  // packages/sdk/src/runtime/react/createReactPage.tsx
1218
1272
  import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
@@ -1233,6 +1287,21 @@ var MESSAGE_METHODS = [
1233
1287
  var createRuntimeRoot = (el) => {
1234
1288
  return createRoot(el);
1235
1289
  };
1290
+ var normalizeCssIsolation = (value) => {
1291
+ if (value === "namespace" || value === "shadow") return value;
1292
+ return "none";
1293
+ };
1294
+ var usesLegacyCssIsolation = (cssIsolation) => cssIsolation === "namespace" || cssIsolation === "shadow";
1295
+ var getRuntimeCssIsolation = (context) => normalizeCssIsolation(context.page?.capabilities?.cssIsolation);
1296
+ var getAntdRuntimeOptions = (cssIsolation) => {
1297
+ const legacy = usesLegacyCssIsolation(cssIsolation);
1298
+ return {
1299
+ prefixCls: legacy ? "sy-ant" : "ant",
1300
+ iconPrefixCls: legacy ? "sy-anticon" : "anticon",
1301
+ messagePrefixCls: legacy ? "sy-ant-message" : "ant-message",
1302
+ theme: legacy ? legacyAntdTheme : antdTheme
1303
+ };
1304
+ };
1236
1305
  var isShadowRoot = (rootNode) => typeof ShadowRoot !== "undefined" && rootNode instanceof ShadowRoot;
1237
1306
  var getStyleContainer = (el) => {
1238
1307
  const rootNode = el.getRootNode?.();
@@ -1261,14 +1330,19 @@ var getRuntimeOverlayContainer = (el, portalContainer) => {
1261
1330
  getTargetContainer: () => getRuntimeRoot(el)
1262
1331
  };
1263
1332
  };
1264
- var createAntdConfig = (overlayContainer) => ({
1265
- locale: zhCN,
1266
- prefixCls: "sy-ant",
1267
- iconPrefixCls: "sy-anticon",
1268
- theme: antdTheme,
1269
- getPopupContainer: overlayContainer.getPopupContainer,
1270
- getTargetContainer: overlayContainer.getTargetContainer
1271
- });
1333
+ var createAntdConfig = (overlayContainer, cssIsolation) => {
1334
+ const antdOptions = getAntdRuntimeOptions(cssIsolation);
1335
+ return {
1336
+ locale: zhCN,
1337
+ prefixCls: antdOptions.prefixCls,
1338
+ iconPrefixCls: antdOptions.iconPrefixCls,
1339
+ theme: antdOptions.theme,
1340
+ ...usesLegacyCssIsolation(cssIsolation) ? {
1341
+ getPopupContainer: overlayContainer.getPopupContainer,
1342
+ getTargetContainer: overlayContainer.getTargetContainer
1343
+ } : {}
1344
+ };
1345
+ };
1272
1346
  var createPortalContainer = (el) => {
1273
1347
  const rootNode = el.getRootNode?.();
1274
1348
  const parent = isShadowRoot(rootNode) ? rootNode : el.ownerDocument?.body || document.body;
@@ -1318,11 +1392,12 @@ var registerAntdMessageApi = (api) => {
1318
1392
  }
1319
1393
  };
1320
1394
  };
1321
- var installRuntimePortalContainer = (el) => {
1395
+ var installRuntimePortalContainer = (el, cssIsolation) => {
1322
1396
  const globalScope = globalThis;
1323
- const portalContainer = createPortalContainer(el);
1397
+ const portalContainer = usesLegacyCssIsolation(cssIsolation) ? createPortalContainer(el) : null;
1324
1398
  const stack = Array.isArray(globalScope[PORTAL_CONTAINER_STACK_GLOBAL]) ? globalScope[PORTAL_CONTAINER_STACK_GLOBAL] : [];
1325
- stack.push(portalContainer);
1399
+ const stackTarget = portalContainer ?? el.ownerDocument?.body ?? document.body;
1400
+ stack.push(stackTarget);
1326
1401
  globalScope[PORTAL_CONTAINER_STACK_GLOBAL] = stack;
1327
1402
  globalScope[PORTAL_CONTAINER_RESOLVER_GLOBAL] = () => {
1328
1403
  for (let index = stack.length - 1; index >= 0; index -= 1) {
@@ -1336,42 +1411,43 @@ var installRuntimePortalContainer = (el) => {
1336
1411
  return {
1337
1412
  container: portalContainer,
1338
1413
  release: () => {
1339
- const position = stack.lastIndexOf(portalContainer);
1414
+ const position = stack.lastIndexOf(stackTarget);
1340
1415
  if (position >= 0) {
1341
1416
  stack.splice(position, 1);
1342
1417
  }
1343
- portalContainer.remove();
1418
+ portalContainer?.remove();
1344
1419
  }
1345
1420
  };
1346
1421
  };
1347
- var installAntdStaticHolder = (el, portalContainer) => {
1422
+ var installAntdStaticHolder = (el, portalContainer, cssIsolation) => {
1348
1423
  installAntdMessageProxy();
1424
+ const antdOptions = getAntdRuntimeOptions(cssIsolation);
1349
1425
  const getMessageContainer = () => {
1350
1426
  if (portalContainer?.isConnected) return portalContainer;
1351
- return getRuntimeRoot(el);
1427
+ return usesLegacyCssIsolation(cssIsolation) ? getRuntimeRoot(el) : document.body;
1352
1428
  };
1353
1429
  ConfigProvider.config({
1354
- prefixCls: "sy-ant",
1355
- iconPrefixCls: "sy-anticon",
1356
- theme: antdTheme,
1430
+ prefixCls: antdOptions.prefixCls,
1431
+ iconPrefixCls: antdOptions.iconPrefixCls,
1432
+ theme: antdOptions.theme,
1357
1433
  holderRender: (children) => {
1358
1434
  if (!el.isConnected) {
1359
1435
  return /* @__PURE__ */ jsx2(
1360
1436
  ConfigProvider,
1361
1437
  {
1362
- prefixCls: "sy-ant",
1363
- iconPrefixCls: "sy-anticon",
1364
- theme: antdTheme,
1438
+ prefixCls: antdOptions.prefixCls,
1439
+ iconPrefixCls: antdOptions.iconPrefixCls,
1440
+ theme: antdOptions.theme,
1365
1441
  children
1366
1442
  }
1367
1443
  );
1368
1444
  }
1369
1445
  const overlayContainer = getRuntimeOverlayContainer(el, portalContainer);
1370
- return /* @__PURE__ */ jsx2(StyleProvider, { hashPriority: "high", container: getStyleContainer(el), children: /* @__PURE__ */ jsx2(ConfigProvider, { ...createAntdConfig(overlayContainer), children }) });
1446
+ return /* @__PURE__ */ jsx2(StyleProvider, { hashPriority: "high", container: getStyleContainer(el), children: /* @__PURE__ */ jsx2(ConfigProvider, { ...createAntdConfig(overlayContainer, cssIsolation), children }) });
1371
1447
  }
1372
1448
  });
1373
1449
  message.config({
1374
- prefixCls: "sy-ant-message",
1450
+ prefixCls: antdOptions.messagePrefixCls,
1375
1451
  getContainer: getMessageContainer
1376
1452
  });
1377
1453
  };
@@ -1389,20 +1465,27 @@ var createReactPage = (AppComponent) => {
1389
1465
  let currentContainer = null;
1390
1466
  let releasePortalContainer = null;
1391
1467
  let portalContainer = null;
1468
+ let currentCssIsolation = null;
1392
1469
  const render = (el, context) => {
1393
- el.classList.add(NAMESPACE_ROOT_CLASS);
1394
- if (!root || currentContainer !== el || !portalContainer?.isConnected) {
1470
+ const cssIsolation = getRuntimeCssIsolation(context);
1471
+ if (usesLegacyCssIsolation(cssIsolation)) {
1472
+ el.classList.add(NAMESPACE_ROOT_CLASS);
1473
+ } else {
1474
+ el.classList.remove(NAMESPACE_ROOT_CLASS);
1475
+ }
1476
+ if (!root || currentContainer !== el || currentCssIsolation !== cssIsolation || usesLegacyCssIsolation(cssIsolation) && !portalContainer?.isConnected) {
1395
1477
  root?.unmount();
1396
1478
  releasePortalContainer?.();
1397
1479
  root = createRuntimeRoot(el);
1398
1480
  currentContainer = el;
1399
- const portalHandle = installRuntimePortalContainer(el);
1481
+ currentCssIsolation = cssIsolation;
1482
+ const portalHandle = installRuntimePortalContainer(el, cssIsolation);
1400
1483
  portalContainer = portalHandle.container;
1401
1484
  releasePortalContainer = portalHandle.release;
1402
1485
  }
1403
1486
  const overlayContainer = getRuntimeOverlayContainer(el, portalContainer);
1404
- installAntdStaticHolder(el, portalContainer);
1405
- const antdConfig = createAntdConfig(overlayContainer);
1487
+ installAntdStaticHolder(el, portalContainer, cssIsolation);
1488
+ const antdConfig = createAntdConfig(overlayContainer, cssIsolation);
1406
1489
  root.render(
1407
1490
  /* @__PURE__ */ jsx2(StyleProvider, { hashPriority: "high", container: getStyleContainer(el), children: /* @__PURE__ */ jsx2(ConfigProvider, { ...antdConfig, children: /* @__PURE__ */ jsx2(AntdApp, { children: /* @__PURE__ */ jsx2(RuntimeMessageBridge, { children: /* @__PURE__ */ jsx2(PageProvider, { context, children: /* @__PURE__ */ jsx2(AppComponent, {}) }) }) }) }) })
1408
1491
  );
@@ -1421,6 +1504,7 @@ var createReactPage = (AppComponent) => {
1421
1504
  currentContainer = null;
1422
1505
  releasePortalContainer = null;
1423
1506
  portalContainer = null;
1507
+ currentCssIsolation = null;
1424
1508
  }
1425
1509
  };
1426
1510
  };