@monkeyplus/flow 5.0.0-rc.127 → 5.0.0-rc.128

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.
@@ -37,18 +37,15 @@ export default eventHandler(async (event) => {
37
37
  const isDynamic = !!Object.keys(params || {});
38
38
  const contextPage = {
39
39
  chunks,
40
- locale
40
+ locale,
41
+ _post: {}
41
42
  };
42
43
  const contextInject = {};
43
44
  const utils = Object.assign({ getLocale: () => locale, injectContext: (key, value) => contextInject[key] = value, defineCachedFunction: event.context.defineCachedFunction }, flow.app.utils);
44
- const contextHooks = {
45
- _post: {}
46
- };
47
45
  if (event.node.req.method.toLowerCase() === "post") {
48
46
  const body = await readBody(event);
49
- contextHooks._post = body;
47
+ contextPage._post = body;
50
48
  }
51
- await flow.callHook("page:context", { localeCode: locale.code, page: pageName }, utils, contextHooks);
52
49
  templateContext.url = url;
53
50
  templateContext.baseURL = flow.$config.app.baseURL;
54
51
  const pageObject = {
@@ -75,18 +72,17 @@ export default eventHandler(async (event) => {
75
72
  templateContext[page.dynamic.assign] = dynamicPage.context;
76
73
  contextPage.dynamic = dynamicPage;
77
74
  }
75
+ await flow.callHook("page:context", { localeCode: locale.code, page: pageName }, utils, contextPage);
78
76
  templateContext.seo = {};
79
77
  const sharedContext = await utils.getSharedContext({
80
- ...contextHooks,
81
78
  ...contextPage,
82
79
  utils
83
80
  });
84
81
  templateContext.sharedContext = sharedContext || {};
85
82
  templateContext.utils = utils;
86
- templateContext.seo = await normalizeCall(page?.seo, { ...contextHooks, ...contextPage, utils, sharedContext });
87
- const contexData = await page.context?.({ ...contextHooks, ...contextPage, utils, sharedContext }) || {};
83
+ templateContext.seo = await normalizeCall(page?.seo, { ...contextPage, utils, sharedContext });
84
+ const contexData = await page.context?.({ ...contextPage, utils, sharedContext }) || {};
88
85
  templateContext.context = {
89
- ...contextHooks,
90
86
  ...contexData
91
87
  };
92
88
  await flow.callHook("page:scripts", scripts, templateContext);
package/dist/index.mjs CHANGED
@@ -24,7 +24,7 @@ import replace from '@rollup/plugin-replace';
24
24
  import { resolveTSConfig } from 'pkg-types';
25
25
  import fse from 'fs-extra';
26
26
 
27
- const version = "5.0.0-rc.127";
27
+ const version = "5.0.0-rc.128";
28
28
 
29
29
  let _distDir = dirname(fileURLToPath(import.meta.url));
30
30
  if (_distDir.match(/(chunks|shared)$/))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkeyplus/flow",
3
- "version": "5.0.0-rc.127",
3
+ "version": "5.0.0-rc.128",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -25,9 +25,9 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@monkeyplus/flow-cli": "5.0.0-rc.127",
29
- "@monkeyplus/flow-kit": "5.0.0-rc.127",
30
- "@monkeyplus/flow-schema": "5.0.0-rc.127",
28
+ "@monkeyplus/flow-cli": "5.0.0-rc.128",
29
+ "@monkeyplus/flow-kit": "5.0.0-rc.128",
30
+ "@monkeyplus/flow-schema": "5.0.0-rc.128",
31
31
  "@rollup/plugin-replace": "^4.0.0",
32
32
  "@vueuse/head": "^1.0.16",
33
33
  "c12": "^1.0.1",