nuxtseo-shared 5.3.15 → 6.0.0
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/brand.d.mts +140 -0
- package/dist/brand.d.ts +140 -0
- package/dist/brand.mjs +353 -0
- package/dist/checklist.d.mts +69 -0
- package/dist/checklist.d.ts +69 -0
- package/dist/checklist.mjs +354 -0
- package/dist/const.d.mts +1 -3
- package/dist/const.d.ts +1 -3
- package/dist/const.mjs +5 -7
- package/dist/devtools.d.mts +11 -14
- package/dist/devtools.d.ts +11 -14
- package/dist/devtools.mjs +73 -385
- package/dist/fetch.d.mts +7 -0
- package/dist/fetch.d.ts +7 -0
- package/dist/fetch.mjs +15 -0
- package/dist/i18n.mjs +26 -3
- package/dist/kit.d.mts +17 -17
- package/dist/kit.d.ts +17 -17
- package/dist/kit.mjs +119 -54
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +4 -4
- package/dist/prerender.d.mts +22 -0
- package/dist/prerender.d.ts +22 -0
- package/dist/prerender.mjs +74 -0
- package/dist/pro.mjs +8 -7
- package/package.json +37 -25
package/dist/brand.d.mts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { NuxtSEOModule } from './const.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Nuxt SEO brand marks as data, plus one pure SVG renderer.
|
|
5
|
+
*
|
|
6
|
+
* One pen draws every mark. Only the landing dot carries colour:
|
|
7
|
+
* green means a free module shipped it, violet means Pro read it back.
|
|
8
|
+
* Pro marks also draw the climb in a violet gradient.
|
|
9
|
+
* nuxtseo.com, the devtools client, READMEs and favicons all draw from here.
|
|
10
|
+
*/
|
|
11
|
+
/** Every module with a hand-drawn icon. The meta `nuxt-seo` module uses the summit mark instead. */
|
|
12
|
+
type ModuleIconName = Exclude<NuxtSEOModule['slug'], 'nuxt-seo' | 'ai-kit'>;
|
|
13
|
+
type BrandIconName = ModuleIconName | 'mcp';
|
|
14
|
+
/** Colour of the landing dot. `free`: a module shipped it. `pro`: Pro read it back. */
|
|
15
|
+
type BrandLanding = 'free' | 'pro' | 'ink' | 'none';
|
|
16
|
+
type BrandProduct = 'free' | 'pro';
|
|
17
|
+
type BrandColor = 'ink' | 'free' | 'pro' | 'tile' | 'tile-ink';
|
|
18
|
+
/** `pro-gradient` sits on the page ground and follows its theme. `tile-gradient` sits on the dark plate. */
|
|
19
|
+
type BrandGradient = 'pro-gradient' | 'tile-gradient';
|
|
20
|
+
type BrandPaint = BrandColor | BrandGradient;
|
|
21
|
+
type BrandShape = {
|
|
22
|
+
_tag: 'Line';
|
|
23
|
+
d: string;
|
|
24
|
+
width: number;
|
|
25
|
+
paint: BrandPaint;
|
|
26
|
+
opacity?: number;
|
|
27
|
+
dash?: string;
|
|
28
|
+
} | {
|
|
29
|
+
_tag: 'Area';
|
|
30
|
+
d: string;
|
|
31
|
+
paint: BrandPaint;
|
|
32
|
+
} | {
|
|
33
|
+
_tag: 'Dot';
|
|
34
|
+
cx: number;
|
|
35
|
+
cy: number;
|
|
36
|
+
r: number;
|
|
37
|
+
paint: BrandPaint;
|
|
38
|
+
} | {
|
|
39
|
+
_tag: 'Tile';
|
|
40
|
+
size: number;
|
|
41
|
+
radius: number;
|
|
42
|
+
paint: BrandPaint;
|
|
43
|
+
};
|
|
44
|
+
interface BrandGroup {
|
|
45
|
+
transform?: string;
|
|
46
|
+
shapes: BrandShape[];
|
|
47
|
+
}
|
|
48
|
+
interface BrandDrawing {
|
|
49
|
+
viewBox: string;
|
|
50
|
+
label: string;
|
|
51
|
+
groups: BrandGroup[];
|
|
52
|
+
}
|
|
53
|
+
interface GradientStops {
|
|
54
|
+
from: string;
|
|
55
|
+
to: string;
|
|
56
|
+
}
|
|
57
|
+
interface BrandPalette {
|
|
58
|
+
ink: string;
|
|
59
|
+
free: string;
|
|
60
|
+
pro: string;
|
|
61
|
+
/** The Pro climb on this palette's ground. */
|
|
62
|
+
gradient: GradientStops;
|
|
63
|
+
tile: string;
|
|
64
|
+
tileInk: string;
|
|
65
|
+
/** The Pro climb on the plate. The plate is dark in every theme, so this never changes. */
|
|
66
|
+
tileGradient: GradientStops;
|
|
67
|
+
}
|
|
68
|
+
/** Static palettes for contexts without CSS: README images, favicons, emails. */
|
|
69
|
+
declare const BRAND_PALETTE_LIGHT: BrandPalette;
|
|
70
|
+
declare const BRAND_PALETTE_DARK: BrandPalette;
|
|
71
|
+
interface IconStroke {
|
|
72
|
+
d: string;
|
|
73
|
+
/** Multiplier on the pen width. */
|
|
74
|
+
weight?: number;
|
|
75
|
+
/** Drawn as a dotted route. Small cuts draw it solid. */
|
|
76
|
+
dotted?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface IconSpec {
|
|
79
|
+
label: string;
|
|
80
|
+
strokes: IconStroke[];
|
|
81
|
+
landing: {
|
|
82
|
+
cx: number;
|
|
83
|
+
cy: number;
|
|
84
|
+
r: number;
|
|
85
|
+
shape: 'dot' | 'spark';
|
|
86
|
+
};
|
|
87
|
+
/** Degrees around the grid centre. */
|
|
88
|
+
rotate?: number;
|
|
89
|
+
}
|
|
90
|
+
declare const BRAND_ICONS: Record<BrandIconName, IconSpec>;
|
|
91
|
+
interface IconOptions {
|
|
92
|
+
/** Colour of the landing dot. Defaults to `free`. */
|
|
93
|
+
landing?: BrandLanding;
|
|
94
|
+
/** Rendered size in CSS pixels. Picks the cut: smaller icons get a heavier pen. */
|
|
95
|
+
size?: number;
|
|
96
|
+
}
|
|
97
|
+
declare function iconDrawing(name: BrandIconName, { landing, size }?: IconOptions): BrandDrawing;
|
|
98
|
+
interface MarkOptions {
|
|
99
|
+
product?: BrandProduct;
|
|
100
|
+
/** Rendered size in CSS pixels. 18 and below uses the small cut. */
|
|
101
|
+
size?: number;
|
|
102
|
+
}
|
|
103
|
+
declare function markDrawing({ product, size }?: MarkOptions): BrandDrawing;
|
|
104
|
+
interface FaviconOptions {
|
|
105
|
+
product?: BrandProduct;
|
|
106
|
+
/** Pixel size of the favicon. 16 and below uses the small cut. */
|
|
107
|
+
size?: number;
|
|
108
|
+
}
|
|
109
|
+
/** The summit on a dark tile. Free stays flat; Pro keeps the original violet gradient on the climb. */
|
|
110
|
+
declare function faviconDrawing({ product, size }?: FaviconOptions): BrandDrawing;
|
|
111
|
+
interface IconPlateOptions {
|
|
112
|
+
landing?: BrandLanding;
|
|
113
|
+
/** Rendered size of the plate in pixels; the icon inside picks its cut from its own size. */
|
|
114
|
+
size?: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A module icon on the dark favicon plate. It reads on light and dark grounds
|
|
118
|
+
* alike, so one image serves places that cannot swap by theme, such as READMEs.
|
|
119
|
+
*/
|
|
120
|
+
declare function iconPlateDrawing(name: BrandIconName, { landing, size }?: IconPlateOptions): BrandDrawing;
|
|
121
|
+
/** Width over height of the lettering's view box, for laying it out beside the wordmark. */
|
|
122
|
+
declare const PRO_LETTERING_ASPECT: number;
|
|
123
|
+
/** Set the lettering about 1.55 times the wordmark's font size. */
|
|
124
|
+
declare const PRO_LETTERING_SCALE = 1.55;
|
|
125
|
+
declare function proLetteringDrawing(): BrandDrawing;
|
|
126
|
+
interface SvgOptions {
|
|
127
|
+
/** Static colours for files without CSS: READMEs, favicons, emails. Omit it to theme through CSS variables. */
|
|
128
|
+
palette?: BrandPalette;
|
|
129
|
+
/** Prefix for gradient ids. Pass a unique value when several marks share one page. */
|
|
130
|
+
idPrefix?: string;
|
|
131
|
+
width?: number | string;
|
|
132
|
+
height?: number | string;
|
|
133
|
+
/** Extra attributes for the root element, already escaped. */
|
|
134
|
+
attrs?: string;
|
|
135
|
+
}
|
|
136
|
+
declare function drawingToSvg(drawing: BrandDrawing, options?: SvgOptions): string;
|
|
137
|
+
declare function isBrandIconName(value: string): value is BrandIconName;
|
|
138
|
+
|
|
139
|
+
export { BRAND_ICONS, BRAND_PALETTE_DARK, BRAND_PALETTE_LIGHT, PRO_LETTERING_ASPECT, PRO_LETTERING_SCALE, drawingToSvg, faviconDrawing, iconDrawing, iconPlateDrawing, isBrandIconName, markDrawing, proLetteringDrawing };
|
|
140
|
+
export type { BrandColor, BrandDrawing, BrandGradient, BrandGroup, BrandIconName, BrandLanding, BrandPaint, BrandPalette, BrandProduct, BrandShape, FaviconOptions, GradientStops, IconOptions, IconPlateOptions, MarkOptions, ModuleIconName, SvgOptions };
|
package/dist/brand.d.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { NuxtSEOModule } from './const.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Nuxt SEO brand marks as data, plus one pure SVG renderer.
|
|
5
|
+
*
|
|
6
|
+
* One pen draws every mark. Only the landing dot carries colour:
|
|
7
|
+
* green means a free module shipped it, violet means Pro read it back.
|
|
8
|
+
* Pro marks also draw the climb in a violet gradient.
|
|
9
|
+
* nuxtseo.com, the devtools client, READMEs and favicons all draw from here.
|
|
10
|
+
*/
|
|
11
|
+
/** Every module with a hand-drawn icon. The meta `nuxt-seo` module uses the summit mark instead. */
|
|
12
|
+
type ModuleIconName = Exclude<NuxtSEOModule['slug'], 'nuxt-seo' | 'ai-kit'>;
|
|
13
|
+
type BrandIconName = ModuleIconName | 'mcp';
|
|
14
|
+
/** Colour of the landing dot. `free`: a module shipped it. `pro`: Pro read it back. */
|
|
15
|
+
type BrandLanding = 'free' | 'pro' | 'ink' | 'none';
|
|
16
|
+
type BrandProduct = 'free' | 'pro';
|
|
17
|
+
type BrandColor = 'ink' | 'free' | 'pro' | 'tile' | 'tile-ink';
|
|
18
|
+
/** `pro-gradient` sits on the page ground and follows its theme. `tile-gradient` sits on the dark plate. */
|
|
19
|
+
type BrandGradient = 'pro-gradient' | 'tile-gradient';
|
|
20
|
+
type BrandPaint = BrandColor | BrandGradient;
|
|
21
|
+
type BrandShape = {
|
|
22
|
+
_tag: 'Line';
|
|
23
|
+
d: string;
|
|
24
|
+
width: number;
|
|
25
|
+
paint: BrandPaint;
|
|
26
|
+
opacity?: number;
|
|
27
|
+
dash?: string;
|
|
28
|
+
} | {
|
|
29
|
+
_tag: 'Area';
|
|
30
|
+
d: string;
|
|
31
|
+
paint: BrandPaint;
|
|
32
|
+
} | {
|
|
33
|
+
_tag: 'Dot';
|
|
34
|
+
cx: number;
|
|
35
|
+
cy: number;
|
|
36
|
+
r: number;
|
|
37
|
+
paint: BrandPaint;
|
|
38
|
+
} | {
|
|
39
|
+
_tag: 'Tile';
|
|
40
|
+
size: number;
|
|
41
|
+
radius: number;
|
|
42
|
+
paint: BrandPaint;
|
|
43
|
+
};
|
|
44
|
+
interface BrandGroup {
|
|
45
|
+
transform?: string;
|
|
46
|
+
shapes: BrandShape[];
|
|
47
|
+
}
|
|
48
|
+
interface BrandDrawing {
|
|
49
|
+
viewBox: string;
|
|
50
|
+
label: string;
|
|
51
|
+
groups: BrandGroup[];
|
|
52
|
+
}
|
|
53
|
+
interface GradientStops {
|
|
54
|
+
from: string;
|
|
55
|
+
to: string;
|
|
56
|
+
}
|
|
57
|
+
interface BrandPalette {
|
|
58
|
+
ink: string;
|
|
59
|
+
free: string;
|
|
60
|
+
pro: string;
|
|
61
|
+
/** The Pro climb on this palette's ground. */
|
|
62
|
+
gradient: GradientStops;
|
|
63
|
+
tile: string;
|
|
64
|
+
tileInk: string;
|
|
65
|
+
/** The Pro climb on the plate. The plate is dark in every theme, so this never changes. */
|
|
66
|
+
tileGradient: GradientStops;
|
|
67
|
+
}
|
|
68
|
+
/** Static palettes for contexts without CSS: README images, favicons, emails. */
|
|
69
|
+
declare const BRAND_PALETTE_LIGHT: BrandPalette;
|
|
70
|
+
declare const BRAND_PALETTE_DARK: BrandPalette;
|
|
71
|
+
interface IconStroke {
|
|
72
|
+
d: string;
|
|
73
|
+
/** Multiplier on the pen width. */
|
|
74
|
+
weight?: number;
|
|
75
|
+
/** Drawn as a dotted route. Small cuts draw it solid. */
|
|
76
|
+
dotted?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface IconSpec {
|
|
79
|
+
label: string;
|
|
80
|
+
strokes: IconStroke[];
|
|
81
|
+
landing: {
|
|
82
|
+
cx: number;
|
|
83
|
+
cy: number;
|
|
84
|
+
r: number;
|
|
85
|
+
shape: 'dot' | 'spark';
|
|
86
|
+
};
|
|
87
|
+
/** Degrees around the grid centre. */
|
|
88
|
+
rotate?: number;
|
|
89
|
+
}
|
|
90
|
+
declare const BRAND_ICONS: Record<BrandIconName, IconSpec>;
|
|
91
|
+
interface IconOptions {
|
|
92
|
+
/** Colour of the landing dot. Defaults to `free`. */
|
|
93
|
+
landing?: BrandLanding;
|
|
94
|
+
/** Rendered size in CSS pixels. Picks the cut: smaller icons get a heavier pen. */
|
|
95
|
+
size?: number;
|
|
96
|
+
}
|
|
97
|
+
declare function iconDrawing(name: BrandIconName, { landing, size }?: IconOptions): BrandDrawing;
|
|
98
|
+
interface MarkOptions {
|
|
99
|
+
product?: BrandProduct;
|
|
100
|
+
/** Rendered size in CSS pixels. 18 and below uses the small cut. */
|
|
101
|
+
size?: number;
|
|
102
|
+
}
|
|
103
|
+
declare function markDrawing({ product, size }?: MarkOptions): BrandDrawing;
|
|
104
|
+
interface FaviconOptions {
|
|
105
|
+
product?: BrandProduct;
|
|
106
|
+
/** Pixel size of the favicon. 16 and below uses the small cut. */
|
|
107
|
+
size?: number;
|
|
108
|
+
}
|
|
109
|
+
/** The summit on a dark tile. Free stays flat; Pro keeps the original violet gradient on the climb. */
|
|
110
|
+
declare function faviconDrawing({ product, size }?: FaviconOptions): BrandDrawing;
|
|
111
|
+
interface IconPlateOptions {
|
|
112
|
+
landing?: BrandLanding;
|
|
113
|
+
/** Rendered size of the plate in pixels; the icon inside picks its cut from its own size. */
|
|
114
|
+
size?: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A module icon on the dark favicon plate. It reads on light and dark grounds
|
|
118
|
+
* alike, so one image serves places that cannot swap by theme, such as READMEs.
|
|
119
|
+
*/
|
|
120
|
+
declare function iconPlateDrawing(name: BrandIconName, { landing, size }?: IconPlateOptions): BrandDrawing;
|
|
121
|
+
/** Width over height of the lettering's view box, for laying it out beside the wordmark. */
|
|
122
|
+
declare const PRO_LETTERING_ASPECT: number;
|
|
123
|
+
/** Set the lettering about 1.55 times the wordmark's font size. */
|
|
124
|
+
declare const PRO_LETTERING_SCALE = 1.55;
|
|
125
|
+
declare function proLetteringDrawing(): BrandDrawing;
|
|
126
|
+
interface SvgOptions {
|
|
127
|
+
/** Static colours for files without CSS: READMEs, favicons, emails. Omit it to theme through CSS variables. */
|
|
128
|
+
palette?: BrandPalette;
|
|
129
|
+
/** Prefix for gradient ids. Pass a unique value when several marks share one page. */
|
|
130
|
+
idPrefix?: string;
|
|
131
|
+
width?: number | string;
|
|
132
|
+
height?: number | string;
|
|
133
|
+
/** Extra attributes for the root element, already escaped. */
|
|
134
|
+
attrs?: string;
|
|
135
|
+
}
|
|
136
|
+
declare function drawingToSvg(drawing: BrandDrawing, options?: SvgOptions): string;
|
|
137
|
+
declare function isBrandIconName(value: string): value is BrandIconName;
|
|
138
|
+
|
|
139
|
+
export { BRAND_ICONS, BRAND_PALETTE_DARK, BRAND_PALETTE_LIGHT, PRO_LETTERING_ASPECT, PRO_LETTERING_SCALE, drawingToSvg, faviconDrawing, iconDrawing, iconPlateDrawing, isBrandIconName, markDrawing, proLetteringDrawing };
|
|
140
|
+
export type { BrandColor, BrandDrawing, BrandGradient, BrandGroup, BrandIconName, BrandLanding, BrandPaint, BrandPalette, BrandProduct, BrandShape, FaviconOptions, GradientStops, IconOptions, IconPlateOptions, MarkOptions, ModuleIconName, SvgOptions };
|
package/dist/brand.mjs
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
const TILE_GRADIENT = { from: "#6925d5", to: "#ddcfff" };
|
|
2
|
+
const BRAND_PALETTE_LIGHT = {
|
|
3
|
+
ink: "#16152b",
|
|
4
|
+
free: "#00a63e",
|
|
5
|
+
pro: "#7844e3",
|
|
6
|
+
// Deeper than the plate gradient, whose pale end disappears on white.
|
|
7
|
+
gradient: { from: "#5b21b6", to: "#a68af7" },
|
|
8
|
+
tile: "#16152b",
|
|
9
|
+
tileInk: "#faf9fd",
|
|
10
|
+
tileGradient: TILE_GRADIENT
|
|
11
|
+
};
|
|
12
|
+
const BRAND_PALETTE_DARK = {
|
|
13
|
+
...BRAND_PALETTE_LIGHT,
|
|
14
|
+
ink: "#f4f3fa",
|
|
15
|
+
free: "#05df72",
|
|
16
|
+
pro: "#9c81f7",
|
|
17
|
+
gradient: TILE_GRADIENT
|
|
18
|
+
};
|
|
19
|
+
const CSS_COLORS = {
|
|
20
|
+
"ink": "currentColor",
|
|
21
|
+
"free": `var(--nuxtseo-brand-free, ${BRAND_PALETTE_LIGHT.free})`,
|
|
22
|
+
"pro": `var(--nuxtseo-brand-pro, ${BRAND_PALETTE_LIGHT.pro})`,
|
|
23
|
+
"tile": `var(--nuxtseo-brand-tile, ${BRAND_PALETTE_LIGHT.tile})`,
|
|
24
|
+
"tile-ink": `var(--nuxtseo-brand-tile-ink, ${BRAND_PALETTE_LIGHT.tileInk})`
|
|
25
|
+
};
|
|
26
|
+
const CSS_GRADIENTS = {
|
|
27
|
+
"pro-gradient": {
|
|
28
|
+
from: `var(--nuxtseo-brand-gradient-from, ${BRAND_PALETTE_LIGHT.gradient.from})`,
|
|
29
|
+
to: `var(--nuxtseo-brand-gradient-to, ${BRAND_PALETTE_LIGHT.gradient.to})`
|
|
30
|
+
},
|
|
31
|
+
"tile-gradient": {
|
|
32
|
+
from: `var(--nuxtseo-brand-tile-gradient-from, ${TILE_GRADIENT.from})`,
|
|
33
|
+
to: `var(--nuxtseo-brand-tile-gradient-to, ${TILE_GRADIENT.to})`
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function paletteColors(palette) {
|
|
37
|
+
return {
|
|
38
|
+
"ink": palette.ink,
|
|
39
|
+
"free": palette.free,
|
|
40
|
+
"pro": palette.pro,
|
|
41
|
+
"tile": palette.tile,
|
|
42
|
+
"tile-ink": palette.tileInk
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const BRAND_ICONS = {
|
|
46
|
+
"site-config": {
|
|
47
|
+
label: "Site Config",
|
|
48
|
+
strokes: [
|
|
49
|
+
{ d: "M5.4 9.4 Q16 8 26.6 8.8 Q27.4 16.8 26.8 25 Q16 26 5.8 25.2 Q4.8 17.4 5.6 8.4" },
|
|
50
|
+
{ d: "M5.5 13.6 Q16.2 12.6 26.9 13.4", weight: 0.8 },
|
|
51
|
+
{ d: "M13.6 8.8 Q13.4 5 16 4.9 Q18.6 5 18.4 8.8" },
|
|
52
|
+
{ d: "M9 20.6 Q10.2 16.6 11.5 19.4 Q12.6 21.8 13.8 18.8 Q15 16.2 16 19 Q16.9 21.2 18.4 19 Q19.2 18 20.4 18.6" }
|
|
53
|
+
],
|
|
54
|
+
landing: { cx: 23.2, cy: 19.2, r: 1.7, shape: "dot" }
|
|
55
|
+
},
|
|
56
|
+
"robots": {
|
|
57
|
+
label: "Robots",
|
|
58
|
+
strokes: [
|
|
59
|
+
{ d: "M8.8 11.2 Q16 10.4 23.4 11 Q25.6 11.2 25.6 13.4 Q26 19 25.4 23.8 Q25.2 25.8 23 25.9 Q16 26.6 9.2 25.9 Q7 25.7 6.9 23.6 Q6.5 18.2 7 13.4 Q7.1 11.4 9.4 11.1" },
|
|
60
|
+
{ d: "M16.2 10.8 Q15.8 8.6 16.1 7.2" },
|
|
61
|
+
{ d: "M12.4 16.4 L12.4 18", weight: 1.3 },
|
|
62
|
+
{ d: "M19.6 16.4 L19.6 18", weight: 1.3 },
|
|
63
|
+
{ d: "M12.6 21.4 Q16 23.4 19.6 21.2" },
|
|
64
|
+
{ d: "M4.4 16.4 Q4.2 18.2 4.5 20" },
|
|
65
|
+
{ d: "M27.6 16.2 Q27.9 18 27.6 19.8" }
|
|
66
|
+
],
|
|
67
|
+
landing: { cx: 16.1, cy: 5.2, r: 1.9, shape: "dot" }
|
|
68
|
+
},
|
|
69
|
+
"sitemap": {
|
|
70
|
+
label: "Sitemap",
|
|
71
|
+
strokes: [
|
|
72
|
+
{ d: "M4.6 8.8 L11.2 6.2 L20.6 8.6 L27.4 6.2 Q27.8 14.6 27.6 23 L20.8 25.6 L11 23 L4.4 25.4 Q4.1 17 4.7 8.2" },
|
|
73
|
+
{ d: "M11.2 6.2 Q11.5 14.6 11 23", weight: 0.7 },
|
|
74
|
+
{ d: "M20.6 8.6 Q20.4 17 20.8 25.6", weight: 0.7 },
|
|
75
|
+
{ d: "M7.4 20.6 Q9.2 15.6 13.2 16.4 Q17.4 17.4 17.2 13.6 Q17.2 11.2 21.4 11.8", dotted: true }
|
|
76
|
+
],
|
|
77
|
+
landing: { cx: 23.8, cy: 12.4, r: 1.9, shape: "dot" }
|
|
78
|
+
},
|
|
79
|
+
"og-image": {
|
|
80
|
+
label: "OG Image",
|
|
81
|
+
strokes: [
|
|
82
|
+
{ d: "M7 5 Q16 4.4 25.4 5.2 Q26.2 15.6 25.6 27 Q16 27.6 6.4 26.8 Q5.8 16 7.2 4.4" },
|
|
83
|
+
{ d: "M9.6 8 Q16 7.6 22.8 8 Q23.2 13.6 22.8 19.6 Q16 20 9.4 19.6 Q9 13.8 9.6 8", weight: 0.8 },
|
|
84
|
+
{ d: "M9.8 17.4 Q12.6 14 15.2 16 Q18.2 18.2 22.6 14.8" },
|
|
85
|
+
{ d: "M11.2 23.4 Q14 22.8 17.4 23.4", weight: 0.8 }
|
|
86
|
+
],
|
|
87
|
+
landing: { cx: 18.6, cy: 11.4, r: 1.8, shape: "dot" }
|
|
88
|
+
},
|
|
89
|
+
"schema-org": {
|
|
90
|
+
label: "Schema.org",
|
|
91
|
+
strokes: [
|
|
92
|
+
{ d: "M10.2 5.4 Q7.4 5.6 7.8 9.4 Q8 13.6 5.4 15.9 Q8 18.2 7.8 22.4 Q7.6 26.4 10.4 26.6" },
|
|
93
|
+
{ d: "M21.8 5.4 Q24.6 5.6 24.2 9.4 Q24 13.6 26.6 15.9 Q24 18.2 24.2 22.4 Q24.4 26.4 21.6 26.6" },
|
|
94
|
+
{ d: "M13.8 12 L18 13.2", weight: 0.8 },
|
|
95
|
+
{ d: "M18.4 15.6 L15.6 19.2", weight: 0.8 },
|
|
96
|
+
{ d: "M12.6 13.2 Q12.9 16.4 13.6 19.4", weight: 0.8 },
|
|
97
|
+
{ d: "M12.3 10 Q13.8 10.1 13.8 11.5 Q13.7 12.9 12.3 12.9 Q10.9 12.8 10.9 11.4 Q11 10.2 12.6 10.1" },
|
|
98
|
+
{ d: "M14.5 19.4 Q16 19.5 16 20.9 Q15.9 22.3 14.5 22.3 Q13.1 22.2 13.1 20.8 Q13.2 19.6 14.8 19.5" }
|
|
99
|
+
],
|
|
100
|
+
landing: { cx: 19.8, cy: 13.8, r: 1.9, shape: "dot" }
|
|
101
|
+
},
|
|
102
|
+
"seo-utils": {
|
|
103
|
+
label: "SEO Utils",
|
|
104
|
+
rotate: -32,
|
|
105
|
+
strokes: [
|
|
106
|
+
{ d: "M10 10.4 Q18.6 9.8 27 10.2 Q27.6 16 27.2 21.8 Q18.6 22.4 10.2 21.8 L4.4 16.2 Q7.2 13.2 10.4 10" },
|
|
107
|
+
{ d: "M14.8 14.2 Q19 13.9 23.4 14.2", weight: 0.8 },
|
|
108
|
+
{ d: "M14.8 17.8 Q17.4 17.6 20.2 17.8", weight: 0.8 },
|
|
109
|
+
{ d: "M8.8 16 Q4.6 16.4 2.6 13.4 Q1.4 11.2 3.2 10", weight: 0.85 }
|
|
110
|
+
],
|
|
111
|
+
landing: { cx: 10.2, cy: 16, r: 1.7, shape: "dot" }
|
|
112
|
+
},
|
|
113
|
+
"link-checker": {
|
|
114
|
+
label: "Link Checker",
|
|
115
|
+
strokes: [
|
|
116
|
+
{ d: "M13.6 18.4 L10.8 21.2 Q8 24 5.2 21.2 Q2.4 18.4 5.2 15.6 L8.8 12 Q11.6 9.2 14.4 12 Q15.2 12.8 15.1 13.8" },
|
|
117
|
+
{ d: "M18.4 13.6 L21.2 10.8 Q24 8 26.8 10.8 Q29.6 13.6 26.8 16.4 L23.2 20 Q20.4 22.8 17.6 20 Q16.8 19.2 16.9 18.2" }
|
|
118
|
+
],
|
|
119
|
+
landing: { cx: 16, cy: 16, r: 1.9, shape: "dot" }
|
|
120
|
+
},
|
|
121
|
+
"skew-protection": {
|
|
122
|
+
label: "Skew Protection",
|
|
123
|
+
strokes: [
|
|
124
|
+
{ d: "M11.6 5 Q18.8 5.6 26 7 Q25 15.4 23.2 23.8 L21.4 23.6", weight: 0.8 },
|
|
125
|
+
{ d: "M6.4 8.6 Q13.4 8 20.6 8.6 Q21 17.6 20.6 26.8 Q13.4 27.2 6 26.8 Q5.6 17.6 6.5 7.9" },
|
|
126
|
+
{ d: "M10.2 13.4 L10.2 5.8 Q10.2 3.6 12.2 3.6 Q14.2 3.6 14.2 5.8 L14.2 12.6 Q14.2 14.4 12.5 14.4 Q11.4 14.4 11.5 12.8 L11.6 8" },
|
|
127
|
+
{ d: "M9 18.6 Q13 18.2 17.4 18.5", weight: 0.8 },
|
|
128
|
+
{ d: "M9 22 Q11.4 21.8 13.4 22", weight: 0.8 }
|
|
129
|
+
],
|
|
130
|
+
landing: { cx: 16.8, cy: 22, r: 1.7, shape: "dot" }
|
|
131
|
+
},
|
|
132
|
+
"ai-ready": {
|
|
133
|
+
label: "AI Ready",
|
|
134
|
+
strokes: [
|
|
135
|
+
{ d: "M16 10 Q11 7.4 4.6 8.4 Q4.4 16.4 4.8 24.4 Q11 23.2 16 25.8" },
|
|
136
|
+
{ d: "M16 10 Q21 7.4 27.4 8.4 Q27.6 16.4 27.2 24.4 Q21 23.2 16 25.8" },
|
|
137
|
+
{ d: "M16 10 Q16.3 18 16 25.8", weight: 0.8 },
|
|
138
|
+
{ d: "M7.4 12.8 Q10.4 12.2 13.2 13.4", weight: 0.8 },
|
|
139
|
+
{ d: "M7.4 16.4 Q10.4 15.8 13.2 17", weight: 0.8 },
|
|
140
|
+
{ d: "M7.4 20 Q9.4 19.6 11.2 20.2", weight: 0.8 }
|
|
141
|
+
],
|
|
142
|
+
landing: { cx: 21.8, cy: 16.4, r: 4.2, shape: "spark" }
|
|
143
|
+
},
|
|
144
|
+
"mcp": {
|
|
145
|
+
label: "MCP Server",
|
|
146
|
+
strokes: [
|
|
147
|
+
{ d: "M11.6 4.2 L11.4 9" },
|
|
148
|
+
{ d: "M20.4 4.2 L20.6 9" },
|
|
149
|
+
{ d: "M7.4 9 Q16 8.4 24.6 9.1 Q24.8 16.2 19.8 19.2 Q16 21 12.2 19.2 Q7.2 16.2 7.5 8.4" },
|
|
150
|
+
{ d: "M16 20.6 Q15.8 25.2 19.2 26.6 Q21.6 27.4 23.6 26.6" }
|
|
151
|
+
],
|
|
152
|
+
landing: { cx: 25.8, cy: 26, r: 1.7, shape: "dot" }
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
function iconCut(size) {
|
|
156
|
+
if (size <= 18)
|
|
157
|
+
return "small";
|
|
158
|
+
if (size <= 28)
|
|
159
|
+
return "compact";
|
|
160
|
+
return "regular";
|
|
161
|
+
}
|
|
162
|
+
const PEN_WIDTH = { regular: 1.75, compact: 2, small: 2.3 };
|
|
163
|
+
const DOT_SCALE = { regular: 1, compact: 1.45, small: 1.6 };
|
|
164
|
+
const SPARK_SCALE = { regular: 1, compact: 1.12, small: 1.12 };
|
|
165
|
+
function sparkPath(cx, cy, r) {
|
|
166
|
+
const q = r * 0.16;
|
|
167
|
+
return `M${cx} ${cy - r} Q${cx + q} ${cy - q} ${cx + r} ${cy} Q${cx + q} ${cy + q} ${cx} ${cy + r} Q${cx - q} ${cy + q} ${cx - r} ${cy} Q${cx - q} ${cy - q} ${cx} ${cy - r}Z`;
|
|
168
|
+
}
|
|
169
|
+
function landingPaint(landing) {
|
|
170
|
+
return landing === "none" ? void 0 : landing;
|
|
171
|
+
}
|
|
172
|
+
function iconDrawing(name, { landing = "free", size = 32 } = {}) {
|
|
173
|
+
const spec = BRAND_ICONS[name];
|
|
174
|
+
const cut = iconCut(size);
|
|
175
|
+
const pen = PEN_WIDTH[cut];
|
|
176
|
+
const shapes = spec.strokes.map((stroke) => {
|
|
177
|
+
const width = pen * (stroke.weight ?? 1);
|
|
178
|
+
const dash = stroke.dotted && cut !== "small" ? `0.01 ${(width * 1.9).toFixed(2)}` : void 0;
|
|
179
|
+
return { _tag: "Line", d: stroke.d, width, paint: "ink", dash };
|
|
180
|
+
});
|
|
181
|
+
const paint = landingPaint(landing);
|
|
182
|
+
if (paint) {
|
|
183
|
+
const { cx, cy, r, shape } = spec.landing;
|
|
184
|
+
shapes.push(shape === "spark" ? { _tag: "Area", d: sparkPath(cx, cy, r * SPARK_SCALE[cut]), paint } : { _tag: "Dot", cx, cy, r: r * DOT_SCALE[cut], paint });
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
viewBox: "0 0 32 32",
|
|
188
|
+
label: spec.label,
|
|
189
|
+
groups: [{ transform: spec.rotate ? `rotate(${spec.rotate} 16 16)` : void 0, shapes }]
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const SUMMIT_REGULAR = {
|
|
193
|
+
pen: 5.4,
|
|
194
|
+
climb: "M5 54 L18.4 37.4 Q21 34.4 23.6 37.4 L27.6 42.4 L39.4 19.6",
|
|
195
|
+
flank: "M48.4 19.6 L60 54",
|
|
196
|
+
dot: { cx: 44, cy: 11.6, r: 6.2 }
|
|
197
|
+
};
|
|
198
|
+
const SUMMIT_SMALL = {
|
|
199
|
+
pen: 8,
|
|
200
|
+
climb: "M6 54 L20 36 L27 43 L38 21",
|
|
201
|
+
flank: "M47 21 L59 54",
|
|
202
|
+
dot: { cx: 44, cy: 12.5, r: 8.4 }
|
|
203
|
+
};
|
|
204
|
+
const FLANK_OPACITY = 0.38;
|
|
205
|
+
function summitShapes(cut, product, ink, style) {
|
|
206
|
+
const flank = { _tag: "Line", d: cut.flank, width: cut.pen, paint: ink, opacity: FLANK_OPACITY };
|
|
207
|
+
if (product === "free")
|
|
208
|
+
return [flank, { _tag: "Line", d: cut.climb, width: cut.pen, paint: ink }, { _tag: "Dot", ...cut.dot, paint: "free" }];
|
|
209
|
+
const gradient = style === "lockup" ? "pro-gradient" : "tile-gradient";
|
|
210
|
+
return [
|
|
211
|
+
flank,
|
|
212
|
+
{ _tag: "Line", d: cut.climb, width: cut.pen, paint: gradient },
|
|
213
|
+
{ _tag: "Dot", ...cut.dot, paint: style === "lockup" ? "pro" : gradient }
|
|
214
|
+
];
|
|
215
|
+
}
|
|
216
|
+
function markDrawing({ product = "free", size = 64 } = {}) {
|
|
217
|
+
const cut = size <= 18 ? SUMMIT_SMALL : SUMMIT_REGULAR;
|
|
218
|
+
return {
|
|
219
|
+
viewBox: "0 0 64 64",
|
|
220
|
+
label: product === "pro" ? "Nuxt SEO Pro" : "Nuxt SEO",
|
|
221
|
+
groups: [{ shapes: summitShapes(cut, product, "ink", "lockup") }]
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function faviconDrawing({ product = "free", size = 32 } = {}) {
|
|
225
|
+
const small = size <= 18;
|
|
226
|
+
const cut = small ? SUMMIT_SMALL : SUMMIT_REGULAR;
|
|
227
|
+
const pad = small ? 3 : 6;
|
|
228
|
+
const scale = (64 - pad * 2) / 64;
|
|
229
|
+
return {
|
|
230
|
+
viewBox: "0 0 64 64",
|
|
231
|
+
label: product === "pro" ? "Nuxt SEO Pro" : "Nuxt SEO",
|
|
232
|
+
groups: [
|
|
233
|
+
{ shapes: [{ _tag: "Tile", size: 64, radius: small ? 12 : 14, paint: "tile" }] },
|
|
234
|
+
{ transform: `translate(${pad} ${pad}) scale(${scale})`, shapes: summitShapes(cut, product, "tile-ink", "favicon") }
|
|
235
|
+
]
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
const PLATE_ICON_SHARE = 44 / 64;
|
|
239
|
+
function iconPlateDrawing(name, { landing = "free", size = 64 } = {}) {
|
|
240
|
+
const icon = iconDrawing(name, { landing, size: size * PLATE_ICON_SHARE });
|
|
241
|
+
const inset = 64 * (1 - PLATE_ICON_SHARE) / 2;
|
|
242
|
+
const scale = 64 * PLATE_ICON_SHARE / 32;
|
|
243
|
+
return {
|
|
244
|
+
viewBox: "0 0 64 64",
|
|
245
|
+
label: icon.label,
|
|
246
|
+
groups: [
|
|
247
|
+
{ shapes: [{ _tag: "Tile", size: 64, radius: 14, paint: "tile" }] },
|
|
248
|
+
...icon.groups.map((group) => ({
|
|
249
|
+
transform: [`translate(${inset} ${inset}) scale(${scale})`, group.transform].filter(Boolean).join(" "),
|
|
250
|
+
shapes: group.shapes.map((shape) => "paint" in shape && shape.paint === "ink" ? { ...shape, paint: "tile-ink" } : shape)
|
|
251
|
+
}))
|
|
252
|
+
]
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
const PRO_LETTERS = [
|
|
256
|
+
"M5.2 27.6 Q4.8 16.4 5.4 5.2",
|
|
257
|
+
"M4.6 5.6 Q13.4 3.8 14.4 9.8 Q15 15.8 5.2 16.2",
|
|
258
|
+
"M20.4 27.6 Q20.2 20.6 20.4 13.2",
|
|
259
|
+
"M20.4 18 Q22.2 13 27.2 13.6",
|
|
260
|
+
"M36.2 13.4 Q30.6 13.6 30.8 20.6 Q31 27.8 36.6 27.6 Q42 27.4 41.8 20.4 Q41.6 13.4 35.4 13.9"
|
|
261
|
+
];
|
|
262
|
+
const PRO_PEN = 3.4;
|
|
263
|
+
function taperedQuadratic(p0, p1, p2, width, steps = 40) {
|
|
264
|
+
const at = (t) => {
|
|
265
|
+
const u = 1 - t;
|
|
266
|
+
return [u * u * p0[0] + 2 * t * u * p1[0] + t * t * p2[0], u * u * p0[1] + 2 * t * u * p1[1] + t * t * p2[1]];
|
|
267
|
+
};
|
|
268
|
+
const tangent = (t) => {
|
|
269
|
+
const dx = 2 * (1 - t) * (p1[0] - p0[0]) + 2 * t * (p2[0] - p1[0]);
|
|
270
|
+
const dy = 2 * (1 - t) * (p1[1] - p0[1]) + 2 * t * (p2[1] - p1[1]);
|
|
271
|
+
const length = Math.hypot(dx, dy) || 1;
|
|
272
|
+
return [dx / length, dy / length];
|
|
273
|
+
};
|
|
274
|
+
const left = [];
|
|
275
|
+
const right = [];
|
|
276
|
+
for (let i = 0; i <= steps; i++) {
|
|
277
|
+
const t = i / steps;
|
|
278
|
+
const [x, y] = at(t);
|
|
279
|
+
const [dx, dy] = tangent(t);
|
|
280
|
+
const half = width(t) / 2;
|
|
281
|
+
left.push([x - dy * half, y + dx * half]);
|
|
282
|
+
right.push([x + dy * half, y - dx * half]);
|
|
283
|
+
}
|
|
284
|
+
const f = (v) => v.toFixed(2);
|
|
285
|
+
const end = right[right.length - 1];
|
|
286
|
+
const rEnd = width(1) / 2;
|
|
287
|
+
const rStart = width(0) / 2;
|
|
288
|
+
return [
|
|
289
|
+
`M${f(left[0][0])} ${f(left[0][1])}`,
|
|
290
|
+
...left.slice(1).map(([x, y]) => `L${f(x)} ${f(y)}`),
|
|
291
|
+
`A${f(rEnd)} ${f(rEnd)} 0 0 0 ${f(end[0])} ${f(end[1])}`,
|
|
292
|
+
...right.slice(0, -1).reverse().map(([x, y]) => `L${f(x)} ${f(y)}`),
|
|
293
|
+
`A${f(rStart)} ${f(rStart)} 0 0 0 ${f(left[0][0])} ${f(left[0][1])}Z`
|
|
294
|
+
].join(" ");
|
|
295
|
+
}
|
|
296
|
+
const PRO_UNDERLINE = taperedQuadratic([-0.6, 36.2], [20, 33.2], [46.4, 32.8], (t) => 3.8 - 2.6 * t ** 1.3);
|
|
297
|
+
const PRO_LETTERING_ASPECT = 52 / 39;
|
|
298
|
+
const PRO_LETTERING_SCALE = 1.55;
|
|
299
|
+
function proLetteringDrawing() {
|
|
300
|
+
return {
|
|
301
|
+
viewBox: "-3 1 52 39",
|
|
302
|
+
label: "Pro",
|
|
303
|
+
groups: [{
|
|
304
|
+
transform: "rotate(-3 23 20)",
|
|
305
|
+
shapes: [
|
|
306
|
+
...PRO_LETTERS.map((d) => ({ _tag: "Line", d, width: PRO_PEN, paint: "pro" })),
|
|
307
|
+
{ _tag: "Area", d: PRO_UNDERLINE, paint: "pro" }
|
|
308
|
+
]
|
|
309
|
+
}]
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
const escapeAttr = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
313
|
+
const isGradient = (paint) => paint === "pro-gradient" || paint === "tile-gradient";
|
|
314
|
+
function drawingToSvg(drawing, options = {}) {
|
|
315
|
+
const { palette } = options;
|
|
316
|
+
const colors = palette ? paletteColors(palette) : CSS_COLORS;
|
|
317
|
+
const gradients = palette ? { "pro-gradient": palette.gradient, "tile-gradient": palette.tileGradient } : CSS_GRADIENTS;
|
|
318
|
+
const gradientId = (gradient) => `${options.idPrefix ?? "nuxtseo"}-${gradient}`;
|
|
319
|
+
const used = /* @__PURE__ */ new Set();
|
|
320
|
+
const paint = (p) => {
|
|
321
|
+
if (!isGradient(p))
|
|
322
|
+
return colors[p];
|
|
323
|
+
used.add(p);
|
|
324
|
+
return `url(#${gradientId(p)})`;
|
|
325
|
+
};
|
|
326
|
+
const shape = (s) => {
|
|
327
|
+
switch (s._tag) {
|
|
328
|
+
case "Line":
|
|
329
|
+
return `<path d="${s.d}" fill="none" stroke="${paint(s.paint)}" stroke-width="${+s.width.toFixed(2)}" stroke-linecap="round" stroke-linejoin="round"${s.dash ? ` stroke-dasharray="${s.dash}"` : ""}${s.opacity === void 0 ? "" : ` opacity="${s.opacity}"`}/>`;
|
|
330
|
+
case "Area":
|
|
331
|
+
return `<path d="${s.d}" fill="${paint(s.paint)}"/>`;
|
|
332
|
+
case "Dot":
|
|
333
|
+
return `<circle cx="${s.cx}" cy="${s.cy}" r="${+s.r.toFixed(2)}" fill="${paint(s.paint)}"/>`;
|
|
334
|
+
case "Tile":
|
|
335
|
+
return `<rect width="${s.size}" height="${s.size}" rx="${s.radius}" fill="${paint(s.paint)}"/>`;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
const body = drawing.groups.map((group) => {
|
|
339
|
+
const inner = group.shapes.map(shape).join("");
|
|
340
|
+
return group.transform ? `<g transform="${group.transform}">${inner}</g>` : inner;
|
|
341
|
+
}).join("");
|
|
342
|
+
const defs = used.size ? `<defs>${[...used].map((g) => `<linearGradient id="${gradientId(g)}" x1="0" y1="1" x2="1" y2="0"><stop offset="0" style="stop-color:${gradients[g].from}"/><stop offset="1" style="stop-color:${gradients[g].to}"/></linearGradient>`).join("")}</defs>` : "";
|
|
343
|
+
const size = [
|
|
344
|
+
options.width === void 0 ? "" : ` width="${options.width}"`,
|
|
345
|
+
options.height === void 0 ? "" : ` height="${options.height}"`
|
|
346
|
+
].join("");
|
|
347
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${drawing.viewBox}"${size} role="img" aria-label="${escapeAttr(drawing.label)}"${options.attrs ? ` ${options.attrs}` : ""}>${defs}${body}</svg>`;
|
|
348
|
+
}
|
|
349
|
+
function isBrandIconName(value) {
|
|
350
|
+
return Object.hasOwn(BRAND_ICONS, value);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export { BRAND_ICONS, BRAND_PALETTE_DARK, BRAND_PALETTE_LIGHT, PRO_LETTERING_ASPECT, PRO_LETTERING_SCALE, drawingToSvg, faviconDrawing, iconDrawing, iconPlateDrawing, isBrandIconName, markDrawing, proLetteringDrawing };
|