@formicoidea/labre-core 0.40.0 → 0.41.0

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.
Files changed (433) hide show
  1. package/dist/_pkgs/affine-block-attachment/attachment-block.js +7 -2
  2. package/dist/_pkgs/affine-block-attachment/components/rename-model.js +3 -2
  3. package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +7 -0
  4. package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +11 -3
  5. package/dist/_pkgs/affine-block-attachment/configs/tooltips.js +4 -4
  6. package/dist/_pkgs/affine-block-attachment/translations.d.ts +49 -0
  7. package/dist/_pkgs/affine-block-attachment/translations.js +98 -0
  8. package/dist/_pkgs/affine-block-attachment/utils.js +9 -6
  9. package/dist/_pkgs/affine-block-bookmark/components/bookmark-card.js +13 -6
  10. package/dist/_pkgs/affine-block-bookmark/configs/slash-menu.js +6 -1
  11. package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +9 -1
  12. package/dist/_pkgs/affine-block-bookmark/configs/tooltips.js +2 -2
  13. package/dist/_pkgs/affine-block-bookmark/translations.d.ts +26 -0
  14. package/dist/_pkgs/affine-block-bookmark/translations.js +55 -0
  15. package/dist/_pkgs/affine-block-callout/configs/slash-menu.js +4 -0
  16. package/dist/_pkgs/affine-block-callout/configs/tooltips.js +2 -2
  17. package/dist/_pkgs/affine-block-callout/translations.d.ts +16 -0
  18. package/dist/_pkgs/affine-block-callout/translations.js +24 -0
  19. package/dist/_pkgs/affine-block-code/code-block.js +6 -3
  20. package/dist/_pkgs/affine-block-code/code-toolbar/components/code-toolbar.js +4 -2
  21. package/dist/_pkgs/affine-block-code/code-toolbar/components/lang-button.js +3 -2
  22. package/dist/_pkgs/affine-block-code/code-toolbar/components/preview-button.js +4 -3
  23. package/dist/_pkgs/affine-block-code/code-toolbar/config.js +116 -72
  24. package/dist/_pkgs/affine-block-code/translations.d.ts +30 -0
  25. package/dist/_pkgs/affine-block-code/translations.js +84 -0
  26. package/dist/_pkgs/affine-block-edgeless-text/edgeless-toolbar/config.js +2 -2
  27. package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +7 -6
  28. package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -2
  29. package/dist/_pkgs/affine-block-embed/embed-html-block/components/fullscreen-toolbar.js +4 -3
  30. package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -1
  31. package/dist/_pkgs/affine-block-embed/embed-html-block/configs/tooltips.js +14 -14
  32. package/dist/_pkgs/affine-block-embed/embed-html-block/embed-html-block.js +7 -1
  33. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +11 -4
  34. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-idle-card.d.ts +2 -0
  35. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-idle-card.js +13 -3
  36. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-link-edit-popup.js +4 -2
  37. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-link-input-base.js +8 -5
  38. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-link-input-popup.js +21 -5
  39. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-loading-card.js +4 -1
  40. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/slash-menu/slash-menu.js +4 -0
  41. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +2 -0
  42. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +6 -1
  43. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +3 -1
  44. package/dist/_pkgs/affine-block-embed/translations.d.ts +46 -0
  45. package/dist/_pkgs/affine-block-embed/translations.js +114 -0
  46. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/slash-menu.js +7 -0
  47. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +29 -12
  48. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/tooltips.js +4 -4
  49. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +10 -4
  50. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +8 -4
  51. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +28 -13
  52. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-edgeless-synced-doc-block.js +3 -2
  53. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +3 -2
  54. package/dist/_pkgs/affine-block-embed-doc/translations.d.ts +40 -0
  55. package/dist/_pkgs/affine-block-embed-doc/translations.js +85 -0
  56. package/dist/_pkgs/affine-block-frame/edgeless-toolbar/frame-dense-menu.js +29 -22
  57. package/dist/_pkgs/affine-block-frame/edgeless-toolbar/frame-menu.js +5 -1
  58. package/dist/_pkgs/affine-block-frame/edgeless-toolbar/frame-tool-button.js +2 -1
  59. package/dist/_pkgs/affine-block-frame/edgeless-toolbar/presentation-toolbar.js +12 -9
  60. package/dist/_pkgs/affine-block-frame/frame-manager.js +8 -2
  61. package/dist/_pkgs/affine-block-frame/frame-tool.js +7 -2
  62. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +12 -6
  63. package/dist/_pkgs/affine-block-frame/index.d.ts +1 -0
  64. package/dist/_pkgs/affine-block-frame/index.js +1 -0
  65. package/dist/_pkgs/affine-block-frame/present/frame-order-button.js +5 -1
  66. package/dist/_pkgs/affine-block-frame/present/navigator-setting-button.js +16 -6
  67. package/dist/_pkgs/affine-block-frame/present/present-button.js +3 -1
  68. package/dist/_pkgs/affine-block-frame/translations.d.ts +64 -0
  69. package/dist/_pkgs/affine-block-frame/translations.js +131 -0
  70. package/dist/_pkgs/affine-block-image/components/page-image-block.js +5 -2
  71. package/dist/_pkgs/affine-block-image/configs/slash-menu.js +4 -0
  72. package/dist/_pkgs/affine-block-image/configs/toolbar.js +7 -1
  73. package/dist/_pkgs/affine-block-image/configs/tooltips.js +1 -1
  74. package/dist/_pkgs/affine-block-image/image-block.js +3 -2
  75. package/dist/_pkgs/affine-block-image/image-edgeless-block.js +6 -3
  76. package/dist/_pkgs/affine-block-image/preview-image/page.js +5 -1
  77. package/dist/_pkgs/affine-block-image/translations.d.ts +35 -0
  78. package/dist/_pkgs/affine-block-image/translations.js +68 -0
  79. package/dist/_pkgs/affine-block-image/utils.js +9 -8
  80. package/dist/_pkgs/affine-block-latex/configs/slash-menu.d.ts +8 -0
  81. package/dist/_pkgs/affine-block-latex/configs/slash-menu.js +19 -3
  82. package/dist/_pkgs/affine-block-latex/latex-block.js +6 -2
  83. package/dist/_pkgs/affine-block-latex/translations.d.ts +35 -0
  84. package/dist/_pkgs/affine-block-latex/translations.js +60 -0
  85. package/dist/_pkgs/affine-block-note/components/edgeless-note-border-dropdown-menu.d.ts +9 -0
  86. package/dist/_pkgs/affine-block-note/components/edgeless-note-border-dropdown-menu.js +23 -6
  87. package/dist/_pkgs/affine-block-note/components/edgeless-note-display-mode-dropdown-menu.d.ts +4 -1
  88. package/dist/_pkgs/affine-block-note/components/edgeless-note-display-mode-dropdown-menu.js +26 -6
  89. package/dist/_pkgs/affine-block-note/components/edgeless-note-shadow-menu.d.ts +3 -0
  90. package/dist/_pkgs/affine-block-note/components/edgeless-note-shadow-menu.js +21 -10
  91. package/dist/_pkgs/affine-block-note/components/edgeless-note-style-panel.js +22 -8
  92. package/dist/_pkgs/affine-block-note/configs/slash-menu.js +13 -0
  93. package/dist/_pkgs/affine-block-note/configs/toolbar.js +26 -19
  94. package/dist/_pkgs/affine-block-note/configs/tooltips.js +57 -30
  95. package/dist/_pkgs/affine-block-note/move-block.js +8 -2
  96. package/dist/_pkgs/affine-block-note/translations.d.ts +91 -0
  97. package/dist/_pkgs/affine-block-note/translations.js +253 -0
  98. package/dist/_pkgs/affine-block-paragraph/paragraph-block.js +7 -2
  99. package/dist/_pkgs/affine-block-paragraph/translations.d.ts +31 -0
  100. package/dist/_pkgs/affine-block-paragraph/translations.js +44 -0
  101. package/dist/_pkgs/affine-block-paragraph/view.js +6 -1
  102. package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +3 -1
  103. package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -3
  104. package/dist/_pkgs/affine-block-root/edgeless/clipboard/utils.js +1 -1
  105. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/alignment.js +26 -4
  106. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +14 -0
  107. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +10 -3
  108. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +8 -0
  109. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +9 -0
  110. package/dist/_pkgs/affine-block-root/edgeless/edgeless-keyboard.js +15 -6
  111. package/dist/_pkgs/affine-block-root/edgeless/utils/consts.d.ts +0 -1
  112. package/dist/_pkgs/affine-block-root/edgeless/utils/consts.js +0 -1
  113. package/dist/_pkgs/affine-block-root/translations.d.ts +61 -0
  114. package/dist/_pkgs/affine-block-root/translations.js +172 -0
  115. package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +3 -1
  116. package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +1 -0
  117. package/dist/_pkgs/affine-block-surface/extensions/index.js +1 -0
  118. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +31 -12
  119. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +40 -8
  120. package/dist/_pkgs/affine-block-surface/extensions/interchange.js +27 -0
  121. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.d.ts +2 -2
  122. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +5 -2
  123. package/dist/_pkgs/affine-block-surface/extensions/reading-widget.js +3 -2
  124. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +48 -0
  125. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +120 -0
  126. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +36 -23
  127. package/dist/_pkgs/affine-block-surface/extensions/tags-toolbar.js +5 -5
  128. package/dist/_pkgs/affine-block-surface-ref/components/placeholder.d.ts +2 -1
  129. package/dist/_pkgs/affine-block-surface-ref/components/placeholder.js +21 -6
  130. package/dist/_pkgs/affine-block-surface-ref/configs/slash-menu.js +24 -7
  131. package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
  132. package/dist/_pkgs/affine-block-surface-ref/index.d.ts +1 -0
  133. package/dist/_pkgs/affine-block-surface-ref/index.js +1 -0
  134. package/dist/_pkgs/affine-block-surface-ref/surface-ref-block-edgeless.js +1 -0
  135. package/dist/_pkgs/affine-block-surface-ref/surface-ref-block.js +1 -0
  136. package/dist/_pkgs/affine-block-surface-ref/translations.d.ts +83 -0
  137. package/dist/_pkgs/affine-block-surface-ref/translations.js +175 -0
  138. package/dist/_pkgs/affine-block-surface-ref/utils.d.ts +8 -1
  139. package/dist/_pkgs/affine-block-surface-ref/utils.js +12 -4
  140. package/dist/_pkgs/affine-components/caption/block-caption.js +3 -1
  141. package/dist/_pkgs/affine-components/card-style-dropdown-menu/dropdown-menu.js +4 -3
  142. package/dist/_pkgs/affine-components/citation/citation.d.ts +2 -0
  143. package/dist/_pkgs/affine-components/citation/citation.js +19 -3
  144. package/dist/_pkgs/affine-components/color-picker/button.d.ts +6 -0
  145. package/dist/_pkgs/affine-components/color-picker/button.js +15 -1
  146. package/dist/_pkgs/affine-components/color-picker/color-panel.d.ts +8 -0
  147. package/dist/_pkgs/affine-components/color-picker/color-panel.js +17 -2
  148. package/dist/_pkgs/affine-components/color-picker/color-picker.d.ts +4 -0
  149. package/dist/_pkgs/affine-components/color-picker/color-picker.js +27 -3
  150. package/dist/_pkgs/affine-components/color-picker/types.d.ts +21 -0
  151. package/dist/_pkgs/affine-components/color-picker/utils.d.ts +28 -2
  152. package/dist/_pkgs/affine-components/color-picker/utils.js +32 -0
  153. package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +3 -0
  154. package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +34 -7
  155. package/dist/_pkgs/affine-components/edgeless-line-styles-panel/line-styles-panel.d.ts +2 -0
  156. package/dist/_pkgs/affine-components/edgeless-line-styles-panel/line-styles-panel.js +21 -2
  157. package/dist/_pkgs/affine-components/edgeless-line-width-panel/line-width-panel.d.ts +2 -0
  158. package/dist/_pkgs/affine-components/edgeless-line-width-panel/line-width-panel.js +18 -2
  159. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.d.ts +2 -0
  160. package/dist/_pkgs/affine-components/edgeless-shape-color-picker/color-picker.js +34 -5
  161. package/dist/_pkgs/affine-components/embed-card-modal/embed-card-create-modal.js +5 -4
  162. package/dist/_pkgs/affine-components/embed-card-modal/embed-card-edit-modal.js +11 -9
  163. package/dist/_pkgs/affine-components/filterable-list/index.d.ts +2 -0
  164. package/dist/_pkgs/affine-components/filterable-list/index.js +17 -2
  165. package/dist/_pkgs/affine-components/highlight-dropdown-menu/dropdown-menu.d.ts +3 -0
  166. package/dist/_pkgs/affine-components/highlight-dropdown-menu/dropdown-menu.js +40 -7
  167. package/dist/_pkgs/affine-components/icon-button/index.d.ts +1 -1
  168. package/dist/_pkgs/affine-components/icon-button/index.js +1 -1
  169. package/dist/_pkgs/affine-components/icon-picker/affine-icon-picker-panel.d.ts +6 -0
  170. package/dist/_pkgs/affine-components/icon-picker/affine-icon-picker-panel.js +42 -7
  171. package/dist/_pkgs/affine-components/icon-picker/emoji-picker-panel.d.ts +4 -0
  172. package/dist/_pkgs/affine-components/icon-picker/emoji-picker-panel.js +35 -5
  173. package/dist/_pkgs/affine-components/icon-picker/icon-picker.d.ts +2 -0
  174. package/dist/_pkgs/affine-components/icon-picker/icon-picker.js +22 -5
  175. package/dist/_pkgs/affine-components/linked-doc-title/doc-title.d.ts +2 -0
  176. package/dist/_pkgs/affine-components/linked-doc-title/doc-title.js +16 -3
  177. package/dist/_pkgs/affine-components/notification/linked-doc.js +5 -4
  178. package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.js +7 -4
  179. package/dist/_pkgs/affine-components/resource/resource.d.ts +16 -1
  180. package/dist/_pkgs/affine-components/resource/resource.js +19 -4
  181. package/dist/_pkgs/affine-components/resource/status.d.ts +2 -0
  182. package/dist/_pkgs/affine-components/resource/status.js +27 -12
  183. package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.d.ts +4 -1
  184. package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +23 -4
  185. package/dist/_pkgs/affine-components/toast/toast.d.ts +1 -1
  186. package/dist/_pkgs/affine-components/toast/toast.js +1 -1
  187. package/dist/_pkgs/affine-components/toggle-button/toggle-button.d.ts +3 -0
  188. package/dist/_pkgs/affine-components/toggle-button/toggle-button.js +18 -3
  189. package/dist/_pkgs/affine-components/toolbar/icon-button.d.ts +2 -0
  190. package/dist/_pkgs/affine-components/toolbar/icon-button.js +18 -2
  191. package/dist/_pkgs/affine-components/toolbar/tooltip.d.ts +3 -3
  192. package/dist/_pkgs/affine-components/toolbar/tooltip.js +3 -3
  193. package/dist/_pkgs/affine-components/translations.d.ts +141 -0
  194. package/dist/_pkgs/affine-components/translations.js +478 -0
  195. package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.d.ts +3 -0
  196. package/dist/_pkgs/affine-fragment-adapter-panel/adapter-panel.js +12 -1
  197. package/dist/_pkgs/affine-fragment-adapter-panel/body/adapter-panel-body.js +4 -3
  198. package/dist/_pkgs/affine-fragment-adapter-panel/config.d.ts +13 -0
  199. package/dist/_pkgs/affine-fragment-adapter-panel/config.js +18 -4
  200. package/dist/_pkgs/affine-fragment-adapter-panel/header/adapter-menu.js +2 -2
  201. package/dist/_pkgs/affine-fragment-adapter-panel/header/adapter-panel-header.js +2 -2
  202. package/dist/_pkgs/affine-fragment-adapter-panel/translations.d.ts +24 -0
  203. package/dist/_pkgs/affine-fragment-adapter-panel/translations.js +37 -0
  204. package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +1 -0
  205. package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +9 -1
  206. package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +13 -0
  207. package/dist/_pkgs/affine-fragment-doc-title/translations.js +17 -0
  208. package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +3 -2
  209. package/dist/_pkgs/affine-fragment-frame-panel/header/frame-panel-header.js +10 -4
  210. package/dist/_pkgs/affine-fragment-frame-panel/header/frames-setting-menu.js +18 -6
  211. package/dist/_pkgs/affine-fragment-frame-panel/translations.d.ts +16 -0
  212. package/dist/_pkgs/affine-fragment-frame-panel/translations.js +44 -0
  213. package/dist/_pkgs/affine-fragment-outline/body/outline-notice.js +10 -4
  214. package/dist/_pkgs/affine-fragment-outline/body/outline-panel-body.js +6 -3
  215. package/dist/_pkgs/affine-fragment-outline/card/outline-card.js +13 -6
  216. package/dist/_pkgs/affine-fragment-outline/card/outline-preview.d.ts +1 -0
  217. package/dist/_pkgs/affine-fragment-outline/card/outline-preview.js +16 -9
  218. package/dist/_pkgs/affine-fragment-outline/config.d.ts +1 -20
  219. package/dist/_pkgs/affine-fragment-outline/config.js +8 -23
  220. package/dist/_pkgs/affine-fragment-outline/header/outline-panel-header.js +10 -3
  221. package/dist/_pkgs/affine-fragment-outline/header/outline-setting-menu.js +9 -2
  222. package/dist/_pkgs/affine-fragment-outline/outline-viewer.js +6 -3
  223. package/dist/_pkgs/affine-fragment-outline/translations.d.ts +54 -0
  224. package/dist/_pkgs/affine-fragment-outline/translations.js +110 -0
  225. package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/eraser-tool-button.js +3 -2
  226. package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/consts.d.ts +3 -0
  227. package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/consts.js +3 -0
  228. package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-menu.js +5 -4
  229. package/dist/_pkgs/affine-gfx-brush/toolbar/components/pen/pen-tool-button.js +3 -2
  230. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/brush.js +4 -2
  231. package/dist/_pkgs/affine-gfx-brush/toolbar/configs/highlighter.js +4 -2
  232. package/dist/_pkgs/affine-gfx-brush/translations.d.ts +17 -0
  233. package/dist/_pkgs/affine-gfx-brush/translations.js +30 -0
  234. package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.d.ts +8 -1
  235. package/dist/_pkgs/affine-gfx-connector/direction/invert-direction.js +7 -1
  236. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +3 -2
  237. package/dist/_pkgs/affine-gfx-connector/toolbar/config.d.ts +4 -1
  238. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +24 -10
  239. package/dist/_pkgs/affine-gfx-connector/toolbar/connector-dense-menu.js +7 -5
  240. package/dist/_pkgs/affine-gfx-connector/toolbar/connector-menu.js +8 -6
  241. package/dist/_pkgs/affine-gfx-connector/toolbar/connector-tool-button.js +4 -3
  242. package/dist/_pkgs/affine-gfx-connector/translations.d.ts +32 -0
  243. package/dist/_pkgs/affine-gfx-connector/translations.js +79 -0
  244. package/dist/_pkgs/affine-gfx-group/command/group-api.js +6 -1
  245. package/dist/_pkgs/affine-gfx-group/index.d.ts +1 -0
  246. package/dist/_pkgs/affine-gfx-group/index.js +1 -0
  247. package/dist/_pkgs/affine-gfx-group/toolbar/config.d.ts +6 -2
  248. package/dist/_pkgs/affine-gfx-group/toolbar/config.js +9 -4
  249. package/dist/_pkgs/affine-gfx-group/translations.d.ts +24 -0
  250. package/dist/_pkgs/affine-gfx-group/translations.js +33 -0
  251. package/dist/_pkgs/affine-gfx-link/toolbar/undo-dense-menu.js +2 -1
  252. package/dist/_pkgs/affine-gfx-link/toolbar/undo-tool-button.js +2 -1
  253. package/dist/_pkgs/affine-gfx-mindmap/index.d.ts +1 -0
  254. package/dist/_pkgs/affine-gfx-mindmap/index.js +1 -0
  255. package/dist/_pkgs/affine-gfx-mindmap/templates/index.js +628 -577
  256. package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +7 -3
  257. package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +9 -1
  258. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-importing-placeholder.d.ts +4 -0
  259. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-importing-placeholder.js +70 -7
  260. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-menu.js +8 -5
  261. package/dist/_pkgs/affine-gfx-mindmap/toolbar/mindmap-tool-button.js +4 -2
  262. package/dist/_pkgs/affine-gfx-mindmap/toolbar/senior-tool.js +7 -2
  263. package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.d.ts +2 -1
  264. package/dist/_pkgs/affine-gfx-mindmap/toolbar/utils/import-mindmap.js +16 -8
  265. package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +84 -0
  266. package/dist/_pkgs/affine-gfx-mindmap/translations.js +171 -0
  267. package/dist/_pkgs/affine-gfx-note/components/note-display-mode-panel.d.ts +8 -0
  268. package/dist/_pkgs/affine-gfx-note/components/note-display-mode-panel.js +24 -9
  269. package/dist/_pkgs/affine-gfx-note/components/note-shadow-panel.d.ts +9 -0
  270. package/dist/_pkgs/affine-gfx-note/components/note-shadow-panel.js +28 -8
  271. package/dist/_pkgs/affine-gfx-note/toolbar/note-menu-config.d.ts +2 -1
  272. package/dist/_pkgs/affine-gfx-note/toolbar/note-menu-config.js +42 -73
  273. package/dist/_pkgs/affine-gfx-note/toolbar/note-menu.js +21 -17
  274. package/dist/_pkgs/affine-gfx-note/toolbar/note-senior-button.js +3 -2
  275. package/dist/_pkgs/affine-gfx-note/toolbar/note-tool-button.js +3 -1
  276. package/dist/_pkgs/affine-gfx-note/toolbar/senior-tool.js +3 -1
  277. package/dist/_pkgs/affine-gfx-note/translations.d.ts +27 -0
  278. package/dist/_pkgs/affine-gfx-note/translations.js +59 -0
  279. package/dist/_pkgs/affine-gfx-pointer/quick-tool/default-tool-button.js +10 -2
  280. package/dist/_pkgs/affine-gfx-pointer/translations.d.ts +9 -0
  281. package/dist/_pkgs/affine-gfx-pointer/translations.js +17 -0
  282. package/dist/_pkgs/affine-gfx-shape/components/shape-panel.d.ts +4 -0
  283. package/dist/_pkgs/affine-gfx-shape/components/shape-panel.js +17 -3
  284. package/dist/_pkgs/affine-gfx-shape/components/shape-style-panel.d.ts +4 -0
  285. package/dist/_pkgs/affine-gfx-shape/components/shape-style-panel.js +23 -5
  286. package/dist/_pkgs/affine-gfx-shape/draggable/shape-menu.d.ts +0 -1
  287. package/dist/_pkgs/affine-gfx-shape/draggable/shape-menu.js +6 -46
  288. package/dist/_pkgs/affine-gfx-shape/draggable/shape-tool-button.js +3 -1
  289. package/dist/_pkgs/affine-gfx-shape/toolbar/config.d.ts +2 -0
  290. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +29 -8
  291. package/dist/_pkgs/affine-gfx-shape/toolbar/senior-tool.js +2 -0
  292. package/dist/_pkgs/affine-gfx-shape/toolbar/shape-menu-config.d.ts +3 -0
  293. package/dist/_pkgs/affine-gfx-shape/toolbar/shape-menu-config.js +7 -0
  294. package/dist/_pkgs/affine-gfx-shape/translations.d.ts +37 -0
  295. package/dist/_pkgs/affine-gfx-shape/translations.js +93 -0
  296. package/dist/_pkgs/affine-gfx-template/builtin/other.js +70 -42
  297. package/dist/_pkgs/affine-gfx-template/contribute.js +8 -1
  298. package/dist/_pkgs/affine-gfx-template/index.d.ts +2 -0
  299. package/dist/_pkgs/affine-gfx-template/index.js +2 -0
  300. package/dist/_pkgs/affine-gfx-template/snapshot-from-action.d.ts +6 -1
  301. package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +15 -5
  302. package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +1 -0
  303. package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +12 -0
  304. package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.d.ts +25 -0
  305. package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.js +36 -0
  306. package/dist/_pkgs/affine-gfx-template/toolbar/senior-tool.js +3 -1
  307. package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.d.ts +1 -0
  308. package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +30 -8
  309. package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +41 -0
  310. package/dist/_pkgs/affine-gfx-template/translations.d.ts +71 -0
  311. package/dist/_pkgs/affine-gfx-template/translations.js +209 -0
  312. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +3 -2
  313. package/dist/_pkgs/affine-gfx-text/toolbar/actions.d.ts +1 -1
  314. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +22 -9
  315. package/dist/_pkgs/affine-gfx-text/toolbar/text-menu.js +1 -0
  316. package/dist/_pkgs/affine-gfx-text/translations.d.ts +31 -0
  317. package/dist/_pkgs/affine-gfx-text/translations.js +64 -0
  318. package/dist/_pkgs/affine-inline-footnote/footnote-node/footnote-popup.js +8 -2
  319. package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +5 -2
  320. package/dist/_pkgs/affine-inline-latex/latex-node/latex-node.js +7 -2
  321. package/dist/_pkgs/affine-inline-latex/translations.d.ts +13 -0
  322. package/dist/_pkgs/affine-inline-latex/translations.js +16 -0
  323. package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +3 -3
  324. package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -5
  325. package/dist/_pkgs/affine-inline-link/link-node/link-popup/link-popup.js +11 -5
  326. package/dist/_pkgs/affine-inline-link/translations.d.ts +23 -0
  327. package/dist/_pkgs/affine-inline-link/translations.js +44 -0
  328. package/dist/_pkgs/affine-inline-mention/affine-mention.js +11 -5
  329. package/dist/_pkgs/affine-inline-mention/translations.d.ts +16 -0
  330. package/dist/_pkgs/affine-inline-mention/translations.js +29 -0
  331. package/dist/_pkgs/affine-inline-preset/command/config.d.ts +3 -0
  332. package/dist/_pkgs/affine-inline-preset/command/config.js +8 -0
  333. package/dist/_pkgs/affine-inline-preset/translations.d.ts +25 -0
  334. package/dist/_pkgs/affine-inline-preset/translations.js +28 -0
  335. package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +2 -2
  336. package/dist/_pkgs/affine-inline-reference/reference-node/reference-node.js +3 -3
  337. package/dist/_pkgs/affine-inline-reference/reference-node/reference-popup/reference-popup.js +8 -6
  338. package/dist/_pkgs/affine-inline-reference/translations.d.ts +8 -0
  339. package/dist/_pkgs/affine-inline-reference/translations.js +13 -0
  340. package/dist/_pkgs/affine-rich-text/conversion.d.ts +13 -0
  341. package/dist/_pkgs/affine-rich-text/conversion.js +27 -0
  342. package/dist/_pkgs/affine-shared/adapters/clipboard/clipboard.js +1 -1
  343. package/dist/_pkgs/affine-shared/adapters/clipboard/utils.d.ts +2 -1
  344. package/dist/_pkgs/affine-shared/adapters/clipboard/utils.js +6 -3
  345. package/dist/_pkgs/affine-shared/adapters/markdown/markdown.js +5 -2
  346. package/dist/_pkgs/affine-shared/adapters/mix-text.js +5 -2
  347. package/dist/_pkgs/affine-shared/adapters/plain-text/plain-text.js +5 -2
  348. package/dist/_pkgs/affine-shared/adapters/utils/index.d.ts +1 -0
  349. package/dist/_pkgs/affine-shared/adapters/utils/index.js +1 -0
  350. package/dist/_pkgs/affine-shared/adapters/utils/wording.d.ts +9 -0
  351. package/dist/_pkgs/affine-shared/adapters/utils/wording.js +12 -0
  352. package/dist/_pkgs/affine-shared/services/comment-service/utils.js +2 -0
  353. package/dist/_pkgs/affine-shared/services/doc-display-meta-service.js +6 -3
  354. package/dist/_pkgs/affine-shared/services/notification-service.js +18 -1
  355. package/dist/_pkgs/affine-shared/services/open-doc-config.d.ts +0 -1
  356. package/dist/_pkgs/affine-shared/services/open-doc-config.js +0 -2
  357. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +362 -0
  358. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +955 -3
  359. package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +40 -2
  360. package/dist/_pkgs/affine-shared/services/translation-service/index.js +44 -3
  361. package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.d.ts +83 -2
  362. package/dist/_pkgs/affine-shared/services/universe-tag-defs-service.js +92 -0
  363. package/dist/_pkgs/affine-widget-drag-handle/components/edgeless-preview/preview.d.ts +4 -0
  364. package/dist/_pkgs/affine-widget-drag-handle/components/edgeless-preview/preview.js +21 -8
  365. package/dist/_pkgs/affine-widget-drag-handle/helpers/preview-helper.js +1 -0
  366. package/dist/_pkgs/affine-widget-drag-handle/translations.d.ts +14 -0
  367. package/dist/_pkgs/affine-widget-drag-handle/translations.js +35 -0
  368. package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +4 -3
  369. package/dist/_pkgs/affine-widget-edgeless-auto-connect/translations.d.ts +6 -0
  370. package/dist/_pkgs/affine-widget-edgeless-auto-connect/translations.js +14 -0
  371. package/dist/_pkgs/affine-widget-edgeless-selected-rect/auto-complete-panel.js +8 -5
  372. package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.js +3 -2
  373. package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-element-link.js +3 -1
  374. package/dist/_pkgs/affine-widget-edgeless-selected-rect/translations.d.ts +17 -0
  375. package/dist/_pkgs/affine-widget-edgeless-selected-rect/translations.js +30 -0
  376. package/dist/_pkgs/affine-widget-edgeless-toolbar/button/tool-icon-button.d.ts +4 -0
  377. package/dist/_pkgs/affine-widget-edgeless-toolbar/button/tool-icon-button.js +18 -2
  378. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/artefact-catalogue-widget.js +2 -2
  379. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/consts.d.ts +2 -0
  380. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/consts.js +3 -0
  381. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +18 -1
  382. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +8 -3
  383. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +38 -18
  384. package/dist/_pkgs/affine-widget-edgeless-toolbar/edgeless-toolbar.js +2 -1
  385. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.d.ts +8 -0
  386. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-weight-and-style-panel.js +31 -8
  387. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +15 -0
  388. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +20 -0
  389. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/translations.d.ts +7 -0
  390. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/translations.js +23 -0
  391. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/zoom-bar-toggle-button.js +3 -1
  392. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/zoom-toolbar.js +5 -3
  393. package/dist/_pkgs/affine-widget-linked-doc/config.js +15 -10
  394. package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.d.ts +12 -1
  395. package/dist/_pkgs/affine-widget-linked-doc/import-doc/import-doc.js +27 -18
  396. package/dist/_pkgs/affine-widget-linked-doc/import-doc/index.d.ts +4 -1
  397. package/dist/_pkgs/affine-widget-linked-doc/import-doc/index.js +2 -2
  398. package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +4 -1
  399. package/dist/_pkgs/affine-widget-linked-doc/mobile-linked-doc-menu.js +6 -2
  400. package/dist/_pkgs/affine-widget-linked-doc/transformers/html.js +3 -2
  401. package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +3 -2
  402. package/dist/_pkgs/affine-widget-linked-doc/translations.d.ts +53 -0
  403. package/dist/_pkgs/affine-widget-linked-doc/translations.js +104 -0
  404. package/dist/_pkgs/affine-widget-remote-selection/edgeless/index.js +4 -1
  405. package/dist/_pkgs/affine-widget-remote-selection/translations.d.ts +12 -0
  406. package/dist/_pkgs/affine-widget-remote-selection/translations.js +12 -0
  407. package/dist/_pkgs/affine-widget-slash-menu/config.js +15 -0
  408. package/dist/_pkgs/affine-widget-slash-menu/index.d.ts +1 -0
  409. package/dist/_pkgs/affine-widget-slash-menu/index.js +1 -0
  410. package/dist/_pkgs/affine-widget-slash-menu/slash-menu-popover.js +30 -15
  411. package/dist/_pkgs/affine-widget-slash-menu/tooltips/copy.js +1 -1
  412. package/dist/_pkgs/affine-widget-slash-menu/tooltips/delete.js +2 -2
  413. package/dist/_pkgs/affine-widget-slash-menu/tooltips/index.js +9 -0
  414. package/dist/_pkgs/affine-widget-slash-menu/tooltips/move-down.js +2 -2
  415. package/dist/_pkgs/affine-widget-slash-menu/tooltips/move-up.js +2 -2
  416. package/dist/_pkgs/affine-widget-slash-menu/tooltips/now.js +3 -3
  417. package/dist/_pkgs/affine-widget-slash-menu/tooltips/today.js +2 -2
  418. package/dist/_pkgs/affine-widget-slash-menu/tooltips/tomorrow.js +3 -3
  419. package/dist/_pkgs/affine-widget-slash-menu/tooltips/yesterday.js +3 -3
  420. package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +91 -0
  421. package/dist/_pkgs/affine-widget-slash-menu/translations.js +175 -0
  422. package/dist/_pkgs/affine-widget-slash-menu/types.d.ts +18 -0
  423. package/dist/_pkgs/affine-widget-slash-menu/utils.d.ts +20 -1
  424. package/dist/_pkgs/affine-widget-slash-menu/utils.js +37 -0
  425. package/dist/_pkgs/affine-widget-toolbar/translations.d.ts +9 -0
  426. package/dist/_pkgs/affine-widget-toolbar/translations.js +13 -0
  427. package/dist/_pkgs/affine-widget-toolbar/utils.js +2 -1
  428. package/dist/_pkgs/std/extension/translation-manifest.d.ts +7 -0
  429. package/dist/_pkgs/std/translations.d.ts +24 -0
  430. package/dist/_pkgs/std/translations.js +28 -0
  431. package/dist/_pkgs/std/view/element/block-component.js +24 -7
  432. package/dist/translations.js +144 -5
  433. package/package.json +1 -1
@@ -54,6 +54,7 @@ import { filter } from 'rxjs/operators';
54
54
  import { AttachmentEmbedProvider } from './embed.js';
55
55
  import { styles } from './styles.js';
56
56
  import { downloadAttachmentBlob, getFileType, refreshData } from './utils.js';
57
+ import { ATTACHMENT_BUTTON_RELOAD, ATTACHMENT_BUTTON_RETRY, ATTACHMENT_BUTTON_UPGRADE, } from './translations.js';
57
58
  let AttachmentBlockComponent = (() => {
58
59
  let _classDecorators = [Peekable({
59
60
  enableOn: ({ model }) => {
@@ -191,12 +192,16 @@ let AttachmentBlockComponent = (() => {
191
192
  }
192
193
  }}
193
194
  >
194
- ${UpgradeIcon()} Upgrade
195
+ ${UpgradeIcon()}
196
+ ${translateKey(this.std, ...ATTACHMENT_BUTTON_UPGRADE)}
195
197
  </button>
196
198
  `);
197
199
  };
198
200
  this.renderNormalButton = (needUpload) => {
199
201
  const label = needUpload ? 'retry' : 'reload';
202
+ const labelWording = needUpload
203
+ ? ATTACHMENT_BUTTON_RETRY
204
+ : ATTACHMENT_BUTTON_RELOAD;
200
205
  const run = async () => {
201
206
  if (needUpload) {
202
207
  await this.resourceController.upload();
@@ -226,7 +231,7 @@ let AttachmentBlockComponent = (() => {
226
231
  }
227
232
  }}
228
233
  >
229
- ${ResetIcon()} ${label}
234
+ ${ResetIcon()} ${translateKey(this.std, ...labelWording)}
230
235
  </button>
231
236
  `;
232
237
  };
@@ -1,8 +1,9 @@
1
1
  import { ConfirmIcon } from '../../affine-components/icons/index.js';
2
2
  import { toast } from '../../affine-components/toast/index.js';
3
- import { CitationProvider } from '../../affine-shared/services/index.js';
3
+ import { CitationProvider, translateKey } from '../../affine-shared/services/index.js';
4
4
  import { html } from 'lit';
5
5
  import { createRef, ref } from 'lit/directives/ref.js';
6
+ import { ATTACHMENT_RENAME_EMPTY_NAME } from '../translations.js';
6
7
  import { renameStyles } from './styles.js';
7
8
  export const RenameModal = ({ editorHost, model, abortController, }) => {
8
9
  const inputRef = createRef();
@@ -22,7 +23,7 @@ export const RenameModal = ({ editorHost, model, abortController, }) => {
22
23
  const onConfirm = () => {
23
24
  const newFileName = fileName + extension;
24
25
  if (!newFileName) {
25
- toast(editorHost, 'File name cannot be empty');
26
+ toast(editorHost, translateKey(editorHost.std, ...ATTACHMENT_RENAME_EMPTY_NAME));
26
27
  return;
27
28
  }
28
29
  model.store.updateBlock(model, {
@@ -1,17 +1,21 @@
1
1
  import { openSingleFileWith } from '../../affine-shared/utils/index.js';
2
2
  import {} from '../../affine-widget-slash-menu/index.js';
3
3
  import { ExportToPdfIcon, FileIcon } from '@blocksuite/icons/lit';
4
+ import { ATTACHMENT_SLASH_DESCRIPTION, ATTACHMENT_SLASH_NAME, ATTACHMENT_SLASH_PDF_DESCRIPTION, ATTACHMENT_SLASH_PDF_NAME, } from '../translations.js';
4
5
  import { addSiblingAttachmentBlocks } from '../utils.js';
5
6
  import { AttachmentTooltip, PDFTooltip } from './tooltips.js';
6
7
  export const attachmentSlashMenuConfig = {
7
8
  items: [
8
9
  {
9
10
  name: 'Attachment',
11
+ nameWording: ATTACHMENT_SLASH_NAME,
10
12
  description: 'Attach a file to document.',
13
+ descriptionWording: ATTACHMENT_SLASH_DESCRIPTION,
11
14
  icon: FileIcon(),
12
15
  tooltip: {
13
16
  figure: AttachmentTooltip,
14
17
  caption: 'Attachment',
18
+ captionWording: ATTACHMENT_SLASH_NAME,
15
19
  },
16
20
  searchAlias: ['file'],
17
21
  group: '4_Content & Media@3',
@@ -30,11 +34,14 @@ export const attachmentSlashMenuConfig = {
30
34
  },
31
35
  {
32
36
  name: 'PDF',
37
+ nameWording: ATTACHMENT_SLASH_PDF_NAME,
33
38
  description: 'Upload a PDF to document.',
39
+ descriptionWording: ATTACHMENT_SLASH_PDF_DESCRIPTION,
34
40
  icon: ExportToPdfIcon(),
35
41
  tooltip: {
36
42
  figure: PDFTooltip,
37
43
  caption: 'PDF',
44
+ captionWording: ATTACHMENT_SLASH_PDF_NAME,
38
45
  },
39
46
  group: '4_Content & Media@4',
40
47
  when: ({ model }) => model.store.schema.flavourSchemaMap.has('affine:attachment'),
@@ -1,7 +1,7 @@
1
1
  import { createLitPortal } from '../../affine-components/portal/index.js';
2
2
  import { AttachmentBlockModel, defaultAttachmentProps, } from '../../affine-model/index.js';
3
3
  import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
4
- import { ActionPlacement, blockCommentToolbarButton, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, toolbarActionLabel, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
4
+ import { ActionPlacement, blockCommentToolbarButton, TOOLBAR_CAPTION, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DOWNLOAD, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_RELOAD, TOOLBAR_RENAME, toolbarActionLabel, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
5
5
  import { getBlockProps } from '../../affine-shared/utils/index.js';
6
6
  import { Bound } from '../../global/gfx/index.js';
7
7
  import { CaptionIcon, CopyIcon, DeleteIcon, DownloadIcon, DuplicateIcon, EditIcon, ReplaceIcon, ResetIcon, } from '@blocksuite/icons/lit';
@@ -13,6 +13,7 @@ import { keyed } from 'lit/directives/keyed.js';
13
13
  import { AttachmentBlockComponent } from '../attachment-block.js';
14
14
  import { RenameModal } from '../components/rename-model.js';
15
15
  import { AttachmentEmbedProvider } from '../embed.js';
16
+ import { ATTACHMENT_TOOLBAR_HORIZONTAL_STYLE, ATTACHMENT_TOOLBAR_REPLACE, ATTACHMENT_TOOLBAR_VERTICAL_STYLE, } from '../translations.js';
16
17
  const trackBaseProps = {
17
18
  category: 'attachment',
18
19
  type: 'card view',
@@ -117,6 +118,7 @@ export const attachmentViewDropdownMenu = {
117
118
  const replaceAction = {
118
119
  id: 'c.replace',
119
120
  tooltip: 'Replace attachment',
121
+ tooltipWording: ATTACHMENT_TOOLBAR_REPLACE,
120
122
  icon: ReplaceIcon(),
121
123
  disabled(ctx) {
122
124
  const block = ctx.getCurrentBlockByType(AttachmentBlockComponent);
@@ -133,6 +135,7 @@ const replaceAction = {
133
135
  const downloadAction = {
134
136
  id: 'd.download',
135
137
  tooltip: 'Download',
138
+ tooltipWording: TOOLBAR_DOWNLOAD,
136
139
  icon: DownloadIcon(),
137
140
  run(ctx) {
138
141
  const block = ctx.getCurrentBlockByType(AttachmentBlockComponent);
@@ -149,6 +152,7 @@ const downloadAction = {
149
152
  const captionAction = {
150
153
  id: 'e.caption',
151
154
  tooltip: 'Caption',
155
+ tooltipWording: TOOLBAR_CAPTION,
152
156
  icon: CaptionIcon(),
153
157
  run(ctx) {
154
158
  const block = ctx.getCurrentBlockByType(AttachmentBlockComponent);
@@ -169,10 +173,11 @@ const builtinToolbarConfig = {
169
173
  return null;
170
174
  const abortController = new AbortController();
171
175
  abortController.signal.onabort = () => ctx.show();
176
+ const renameLabel = translateKey(ctx.std, ...TOOLBAR_RENAME);
172
177
  return html `
173
178
  <editor-icon-button
174
- aria-label="Rename"
175
- .tooltip="${'Rename'}"
179
+ aria-label=${renameLabel}
180
+ .tooltip="${renameLabel}"
176
181
  @click=${() => {
177
182
  ctx.hide();
178
183
  createLitPortal({
@@ -240,6 +245,7 @@ const builtinToolbarConfig = {
240
245
  placement: ActionPlacement.More,
241
246
  id: 'b.refresh',
242
247
  label: 'Reload',
248
+ labelWording: TOOLBAR_RELOAD,
243
249
  icon: ResetIcon(),
244
250
  run(ctx) {
245
251
  const block = ctx.getCurrentBlockByType(AttachmentBlockComponent);
@@ -278,10 +284,12 @@ const builtinSurfaceToolbarConfig = {
278
284
  {
279
285
  id: 'horizontalThin',
280
286
  label: 'Horizontal style',
287
+ labelWording: ATTACHMENT_TOOLBAR_HORIZONTAL_STYLE,
281
288
  },
282
289
  {
283
290
  id: 'cubeThick',
284
291
  label: 'Vertical style',
292
+ labelWording: ATTACHMENT_TOOLBAR_VERTICAL_STYLE,
285
293
  },
286
294
  ],
287
295
  content(ctx) {
@@ -18,9 +18,9 @@ export const AttachmentTooltip = html `<svg width="170" height="68" viewBox="0 0
18
18
  <g clip-path="url(#clip0_16460_1013)">
19
19
  <path fill-rule="evenodd" clip-rule="evenodd" d="M20.1088 36.804L17.0887 39.8241C16.1371 40.7509 16.1371 42.2492 17.0886 43.1759C18.0457 44.108 19.6014 44.108 20.5584 43.1759L23.5034 40.3144C23.6519 40.1701 23.8893 40.1735 24.0337 40.322C24.178 40.4706 24.1746 40.708 24.026 40.8523L21.0817 43.7132C21.0817 43.7133 21.0818 43.7131 21.0817 43.7132C19.8334 44.9288 17.8136 44.9289 16.5653 43.7132C15.3122 42.4926 15.3116 40.5099 16.5635 39.2886L19.5838 36.2683C20.4645 35.4105 21.8884 35.4106 22.7691 36.2683C23.6548 37.1309 23.6554 38.5332 22.771 39.3965L19.7507 42.4169C19.2376 42.9167 18.4095 42.9166 17.8964 42.4168C17.3777 41.9116 17.3777 41.0884 17.8964 40.5832L20.9956 37.5647C21.1439 37.4202 21.3813 37.4233 21.5259 37.5717C21.6704 37.7201 21.6672 37.9575 21.5189 38.102L18.4197 41.1205C18.2033 41.3312 18.2033 41.6688 18.4197 41.8796C18.6411 42.0952 19.0038 42.0957 19.2259 41.881L22.2458 38.861C22.8298 38.2923 22.8298 37.3744 22.2459 36.8056C21.6569 36.232 20.6984 36.2315 20.1088 36.804Z" fill="#77757D"/>
20
20
  </g>
21
- <text fill="#121212" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="10" font-weight="600" letter-spacing="0em"><tspan x="30" y="43.6364">Rickroll.mp3</tspan></text>
21
+ <rect x="30" y="36.1364" width="66" height="8" rx="4" fill="#121212" fill-opacity="0.3"/>
22
22
  </g>
23
- <text fill="#8E8D91" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="10" letter-spacing="0px"><tspan x="10" y="18.6364">Attach a file.</tspan></text>
23
+ <rect x="10" y="11.1364" width="77" height="8" rx="4" fill="#8E8D91" fill-opacity="0.55"/>
24
24
  </g>
25
25
  <defs>
26
26
  <filter id="filter0_d_16460_1013" x="118.277" y="34.2783" width="48.7936" height="55.3602" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
@@ -56,9 +56,9 @@ export const PDFTooltip = html `<svg width="170" height="68" viewBox="0 0 170 68
56
56
  <path d="M153.295 43.1135C152.819 42.4792 151.818 42.7394 151.708 43.5259L150.416 52.7614C150.251 53.9385 151.067 55.0268 152.239 55.1922L161.432 56.4901C162.215 56.6007 162.74 55.7051 162.264 55.0708L153.295 43.1135Z" fill="white"/>
57
57
  </g>
58
58
  <path fill-rule="evenodd" clip-rule="evenodd" d="M18 35.125C17.2406 35.125 16.625 35.7406 16.625 36.5V38C16.625 38.2071 16.7929 38.375 17 38.375C17.2071 38.375 17.375 38.2071 17.375 38V36.5C17.375 36.1548 17.6548 35.875 18 35.875H20.5H21.7609C21.9538 35.875 22.1359 35.964 22.2543 36.1163L23.4933 37.7094C23.5787 37.8191 23.625 37.9541 23.625 38.0931V40V43C23.625 43.3452 23.3452 43.625 23 43.625H18C17.6548 43.625 17.375 43.3452 17.375 43V42.25C17.375 42.0429 17.2071 41.875 17 41.875C16.7929 41.875 16.625 42.0429 16.625 42.25V43C16.625 43.7594 17.2406 44.375 18 44.375H23C23.7594 44.375 24.375 43.7594 24.375 43V40V38.0931C24.375 37.7873 24.2731 37.4903 24.0854 37.2489L22.8463 35.6558C22.5858 35.3209 22.1852 35.125 21.7609 35.125H20.5H18ZM15.3965 40.9614C15.3965 41.1694 15.5093 41.2866 15.707 41.2866C15.9048 41.2866 16.0176 41.1694 16.0176 40.9614V40.6729H16.3193C16.813 40.6729 17.1484 40.3726 17.1484 39.9067C17.1484 39.4365 16.832 39.1362 16.3618 39.1362H15.707C15.5093 39.1362 15.3965 39.2534 15.3965 39.4614V40.9614ZM16.1919 40.2144H16.0176V39.6035H16.1963C16.3984 39.6035 16.5215 39.7075 16.5215 39.9082C16.5215 40.1104 16.3984 40.2144 16.1919 40.2144ZM17.3682 40.9248C17.3682 41.1328 17.481 41.25 17.6787 41.25H18.272C18.9121 41.25 19.29 40.8545 19.29 40.1777C19.29 39.501 18.9136 39.1362 18.272 39.1362H17.6787C17.481 39.1362 17.3682 39.2534 17.3682 39.4614V40.9248ZM18.1841 40.7563H17.9893V39.6299H18.1841C18.4814 39.6299 18.6572 39.8218 18.6572 40.1777C18.6572 40.5674 18.4946 40.7563 18.1841 40.7563ZM19.5332 40.9614C19.5332 41.1694 19.646 41.2866 19.8438 41.2866C20.0415 41.2866 20.1543 41.1694 20.1543 40.9614V40.5015H20.7109C20.8691 40.5015 20.9658 40.4165 20.9658 40.2686C20.9658 40.1206 20.8662 40.0356 20.7109 40.0356H20.1543V39.6313H20.7739C20.938 39.6313 21.0479 39.542 21.0479 39.3838C21.0479 39.2256 20.9409 39.1362 20.7739 39.1362H19.8438C19.646 39.1362 19.5332 39.2534 19.5332 39.4614V40.9614Z" fill="#7A7A7A"/>
59
- <text fill="#121212" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="10" font-weight="600" letter-spacing="0em"><tspan x="30" y="43.6364">Rickroll.pdf</tspan></text>
59
+ <rect x="30" y="36.1364" width="66" height="8" rx="4" fill="#121212" fill-opacity="0.3"/>
60
60
  </g>
61
- <text fill="#8E8D91" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="10" letter-spacing="0px"><tspan x="10" y="18.6364">Upload a pdf to document.</tspan></text>
61
+ <rect x="10" y="11.1364" width="137.5" height="8" rx="4" fill="#8E8D91" fill-opacity="0.55"/>
62
62
  </g>
63
63
  <defs>
64
64
  <filter id="filter0_d_689_35293" x="118.277" y="34.2783" width="48.7936" height="55.3604" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
@@ -0,0 +1,49 @@
1
+ import { type ChromeWording } from '../affine-shared/services/index.js';
2
+ /**
3
+ * The slash-menu "Attachment" item: `nameWording` doubles as its tooltip's
4
+ * `captionWording` (`configs/slash-menu.ts`, `configs/tooltips.ts`) — the same
5
+ * word names the item and captions the illustration. Declared in `chrome.ts`
6
+ * (L7 dedupe: also shared with the outline panel's own placeholder for an
7
+ * untitled attachment) and re-exported here under this package's own name.
8
+ */
9
+ export declare const ATTACHMENT_SLASH_NAME: ChromeWording;
10
+ export declare const ATTACHMENT_SLASH_DESCRIPTION: ChromeWording;
11
+ /** The slash-menu "PDF" item, same pattern as {@link ATTACHMENT_SLASH_NAME}. */
12
+ export declare const ATTACHMENT_SLASH_PDF_NAME: ChromeWording;
13
+ export declare const ATTACHMENT_SLASH_PDF_DESCRIPTION: ChromeWording;
14
+ /** The toolbar's "Replace attachment" tooltip (`configs/toolbar.ts`). */
15
+ export declare const ATTACHMENT_TOOLBAR_REPLACE: ChromeWording;
16
+ /**
17
+ * The surface toolbar's two style labels — plain, unlike the "Large / Small"
18
+ * pairs the card-style switchers of bookmark / embed / embed-doc share
19
+ * (`TOOLBAR_LARGE_HORIZONTAL_STYLE`…): the attachment card has only the two
20
+ * cube styles, so its own words stay here rather than in `chrome.ts`.
21
+ */
22
+ export declare const ATTACHMENT_TOOLBAR_HORIZONTAL_STYLE: ChromeWording;
23
+ export declare const ATTACHMENT_TOOLBAR_VERTICAL_STYLE: ChromeWording;
24
+ /** The rename modal's empty-name toast (`components/rename-model.ts`). */
25
+ export declare const ATTACHMENT_RENAME_EMPTY_NAME: ChromeWording;
26
+ /**
27
+ * The download toasts (`utils.ts`), named with the (possibly shortened) file
28
+ * name — `{{name}}` is that name, not a count, so the host translates the
29
+ * sentence around it rather than pluralising anything.
30
+ */
31
+ export declare const ATTACHMENT_TOAST_DOWNLOADING: ChromeWording;
32
+ export declare const ATTACHMENT_TOAST_DOWNLOAD_FAILED: ChromeWording;
33
+ /**
34
+ * The resource-state buttons (`attachment-block.ts`). `label` there also
35
+ * feeds `AttachmentReloadedEvent`'s telemetry `control` field, so it stays a
36
+ * stable lowercase English identifier — only the RENDERED text goes through
37
+ * `translateKey`, via these separate wordings.
38
+ */
39
+ export declare const ATTACHMENT_BUTTON_UPGRADE: ChromeWording;
40
+ export declare const ATTACHMENT_BUTTON_RETRY: ChromeWording;
41
+ export declare const ATTACHMENT_BUTTON_RELOAD: ChromeWording;
42
+ /**
43
+ * This package's contribution to the translation-key manifest, listed in
44
+ * `PACKAGE_WORDINGS` under source `chrome`
45
+ * (`packages/affine/all/src/translations.ts`). The shared verbs it reuses
46
+ * (Caption, Download, Rename…) travel with `@labre/affine-shared/services`
47
+ * instead, so they are not restated here.
48
+ */
49
+ export declare const ATTACHMENT_WORDINGS: readonly ChromeWording[];
@@ -0,0 +1,98 @@
1
+ import { ATTACHMENT_LABEL, } from '../affine-shared/services/index.js';
2
+ /**
3
+ * The slash-menu "Attachment" item: `nameWording` doubles as its tooltip's
4
+ * `captionWording` (`configs/slash-menu.ts`, `configs/tooltips.ts`) — the same
5
+ * word names the item and captions the illustration. Declared in `chrome.ts`
6
+ * (L7 dedupe: also shared with the outline panel's own placeholder for an
7
+ * untitled attachment) and re-exported here under this package's own name.
8
+ */
9
+ export const ATTACHMENT_SLASH_NAME = ATTACHMENT_LABEL;
10
+ export const ATTACHMENT_SLASH_DESCRIPTION = [
11
+ 'com.labre.attachment.slash.description',
12
+ 'Attach a file to document.',
13
+ ];
14
+ /** The slash-menu "PDF" item, same pattern as {@link ATTACHMENT_SLASH_NAME}. */
15
+ export const ATTACHMENT_SLASH_PDF_NAME = [
16
+ 'com.labre.attachment.slash.pdf.name',
17
+ 'PDF',
18
+ ];
19
+ export const ATTACHMENT_SLASH_PDF_DESCRIPTION = [
20
+ 'com.labre.attachment.slash.pdf.description',
21
+ 'Upload a PDF to document.',
22
+ ];
23
+ /** The toolbar's "Replace attachment" tooltip (`configs/toolbar.ts`). */
24
+ export const ATTACHMENT_TOOLBAR_REPLACE = [
25
+ 'com.labre.attachment.toolbar.replace',
26
+ 'Replace attachment',
27
+ ];
28
+ /**
29
+ * The surface toolbar's two style labels — plain, unlike the "Large / Small"
30
+ * pairs the card-style switchers of bookmark / embed / embed-doc share
31
+ * (`TOOLBAR_LARGE_HORIZONTAL_STYLE`…): the attachment card has only the two
32
+ * cube styles, so its own words stay here rather than in `chrome.ts`.
33
+ */
34
+ export const ATTACHMENT_TOOLBAR_HORIZONTAL_STYLE = [
35
+ 'com.labre.attachment.toolbar.style.horizontal',
36
+ 'Horizontal style',
37
+ ];
38
+ export const ATTACHMENT_TOOLBAR_VERTICAL_STYLE = [
39
+ 'com.labre.attachment.toolbar.style.vertical',
40
+ 'Vertical style',
41
+ ];
42
+ /** The rename modal's empty-name toast (`components/rename-model.ts`). */
43
+ export const ATTACHMENT_RENAME_EMPTY_NAME = [
44
+ 'com.labre.attachment.rename.empty-name',
45
+ 'File name cannot be empty',
46
+ ];
47
+ /**
48
+ * The download toasts (`utils.ts`), named with the (possibly shortened) file
49
+ * name — `{{name}}` is that name, not a count, so the host translates the
50
+ * sentence around it rather than pluralising anything.
51
+ */
52
+ export const ATTACHMENT_TOAST_DOWNLOADING = [
53
+ 'com.labre.attachment.toast.downloading',
54
+ 'Downloading {{name}}',
55
+ ];
56
+ export const ATTACHMENT_TOAST_DOWNLOAD_FAILED = [
57
+ 'com.labre.attachment.toast.download-failed',
58
+ 'Failed to download {{name}}!',
59
+ ];
60
+ /**
61
+ * The resource-state buttons (`attachment-block.ts`). `label` there also
62
+ * feeds `AttachmentReloadedEvent`'s telemetry `control` field, so it stays a
63
+ * stable lowercase English identifier — only the RENDERED text goes through
64
+ * `translateKey`, via these separate wordings.
65
+ */
66
+ export const ATTACHMENT_BUTTON_UPGRADE = [
67
+ 'com.labre.attachment.button.upgrade',
68
+ 'Upgrade',
69
+ ];
70
+ export const ATTACHMENT_BUTTON_RETRY = [
71
+ 'com.labre.attachment.button.retry',
72
+ 'retry',
73
+ ];
74
+ export const ATTACHMENT_BUTTON_RELOAD = [
75
+ 'com.labre.attachment.button.reload',
76
+ 'reload',
77
+ ];
78
+ /**
79
+ * This package's contribution to the translation-key manifest, listed in
80
+ * `PACKAGE_WORDINGS` under source `chrome`
81
+ * (`packages/affine/all/src/translations.ts`). The shared verbs it reuses
82
+ * (Caption, Download, Rename…) travel with `@labre/affine-shared/services`
83
+ * instead, so they are not restated here.
84
+ */
85
+ export const ATTACHMENT_WORDINGS = [
86
+ ATTACHMENT_SLASH_DESCRIPTION,
87
+ ATTACHMENT_SLASH_PDF_NAME,
88
+ ATTACHMENT_SLASH_PDF_DESCRIPTION,
89
+ ATTACHMENT_TOOLBAR_REPLACE,
90
+ ATTACHMENT_TOOLBAR_HORIZONTAL_STYLE,
91
+ ATTACHMENT_TOOLBAR_VERTICAL_STYLE,
92
+ ATTACHMENT_RENAME_EMPTY_NAME,
93
+ ATTACHMENT_TOAST_DOWNLOADING,
94
+ ATTACHMENT_TOAST_DOWNLOAD_FAILED,
95
+ ATTACHMENT_BUTTON_UPGRADE,
96
+ ATTACHMENT_BUTTON_RETRY,
97
+ ATTACHMENT_BUTTON_RELOAD,
98
+ ];
@@ -1,10 +1,11 @@
1
1
  import { toast } from '../affine-components/toast/index.js';
2
2
  import { AttachmentBlockSchema, } from '../affine-model/index.js';
3
3
  import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../affine-shared/consts/index.js';
4
- import { FileSizeLimitProvider, TelemetryProvider, } from '../affine-shared/services/index.js';
4
+ import { FileSizeLimitProvider, TelemetryProvider, TOAST_DOWNLOAD_IN_PROGRESS, TOAST_UPLOAD_SIZE_LIMIT, translateKey, } from '../affine-shared/services/index.js';
5
5
  import { formatSize } from '../affine-shared/utils/index.js';
6
6
  import { Bound, Vec } from '../global/gfx/index.js';
7
7
  import { GfxControllerIdentifier } from '../std/gfx/index.js';
8
+ import { ATTACHMENT_TOAST_DOWNLOAD_FAILED, ATTACHMENT_TOAST_DOWNLOADING, } from './translations.js';
8
9
  export async function getAttachmentBlob(model) {
9
10
  const { sourceId$, type$ } = model.props;
10
11
  const sourceId = sourceId$.peek();
@@ -22,19 +23,21 @@ export async function getAttachmentBlob(model) {
22
23
  * the download process may take a long time!
23
24
  */
24
25
  export function downloadAttachmentBlob(block) {
25
- const { host, model, blobUrl, resourceController } = block;
26
+ const { host, model, blobUrl, resourceController, std } = block;
26
27
  if (resourceController.state$.peek().downloading) {
27
- toast(host, 'Download in progress...');
28
+ toast(host, translateKey(std, ...TOAST_DOWNLOAD_IN_PROGRESS));
28
29
  return;
29
30
  }
30
31
  const name = model.props.name;
31
32
  const shortName = name.length < 20 ? name : name.slice(0, 20) + '...';
32
33
  if (!blobUrl) {
33
- toast(host, `Failed to download ${shortName}!`);
34
+ toast(host, translateKey(std, ...ATTACHMENT_TOAST_DOWNLOAD_FAILED, {
35
+ name: shortName,
36
+ }));
34
37
  return;
35
38
  }
36
39
  resourceController.updateState({ downloading: true });
37
- toast(host, `Downloading ${shortName}`);
40
+ toast(host, translateKey(std, ...ATTACHMENT_TOAST_DOWNLOADING, { name: shortName }));
38
41
  const tmpLink = document.createElement('a');
39
42
  const event = new MouseEvent('click');
40
43
  tmpLink.download = name;
@@ -61,7 +64,7 @@ function hasExceeded(std, files, maxFileSize = std.get(FileSizeLimitProvider).ma
61
64
  const exceeded = files.some(file => file.size > maxFileSize);
62
65
  if (exceeded) {
63
66
  const size = formatSize(maxFileSize);
64
- toast(std.host, `You can only upload files less than ${size}`);
67
+ toast(std.host, translateKey(std, ...TOAST_UPLOAD_SIZE_LIMIT, { size: size ?? '' }));
65
68
  }
66
69
  return exceeded;
67
70
  }
@@ -35,7 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
35
35
  import { getEmbedCardIcons } from '../../affine-block-embed/index.js';
36
36
  import { LoadingIcon, WebIcon16 } from '../../affine-components/icons/index.js';
37
37
  import { ImageProxyService } from '../../affine-shared/adapters/index.js';
38
- import { ThemeProvider } from '../../affine-shared/services/index.js';
38
+ import { CHROME_LOADING, ThemeProvider, translateKey, } from '../../affine-shared/services/index.js';
39
39
  import { getHostName } from '../../affine-shared/utils/index.js';
40
40
  import { SignalWatcher, WithDisposable } from '../../global/lit/index.js';
41
41
  import { OpenInNewIcon } from '@blocksuite/icons/lit';
@@ -44,6 +44,7 @@ import { html } from 'lit';
44
44
  import { property } from 'lit/decorators.js';
45
45
  import { classMap } from 'lit/directives/class-map.js';
46
46
  import { styles } from '../styles.js';
47
+ import { BOOKMARK_ALT_BANNER, BOOKMARK_ALT_ICON, BOOKMARK_LINK_CARD_FALLBACK, BOOKMARK_RETRIEVE_FAILED, } from '../translations.js';
47
48
  let BookmarkCard = (() => {
48
49
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
49
50
  let _bookmark_decorators;
@@ -88,30 +89,36 @@ let BookmarkCard = (() => {
88
89
  'comment-highlighted': this.bookmark.isCommentHighlighted,
89
90
  });
90
91
  const domainName = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n]+)/im)?.[1];
92
+ const { std } = this.bookmark;
91
93
  const titleText = this.loading
92
- ? 'Loading...'
94
+ ? translateKey(std, ...CHROME_LOADING)
93
95
  : !title
94
96
  ? this.error
95
- ? (domainName ?? 'Link card')
97
+ ? (domainName ?? translateKey(std, ...BOOKMARK_LINK_CARD_FALLBACK))
96
98
  : ''
97
99
  : title;
98
100
  const theme = this.bookmark.std.get(ThemeProvider).theme;
99
101
  const { EmbedCardBannerIcon } = getEmbedCardIcons(theme);
100
102
  const imageProxyService = this.bookmark.store.get(ImageProxyService);
103
+ const iconAlt = translateKey(std, ...BOOKMARK_ALT_ICON);
104
+ const bannerAlt = translateKey(std, ...BOOKMARK_ALT_BANNER);
101
105
  const titleIcon = this.loading
102
106
  ? LoadingIcon()
103
107
  : icon
104
- ? html `<img src=${imageProxyService.buildUrl(icon)} alt="icon" />`
108
+ ? html `<img src=${imageProxyService.buildUrl(icon)} alt=${iconAlt} />`
105
109
  : WebIcon16;
106
110
  const descriptionText = this.loading
107
111
  ? ''
108
112
  : !description
109
113
  ? this.error
110
- ? 'Failed to retrieve link information.'
114
+ ? translateKey(std, ...BOOKMARK_RETRIEVE_FAILED)
111
115
  : url
112
116
  : (description ?? '');
113
117
  const bannerImage = !this.loading && image
114
- ? html `<img src=${imageProxyService.buildUrl(image)} alt="banner" />`
118
+ ? html `<img
119
+ src=${imageProxyService.buildUrl(image)}
120
+ alt=${bannerAlt}
121
+ />`
115
122
  : EmbedCardBannerIcon;
116
123
  return html `
117
124
  <div
@@ -1,19 +1,24 @@
1
1
  import { DefaultTool } from '../../affine-block-surface/index.js';
2
2
  import { toggleEmbedCardCreateModal } from '../../affine-components/embed-card-modal/index.js';
3
3
  import { BookmarkBlockSchema } from '../../affine-model/index.js';
4
+ import { translateKey } from '../../affine-shared/services/index.js';
4
5
  import { SlashMenuConfigIdentifier, } from '../../affine-widget-slash-menu/index.js';
5
6
  import { LinkIcon } from '@blocksuite/icons/lit';
6
7
  import { GfxControllerIdentifier } from '../../std/gfx/index.js';
8
+ import { BOOKMARK_MODAL_DESCRIPTION, BOOKMARK_MODAL_TITLE, BOOKMARK_SLASH_DESCRIPTION, BOOKMARK_SLASH_NAME, } from '../translations.js';
7
9
  import { LinkTooltip } from './tooltips.js';
8
10
  const bookmarkSlashMenuConfig = {
9
11
  items: [
10
12
  {
11
13
  name: 'Link',
14
+ nameWording: BOOKMARK_SLASH_NAME,
12
15
  description: 'Add a bookmark for reference.',
16
+ descriptionWording: BOOKMARK_SLASH_DESCRIPTION,
13
17
  icon: LinkIcon(),
14
18
  tooltip: {
15
19
  figure: LinkTooltip,
16
20
  caption: 'Link',
21
+ captionWording: BOOKMARK_SLASH_NAME,
17
22
  },
18
23
  group: '4_Content & Media@2',
19
24
  when: ({ model }) => model.store.schema.flavourSchemaMap.has('affine:bookmark'),
@@ -24,7 +29,7 @@ const bookmarkSlashMenuConfig = {
24
29
  return;
25
30
  }
26
31
  const index = parentModel.children.indexOf(model) + 1;
27
- toggleEmbedCardCreateModal(host, 'Links', 'The added link will be displayed as a card view.', { mode: 'page', parentModel, index }, ({ mode }) => {
32
+ toggleEmbedCardCreateModal(host, translateKey(std, ...BOOKMARK_MODAL_TITLE), translateKey(std, ...BOOKMARK_MODAL_DESCRIPTION), { mode: 'page', parentModel, index }, ({ mode }) => {
28
33
  if (mode === 'edgeless') {
29
34
  const gfx = std.get(GfxControllerIdentifier);
30
35
  gfx.tool.setTool(DefaultTool);
@@ -3,7 +3,7 @@ import { reassociateConnectorsCommand } from '../../affine-block-surface/index.j
3
3
  import { toast } from '../../affine-components/toast/index.js';
4
4
  import { BookmarkBlockModel, BookmarkStyles, } from '../../affine-model/index.js';
5
5
  import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
6
- import { ActionPlacement, blockCommentToolbarButton, EmbedIframeService, EmbedOptionProvider, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, toolbarActionLabel, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
6
+ import { ActionPlacement, blockCommentToolbarButton, EmbedIframeService, EmbedOptionProvider, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_CAPTION, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, TOOLBAR_LARGE_HORIZONTAL_STYLE, TOOLBAR_LARGE_VERTICAL_STYLE, TOOLBAR_RELOAD, TOOLBAR_SMALL_HORIZONTAL_STYLE, TOOLBAR_SMALL_VERTICAL_STYLE, toolbarActionLabel, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
7
7
  import { getBlockProps } from '../../affine-shared/utils/index.js';
8
8
  import { Bound } from '../../global/gfx/index.js';
9
9
  import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ResetIcon, } from '@blocksuite/icons/lit';
@@ -31,6 +31,7 @@ const previewAction = {
31
31
  const captionAction = {
32
32
  id: 'd.caption',
33
33
  tooltip: 'Caption',
34
+ tooltipWording: TOOLBAR_CAPTION,
34
35
  icon: CaptionIcon(),
35
36
  run(ctx) {
36
37
  const block = ctx.getCurrentBlockByType(BookmarkBlockComponent);
@@ -169,10 +170,12 @@ const builtinToolbarConfig = {
169
170
  {
170
171
  id: 'horizontal',
171
172
  label: 'Large horizontal style',
173
+ labelWording: TOOLBAR_LARGE_HORIZONTAL_STYLE,
172
174
  },
173
175
  {
174
176
  id: 'list',
175
177
  label: 'Small horizontal style',
178
+ labelWording: TOOLBAR_SMALL_HORIZONTAL_STYLE,
176
179
  },
177
180
  ],
178
181
  content(ctx) {
@@ -243,6 +246,7 @@ const builtinToolbarConfig = {
243
246
  placement: ActionPlacement.More,
244
247
  id: 'b.refresh',
245
248
  label: 'Reload',
249
+ labelWording: TOOLBAR_RELOAD,
246
250
  icon: ResetIcon(),
247
251
  run(ctx) {
248
252
  const block = ctx.getCurrentBlockByType(BookmarkBlockComponent);
@@ -368,18 +372,22 @@ const builtinSurfaceToolbarConfig = {
368
372
  {
369
373
  id: 'horizontal',
370
374
  label: 'Large horizontal style',
375
+ labelWording: TOOLBAR_LARGE_HORIZONTAL_STYLE,
371
376
  },
372
377
  {
373
378
  id: 'list',
374
379
  label: 'Small horizontal style',
380
+ labelWording: TOOLBAR_SMALL_HORIZONTAL_STYLE,
375
381
  },
376
382
  {
377
383
  id: 'vertical',
378
384
  label: 'Large vertical style',
385
+ labelWording: TOOLBAR_LARGE_VERTICAL_STYLE,
379
386
  },
380
387
  {
381
388
  id: 'cube',
382
389
  label: 'Small vertical style',
390
+ labelWording: TOOLBAR_SMALL_VERTICAL_STYLE,
383
391
  },
384
392
  ].filter(action => BookmarkStyles.includes(action.id)),
385
393
  content(ctx) {
@@ -6,8 +6,8 @@ export const LinkTooltip = html `<svg width="170" height="68" viewBox="0 0 170 6
6
6
  <rect width="170" height="68" rx="2" fill="white"/>
7
7
  </mask>
8
8
  <g mask="url(#mask0_16460_1007)">
9
- <text fill="#121212" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="10" letter-spacing="0px"><tspan x="8" y="15.6364">In a decentralized system, we can have a kaleidoscopic </tspan><tspan x="8" y="27.6364">complexity to our data.&#10;</tspan><tspan x="8" y="63.6364">Any user may have a different perspective on what data they </tspan><tspan x="8" y="75.6364">either have, choose to share, or accept.&#10;</tspan><tspan x="8" y="111.636">For example, one user&#x2019;s edits to a document might be on </tspan><tspan x="8" y="123.636">their laptop on an airplane; when the plane lands and the </tspan><tspan x="8" y="135.636">computer reconnects, those changes are distributed to </tspan><tspan x="8" y="147.636">other users.&#10;</tspan><tspan x="8" y="183.636">Other users might choose to accept all, some, or none of </tspan><tspan x="8" y="195.636">those changes to their version of the document.</tspan></text>
10
- <text fill="#1E67AF" xml:space="preserve" style="white-space: pre" font-family="Inter" font-size="11" letter-spacing="0em"><tspan x="8" y="45.5">Learn about AFFiNE</tspan></text>
9
+ <rect x="8" y="8.1364" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="20.1364" width="126.5" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="56.1364" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="68.1364" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="104.136" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="116.136" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="128.136" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="140.136" width="66" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="176.136" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/><rect x="8" y="188.136" width="162" height="8" rx="4" fill="#121212" fill-opacity="0.3"/>
10
+ <rect x="8" y="37.25" width="108.9" height="8.8" rx="4.4" fill="#1E67AF" fill-opacity="0.3"/>
11
11
  </g>
12
12
  </svg>
13
13
  `;
@@ -0,0 +1,26 @@
1
+ import { type ChromeWording } from '../affine-shared/services/index.js';
2
+ /**
3
+ * The slash-menu "Link" item: `nameWording` doubles as its tooltip's
4
+ * `captionWording` — the same word names the item and captions the
5
+ * illustration (`configs/slash-menu.ts`). An alias (L7 dedupe): the same word
6
+ * as {@link TOOLBAR_LINK}, one key.
7
+ */
8
+ export declare const BOOKMARK_SLASH_NAME: ChromeWording;
9
+ export declare const BOOKMARK_SLASH_DESCRIPTION: ChromeWording;
10
+ /** The create-link modal's title and body (`configs/slash-menu.ts`). */
11
+ export declare const BOOKMARK_MODAL_TITLE: ChromeWording;
12
+ export declare const BOOKMARK_MODAL_DESCRIPTION: ChromeWording;
13
+ /** The card's decorative `alt` text (`components/bookmark-card.ts`). */
14
+ export declare const BOOKMARK_ALT_ICON: ChromeWording;
15
+ export declare const BOOKMARK_ALT_BANNER: ChromeWording;
16
+ /** The card's title, once loaded, when the link preview has none. */
17
+ export declare const BOOKMARK_LINK_CARD_FALLBACK: ChromeWording;
18
+ export declare const BOOKMARK_RETRIEVE_FAILED: ChromeWording;
19
+ /**
20
+ * This package's contribution to the translation-key manifest, listed in
21
+ * `PACKAGE_WORDINGS` under source `chrome`
22
+ * (`packages/affine/all/src/translations.ts`). The shared verbs it reuses
23
+ * (Caption, Reload, the card-style switcher's four wordings…) travel with
24
+ * `@labre/affine-shared/services` instead, so they are not restated here.
25
+ */
26
+ export declare const BOOKMARK_WORDINGS: readonly ChromeWording[];