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

View File

@@ -0,0 +1,200 @@
# 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-editor-component-image@3.1.2...decap-cms-editor-component-image@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-editor-component-image@3.1.1...decap-cms-editor-component-image@3.1.2) (2024-08-13)
**Note:** Version bump only for package decap-cms-editor-component-image
## [3.1.1](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@3.1.0-beta.1...decap-cms-editor-component-image@3.1.1) (2024-03-21)
**Note:** Version bump only for package decap-cms-editor-component-image
# [3.1.0](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@3.1.0-beta.1...decap-cms-editor-component-image@3.1.0) (2024-02-01)
**Note:** Version bump only for package decap-cms-editor-component-image
# [3.1.0-beta.1](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@3.1.0-beta.0...decap-cms-editor-component-image@3.1.0-beta.1) (2024-01-31)
**Note:** Version bump only for package decap-cms-editor-component-image
# [3.1.0-beta.0](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@3.1.0...decap-cms-editor-component-image@3.1.0-beta.0) (2023-10-20)
### Reverts
- Revert "chore(release): publish" ([b89fc89](https://github.com/decaporg/decap-cms/commit/b89fc894dfbb5f4136b2e5427fd25a29378a58c6))
# [3.0.0](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@2.8.0...decap-cms-editor-component-image@3.0.0) (2023-08-18)
**Note:** Version bump only for package decap-cms-editor-component-image
# [2.8.0](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@2.8.0-beta.0...decap-cms-editor-component-image@2.8.0) (2023-08-18)
**Note:** Version bump only for package decap-cms-editor-component-image
# 2.8.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))
## [2.7.1-beta.0](https://github.com/decaporg/decap-cms/compare/decap-cms-editor-component-image@2.7.0...decap-cms-editor-component-image@2.7.1-beta.0) (2023-07-27)
**Note:** Version bump only for package decap-cms-editor-component-image
# [2.7.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.6.7...decap-cms-editor-component-image@2.7.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-editor-component-image/issues/5316)) ([9e42380](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/9e423805707321396eec137f5b732a5b07a0dd3f))
## [2.6.7](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.6.6...decap-cms-editor-component-image@2.6.7) (2020-10-12)
**Note:** Version bump only for package decap-cms-editor-component-image
## [2.6.6](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.6.5...decap-cms-editor-component-image@2.6.6) (2020-09-15)
**Note:** Version bump only for package decap-cms-editor-component-image
## 2.6.5 (2020-09-08)
### Reverts
- Revert "chore(release): publish" ([828bb16](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/828bb16415b8c22a34caa19c50c38b24ffe9ceae))
## 2.6.4 (2020-08-20)
### Reverts
- Revert "chore(release): publish" ([8262487](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/82624879ccbcb16610090041db28f00714d924c8))
## 2.6.3 (2020-07-27)
### Reverts
- Revert "chore(release): publish" ([118d50a](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/118d50a7a70295f25073e564b5161aa2b9883056))
## [2.6.2](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.6.1...decap-cms-editor-component-image@2.6.2) (2020-02-14)
**Note:** Version bump only for package decap-cms-editor-component-image
## [2.6.1](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.6.0...decap-cms-editor-component-image@2.6.1) (2020-02-13)
### Bug Fixes
- change getAsset to not return a promise ([#3232](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/3232)) ([ab685e8](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/ab685e85943d1ac48142f157683bc2126fd6af16))
# [2.6.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.5.0...decap-cms-editor-component-image@2.6.0) (2020-02-10)
### Features
- field based media/public folders ([#3208](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/3208)) ([97bc0c8](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/97bc0c8dc489e736f89d748ba832d78400fe4332))
### Reverts
- Revert "chore(release): publish" ([a015d1d](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/a015d1d92a4b1c0130c44fcef1c9ecdb157a0f07))
# [2.5.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.5.0-beta.0...decap-cms-editor-component-image@2.5.0) (2020-01-07)
**Note:** Version bump only for package decap-cms-editor-component-image
# [2.5.0-beta.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.3...decap-cms-editor-component-image@2.5.0-beta.0) (2019-12-18)
### Features
- bundle assets with content ([#2958](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/2958)) ([2b41d8a](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/2b41d8a838a9c8a6b21cde2ddd16b9288334e298))
## [2.4.3](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.2...decap-cms-editor-component-image@2.4.3) (2019-11-07)
**Note:** Version bump only for package decap-cms-editor-component-image
## [2.4.2](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.2-beta.0...decap-cms-editor-component-image@2.4.2) (2019-04-10)
**Note:** Version bump only for package decap-cms-editor-component-image
## [2.4.2-beta.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.1...decap-cms-editor-component-image@2.4.2-beta.0) (2019-04-05)
**Note:** Version bump only for package decap-cms-editor-component-image
## [2.4.1](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.1-beta.1...decap-cms-editor-component-image@2.4.1) (2019-03-29)
**Note:** Version bump only for package decap-cms-editor-component-image
## [2.4.1-beta.1](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.1-beta.0...decap-cms-editor-component-image@2.4.1-beta.1) (2019-03-26)
### Bug Fixes
- export on decap-cms and maps on esm ([#2244](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/2244)) ([6ffd13b](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/6ffd13b))
## [2.4.1-beta.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.4.0...decap-cms-editor-component-image@2.4.1-beta.0) (2019-03-25)
**Note:** Version bump only for package decap-cms-editor-component-image
# [2.4.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.3.0...decap-cms-editor-component-image@2.4.0) (2019-03-22)
### Features
- add ES module builds ([#2215](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/2215)) ([d142b32](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/d142b32))
# [2.3.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.3.0-beta.0...decap-cms-editor-component-image@2.3.0) (2019-03-22)
**Note:** Version bump only for package decap-cms-editor-component-image
# [2.3.0-beta.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.2.1-beta.0...decap-cms-editor-component-image@2.3.0-beta.0) (2019-03-21)
### Features
- provide usable UMD builds for all packages ([#2141](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/2141)) ([82cc794](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/82cc794))
## [2.2.1-beta.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.2.0...decap-cms-editor-component-image@2.2.1-beta.0) (2019-03-15)
### Features
- upgrade to Emotion 10 ([#2166](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/2166)) ([ccef446](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/ccef446))
# [2.2.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.1.0...decap-cms-editor-component-image@2.2.0) (2018-12-11)
### Features
- **editor-components:** support title in image component ([#1862](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/1862)) ([cbb7762](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/cbb7762))
# [2.1.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.0.4...decap-cms-editor-component-image@2.1.0) (2018-12-04)
### Features
- add cloudinary support ([#1932](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/issues/1932)) ([1fc2f50](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/commit/1fc2f50))
<a name="2.0.4"></a>
## [2.0.4](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.0.3...decap-cms-editor-component-image@2.0.4) (2018-08-24)
**Note:** Version bump only for package decap-cms-editor-component-image
<a name="2.0.3"></a>
## [2.0.3](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.0.2...decap-cms-editor-component-image@2.0.3) (2018-08-01)
**Note:** Version bump only for package decap-cms-editor-component-image
<a name="2.0.2"></a>
## [2.0.2](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image/compare/decap-cms-editor-component-image@2.0.1...decap-cms-editor-component-image@2.0.2) (2018-07-28)
**Note:** Version bump only for package decap-cms-editor-component-image
<a name="2.0.1"></a>
## 2.0.1 (2018-07-26)
<a name="2.0.0"></a>
# 2.0.0 (2018-07-26)
**Note:** Version bump only for package decap-cms-editor-component-image

22
node_modules/decap-cms-editor-component-image/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.

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-editor-component-image/README.md)!

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
/** @license React v16.13.1
* react-is.production.min.js
*
* 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.
*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.DecapCmsEditorComponentImage = void 0;
var _react = _interopRequireDefault(require("react"));
var _react2 = require("@emotion/react");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const image = {
label: 'Image',
id: 'image',
fromBlock: match => match && {
image: match[2],
alt: match[1],
title: match[4]
},
toBlock: ({
alt,
image,
title
}) => `![${alt || ''}](${image || ''}${title ? ` "${title.replace(/"/g, '\\"')}"` : ''})`,
// eslint-disable-next-line react/display-name
toPreview: ({
alt,
image,
title
}, getAsset, fields) => {
const imageField = fields === null || fields === void 0 ? void 0 : fields.find(f => f.get('widget') === 'image');
const src = getAsset(image, imageField);
return (0, _react2.jsx)("img", {
src: src || '',
alt: alt || '',
title: title || ''
});
},
pattern: /^!\[(.*)\]\((.*?)(\s"(.*)")?\)$/,
fields: [{
label: 'Image',
name: 'image',
widget: 'image',
media_library: {
allow_multiple: false
}
}, {
label: 'Alt Text',
name: 'alt'
}, {
label: 'Title',
name: 'title'
}]
};
const DecapCmsEditorComponentImage = exports.DecapCmsEditorComponentImage = image;
var _default = exports.default = image;

View File

@@ -0,0 +1,28 @@
{
"name": "decap-cms-editor-component-image",
"description": "Image component for Decap CMS editor widget",
"version": "3.1.3",
"repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-editor-component-image",
"bugs": "https://github.com/decaporg/decap-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/decap-cms-editor-component-image.js",
"license": "MIT",
"keywords": [
"decap-cms",
"editor",
"component"
],
"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"
},
"devDependencies": {
"cross-env": "^7.0.0"
},
"peerDependencies": {
"react": "^18.2.0"
},
"gitHead": "64d91b8bb3d0a93dd36c53800cdac4ba2e435000"
}

View File

@@ -0,0 +1,75 @@
import component from '../index';
function getAsset(path) {
return path;
}
const image = '/image';
const alt = 'alt';
const title = 'title';
describe('editor component image', () => {
it('should generate empty markdown image from empty object', () => {
expect(component.toBlock({})).toEqual(`![]()`);
});
it('should generate valid markdown from path', () => {
expect(component.toBlock({ image })).toEqual(`![](/image)`);
});
it('should generate valid markdown from path and alt text', () => {
expect(component.toBlock({ image, alt })).toEqual(`![alt](/image)`);
});
it('should generate valid markdown from path and title', () => {
expect(component.toBlock({ image, title })).toEqual(`![](/image "title")`);
});
it('should generate valid markdown from path, alt text, and title ', () => {
expect(component.toBlock({ image, alt, title })).toEqual(`![alt](/image "title")`);
});
it('should escape quotes in title', () => {
expect(component.toBlock({ image, alt, title: `"ti"tle"` })).toEqual(
`![alt](/image "\\"ti\\"tle\\"")`,
);
});
it('should generate valid react props', () => {
expect(component.toPreview({ image, alt, title }, getAsset)).toMatchObject({
props: { src: image, alt, title },
});
});
it('should match markdown with no properties defined', () => {
expect(`![]()`).toMatch(component.pattern);
});
it('should match markdown with path', () => {
expect(`![](/image)`).toMatch(component.pattern);
});
it('should match markdown with path and alt text', () => {
expect(`![alt](/image)`).toMatch(component.pattern);
});
it('should match markdown with path and title', () => {
expect(`![](/image "title")`).toMatch(component.pattern);
});
it('should match markdown with path, alt text, and title', () => {
expect(`![alt](/image "title")`).toMatch(component.pattern);
});
it('should match markdown with path, alt text, and title', () => {
expect(`![alt](/image "title")`).toMatch(component.pattern);
});
it('should match markdown with arbitrary amount of whitespace', () => {
expect(`![alt](/image "title")`).toMatch(component.pattern);
});
it('should match markdown with quoted title', () => {
expect(`![alt](/image "\\"ti\\"tle\\"")`).toMatch(component.pattern);
});
});

View File

@@ -0,0 +1,42 @@
import React from 'react';
const image = {
label: 'Image',
id: 'image',
fromBlock: match =>
match && {
image: match[2],
alt: match[1],
title: match[4],
},
toBlock: ({ alt, image, title }) =>
`![${alt || ''}](${image || ''}${title ? ` "${title.replace(/"/g, '\\"')}"` : ''})`,
// eslint-disable-next-line react/display-name
toPreview: ({ alt, image, title }, getAsset, fields) => {
const imageField = fields?.find(f => f.get('widget') === 'image');
const src = getAsset(image, imageField);
return <img src={src || ''} alt={alt || ''} title={title || ''} />;
},
pattern: /^!\[(.*)\]\((.*?)(\s"(.*)")?\)$/,
fields: [
{
label: 'Image',
name: 'image',
widget: 'image',
media_library: {
allow_multiple: false,
},
},
{
label: 'Alt Text',
name: 'alt',
},
{
label: 'Title',
name: 'title',
},
],
};
export const DecapCmsEditorComponentImage = image;
export default image;

View File

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