@react-page/core
Advanced tools
Comparing version 0.11.4 to 0.12.0
@@ -56,2 +56,3 @@ /* | ||
isLayoutMode: nextProps.isLayoutMode, | ||
remove: nextProps.removeCell, | ||
}; | ||
@@ -70,3 +71,3 @@ // Basically we check if the focus state changed and if yes, we execute the callback handler from the plugin, that | ||
render() { | ||
const { editable, id, node: { content: { plugin: { Component = () => null, name = 'N/A', version = 'N/A', } = {}, state = {}, } = {}, focused, }, } = this.props; | ||
const { editable, id, node: { content: { plugin: { Component = () => null, name = 'N/A', version = 'N/A', text = 'unnamed plugin', } = {}, state = {}, } = {}, focused, }, } = this.props; | ||
const { focusCell, blurCell } = this.props; | ||
@@ -85,3 +86,3 @@ let focusProps; | ||
return (React.createElement("div", Object.assign({}, focusProps, { tabIndex: "-1", style: { outline: 'none' }, ref: this.onRef, className: "ory-cell-inner ory-cell-leaf" }), | ||
React.createElement(Component, { editable: editable, id: id, state: state, focused: this.props.isEditMode && focused, name: name, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellContent, focus: focusCell, blur: blurCell, isInsertMode: this.props.isInsertMode, isResizeMode: this.props.isResizeMode, isPreviewMode: this.props.isPreviewMode, isEditMode: this.props.isEditMode, isLayoutMode: this.props.isLayoutMode }))); | ||
React.createElement(Component, { editable: editable, id: id, state: state, focused: this.props.isEditMode && focused, name: name, text: text, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellContent, focus: focusCell, blur: blurCell, isInsertMode: this.props.isInsertMode, isResizeMode: this.props.isResizeMode, isPreviewMode: this.props.isPreviewMode, isEditMode: this.props.isEditMode, isLayoutMode: this.props.isLayoutMode, remove: this.props.removeCell }))); | ||
} | ||
@@ -88,0 +89,0 @@ } |
@@ -43,2 +43,3 @@ /* | ||
import Resizable from './Resizable'; | ||
import { removeCell } from './../../actions/cell/core'; | ||
const gridClass = (_a) => { | ||
@@ -80,2 +81,3 @@ var { node: { size } } = _a, rest = __rest(_a, ["node"]); | ||
blurAllCells, | ||
removeCell: () => removeCell(id), | ||
}, | ||
@@ -82,0 +84,0 @@ // tslint:disable-next-line:no-any |
@@ -52,2 +52,3 @@ /* | ||
version, | ||
remove: this.props.removeCell, | ||
}; | ||
@@ -68,4 +69,4 @@ // Basically we check if the focus state changed and if yes, we execute the callback handler from the plugin, that | ||
const { plugin, state } = layout; | ||
const { Component, version, name } = plugin; | ||
const { focusCell, blurCell } = this.props; | ||
const { Component, version, name, text } = plugin; | ||
const { focusCell, blurCell, removeCell } = this.props; | ||
let focusProps; | ||
@@ -86,3 +87,3 @@ if (!this.props.isPreviewMode) { | ||
return (React.createElement("div", Object.assign({}, focusProps, { tabIndex: "-1", className: "ory-cell-inner", ref: this.onRef }), | ||
React.createElement(Component, { id: id, state: state, focus: focusCell, blur: blurCell, editable: editable, focused: this.props.isEditMode && focused, name: name, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellLayout }, rows.map((r) => (React.createElement(Row, { editable: editable, ancestors: [...ancestors, id], key: r, id: r })))))); | ||
React.createElement(Component, { id: id, state: state, focus: focusCell, blur: blurCell, editable: editable, focused: this.props.isEditMode && focused, name: name, text: text, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellLayout, remove: removeCell }, rows.map((r) => (React.createElement(Row, { editable: editable, ancestors: [...ancestors, id], key: r, id: r })))))); | ||
} | ||
@@ -89,0 +90,0 @@ } |
@@ -14,3 +14,3 @@ import { AnyAction } from 'redux'; | ||
}; | ||
export declare type OmitInPluginConfig = 'id' | 'focus' | 'blur' | 'editable' | 'readOnly' | 'state' | 'onChange' | 'focused'; | ||
export declare type OmitInPluginConfig = 'id' | 'focus' | 'blur' | 'editable' | 'readOnly' | 'state' | 'onChange' | 'focused' | 'remove'; | ||
export declare type PluginConfig<T = any, ExtraProps = {}> = Omit<PluginProps<T, ExtraProps>, OmitInPluginConfig>; | ||
@@ -96,2 +96,3 @@ export declare type ContentPluginConfig<T = any> = Omit<ContentPluginProps<T>, OmitInPluginConfig | 'isEditMode' | 'isResizeMode' | 'isLayoutMode' | 'isPreviewMode' | 'isInsertMode'>; | ||
editable?: string; | ||
remove?: () => void; | ||
/** | ||
@@ -98,0 +99,0 @@ * Should be called with the new state if the plugin's state changes. |
@@ -91,2 +91,3 @@ "use strict"; | ||
isLayoutMode: nextProps.isLayoutMode, | ||
remove: nextProps.removeCell, | ||
}; | ||
@@ -105,4 +106,4 @@ // Basically we check if the focus state changed and if yes, we execute the callback handler from the plugin, that | ||
Content.prototype.render = function () { | ||
var _a = this.props, editable = _a.editable, id = _a.id, _b = _a.node, _c = _b.content, _d = _c === void 0 ? {} : _c, _e = _d.plugin, _f = _e === void 0 ? {} : _e, _g = _f.Component, Component = _g === void 0 ? function () { return null; } : _g, _h = _f.name, name = _h === void 0 ? 'N/A' : _h, _j = _f.version, version = _j === void 0 ? 'N/A' : _j, _k = _d.state, state = _k === void 0 ? {} : _k, focused = _b.focused; | ||
var _l = this.props, focusCell = _l.focusCell, blurCell = _l.blurCell; | ||
var _a = this.props, editable = _a.editable, id = _a.id, _b = _a.node, _c = _b.content, _d = _c === void 0 ? {} : _c, _e = _d.plugin, _f = _e === void 0 ? {} : _e, _g = _f.Component, Component = _g === void 0 ? function () { return null; } : _g, _h = _f.name, name = _h === void 0 ? 'N/A' : _h, _j = _f.version, version = _j === void 0 ? 'N/A' : _j, _k = _f.text, text = _k === void 0 ? 'unnamed plugin' : _k, _l = _d.state, state = _l === void 0 ? {} : _l, focused = _b.focused; | ||
var _m = this.props, focusCell = _m.focusCell, blurCell = _m.blurCell; | ||
var focusProps; | ||
@@ -120,3 +121,3 @@ if (!this.props.isPreviewMode) { | ||
return (React.createElement("div", __assign({}, focusProps, { tabIndex: "-1", style: { outline: 'none' }, ref: this.onRef, className: "ory-cell-inner ory-cell-leaf" }), | ||
React.createElement(Component, { editable: editable, id: id, state: state, focused: this.props.isEditMode && focused, name: name, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellContent, focus: focusCell, blur: blurCell, isInsertMode: this.props.isInsertMode, isResizeMode: this.props.isResizeMode, isPreviewMode: this.props.isPreviewMode, isEditMode: this.props.isEditMode, isLayoutMode: this.props.isLayoutMode }))); | ||
React.createElement(Component, { editable: editable, id: id, state: state, focused: this.props.isEditMode && focused, name: name, text: text, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellContent, focus: focusCell, blur: blurCell, isInsertMode: this.props.isInsertMode, isResizeMode: this.props.isResizeMode, isPreviewMode: this.props.isPreviewMode, isEditMode: this.props.isEditMode, isLayoutMode: this.props.isLayoutMode, remove: this.props.removeCell }))); | ||
}; | ||
@@ -123,0 +124,0 @@ return Content; |
@@ -79,2 +79,3 @@ "use strict"; | ||
var Resizable_1 = __importDefault(require("./Resizable")); | ||
var core_1 = require("./../../actions/cell/core"); | ||
var gridClass = function (_a) { | ||
@@ -125,2 +126,3 @@ var size = _a.node.size, rest = __rest(_a, ["node"]); | ||
blurAllCells: cell_1.blurAllCells, | ||
removeCell: function () { return core_1.removeCell(id); }, | ||
}, | ||
@@ -127,0 +129,0 @@ // tslint:disable-next-line:no-any |
@@ -97,2 +97,3 @@ "use strict"; | ||
version: version, | ||
remove: this.props.removeCell, | ||
}; | ||
@@ -114,4 +115,4 @@ // Basically we check if the focus state changed and if yes, we execute the callback handler from the plugin, that | ||
var plugin = layout.plugin, state = layout.state; | ||
var Component = plugin.Component, version = plugin.version, name = plugin.name; | ||
var _e = this.props, focusCell = _e.focusCell, blurCell = _e.blurCell; | ||
var Component = plugin.Component, version = plugin.version, name = plugin.name, text = plugin.text; | ||
var _e = this.props, focusCell = _e.focusCell, blurCell = _e.blurCell, removeCell = _e.removeCell; | ||
var focusProps; | ||
@@ -132,3 +133,3 @@ if (!this.props.isPreviewMode) { | ||
return (React.createElement("div", __assign({}, focusProps, { tabIndex: "-1", className: "ory-cell-inner", ref: this.onRef }), | ||
React.createElement(Component, { id: id, state: state, focus: focusCell, blur: blurCell, editable: editable, focused: this.props.isEditMode && focused, name: name, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellLayout }, rows.map(function (r) { return (React.createElement(Row_1.default, { editable: editable, ancestors: __spreadArrays(ancestors, [id]), key: r, id: r })); })))); | ||
React.createElement(Component, { id: id, state: state, focus: focusCell, blur: blurCell, editable: editable, focused: this.props.isEditMode && focused, name: name, text: text, version: version, readOnly: !this.props.isEditMode, onChange: this.props.updateCellLayout, remove: removeCell }, rows.map(function (r) { return (React.createElement(Row_1.default, { editable: editable, ancestors: __spreadArrays(ancestors, [id]), key: r, id: r })); })))); | ||
}; | ||
@@ -135,0 +136,0 @@ return Layout; |
@@ -14,3 +14,3 @@ import { AnyAction } from 'redux'; | ||
}; | ||
export declare type OmitInPluginConfig = 'id' | 'focus' | 'blur' | 'editable' | 'readOnly' | 'state' | 'onChange' | 'focused'; | ||
export declare type OmitInPluginConfig = 'id' | 'focus' | 'blur' | 'editable' | 'readOnly' | 'state' | 'onChange' | 'focused' | 'remove'; | ||
export declare type PluginConfig<T = any, ExtraProps = {}> = Omit<PluginProps<T, ExtraProps>, OmitInPluginConfig>; | ||
@@ -96,2 +96,3 @@ export declare type ContentPluginConfig<T = any> = Omit<ContentPluginProps<T>, OmitInPluginConfig | 'isEditMode' | 'isResizeMode' | 'isLayoutMode' | 'isPreviewMode' | 'isInsertMode'>; | ||
editable?: string; | ||
remove?: () => void; | ||
/** | ||
@@ -98,0 +99,0 @@ * Should be called with the new state if the plugin's state changes. |
{ | ||
"name": "@react-page/core", | ||
"version": "0.11.4", | ||
"version": "0.12.0", | ||
"main": "./lib/index.js", | ||
@@ -56,3 +56,3 @@ "module": "./lib-es/index.js", | ||
}, | ||
"gitHead": "d2b71819c5b1447181707230dfca77a83b99c5c6" | ||
"gitHead": "5941d2185c63b4a1c073f70843fc37408db933a7" | ||
} |
@@ -48,3 +48,4 @@ /* | ||
| 'onChange' | ||
| 'focused'; | ||
| 'focused' | ||
| 'remove'; | ||
@@ -207,2 +208,3 @@ // tslint:disable-next-line:no-any | ||
editable?: string; | ||
remove?: () => void; // removes the plugin | ||
/** | ||
@@ -209,0 +211,0 @@ * Should be called with the new state if the plugin's state changes. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1695775
28476