@monkeyplus/flow 6.0.54 → 6.0.56

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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkeyplus/flow",
3
- "version": "6.0.54",
3
+ "version": "6.0.56",
4
4
  "description": "@monkeyplus/flow package-first runtime with Vite, Nitro, Vue and a workspace playground.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -7,7 +7,8 @@ import { localizeRoutePattern, normalizePath, toPublicRoute } from "../../src/ru
7
7
  function mergeHeadDefinitions(...heads) {
8
8
  const result = {};
9
9
  for (const head of heads) {
10
- if (!head) continue;
10
+ if (!head)
11
+ continue;
11
12
  for (const [key, value] of Object.entries(head)) {
12
13
  if (["meta", "link", "script", "style", "noscript"].includes(key)) {
13
14
  result[key] = [...result[key] || [], ...Array.isArray(value) ? value : []];
@@ -103,7 +103,7 @@ async function renderBody(page) {
103
103
  page: page.definition,
104
104
  context: page.context,
105
105
  head: page.head,
106
- seo: page.seo,
106
+ seo: page.head.seo,
107
107
  locale: page.locale,
108
108
  params: page.params,
109
109
  path: page.pathname
@@ -135,7 +135,7 @@ async function renderBody(page) {
135
135
  const app = createSSRApp(TemplateRoot);
136
136
  app.config.warnHandler = (msg, instance, trace) => {
137
137
  const cleanTrace = trace.split("\n").map((line) => {
138
- return line.length > 200 ? line.substring(0, 200) + " ... >" : line;
138
+ return line.length > 200 ? `${line.substring(0, 200)} ... >` : line;
139
139
  }).join("\n");
140
140
  console.warn(`[Vue warn]: ${msg}
141
141
  ${cleanTrace}`);
@@ -1,6 +1,6 @@
1
1
  export type { ContentDirectoryNode, ContentEntry, ContentFileNode, ContentTreeNode, } from '../../modules/content/query.ts';
2
2
  export type { FlowBootPayload } from '../runtime/boot.ts';
3
- export { useContext, useGlobal, useLocale, usePage, useSeo, useSharedContext, useUtils, useView, } from '../runtime/composables.ts';
3
+ export { useContext, useGlobal, useHead, useLocale, usePage, useSeo, useSharedContext, useUtils, useView, } from '../runtime/composables.ts';
4
4
  export { defineFlowConfig, defineFlowModule, resolveFlowConfig } from '../runtime/config.ts';
5
5
  export type { FlowConfig, UserFlowConfig, } from '../runtime/config.ts';
6
6
  export { useSchemaOrg } from '../runtime/head.ts';
@@ -1,6 +1,7 @@
1
1
  export {
2
2
  useContext,
3
3
  useGlobal,
4
+ useHead,
4
5
  useLocale,
5
6
  usePage,
6
7
  useSeo,
@@ -24,7 +24,7 @@ import {
24
24
  import { createFlowNitroConfig } from "./nitro.mjs";
25
25
  let schemaOrgImports = {};
26
26
  try {
27
- const pkg = await import("@unhead/schema-org-vue");
27
+ const pkg = await import("@unhead/schema-org/vue");
28
28
  schemaOrgImports = pkg.schemaOrgAutoImports || {};
29
29
  console.log("--- SCHEMA ORG IMPORTS LOADED ---", typeof schemaOrgImports, Array.isArray(schemaOrgImports));
30
30
  } catch (e) {
@@ -378,6 +378,7 @@ export function createFlowViteConfig(options = {}) {
378
378
  "useSchemaOrg",
379
379
  "useContext",
380
380
  "useSeo",
381
+ "useHead",
381
382
  "useUtils",
382
383
  "useSharedContext",
383
384
  "useGlobal",
@@ -1,6 +1,7 @@
1
1
  import type { FlowLocale, PageContextUtils, PageDefinition } from './pages.ts';
2
2
  export declare function useContext<T = any>(): T;
3
- export declare function useSeo<T = any>(): T;
3
+ export declare function useSeo(): any;
4
+ export declare function useHead<T = any>(): T;
4
5
  export declare function useUtils(): PageContextUtils;
5
6
  export declare function useSharedContext<T = any>(): T;
6
7
  export declare function useGlobal<T = any>(): T;
@@ -10,6 +10,10 @@ export function useSeo() {
10
10
  const ctx = inject("context", {});
11
11
  return ctx.seo || {};
12
12
  }
13
+ export function useHead() {
14
+ const ctx = inject("context", {});
15
+ return ctx.head || {};
16
+ }
13
17
  export function useUtils() {
14
18
  return inject("utils", {});
15
19
  }
@@ -1,4 +1,4 @@
1
- import { useSchemaOrg } from '@unhead/schema-org-vue';
1
+ import { useSchemaOrg } from '@unhead/schema-org/vue';
2
2
  import { useHead, useSeoMeta } from '@unhead/vue';
3
3
  export declare function getClientHead(): import("@unhead/vue").VueHeadClient<import("@unhead/vue").UseHeadInput<_Deprecated>, boolean>;
4
4
  export { useHead, useSchemaOrg, useSeoMeta };
@@ -1,5 +1,5 @@
1
1
  import { UnheadSchemaOrg } from "@unhead/schema-org";
2
- import { useSchemaOrg } from "@unhead/schema-org-vue";
2
+ import { useSchemaOrg } from "@unhead/schema-org/vue";
3
3
  import { useHead, useSeoMeta } from "@unhead/vue";
4
4
  import { createHead } from "@unhead/vue/client";
5
5
  const clientHead = createHead();
@@ -1,4 +1,4 @@
1
- import type { UseHeadInput } from '@unhead/vue';
1
+ import type { UseHeadInput, UseSeoMetaInput } from '@unhead/vue';
2
2
  export type MaybePromise<T> = T | Promise<T>;
3
3
  export interface FlowLocale {
4
4
  code: string;
@@ -36,7 +36,9 @@ export interface LegacySeoDefinition {
36
36
  */
37
37
  facebook?: boolean;
38
38
  }
39
- export type HeadDefinition = UseHeadInput & LegacySeoDefinition;
39
+ export type HeadDefinition = UseHeadInput & LegacySeoDefinition & {
40
+ seo: UseSeoMetaInput;
41
+ };
40
42
  /**
41
43
  * @deprecated Use HeadDefinition.
42
44
  */