Fix code quality violations and exclude Manifest from checks
Document application modes (development/debug/production) Add global file drop handler, order column normalization, SPA hash fix Serve CDN assets via /_vendor/ URLs instead of merging into bundles Add production minification with license preservation Improve JSON formatting for debugging and production optimization Add CDN asset caching with CSS URL inlining for production builds Add three-mode system (development, debug, production) Update Manifest CLAUDE.md to reflect helper class architecture Refactor Manifest.php into helper classes for better organization Pre-manifest-refactor checkpoint: Add app_mode documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
70
node_modules/svgo/plugins/collapseGroups.js
generated
vendored
70
node_modules/svgo/plugins/collapseGroups.js
generated
vendored
@@ -1,23 +1,18 @@
|
||||
'use strict';
|
||||
import { collectStylesheet, computeStyle } from '../lib/style.js';
|
||||
import { elemsGroups, inheritableAttrs } from './_collections.js';
|
||||
|
||||
export const name = 'collapseGroups';
|
||||
export const description = 'collapses useless groups';
|
||||
|
||||
/**
|
||||
* @typedef {import('../lib/types').XastNode} XastNode
|
||||
*/
|
||||
|
||||
const { inheritableAttrs, elemsGroups } = require('./_collections.js');
|
||||
|
||||
exports.type = 'visitor';
|
||||
exports.name = 'collapseGroups';
|
||||
exports.active = true;
|
||||
exports.description = 'collapses useless groups';
|
||||
|
||||
/**
|
||||
* @type {(node: XastNode, name: string) => boolean}
|
||||
* @param {import('../lib/types.js').XastNode} node
|
||||
* @param {string} name
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const hasAnimatedAttr = (node, name) => {
|
||||
if (node.type === 'element') {
|
||||
if (
|
||||
elemsGroups.animation.includes(node.name) &&
|
||||
elemsGroups.animation.has(node.name) &&
|
||||
node.attributes.attributeName === name
|
||||
) {
|
||||
return true;
|
||||
@@ -40,20 +35,22 @@ const hasAnimatedAttr = (node, name) => {
|
||||
* <path d="..."/>
|
||||
* </g>
|
||||
* </g>
|
||||
* ⬇
|
||||
* ⬇
|
||||
* <g>
|
||||
* <g>
|
||||
* <path attr1="val1" d="..."/>
|
||||
* </g>
|
||||
* </g>
|
||||
* ⬇
|
||||
* ⬇
|
||||
* <path attr1="val1" d="..."/>
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<void>}
|
||||
* @type {import('../lib/types.js').Plugin}
|
||||
*/
|
||||
exports.fn = () => {
|
||||
export const fn = (root) => {
|
||||
const stylesheet = collectStylesheet(root);
|
||||
|
||||
return {
|
||||
element: {
|
||||
exit: (node, parentNode) => {
|
||||
@@ -65,17 +62,20 @@ exports.fn = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// move group attibutes to the single child element
|
||||
// move group attributes to the single child element
|
||||
if (
|
||||
Object.keys(node.attributes).length !== 0 &&
|
||||
node.children.length === 1
|
||||
) {
|
||||
const firstChild = node.children[0];
|
||||
const nodeHasFilter = !!(
|
||||
node.attributes.filter || computeStyle(stylesheet, node).filter
|
||||
);
|
||||
// TODO untangle this mess
|
||||
if (
|
||||
firstChild.type === 'element' &&
|
||||
firstChild.attributes.id == null &&
|
||||
node.attributes.filter == null &&
|
||||
!nodeHasFilter &&
|
||||
(node.attributes.class == null ||
|
||||
firstChild.attributes.class == null) &&
|
||||
((node.attributes['clip-path'] == null &&
|
||||
@@ -84,26 +84,30 @@ exports.fn = () => {
|
||||
node.attributes.transform == null &&
|
||||
firstChild.attributes.transform == null))
|
||||
) {
|
||||
const newChildElemAttrs = { ...firstChild.attributes };
|
||||
|
||||
for (const [name, value] of Object.entries(node.attributes)) {
|
||||
// avoid copying to not conflict with animated attribute
|
||||
if (hasAnimatedAttr(firstChild, name)) {
|
||||
return;
|
||||
}
|
||||
if (firstChild.attributes[name] == null) {
|
||||
firstChild.attributes[name] = value;
|
||||
|
||||
if (newChildElemAttrs[name] == null) {
|
||||
newChildElemAttrs[name] = value;
|
||||
} else if (name === 'transform') {
|
||||
firstChild.attributes[name] =
|
||||
value + ' ' + firstChild.attributes[name];
|
||||
} else if (firstChild.attributes[name] === 'inherit') {
|
||||
firstChild.attributes[name] = value;
|
||||
newChildElemAttrs[name] = value + ' ' + newChildElemAttrs[name];
|
||||
} else if (newChildElemAttrs[name] === 'inherit') {
|
||||
newChildElemAttrs[name] = value;
|
||||
} else if (
|
||||
inheritableAttrs.includes(name) === false &&
|
||||
firstChild.attributes[name] !== value
|
||||
!inheritableAttrs.has(name) &&
|
||||
newChildElemAttrs[name] !== value
|
||||
) {
|
||||
return;
|
||||
}
|
||||
delete node.attributes[name];
|
||||
}
|
||||
|
||||
node.attributes = {};
|
||||
firstChild.attributes = newChildElemAttrs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +118,7 @@ exports.fn = () => {
|
||||
for (const child of node.children) {
|
||||
if (
|
||||
child.type === 'element' &&
|
||||
elemsGroups.animation.includes(child.name)
|
||||
elemsGroups.animation.has(child.name)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -122,12 +126,6 @@ exports.fn = () => {
|
||||
// replace current node with all its children
|
||||
const index = parentNode.children.indexOf(node);
|
||||
parentNode.children.splice(index, 1, ...node.children);
|
||||
// TODO remove in v3
|
||||
for (const child of node.children) {
|
||||
// @ts-ignore parentNode is forbidden for public usage
|
||||
// and will be moved in v3
|
||||
child.parentNode = parentNode;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user