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:
43
node_modules/svgo/plugins/removeOffCanvasPaths.js
generated
vendored
43
node_modules/svgo/plugins/removeOffCanvasPaths.js
generated
vendored
@@ -1,29 +1,22 @@
|
||||
'use strict';
|
||||
import { detachNodeFromParent } from '../lib/xast.js';
|
||||
import { visitSkip } from '../lib/util/visit.js';
|
||||
import { parsePathData } from '../lib/path.js';
|
||||
import { intersects } from './_path.js';
|
||||
|
||||
export const name = 'removeOffCanvasPaths';
|
||||
export const description =
|
||||
'removes elements that are drawn outside of the viewBox (disabled by default)';
|
||||
|
||||
/**
|
||||
* @typedef {import('../lib/types').PathDataItem} PathDataItem
|
||||
*/
|
||||
|
||||
const { visitSkip, detachNodeFromParent } = require('../lib/xast.js');
|
||||
const { parsePathData } = require('../lib/path.js');
|
||||
const { intersects } = require('./_path.js');
|
||||
|
||||
exports.type = 'visitor';
|
||||
exports.name = 'removeOffCanvasPaths';
|
||||
exports.active = false;
|
||||
exports.description =
|
||||
'removes elements that are drawn outside of the viewbox (disabled by default)';
|
||||
|
||||
/**
|
||||
* Remove elements that are drawn outside of the viewbox.
|
||||
* Remove elements that are drawn outside of the viewBox.
|
||||
*
|
||||
* @author JoshyPHP
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<void>}
|
||||
* @type {import('../lib/types.js').Plugin}
|
||||
*/
|
||||
exports.fn = () => {
|
||||
export const fn = () => {
|
||||
/**
|
||||
* @type {null | {
|
||||
* @type {?{
|
||||
* top: number,
|
||||
* right: number,
|
||||
* bottom: number,
|
||||
@@ -39,7 +32,7 @@ exports.fn = () => {
|
||||
enter: (node, parentNode) => {
|
||||
if (node.name === 'svg' && parentNode.type === 'root') {
|
||||
let viewBox = '';
|
||||
// find viewbox
|
||||
// find viewBox
|
||||
if (node.attributes.viewBox != null) {
|
||||
// remove commas and plus signs, normalize and trim whitespace
|
||||
viewBox = node.attributes.viewBox;
|
||||
@@ -50,7 +43,7 @@ exports.fn = () => {
|
||||
viewBox = `0 0 ${node.attributes.width} ${node.attributes.height}`;
|
||||
}
|
||||
|
||||
// parse viewbox
|
||||
// parse viewBox
|
||||
// remove commas and plus signs, normalize and trim whitespace
|
||||
viewBox = viewBox
|
||||
.replace(/[,+]|px/g, ' ')
|
||||
@@ -59,7 +52,7 @@ exports.fn = () => {
|
||||
// ensure that the dimensions are 4 values separated by space
|
||||
const m =
|
||||
/^(-?\d*\.?\d+) (-?\d*\.?\d+) (\d*\.?\d+) (\d*\.?\d+)$/.exec(
|
||||
viewBox
|
||||
viewBox,
|
||||
);
|
||||
if (m == null) {
|
||||
return;
|
||||
@@ -92,7 +85,7 @@ exports.fn = () => {
|
||||
) {
|
||||
const pathData = parsePathData(node.attributes.d);
|
||||
|
||||
// consider that a M command within the viewBox is visible
|
||||
// consider that an M command within the viewBox is visible
|
||||
let visible = false;
|
||||
for (const pathDataItem of pathData) {
|
||||
if (pathDataItem.command === 'M') {
|
||||
@@ -117,9 +110,7 @@ exports.fn = () => {
|
||||
}
|
||||
|
||||
const { left, top, width, height } = viewBoxData;
|
||||
/**
|
||||
* @type {Array<PathDataItem>}
|
||||
*/
|
||||
/** @type {ReadonlyArray<import('../lib/types.js').PathDataItem>} */
|
||||
const viewBoxPathData = [
|
||||
{ command: 'M', args: [left, top] },
|
||||
{ command: 'h', args: [width] },
|
||||
|
||||
Reference in New Issue
Block a user