Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename field-content to fields-content #3304

Merged
merged 11 commits into from
Aug 7, 2020
8 changes: 8 additions & 0 deletions .changeset/smart-baboons-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@keystonejs/field-content': major
emmatown marked this conversation as resolved.
Show resolved Hide resolved
'@keystonejs/fields-content': major
MadeByMike marked this conversation as resolved.
Show resolved Hide resolved
'@keystonejs/fields': patch
'@keystonejs/cypress-project-basic': patch
---

Renamed `@keystonejs/field-content` to `@keystonejs/fields-content`. Please install `@keystonejs/fields-content` and update your imports from `@keystonejs/field-content` to `@keystonejs/fields-content`.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
"packages/fields-mongoid",
"packages/fields-wysiwyg-tinymce",
"packages/oembed-adapters",
"packages/fields-content",
"packages/fields-color"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
Expand All @@ -178,7 +179,6 @@
},
"field-types": {
"packages": [
"packages/field-content",
"packages/fields"
]
},
Expand Down
7 changes: 0 additions & 7 deletions packages/field-content/Block/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/field-content/block-components/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/field-content/blocks/package.json

This file was deleted.

3 changes: 3 additions & 0 deletions packages/field-content/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
throw new Error(
'`@keystonejs/field-content` has been renamed to `@keystonejs/fields-content`. Please install `@keystonejs/fields-content` and change your imports from `@keystonejs/field-content` to `@keystonejs/fields-content`'
);
65 changes: 11 additions & 54 deletions packages/field-content/package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,12 @@
{
"name": "@keystonejs/field-content",
"description": "A block-based content field for KeystoneJS",
"version": "7.0.3",
"author": "The KeystoneJS Development Team",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"dependencies": {
"@arch-ui/color-utils": "^0.0.2",
"@arch-ui/fields": "^3.0.3",
"@arch-ui/hooks": "^0.0.10",
"@arch-ui/input": "^0.1.10",
"@arch-ui/theme": "^0.0.10",
"@arch-ui/tooltip": "^0.1.12",
"@arch-ui/typography": "^0.0.17",
"@babel/runtime": "^7.8.4",
"@emotion/core": "^10.0.28",
"@keystonejs/build-field-types": "^5.2.11",
"@keystonejs/fields": "^15.0.0",
"@keystonejs/utils": "^5.4.1",
"@popperjs/core": "^2.3.3",
"@primer/octicons-react": "^10.0.0",
"apply-ref": "^0.2.0",
"get-selection-range": "^0.1.0",
"image-extensions": "^1.1.0",
"immutable": "^4.0.0-rc.12",
"is-hotkey": "^0.1.4",
"lodash.get": "^4.4.2",
"memoize-one": "^5.1.1",
"nanoassert": "^2.0.0",
"p-is-promise": "^3.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-popper": "^2.2.2",
"slate": "^0.47.4",
"slate-drop-or-paste-images": "^0.9.1",
"slate-plain-serializer": "^0.7.11",
"slate-react": "^0.22.4"
},
"peerDependencies": {},
"field-types": {
"entrypoints": [
".",
"Block",
"slate-serializer",
"blocks",
"block-components"
]
},
"main": "dist/field-content.cjs.js",
"module": "dist/field-content.esm.js",
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/field-content"
}
"name": "@keystonejs/field-content",
"description": "A block-based content field for KeystoneJS",
"version": "7.0.3",
"author": "The KeystoneJS Development Team",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/field-content"
}

7 changes: 0 additions & 7 deletions packages/field-content/slate-serializer/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/field-content/src/views/index.js

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions packages/fields-content/Block/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"main": "dist/fields-content.cjs.js",
"module": "dist/fields-content.esm.js",
"field-types": {
"source": "../src/Block"
}
}
435 changes: 435 additions & 0 deletions packages/fields-content/CHANGELOG.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ editing flows.

## Usage

This package isn't included with the keystone fields package and needs to be installed with `yarn add @keystonejs/field-content` or `npm install @keystonejs/field-content`.
This package isn't included with the keystone fields package and needs to be installed with `yarn add @keystonejs/fields-content` or `npm install @keystonejs/fields-content`.

```javascript
const { Content } = require('@keystonejs/field-content');
const { Content } = require('@keystonejs/fields-content');

keystone.createList('Post', {
fields: {
Expand Down
7 changes: 7 additions & 0 deletions packages/fields-content/block-components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"main": "dist/fields-content.cjs.js",
"module": "dist/fields-content.esm.js",
"field-types": {
"source": "../src/views/"
}
}
7 changes: 7 additions & 0 deletions packages/fields-content/blocks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"main": "dist/fields-content.cjs.js",
"module": "dist/fields-content.esm.js",
"field-types": {
"source": "../src/blocks"
}
}
55 changes: 55 additions & 0 deletions packages/fields-content/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@keystonejs/fields-content",
"description": "A block-based content field for KeystoneJS",
"version": "7.0.3",
"author": "The KeystoneJS Development Team",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"dependencies": {
"@arch-ui/color-utils": "^0.0.2",
"@arch-ui/fields": "^3.0.3",
"@arch-ui/hooks": "^0.0.10",
"@arch-ui/input": "^0.1.10",
"@arch-ui/theme": "^0.0.10",
"@arch-ui/tooltip": "^0.1.12",
"@arch-ui/typography": "^0.0.17",
"@babel/runtime": "^7.8.4",
"@emotion/core": "^10.0.28",
"@keystonejs/fields": "^15.0.0",
"@keystonejs/utils": "^5.4.1",
"@popperjs/core": "^2.3.3",
"@primer/octicons-react": "^10.0.0",
"apply-ref": "^0.2.0",
"get-selection-range": "^0.1.0",
"image-extensions": "^1.1.0",
"immutable": "^4.0.0-rc.12",
"is-hotkey": "^0.1.4",
"lodash.get": "^4.4.2",
"memoize-one": "^5.1.1",
"nanoassert": "^2.0.0",
"p-is-promise": "^3.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-popper": "^2.2.2",
"slate": "^0.47.4",
"slate-drop-or-paste-images": "^0.9.1",
"slate-plain-serializer": "^0.7.11",
"slate-react": "^0.22.4"
},
"preconstruct": {
"entrypoints": [
"index.js",
"Block.js",
"slate-serializer.js",
"blocks/index.js",
"block-components.js",
"views/*.js",
"views/editor/blocks/*.js"
]
},
"main": "dist/fields-content.cjs.js",
"module": "dist/fields-content.esm.js",
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/fields-content"
}
7 changes: 7 additions & 0 deletions packages/fields-content/slate-serializer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"main": "dist/fields-content.cjs.js",
"module": "dist/fields-content.esm.js",
"field-types": {
"source": "../src/slate-serializer"
}
}
1 change: 1 addition & 0 deletions packages/fields-content/src/block-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { BlockMenuItem } from './views/editor/block-menu-item';
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';

export default class BlockquoteBlock extends Block {
get type() {
return 'blockquote';
}
getAdminViews() {
return [importView('../views/editor/blocks/blockquote')];
return [resolveView('views/editor/blocks/blockquote')];
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';

export default class CaptionBlock extends Block {
get type() {
return 'caption';
}
getAdminViews() {
return [importView('../views/editor/blocks/caption')];
return [resolveView('views/editor/blocks/caption')];
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';
import { paragraph } from '../blocks';

Expand All @@ -7,6 +7,6 @@ export default class HeadingBlock extends Block {
return 'heading';
}
getAdminViews() {
return [importView('../views/editor/blocks/heading'), ...new paragraph().getAdminViews()];
return [resolveView('views/editor/blocks/heading'), ...new paragraph().getAdminViews()];
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';
import image from './image';
import caption from './caption';
Expand All @@ -9,7 +9,7 @@ export default class ImageContainerBlock extends Block {
}
getAdminViews() {
return [
importView('../views/editor/blocks/image-container'),
resolveView('views/editor/blocks/image-container'),
...new image().getAdminViews(),
...new caption().getAdminViews(),
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';

export default class ImageBlock extends Block {
get type() {
return 'image';
}
getAdminViews() {
return [importView('../views/editor/blocks/image')];
return [resolveView('views/editor/blocks/image')];
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';

export default class LinkBlock extends Block {
get type() {
return 'link';
}
getAdminViews() {
return [importView('../views/editor/blocks/link')];
return [resolveView('views/editor/blocks/link')];
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';

export default class ListItemBlock extends Block {
get type() {
return 'list-item';
}
getAdminViews() {
return [importView('../views/editor/blocks/list-item')];
return [resolveView('views/editor/blocks/list-item')];
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';
import listItem from './list-item';

Expand All @@ -7,6 +7,6 @@ export default class OrderedListBlock extends Block {
return 'ordered-list';
}
getAdminViews() {
return [importView('../views/editor/blocks/ordered-list'), ...new listItem().getAdminViews()];
return [resolveView('views/editor/blocks/ordered-list'), ...new listItem().getAdminViews()];
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';

export default class ParagraphBlock extends Block {
get type() {
return 'paragraph';
}
getAdminViews() {
return [importView('../views/editor/blocks/paragraph')];
return [resolveView('views/editor/blocks/paragraph')];
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { importView } from '@keystonejs/build-field-types';
import { resolveView } from '../resolve-view';
import { Block } from '../Block';
import listItem from './list-item';

Expand All @@ -7,6 +7,6 @@ export default class UnorderedListBlock extends Block {
return 'unordered-list';
}
getAdminViews() {
return [importView('../views/editor/blocks/unordered-list'), ...new listItem().getAdminViews()];
return [resolveView('views/editor/blocks/unordered-list'), ...new listItem().getAdminViews()];
}
}
Loading