@unhead/schema-org 1.10.4 → 1.11.0-beta.2

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.
package/dist/vue.d.cts CHANGED
@@ -1,9 +1,9 @@
1
+ import { P as PostalAddress, c as AggregateOffer, d as AggregateRating, e as Article, B as BreadcrumbList, C as Comment, E as Event, F as FoodEstablishment, V as VirtualLocation, f as Place, H as HowTo, g as HowToStep, I as ImageObject, J as JobPosting, L as LocalBusiness, O as Offer, h as OpeningHoursSpecification, i as Organization, j as Person, k as Product, Q as Question, l as Recipe, m as Review, n as VideoObject, W as WebPage, o as WebSite, p as Book, q as Course, r as ItemList, s as ListItem, t as Movie, u as SearchAction, v as ReadAction, w as SoftwareApp, x as BookEdition, A as Arrayable, T as Thing } from './shared/schema-org.d2b719c3.cjs';
2
+ export { M as MetaInput, bc as PluginSchemaOrg, bd as SchemaOrgUnheadPlugin, bj as UserConfig } from './shared/schema-org.d2b719c3.cjs';
1
3
  import { ComponentResolver } from 'unplugin-vue-components';
2
- import * as _unhead_vue from '@unhead/vue';
3
- import { MaybeComputedRefOrPromise } from '@unhead/vue';
4
- import { P as PostalAddress, c as AggregateOffer, d as AggregateRating, e as Article, B as BreadcrumbList, C as Comment, E as Event, F as FoodEstablishment, V as VirtualLocation, f as Place, H as HowTo, g as HowToStep, I as ImageObject, J as JobPosting, L as LocalBusiness, O as Offer, h as OpeningHoursSpecification, i as Organization, j as Person, k as Product, Q as Question, l as Recipe, m as Review, n as VideoObject, W as WebPage, o as WebSite, p as Book, q as Course, r as ItemList, s as ListItem, t as Movie, u as SearchAction, v as ReadAction, w as SoftwareApp, x as BookEdition, A as Arrayable, T as Thing } from './shared/schema-org.397d7cf9.cjs';
5
- export { M as MetaInput, bc as PluginSchemaOrg, bd as SchemaOrgUnheadPlugin, bj as UserConfig } from './shared/schema-org.397d7cf9.cjs';
6
4
  import { defineComponent } from 'vue';
5
+ import * as _unhead_vue from '@unhead/vue';
6
+ import { MaybeComputedRefOrFalsy } from '@unhead/vue';
7
7
  import '@unhead/schema';
8
8
 
9
9
  interface SchemaOrgResolverOptions {
@@ -22,8 +22,33 @@ declare const schemaOrgAutoImports: {
22
22
  declare const schemaOrgComponents: string[];
23
23
  declare function SchemaOrgResolver(options?: SchemaOrgResolverOptions): ComponentResolver;
24
24
 
25
+ declare function defineSchemaOrgComponent(name: string, defineFn: (input: any) => any): ReturnType<typeof defineComponent>;
26
+ declare const SchemaOrgArticle: any;
27
+ declare const SchemaOrgBreadcrumb: any;
28
+ declare const SchemaOrgComment: any;
29
+ declare const SchemaOrgEvent: any;
30
+ declare const SchemaOrgFoodEstablishment: any;
31
+ declare const SchemaOrgHowTo: any;
32
+ declare const SchemaOrgImage: any;
33
+ declare const SchemaOrgJobPosting: any;
34
+ declare const SchemaOrgLocalBusiness: any;
35
+ declare const SchemaOrgOrganization: any;
36
+ declare const SchemaOrgPerson: any;
37
+ declare const SchemaOrgProduct: any;
38
+ declare const SchemaOrgQuestion: any;
39
+ declare const SchemaOrgRecipe: any;
40
+ declare const SchemaOrgReview: any;
41
+ declare const SchemaOrgVideo: any;
42
+ declare const SchemaOrgWebPage: any;
43
+ declare const SchemaOrgWebSite: any;
44
+ declare const SchemaOrgMovie: any;
45
+ declare const SchemaOrgCourse: any;
46
+ declare const SchemaOrgItemList: any;
47
+ declare const SchemaOrgBook: any;
48
+ declare const SchemaOrgSoftwareApp: any;
49
+
25
50
  type DeepMaybeRef<T> = {
26
- [key in keyof T]?: MaybeComputedRefOrPromise<T[key]>;
51
+ [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
27
52
  };
28
53
  declare function defineAddress<T extends Record<string, any>>(input?: DeepMaybeRef<PostalAddress & T>): DeepMaybeRef<PostalAddress & T>;
29
54
  declare function defineAggregateOffer<T extends Record<string, any>>(input?: DeepMaybeRef<AggregateOffer & T>): DeepMaybeRef<AggregateOffer & T>;
@@ -67,29 +92,4 @@ declare function useSchemaOrg(input: UseSchemaOrgInput): void | _unhead_vue.Acti
67
92
  };
68
93
  }>>;
69
94
 
70
- declare function defineSchemaOrgComponent(name: string, defineFn: (input: any) => any): ReturnType<typeof defineComponent>;
71
- declare const SchemaOrgArticle: any;
72
- declare const SchemaOrgBreadcrumb: any;
73
- declare const SchemaOrgComment: any;
74
- declare const SchemaOrgEvent: any;
75
- declare const SchemaOrgFoodEstablishment: any;
76
- declare const SchemaOrgHowTo: any;
77
- declare const SchemaOrgImage: any;
78
- declare const SchemaOrgJobPosting: any;
79
- declare const SchemaOrgLocalBusiness: any;
80
- declare const SchemaOrgOrganization: any;
81
- declare const SchemaOrgPerson: any;
82
- declare const SchemaOrgProduct: any;
83
- declare const SchemaOrgQuestion: any;
84
- declare const SchemaOrgRecipe: any;
85
- declare const SchemaOrgReview: any;
86
- declare const SchemaOrgVideo: any;
87
- declare const SchemaOrgWebPage: any;
88
- declare const SchemaOrgWebSite: any;
89
- declare const SchemaOrgMovie: any;
90
- declare const SchemaOrgCourse: any;
91
- declare const SchemaOrgItemList: any;
92
- declare const SchemaOrgBook: any;
93
- declare const SchemaOrgSoftwareApp: any;
94
-
95
95
  export { type DeepMaybeRef, SchemaOrgArticle, SchemaOrgBook, SchemaOrgBreadcrumb, SchemaOrgComment, SchemaOrgCourse, SchemaOrgEvent, SchemaOrgFoodEstablishment, SchemaOrgHowTo, SchemaOrgImage, SchemaOrgItemList, SchemaOrgJobPosting, SchemaOrgLocalBusiness, SchemaOrgMovie, SchemaOrgOrganization, SchemaOrgPerson, SchemaOrgProduct, SchemaOrgQuestion, SchemaOrgRecipe, SchemaOrgResolver, type SchemaOrgResolverOptions, SchemaOrgReview, SchemaOrgSoftwareApp, SchemaOrgVideo, SchemaOrgWebPage, SchemaOrgWebSite, type UseSchemaOrgInput, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgComponent, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, schemaAutoImports, schemaOrgAutoImports, schemaOrgComponents, useSchemaOrg };
package/dist/vue.d.mts CHANGED
@@ -1,9 +1,9 @@
1
+ import { P as PostalAddress, c as AggregateOffer, d as AggregateRating, e as Article, B as BreadcrumbList, C as Comment, E as Event, F as FoodEstablishment, V as VirtualLocation, f as Place, H as HowTo, g as HowToStep, I as ImageObject, J as JobPosting, L as LocalBusiness, O as Offer, h as OpeningHoursSpecification, i as Organization, j as Person, k as Product, Q as Question, l as Recipe, m as Review, n as VideoObject, W as WebPage, o as WebSite, p as Book, q as Course, r as ItemList, s as ListItem, t as Movie, u as SearchAction, v as ReadAction, w as SoftwareApp, x as BookEdition, A as Arrayable, T as Thing } from './shared/schema-org.d2b719c3.mjs';
2
+ export { M as MetaInput, bc as PluginSchemaOrg, bd as SchemaOrgUnheadPlugin, bj as UserConfig } from './shared/schema-org.d2b719c3.mjs';
1
3
  import { ComponentResolver } from 'unplugin-vue-components';
2
- import * as _unhead_vue from '@unhead/vue';
3
- import { MaybeComputedRefOrPromise } from '@unhead/vue';
4
- import { P as PostalAddress, c as AggregateOffer, d as AggregateRating, e as Article, B as BreadcrumbList, C as Comment, E as Event, F as FoodEstablishment, V as VirtualLocation, f as Place, H as HowTo, g as HowToStep, I as ImageObject, J as JobPosting, L as LocalBusiness, O as Offer, h as OpeningHoursSpecification, i as Organization, j as Person, k as Product, Q as Question, l as Recipe, m as Review, n as VideoObject, W as WebPage, o as WebSite, p as Book, q as Course, r as ItemList, s as ListItem, t as Movie, u as SearchAction, v as ReadAction, w as SoftwareApp, x as BookEdition, A as Arrayable, T as Thing } from './shared/schema-org.397d7cf9.mjs';
5
- export { M as MetaInput, bc as PluginSchemaOrg, bd as SchemaOrgUnheadPlugin, bj as UserConfig } from './shared/schema-org.397d7cf9.mjs';
6
4
  import { defineComponent } from 'vue';
5
+ import * as _unhead_vue from '@unhead/vue';
6
+ import { MaybeComputedRefOrFalsy } from '@unhead/vue';
7
7
  import '@unhead/schema';
8
8
 
9
9
  interface SchemaOrgResolverOptions {
@@ -22,8 +22,33 @@ declare const schemaOrgAutoImports: {
22
22
  declare const schemaOrgComponents: string[];
23
23
  declare function SchemaOrgResolver(options?: SchemaOrgResolverOptions): ComponentResolver;
24
24
 
25
+ declare function defineSchemaOrgComponent(name: string, defineFn: (input: any) => any): ReturnType<typeof defineComponent>;
26
+ declare const SchemaOrgArticle: any;
27
+ declare const SchemaOrgBreadcrumb: any;
28
+ declare const SchemaOrgComment: any;
29
+ declare const SchemaOrgEvent: any;
30
+ declare const SchemaOrgFoodEstablishment: any;
31
+ declare const SchemaOrgHowTo: any;
32
+ declare const SchemaOrgImage: any;
33
+ declare const SchemaOrgJobPosting: any;
34
+ declare const SchemaOrgLocalBusiness: any;
35
+ declare const SchemaOrgOrganization: any;
36
+ declare const SchemaOrgPerson: any;
37
+ declare const SchemaOrgProduct: any;
38
+ declare const SchemaOrgQuestion: any;
39
+ declare const SchemaOrgRecipe: any;
40
+ declare const SchemaOrgReview: any;
41
+ declare const SchemaOrgVideo: any;
42
+ declare const SchemaOrgWebPage: any;
43
+ declare const SchemaOrgWebSite: any;
44
+ declare const SchemaOrgMovie: any;
45
+ declare const SchemaOrgCourse: any;
46
+ declare const SchemaOrgItemList: any;
47
+ declare const SchemaOrgBook: any;
48
+ declare const SchemaOrgSoftwareApp: any;
49
+
25
50
  type DeepMaybeRef<T> = {
26
- [key in keyof T]?: MaybeComputedRefOrPromise<T[key]>;
51
+ [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
27
52
  };
28
53
  declare function defineAddress<T extends Record<string, any>>(input?: DeepMaybeRef<PostalAddress & T>): DeepMaybeRef<PostalAddress & T>;
29
54
  declare function defineAggregateOffer<T extends Record<string, any>>(input?: DeepMaybeRef<AggregateOffer & T>): DeepMaybeRef<AggregateOffer & T>;
@@ -67,29 +92,4 @@ declare function useSchemaOrg(input: UseSchemaOrgInput): void | _unhead_vue.Acti
67
92
  };
68
93
  }>>;
69
94
 
70
- declare function defineSchemaOrgComponent(name: string, defineFn: (input: any) => any): ReturnType<typeof defineComponent>;
71
- declare const SchemaOrgArticle: any;
72
- declare const SchemaOrgBreadcrumb: any;
73
- declare const SchemaOrgComment: any;
74
- declare const SchemaOrgEvent: any;
75
- declare const SchemaOrgFoodEstablishment: any;
76
- declare const SchemaOrgHowTo: any;
77
- declare const SchemaOrgImage: any;
78
- declare const SchemaOrgJobPosting: any;
79
- declare const SchemaOrgLocalBusiness: any;
80
- declare const SchemaOrgOrganization: any;
81
- declare const SchemaOrgPerson: any;
82
- declare const SchemaOrgProduct: any;
83
- declare const SchemaOrgQuestion: any;
84
- declare const SchemaOrgRecipe: any;
85
- declare const SchemaOrgReview: any;
86
- declare const SchemaOrgVideo: any;
87
- declare const SchemaOrgWebPage: any;
88
- declare const SchemaOrgWebSite: any;
89
- declare const SchemaOrgMovie: any;
90
- declare const SchemaOrgCourse: any;
91
- declare const SchemaOrgItemList: any;
92
- declare const SchemaOrgBook: any;
93
- declare const SchemaOrgSoftwareApp: any;
94
-
95
95
  export { type DeepMaybeRef, SchemaOrgArticle, SchemaOrgBook, SchemaOrgBreadcrumb, SchemaOrgComment, SchemaOrgCourse, SchemaOrgEvent, SchemaOrgFoodEstablishment, SchemaOrgHowTo, SchemaOrgImage, SchemaOrgItemList, SchemaOrgJobPosting, SchemaOrgLocalBusiness, SchemaOrgMovie, SchemaOrgOrganization, SchemaOrgPerson, SchemaOrgProduct, SchemaOrgQuestion, SchemaOrgRecipe, SchemaOrgResolver, type SchemaOrgResolverOptions, SchemaOrgReview, SchemaOrgSoftwareApp, SchemaOrgVideo, SchemaOrgWebPage, SchemaOrgWebSite, type UseSchemaOrgInput, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgComponent, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, schemaAutoImports, schemaOrgAutoImports, schemaOrgComponents, useSchemaOrg };
package/dist/vue.d.ts CHANGED
@@ -1,9 +1,9 @@
1
+ import { P as PostalAddress, c as AggregateOffer, d as AggregateRating, e as Article, B as BreadcrumbList, C as Comment, E as Event, F as FoodEstablishment, V as VirtualLocation, f as Place, H as HowTo, g as HowToStep, I as ImageObject, J as JobPosting, L as LocalBusiness, O as Offer, h as OpeningHoursSpecification, i as Organization, j as Person, k as Product, Q as Question, l as Recipe, m as Review, n as VideoObject, W as WebPage, o as WebSite, p as Book, q as Course, r as ItemList, s as ListItem, t as Movie, u as SearchAction, v as ReadAction, w as SoftwareApp, x as BookEdition, A as Arrayable, T as Thing } from './shared/schema-org.d2b719c3.js';
2
+ export { M as MetaInput, bc as PluginSchemaOrg, bd as SchemaOrgUnheadPlugin, bj as UserConfig } from './shared/schema-org.d2b719c3.js';
1
3
  import { ComponentResolver } from 'unplugin-vue-components';
2
- import * as _unhead_vue from '@unhead/vue';
3
- import { MaybeComputedRefOrPromise } from '@unhead/vue';
4
- import { P as PostalAddress, c as AggregateOffer, d as AggregateRating, e as Article, B as BreadcrumbList, C as Comment, E as Event, F as FoodEstablishment, V as VirtualLocation, f as Place, H as HowTo, g as HowToStep, I as ImageObject, J as JobPosting, L as LocalBusiness, O as Offer, h as OpeningHoursSpecification, i as Organization, j as Person, k as Product, Q as Question, l as Recipe, m as Review, n as VideoObject, W as WebPage, o as WebSite, p as Book, q as Course, r as ItemList, s as ListItem, t as Movie, u as SearchAction, v as ReadAction, w as SoftwareApp, x as BookEdition, A as Arrayable, T as Thing } from './shared/schema-org.397d7cf9.js';
5
- export { M as MetaInput, bc as PluginSchemaOrg, bd as SchemaOrgUnheadPlugin, bj as UserConfig } from './shared/schema-org.397d7cf9.js';
6
4
  import { defineComponent } from 'vue';
5
+ import * as _unhead_vue from '@unhead/vue';
6
+ import { MaybeComputedRefOrFalsy } from '@unhead/vue';
7
7
  import '@unhead/schema';
8
8
 
9
9
  interface SchemaOrgResolverOptions {
@@ -22,8 +22,33 @@ declare const schemaOrgAutoImports: {
22
22
  declare const schemaOrgComponents: string[];
23
23
  declare function SchemaOrgResolver(options?: SchemaOrgResolverOptions): ComponentResolver;
24
24
 
25
+ declare function defineSchemaOrgComponent(name: string, defineFn: (input: any) => any): ReturnType<typeof defineComponent>;
26
+ declare const SchemaOrgArticle: any;
27
+ declare const SchemaOrgBreadcrumb: any;
28
+ declare const SchemaOrgComment: any;
29
+ declare const SchemaOrgEvent: any;
30
+ declare const SchemaOrgFoodEstablishment: any;
31
+ declare const SchemaOrgHowTo: any;
32
+ declare const SchemaOrgImage: any;
33
+ declare const SchemaOrgJobPosting: any;
34
+ declare const SchemaOrgLocalBusiness: any;
35
+ declare const SchemaOrgOrganization: any;
36
+ declare const SchemaOrgPerson: any;
37
+ declare const SchemaOrgProduct: any;
38
+ declare const SchemaOrgQuestion: any;
39
+ declare const SchemaOrgRecipe: any;
40
+ declare const SchemaOrgReview: any;
41
+ declare const SchemaOrgVideo: any;
42
+ declare const SchemaOrgWebPage: any;
43
+ declare const SchemaOrgWebSite: any;
44
+ declare const SchemaOrgMovie: any;
45
+ declare const SchemaOrgCourse: any;
46
+ declare const SchemaOrgItemList: any;
47
+ declare const SchemaOrgBook: any;
48
+ declare const SchemaOrgSoftwareApp: any;
49
+
25
50
  type DeepMaybeRef<T> = {
26
- [key in keyof T]?: MaybeComputedRefOrPromise<T[key]>;
51
+ [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
27
52
  };
28
53
  declare function defineAddress<T extends Record<string, any>>(input?: DeepMaybeRef<PostalAddress & T>): DeepMaybeRef<PostalAddress & T>;
29
54
  declare function defineAggregateOffer<T extends Record<string, any>>(input?: DeepMaybeRef<AggregateOffer & T>): DeepMaybeRef<AggregateOffer & T>;
@@ -67,29 +92,4 @@ declare function useSchemaOrg(input: UseSchemaOrgInput): void | _unhead_vue.Acti
67
92
  };
68
93
  }>>;
69
94
 
70
- declare function defineSchemaOrgComponent(name: string, defineFn: (input: any) => any): ReturnType<typeof defineComponent>;
71
- declare const SchemaOrgArticle: any;
72
- declare const SchemaOrgBreadcrumb: any;
73
- declare const SchemaOrgComment: any;
74
- declare const SchemaOrgEvent: any;
75
- declare const SchemaOrgFoodEstablishment: any;
76
- declare const SchemaOrgHowTo: any;
77
- declare const SchemaOrgImage: any;
78
- declare const SchemaOrgJobPosting: any;
79
- declare const SchemaOrgLocalBusiness: any;
80
- declare const SchemaOrgOrganization: any;
81
- declare const SchemaOrgPerson: any;
82
- declare const SchemaOrgProduct: any;
83
- declare const SchemaOrgQuestion: any;
84
- declare const SchemaOrgRecipe: any;
85
- declare const SchemaOrgReview: any;
86
- declare const SchemaOrgVideo: any;
87
- declare const SchemaOrgWebPage: any;
88
- declare const SchemaOrgWebSite: any;
89
- declare const SchemaOrgMovie: any;
90
- declare const SchemaOrgCourse: any;
91
- declare const SchemaOrgItemList: any;
92
- declare const SchemaOrgBook: any;
93
- declare const SchemaOrgSoftwareApp: any;
94
-
95
95
  export { type DeepMaybeRef, SchemaOrgArticle, SchemaOrgBook, SchemaOrgBreadcrumb, SchemaOrgComment, SchemaOrgCourse, SchemaOrgEvent, SchemaOrgFoodEstablishment, SchemaOrgHowTo, SchemaOrgImage, SchemaOrgItemList, SchemaOrgJobPosting, SchemaOrgLocalBusiness, SchemaOrgMovie, SchemaOrgOrganization, SchemaOrgPerson, SchemaOrgProduct, SchemaOrgQuestion, SchemaOrgRecipe, SchemaOrgResolver, type SchemaOrgResolverOptions, SchemaOrgReview, SchemaOrgSoftwareApp, SchemaOrgVideo, SchemaOrgWebPage, SchemaOrgWebSite, type UseSchemaOrgInput, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgComponent, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, schemaAutoImports, schemaOrgAutoImports, schemaOrgComponents, useSchemaOrg };
package/dist/vue.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { U as UnheadSchemaOrg } from './shared/schema-org.967f487d.mjs';
2
- export { a1 as PluginSchemaOrg, a2 as SchemaOrgUnheadPlugin } from './shared/schema-org.967f487d.mjs';
3
- import { injectHead, useHead } from '@unhead/vue';
1
+ import { U as UnheadSchemaOrg } from './shared/schema-org.7698b7cd.mjs';
2
+ export { a1 as PluginSchemaOrg, a2 as SchemaOrgUnheadPlugin } from './shared/schema-org.7698b7cd.mjs';
4
3
  import { defineComponent, ref, computed, unref, h } from 'vue';
4
+ import { injectHead, useHead } from '@unhead/vue';
5
5
  import 'ufo';
6
6
 
7
7
  const schemaAutoImports = [
@@ -92,6 +92,88 @@ function SchemaOrgResolver(options = {}) {
92
92
  };
93
93
  }
94
94
 
95
+ function shallowVNodesToText(nodes) {
96
+ let text = "";
97
+ for (const node of nodes) {
98
+ if (typeof node.children === "string")
99
+ text += node.children.trim();
100
+ }
101
+ return text;
102
+ }
103
+ function fixKey(s) {
104
+ let key = s.replace(/-./g, (x) => x[1].toUpperCase());
105
+ if (key === "type" || key === "id")
106
+ key = `@${key}`;
107
+ return key;
108
+ }
109
+ function ignoreKey(s) {
110
+ if (s.startsWith("aria-") || s.startsWith("data-"))
111
+ return false;
112
+ return s === "class" || s === "style";
113
+ }
114
+ function defineSchemaOrgComponent(name, defineFn) {
115
+ return defineComponent({
116
+ name,
117
+ props: {
118
+ as: String
119
+ },
120
+ setup(props, { slots, attrs }) {
121
+ const node = ref(null);
122
+ const nodePartial = computed(() => {
123
+ const val = {};
124
+ Object.entries(unref(attrs)).forEach(([key, value]) => {
125
+ if (!ignoreKey(key)) {
126
+ val[fixKey(key)] = unref(value);
127
+ }
128
+ });
129
+ if (!node.value) {
130
+ for (const [key, slot] of Object.entries(slots)) {
131
+ if (!slot || key === "default")
132
+ continue;
133
+ val[fixKey(key)] = shallowVNodesToText(slot(props));
134
+ }
135
+ }
136
+ return val;
137
+ });
138
+ if (defineFn) {
139
+ useSchemaOrg(defineFn(unref(nodePartial)));
140
+ }
141
+ return () => {
142
+ const data = unref(nodePartial);
143
+ if (!slots.default)
144
+ return null;
145
+ const childSlots = [];
146
+ if (slots.default)
147
+ childSlots.push(slots.default(data));
148
+ return h(props.as || "div", {}, childSlots);
149
+ };
150
+ }
151
+ });
152
+ }
153
+ const SchemaOrgArticle = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgArticle", defineArticle);
154
+ const SchemaOrgBreadcrumb = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgBreadcrumb", defineBreadcrumb);
155
+ const SchemaOrgComment = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgComment", defineComment);
156
+ const SchemaOrgEvent = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgEvent", defineEvent);
157
+ const SchemaOrgFoodEstablishment = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgFoodEstablishment", defineFoodEstablishment);
158
+ const SchemaOrgHowTo = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgHowTo", defineHowTo);
159
+ const SchemaOrgImage = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgImage", defineImage);
160
+ const SchemaOrgJobPosting = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgJobPosting", defineJobPosting);
161
+ const SchemaOrgLocalBusiness = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgLocalBusiness", defineLocalBusiness);
162
+ const SchemaOrgOrganization = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgOrganization", defineOrganization);
163
+ const SchemaOrgPerson = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgPerson", definePerson);
164
+ const SchemaOrgProduct = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgProduct", defineProduct);
165
+ const SchemaOrgQuestion = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgQuestion", defineQuestion);
166
+ const SchemaOrgRecipe = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgRecipe", defineRecipe);
167
+ const SchemaOrgReview = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgReview", defineReview);
168
+ const SchemaOrgVideo = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgVideo", defineVideo);
169
+ const SchemaOrgWebPage = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgWebPage", defineWebPage);
170
+ const SchemaOrgWebSite = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgWebSite", defineWebSite);
171
+ const SchemaOrgMovie = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgMovie", defineMovie);
172
+ const SchemaOrgCourse = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgCourse", defineCourse);
173
+ const SchemaOrgItemList = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgItemList", defineItemList);
174
+ const SchemaOrgBook = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgBook", defineBook);
175
+ const SchemaOrgSoftwareApp = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgSoftwareApp", defineSoftwareApp);
176
+
95
177
  function provideResolver(input, resolver) {
96
178
  if (!input)
97
179
  input = {};
@@ -210,7 +292,6 @@ function useSchemaOrg(input) {
210
292
  script: [
211
293
  {
212
294
  type: "application/ld+json",
213
- id: "schema-org-graph",
214
295
  key: "schema-org-graph",
215
296
  nodes: input
216
297
  }
@@ -218,86 +299,4 @@ function useSchemaOrg(input) {
218
299
  });
219
300
  }
220
301
 
221
- function shallowVNodesToText(nodes) {
222
- let text = "";
223
- for (const node of nodes) {
224
- if (typeof node.children === "string")
225
- text += node.children.trim();
226
- }
227
- return text;
228
- }
229
- function fixKey(s) {
230
- let key = s.replace(/-./g, (x) => x[1].toUpperCase());
231
- if (key === "type" || key === "id")
232
- key = `@${key}`;
233
- return key;
234
- }
235
- function ignoreKey(s) {
236
- if (s.startsWith("aria-") || s.startsWith("data-"))
237
- return false;
238
- return s === "class" || s === "style";
239
- }
240
- function defineSchemaOrgComponent(name, defineFn) {
241
- return defineComponent({
242
- name,
243
- props: {
244
- as: String
245
- },
246
- setup(props, { slots, attrs }) {
247
- const node = ref(null);
248
- const nodePartial = computed(() => {
249
- const val = {};
250
- Object.entries(unref(attrs)).forEach(([key, value]) => {
251
- if (!ignoreKey(key)) {
252
- val[fixKey(key)] = unref(value);
253
- }
254
- });
255
- if (!node.value) {
256
- for (const [key, slot] of Object.entries(slots)) {
257
- if (!slot || key === "default")
258
- continue;
259
- val[fixKey(key)] = shallowVNodesToText(slot(props));
260
- }
261
- }
262
- return val;
263
- });
264
- if (defineFn) {
265
- useSchemaOrg(defineFn(unref(nodePartial)));
266
- }
267
- return () => {
268
- const data = unref(nodePartial);
269
- if (!slots.default)
270
- return null;
271
- const childSlots = [];
272
- if (slots.default)
273
- childSlots.push(slots.default(data));
274
- return h(props.as || "div", {}, childSlots);
275
- };
276
- }
277
- });
278
- }
279
- const SchemaOrgArticle = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgArticle", defineArticle);
280
- const SchemaOrgBreadcrumb = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgBreadcrumb", defineBreadcrumb);
281
- const SchemaOrgComment = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgComment", defineComment);
282
- const SchemaOrgEvent = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgEvent", defineEvent);
283
- const SchemaOrgFoodEstablishment = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgFoodEstablishment", defineFoodEstablishment);
284
- const SchemaOrgHowTo = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgHowTo", defineHowTo);
285
- const SchemaOrgImage = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgImage", defineImage);
286
- const SchemaOrgJobPosting = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgJobPosting", defineJobPosting);
287
- const SchemaOrgLocalBusiness = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgLocalBusiness", defineLocalBusiness);
288
- const SchemaOrgOrganization = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgOrganization", defineOrganization);
289
- const SchemaOrgPerson = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgPerson", definePerson);
290
- const SchemaOrgProduct = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgProduct", defineProduct);
291
- const SchemaOrgQuestion = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgQuestion", defineQuestion);
292
- const SchemaOrgRecipe = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgRecipe", defineRecipe);
293
- const SchemaOrgReview = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgReview", defineReview);
294
- const SchemaOrgVideo = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgVideo", defineVideo);
295
- const SchemaOrgWebPage = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgWebPage", defineWebPage);
296
- const SchemaOrgWebSite = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgWebSite", defineWebSite);
297
- const SchemaOrgMovie = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgMovie", defineMovie);
298
- const SchemaOrgCourse = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgCourse", defineCourse);
299
- const SchemaOrgItemList = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgItemList", defineItemList);
300
- const SchemaOrgBook = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgBook", defineBook);
301
- const SchemaOrgSoftwareApp = /* @__PURE__ */ defineSchemaOrgComponent("SchemaOrgSoftwareApp", defineSoftwareApp);
302
-
303
302
  export { SchemaOrgArticle, SchemaOrgBook, SchemaOrgBreadcrumb, SchemaOrgComment, SchemaOrgCourse, SchemaOrgEvent, SchemaOrgFoodEstablishment, SchemaOrgHowTo, SchemaOrgImage, SchemaOrgItemList, SchemaOrgJobPosting, SchemaOrgLocalBusiness, SchemaOrgMovie, SchemaOrgOrganization, SchemaOrgPerson, SchemaOrgProduct, SchemaOrgQuestion, SchemaOrgRecipe, SchemaOrgResolver, SchemaOrgReview, SchemaOrgSoftwareApp, SchemaOrgVideo, SchemaOrgWebPage, SchemaOrgWebSite, defineAddress, defineAggregateOffer, defineAggregateRating, defineArticle, defineBook, defineBookEdition, defineBreadcrumb, defineComment, defineCourse, defineEvent, defineFoodEstablishment, defineHowTo, defineHowToStep, defineImage, defineItemList, defineJobPosting, defineListItem, defineLocalBusiness, defineMovie, defineOffer, defineOpeningHours, defineOrganization, definePerson, definePlace, defineProduct, defineQuestion, defineReadAction, defineRecipe, defineReview, defineSchemaOrgComponent, defineSearchAction, defineSoftwareApp, defineVideo, defineVirtualLocation, defineWebPage, defineWebSite, schemaAutoImports, schemaOrgAutoImports, schemaOrgComponents, useSchemaOrg };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/schema-org",
3
- "version": "1.10.4",
3
+ "type": "module",
4
+ "version": "1.11.0-beta.2",
4
5
  "description": "Unhead Schema.org for Simple and Automated Google Rich Results",
5
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
7
  "license": "MIT",
@@ -48,10 +49,10 @@
48
49
  },
49
50
  "devDependencies": {
50
51
  "unplugin-vue-components": "^0.27.4",
51
- "@unhead/schema": "1.10.4",
52
- "@unhead/shared": "1.10.4",
53
- "@unhead/vue": "1.10.4",
54
- "unhead": "1.10.4"
52
+ "@unhead/schema": "1.11.0-beta.2",
53
+ "@unhead/shared": "1.11.0-beta.2",
54
+ "unhead": "1.11.0-beta.2",
55
+ "@unhead/vue": "1.11.0-beta.2"
55
56
  },
56
57
  "scripts": {
57
58
  "build": "unbuild .",