@tinymce/tinymce-react
Advanced tools
Comparing version 4.3.3-feature.20240321025936244.sha567754e to 4.3.3-feature.20240321202715926.sha32cec42
@@ -7,10 +7,4 @@ import * as React from 'react'; | ||
type EditorOptions = Parameters<TinyMCE['init']>[0]; | ||
export type Version = `${'4' | '5' | '6' | '7'}${'' | '-dev' | '-testing' | `.${number}` | `.${number}.${number}`}`; | ||
export interface CloudHostedProps { | ||
export interface IProps { | ||
apiKey: string; | ||
} | ||
export interface HybridOrSelfHostedProps { | ||
licenseKey: string; | ||
} | ||
export interface IProps { | ||
id: string; | ||
@@ -21,5 +15,5 @@ inline: boolean; | ||
value: string; | ||
init: EditorOptions & Partial<Record<'selector' | 'target' | 'readonly' | 'license_key', undefined>>; | ||
init: EditorOptions & Partial<Record<'selector' | 'target' | 'readonly', undefined>>; | ||
tagName: string; | ||
cloudChannel: Version; | ||
cloudChannel: string; | ||
plugins: NonNullable<EditorOptions['plugins']>; | ||
@@ -37,6 +31,4 @@ toolbar: NonNullable<EditorOptions['toolbar']>; | ||
} | ||
export type IAllProps = (CloudHostedProps | HybridOrSelfHostedProps) & Partial<IProps & IEvents>; | ||
/** | ||
* @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/} for the TinyMCE React Technical Reference | ||
*/ | ||
export interface IAllProps extends Partial<IProps>, Partial<IEvents> { | ||
} | ||
export declare class Editor extends React.Component<IAllProps> { | ||
@@ -53,3 +45,3 @@ static propTypes: IEditorPropTypes; | ||
private valueCursor; | ||
constructor(props: IAllProps); | ||
constructor(props: Partial<IAllProps>); | ||
private get view(); | ||
@@ -56,0 +48,0 @@ componentDidUpdate(prevProps: Partial<IAllProps>): void; |
@@ -35,5 +35,2 @@ "use strict"; | ||
var EditorPropTypes_1 = require("./EditorPropTypes"); | ||
/** | ||
* @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/} for the TinyMCE React Technical Reference | ||
*/ | ||
var Editor = /** @class */ (function (_super) { | ||
@@ -133,3 +130,3 @@ __extends(Editor, _super); | ||
} | ||
var finalInit = __assign(__assign(__assign(__assign({}, _this.props.init), { selector: undefined, target: target, readonly: _this.props.disabled, inline: _this.inline, plugins: (0, Utils_1.mergePlugins)((_a = _this.props.init) === null || _a === void 0 ? void 0 : _a.plugins, _this.props.plugins), toolbar: (_b = _this.props.toolbar) !== null && _b !== void 0 ? _b : (_c = _this.props.init) === null || _c === void 0 ? void 0 : _c.toolbar }), ('licenseKey' in _this.props && _this.props.licenseKey ? { license_key: _this.props.licenseKey } : {})), { setup: function (editor) { | ||
var finalInit = __assign(__assign({}, _this.props.init), { selector: undefined, target: target, readonly: _this.props.disabled, inline: _this.inline, plugins: (0, Utils_1.mergePlugins)((_a = _this.props.init) === null || _a === void 0 ? void 0 : _a.plugins, _this.props.plugins), toolbar: (_b = _this.props.toolbar) !== null && _b !== void 0 ? _b : (_c = _this.props.init) === null || _c === void 0 ? void 0 : _c.toolbar, setup: function (editor) { | ||
_this.editor = editor; | ||
@@ -255,3 +252,3 @@ _this.bindHandlers({}); | ||
} | ||
else if ('tinymceScriptSrc' in this.props && Array.isArray(this.props.tinymceScriptSrc) && this.props.tinymceScriptSrc.length === 0) { | ||
else if (Array.isArray(this.props.tinymceScriptSrc) && this.props.tinymceScriptSrc.length === 0) { | ||
(_b = (_a = this.props).onScriptsLoadError) === null || _b === void 0 ? void 0 : _b.call(_a, new Error('No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array.')); | ||
@@ -321,3 +318,3 @@ } | ||
var defer = (_b = this.props.scriptLoading) === null || _b === void 0 ? void 0 : _b.defer; | ||
if ('tinymceScriptSrc' in this.props && this.props.tinymceScriptSrc !== undefined) { | ||
if (this.props.tinymceScriptSrc !== undefined) { | ||
if (typeof this.props.tinymceScriptSrc === 'string') { | ||
@@ -339,4 +336,4 @@ return [{ src: this.props.tinymceScriptSrc, async: async, defer: defer }]; | ||
// fallback to the cloud when the tinymceScriptSrc is not specified | ||
var channel = this.props.cloudChannel; // `cloudChannel` is in `defaultProps`, so it's always defined. | ||
var apiKey = 'apiKey' in this.props && this.props.apiKey ? this.props.apiKey : 'no-api-key'; | ||
var channel = this.props.cloudChannel; | ||
var apiKey = this.props.apiKey ? this.props.apiKey : 'no-api-key'; | ||
var cloudTinyJs = "https://cdn.tiny.cloud/1/".concat(apiKey, "/tinymce/").concat(channel, "/tinymce.min.js"); | ||
@@ -383,3 +380,3 @@ return [{ src: cloudTinyJs, async: async, defer: defer }]; | ||
Editor.defaultProps = { | ||
cloudChannel: '7', | ||
cloudChannel: '6' | ||
}; | ||
@@ -386,0 +383,0 @@ return Editor; |
import * as PropTypes from 'prop-types'; | ||
import { IEvents } from '../Events'; | ||
import { HybridOrSelfHostedProps, IProps, CloudHostedProps } from './Editor'; | ||
import { IProps } from './Editor'; | ||
export type CopyProps<T> = { | ||
@@ -8,5 +8,5 @@ [P in keyof T]: PropTypes.Requireable<unknown>; | ||
export type IEventPropTypes = CopyProps<IEvents>; | ||
export interface IEditorPropTypes extends IEventPropTypes, CopyProps<IProps & CloudHostedProps & HybridOrSelfHostedProps> { | ||
export interface IEditorPropTypes extends IEventPropTypes, CopyProps<IProps> { | ||
} | ||
export declare const eventPropTypes: IEventPropTypes; | ||
export declare const EditorPropTypes: IEditorPropTypes; |
@@ -89,3 +89,3 @@ "use strict"; | ||
}; | ||
exports.EditorPropTypes = __assign({ apiKey: PropTypes.string, licenseKey: PropTypes.string, id: PropTypes.string, inline: PropTypes.bool, init: PropTypes.object, initialValue: PropTypes.string, onEditorChange: PropTypes.func, value: PropTypes.string, tagName: PropTypes.string, cloudChannel: PropTypes.string, plugins: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), toolbar: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), disabled: PropTypes.bool, textareaName: PropTypes.string, tinymceScriptSrc: PropTypes.oneOfType([ | ||
exports.EditorPropTypes = __assign({ apiKey: PropTypes.string, id: PropTypes.string, inline: PropTypes.bool, init: PropTypes.object, initialValue: PropTypes.string, onEditorChange: PropTypes.func, value: PropTypes.string, tagName: PropTypes.string, cloudChannel: PropTypes.string, plugins: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), toolbar: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), disabled: PropTypes.bool, textareaName: PropTypes.string, tinymceScriptSrc: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
@@ -92,0 +92,0 @@ PropTypes.arrayOf(PropTypes.string), |
@@ -7,10 +7,4 @@ import * as React from 'react'; | ||
type EditorOptions = Parameters<TinyMCE['init']>[0]; | ||
export type Version = `${'4' | '5' | '6' | '7'}${'' | '-dev' | '-testing' | `.${number}` | `.${number}.${number}`}`; | ||
export interface CloudHostedProps { | ||
export interface IProps { | ||
apiKey: string; | ||
} | ||
export interface HybridOrSelfHostedProps { | ||
licenseKey: string; | ||
} | ||
export interface IProps { | ||
id: string; | ||
@@ -21,5 +15,5 @@ inline: boolean; | ||
value: string; | ||
init: EditorOptions & Partial<Record<'selector' | 'target' | 'readonly' | 'license_key', undefined>>; | ||
init: EditorOptions & Partial<Record<'selector' | 'target' | 'readonly', undefined>>; | ||
tagName: string; | ||
cloudChannel: Version; | ||
cloudChannel: string; | ||
plugins: NonNullable<EditorOptions['plugins']>; | ||
@@ -37,6 +31,4 @@ toolbar: NonNullable<EditorOptions['toolbar']>; | ||
} | ||
export type IAllProps = (CloudHostedProps | HybridOrSelfHostedProps) & Partial<IProps & IEvents>; | ||
/** | ||
* @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/} for the TinyMCE React Technical Reference | ||
*/ | ||
export interface IAllProps extends Partial<IProps>, Partial<IEvents> { | ||
} | ||
export declare class Editor extends React.Component<IAllProps> { | ||
@@ -53,3 +45,3 @@ static propTypes: IEditorPropTypes; | ||
private valueCursor; | ||
constructor(props: IAllProps); | ||
constructor(props: Partial<IAllProps>); | ||
private get view(); | ||
@@ -56,0 +48,0 @@ componentDidUpdate(prevProps: Partial<IAllProps>): void; |
@@ -32,5 +32,2 @@ var __extends = (this && this.__extends) || (function () { | ||
import { EditorPropTypes } from './EditorPropTypes'; | ||
/** | ||
* @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/} for the TinyMCE React Technical Reference | ||
*/ | ||
var Editor = /** @class */ (function (_super) { | ||
@@ -130,3 +127,3 @@ __extends(Editor, _super); | ||
} | ||
var finalInit = __assign(__assign(__assign(__assign({}, _this.props.init), { selector: undefined, target: target, readonly: _this.props.disabled, inline: _this.inline, plugins: mergePlugins((_a = _this.props.init) === null || _a === void 0 ? void 0 : _a.plugins, _this.props.plugins), toolbar: (_b = _this.props.toolbar) !== null && _b !== void 0 ? _b : (_c = _this.props.init) === null || _c === void 0 ? void 0 : _c.toolbar }), ('licenseKey' in _this.props && _this.props.licenseKey ? { license_key: _this.props.licenseKey } : {})), { setup: function (editor) { | ||
var finalInit = __assign(__assign({}, _this.props.init), { selector: undefined, target: target, readonly: _this.props.disabled, inline: _this.inline, plugins: mergePlugins((_a = _this.props.init) === null || _a === void 0 ? void 0 : _a.plugins, _this.props.plugins), toolbar: (_b = _this.props.toolbar) !== null && _b !== void 0 ? _b : (_c = _this.props.init) === null || _c === void 0 ? void 0 : _c.toolbar, setup: function (editor) { | ||
_this.editor = editor; | ||
@@ -252,3 +249,3 @@ _this.bindHandlers({}); | ||
} | ||
else if ('tinymceScriptSrc' in this.props && Array.isArray(this.props.tinymceScriptSrc) && this.props.tinymceScriptSrc.length === 0) { | ||
else if (Array.isArray(this.props.tinymceScriptSrc) && this.props.tinymceScriptSrc.length === 0) { | ||
(_b = (_a = this.props).onScriptsLoadError) === null || _b === void 0 ? void 0 : _b.call(_a, new Error('No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array.')); | ||
@@ -318,3 +315,3 @@ } | ||
var defer = (_b = this.props.scriptLoading) === null || _b === void 0 ? void 0 : _b.defer; | ||
if ('tinymceScriptSrc' in this.props && this.props.tinymceScriptSrc !== undefined) { | ||
if (this.props.tinymceScriptSrc !== undefined) { | ||
if (typeof this.props.tinymceScriptSrc === 'string') { | ||
@@ -336,4 +333,4 @@ return [{ src: this.props.tinymceScriptSrc, async: async, defer: defer }]; | ||
// fallback to the cloud when the tinymceScriptSrc is not specified | ||
var channel = this.props.cloudChannel; // `cloudChannel` is in `defaultProps`, so it's always defined. | ||
var apiKey = 'apiKey' in this.props && this.props.apiKey ? this.props.apiKey : 'no-api-key'; | ||
var channel = this.props.cloudChannel; | ||
var apiKey = this.props.apiKey ? this.props.apiKey : 'no-api-key'; | ||
var cloudTinyJs = "https://cdn.tiny.cloud/1/".concat(apiKey, "/tinymce/").concat(channel, "/tinymce.min.js"); | ||
@@ -380,3 +377,3 @@ return [{ src: cloudTinyJs, async: async, defer: defer }]; | ||
Editor.defaultProps = { | ||
cloudChannel: '7', | ||
cloudChannel: '6' | ||
}; | ||
@@ -383,0 +380,0 @@ return Editor; |
import * as PropTypes from 'prop-types'; | ||
import { IEvents } from '../Events'; | ||
import { HybridOrSelfHostedProps, IProps, CloudHostedProps } from './Editor'; | ||
import { IProps } from './Editor'; | ||
export type CopyProps<T> = { | ||
@@ -8,5 +8,5 @@ [P in keyof T]: PropTypes.Requireable<unknown>; | ||
export type IEventPropTypes = CopyProps<IEvents>; | ||
export interface IEditorPropTypes extends IEventPropTypes, CopyProps<IProps & CloudHostedProps & HybridOrSelfHostedProps> { | ||
export interface IEditorPropTypes extends IEventPropTypes, CopyProps<IProps> { | ||
} | ||
export declare const eventPropTypes: IEventPropTypes; | ||
export declare const EditorPropTypes: IEditorPropTypes; |
@@ -86,3 +86,3 @@ var __assign = (this && this.__assign) || function () { | ||
}; | ||
export var EditorPropTypes = __assign({ apiKey: PropTypes.string, licenseKey: PropTypes.string, id: PropTypes.string, inline: PropTypes.bool, init: PropTypes.object, initialValue: PropTypes.string, onEditorChange: PropTypes.func, value: PropTypes.string, tagName: PropTypes.string, cloudChannel: PropTypes.string, plugins: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), toolbar: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), disabled: PropTypes.bool, textareaName: PropTypes.string, tinymceScriptSrc: PropTypes.oneOfType([ | ||
export var EditorPropTypes = __assign({ apiKey: PropTypes.string, id: PropTypes.string, inline: PropTypes.bool, init: PropTypes.object, initialValue: PropTypes.string, onEditorChange: PropTypes.func, value: PropTypes.string, tagName: PropTypes.string, cloudChannel: PropTypes.string, plugins: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), toolbar: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), disabled: PropTypes.bool, textareaName: PropTypes.string, tinymceScriptSrc: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
@@ -89,0 +89,0 @@ PropTypes.arrayOf(PropTypes.string), |
@@ -30,3 +30,3 @@ { | ||
"prop-types": "^15.6.2", | ||
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1" | ||
"tinymce": "^6.0.0 || ^5.5.1" | ||
}, | ||
@@ -43,4 +43,4 @@ "peerDependencies": { | ||
"@ephox/agar": "^8.0.0-alpha.0", | ||
"@ephox/bedrock-client": "^14.1.1", | ||
"@ephox/bedrock-server": "^14.1.3", | ||
"@ephox/bedrock-client": "^13.0.0", | ||
"@ephox/bedrock-server": "^13.6.0", | ||
"@ephox/katamari": "^9.1.5", | ||
@@ -50,11 +50,13 @@ "@ephox/mcagar": "^9.0.0-alpha.0", | ||
"@ephox/sugar": "^9.2.1", | ||
"@storybook/addon-essentials": "^8.0.2", | ||
"@storybook/addon-interactions": "^8.0.2", | ||
"@storybook/addon-links": "^8.0.2", | ||
"@storybook/blocks": "^8.0.2", | ||
"@storybook/react": "^8.0.2", | ||
"@storybook/react-vite": "^8.0.2", | ||
"@storybook/addon-essentials": "^7.5.3", | ||
"@storybook/addon-interactions": "^7.5.3", | ||
"@storybook/addon-links": "^7.5.3", | ||
"@storybook/addon-onboarding": "^1.0.8", | ||
"@storybook/blocks": "^7.5.3", | ||
"@storybook/react": "^7.5.3", | ||
"@storybook/react-webpack5": "^7.5.3", | ||
"@storybook/testing-library": "^0.2.2", | ||
"@tinymce/beehive-flow": "^0.19.0", | ||
"@tinymce/eslint-plugin": "^2.3.1", | ||
"@tinymce/miniature": "^6.0.0", | ||
"@tinymce/miniature": "^5.0.1", | ||
"@types/node": "^20.9.0", | ||
@@ -68,12 +70,10 @@ "@types/prop-types": "^15.7.10", | ||
"rimraf": "^5.0.5", | ||
"storybook": "^8.0.2", | ||
"storybook": "^7.5.3", | ||
"tinymce-4": "npm:tinymce@^4", | ||
"tinymce-5": "npm:tinymce@^5", | ||
"tinymce-6": "npm:tinymce@^6", | ||
"tinymce-7": "npm:tinymce@^7", | ||
"typescript": "~5.4.3", | ||
"vite": "^5.2.2" | ||
"typescript": "~5.2.2" | ||
}, | ||
"version": "4.3.3-feature.20240321025936244.sha567754e", | ||
"version": "4.3.3-feature.20240321202715926.sha32cec42", | ||
"name": "@tinymce/tinymce-react" | ||
} |
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
97281
1796
+ Addedtinymce@6.8.5(transitive)
- Removedtinymce@7.6.0(transitive)
Updatedtinymce@^6.0.0 || ^5.5.1