@zero-library/common 3.2.0 → 3.2.1

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/dist/index.d.mts CHANGED
@@ -1002,6 +1002,7 @@ declare const commonEnUS: {
1002
1002
  filePreview: {
1003
1003
  title: string;
1004
1004
  closePreview: string;
1005
+ htmlPreviewTitle: string;
1005
1006
  previewImageAlt: string;
1006
1007
  previewNotSupported: string;
1007
1008
  previewNotSupportedDownload: string;
@@ -1034,6 +1035,7 @@ declare const commonEnUS: {
1034
1035
  mainArea: string;
1035
1036
  unknown: string;
1036
1037
  toolbar: {
1038
+ toolbarAria: string;
1037
1039
  quote: string;
1038
1040
  annotation: string;
1039
1041
  excerpt: string;
@@ -1070,6 +1072,7 @@ declare const commonEnUS: {
1070
1072
  toggle: string;
1071
1073
  label: string;
1072
1074
  textLabel: string;
1075
+ colorOptionAria: string;
1073
1076
  removeBackground: string;
1074
1077
  removeHighlight: string;
1075
1078
  default: string;
@@ -1103,7 +1106,14 @@ declare const commonEnUS: {
1103
1106
  confirmDelete: string;
1104
1107
  empty: string;
1105
1108
  };
1109
+ themeToggle: {
1110
+ switchToLight: string;
1111
+ switchToDark: string;
1112
+ };
1106
1113
  upload: {
1114
+ clickToUpload: string;
1115
+ dragAndDrop: string;
1116
+ maxFileHint: string;
1107
1117
  noFile: string;
1108
1118
  canceled: string;
1109
1119
  fileSizeExceeded: string;
@@ -1189,6 +1199,7 @@ declare const commonJaJP: {
1189
1199
  filePreview: {
1190
1200
  title: string;
1191
1201
  closePreview: string;
1202
+ htmlPreviewTitle: string;
1192
1203
  previewImageAlt: string;
1193
1204
  previewNotSupported: string;
1194
1205
  previewNotSupportedDownload: string;
@@ -1221,6 +1232,7 @@ declare const commonJaJP: {
1221
1232
  mainArea: string;
1222
1233
  unknown: string;
1223
1234
  toolbar: {
1235
+ toolbarAria: string;
1224
1236
  quote: string;
1225
1237
  annotation: string;
1226
1238
  excerpt: string;
@@ -1257,6 +1269,7 @@ declare const commonJaJP: {
1257
1269
  toggle: string;
1258
1270
  label: string;
1259
1271
  textLabel: string;
1272
+ colorOptionAria: string;
1260
1273
  removeBackground: string;
1261
1274
  removeHighlight: string;
1262
1275
  default: string;
@@ -1290,7 +1303,14 @@ declare const commonJaJP: {
1290
1303
  confirmDelete: string;
1291
1304
  empty: string;
1292
1305
  };
1306
+ themeToggle: {
1307
+ switchToLight: string;
1308
+ switchToDark: string;
1309
+ };
1293
1310
  upload: {
1311
+ clickToUpload: string;
1312
+ dragAndDrop: string;
1313
+ maxFileHint: string;
1294
1314
  noFile: string;
1295
1315
  canceled: string;
1296
1316
  fileSizeExceeded: string;
@@ -1383,6 +1403,7 @@ declare const commonZhCN: {
1383
1403
  readonly filePreview: {
1384
1404
  readonly title: "文件预览";
1385
1405
  readonly closePreview: "关闭预览";
1406
+ readonly htmlPreviewTitle: "HTML 预览";
1386
1407
  readonly previewImageAlt: "预览图片";
1387
1408
  readonly previewNotSupported: "暂不支持 {{suffix}} 文件的预览";
1388
1409
  readonly previewNotSupportedDownload: "{{suffix}} 文件暂不支持在线预览,请下载打开";
@@ -1415,6 +1436,7 @@ declare const commonZhCN: {
1415
1436
  readonly mainArea: "主内容区域,开始输入文本...";
1416
1437
  readonly unknown: "未知";
1417
1438
  readonly toolbar: {
1439
+ readonly toolbarAria: "编辑器工具栏";
1418
1440
  readonly quote: "引用选中文本";
1419
1441
  readonly annotation: "批注";
1420
1442
  readonly excerpt: "摘录笔记";
@@ -1451,6 +1473,7 @@ declare const commonZhCN: {
1451
1473
  readonly toggle: "切换高亮显示 ({{color}})";
1452
1474
  readonly label: "背景色";
1453
1475
  readonly textLabel: "文本背景色";
1476
+ readonly colorOptionAria: "{{label}} 高亮颜色";
1454
1477
  readonly removeBackground: "移除背景";
1455
1478
  readonly removeHighlight: "移除高亮";
1456
1479
  readonly default: "默认背景";
@@ -1484,7 +1507,14 @@ declare const commonZhCN: {
1484
1507
  readonly confirmDelete: "确认删除当前摘录吗?";
1485
1508
  readonly empty: "暂无摘录";
1486
1509
  };
1510
+ readonly themeToggle: {
1511
+ readonly switchToLight: "切换到浅色模式";
1512
+ readonly switchToDark: "切换到深色模式";
1513
+ };
1487
1514
  readonly upload: {
1515
+ readonly clickToUpload: "点击上传";
1516
+ readonly dragAndDrop: "或拖拽到此处";
1517
+ readonly maxFileHint: "最多 {{limit}} 个文件,每个 {{size}}MB";
1488
1518
  readonly noFile: "未提供文件";
1489
1519
  readonly canceled: "上传已取消";
1490
1520
  readonly fileSizeExceeded: "文件大小超过最大限制 ({{max}}MB)";
package/dist/index.d.ts CHANGED
@@ -1002,6 +1002,7 @@ declare const commonEnUS: {
1002
1002
  filePreview: {
1003
1003
  title: string;
1004
1004
  closePreview: string;
1005
+ htmlPreviewTitle: string;
1005
1006
  previewImageAlt: string;
1006
1007
  previewNotSupported: string;
1007
1008
  previewNotSupportedDownload: string;
@@ -1034,6 +1035,7 @@ declare const commonEnUS: {
1034
1035
  mainArea: string;
1035
1036
  unknown: string;
1036
1037
  toolbar: {
1038
+ toolbarAria: string;
1037
1039
  quote: string;
1038
1040
  annotation: string;
1039
1041
  excerpt: string;
@@ -1070,6 +1072,7 @@ declare const commonEnUS: {
1070
1072
  toggle: string;
1071
1073
  label: string;
1072
1074
  textLabel: string;
1075
+ colorOptionAria: string;
1073
1076
  removeBackground: string;
1074
1077
  removeHighlight: string;
1075
1078
  default: string;
@@ -1103,7 +1106,14 @@ declare const commonEnUS: {
1103
1106
  confirmDelete: string;
1104
1107
  empty: string;
1105
1108
  };
1109
+ themeToggle: {
1110
+ switchToLight: string;
1111
+ switchToDark: string;
1112
+ };
1106
1113
  upload: {
1114
+ clickToUpload: string;
1115
+ dragAndDrop: string;
1116
+ maxFileHint: string;
1107
1117
  noFile: string;
1108
1118
  canceled: string;
1109
1119
  fileSizeExceeded: string;
@@ -1189,6 +1199,7 @@ declare const commonJaJP: {
1189
1199
  filePreview: {
1190
1200
  title: string;
1191
1201
  closePreview: string;
1202
+ htmlPreviewTitle: string;
1192
1203
  previewImageAlt: string;
1193
1204
  previewNotSupported: string;
1194
1205
  previewNotSupportedDownload: string;
@@ -1221,6 +1232,7 @@ declare const commonJaJP: {
1221
1232
  mainArea: string;
1222
1233
  unknown: string;
1223
1234
  toolbar: {
1235
+ toolbarAria: string;
1224
1236
  quote: string;
1225
1237
  annotation: string;
1226
1238
  excerpt: string;
@@ -1257,6 +1269,7 @@ declare const commonJaJP: {
1257
1269
  toggle: string;
1258
1270
  label: string;
1259
1271
  textLabel: string;
1272
+ colorOptionAria: string;
1260
1273
  removeBackground: string;
1261
1274
  removeHighlight: string;
1262
1275
  default: string;
@@ -1290,7 +1303,14 @@ declare const commonJaJP: {
1290
1303
  confirmDelete: string;
1291
1304
  empty: string;
1292
1305
  };
1306
+ themeToggle: {
1307
+ switchToLight: string;
1308
+ switchToDark: string;
1309
+ };
1293
1310
  upload: {
1311
+ clickToUpload: string;
1312
+ dragAndDrop: string;
1313
+ maxFileHint: string;
1294
1314
  noFile: string;
1295
1315
  canceled: string;
1296
1316
  fileSizeExceeded: string;
@@ -1383,6 +1403,7 @@ declare const commonZhCN: {
1383
1403
  readonly filePreview: {
1384
1404
  readonly title: "文件预览";
1385
1405
  readonly closePreview: "关闭预览";
1406
+ readonly htmlPreviewTitle: "HTML 预览";
1386
1407
  readonly previewImageAlt: "预览图片";
1387
1408
  readonly previewNotSupported: "暂不支持 {{suffix}} 文件的预览";
1388
1409
  readonly previewNotSupportedDownload: "{{suffix}} 文件暂不支持在线预览,请下载打开";
@@ -1415,6 +1436,7 @@ declare const commonZhCN: {
1415
1436
  readonly mainArea: "主内容区域,开始输入文本...";
1416
1437
  readonly unknown: "未知";
1417
1438
  readonly toolbar: {
1439
+ readonly toolbarAria: "编辑器工具栏";
1418
1440
  readonly quote: "引用选中文本";
1419
1441
  readonly annotation: "批注";
1420
1442
  readonly excerpt: "摘录笔记";
@@ -1451,6 +1473,7 @@ declare const commonZhCN: {
1451
1473
  readonly toggle: "切换高亮显示 ({{color}})";
1452
1474
  readonly label: "背景色";
1453
1475
  readonly textLabel: "文本背景色";
1476
+ readonly colorOptionAria: "{{label}} 高亮颜色";
1454
1477
  readonly removeBackground: "移除背景";
1455
1478
  readonly removeHighlight: "移除高亮";
1456
1479
  readonly default: "默认背景";
@@ -1484,7 +1507,14 @@ declare const commonZhCN: {
1484
1507
  readonly confirmDelete: "确认删除当前摘录吗?";
1485
1508
  readonly empty: "暂无摘录";
1486
1509
  };
1510
+ readonly themeToggle: {
1511
+ readonly switchToLight: "切换到浅色模式";
1512
+ readonly switchToDark: "切换到深色模式";
1513
+ };
1487
1514
  readonly upload: {
1515
+ readonly clickToUpload: "点击上传";
1516
+ readonly dragAndDrop: "或拖拽到此处";
1517
+ readonly maxFileHint: "最多 {{limit}} 个文件,每个 {{size}}MB";
1488
1518
  readonly noFile: "未提供文件";
1489
1519
  readonly canceled: "上传已取消";
1490
1520
  readonly fileSizeExceeded: "文件大小超过最大限制 ({{max}}MB)";
package/dist/index.esm.js CHANGED
@@ -1328,6 +1328,7 @@ var commonZhCN = {
1328
1328
  filePreview: {
1329
1329
  title: "\u6587\u4EF6\u9884\u89C8",
1330
1330
  closePreview: "\u5173\u95ED\u9884\u89C8",
1331
+ htmlPreviewTitle: "HTML \u9884\u89C8",
1331
1332
  previewImageAlt: "\u9884\u89C8\u56FE\u7247",
1332
1333
  previewNotSupported: "\u6682\u4E0D\u652F\u6301 {{suffix}} \u6587\u4EF6\u7684\u9884\u89C8",
1333
1334
  previewNotSupportedDownload: "{{suffix}} \u6587\u4EF6\u6682\u4E0D\u652F\u6301\u5728\u7EBF\u9884\u89C8\uFF0C\u8BF7\u4E0B\u8F7D\u6253\u5F00",
@@ -1362,6 +1363,7 @@ var commonZhCN = {
1362
1363
  unknown: "\u672A\u77E5",
1363
1364
  // 工具栏
1364
1365
  toolbar: {
1366
+ toolbarAria: "\u7F16\u8F91\u5668\u5DE5\u5177\u680F",
1365
1367
  quote: "\u5F15\u7528\u9009\u4E2D\u6587\u672C",
1366
1368
  annotation: "\u6279\u6CE8",
1367
1369
  excerpt: "\u6458\u5F55\u7B14\u8BB0",
@@ -1399,6 +1401,7 @@ var commonZhCN = {
1399
1401
  toggle: "\u5207\u6362\u9AD8\u4EAE\u663E\u793A ({{color}})",
1400
1402
  label: "\u80CC\u666F\u8272",
1401
1403
  textLabel: "\u6587\u672C\u80CC\u666F\u8272",
1404
+ colorOptionAria: "{{label}} \u9AD8\u4EAE\u989C\u8272",
1402
1405
  removeBackground: "\u79FB\u9664\u80CC\u666F",
1403
1406
  removeHighlight: "\u79FB\u9664\u9AD8\u4EAE",
1404
1407
  default: "\u9ED8\u8BA4\u80CC\u666F",
@@ -1435,7 +1438,14 @@ var commonZhCN = {
1435
1438
  empty: "\u6682\u65E0\u6458\u5F55"
1436
1439
  },
1437
1440
  // 文件 / 图片上传
1441
+ themeToggle: {
1442
+ switchToLight: "\u5207\u6362\u5230\u6D45\u8272\u6A21\u5F0F",
1443
+ switchToDark: "\u5207\u6362\u5230\u6DF1\u8272\u6A21\u5F0F"
1444
+ },
1438
1445
  upload: {
1446
+ clickToUpload: "\u70B9\u51FB\u4E0A\u4F20",
1447
+ dragAndDrop: "\u6216\u62D6\u62FD\u5230\u6B64\u5904",
1448
+ maxFileHint: "\u6700\u591A {{limit}} \u4E2A\u6587\u4EF6\uFF0C\u6BCF\u4E2A {{size}}MB",
1439
1449
  noFile: "\u672A\u63D0\u4F9B\u6587\u4EF6",
1440
1450
  canceled: "\u4E0A\u4F20\u5DF2\u53D6\u6D88",
1441
1451
  fileSizeExceeded: "\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u9650\u5236 ({{max}}MB)",
@@ -1517,6 +1527,7 @@ var commonEnUS = {
1517
1527
  filePreview: {
1518
1528
  title: "File Preview",
1519
1529
  closePreview: "Close preview",
1530
+ htmlPreviewTitle: "HTML Preview",
1520
1531
  previewImageAlt: "Preview image",
1521
1532
  previewNotSupported: "Preview of {{suffix}} files is not supported",
1522
1533
  previewNotSupportedDownload: "{{suffix}} files cannot be previewed online, please download and open",
@@ -1549,6 +1560,7 @@ var commonEnUS = {
1549
1560
  mainArea: "Main content area, start typing...",
1550
1561
  unknown: "Unknown",
1551
1562
  toolbar: {
1563
+ toolbarAria: "Editor toolbar",
1552
1564
  quote: "Quote Selected Text",
1553
1565
  annotation: "Annotate",
1554
1566
  excerpt: "Excerpt Note",
@@ -1585,6 +1597,7 @@ var commonEnUS = {
1585
1597
  toggle: "Toggle highlight ({{color}})",
1586
1598
  label: "Background color",
1587
1599
  textLabel: "Text background color",
1600
+ colorOptionAria: "{{label}} highlight color",
1588
1601
  removeBackground: "Remove background",
1589
1602
  removeHighlight: "Remove highlight",
1590
1603
  default: "Default background",
@@ -1618,7 +1631,14 @@ var commonEnUS = {
1618
1631
  confirmDelete: "Delete this excerpt?",
1619
1632
  empty: "No excerpts"
1620
1633
  },
1634
+ themeToggle: {
1635
+ switchToLight: "Switch to light mode",
1636
+ switchToDark: "Switch to dark mode"
1637
+ },
1621
1638
  upload: {
1639
+ clickToUpload: "Click to upload",
1640
+ dragAndDrop: "or drag and drop",
1641
+ maxFileHint: "Maximum {{limit}} files, {{size}}MB each",
1622
1642
  noFile: "No file provided",
1623
1643
  canceled: "Upload canceled",
1624
1644
  fileSizeExceeded: "File size exceeds the maximum limit ({{max}}MB)",
@@ -1709,6 +1729,7 @@ var commonJaJP = {
1709
1729
  filePreview: {
1710
1730
  title: "\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC",
1711
1731
  closePreview: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B",
1732
+ htmlPreviewTitle: "HTML \u30D7\u30EC\u30D3\u30E5\u30FC",
1712
1733
  previewImageAlt: "\u30D7\u30EC\u30D3\u30E5\u30FC\u753B\u50CF",
1713
1734
  previewNotSupported: "{{suffix}}\u30D5\u30A1\u30A4\u30EB\u306E\u30D7\u30EC\u30D3\u30E5\u30FC\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093",
1714
1735
  previewNotSupportedDownload: "{{suffix}}\u30D5\u30A1\u30A4\u30EB\u306F\u30AA\u30F3\u30E9\u30A4\u30F3\u30D7\u30EC\u30D3\u30E5\u30FC\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u958B\u3044\u3066\u304F\u3060\u3055\u3044",
@@ -1743,6 +1764,7 @@ var commonJaJP = {
1743
1764
  unknown: "\u4E0D\u660E",
1744
1765
  // ツールバー
1745
1766
  toolbar: {
1767
+ toolbarAria: "\u30A8\u30C7\u30A3\u30BF\u30FC\u30C4\u30FC\u30EB\u30D0\u30FC",
1746
1768
  quote: "\u9078\u629E\u30C6\u30AD\u30B9\u30C8\u3092\u5F15\u7528",
1747
1769
  annotation: "\u6CE8\u91C8",
1748
1770
  excerpt: "\u629C\u7C8B\u30E1\u30E2",
@@ -1780,6 +1802,7 @@ var commonJaJP = {
1780
1802
  toggle: "\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A\u3092\u5207\u308A\u66FF\u3048 ({{color}})",
1781
1803
  label: "\u80CC\u666F\u8272",
1782
1804
  textLabel: "\u30C6\u30AD\u30B9\u30C8\u80CC\u666F\u8272",
1805
+ colorOptionAria: "{{label}} \u306E\u30CF\u30A4\u30E9\u30A4\u30C8\u8272",
1783
1806
  removeBackground: "\u80CC\u666F\u3092\u524A\u9664",
1784
1807
  removeHighlight: "\u30CF\u30A4\u30E9\u30A4\u30C8\u3092\u524A\u9664",
1785
1808
  default: "\u30C7\u30D5\u30A9\u30EB\u30C8\u80CC\u666F",
@@ -1816,7 +1839,14 @@ var commonJaJP = {
1816
1839
  empty: "\u629C\u7C8B\u306F\u3042\u308A\u307E\u305B\u3093"
1817
1840
  },
1818
1841
  // ファイル / 画像アップロード
1842
+ themeToggle: {
1843
+ switchToLight: "\u30E9\u30A4\u30C8\u30E2\u30FC\u30C9\u306B\u5207\u308A\u66FF\u3048",
1844
+ switchToDark: "\u30C0\u30FC\u30AF\u30E2\u30FC\u30C9\u306B\u5207\u308A\u66FF\u3048"
1845
+ },
1819
1846
  upload: {
1847
+ clickToUpload: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
1848
+ dragAndDrop: "\u307E\u305F\u306F\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7",
1849
+ maxFileHint: "\u6700\u5927 {{limit}} \u4EF6\u3001\u5404 {{size}}MB \u307E\u3067",
1820
1850
  noFile: "\u30D5\u30A1\u30A4\u30EB\u304C\u63D0\u4F9B\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
1821
1851
  canceled: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u306F\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F",
1822
1852
  fileSizeExceeded: "\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u6700\u5927\u5236\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059 ({{max}}MB)",
@@ -3457,7 +3487,7 @@ var CodePreview = ({ fileUrl, suffix }) => {
3457
3487
  var CodePreview_default = CodePreview;
3458
3488
  var { Text } = Typography;
3459
3489
  pdfjsLib.GlobalWorkerOptions.workerSrc = "https://unpkg.com/pdfjs-dist@5.4.296/legacy/build/pdf.worker.min.mjs";
3460
- var MIN_SCALE = 0.6;
3490
+ var MIN_SCALE = 0.1;
3461
3491
  var MAX_SCALE = 1.5;
3462
3492
  var SCALE_STEP = 0.1;
3463
3493
  var PdfPage = React3__default.memo(({ pdf, pageNumber, scale, scrollContainerRef, defaultSize }) => {
@@ -3803,7 +3833,7 @@ var HtmlPreview = ({ fileUrl }) => {
3803
3833
  srcDoc: content,
3804
3834
  style: { width: "100%", height: "100%", border: "none" },
3805
3835
  sandbox: "allow-scripts allow-same-origin allow-popups allow-forms",
3806
- title: "HTML Preview"
3836
+ title: t2("filePreview.htmlPreviewTitle")
3807
3837
  }
3808
3838
  ) : null });
3809
3839
  };
@@ -5997,13 +6027,14 @@ var Toolbar = forwardRef(
5997
6027
  ({ children, className, variant = "fixed", ...props }, ref) => {
5998
6028
  const toolbarRef = useRef(null);
5999
6029
  const composedRef = useComposedRef(toolbarRef, ref);
6030
+ const { t: t2 } = useTranslation(NS_COMMON);
6000
6031
  useToolbarNavigation(toolbarRef);
6001
6032
  return /* @__PURE__ */ jsx(
6002
6033
  "div",
6003
6034
  {
6004
6035
  ref: composedRef,
6005
6036
  role: "toolbar",
6006
- "aria-label": "toolbar",
6037
+ "aria-label": t2("markdownEditor.toolbar.toolbarAria"),
6007
6038
  "data-variant": variant,
6008
6039
  className: cn("tiptap-toolbar", className),
6009
6040
  ...props,
@@ -6993,7 +7024,7 @@ function ColorHighlightPopoverContent({
6993
7024
  editor,
6994
7025
  highlightColor: color.value,
6995
7026
  tooltip: t2(color.labelKey),
6996
- "aria-label": `${t2(color.labelKey)} highlight color`,
7027
+ "aria-label": t2("markdownEditor.highlight.colorOptionAria", { label: t2(color.labelKey) }),
6997
7028
  tabIndex: index === selectedIndex ? 0 : -1,
6998
7029
  "data-highlighted": selectedIndex === index
6999
7030
  },
@@ -7565,7 +7596,7 @@ var HeadingDropdownMenu = forwardRef(
7565
7596
  tabIndex: -1,
7566
7597
  disabled: !canToggle3,
7567
7598
  "data-disabled": !canToggle3,
7568
- "aria-label": "Format text as heading",
7599
+ "aria-label": t2("markdownEditor.toolbar.heading"),
7569
7600
  "aria-pressed": isActive,
7570
7601
  tooltip: t2("markdownEditor.toolbar.heading"),
7571
7602
  ...buttonProps,