@tiny-mce-umbraco/backoffice 17.1.0 → 17.3.4

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.
@@ -42,6 +42,7 @@ export type TinyMceConfig = {
42
42
  openAiApikey: string;
43
43
  pluginsToExclude: Array<string>;
44
44
  openAiApiConfig: OpenAiApiConfig;
45
+ sanitizeTinyMce: boolean;
45
46
  customConfig: {
46
47
  [key: string]: unknown;
47
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../src/api/types.gen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,yBAAyB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtH,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,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MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG;IAC7B;;OAEG;IACH,GAAG,EAAE,0BAA0B,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
2
+ import type { UmbBlockRteValueModel } from '@umbraco-cms/backoffice/block-rte';
3
+ import type { UmbBlockClipboardEntryValueModel } from '@umbraco-cms/backoffice/block';
4
+ import type { UmbClipboardCopyPropertyValueTranslator } from '@umbraco-cms/backoffice/clipboard';
5
+ export declare class UmbTinyMceBlockRteToBlockClipboardCopyPropertyValueTranslator extends UmbControllerBase implements UmbClipboardCopyPropertyValueTranslator<UmbBlockRteValueModel> {
6
+ translate(propertyValue: UmbBlockRteValueModel): Promise<UmbBlockClipboardEntryValueModel>;
7
+ }
8
+ export { UmbTinyMceBlockRteToBlockClipboardCopyPropertyValueTranslator as api };
9
+ //# sourceMappingURL=block-rte-to-block-copy-translator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-rte-to-block-copy-translator.d.ts","sourceRoot":"","sources":["../../../../src/clipboard/block/copy/block-rte-to-block-copy-translator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,mCAAmC,CAAC;AAEjG,qBAAa,6DACZ,SAAQ,iBACR,YAAW,uCAAuC,CAAC,qBAAqB,CAAC;IAEnE,SAAS,CAAC,aAAa,EAAE,qBAAqB,GAAG,OAAO,CAAC,gCAAgC,CAAC;CAkBhG;AAED,OAAO,EAAE,6DAA6D,IAAI,GAAG,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
2
+ import { UMB_BLOCK_RTE_PROPERTY_EDITOR_SCHEMA_ALIAS } from '@umbraco-cms/backoffice/rte';
3
+ export class UmbTinyMceBlockRteToBlockClipboardCopyPropertyValueTranslator extends UmbControllerBase {
4
+ async translate(propertyValue) {
5
+ if (!propertyValue) {
6
+ throw new Error('Property value is missing.');
7
+ }
8
+ const valueClone = structuredClone(propertyValue);
9
+ const contentData = valueClone.contentData;
10
+ const layout = valueClone.layout?.[UMB_BLOCK_RTE_PROPERTY_EDITOR_SCHEMA_ALIAS] ?? undefined;
11
+ const settingsData = valueClone.settingsData;
12
+ layout?.forEach((layoutItem) => {
13
+ // @ts-expect-error removing $type from layout item
14
+ delete layoutItem.$type;
15
+ });
16
+ return {
17
+ contentData: contentData ?? [],
18
+ layout: layout,
19
+ settingsData: settingsData ?? [],
20
+ };
21
+ }
22
+ }
23
+ export { UmbTinyMceBlockRteToBlockClipboardCopyPropertyValueTranslator as api };
@@ -0,0 +1,15 @@
1
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
2
+ import type { UmbBlockClipboardEntryValueModel } from '@umbraco-cms/backoffice/block';
3
+ import type { UmbPropertyEditorRteValueType } from '@umbraco-cms/backoffice/rte';
4
+ import type { UmbClipboardPastePropertyValueTranslator } from '@umbraco-cms/backoffice/clipboard';
5
+ export declare class UmbTinyMceBlockToBlockRteClipboardPastePropertyValueTranslator extends UmbControllerBase implements UmbClipboardPastePropertyValueTranslator<UmbBlockClipboardEntryValueModel, UmbPropertyEditorRteValueType> {
6
+ translate(value: UmbBlockClipboardEntryValueModel): Promise<UmbPropertyEditorRteValueType>;
7
+ isCompatibleValue(propertyValue: UmbPropertyEditorRteValueType, config: Array<{
8
+ alias: string;
9
+ value: [{
10
+ contentElementTypeKey: string;
11
+ }];
12
+ }>): Promise<boolean>;
13
+ }
14
+ export { UmbTinyMceBlockToBlockRteClipboardPastePropertyValueTranslator as api };
15
+ //# sourceMappingURL=block-to-block-rte-paste-translator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-to-block-rte-paste-translator.d.ts","sourceRoot":"","sources":["../../../../src/clipboard/block/paste/block-to-block-rte-paste-translator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,mCAAmC,CAAC;AAElG,qBAAa,8DACZ,SAAQ,iBACR,YAAW,wCAAwC,CAAC,gCAAgC,EAAE,6BAA6B,CAAC;IAE9G,SAAS,CAAC,KAAK,EAAE,gCAAgC,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAkB1F,iBAAiB,CACtB,aAAa,EAAE,6BAA6B,EAC5C,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,CAAC;YAAE,qBAAqB,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,GAC1E,OAAO,CAAC,OAAO,CAAC;CAMnB;AAED,OAAO,EAAE,8DAA8D,IAAI,GAAG,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
2
+ import { UMB_BLOCK_RTE_PROPERTY_EDITOR_SCHEMA_ALIAS } from '@umbraco-cms/backoffice/rte';
3
+ export class UmbTinyMceBlockToBlockRteClipboardPastePropertyValueTranslator extends UmbControllerBase {
4
+ async translate(value) {
5
+ if (!value) {
6
+ throw new Error('Value is missing.');
7
+ }
8
+ const valueClone = structuredClone(value);
9
+ return {
10
+ markup: '',
11
+ blocks: {
12
+ contentData: valueClone.contentData,
13
+ settingsData: valueClone.settingsData,
14
+ expose: [],
15
+ layout: {
16
+ [UMB_BLOCK_RTE_PROPERTY_EDITOR_SCHEMA_ALIAS]: valueClone.layout ?? undefined,
17
+ },
18
+ },
19
+ };
20
+ }
21
+ async isCompatibleValue(propertyValue, config) {
22
+ const allowedBlockContentTypes = config.find((c) => c.alias === 'blocks')?.value.map((b) => b.contentElementTypeKey) ?? [];
23
+ const blockContentTypes = propertyValue.blocks?.contentData.map((c) => c.contentTypeKey) ?? [];
24
+ return blockContentTypes.every((b) => allowedBlockContentTypes.includes(b));
25
+ }
26
+ }
27
+ export { UmbTinyMceBlockToBlockRteClipboardPastePropertyValueTranslator as api };
@@ -0,0 +1,2 @@
1
+ export declare const manifests: Array<UmbExtensionManifest>;
2
+ //# sourceMappingURL=manifests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../src/clipboard/manifests.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAiBjD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS } from '@tiny-mce-umbraco/backoffice/core';
2
+ import { UMB_BLOCK_CLIPBOARD_ENTRY_VALUE_TYPE } from '@umbraco-cms/backoffice/block';
3
+ export const manifests = [
4
+ {
5
+ type: 'clipboardCopyPropertyValueTranslator',
6
+ alias: 'TinyMCE.ClipboardCopyPropertyValueTranslator.BlockRteToBlock',
7
+ name: 'TinyMCE Block RTE To Block Clipboard Copy Property Value Translator',
8
+ api: () => import('./block/copy/block-rte-to-block-copy-translator.js'),
9
+ fromPropertyEditorUi: UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS,
10
+ toClipboardEntryValueType: UMB_BLOCK_CLIPBOARD_ENTRY_VALUE_TYPE,
11
+ },
12
+ {
13
+ type: 'clipboardPastePropertyValueTranslator',
14
+ alias: 'TinyMCE.ClipboardPastePropertyValueTranslator.BlockToBlockRte',
15
+ name: 'TinyMCE Block To Block RTE Clipboard Paste Property Value Translator',
16
+ api: () => import('./block/paste/block-to-block-rte-paste-translator.js'),
17
+ fromClipboardEntryValueType: UMB_BLOCK_CLIPBOARD_ENTRY_VALUE_TYPE,
18
+ toPropertyEditorUi: UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS,
19
+ },
20
+ ];
@@ -1 +1 @@
1
- {"version":3,"file":"input-tiny-mce.defaults.d.ts","sourceRoot":"","sources":["../../../src/components/input-tiny-mce/input-tiny-mce.defaults.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,eAAO,MAAM,4CAA4C,sCAAsC,CAAC;AAEhG,eAAO,MAAM,yBAAyB,uQAmB5B,CAAC;AAIX,eAAO,MAAM,qBAAqB,EAAE,gBAiKnC,CAAC"}
1
+ {"version":3,"file":"input-tiny-mce.defaults.d.ts","sourceRoot":"","sources":["../../../src/components/input-tiny-mce/input-tiny-mce.defaults.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,eAAO,MAAM,4CAA4C,sCAAsC,CAAC;AAEhG,eAAO,MAAM,yBAAyB,uQAmB5B,CAAC;AAMX,eAAO,MAAM,qBAAqB,EAAE,gBAiKnC,CAAC"}
@@ -21,13 +21,15 @@ export const defaultPremiumPluginsList = [
21
21
  'tinymcespellchecker',
22
22
  'tableofcontents',
23
23
  ];
24
- //we put these as extended elements because they get merged on top of the normal allowed elements by tiny mce
25
- //so we don't have to specify all the normal elements again
24
+ //we use extended_valid_elements only for Umbraco custom elements and non-standard HTML elements
25
+ //that must be added on top of valid_elements. Standard HTML elements (h1-h6, div, ul, li, span)
26
+ //must NOT appear here because extended_valid_elements overrides valid_elements exclusions —
27
+ //if a user removes an element from ValidElements config it would still be allowed via this list.
26
28
  export const defaultFallbackConfig = {
27
29
  plugins: ['anchor', 'charmap', 'table', 'lists', 'advlist', 'autolink', 'directionality', 'searchreplace'],
28
- valid_elements: '+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-s[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],figure,figcaption,cite,video[*],audio[*],picture[*],source[*],canvas[*],details[*],summary[*],-code',
30
+ valid_elements: '+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-s[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style|lang],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],figure,figcaption,cite,video[*],audio[*],picture[*],source[*],canvas[*],details[*],summary[*],-code',
29
31
  invalid_elements: 'font',
30
- extended_valid_elements: '@[id|class|style],+umb-rte-block[!data-content-key],+umb-rte-block-inline[!data-content-key],-div[id|dir|class|align|style],ins[datetime|cite],-ul[class|style],-li[class|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align],span[id|class|style|lang],figure,figcaption',
32
+ extended_valid_elements: '@[id|class|style],+umb-rte-block[!data-content-key],+umb-rte-block-inline[!data-content-key],ins[datetime|cite],figure,figcaption',
31
33
  custom_elements: 'umb-rte-block,~umb-rte-block-inline',
32
34
  toolbar: [
33
35
  'styles',
@@ -1 +1 @@
1
- {"version":3,"file":"input-tiny-mce.element.d.ts","sourceRoot":"","sources":["../../../src/components/input-tiny-mce/input-tiny-mce.element.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpE,OAAO,KAAK,EAAe,MAAM,EAAoB,MAAM,+CAA+C,CAAC;AAE3G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;;AA0CjG,qBACa,sBAAuB,SAAQ,2BAAsC;;IAEjF,aAAa,CAAC,EAAE,iCAAiC,CAAC;cAQ/B,cAAc;IAIjC,IAAa,KAAK,CAAC,QAAQ,EAAE,kBAAkB,GAAG,QAAQ,EAOzD;IAED,IAAa,KAAK,IAAI,kBAAkB,GAAG,QAAQ,CAElD;IAED;;;;;OAKG;IACH,IACW,QAAQ,YAElB;IACD,IAAW,QAAQ,CAAC,KAAK,SAAA,EAKxB;IAID,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAc;IAE9C,SAAS;IAIA,YAAY;IAsBZ,oBAAoB;IA0BvB,eAAe,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC;IA6UpD;;;OAGG;IACM,MAAM;IAIf,gBAAyB,MAAM,4BAkB7B;CACF;AAED,eAAe,sBAAsB,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,oBAAoB,EAAE,sBAAsB,CAAC;KAC7C;CACD"}
1
+ {"version":3,"file":"input-tiny-mce.element.d.ts","sourceRoot":"","sources":["../../../src/components/input-tiny-mce/input-tiny-mce.element.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpE,OAAO,KAAK,EAAe,MAAM,EAAoB,MAAM,+CAA+C,CAAC;AAE3G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;;AA8DjG,qBACa,sBAAuB,SAAQ,2BAAsC;;IAEjF,aAAa,CAAC,EAAE,iCAAiC,CAAC;cAS/B,cAAc;IAIjC,IAAa,KAAK,CAAC,QAAQ,EAAE,kBAAkB,GAAG,QAAQ,EAOzD;IAED,IAAa,KAAK,IAAI,kBAAkB,GAAG,QAAQ,CAElD;IAED;;;;;OAKG;IACH,IACW,QAAQ,YAElB;IACD,IAAW,QAAQ,CAAC,KAAK,SAAA,EAOxB;IAID,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAc;IAE9C,SAAS;IAIA,YAAY;IAsBZ,oBAAoB;IA0BvB,eAAe,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC;IA+UpD;;;OAGG;IACM,MAAM;IAIf,gBAAyB,MAAM,4BAkB7B;CACF;AAED,eAAe,sBAAsB,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,oBAAoB,EAAE,sBAAsB,CAAC;KAC7C;CACD"}
@@ -15,7 +15,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
15
15
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
16
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
17
  };
18
- var _UmbInputTinyMceElement_instances, _UmbInputTinyMceElement_plugins, _UmbInputTinyMceElement_editorRef, _UmbInputTinyMceElement_stylesheetRepository, _UmbInputTinyMceElement_umbStylesheetRuleManager, _UmbInputTinyMceElement_readonly, _UmbInputTinyMceElement_loadEditor, _UmbInputTinyMceElement_loadPlugins, _UmbInputTinyMceElement_getTinyMceConfig, _UmbInputTinyMceElement_setTinyConfig, _UmbInputTinyMceElement_getLanguage, _UmbInputTinyMceElement_editorSetup, _UmbInputTinyMceElement_onInit, _UmbInputTinyMceElement_onChange;
18
+ var _UmbInputTinyMceElement_instances, _UmbInputTinyMceElement_plugins, _UmbInputTinyMceElement_editorRef, _UmbInputTinyMceElement_sanitizeTinyMce, _UmbInputTinyMceElement_stylesheetRepository, _UmbInputTinyMceElement_umbStylesheetRuleManager, _UmbInputTinyMceElement_readonly, _UmbInputTinyMceElement_loadEditor, _UmbInputTinyMceElement_loadPlugins, _UmbInputTinyMceElement_getTinyMceConfig, _UmbInputTinyMceElement_setTinyConfig, _UmbInputTinyMceElement_getLanguage, _UmbInputTinyMceElement_editorSetup, _UmbInputTinyMceElement_onInit, _UmbInputTinyMceElement_onChange;
19
19
  import { availableLanguages } from '@tiny-mce-umbraco/backoffice/core';
20
20
  import { defaultFallbackConfig, defaultPremiumPluginsList } from '@tiny-mce-umbraco/backoffice/core';
21
21
  import { pastePreProcessHandler } from '@tiny-mce-umbraco/backoffice/core';
@@ -57,6 +57,27 @@ function mergeArrays(arr1, arr2) {
57
57
  const a2 = Array.isArray(arr2) ? arr2 : arr2 ? [arr2] : [];
58
58
  return Array.from(new Set([...a1, ...a2]));
59
59
  }
60
+ // Some config paths (e.g. Umbraco:CMS:RichTextEditor:CustomConfig) can only store scalar string
61
+ // values via the .NET config binder. Complex TinyMCE options like style_formats were historically
62
+ // stored as JSON strings in Umbraco v13. This function parses those JSON strings back into real
63
+ // objects/arrays so TinyMCE receives the correct types.
64
+ function parseJsonStringValues(config) {
65
+ const result = {};
66
+ for (const [key, value] of Object.entries(config)) {
67
+ if (typeof value === 'string' && (value.startsWith('[') || value.startsWith('{'))) {
68
+ try {
69
+ result[key] = JSON.parse(value);
70
+ }
71
+ catch {
72
+ result[key] = value;
73
+ }
74
+ }
75
+ else {
76
+ result[key] = value;
77
+ }
78
+ }
79
+ return result;
80
+ }
60
81
  let UmbInputTinyMceElement = class UmbInputTinyMceElement extends UUIFormControlMixin(UmbLitElement, '') {
61
82
  constructor() {
62
83
  super(...arguments);
@@ -64,6 +85,7 @@ let UmbInputTinyMceElement = class UmbInputTinyMceElement extends UUIFormControl
64
85
  //#plugins: Array<ClassConstructor<UmbTinyMcePluginBase> | undefined> = [];
65
86
  _UmbInputTinyMceElement_plugins.set(this, []);
66
87
  _UmbInputTinyMceElement_editorRef.set(this, null);
88
+ _UmbInputTinyMceElement_sanitizeTinyMce.set(this, true);
67
89
  _UmbInputTinyMceElement_stylesheetRepository.set(this, new UmbStylesheetDetailRepository(this));
68
90
  _UmbInputTinyMceElement_umbStylesheetRuleManager.set(this, new UmbStylesheetRuleManager());
69
91
  _UmbInputTinyMceElement_readonly.set(this, false);
@@ -93,8 +115,10 @@ let UmbInputTinyMceElement = class UmbInputTinyMceElement extends UUIFormControl
93
115
  set readonly(value) {
94
116
  __classPrivateFieldSet(this, _UmbInputTinyMceElement_readonly, value, "f");
95
117
  const editor = this.getEditor();
96
- const mode = value ? 'readonly' : 'design';
97
- editor?.mode.set(mode);
118
+ // editor.removed is true when TinyMCE has been destroyed; mode.set() throws on a destroyed editor
119
+ if (editor && !editor.removed) {
120
+ editor.mode.set(value ? 'readonly' : 'design');
121
+ }
98
122
  }
99
123
  getEditor() {
100
124
  return __classPrivateFieldGet(this, _UmbInputTinyMceElement_editorRef, "f");
@@ -158,6 +182,7 @@ let UmbInputTinyMceElement = class UmbInputTinyMceElement extends UUIFormControl
158
182
  };
159
183
  _UmbInputTinyMceElement_plugins = new WeakMap();
160
184
  _UmbInputTinyMceElement_editorRef = new WeakMap();
185
+ _UmbInputTinyMceElement_sanitizeTinyMce = new WeakMap();
161
186
  _UmbInputTinyMceElement_stylesheetRepository = new WeakMap();
162
187
  _UmbInputTinyMceElement_umbStylesheetRuleManager = new WeakMap();
163
188
  _UmbInputTinyMceElement_readonly = new WeakMap();
@@ -218,6 +243,7 @@ _UmbInputTinyMceElement_setTinyConfig = async function _UmbInputTinyMceElement_s
218
243
  let url = '';
219
244
  let excludeList = [];
220
245
  if (appSettingsConfig) {
246
+ __classPrivateFieldSet(this, _UmbInputTinyMceElement_sanitizeTinyMce, appSettingsConfig.config?.sanitizeTinyMce ?? true, "f");
221
247
  // @ts-ignore
222
248
  apiKey = appSettingsConfig.richTextEditor?.cloudApiKey || 'no-origin';
223
249
  if (appSettingsConfig.config?.apikey) {
@@ -318,7 +344,7 @@ _UmbInputTinyMceElement_setTinyConfig = async function _UmbInputTinyMceElement_s
318
344
  if (appSettingsConfig) {
319
345
  if (appSettingsConfig.richTextEditor) {
320
346
  const mergedPlugins = mergeArrays(appSettingsConfig.richTextEditor.plugins, config.plugins);
321
- config = umbDeepMerge(appSettingsConfig.richTextEditor.customConfig, config);
347
+ config = umbDeepMerge(parseJsonStringValues(appSettingsConfig.richTextEditor.customConfig), config);
322
348
  config.plugins = mergedPlugins;
323
349
  if (appSettingsConfig.richTextEditor.validElements.length > 0) {
324
350
  config.valid_elements = appSettingsConfig.richTextEditor.validElements;
@@ -388,6 +414,8 @@ _UmbInputTinyMceElement_editorSetup = async function _UmbInputTinyMceElement_edi
388
414
  __classPrivateFieldGet(this, _UmbInputTinyMceElement_instances, "m", _UmbInputTinyMceElement_onChange).call(this, editor.getContent());
389
415
  });
390
416
  editor.on('SetContent', () => {
417
+ if (!__classPrivateFieldGet(this, _UmbInputTinyMceElement_sanitizeTinyMce, "f"))
418
+ return;
391
419
  /**
392
420
  * Prevent injecting arbitrary JavaScript execution in on-attributes.
393
421
  *
@@ -1 +1 @@
1
- {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../src/manifests.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAQjD,CAAC"}
1
+ {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../src/manifests.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,oBAAoB,CASjD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { manifests as clipboard } from './clipboard/manifests.js';
1
2
  import { manifests as components } from './components/manifests.js';
2
3
  import { manifests as entryPoints } from './entry-points/manifest.js';
3
4
  import { manifests as icons } from './icons/manifests.js';
@@ -6,6 +7,7 @@ import { manifests as propertyEditors } from './property-editors/manifests.js';
6
7
  import { manifests as plugins } from './plugins/manifests.js';
7
8
  import { manifests as stylesheets } from './stylesheets/manifests.js';
8
9
  export const manifests = [
10
+ ...clipboard,
9
11
  ...components,
10
12
  ...entryPoints,
11
13
  ...icons,
@@ -1 +1 @@
1
- {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../../src/property-editors/tiny-mce/manifests.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAkJjD,CAAC"}
1
+ {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../../src/property-editors/tiny-mce/manifests.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAyJjD,CAAC"}
@@ -1,6 +1,13 @@
1
1
  import { UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS } from '@tiny-mce-umbraco/backoffice/core';
2
2
  import { UMB_BLOCK_RTE_PROPERTY_EDITOR_SCHEMA_ALIAS } from '@umbraco-cms/backoffice/rte';
3
3
  export const manifests = [
4
+ {
5
+ type: 'propertyContext',
6
+ kind: 'clipboard',
7
+ alias: 'TinyMCE.PropertyContext.Clipboard',
8
+ name: 'TinyMCE Clipboard Property Context',
9
+ forPropertyEditorUis: [UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS],
10
+ },
4
11
  {
5
12
  type: 'propertyEditorUi',
6
13
  alias: UMB_BLOCK_RTE_PROPERTY_EDITOR_UI_ALIAS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-mce-umbraco/backoffice",
3
- "version": "17.1.0",
3
+ "version": "17.3.4",
4
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
5
  "keywords": [
6
6
  "Umbraco",
@@ -40,7 +40,7 @@
40
40
  "@rollup/plugin-json": "^6.1.0",
41
41
  "@rollup/plugin-node-resolve": "^16.0.1",
42
42
  "@rollup/plugin-replace": "^6.0.2",
43
- "@umbraco-cms/backoffice": "^17.1.0",
43
+ "@umbraco-cms/backoffice": "^17.3.4",
44
44
  "chalk": "^5.3.0",
45
45
  "cross-env": "^10.1.0",
46
46
  "eslint": "^9.37.0",
@@ -55,7 +55,7 @@
55
55
  "vite-tsconfig-paths": "^5.1.4"
56
56
  },
57
57
  "peerDependencies": {
58
- "@umbraco-cms/backoffice": "^17.1.0",
58
+ "@umbraco-cms/backoffice": "^17.3.4",
59
59
  "tinymce": "^6.8.5",
60
60
  "tinymce-i18n": "^24.12.30"
61
61
  }