@blocklet/pages-kit-block-studio 0.5.30 → 0.5.31

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.
@@ -40,6 +40,7 @@ exports.generatePageDataTypesWithZod = generatePageDataTypesWithZod;
40
40
  exports.generatePropertiesTypesWithZod = generatePropertiesTypesWithZod;
41
41
  exports.generatePageDataZodToAgent = generatePageDataZodToAgent;
42
42
  // 导入 Zod 工具集
43
+ const page_model_1 = require("@blocklet/pages-kit/utils/page-model");
43
44
  const property_1 = require("@blocklet/pages-kit/utils/property");
44
45
  const zod_1 = require("zod");
45
46
  const block_props_utils_1 = require("./block-props-utils");
@@ -347,8 +348,7 @@ function generatePageDataJsonSchemasWithZod(state) {
347
348
  .replace(/[^a-zA-Z0-9]/g, '')}Data`;
348
349
  // 收集所有 section 的配置信息
349
350
  const sectionProperties = {};
350
- page.sectionIds.forEach((sectionId) => {
351
- const section = page.sections[sectionId];
351
+ (0, page_model_1.getPageAllSections)(page)?.forEach((section) => {
352
352
  if (!section)
353
353
  return;
354
354
  const sectionName = section.name || section.id;
@@ -433,9 +433,8 @@ function generatePageDataTypesWithZod(state) {
433
433
  .join('')
434
434
  .replace(/[^a-zA-Z0-9]/g, '')}Data`;
435
435
  // 收集所有 section 的配置信息
436
- const sectionTypes = page.sectionIds
437
- .map((sectionId) => {
438
- const section = page.sections[sectionId];
436
+ const sectionTypes = (0, page_model_1.getPageAllSections)(page)
437
+ ?.map((section) => {
439
438
  if (!section)
440
439
  return null;
441
440
  // 嵌套组件
@@ -510,8 +509,7 @@ function generatePageDataZodToAgent(state, pageId) {
510
509
  }
511
510
  const sectionSchemas = {};
512
511
  // 收集页面所有section的配置信息
513
- page.sectionIds.forEach((sectionId) => {
514
- const section = page.sections[sectionId];
512
+ (0, page_model_1.getPageAllSections)(page)?.forEach((section) => {
515
513
  if (!section)
516
514
  return;
517
515
  const sectionName = section.name || section.id;