@blocklet/pages-kit-block-studio 0.1.31 → 0.1.32

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.
@@ -50,6 +50,7 @@ export function generateWrapperCode(_a) {
50
50
  import: './middleware.js',
51
51
  types: './middleware.d.ts',
52
52
  },
53
+ './data.json': './data.json',
53
54
  },
54
55
  }, null, 2);
55
56
  const client = `\
@@ -72,6 +73,8 @@ import { initPackResourceStates } from '@blocklet/pages-kit-inner-components/sit
72
73
  import { initUploaderRouter } from '@blocklet/pages-kit-block-studio/init-uploader-router';
73
74
  import { joinURL } from 'ufo';
74
75
 
76
+ import StateData from './data.json';
77
+
75
78
  const router = Router();
76
79
 
77
80
  router.use('/api/resources', initResourceRouter);
@@ -81,7 +84,7 @@ let tempStates: any[] = [];
81
84
  let allResourcesComponents: any[] = [];
82
85
 
83
86
  const PAGES_KIT_BLOCKLET_DID = 'z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o';
84
- const PROJECT_ID = '${project.id}';
87
+ export const PROJECT_ID = '${project.id}';
85
88
 
86
89
  initPackResourceStates(({ states }: any) => {
87
90
  allResourcesComponents = states.reduce((acc, { state }) => {
@@ -96,6 +99,8 @@ initPackResourceStates(({ states }: any) => {
96
99
  router.get('/api/pages', async (req, res) => {
97
100
  const { did, projectId, siteFrom } = req.query;
98
101
 
102
+ console.log('get state data', StateData);
103
+ return res.json(StateData.state);
99
104
  try {
100
105
  // Case 1: Using did
101
106
  if (did) {