@se-studio/contentful-rest-api 1.0.128 → 1.0.130
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.
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
* SVG processing utilities for icon sprite generation.
|
|
3
3
|
* These functions fetch and process SVG content during data conversion.
|
|
4
4
|
*/
|
|
5
|
+
export type SvgIssueCode = 'CSS_FILL_STROKE' | 'CSS_COMPLEX_SELECTORS' | 'CSS_AT_RULES' | 'CSS_VARS' | 'DEFS_REFERENCES' | 'NESTED_USE' | 'EMBEDDED_IMAGE';
|
|
6
|
+
export interface SvgIssue {
|
|
7
|
+
severity: 'warn';
|
|
8
|
+
code: SvgIssueCode;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Inspects raw SVG content for patterns that are known to render incorrectly
|
|
13
|
+
* or unreliably when the SVG is embedded as a <symbol> in a sprite sheet and
|
|
14
|
+
* referenced via <use>.
|
|
15
|
+
*
|
|
16
|
+
* Call this before or alongside processSvgForSprite to surface actionable
|
|
17
|
+
* warnings in server logs at conversion time.
|
|
18
|
+
*
|
|
19
|
+
* @param svgContent - The raw SVG content
|
|
20
|
+
* @param iconId - Unique identifier used in log messages
|
|
21
|
+
* @returns Array of issues found (empty = no known problems)
|
|
22
|
+
*/
|
|
23
|
+
export declare function detectSvgIssues(svgContent: string, iconId: string): SvgIssue[];
|
|
24
|
+
/**
|
|
25
|
+
* Converts CSS class-based fill/stroke rules (e.g. Illustrator's .st0) to
|
|
26
|
+
* inline presentation attributes on the matching elements, then removes the
|
|
27
|
+
* <style> block (and any now-empty <defs>).
|
|
28
|
+
*
|
|
29
|
+
* Only handles simple single-class selectors (.st0 { fill: #xxx }). Complex
|
|
30
|
+
* selectors (child combinators, pseudo-classes, compound classes, etc.) are
|
|
31
|
+
* left untouched — the caller should have already detected CSS_COMPLEX_SELECTORS
|
|
32
|
+
* and decided not to call this function in that case.
|
|
33
|
+
*
|
|
34
|
+
* @param svgContent - Raw SVG markup
|
|
35
|
+
* @returns SVG markup with class-based fills/strokes converted to attributes
|
|
36
|
+
*/
|
|
37
|
+
export declare function inlineSvgClassStyles(svgContent: string): string;
|
|
5
38
|
/**
|
|
6
39
|
* Fetches SVG content from a URL.
|
|
7
40
|
* Uses the parent request's cache tags (page-level) for revalidation.
|
|
@@ -14,6 +47,8 @@ export declare function fetchSvgContent(url: string): Promise<string>;
|
|
|
14
47
|
/**
|
|
15
48
|
* Processes SVG content for use in a sprite sheet.
|
|
16
49
|
* Extracts the SVG content and wraps it in a symbol element.
|
|
50
|
+
* Emits console.warn for any patterns that are known to render incorrectly
|
|
51
|
+
* or unreliably via <use> (see detectSvgIssues).
|
|
17
52
|
*
|
|
18
53
|
* @param svgContent - The raw SVG content
|
|
19
54
|
* @param iconId - Unique identifier for the icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svgProcessor.d.ts","sourceRoot":"","sources":["../../src/converters/svgProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMlE;AAED
|
|
1
|
+
{"version":3,"file":"svgProcessor.d.ts","sourceRoot":"","sources":["../../src/converters/svgProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,uBAAuB,GACvB,cAAc,GACd,UAAU,GACV,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CA+F9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAuD/D;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAwC9E"}
|
|
@@ -2,6 +2,165 @@
|
|
|
2
2
|
* SVG processing utilities for icon sprite generation.
|
|
3
3
|
* These functions fetch and process SVG content during data conversion.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Inspects raw SVG content for patterns that are known to render incorrectly
|
|
7
|
+
* or unreliably when the SVG is embedded as a <symbol> in a sprite sheet and
|
|
8
|
+
* referenced via <use>.
|
|
9
|
+
*
|
|
10
|
+
* Call this before or alongside processSvgForSprite to surface actionable
|
|
11
|
+
* warnings in server logs at conversion time.
|
|
12
|
+
*
|
|
13
|
+
* @param svgContent - The raw SVG content
|
|
14
|
+
* @param iconId - Unique identifier used in log messages
|
|
15
|
+
* @returns Array of issues found (empty = no known problems)
|
|
16
|
+
*/
|
|
17
|
+
export function detectSvgIssues(svgContent, iconId) {
|
|
18
|
+
const issues = [];
|
|
19
|
+
// --- CSS <style> block analysis ---
|
|
20
|
+
const styleBlockMatch = svgContent.match(/<style[^>]*>([\s\S]*?)<\/style>/i);
|
|
21
|
+
if (styleBlockMatch) {
|
|
22
|
+
const styleContent = styleBlockMatch[1] ?? '';
|
|
23
|
+
// fill/stroke rules → class names collide across icons in the same sprite
|
|
24
|
+
// sheet; CSS may also not cross the <use> shadow boundary in all browsers
|
|
25
|
+
if (/\b(fill|stroke)\s*:/i.test(styleContent)) {
|
|
26
|
+
issues.push({
|
|
27
|
+
severity: 'warn',
|
|
28
|
+
code: 'CSS_FILL_STROKE',
|
|
29
|
+
message: `Icon "${iconId}" uses CSS class-based fill/stroke (e.g. Illustrator's .st0). ` +
|
|
30
|
+
'Class names collide when multiple SVGs share the sprite sheet, and the styles ' +
|
|
31
|
+
'may not apply through <use>. Convert fills/strokes to inline presentation attributes.',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// Complex selectors that can't be mechanically inlined
|
|
35
|
+
// Matches: child/sibling operators (> ~ +), attribute selectors ([...]),
|
|
36
|
+
// pseudo-classes (:[a-z], e.g. :hover), compound class selectors (.a.b),
|
|
37
|
+
// element+class (path.x).
|
|
38
|
+
// Note: `:` is only matched when followed by a letter to avoid false-positives
|
|
39
|
+
// from CSS property values such as `fill:#8b6ffe`.
|
|
40
|
+
if (/[>~+[\]]|:[a-zA-Z]|[a-z]\.[\w-]|\.[\w-]+\.[\w-]/i.test(styleContent)) {
|
|
41
|
+
issues.push({
|
|
42
|
+
severity: 'warn',
|
|
43
|
+
code: 'CSS_COMPLEX_SELECTORS',
|
|
44
|
+
message: `Icon "${iconId}" uses complex CSS selectors that cannot be automatically inlined. ` +
|
|
45
|
+
'Manual SVG cleanup is required.',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// @font-face / @keyframes won't scope correctly inside a sprite sheet
|
|
49
|
+
if (/@font-face|@keyframes/i.test(styleContent)) {
|
|
50
|
+
issues.push({
|
|
51
|
+
severity: 'warn',
|
|
52
|
+
code: 'CSS_AT_RULES',
|
|
53
|
+
message: `Icon "${iconId}" contains @font-face or @keyframes rules inside a <style> block. ` +
|
|
54
|
+
'These will not scope correctly when embedded in a sprite sheet.',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// CSS custom properties — must be defined on the host document to take effect
|
|
59
|
+
if (/var\s*\(/i.test(svgContent)) {
|
|
60
|
+
issues.push({
|
|
61
|
+
severity: 'warn',
|
|
62
|
+
code: 'CSS_VARS',
|
|
63
|
+
message: `Icon "${iconId}" uses CSS custom properties (var(...)). ` +
|
|
64
|
+
'These must be defined on the host document; they will have no fallback inside the sprite.',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// url(#...) references to <defs> (gradients, filters, clipPaths, patterns)
|
|
68
|
+
// Work in modern browsers but are fragile across the <use> boundary in older ones
|
|
69
|
+
if (/url\(#[^)]+\)/i.test(svgContent)) {
|
|
70
|
+
issues.push({
|
|
71
|
+
severity: 'warn',
|
|
72
|
+
code: 'DEFS_REFERENCES',
|
|
73
|
+
message: `Icon "${iconId}" uses url(#...) references (gradients, filters, or clipPaths). ` +
|
|
74
|
+
'These work in modern browsers but may fail in older ones when used inside a sprite.',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Nested <use> — internal href targets break when the SVG moves into a foreign sprite sheet
|
|
78
|
+
if (/<use[\s>]/i.test(svgContent)) {
|
|
79
|
+
issues.push({
|
|
80
|
+
severity: 'warn',
|
|
81
|
+
code: 'NESTED_USE',
|
|
82
|
+
message: `Icon "${iconId}" contains nested <use> elements. ` +
|
|
83
|
+
'Internal href targets may not resolve correctly inside a sprite sheet.',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// Embedded <image> — unusual in an icon; raster content bloats the sprite
|
|
87
|
+
if (/<image[\s>]/i.test(svgContent)) {
|
|
88
|
+
issues.push({
|
|
89
|
+
severity: 'warn',
|
|
90
|
+
code: 'EMBEDDED_IMAGE',
|
|
91
|
+
message: `Icon "${iconId}" contains an embedded <image> element. ` +
|
|
92
|
+
'Raster images inside a sprite sheet are unusual and may not render as expected.',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return issues;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Converts CSS class-based fill/stroke rules (e.g. Illustrator's .st0) to
|
|
99
|
+
* inline presentation attributes on the matching elements, then removes the
|
|
100
|
+
* <style> block (and any now-empty <defs>).
|
|
101
|
+
*
|
|
102
|
+
* Only handles simple single-class selectors (.st0 { fill: #xxx }). Complex
|
|
103
|
+
* selectors (child combinators, pseudo-classes, compound classes, etc.) are
|
|
104
|
+
* left untouched — the caller should have already detected CSS_COMPLEX_SELECTORS
|
|
105
|
+
* and decided not to call this function in that case.
|
|
106
|
+
*
|
|
107
|
+
* @param svgContent - Raw SVG markup
|
|
108
|
+
* @returns SVG markup with class-based fills/strokes converted to attributes
|
|
109
|
+
*/
|
|
110
|
+
export function inlineSvgClassStyles(svgContent) {
|
|
111
|
+
const styleBlockMatch = svgContent.match(/<style[^>]*>([\s\S]*?)<\/style>/i);
|
|
112
|
+
if (!styleBlockMatch)
|
|
113
|
+
return svgContent;
|
|
114
|
+
const styleContent = styleBlockMatch[1] ?? '';
|
|
115
|
+
// Build a map of className → { fill?, stroke? } from simple .cls { ... } rules.
|
|
116
|
+
// We skip any rule whose selector contains combinators or pseudo-classes because
|
|
117
|
+
// those can't be mechanically inlined element-by-element.
|
|
118
|
+
const classStyles = {};
|
|
119
|
+
const ruleRegex = /\.([\w-]+)\s*\{([^}]+)\}/g;
|
|
120
|
+
for (const ruleMatch of styleContent.matchAll(ruleRegex)) {
|
|
121
|
+
const className = ruleMatch[1];
|
|
122
|
+
const body = ruleMatch[2];
|
|
123
|
+
if (!className || !body)
|
|
124
|
+
continue;
|
|
125
|
+
const props = {};
|
|
126
|
+
const propRegex = /\b(fill|stroke)\s*:\s*([^;}\s]+)/gi;
|
|
127
|
+
for (const propMatch of body.matchAll(propRegex)) {
|
|
128
|
+
const prop = propMatch[1];
|
|
129
|
+
const value = propMatch[2];
|
|
130
|
+
if (prop && value)
|
|
131
|
+
props[prop.toLowerCase()] = value;
|
|
132
|
+
}
|
|
133
|
+
if (Object.keys(props).length > 0)
|
|
134
|
+
classStyles[className] = props;
|
|
135
|
+
}
|
|
136
|
+
if (Object.keys(classStyles).length === 0)
|
|
137
|
+
return svgContent;
|
|
138
|
+
// Apply the collected styles as presentation attributes on matching elements.
|
|
139
|
+
// Matches any opening tag that carries a class="..." attribute.
|
|
140
|
+
svgContent = svgContent.replace(/(<[a-zA-Z][a-zA-Z0-9]*\b[^>]*?\bclass\s*=\s*["']([^"']*)["'][^>]*?>)/g, (fullTag, _unused, classAttr) => {
|
|
141
|
+
const classes = classAttr.trim().split(/\s+/);
|
|
142
|
+
let extra = '';
|
|
143
|
+
for (const cls of classes) {
|
|
144
|
+
const styles = classStyles[cls];
|
|
145
|
+
if (!styles)
|
|
146
|
+
continue;
|
|
147
|
+
for (const [prop, value] of Object.entries(styles)) {
|
|
148
|
+
// Don't overwrite an existing presentation attribute.
|
|
149
|
+
if (!new RegExp(`\\b${prop}\\s*=`, 'i').test(fullTag)) {
|
|
150
|
+
extra += ` ${prop}="${value}"`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (!extra)
|
|
155
|
+
return fullTag;
|
|
156
|
+
// Insert before the closing > or />.
|
|
157
|
+
return fullTag.replace(/(\s*\/?>)$/, `${extra}$1`);
|
|
158
|
+
});
|
|
159
|
+
// Remove the <style> block and any <defs> that are now empty.
|
|
160
|
+
svgContent = svgContent.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, '');
|
|
161
|
+
svgContent = svgContent.replace(/<defs[^>]*>\s*<\/defs>/gi, '');
|
|
162
|
+
return svgContent;
|
|
163
|
+
}
|
|
5
164
|
/**
|
|
6
165
|
* Fetches SVG content from a URL.
|
|
7
166
|
* Uses the parent request's cache tags (page-level) for revalidation.
|
|
@@ -20,12 +179,32 @@ export async function fetchSvgContent(url) {
|
|
|
20
179
|
/**
|
|
21
180
|
* Processes SVG content for use in a sprite sheet.
|
|
22
181
|
* Extracts the SVG content and wraps it in a symbol element.
|
|
182
|
+
* Emits console.warn for any patterns that are known to render incorrectly
|
|
183
|
+
* or unreliably via <use> (see detectSvgIssues).
|
|
23
184
|
*
|
|
24
185
|
* @param svgContent - The raw SVG content
|
|
25
186
|
* @param iconId - Unique identifier for the icon
|
|
26
187
|
* @returns Processed SVG symbol element as a string
|
|
27
188
|
*/
|
|
28
189
|
export function processSvgForSprite(svgContent, iconId) {
|
|
190
|
+
// Detect known problematic patterns before processing
|
|
191
|
+
const issues = detectSvgIssues(svgContent, iconId);
|
|
192
|
+
const hasFillStroke = issues.some((i) => i.code === 'CSS_FILL_STROKE');
|
|
193
|
+
const hasComplexSelectors = issues.some((i) => i.code === 'CSS_COMPLEX_SELECTORS');
|
|
194
|
+
if (hasFillStroke && !hasComplexSelectors) {
|
|
195
|
+
// Safe to auto-fix: inline the class-based fills/strokes as presentation attributes.
|
|
196
|
+
svgContent = inlineSvgClassStyles(svgContent);
|
|
197
|
+
// Re-detect on the fixed content so we only warn about issues that remain.
|
|
198
|
+
const remaining = detectSvgIssues(svgContent, iconId).filter((i) => i.code !== 'CSS_FILL_STROKE');
|
|
199
|
+
for (const issue of remaining) {
|
|
200
|
+
console.warn(`[SVG sprite] ${issue.message}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
for (const issue of issues) {
|
|
205
|
+
console.warn(`[SVG sprite] ${issue.message}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
29
208
|
// Parse the SVG to extract viewBox and content
|
|
30
209
|
// Handle optional spaces around equals sign
|
|
31
210
|
const viewBoxMatch = svgContent.match(/viewBox\s*=\s*["']([^"']+)["']/i);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svgProcessor.js","sourceRoot":"","sources":["../../src/converters/svgProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"svgProcessor.js","sourceRoot":"","sources":["../../src/converters/svgProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,UAAkB,EAAE,MAAc;IAChE,MAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,qCAAqC;IACrC,MAAM,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC7E,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,YAAY,GAAG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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/contentful-rest-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.130",
|
|
4
4
|
"description": "Type-safe Contentful REST API client with caching and rate limiting for Next.js applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"url": "https://github.com/Something-Else-Studio/se-core-product/issues"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@contentful/rich-text-types": "^17.2.
|
|
51
|
-
"contentful": "^11.12.
|
|
50
|
+
"@contentful/rich-text-types": "^17.2.7",
|
|
51
|
+
"contentful": "^11.12.1",
|
|
52
52
|
"server-only": "0.0.1",
|
|
53
53
|
"@se-studio/core-data-types": "1.0.125"
|
|
54
54
|
},
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"next": ">=15.5.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@biomejs/biome": "^2.4.
|
|
60
|
-
"@types/node": "^22.19.
|
|
61
|
-
"next": "^15.5.
|
|
59
|
+
"@biomejs/biome": "^2.4.12",
|
|
60
|
+
"@types/node": "^22.19.17",
|
|
61
|
+
"next": "^15.5.15",
|
|
62
62
|
"typescript": "^6.0.2",
|
|
63
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.4"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsc --project tsconfig.build.json",
|