@tiny-mce-umbraco/backoffice 16.0.0-rc2

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.
@@ -0,0 +1,252 @@
1
+ import type { ClassConstructor } from '@umbraco-cms/backoffice/extension-api';
2
+ import type { Client } from '@hey-api/client-fetch';
3
+ import { CSSResult } from 'lit';
4
+ import { Editor } from 'tinymce';
5
+ import type { ManifestApi } from '@umbraco-cms/backoffice/extension-api';
6
+ import type { Options as Options_2 } from '@hey-api/client-fetch';
7
+ import { RawEditorOptions } from 'tinymce';
8
+ import { RequestResult } from '@hey-api/client-fetch';
9
+ import type { TDataShape } from '@hey-api/client-fetch';
10
+ import { TemplateResult } from 'lit-html';
11
+ import { TinyMceConfigResponseModel as TinyMceConfigResponseModel_2 } from './types.gen';
12
+ import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
13
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
14
+ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
15
+ import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
16
+ import { UUIFormControlMixinElement } from '@umbraco-ui/uui-base';
17
+
18
+ export declare const availableLanguages: string[];
19
+
20
+ export declare type ClientOptions = {
21
+ baseUrl: 'https://localhost:44308' | (string & {});
22
+ };
23
+
24
+ export declare const defaultFallbackConfig: RawEditorOptions;
25
+
26
+ export declare const defaultPremiumPluginsList: readonly ["a11ychecker", "advcode", "advtable", "advtemplate", "typography", "ai", "casechange", "checklist", "mediaembed", "export", "footnotes", "formatpainter", "mergetags", "pageembed", "powerpaste", "permanentpen", "tinymcespellchecker", "tableofcontents"];
27
+
28
+ export declare type GetConfigData = {
29
+ body?: never;
30
+ path?: never;
31
+ query?: never;
32
+ url: '/umbraco/management/api/v1/tiny-mce/config';
33
+ };
34
+
35
+ export declare type GetConfigError = GetConfigErrors[keyof GetConfigErrors];
36
+
37
+ export declare type GetConfigErrors = {
38
+ /**
39
+ * The resource is protected and requires an authentication token
40
+ */
41
+ 401: unknown;
42
+ /**
43
+ * The authenticated user does not have access to this resource
44
+ */
45
+ 403: unknown;
46
+ /**
47
+ * Not Found
48
+ */
49
+ 404: ProblemDetails;
50
+ };
51
+
52
+ export declare type GetConfigResponse = GetConfigResponses[keyof GetConfigResponses];
53
+
54
+ export declare type GetConfigResponses = {
55
+ /**
56
+ * OK
57
+ */
58
+ 200: TinyMceConfigResponseModel;
59
+ };
60
+
61
+ /**
62
+ * The manifest for a TinyMCE plugin.
63
+ * The plugin will be loaded into the TinyMCE editor.
64
+ * A plugin can add things like buttons, menu items, context menu items, etc. through the TinyMCE API.
65
+ * A plugin can also add custom commands to the editor.
66
+ * A plugin can also modify the behavior of the editor.
67
+ * @see [TinyMCE Plugin](https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.plugin/) for more information.
68
+ */
69
+ export declare interface ManifestTinyMcePlugin extends ManifestApi<UmbTinyMcePluginBase> {
70
+ type: 'tinyMcePlugin';
71
+ meta?: MetaTinyMcePlugin;
72
+ }
73
+
74
+ export declare interface MetaTinyMcePlugin {
75
+ /**
76
+ * If the plugin adds toolbar buttons, this property can be used to configure the buttons.
77
+ * This configuration will be used on the Rich Text Editor configuration page.
78
+ */
79
+ plugins?: string[];
80
+ /**
81
+ * If the plugin adds toolbar buttons, this property can be used to configure the buttons.
82
+ * This configuration will be used on the Rich Text Editor configuration page.
83
+ */
84
+ toolbar?: Array<{
85
+ /**
86
+ * The alias of the toolbar button that will be configured in the TinyMCE editor.
87
+ * @see [TinyMCE Toolbar](https://www.tiny.cloud/docs/tinymce/6/toolbar-configuration-options/) for more information.
88
+ */
89
+ alias: string;
90
+ /**
91
+ * The label of the option shown on the Rich Text Editor configuration page.
92
+ */
93
+ label: string;
94
+ /**
95
+ * The icon shown on the Rich Text Editor configuration page. The icon has to be a part of TinyMCE's icon set.
96
+ * @optional
97
+ * @see [TinyMCE Icon Set](https://www.tiny.cloud/docs/tinymce/6/editor-icon-identifiers/) for available default icons.
98
+ */
99
+ icon?: string;
100
+ /**
101
+ * If this is a TinyMCE plugin that can be enabled/disabled
102
+ */
103
+ isplugin?: boolean;
104
+ /**
105
+ * Name of the plugin this is a part of (links to the plugin for property editor UI)
106
+ */
107
+ pluginAlias?: string;
108
+ }>;
109
+ /**
110
+ * @title Sets the default configuration for the TinyMCE editor.
111
+ * @description This configuration will be used when the editor is initialized. See the [TinyMCE Configuration](https://www.tiny.cloud/docs/configure/) for more information.
112
+ * @optional
113
+ * @TJS-type object
114
+ * @examples [
115
+ * {
116
+ * "plugins": "wordcount",
117
+ * "statusbar": true
118
+ * }
119
+ * ]
120
+ */
121
+ config?: RawEditorOptions;
122
+ }
123
+
124
+ export declare type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options_2<TData, ThrowOnError> & {
125
+ /**
126
+ * You can provide a client instance returned by `createClient()` instead of
127
+ * individual options. This might be also useful if you want to implement a
128
+ * custom client.
129
+ */
130
+ client?: Client;
131
+ /**
132
+ * You can pass arbitrary values through the `meta` object. This can be
133
+ * used to access values that aren't defined as part of the SDK function.
134
+ */
135
+ meta?: Record<string, unknown>;
136
+ };
137
+
138
+ export declare const pastePreProcessHandler: RawEditorOptions['paste_preprocess'];
139
+
140
+ export declare type ProblemDetails = {
141
+ type?: string | null;
142
+ title?: string | null;
143
+ status?: number | null;
144
+ detail?: string | null;
145
+ instance?: string | null;
146
+ [key: string]: unknown | (string | null) | (string | null) | (number | null) | (string | null) | (string | null) | undefined;
147
+ };
148
+
149
+ export declare type RichTextEditorCommand = {
150
+ alias: string;
151
+ name: string;
152
+ mode: RichTextEditorCommandModeModel;
153
+ };
154
+
155
+ export declare enum RichTextEditorCommandModeModel {
156
+ INSERT = "Insert",
157
+ SELECTION = "Selection",
158
+ ALL = "All"
159
+ }
160
+
161
+ export declare type RichTextEditorSettings = {
162
+ commands: Array<RichTextEditorCommand>;
163
+ plugins: Array<string>;
164
+ customConfig: {
165
+ [key: string]: string;
166
+ };
167
+ validElements: string;
168
+ invalidElements: string;
169
+ cloudApiKey?: string | null;
170
+ };
171
+
172
+ export declare type TinyMceConfigResponseModel = {
173
+ richTextEditor?: RichTextEditorSettings | null;
174
+ config?: TinyMceSettings | null;
175
+ };
176
+
177
+ export declare type TinyMcePluginArguments = {
178
+ host: UmbInputTinyMceElement;
179
+ editor: Editor;
180
+ };
181
+
182
+ export declare interface TinyMcePluginInterface {
183
+ init(): Promise<void>;
184
+ }
185
+
186
+ export declare class TinyMceService {
187
+ static getConfig<ThrowOnError extends boolean = false>(options?: Options<GetConfigData, ThrowOnError>): RequestResult<TinyMceConfigResponseModel_2, unknown, ThrowOnError>;
188
+ }
189
+
190
+ export declare type TinyMceSettings = {
191
+ apikey: string;
192
+ tinyMceVersion: string;
193
+ tinyMceUrl: string;
194
+ openAiApikey: string;
195
+ pluginsToExclude: Array<string>;
196
+ customConfig: {};
197
+ };
198
+
199
+ export declare const UMB_BLOCK_ENTRY_WEB_COMPONENTS_ABSOLUTE_PATH = "@umbraco-cms/backoffice/block-rte";
200
+
201
+ export declare const UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS = "Umb.PropertyEditorUi.TinyMCE";
202
+
203
+ export declare class UmbInputTinyMceElement extends UmbInputTinyMceElement_base {
204
+ #private;
205
+ configuration?: UmbPropertyEditorConfigCollection;
206
+ protected getFormElement(): HTMLIFrameElement | undefined;
207
+ set value(newValue: FormDataEntryValue | FormData);
208
+ get value(): FormDataEntryValue | FormData;
209
+ /**
210
+ * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
211
+ * @type {boolean}
212
+ * @attr
213
+ * @default
214
+ */
215
+ get readonly(): boolean;
216
+ set readonly(value: boolean);
217
+ private readonly _editorElement?;
218
+ getEditor(): Editor | null | undefined;
219
+ firstUpdated(): void;
220
+ disconnectedCallback(): void;
221
+ getFormatStyles(stylesheetPaths: Array<string>): Promise<any[]>;
222
+ /**
223
+ * Nothing rendered by default - TinyMCE initialization creates
224
+ * a target div and binds the RTE to that element
225
+ */
226
+ render(): TemplateResult<1>;
227
+ static readonly styles: CSSResult[];
228
+ }
229
+
230
+ declare const UmbInputTinyMceElement_base: (new (...args: any[]) => UUIFormControlMixinElement<FormDataEntryValue | FormData>) & typeof UmbLitElement;
231
+
232
+ export declare class UmbTinyMcePluginBase extends UmbControllerBase implements UmbApi, TinyMcePluginInterface {
233
+ editor: Editor;
234
+ configuration?: UmbPropertyEditorConfigCollection;
235
+ constructor(arg: TinyMcePluginArguments);
236
+ static extendEditorConfig(_config: any): Promise<void>;
237
+ init(): Promise<void>;
238
+ }
239
+
240
+ export declare interface UmbTinyMcePluginClass extends ClassConstructor<UmbTinyMcePluginBase> {
241
+ extendEditorConfig?: (_config: any) => Promise<void>;
242
+ }
243
+
244
+ /**
245
+ * Setup sanitization for preventing injecting arbitrary JavaScript execution in attributes:
246
+ * https://github.com/advisories/GHSA-w7jx-j77m-wp65
247
+ * https://github.com/advisories/GHSA-5vm8-hhgr-jcjp
248
+ * @param editor
249
+ */
250
+ export declare const uriAttributeSanitizer: (editor: Editor) => void;
251
+
252
+ export { }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@tiny-mce-umbraco/backoffice",
3
+ "version": "16.0.0-rc2",
4
+ "description": "This Umbraco CMS package enables access to the TinyMCE-based Rich Text Editor (RTE) in version 16 and above. It also supports the use of TinyMCE Premium plugins with a valid subscription. Additional features include streamlined configuration for RTE Data Types in Umbraco and enhanced settings that support direct JSON-based configuration via .NET (appsettings.config).",
5
+ "keywords": [
6
+ "umbraco",
7
+ "tinymce",
8
+ "rte"
9
+ ],
10
+ "author": "ProWorks Corporation",
11
+ "license": "MIT",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "type": "module",
16
+ "types": "types/index.d.ts",
17
+ "files": [ "dist" ],
18
+ "scripts": {
19
+ "dev": "tsc && vite build --watch",
20
+ "build": "tsc && vite build",
21
+ "build:api": "tsc -p tsconfig.api.json && api-extractor run --verbose",
22
+ "pack:api": "npm pack",
23
+ "generate-client": "node scripts/generate-openapi.js https://localhost:44308/umbraco/swagger/tiny-mce/swagger.json"
24
+ },
25
+ "dependencies": {
26
+ "tinymce": "^6.8.5",
27
+ "tinymce-i18n": "^24.12.30"
28
+ },
29
+ "devDependencies": {
30
+ "@hey-api/client-fetch": "^0.10.0",
31
+ "@hey-api/openapi-ts": "^0.66.1",
32
+ "@microsoft/api-extractor": "^7.52.8",
33
+ "@rollup/plugin-json": "^6.1.0",
34
+ "@rollup/plugin-node-resolve": "^16.0.0",
35
+ "@rollup/plugin-replace": "^6.0.2",
36
+ "@umbraco-cms/backoffice": "^16.0.0-rc3",
37
+ "chalk": "^5.3.0",
38
+ "cross-env": "7.0.3",
39
+ "eslint": "^9.25.1",
40
+ "node-fetch": "^3.3.2",
41
+ "rollup": "^4.34.8",
42
+ "rollup-plugin-esbuild": "^6.2.0",
43
+ "rollup-plugin-import-css": "^3.5.8",
44
+ "tiny-glob": "^0.2.9",
45
+ "typescript": "^5.7.3",
46
+ "vite": "^6.2.2",
47
+ "vite-plugin-static-copy": "^2.2.0",
48
+ "vite-tsconfig-paths": "^5.1.4"
49
+ },
50
+ "peerDependencies": {
51
+ "@umbraco-cms/backoffice": "^16.0.0-rc3",
52
+ "tinymce": "^6.8.5",
53
+ "tinymce-i18n": "^24.12.30"
54
+ }
55
+ }