@ckeditor/ckeditor5-ckbox 0.0.0-nightly-20231212.0 → 0.0.0-nightly-20231213.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/build/ckbox.js +1 -1
  2. package/build/translations/ar.js +1 -1
  3. package/build/translations/bg.js +1 -1
  4. package/build/translations/bn.js +1 -1
  5. package/build/translations/ca.js +1 -1
  6. package/build/translations/cs.js +1 -1
  7. package/build/translations/da.js +1 -1
  8. package/build/translations/de.js +1 -1
  9. package/build/translations/el.js +1 -1
  10. package/build/translations/es.js +1 -1
  11. package/build/translations/et.js +1 -1
  12. package/build/translations/fi.js +1 -1
  13. package/build/translations/fr.js +1 -1
  14. package/build/translations/he.js +1 -1
  15. package/build/translations/hi.js +1 -1
  16. package/build/translations/hu.js +1 -1
  17. package/build/translations/id.js +1 -1
  18. package/build/translations/it.js +1 -1
  19. package/build/translations/ja.js +1 -1
  20. package/build/translations/ko.js +1 -1
  21. package/build/translations/lt.js +1 -1
  22. package/build/translations/lv.js +1 -1
  23. package/build/translations/ms.js +1 -1
  24. package/build/translations/nl.js +1 -1
  25. package/build/translations/no.js +1 -1
  26. package/build/translations/pl.js +1 -1
  27. package/build/translations/pt-br.js +1 -1
  28. package/build/translations/pt.js +1 -1
  29. package/build/translations/ro.js +1 -1
  30. package/build/translations/ru.js +1 -1
  31. package/build/translations/sk.js +1 -1
  32. package/build/translations/sr.js +1 -1
  33. package/build/translations/sv.js +1 -1
  34. package/build/translations/th.js +1 -1
  35. package/build/translations/tr.js +1 -1
  36. package/build/translations/uk.js +1 -1
  37. package/build/translations/vi.js +1 -1
  38. package/build/translations/zh-cn.js +1 -1
  39. package/build/translations/zh.js +1 -1
  40. package/lang/translations/ar.po +4 -4
  41. package/lang/translations/bg.po +4 -4
  42. package/lang/translations/bn.po +4 -4
  43. package/lang/translations/ca.po +4 -4
  44. package/lang/translations/cs.po +4 -4
  45. package/lang/translations/da.po +4 -4
  46. package/lang/translations/de.po +4 -4
  47. package/lang/translations/el.po +4 -4
  48. package/lang/translations/es.po +4 -4
  49. package/lang/translations/et.po +4 -4
  50. package/lang/translations/fi.po +4 -4
  51. package/lang/translations/fr.po +4 -4
  52. package/lang/translations/he.po +4 -4
  53. package/lang/translations/hi.po +4 -4
  54. package/lang/translations/hu.po +4 -4
  55. package/lang/translations/id.po +4 -4
  56. package/lang/translations/it.po +4 -4
  57. package/lang/translations/ja.po +4 -4
  58. package/lang/translations/ko.po +4 -4
  59. package/lang/translations/lt.po +4 -4
  60. package/lang/translations/lv.po +4 -4
  61. package/lang/translations/ms.po +4 -4
  62. package/lang/translations/nl.po +4 -4
  63. package/lang/translations/no.po +4 -4
  64. package/lang/translations/pl.po +4 -4
  65. package/lang/translations/pt-br.po +4 -4
  66. package/lang/translations/pt.po +4 -4
  67. package/lang/translations/ro.po +4 -4
  68. package/lang/translations/ru.po +4 -4
  69. package/lang/translations/sk.po +4 -4
  70. package/lang/translations/sr.po +4 -4
  71. package/lang/translations/sv.po +4 -4
  72. package/lang/translations/th.po +4 -4
  73. package/lang/translations/tr.po +4 -4
  74. package/lang/translations/uk.po +4 -4
  75. package/lang/translations/vi.po +4 -4
  76. package/lang/translations/zh-cn.po +4 -4
  77. package/lang/translations/zh.po +4 -4
  78. package/package.json +2 -2
  79. package/src/ckboxcommand.d.ts +1 -0
  80. package/src/ckboxcommand.js +2 -0
  81. package/src/ckboxediting.d.ts +1 -1
  82. package/src/ckboxediting.js +1 -1
  83. package/src/ckboximageedit/ckboximageeditcommand.js +2 -2
  84. package/src/ckboximageedit/utils.js +1 -1
  85. package/src/ckboxutils.d.ts +1 -2
  86. package/src/ckboxutils.js +1 -2
  87. package/src/utils.d.ts +6 -0
  88. package/src/utils.js +6 -0
@@ -31,16 +31,16 @@ msgstr "ไม่สามารถเข้าถึงพื้นที่ท
31
31
 
32
32
  msgctxt "Image toolbar button tooltip for opening a dialog to manipulate the image."
33
33
  msgid "Edit image"
34
- msgstr ""
34
+ msgstr "แก้ไขภาพ"
35
35
 
36
36
  msgctxt "A message stating that image editing is in progress."
37
37
  msgid "Processing the edited image."
38
- msgstr ""
38
+ msgstr "กำลังประมวลผลภาพที่แก้ไข"
39
39
 
40
40
  msgctxt "A message is displayed when the server fails to process an image or doesn't respond."
41
41
  msgid "Server failed to process the image."
42
- msgstr ""
42
+ msgstr "เซิร์ฟเวอร์ประมวลผลภาพไม่สำเร็จ"
43
43
 
44
44
  msgctxt "A message is displayed when category of the image user wants to edit can't be determined."
45
45
  msgid "Failed to determine category of edited image."
46
- msgstr ""
46
+ msgstr "ระบุหมวดหมู่ของภาพที่แก้ไขไม่สำเร็จ"
@@ -31,16 +31,16 @@ msgstr "Varsayılan çalışma alanına erişilemiyor."
31
31
 
32
32
  msgctxt "Image toolbar button tooltip for opening a dialog to manipulate the image."
33
33
  msgid "Edit image"
34
- msgstr ""
34
+ msgstr "Görüntüyü düzenle"
35
35
 
36
36
  msgctxt "A message stating that image editing is in progress."
37
37
  msgid "Processing the edited image."
38
- msgstr ""
38
+ msgstr "Düzenlenen görüntü işleniyor."
39
39
 
40
40
  msgctxt "A message is displayed when the server fails to process an image or doesn't respond."
41
41
  msgid "Server failed to process the image."
42
- msgstr ""
42
+ msgstr "Sunucu görüntüyü işlemede başarısız oldu."
43
43
 
44
44
  msgctxt "A message is displayed when category of the image user wants to edit can't be determined."
45
45
  msgid "Failed to determine category of edited image."
46
- msgstr ""
46
+ msgstr "Düzenlenen görselin kategorisinin belirlenmesi başarısız oldu."
@@ -31,16 +31,16 @@ msgstr "Немає доступу до робочого простору за з
31
31
 
32
32
  msgctxt "Image toolbar button tooltip for opening a dialog to manipulate the image."
33
33
  msgid "Edit image"
34
- msgstr ""
34
+ msgstr "Редагувати зображення"
35
35
 
36
36
  msgctxt "A message stating that image editing is in progress."
37
37
  msgid "Processing the edited image."
38
- msgstr ""
38
+ msgstr "Обробка відредагованого зображення."
39
39
 
40
40
  msgctxt "A message is displayed when the server fails to process an image or doesn't respond."
41
41
  msgid "Server failed to process the image."
42
- msgstr ""
42
+ msgstr "Серверу не вдалося обробити зображення."
43
43
 
44
44
  msgctxt "A message is displayed when category of the image user wants to edit can't be determined."
45
45
  msgid "Failed to determine category of edited image."
46
- msgstr ""
46
+ msgstr "Не вдалося визначити категорію відредагованого зображення."
@@ -31,16 +31,16 @@ msgstr "Không thể truy cập vào không gian làm việc mặc định."
31
31
 
32
32
  msgctxt "Image toolbar button tooltip for opening a dialog to manipulate the image."
33
33
  msgid "Edit image"
34
- msgstr ""
34
+ msgstr "Chỉnh sửa hình ảnh"
35
35
 
36
36
  msgctxt "A message stating that image editing is in progress."
37
37
  msgid "Processing the edited image."
38
- msgstr ""
38
+ msgstr "Xử lý hình ảnh đã chỉnh sửa."
39
39
 
40
40
  msgctxt "A message is displayed when the server fails to process an image or doesn't respond."
41
41
  msgid "Server failed to process the image."
42
- msgstr ""
42
+ msgstr "Máy chủ không thể xử lý hình ảnh."
43
43
 
44
44
  msgctxt "A message is displayed when category of the image user wants to edit can't be determined."
45
45
  msgid "Failed to determine category of edited image."
46
- msgstr ""
46
+ msgstr "Không thể xác định danh mục hình ảnh đã chỉnh sửa."
@@ -31,16 +31,16 @@ msgstr "无法访问默认工作区"
31
31
 
32
32
  msgctxt "Image toolbar button tooltip for opening a dialog to manipulate the image."
33
33
  msgid "Edit image"
34
- msgstr ""
34
+ msgstr "编辑图片"
35
35
 
36
36
  msgctxt "A message stating that image editing is in progress."
37
37
  msgid "Processing the edited image."
38
- msgstr ""
38
+ msgstr "正在处理已编辑的图片。"
39
39
 
40
40
  msgctxt "A message is displayed when the server fails to process an image or doesn't respond."
41
41
  msgid "Server failed to process the image."
42
- msgstr ""
42
+ msgstr "服务器未能处理图片。"
43
43
 
44
44
  msgctxt "A message is displayed when category of the image user wants to edit can't be determined."
45
45
  msgid "Failed to determine category of edited image."
46
- msgstr ""
46
+ msgstr "未能确定已编辑图片的类别。"
@@ -31,16 +31,16 @@ msgstr "無法存取預設工作區。"
31
31
 
32
32
  msgctxt "Image toolbar button tooltip for opening a dialog to manipulate the image."
33
33
  msgid "Edit image"
34
- msgstr ""
34
+ msgstr "編輯圖片"
35
35
 
36
36
  msgctxt "A message stating that image editing is in progress."
37
37
  msgid "Processing the edited image."
38
- msgstr ""
38
+ msgstr "正在處理已編輯的圖片。"
39
39
 
40
40
  msgctxt "A message is displayed when the server fails to process an image or doesn't respond."
41
41
  msgid "Server failed to process the image."
42
- msgstr ""
42
+ msgstr "伺服器無法處理該圖片。"
43
43
 
44
44
  msgctxt "A message is displayed when category of the image user wants to edit can't be determined."
45
45
  msgid "Failed to determine category of edited image."
46
- msgstr ""
46
+ msgstr "無法判斷已編輯圖片的類別。"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ckbox",
3
- "version": "0.0.0-nightly-20231212.0",
3
+ "version": "0.0.0-nightly-20231213.0",
4
4
  "description": "CKBox integration for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "0.0.0-nightly-20231212.0",
15
+ "ckeditor5": "0.0.0-nightly-20231213.0",
16
16
  "blurhash": "2.0.5",
17
17
  "lodash-es": "4.17.21"
18
18
  },
@@ -73,6 +73,7 @@ export default class CKBoxCommand extends Command {
73
73
  * - language The language for CKBox dialog.
74
74
  * - tokenUrl The token endpoint URL.
75
75
  * - serviceOrigin The base URL of the API service.
76
+ * - forceDemoLabel Whether to force "Powered by CKBox" link.
76
77
  * - dialog.onClose The callback function invoked after closing the CKBox dialog.
77
78
  * - assets.onChoose The callback function invoked after choosing the assets.
78
79
  */
@@ -94,6 +94,7 @@ export default class CKBoxCommand extends Command {
94
94
  * - language The language for CKBox dialog.
95
95
  * - tokenUrl The token endpoint URL.
96
96
  * - serviceOrigin The base URL of the API service.
97
+ * - forceDemoLabel Whether to force "Powered by CKBox" link.
97
98
  * - dialog.onClose The callback function invoked after closing the CKBox dialog.
98
99
  * - assets.onChoose The callback function invoked after choosing the assets.
99
100
  */
@@ -105,6 +106,7 @@ export default class CKBoxCommand extends Command {
105
106
  language: ckboxConfig.language,
106
107
  tokenUrl: ckboxConfig.tokenUrl,
107
108
  serviceOrigin: ckboxConfig.serviceOrigin,
109
+ forceDemoLabel: ckboxConfig.forceDemoLabel,
108
110
  dialog: {
109
111
  onClose: () => this.fire('ckbox:close')
110
112
  },
@@ -27,7 +27,7 @@ export default class CKBoxEditing extends Plugin {
27
27
  */
28
28
  init(): void;
29
29
  /**
30
- * Checks if the at least one image plugin is loaded.
30
+ * Checks if at least one image plugin is loaded.
31
31
  */
32
32
  private _checkImagePlugins;
33
33
  /**
@@ -51,7 +51,7 @@ export default class CKBoxEditing extends Plugin {
51
51
  }
52
52
  }
53
53
  /**
54
- * Checks if the at least one image plugin is loaded.
54
+ * Checks if at least one image plugin is loaded.
55
55
  */
56
56
  _checkImagePlugins() {
57
57
  const editor = this.editor;
@@ -280,10 +280,10 @@ export default class CKBoxImageEditCommand extends Command {
280
280
  source: {
281
281
  src: imageFallbackUrl,
282
282
  sources: imageSources,
283
- alt: element.getAttribute('alt'),
284
283
  width: imageWidth,
285
284
  height: imageHeight,
286
- ...(imagePlaceholder ? { placeholder: imagePlaceholder } : null)
285
+ ...(imagePlaceholder ? { placeholder: imagePlaceholder } : null),
286
+ ...(element.hasAttribute('alt') ? { alt: element.getAttribute('alt') } : null)
287
287
  }
288
288
  });
289
289
  const previousChildren = element.getChildren();
@@ -33,7 +33,7 @@ function createUrlChecker(allowExternalImagesEditing) {
33
33
  }
34
34
  if (allowExternalImagesEditing == 'origin') {
35
35
  const origin = global.window.location.origin;
36
- return src => src.startsWith(origin + '/');
36
+ return src => new URL(src, global.document.baseURI).origin == origin;
37
37
  }
38
38
  if (typeof allowExternalImagesEditing == 'function') {
39
39
  return allowExternalImagesEditing;
@@ -8,8 +8,7 @@
8
8
  import type { InitializedToken } from '@ckeditor/ckeditor5-cloud-services';
9
9
  import { Plugin } from 'ckeditor5/src/core';
10
10
  /**
11
- * The CKBox editing feature. It introduces the {@link module:ckbox/ckboxcommand~CKBoxCommand CKBox command} and
12
- * {@link module:ckbox/ckboxuploadadapter~CKBoxUploadAdapter CKBox upload adapter}.
11
+ * The CKBox utilities plugin.
13
12
  */
14
13
  export default class CKBoxUtils extends Plugin {
15
14
  /**
package/src/ckboxutils.js CHANGED
@@ -7,8 +7,7 @@ import { Plugin } from 'ckeditor5/src/core';
7
7
  import { convertMimeTypeToExtension, getContentTypeOfUrl, getFileExtension, getWorkspaceId, sendHttpRequest } from './utils';
8
8
  const DEFAULT_CKBOX_THEME_NAME = 'lark';
9
9
  /**
10
- * The CKBox editing feature. It introduces the {@link module:ckbox/ckboxcommand~CKBoxCommand CKBox command} and
11
- * {@link module:ckbox/ckboxuploadadapter~CKBoxUploadAdapter CKBox upload adapter}.
10
+ * The CKBox utilities plugin.
12
11
  */
13
12
  export default class CKBoxUtils extends Plugin {
14
13
  /**
package/src/utils.d.ts CHANGED
@@ -47,7 +47,13 @@ export declare function sendHttpRequest({ url, method, data, onUploadProgress, s
47
47
  data?: FormData | null;
48
48
  onUploadProgress?: (evt: ProgressEvent) => void;
49
49
  }): Promise<any>;
50
+ /**
51
+ * Returns an extension a typical file in the specified `mimeType` format would have.
52
+ */
50
53
  export declare function convertMimeTypeToExtension(mimeType: string): string;
54
+ /**
55
+ * Tries to fetch the given `url` and returns 'content-type' of the response.
56
+ */
51
57
  export declare function getContentTypeOfUrl(url: string, options: {
52
58
  signal: AbortSignal;
53
59
  }): Promise<string>;
package/src/utils.js CHANGED
@@ -139,9 +139,15 @@ const MIME_TO_EXTENSION = {
139
139
  'image/bmp': 'bmp',
140
140
  'image/tiff': 'tiff'
141
141
  };
142
+ /**
143
+ * Returns an extension a typical file in the specified `mimeType` format would have.
144
+ */
142
145
  export function convertMimeTypeToExtension(mimeType) {
143
146
  return MIME_TO_EXTENSION[mimeType];
144
147
  }
148
+ /**
149
+ * Tries to fetch the given `url` and returns 'content-type' of the response.
150
+ */
145
151
  export async function getContentTypeOfUrl(url, options) {
146
152
  try {
147
153
  const response = await fetch(url, {