planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

94
node_modules/decap-cms-widget-colorstring/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,94 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.1.3](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.2...decap-cms-widget-colorstring@3.1.3) (2024-08-13)
### Reverts
- Revert "Update dependencies (#7264)" ([22d483a](https://github.com/decaporg/decap-cms/commit/22d483a5b0c654071ae05735ac4f49abdc13d38c)), closes [#7264](https://github.com/decaporg/decap-cms/issues/7264)
## [3.1.2](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.1...decap-cms-widget-colorstring@3.1.2) (2024-08-13)
**Note:** Version bump only for package decap-cms-widget-colorstring
## [3.1.1](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.0-beta.2...decap-cms-widget-colorstring@3.1.1) (2024-03-21)
**Note:** Version bump only for package decap-cms-widget-colorstring
# [3.1.0](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.0-beta.2...decap-cms-widget-colorstring@3.1.0) (2024-02-01)
**Note:** Version bump only for package decap-cms-widget-colorstring
# [3.1.0-beta.2](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.0-beta.1...decap-cms-widget-colorstring@3.1.0-beta.2) (2024-01-31)
**Note:** Version bump only for package decap-cms-widget-colorstring
# [3.1.0-beta.1](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.0-beta.0...decap-cms-widget-colorstring@3.1.0-beta.1) (2024-01-16)
### Bug Fixes
- **#7007:** Replace validate color with tiny color 2 ([#7009](https://github.com/decaporg/decap-cms/issues/7009)) ([76b469c](https://github.com/decaporg/decap-cms/commit/76b469c754953a54dce60ac678eb3b4089850760)), closes [#7007](https://github.com/decaporg/decap-cms/issues/7007)
# [3.1.0-beta.0](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.1.0...decap-cms-widget-colorstring@3.1.0-beta.0) (2023-10-20)
### Reverts
- Revert "chore(release): publish" ([b89fc89](https://github.com/decaporg/decap-cms/commit/b89fc894dfbb5f4136b2e5427fd25a29378a58c6))
## [3.0.2](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.0.1...decap-cms-widget-colorstring@3.0.2) (2023-10-13)
**Note:** Version bump only for package decap-cms-widget-colorstring
## [3.0.1](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@3.0.0...decap-cms-widget-colorstring@3.0.1) (2023-08-25)
### Bug Fixes
- update peer dependencies ([#6886](https://github.com/decaporg/decap-cms/issues/6886)) ([e580ce5](https://github.com/decaporg/decap-cms/commit/e580ce52ce5f80fa040e8fbcab7fed0744f4f695))
# [3.0.0](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@1.2.0...decap-cms-widget-colorstring@3.0.0) (2023-08-18)
**Note:** Version bump only for package decap-cms-widget-colorstring
# [1.2.0](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@1.2.0-beta.0...decap-cms-widget-colorstring@1.2.0) (2023-08-18)
**Note:** Version bump only for package decap-cms-widget-colorstring
# 1.2.0-beta.0 (2023-08-18)
### Features
- rename packages ([#6863](https://github.com/decaporg/decap-cms/issues/6863)) ([d515e7b](https://github.com/decaporg/decap-cms/commit/d515e7bd33216a775d96887b08c4f7b1962941bb))
## [1.1.3-beta.0](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@1.1.2...decap-cms-widget-colorstring@1.1.3-beta.0) (2023-07-27)
**Note:** Version bump only for package decap-cms-widget-colorstring
## [1.1.2](https://github.com/decaporg/decap-cms/compare/decap-cms-widget-colorstring@1.1.1...decap-cms-widget-colorstring@1.1.2) (2022-03-08)
**Note:** Version bump only for package decap-cms-widget-colorstring
## [1.1.1](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/compare/decap-cms-widget-colorstring@1.1.0...decap-cms-widget-colorstring@1.1.1) (2021-05-19)
**Note:** Version bump only for package decap-cms-widget-colorstring
# [1.1.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/compare/decap-cms-widget-colorstring@1.0.3...decap-cms-widget-colorstring@1.1.0) (2021-05-04)
### Features
- added react 17 as peer dependency in packages ([#5316](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/issues/5316)) ([9e42380](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/commit/9e423805707321396eec137f5b732a5b07a0dd3f))
## [1.0.3](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/compare/decap-cms-widget-colorstring@1.0.2...decap-cms-widget-colorstring@1.0.3) (2021-02-23)
**Note:** Version bump only for package decap-cms-widget-colorstring
## [1.0.2](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/compare/decap-cms-widget-colorstring@1.0.1...decap-cms-widget-colorstring@1.0.2) (2021-02-10)
**Note:** Version bump only for package decap-cms-widget-colorstring
## 1.0.1 (2020-10-25)
### Bug Fixes
- **widget-color:** rename to colorstring ([#4496](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/issues/4496)) ([fbc8963](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring/commit/fbc89637267f65ede25cd15ff6ed832ab3eb44dc))

22
node_modules/decap-cms-widget-colorstring/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2016 Netlify <decap@p-m.si>
MIT License
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.

9
node_modules/decap-cms-widget-colorstring/README.md generated vendored Normal file
View File

@@ -0,0 +1,9 @@
# Docs coming soon!
Decap CMS was converted from a single npm package to a "monorepo" of over 20 packages.
We haven't created a README for this package yet, but you can:
1. Check out the [main readme](https://github.com/decaporg/decap-cms/#readme) or the [documentation
site](https://www.decapcms.org) for more info.
2. Reach out to the [community chat](https://decapcms.org/chat/) if you need help.
3. Help out and [write the readme yourself](https://github.com/decaporg/decap-cms/edit/main/packages/decap-cms-widget-colorstring/README.md)!

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _decapCmsUiDefault = require("decap-cms-ui-default");
var _react2 = require("@emotion/react");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ColorPreview({
value
}) {
return (0, _react2.jsx)(_decapCmsUiDefault.WidgetPreviewContainer, null, value);
}
ColorPreview.propTypes = {
value: _propTypes.default.node
};
var _default = exports.default = ColorPreview;

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DecapCmsWidgetColorString = void 0;
var _ColorControl = _interopRequireDefault(require("./ColorControl"));
var _ColorPreview = _interopRequireDefault(require("./ColorPreview"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function Widget(opts = {}) {
return _objectSpread({
name: 'color',
controlComponent: _ColorControl.default,
previewComponent: _ColorPreview.default
}, opts);
}
const DecapCmsWidgetColorString = exports.DecapCmsWidgetColorString = {
Widget,
controlComponent: _ColorControl.default,
previewComponent: _ColorPreview.default
};
var _default = exports.default = DecapCmsWidgetColorString;

34
node_modules/decap-cms-widget-colorstring/package.json generated vendored Normal file
View File

@@ -0,0 +1,34 @@
{
"name": "decap-cms-widget-colorstring",
"description": "Widget for editing color strings in Decap CMS.",
"version": "3.1.3",
"homepage": "https://www.decapcms.org/docs/widgets/#color",
"repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-colorstring",
"bugs": "https://github.com/decaporg/decap-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/decap-cms-widget-colorstring.js",
"license": "MIT",
"keywords": [
"decap-cms",
"widget",
"color"
],
"sideEffects": false,
"scripts": {
"develop": "npm run build:esm -- --watch",
"build": "cross-env NODE_ENV=production webpack",
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward"
},
"dependencies": {
"react-color": "^2.18.1",
"tinycolor2": "^1.4.1"
},
"peerDependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"decap-cms-ui-default": "^3.0.0",
"prop-types": "^15.7.2",
"react": "^18.2.0"
},
"gitHead": "64d91b8bb3d0a93dd36c53800cdac4ba2e435000"
}

View File

@@ -0,0 +1,173 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import ChromePicker from 'react-color';
import tinycolor from 'tinycolor2';
import { zIndex } from 'decap-cms-ui-default';
function ClearIcon() {
return (
<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false">
<path
fill="rgb(122, 130, 145)"
d="M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
></path>
</svg>
);
}
const ClearButton = styled.div`
position: absolute;
right: 6px;
z-index: ${zIndex.zIndex1000};
padding: 8px;
margin-top: 11px;
`;
const ClearButtonWrapper = styled.div`
position: relative;
width: 100%;
`;
// color swatch background with checkerboard to display behind transparent colors
const ColorSwatchBackground = styled.div`
position: absolute;
z-index: ${zIndex.zIndex1};
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==');
height: 38px;
width: 48px;
margin-top: 10px;
margin-left: 10px;
border-radius: 5px;
`;
const ColorSwatch = styled.div`
position: absolute;
z-index: ${zIndex.zIndex2};
background: ${props => props.background};
cursor: pointer;
height: 38px;
width: 48px;
margin-top: 10px;
margin-left: 10px;
border-radius: 5px;
border: 2px solid rgb(223, 223, 227);
text-align: center;
font-size: 27px;
line-height: 1;
padding-top: 4px;
user-select: none;
color: ${props => props.color};
`;
const ColorPickerContainer = styled.div`
position: absolute;
z-index: ${zIndex.zIndex1000};
margin-top: 48px;
margin-left: 12px;
`;
// fullscreen div to close color picker when clicking outside of picker
const ClickOutsideDiv = styled.div`
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
`;
export default class ColorControl extends React.Component {
static propTypes = {
onChange: PropTypes.func.isRequired,
forID: PropTypes.string,
value: PropTypes.node,
classNameWrapper: PropTypes.string.isRequired,
setActiveStyle: PropTypes.func.isRequired,
setInactiveStyle: PropTypes.func.isRequired,
};
static defaultProps = {
value: '',
};
state = {
showColorPicker: false,
};
// show/hide color picker
handleClick = () => {
this.setState({ showColorPicker: !this.state.showColorPicker });
};
handleClear = () => {
this.props.onChange('');
};
handleClose = () => {
this.setState({ showColorPicker: false });
};
handleChange = color => {
const formattedColor =
color.rgb.a < 1
? `rgba(${color.rgb.r}, ${color.rgb.g}, ${color.rgb.b}, ${color.rgb.a})`
: color.hex;
this.props.onChange(formattedColor);
};
render() {
const { forID, value, field, onChange, classNameWrapper, setActiveStyle, setInactiveStyle } =
this.props;
const allowInput = field.get('allowInput', false);
// clear button is not displayed if allowInput: true
const showClearButton = !allowInput && value;
return (
<>
{' '}
{showClearButton && (
<ClearButtonWrapper>
<ClearButton onClick={this.handleClear}>
<ClearIcon />
</ClearButton>
</ClearButtonWrapper>
)}
<ColorSwatchBackground />
<ColorSwatch
background={tinycolor(this.props.value).isValid() ? this.props.value : '#fff'}
color={
tinycolor(this.props.value).isValid() ? 'rgba(255, 255, 255, 0)' : 'rgb(223, 223, 227)'
}
onClick={this.handleClick}
>
?
</ColorSwatch>
{this.state.showColorPicker && (
<ColorPickerContainer>
<ClickOutsideDiv onClick={this.handleClose} />
<ChromePicker
color={value || ''}
onChange={this.handleChange}
disableAlpha={!field.get('enableAlpha', false)}
/>
</ColorPickerContainer>
)}
<input
// text input with padding left for the color swatch
type="text"
id={forID}
className={classNameWrapper}
value={value || ''}
onChange={e => onChange(e.target.value)}
onFocus={setActiveStyle}
onBlur={setInactiveStyle}
style={{
paddingLeft: '75px',
paddingRight: '70px',
color: !allowInput && '#bbb',
}}
// make readonly and open color picker on click if set to allowInput: false
onClick={!allowInput ? this.handleClick : undefined}
readOnly={!allowInput}
/>
</>
);
}
}

View File

@@ -0,0 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import { WidgetPreviewContainer } from 'decap-cms-ui-default';
function ColorPreview({ value }) {
return <WidgetPreviewContainer>{value}</WidgetPreviewContainer>;
}
ColorPreview.propTypes = {
value: PropTypes.node,
};
export default ColorPreview;

14
node_modules/decap-cms-widget-colorstring/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import controlComponent from './ColorControl';
import previewComponent from './ColorPreview';
function Widget(opts = {}) {
return {
name: 'color',
controlComponent,
previewComponent,
...opts,
};
}
export const DecapCmsWidgetColorString = { Widget, controlComponent, previewComponent };
export default DecapCmsWidgetColorString;

View File

@@ -0,0 +1,3 @@
const { getConfig } = require('../../scripts/webpack.js');
module.exports = getConfig();