@_sh/strapi-plugin-ckeditor 4.0.11 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +586 -575
- package/dist/_chunks/Field-8Nh0dMSc.mjs +574 -0
- package/dist/_chunks/Field-BKtrDFjh.js +598 -0
- package/dist/_chunks/index-CNalXcwy.mjs +1330 -0
- package/dist/_chunks/index-DO2vqIdx.js +1350 -0
- package/dist/admin/index.js +11 -4
- package/dist/admin/index.mjs +10 -4
- package/dist/admin/src/components/CKEReact.d.ts +6 -0
- package/dist/admin/src/components/CKEditorIcon.d.ts +1 -0
- package/dist/admin/src/components/Editor.d.ts +1 -0
- package/dist/admin/src/components/EditorLayout.d.ts +4 -0
- package/dist/admin/src/components/EditorProvider.d.ts +20 -0
- package/dist/admin/src/components/Field.d.ts +20 -0
- package/dist/admin/src/components/GlobalStyling.d.ts +4 -0
- package/dist/admin/src/components/MediaLib.d.ts +9 -0
- package/dist/admin/src/config/htmlPreset.d.ts +2 -0
- package/dist/admin/src/config/index.d.ts +5 -0
- package/dist/admin/src/config/language.d.ts +15 -0
- package/dist/admin/src/config/markdownPreset.d.ts +2 -0
- package/dist/admin/src/config/pluginConfig.d.ts +23 -0
- package/dist/admin/src/config/types.d.ts +123 -0
- package/dist/admin/src/exports.d.ts +9 -0
- package/dist/admin/src/index.d.ts +6 -0
- package/dist/admin/src/plugins/StrapiMediaLib.d.ts +15 -0
- package/dist/admin/src/plugins/StrapiUploadAdapter.d.ts +12 -0
- package/dist/admin/src/plugins/index.d.ts +2 -0
- package/dist/admin/src/theme/additional.d.ts +1 -0
- package/dist/admin/src/theme/colors.d.ts +1 -0
- package/dist/admin/src/theme/common.d.ts +1 -0
- package/dist/admin/src/theme/dark.d.ts +1 -0
- package/dist/admin/src/theme/index.d.ts +2 -0
- package/dist/admin/src/theme/light.d.ts +1 -0
- package/dist/admin/src/utils/index.d.ts +4 -0
- package/dist/admin/src/utils/isImageResponsive.d.ts +3 -0
- package/dist/admin/src/utils/localStorage.d.ts +3 -0
- package/dist/admin/src/utils/pluginId.d.ts +1 -0
- package/dist/admin/src/utils/prefixWithBackendUrl.d.ts +1 -0
- package/dist/server/index.js +61 -119
- package/dist/server/index.mjs +61 -117
- package/dist/server/src/index.d.ts +7 -0
- package/package.json +50 -22
- package/dist/_chunks/index-5LGZsCS3.mjs +0 -1125
- package/dist/_chunks/index-5LGZsCS3.mjs.map +0 -1
- package/dist/_chunks/index-B5HkOicq.mjs +0 -3530
- package/dist/_chunks/index-B5HkOicq.mjs.map +0 -1
- package/dist/_chunks/index-BOqpyEaD.js +0 -1150
- package/dist/_chunks/index-BOqpyEaD.js.map +0 -1
- package/dist/_chunks/index-BQ7yqvCN.mjs +0 -1124
- package/dist/_chunks/index-BQ7yqvCN.mjs.map +0 -1
- package/dist/_chunks/index-BZP-quaN.mjs +0 -3530
- package/dist/_chunks/index-BZP-quaN.mjs.map +0 -1
- package/dist/_chunks/index-BZZiYjTp.mjs +0 -3530
- package/dist/_chunks/index-BZZiYjTp.mjs.map +0 -1
- package/dist/_chunks/index-Be-t5n4r.mjs +0 -1125
- package/dist/_chunks/index-Be-t5n4r.mjs.map +0 -1
- package/dist/_chunks/index-BiOS6ItS.js +0 -1150
- package/dist/_chunks/index-BiOS6ItS.js.map +0 -1
- package/dist/_chunks/index-C4BPSFZt.mjs +0 -3530
- package/dist/_chunks/index-C4BPSFZt.mjs.map +0 -1
- package/dist/_chunks/index-CFskHjqL.js +0 -3548
- package/dist/_chunks/index-CFskHjqL.js.map +0 -1
- package/dist/_chunks/index-CPBrnTwd.mjs +0 -1124
- package/dist/_chunks/index-CPBrnTwd.mjs.map +0 -1
- package/dist/_chunks/index-CRK4zk5I.js +0 -3548
- package/dist/_chunks/index-CRK4zk5I.js.map +0 -1
- package/dist/_chunks/index-CUmwBN9O.js +0 -1151
- package/dist/_chunks/index-CUmwBN9O.js.map +0 -1
- package/dist/_chunks/index-CaYpAgjX.js +0 -1151
- package/dist/_chunks/index-CaYpAgjX.js.map +0 -1
- package/dist/_chunks/index-pRK2Er3w.js +0 -3548
- package/dist/_chunks/index-pRK2Er3w.js.map +0 -1
- package/dist/_chunks/index-uYy-Myyv.js +0 -3548
- package/dist/_chunks/index-uYy-Myyv.js.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/index.mjs.map +0 -1
- package/strapi-server.js +0 -3
package/dist/admin/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
require("yup");
|
|
4
|
+
const index = require("../_chunks/index-DO2vqIdx.js");
|
|
5
|
+
require("ckeditor5");
|
|
6
|
+
exports.StrapiMediaLib = index.StrapiMediaLib;
|
|
7
|
+
exports.StrapiUploadAdapter = index.StrapiUploadAdapter;
|
|
8
|
+
exports.default = index.index;
|
|
9
|
+
exports.defaultHtmlPreset = index.clonedDefaultHtmlPreset;
|
|
10
|
+
exports.defaultMarkdownPreset = index.clonedDefaultMarkdownPreset;
|
|
11
|
+
exports.defaultTheme = index.clonedDefaultTheme;
|
|
12
|
+
exports.setPluginConfig = index.setPluginConfig;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
1
|
+
import "yup";
|
|
2
|
+
import { S, e, a, b, d, c, s } from "../_chunks/index-CNalXcwy.mjs";
|
|
3
|
+
import "ckeditor5";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
+
S as StrapiMediaLib,
|
|
6
|
+
e as StrapiUploadAdapter,
|
|
7
|
+
a as default,
|
|
8
|
+
b as defaultHtmlPreset,
|
|
9
|
+
d as defaultMarkdownPreset,
|
|
10
|
+
c as defaultTheme,
|
|
11
|
+
s as setPluginConfig
|
|
5
12
|
};
|
|
6
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CKEditorIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Editor(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputProps } from '@strapi/strapi/admin';
|
|
3
|
+
import { type Preset } from '../config';
|
|
4
|
+
type EditorProviderBaseProps = Pick<InputProps, 'name' | 'disabled' | 'placeholder' | 'hint' | 'label' | 'required'> & {
|
|
5
|
+
labelAction?: React.ReactNode;
|
|
6
|
+
presetName: string;
|
|
7
|
+
wordsLimit?: number;
|
|
8
|
+
charsLimit?: number;
|
|
9
|
+
isFieldLocalized: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
12
|
+
type EditorContextValue = EditorProviderBaseProps & {
|
|
13
|
+
preset: Preset | null;
|
|
14
|
+
};
|
|
15
|
+
type EditorProviderProps = EditorProviderBaseProps & {
|
|
16
|
+
children: React.ReactElement;
|
|
17
|
+
};
|
|
18
|
+
export declare function useEditorContext(): EditorContextValue;
|
|
19
|
+
export declare function EditorProvider({ name, disabled, error, placeholder, hint, label, labelAction, required, presetName, wordsLimit, charsLimit, children, isFieldLocalized, }: EditorProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputProps, FieldValue } from '@strapi/strapi/admin';
|
|
3
|
+
type CKEditorFieldProps = Readonly<InputProps & FieldValue & {
|
|
4
|
+
labelAction?: React.ReactNode;
|
|
5
|
+
attribute: {
|
|
6
|
+
options: {
|
|
7
|
+
preset: string;
|
|
8
|
+
maxLengthWords: number;
|
|
9
|
+
maxLengthCharacters: number;
|
|
10
|
+
};
|
|
11
|
+
pluginOptions?: {
|
|
12
|
+
i18n?: {
|
|
13
|
+
localized?: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
declare function Field({ name, hint, error, placeholder, label, attribute, labelAction, disabled, required, }: CKEditorFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare const MemoizedField: React.MemoExoticComponent<typeof Field>;
|
|
20
|
+
export { MemoizedField as Field };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type MediaLibProps = {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
toggle: () => void;
|
|
5
|
+
handleChangeAssets: (newElems: string) => void;
|
|
6
|
+
};
|
|
7
|
+
declare function MediaLib({ isOpen, toggle, handleChangeAssets }: MediaLibProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
declare const MemoizedMediaLib: React.MemoExoticComponent<typeof MediaLib>;
|
|
9
|
+
export { MemoizedMediaLib as MediaLib };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EditorConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets the language property for the provided editor configuration and loads translations.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
*
|
|
9
|
+
* - UI language: If the language is not set, it defaults to the admin's preferred language, falling
|
|
10
|
+
* back to 'en'. If the language is other than 'en', the CKEditor translation will be loaded.
|
|
11
|
+
*
|
|
12
|
+
* - Content language: Checks whether the field is localized (`isFieldLocalized`) and applies
|
|
13
|
+
* the determined i18n language accordingly.
|
|
14
|
+
*/
|
|
15
|
+
export declare function setUpLanguage(config: EditorConfig, isFieldLocalized: boolean): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PluginConfig, UserPluginConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets a configuration for the plugin.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
*
|
|
7
|
+
* - The function must be invoked before the admin panel's bootstrap lifecycle function.
|
|
8
|
+
* The general recommendation is to call it inside the admin panel's register lifecycle function.
|
|
9
|
+
*
|
|
10
|
+
* - Provided properties will overwrite the default configuration values.
|
|
11
|
+
*
|
|
12
|
+
* - The configuration becomes immutable after the first invocation, preventing further
|
|
13
|
+
* modifications.
|
|
14
|
+
*
|
|
15
|
+
* @param userConfig - The plugin configuration object.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setPluginConfig(userPluginConfig: UserPluginConfig): void;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the current plugin configuration, ensuring it is immutable.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPluginConfig(): PluginConfig;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { EditorConfig as CKE5EditorConfig } from 'ckeditor5';
|
|
2
|
+
import type { Interpolation } from 'styled-components';
|
|
3
|
+
/**
|
|
4
|
+
* Plugin configuration object.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export type PluginConfig = {
|
|
9
|
+
presets: Record<string, Preset>;
|
|
10
|
+
theme: Theme;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Used to register a preset option in the admin panel.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*
|
|
17
|
+
* @see {@link https://docs.strapi.io/dev-docs/custom-fields#options | Strapi documentation}
|
|
18
|
+
*/
|
|
19
|
+
export type Option = {
|
|
20
|
+
metadatas: Metadatas;
|
|
21
|
+
key: string | number;
|
|
22
|
+
/**
|
|
23
|
+
* @remarks
|
|
24
|
+
*
|
|
25
|
+
* The value must match the corresponding key in the presets.
|
|
26
|
+
*/
|
|
27
|
+
value: string | number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Used to register a preset option in the admin panel.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://docs.strapi.io/dev-docs/custom-fields#options | Strapi documentation}
|
|
35
|
+
*/
|
|
36
|
+
export type Metadatas = {
|
|
37
|
+
intlLabel: IntlLabel;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Used to register a preset option in the admin panel.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://docs.strapi.io/dev-docs/custom-fields#options | Strapi documentation}
|
|
45
|
+
*/
|
|
46
|
+
export type IntlLabel = {
|
|
47
|
+
id: string;
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
values?: object;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Plugin configuration object.
|
|
53
|
+
*/
|
|
54
|
+
export type UserPluginConfig = {
|
|
55
|
+
/**
|
|
56
|
+
* Presets are sets of settings that define the editor's features and appearance.
|
|
57
|
+
*/
|
|
58
|
+
presets?: Preset[];
|
|
59
|
+
/**
|
|
60
|
+
* Styles applied globally to every editor instance.
|
|
61
|
+
*/
|
|
62
|
+
theme?: Theme;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Styles applied globally to every editor instance.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
*
|
|
69
|
+
* The `common` styles are applied first, followed by `light` or `dark` styles
|
|
70
|
+
* according to the preferences, and finally `additional` styles.
|
|
71
|
+
*/
|
|
72
|
+
export type Theme = {
|
|
73
|
+
/**
|
|
74
|
+
* Core styles.
|
|
75
|
+
*/
|
|
76
|
+
common?: EditorStyles;
|
|
77
|
+
/**
|
|
78
|
+
* Styles apllied in light mode.
|
|
79
|
+
*/
|
|
80
|
+
light?: EditorStyles;
|
|
81
|
+
/**
|
|
82
|
+
* Styles apllied in dark mode.
|
|
83
|
+
*/
|
|
84
|
+
dark?: EditorStyles;
|
|
85
|
+
/**
|
|
86
|
+
* Additional styles that complement the theme.
|
|
87
|
+
*/
|
|
88
|
+
additional?: EditorStyles;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Represents styles that can be applied to an editor instance.
|
|
92
|
+
* Can be a plain CSS string or an array of interpolations for dynamic styling.
|
|
93
|
+
*/
|
|
94
|
+
export type EditorStyles = string | Interpolation<object>[];
|
|
95
|
+
/**
|
|
96
|
+
* Preset is a set of settings that define the editor's features and appearance.
|
|
97
|
+
*/
|
|
98
|
+
export type Preset = {
|
|
99
|
+
/**
|
|
100
|
+
* Preset name, displayed in the schema.
|
|
101
|
+
*/
|
|
102
|
+
name: string;
|
|
103
|
+
/**
|
|
104
|
+
* Preset description, displayed in the Content-Type Builder.
|
|
105
|
+
*/
|
|
106
|
+
description: string;
|
|
107
|
+
/**
|
|
108
|
+
* Additional styles applied to the editor instance after the theme styles.
|
|
109
|
+
*/
|
|
110
|
+
styles?: EditorStyles;
|
|
111
|
+
/**
|
|
112
|
+
* CKEditor configuration object.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html | CKEditor documentation}
|
|
115
|
+
*/
|
|
116
|
+
editorConfig: EditorConfig;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* CKEditor configuration object.
|
|
120
|
+
*
|
|
121
|
+
* @see {@link https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html | CKEditor documentation}
|
|
122
|
+
*/
|
|
123
|
+
export type EditorConfig = CKE5EditorConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const clonedDefaultTheme: import("./config").Theme;
|
|
2
|
+
declare const clonedDefaultHtmlPreset: import("./config").Preset;
|
|
3
|
+
declare const clonedDefaultMarkdownPreset: import("./config").Preset;
|
|
4
|
+
export { clonedDefaultTheme as defaultTheme };
|
|
5
|
+
export { clonedDefaultHtmlPreset as defaultHtmlPreset };
|
|
6
|
+
export { clonedDefaultMarkdownPreset as defaultMarkdownPreset };
|
|
7
|
+
export type { UserPluginConfig as PluginConfig, EditorConfig, Preset, Theme, EditorStyles, } from './config/types';
|
|
8
|
+
export { setPluginConfig } from './config';
|
|
9
|
+
export { StrapiMediaLib, StrapiUploadAdapter } from './plugins';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Plugin } from 'ckeditor5';
|
|
2
|
+
export interface StrapiMediaLibPlugin extends Plugin {
|
|
3
|
+
connect: (strapiToggle: () => void) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare class StrapiMediaLib extends Plugin implements StrapiMediaLibPlugin {
|
|
6
|
+
/**
|
|
7
|
+
* Strapi function used to show media library modal.
|
|
8
|
+
* Should be provided via connect method before using toggle method.
|
|
9
|
+
*/
|
|
10
|
+
private strapiToggle;
|
|
11
|
+
static get pluginName(): "StrapiMediaLib";
|
|
12
|
+
init(): void;
|
|
13
|
+
connect(strapiToggle: () => void): void;
|
|
14
|
+
toggle(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin, FileRepository, type SimpleUploadConfig } from 'ckeditor5';
|
|
2
|
+
export interface StrapiUploadAdapterConfig extends SimpleUploadConfig {
|
|
3
|
+
}
|
|
4
|
+
export interface StrapiUploadAdapterPlugin extends Plugin {
|
|
5
|
+
initAdapter: (config: StrapiUploadAdapterConfig) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class StrapiUploadAdapter extends Plugin implements StrapiUploadAdapterPlugin {
|
|
8
|
+
static get requires(): readonly [typeof FileRepository];
|
|
9
|
+
static get pluginName(): "StrapiUploadAdapter";
|
|
10
|
+
init(): void;
|
|
11
|
+
initAdapter(config: StrapiUploadAdapterConfig): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const additional: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const colors: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const common: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dark: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const light: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLUGIN_ID: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prefixFileUrlWithBackendUrl(fileURL: string): string;
|
package/dist/server/index.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require$$0$1 = require("fs");
|
|
3
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
4
|
-
const require$$0__default = /* @__PURE__ */ _interopDefault(require$$0$1);
|
|
5
|
-
function getDefaultExportFromCjs(x) {
|
|
6
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
7
|
-
}
|
|
8
2
|
const name = "@_sh/strapi-plugin-ckeditor";
|
|
9
|
-
const version = "
|
|
10
|
-
const description = "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (
|
|
3
|
+
const version = "5.0.0";
|
|
4
|
+
const description = "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)";
|
|
11
5
|
const keywords = [
|
|
12
6
|
"strapi",
|
|
13
7
|
"ckeditor",
|
|
@@ -25,80 +19,109 @@ const repository = {
|
|
|
25
19
|
type: "git",
|
|
26
20
|
url: "https://github.com/nshenderov/strapi-plugin-ckeditor.git"
|
|
27
21
|
};
|
|
28
|
-
const strapi
|
|
22
|
+
const strapi = {
|
|
29
23
|
name: "ckeditor5",
|
|
30
24
|
displayName: "CKEditor 5",
|
|
31
|
-
description: "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (
|
|
25
|
+
description: "Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Community Edition)",
|
|
32
26
|
kind: "plugin"
|
|
33
27
|
};
|
|
28
|
+
const type = "commonjs";
|
|
34
29
|
const exports$1 = {
|
|
35
30
|
"./package.json": "./package.json",
|
|
31
|
+
".": {
|
|
32
|
+
types: "./dist/admin/src/index.d.ts",
|
|
33
|
+
source: "./admin/src/index.ts",
|
|
34
|
+
"import": "./dist/admin/index.mjs",
|
|
35
|
+
require: "./dist/admin/index.js",
|
|
36
|
+
"default": "./dist/admin/index.js"
|
|
37
|
+
},
|
|
36
38
|
"./strapi-admin": {
|
|
37
|
-
|
|
39
|
+
types: "./dist/admin/src/index.d.ts",
|
|
40
|
+
source: "./admin/src/index.ts",
|
|
38
41
|
"import": "./dist/admin/index.mjs",
|
|
39
42
|
require: "./dist/admin/index.js",
|
|
40
43
|
"default": "./dist/admin/index.js"
|
|
41
44
|
},
|
|
42
45
|
"./strapi-server": {
|
|
43
|
-
|
|
46
|
+
types: "./dist/server/src/index.d.ts",
|
|
47
|
+
source: "./server/src/index.ts",
|
|
44
48
|
"import": "./dist/server/index.mjs",
|
|
45
49
|
require: "./dist/server/index.js",
|
|
46
50
|
"default": "./dist/server/index.js"
|
|
47
51
|
}
|
|
48
52
|
};
|
|
49
53
|
const files = [
|
|
50
|
-
"dist"
|
|
51
|
-
"./strapi-server.js"
|
|
54
|
+
"dist"
|
|
52
55
|
];
|
|
53
56
|
const scripts = {
|
|
54
57
|
build: "strapi-plugin build",
|
|
55
58
|
watch: "strapi-plugin watch",
|
|
56
59
|
"watch:link": "strapi-plugin watch:link",
|
|
57
60
|
verify: "strapi-plugin verify",
|
|
61
|
+
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
62
|
+
"test:ts:back": "run -T tsc -p server/tsconfig.json",
|
|
58
63
|
release: "release-it",
|
|
59
64
|
"release:info": "release-it --changelog"
|
|
60
65
|
};
|
|
61
66
|
const dependencies = {
|
|
62
|
-
ckeditor5: "^
|
|
63
|
-
"@
|
|
64
|
-
"@strapi/
|
|
67
|
+
"@ckeditor/ckeditor5-react": "^9.4.0",
|
|
68
|
+
"@strapi/design-system": "^2.0.0-rc.13",
|
|
69
|
+
"@strapi/icons": "^2.0.0-rc.13",
|
|
70
|
+
lodash: "^4.17.21",
|
|
71
|
+
ckeditor5: "^44.0.0",
|
|
65
72
|
"prop-types": "^15.8.1",
|
|
66
|
-
"sanitize-html": "^2.13.1"
|
|
73
|
+
"sanitize-html": "^2.13.1",
|
|
74
|
+
yup: "0.32.9"
|
|
67
75
|
};
|
|
68
76
|
const devDependencies = {
|
|
77
|
+
"@release-it/conventional-changelog": "^8.0.1",
|
|
78
|
+
"@strapi/sdk-plugin": "^5.2.7",
|
|
69
79
|
"@strapi/strapi": "^5.0.0",
|
|
70
|
-
"@strapi/
|
|
71
|
-
|
|
80
|
+
"@strapi/typescript-utils": "^5.4.0",
|
|
81
|
+
"@types/react": "^18.3.12",
|
|
82
|
+
"@types/react-dom": "^18.3.1",
|
|
83
|
+
"@types/sanitize-html": "^2.13.0",
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
85
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
86
|
+
eslint: "^8.2.0",
|
|
87
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
88
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
89
|
+
"eslint-config-prettier": "^9.1.0",
|
|
90
|
+
"eslint-plugin-import": "^2.25.3",
|
|
91
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
92
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
93
|
+
"eslint-plugin-react": "^7.28.0",
|
|
94
|
+
"eslint-plugin-react-hooks": "^4.3.0",
|
|
95
|
+
prettier: "3.4.0",
|
|
72
96
|
react: "^18.3.1",
|
|
73
97
|
"react-dom": "^18.3.1",
|
|
74
98
|
"react-router-dom": "^6.26.2",
|
|
75
|
-
"styled-components": "^6.1.13",
|
|
76
99
|
"release-it": "^17.6.0",
|
|
77
|
-
"
|
|
100
|
+
"styled-components": "^6.1.13",
|
|
101
|
+
typescript: "^5.6.3"
|
|
78
102
|
};
|
|
79
103
|
const peerDependencies = {
|
|
80
104
|
"@strapi/strapi": "^5.0.0",
|
|
81
|
-
|
|
82
|
-
react: "^18.
|
|
83
|
-
"react-dom": "^
|
|
84
|
-
"
|
|
85
|
-
"styled-components": "^6.1.13"
|
|
105
|
+
react: "^18.0.0",
|
|
106
|
+
"react-dom": "^18.0.0",
|
|
107
|
+
"react-router-dom": "^6.0.0",
|
|
108
|
+
"styled-components": "^6.0.0"
|
|
86
109
|
};
|
|
87
110
|
const engines = {
|
|
88
|
-
node: ">=18.0.0 <=
|
|
111
|
+
node: ">=18.0.0 <=22.x.x",
|
|
89
112
|
npm: ">=6.0.0"
|
|
90
113
|
};
|
|
91
114
|
const license = "MIT";
|
|
92
|
-
const
|
|
115
|
+
const pluginPkg = {
|
|
93
116
|
name,
|
|
94
117
|
version,
|
|
95
118
|
description,
|
|
96
|
-
"private": false,
|
|
97
119
|
keywords,
|
|
98
120
|
author,
|
|
99
121
|
homepage,
|
|
100
122
|
repository,
|
|
101
|
-
strapi
|
|
123
|
+
strapi,
|
|
124
|
+
type,
|
|
102
125
|
exports: exports$1,
|
|
103
126
|
files,
|
|
104
127
|
scripts,
|
|
@@ -108,94 +131,13 @@ const require$$0 = {
|
|
|
108
131
|
engines,
|
|
109
132
|
license
|
|
110
133
|
};
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
type: "richtext"
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
const pluginId = pluginId$2;
|
|
122
|
-
var config$3 = {
|
|
123
|
-
getConfig: async (ctx) => {
|
|
124
|
-
const { responsiveDimensions = false } = await strapi.plugin("upload").service("upload").getSettings();
|
|
125
|
-
const config2 = await strapi.plugin(pluginId).service("config").getConfig() + `
|
|
126
|
-
globalThis.SH_CKE_UPLOAD_ADAPTER_IS_RESPONSIVE = ${responsiveDimensions}`;
|
|
127
|
-
ctx.type = "application/javascript";
|
|
128
|
-
ctx.send(config2);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const config$2 = config$3;
|
|
132
|
-
var controllers$1 = {
|
|
133
|
-
config: config$2
|
|
134
|
-
};
|
|
135
|
-
var routes$1 = {
|
|
136
|
-
config: {
|
|
137
|
-
type: "admin",
|
|
138
|
-
routes: [
|
|
139
|
-
{
|
|
140
|
-
method: "GET",
|
|
141
|
-
path: "/config/ckeditor",
|
|
142
|
-
handler: "config.getConfig",
|
|
143
|
-
config: {
|
|
144
|
-
auth: false
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
]
|
|
134
|
+
const index = {
|
|
135
|
+
register: ({ strapi: strapi2 }) => {
|
|
136
|
+
strapi2.customFields.register({
|
|
137
|
+
name: "CKEditor",
|
|
138
|
+
plugin: pluginPkg.strapi.name,
|
|
139
|
+
type: "richtext"
|
|
140
|
+
});
|
|
148
141
|
}
|
|
149
142
|
};
|
|
150
|
-
const fs = require$$0__default.default;
|
|
151
|
-
var config$1 = ({ strapi: strapi2 }) => {
|
|
152
|
-
const readConfigFile = () => {
|
|
153
|
-
const appDir = process.cwd();
|
|
154
|
-
const isTSProject = fs.existsSync(`${appDir}/dist`);
|
|
155
|
-
const envName = process.env.NODE_ENV;
|
|
156
|
-
const cfgDir = isTSProject ? `${appDir}/dist/config` : `${appDir}/config`;
|
|
157
|
-
const cfgFileName = "ckeditor.js";
|
|
158
|
-
const envFilePath = `${cfgDir}/env/${envName}/${cfgFileName}`;
|
|
159
|
-
const baseFilePath = `${cfgDir}/${cfgFileName}`;
|
|
160
|
-
if (fs.existsSync(envFilePath)) {
|
|
161
|
-
return fs.readFileSync(envFilePath, "utf8");
|
|
162
|
-
} else if (fs.existsSync(baseFilePath)) {
|
|
163
|
-
return fs.readFileSync(baseFilePath, "utf8");
|
|
164
|
-
} else {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const trimConfig = (str) => {
|
|
169
|
-
for (const func of ["const CKEConfig", "function CKEConfig"]) {
|
|
170
|
-
const idx = str.indexOf(func);
|
|
171
|
-
if (idx >= 0) {
|
|
172
|
-
return str.substring(idx) + `
|
|
173
|
-
globalThis.SH_CKE_CONFIG = CKEConfig()`;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
return {
|
|
178
|
-
getConfig() {
|
|
179
|
-
const configFileContent = readConfigFile();
|
|
180
|
-
const config2 = configFileContent && trimConfig(configFileContent);
|
|
181
|
-
return config2 || `globalThis.SH_CKE_CONFIG = null`;
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
const config = config$1;
|
|
186
|
-
var services$1 = {
|
|
187
|
-
config
|
|
188
|
-
};
|
|
189
|
-
const register = register$1;
|
|
190
|
-
const controllers = controllers$1;
|
|
191
|
-
const routes = routes$1;
|
|
192
|
-
const services = services$1;
|
|
193
|
-
var src = {
|
|
194
|
-
register,
|
|
195
|
-
controllers,
|
|
196
|
-
routes,
|
|
197
|
-
services
|
|
198
|
-
};
|
|
199
|
-
const index = /* @__PURE__ */ getDefaultExportFromCjs(src);
|
|
200
143
|
module.exports = index;
|
|
201
|
-
//# sourceMappingURL=index.js.map
|