- Fix bug where block creation toggle could get stuck open
- Address embed issues where manually typing in HTML was impossible
- Generate a unique ID for and its associated label
- Content may now be updated by passing a key/value pair to
onChange
. See the following section for more info.
We've hit many situations where we need to update a deeply nested key in CK. This is particularly painful when updating an index of an array:
let tags = this.props.metadata.tags.concat()
tags[1] = 'jellybeans'
this.props.onChange({
metadata: { ...this.props.content.metadata, tags }
})`
Instead, with this release you can provide a key path. This behaves similarly to Lodash's set function:
this.props.onChange('title', 'My Dessert Foods')
this.props.onChange('metadata.tags.1', 'jellybeans')
By providing a string of dot
separated values, CK will drill down
into content properties on your behalf. This aims to greatly improve
the ergonomics of updating nested keys.
- Fix build issue where Object.assign compiled to
true
- Remove uglify step to avoid unexpected minification errors
Upgrade to support React 16.0
Component definitions must now be React class instances. If your
components use the React.createClass syntax, consider moving over to
ES6 classes, or use the react-create-class
package.
- Inline the uid module
- Use ref callback pattern. This change removes deprecation warnings in the browser console when Colonel Kurtz is used with React 15.6.0.
- Add
maxDepth
config option to ColonelKurtz application
- Blocks assign default content when mounted. This is technically a bug, but the fix impacts content assignment (default values will start to show up), so we're releasing it under a minor revision.
- Upgraded dependencies
- Removed deprecation warnings for React 15.x
- Added support for React 15.x
- Added a style tag to the HTML embed addon to cut default body margins
- Added a fallback state for when a block type is not recognized.
- Upgrade Microcosm to 9.21.x
- The
<Field />
component is once again controlled. Upgrading Microcosm addressed issues with using a controlled input inside of this add-on. - Fix html embed styles
If you are using the <Field />
component, verify that it continues to
work as expected. We moved away from controlled inputs in a prior
release when we were unable to determine why cursor position would
erratically move to the end of an input when it changed. This was due
to a way older versions of Microcosm batched state changes
together. This is no longer an issue, so we moved back to the original
controlled strategy.
If you would like to keep the old behavior, instead of passing a
value
property into the <Field />
component, send in
defaultValue
. This is the method exposed by React for uncontrolled
inputs.
For more information on controlled inputs, see the React documentation:
https://facebook.github.io/react/docs/forms.html#controlled-components
- Added
html-embed
add-on. This component may be used to include HTML and accompanying scripts within Colonel Kurtz.
- The menu item component is now available as the third argument of onClick handlers for custom menu items.
- Fixed style issue in Firefox where menu items were truncated
- Added a
clientOnly
property to blocks. This is a boolean property indicating if the block was created by the user during the current editing session (as opposed to being present when the editor starts).
- Important Update: This update makes breaking changes to support
React 0.14. colonel-kurtz now takes advantage of
react-addons-css-transition-group
and utilizesreact-dom
for rendering.
- Address bug where default content block information was not respected.
- The BlockType creator menu now properly displays focus state
- BlockTypes given a
group
property will display as a dropdown in the BlockType creator menu.
All changes are non-breaking. For those not including the Colonel
Kurtz stylesheet via node_modules
, you will need to update your
stylesheet in order to benefit from the new focus state on the
BlockType creator menu
BlockTypes can be grouped! To do this, add a group
property to your
block type like so:
let blockTypes = [
{
id: 'youtube',
group: 'Embedded'
// other props
},
{
id: 'twitter',
group: 'Embedded'
// other props
},
{
id: 'facebook',
group: 'Embedded'
// other props
}
]
- Added a
hint
property the<Field />
- Added
uid
dependency to generate unique ids for<Field />
hints - Updated some development dependencies
- The YouTube addon will now accept a URL in addition to ID. The ID of the YouTube video will be extracted and saved (no breaking change)
- Updated the labels and hints for the YouTube addon to make it clear that a URL may also be pasted into the field.
- Added hint property to
<Embeddable />
to allow hint text on its<Field />
component - Added padding to right of
<Field />
label to handle very long labels colliding with menu button.
There are small style updates to <Field />
those not pulling in the
style sheet from node_modules should update theirs accordingly.
- The
<Field />
component is no longer a controlled input - The
<Field />
component label now wraps its input
- Added Embedded common component addon. The YouTube addon now uses it.
- BlockTypes are provided a default component definition that only renders children. This is to provide a standard default for block types that are containers for other blocks.
- This project no longer compiles in Babel loose mode.
- Focus places upon the navigation element instead of the first button of a block creator menu when opened.
- Improved focus state of block creator menu buttons.
- Added
col-block-editor
andcol-block-children
css hooks Field
component can take anelement
option (for text areas, defaults toinput
)- Added
allow
property to configuration options to only allow specific blocks - The Youtube and Image addons strip white space when checking to open
- Upgraded Microcosm to 8.1.0
- Added
root
property to blockTypes. When set to false, it will prevent it from displaying in the default block menu - Added
maxChildren
property to Colonel instances and BlockTypes to limit the number of children - Returned "Move up" and "Move down" phrasing in menu items.
- The content object of a block is always defined as an object.
- Bump react-ink to 0.4
- Lock down a few dependencies to prevent installation of React 0.14
- Slightly increased padding of switch navigation buttons. This is present when block type labels exceed the min-width of those buttons
- Tweaked vertical alignment of secondary add block buttons
- Increased contrast of button focus background for block menu
- Improve animation for menus, add closing animation.
- "Move Up" and "Move Down" have been renamed to "Move Before" and "Move After". This is in anticipation for block types that display children horizontally.
Dialog
addon acceptstitle
andheadingComponent
props for customizable headings.Dialog
y-axis overflow scrolls when necessary.
This releases an update to the stylesheet. If you are not including it
from node_modules
, be sure to pull down the latest files from ./style
- The menu to add new blocks will now collapse when the escape key is pressed.
- Refactored switch navigation to be smarter about secondary buttons.
- Improved animation for switches. Refactored Switch css
This releases an update to the stylesheet. If you are not including it
from node_modules
, be sure to pull down the latest files from ./style
New style updates warranted a minor release, however we also refactored some internal components related to block type navigation.
- Improved the appearance and opening animation of the dialog addon
- Improved focus for switch navigation
- Fixed a case where an error would be thrown related to menus of torn down blocks.
The stylesheet for this release was updated, for a stylesheet specific
to this version, reference the style
directory that is pulled down
with the npm
module.
- Custom menu items are no longer defined in
statics
. Instead, they are returned from agetMenuItems
method on the component itself. - The component lifecycle method
menuWillSelect
has been removed. For the purposes it was required for,getMenuItems
is sufficient
- For those using custom menu items, see the updated
menu.md
doc for the updated API.
react-ink
was missing in the build. Originally it was compiled into the main payload, this changed when we updated the build process.react-ink
is now a standard dependency.
- Publishing to NPM occurs by pushing the
dist
folder. Instead, the root folder was published
- Addons are now available directly under
colonel-kurtz/addons
, theircolonel-kurtz/build
counterparts have been removed. This is due to a change in the build process to help expose components for use when building new UI.
- New menu items may now be added on an individual block type
level. For more information, see
./docs/menus.md
- Style for addons has been moved to
./style/addons
so that it is easier to pull down all styles at once or reference the directory innode_modules
.
This release has a breaking change to improve the ease of including React components defined by Colonel Kurtz when building new block types. If you are including addons, the following change is necessary:
In the case of the YouTube component addon, in the previous release it can be included using:
let YouTube = require('colonel-kurtz/build/addons/youtube')
This has now become:
let YouTube = require('colonel-kurtz/addons/youtube')
- Youtube and Image components can accept children. This is intended to better support additional fields.
- Colonel Kurtz will now inherit theme colors from upcoming active_material gem. Beyond exposing variables, no visual differences should be observed.
- Fixed some style inconsistencies in Firefox
- Colonel's
blocks
option can accept an input or textarea
As of this release, we will break out changes into those noticeable to users and those internal to Colonel itself.
- Menu items will always display for moving blocks. If a block can not be moved further, the item will be disabled.
- Change internal moving method to eliminate edge cases and fragility
- Increase test coverage
- Add experimental "Section" block type addon
- Reworked build process to speedup setup time
- Externalize react-focus-trap so it gets patches
- Upgrade react focus trap for better focus management of menus
- Upgraded Microcosm to 7.0.0.
- Renamed Toolbar to Menu, be sure to upgrade CSS with this change.
- Refactored some internals, though nothing should surface itself
- Set up more sharing between Youtube and Image addons
- Improve animations of Image and Youtube UI
- Refined YouTube UI
- Added a section addon
- Improved focus state of buttons
- Internal updates. We make better use of
react-focus-trap
and resolve some testing issues
- Menus will no longer automatically close, this is to improve the experience of keyboard navigation
- Fixed main entry point
- Each Colonel Kurtz is now an isolated instance with its own state
- Refactored internals to achieve higher test coverage
- Compliance with React 0.13.0
- Updated UI to better support nested blocks
- Added block menus (instead of just a remove button)
- Colonel Kurtz is now a layer on top of Microcosm. It now benefits from the features provided by this system.
- Added a plugin system which will run before Colonel Kurtz starts
addCallback
is nowlisten
removeCallback
is nowignore
simulateChange
is nowemit
- Block types must provided within the
blockTypes
key when instantiating Colonel Kurtz render
is nowstart
.start
comes from Microcosm and will run through all configured plugins and render the app.