opentiny 6.9.3 → 6.9.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opentiny",
3
- "version": "6.9.3",
3
+ "version": "6.9.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mild-blue/opentiny"
package/tinymce.js CHANGED
@@ -7725,8 +7725,6 @@
7725
7725
  const shouldSandboxIframes = option('sandbox_iframes');
7726
7726
  const getSandboxIframesExclusions = editor => editor.options.get('sandbox_iframes_exclusions');
7727
7727
  const shouldConvertUnsafeEmbeds = option('convert_unsafe_embeds');
7728
- const getLicenseKey = option('license_key');
7729
- const getApiKey = option('api_key');
7730
7728
 
7731
7729
  const isElement$3 = isElement$6;
7732
7730
  const isText$5 = isText$b;
@@ -26178,6 +26176,7 @@
26178
26176
  }
26179
26177
  };
26180
26178
 
26179
+ const defaultMaxImageWidthPx = 300;
26181
26180
  const uniqueId = createIdGenerator('mceclip');
26182
26181
  const createPasteDataTransfer = html => {
26183
26182
  const dataTransfer = createDataTransfer();
@@ -26247,7 +26246,17 @@
26247
26246
  const blobCache = editor.editorUpload.blobCache;
26248
26247
  const existingBlobInfo = blobCache.getByData(base64, type);
26249
26248
  const blobInfo = existingBlobInfo !== null && existingBlobInfo !== void 0 ? existingBlobInfo : createBlobInfo(editor, blobCache, file, base64);
26250
- pasteHtml(editor, `<img src="${ blobInfo.blobUri() }">`, false, true);
26249
+ const img = new Image();
26250
+ img.src = blobInfo.blobUri();
26251
+ img.onload = () => {
26252
+ const contentBodyElement = editor.dom.select('.mce-content-body')[0];
26253
+ const maxImageWidth = contentBodyElement ? parseInt(window.getComputedStyle(contentBodyElement).width) : defaultMaxImageWidthPx;
26254
+ const imageWidth = Math.min(img.naturalWidth, maxImageWidth);
26255
+ pasteHtml(editor, `<img src="${ blobInfo.blobUri() }" width="${ imageWidth }px">`, false, true);
26256
+ };
26257
+ img.onerror = err => {
26258
+ console.error('Failed to load the image blob:', err);
26259
+ };
26251
26260
  });
26252
26261
  };
26253
26262
  const isClipboardEvent = event => event.type === 'paste';
@@ -28573,17 +28582,6 @@
28573
28582
  };
28574
28583
  };
28575
28584
 
28576
- const isGplKey = key => key.toLowerCase() === 'gpl';
28577
- const isValidGeneratedKey = key => key.length >= 64 && key.length <= 255;
28578
- const validateLicenseKey = key => isGplKey(key) || isValidGeneratedKey(key) ? 'VALID' : 'INVALID';
28579
- const validateEditorLicenseKey = editor => {
28580
- const licenseKey = getLicenseKey(editor);
28581
- const hasApiKey = isString(getApiKey(editor));
28582
- if (!hasApiKey && (isUndefined(licenseKey) || validateLicenseKey(licenseKey) === 'INVALID')) {
28583
- console.warn('You are running TinyMCE in evaluation mode. Provide a valid license key or specify the license to \'GPL\' to agree to the open source license terms. https://www.tiny.cloud/');
28584
- }
28585
- };
28586
-
28587
28585
  const DOM$6 = DOMUtils.DOM;
28588
28586
  const appendStyle = (editor, text) => {
28589
28587
  const body = SugarElement.fromDom(editor.getBody());
@@ -28935,7 +28933,6 @@
28935
28933
  setup$7(editor);
28936
28934
  const setupRtcThunk = setup$t(editor);
28937
28935
  preInit(editor);
28938
- validateEditorLicenseKey(editor);
28939
28936
  setupRtcThunk.fold(() => {
28940
28937
  const cancelProgress = startProgress(editor);
28941
28938
  loadContentCss(editor).then(() => {