This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

21
node_modules/@docusaurus/cssnano-preset/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3
node_modules/@docusaurus/cssnano-preset/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# `@docusaurus/cssnano-preset`
An advanced cssnano preset for maximum optimization.

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import advancedBasePreset from 'cssnano-preset-advanced';
declare const preset: typeof advancedBasePreset;
export = preset;

23
node_modules/@docusaurus/cssnano-preset/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const tslib_1 = require("tslib");
const cssnano_preset_advanced_1 = tslib_1.__importDefault(require("cssnano-preset-advanced"));
const postcss_sort_media_queries_1 = tslib_1.__importDefault(require("postcss-sort-media-queries"));
const remove_overridden_custom_properties_1 = tslib_1.__importDefault(require("./remove-overridden-custom-properties"));
const preset = function preset(opts) {
const advancedPreset = (0, cssnano_preset_advanced_1.default)({
autoprefixer: { add: false },
discardComments: { removeAll: true },
/* cSpell:ignore zindex */
zindex: false,
...opts,
});
advancedPreset.plugins.unshift([postcss_sort_media_queries_1.default, undefined], [remove_overridden_custom_properties_1.default, undefined]);
return advancedPreset;
};
module.exports = preset;

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { Plugin } from 'postcss';
/**
* This PostCSS plugin will remove duplicate/same custom properties (which are
* actually overridden ones) **only** from `:root` selector.
*
* Depending on the presence of an `!important` rule in value of custom
* property, the following actions will happen:
*
* - If the same custom properties do **not** have an `!important` rule, then
* all of them will be removed except for the last one (which will actually be
* applied).
* - If the same custom properties have at least one `!important` rule, then
* only those properties that do not have this rule will be removed.
*/
declare function creator(): Plugin;
declare namespace creator {
var postcss: true;
}
export default creator;

View File

@@ -0,0 +1,40 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const isRule = (node) => node?.type === 'rule';
/**
* This PostCSS plugin will remove duplicate/same custom properties (which are
* actually overridden ones) **only** from `:root` selector.
*
* Depending on the presence of an `!important` rule in value of custom
* property, the following actions will happen:
*
* - If the same custom properties do **not** have an `!important` rule, then
* all of them will be removed except for the last one (which will actually be
* applied).
* - If the same custom properties have at least one `!important` rule, then
* only those properties that do not have this rule will be removed.
*/
function creator() {
return {
postcssPlugin: 'postcss-remove-overridden-custom-properties',
Declaration(decl) {
if (!isRule(decl.parent) || decl.parent.selector !== ':root') {
return;
}
const sameProperties = decl.parent.nodes.filter((n) => 'prop' in n && n.prop === decl.prop);
const hasImportantProperties = sameProperties.some((p) => 'important' in p);
const overriddenProperties = hasImportantProperties
? sameProperties.filter((p) => !('important' in p))
: sameProperties.slice(0, -1);
overriddenProperties.map((p) => p.remove());
},
};
}
creator.postcss = true;
exports.default = creator;

32
node_modules/@docusaurus/cssnano-preset/package.json generated vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "@docusaurus/cssnano-preset",
"version": "3.1.1",
"description": "Advanced cssnano preset for maximum optimization.",
"main": "lib/index.js",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"watch": "tsc --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-cssnano-preset"
},
"dependencies": {
"cssnano-preset-advanced": "^5.3.10",
"postcss": "^8.4.26",
"postcss-sort-media-queries": "^4.4.1",
"tslib": "^2.6.0"
},
"devDependencies": {
"to-vfile": "^6.1.0"
},
"engines": {
"node": ">=18.0"
},
"gitHead": "8017f6a6776ba1bd7065e630a52fe2c2654e2f1b"
}

11
node_modules/@docusaurus/cssnano-preset/src/deps.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
declare module 'postcss-sort-media-queries' {
const plugin: import('postcss').PluginCreator<object>;
export default plugin;
}

29
node_modules/@docusaurus/cssnano-preset/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import advancedBasePreset from 'cssnano-preset-advanced';
import postCssSortMediaQueries from 'postcss-sort-media-queries';
import postCssRemoveOverriddenCustomProperties from './remove-overridden-custom-properties';
const preset: typeof advancedBasePreset = function preset(opts) {
const advancedPreset = advancedBasePreset({
autoprefixer: {add: false},
discardComments: {removeAll: true},
/* cSpell:ignore zindex */
zindex: false,
...opts,
});
advancedPreset.plugins.unshift(
[postCssSortMediaQueries, undefined],
[postCssRemoveOverriddenCustomProperties, undefined],
);
return advancedPreset;
};
export = preset;

View File

@@ -0,0 +1,51 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type {Plugin, Rule, Node} from 'postcss';
const isRule = (node: Node | undefined): node is Rule => node?.type === 'rule';
/**
* This PostCSS plugin will remove duplicate/same custom properties (which are
* actually overridden ones) **only** from `:root` selector.
*
* Depending on the presence of an `!important` rule in value of custom
* property, the following actions will happen:
*
* - If the same custom properties do **not** have an `!important` rule, then
* all of them will be removed except for the last one (which will actually be
* applied).
* - If the same custom properties have at least one `!important` rule, then
* only those properties that do not have this rule will be removed.
*/
function creator(): Plugin {
return {
postcssPlugin: 'postcss-remove-overridden-custom-properties',
Declaration(decl) {
if (!isRule(decl.parent) || decl.parent.selector !== ':root') {
return;
}
const sameProperties = decl.parent.nodes.filter(
(n) => 'prop' in n && n.prop === decl.prop,
);
const hasImportantProperties = sameProperties.some(
(p) => 'important' in p,
);
const overriddenProperties = hasImportantProperties
? sameProperties.filter((p) => !('important' in p))
: sameProperties.slice(0, -1);
overriddenProperties.map((p) => p.remove());
},
};
}
creator.postcss = true as const;
export default creator;