@formicoidea/labre-core 0.33.0 → 0.34.2
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/_pkgs/affine-block-attachment/attachment-block.js +2 -2
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.d.ts +2 -2
- package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +9 -7
- package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +12 -12
- package/dist/_pkgs/affine-block-code/code-block.js +2 -2
- package/dist/_pkgs/affine-block-code/code-toolbar/config.js +6 -0
- package/dist/_pkgs/affine-block-database/database-block.js +2 -2
- package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +3 -3
- package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -11
- package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -5
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +7 -7
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +12 -12
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +9 -9
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +5 -4
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +9 -9
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +2 -2
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +4 -4
- package/dist/_pkgs/affine-block-note/configs/toolbar.js +2 -2
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +6 -4
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +10 -10
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +4 -4
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +7 -7
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +8 -8
- package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +3 -1
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +15 -4
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +17 -0
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.d.ts +21 -0
- package/dist/_pkgs/affine-block-surface/extensions/spotlight.js +17 -3
- package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.d.ts +17 -0
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +66 -0
- package/dist/_pkgs/affine-block-surface/view.js +5 -0
- package/dist/_pkgs/affine-block-surface-ref/configs/toolbar.js +4 -4
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-components/icons/text.js +426 -426
- package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.d.ts +2 -0
- package/dist/_pkgs/affine-components/resource/resource.js +2 -0
- package/dist/_pkgs/affine-components/view-dropdown-menu/dropdown-menu.js +27 -14
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +4 -4
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.d.ts +4 -4
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +6 -6
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +61 -0
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +93 -0
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +9 -4
- package/dist/_pkgs/affine-model/elements/edgy/board.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/edgy/board.js +9 -4
- package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +20 -3
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +13 -4
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +9 -4
- package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +7 -2
- package/dist/_pkgs/affine-model/elements/framework-background/background.js +9 -4
- package/dist/_pkgs/affine-model/elements/framework-background/hit-test.d.ts +48 -0
- package/dist/_pkgs/affine-model/elements/framework-background/hit-test.js +55 -0
- package/dist/_pkgs/affine-model/elements/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +11 -0
- package/dist/_pkgs/affine-shared/services/edit-props-store.js +15 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.d.ts +32 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/action.js +16 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/flags.d.ts +10 -0
- package/dist/_pkgs/affine-shared/services/toolbar-service/flags.js +32 -1
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +106 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +201 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/translation-service/index.js +1 -0
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.d.ts +11 -16
- package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +11 -28
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +2 -1
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-slash-menu/config.js +2 -1
- package/dist/_pkgs/affine-widget-toolbar/toolbar.js +5 -0
- package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +19 -2
- package/dist/_pkgs/affine-widget-toolbar/utils.js +22 -7
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
- package/dist/_pkgs/std/extension/command-registry.d.ts +36 -0
- package/dist/_pkgs/std/extension/command-registry.js +16 -0
- package/dist/_pkgs/std/extension/translation-manifest.d.ts +46 -1
- package/dist/_pkgs/std/extension/translation-manifest.js +58 -0
- package/dist/_pkgs/std/gfx/highlight.d.ts +84 -0
- package/dist/_pkgs/std/gfx/highlight.js +112 -0
- package/dist/_pkgs/std/gfx/index.d.ts +1 -0
- package/dist/_pkgs/std/gfx/index.js +1 -0
- package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +17 -3
- package/dist/_pkgs/std/scope/std-scope.d.ts +2 -1
- package/dist/_pkgs/std/scope/std-scope.js +2 -0
- package/dist/_pkgs/std/utils/gfx.js +2 -0
- package/dist/shortcuts.d.ts +20 -6
- package/dist/shortcuts.js +7 -9
- package/dist/translations.js +25 -18
- package/package.json +13 -1
|
@@ -2,7 +2,7 @@ import { toast } from '../../../affine-components/toast/index.js';
|
|
|
2
2
|
import { EditorChevronDown } from '../../../affine-components/toolbar/index.js';
|
|
3
3
|
import { EmbedLinkedDocModel, EmbedLinkedDocStyles, } from '../../../affine-model/index.js';
|
|
4
4
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../../affine-shared/consts/index.js';
|
|
5
|
-
import { ActionPlacement, blockCommentToolbarButton, DocDisplayMetaProvider, EditorSettingProvider, ToolbarModuleExtension, } from '../../../affine-shared/services/index.js';
|
|
5
|
+
import { ActionPlacement, blockCommentToolbarButton, DocDisplayMetaProvider, EditorSettingProvider, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, ToolbarModuleExtension, translateKey, } from '../../../affine-shared/services/index.js';
|
|
6
6
|
import { getBlockProps, referenceToNode } from '../../../affine-shared/utils/index.js';
|
|
7
7
|
import { Bound } from '../../../global/gfx/index.js';
|
|
8
8
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ExpandFullIcon, OpenInNewIcon, } from '@blocksuite/icons/lit';
|
|
@@ -112,7 +112,7 @@ const conversionsActionGroup = {
|
|
|
112
112
|
actions: [
|
|
113
113
|
{
|
|
114
114
|
id: 'inline',
|
|
115
|
-
|
|
115
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
116
116
|
run(ctx) {
|
|
117
117
|
const block = ctx.getCurrentBlockByType(EmbedLinkedDocBlockComponent);
|
|
118
118
|
block?.convertToInline();
|
|
@@ -129,12 +129,12 @@ const conversionsActionGroup = {
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
id: 'card',
|
|
132
|
-
|
|
132
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
133
133
|
disabled: true,
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
id: 'embed',
|
|
137
|
-
|
|
137
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
138
138
|
disabled(ctx) {
|
|
139
139
|
const block = ctx.getCurrentBlockByType(EmbedLinkedDocBlockComponent);
|
|
140
140
|
if (!block)
|
|
@@ -170,7 +170,7 @@ const conversionsActionGroup = {
|
|
|
170
170
|
if (!model)
|
|
171
171
|
return null;
|
|
172
172
|
const actions = this.actions.map(action => ({ ...action }));
|
|
173
|
-
const viewType$ = signal(
|
|
173
|
+
const viewType$ = signal(translateKey(ctx.std, ...TOOLBAR_CARD_VIEW));
|
|
174
174
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
175
175
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
176
176
|
@toggle=${onToggle}
|
|
@@ -231,7 +231,7 @@ const builtinToolbarConfig = {
|
|
|
231
231
|
actions: [
|
|
232
232
|
{
|
|
233
233
|
id: 'copy',
|
|
234
|
-
|
|
234
|
+
labelWording: TOOLBAR_COPY,
|
|
235
235
|
icon: CopyIcon(),
|
|
236
236
|
run(ctx) {
|
|
237
237
|
const model = ctx.getCurrentModelByType(EmbedLinkedDocModel);
|
|
@@ -240,13 +240,13 @@ const builtinToolbarConfig = {
|
|
|
240
240
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
241
241
|
ctx.clipboard
|
|
242
242
|
.copySlice(slice)
|
|
243
|
-
.then(() => toast(ctx.host,
|
|
243
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
244
244
|
.catch(console.error);
|
|
245
245
|
},
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
248
|
id: 'duplicate',
|
|
249
|
-
|
|
249
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
250
250
|
icon: DuplicateIcon(),
|
|
251
251
|
run(ctx) {
|
|
252
252
|
const model = ctx.getCurrentModelByType(EmbedLinkedDocModel);
|
|
@@ -263,7 +263,7 @@ const builtinToolbarConfig = {
|
|
|
263
263
|
{
|
|
264
264
|
placement: ActionPlacement.More,
|
|
265
265
|
id: 'c.delete',
|
|
266
|
-
|
|
266
|
+
labelWording: TOOLBAR_DELETE,
|
|
267
267
|
icon: DeleteIcon(),
|
|
268
268
|
variant: 'destructive',
|
|
269
269
|
run(ctx) {
|
|
@@ -38,7 +38,7 @@ import { LoadingIcon } from '../../affine-components/icons/index.js';
|
|
|
38
38
|
import { isPeekable, Peekable } from '../../affine-components/peek/index.js';
|
|
39
39
|
import { RefNodeSlotsProvider } from '../../affine-inline-reference/index.js';
|
|
40
40
|
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, REFERENCE_NODE, } from '../../affine-shared/consts/index.js';
|
|
41
|
-
import { CitationProvider, DocDisplayMetaProvider, DocModeProvider, OpenDocExtensionIdentifier, ThemeProvider, whenLinkedDocContentReady, } from '../../affine-shared/services/index.js';
|
|
41
|
+
import { CitationProvider, DocDisplayMetaProvider, DocModeProvider, LINKED_DOC_DELETED, LINKED_DOC_EMPTY_PREVIEW, LINKED_DOC_FAILED, OpenDocExtensionIdentifier, ThemeProvider, translateKey, whenLinkedDocContentReady, } from '../../affine-shared/services/index.js';
|
|
42
42
|
import { cloneReferenceInfo, cloneReferenceInfoWithoutAliases, isNewTabTrigger, isNewViewTrigger, matchModels, referenceToNode, } from '../../affine-shared/utils/index.js';
|
|
43
43
|
import { Bound } from '../../global/gfx/index.js';
|
|
44
44
|
import { ResetIcon } from '@blocksuite/icons/lit';
|
|
@@ -468,13 +468,13 @@ let EmbedLinkedDocBlockComponent = (() => {
|
|
|
468
468
|
const description = this.model.props.description$;
|
|
469
469
|
const showDefaultNoteContent = isError || isLoading || isDeleted || isEmpty;
|
|
470
470
|
const defaultNoteContent = isError
|
|
471
|
-
?
|
|
471
|
+
? translateKey(this.std, ...LINKED_DOC_FAILED)
|
|
472
472
|
: isLoading
|
|
473
473
|
? ''
|
|
474
474
|
: isDeleted
|
|
475
|
-
?
|
|
475
|
+
? translateKey(this.std, ...LINKED_DOC_DELETED)
|
|
476
476
|
: isEmpty
|
|
477
|
-
?
|
|
477
|
+
? translateKey(this.std, ...LINKED_DOC_EMPTY_PREVIEW)
|
|
478
478
|
: '';
|
|
479
479
|
const dateText = this._cardStyle === 'cube'
|
|
480
480
|
? this._docUpdatedAt.toLocaleTimeString()
|
package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js
CHANGED
|
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { RENDER_CARD_THROTTLE_MS } from '../../../affine-block-embed/index.js';
|
|
36
36
|
import { LoadingIcon } from '../../../affine-components/icons/index.js';
|
|
37
|
-
import { ThemeProvider, whenLinkedDocContentReady, } from '../../../affine-shared/services/index.js';
|
|
37
|
+
import { LINKED_DOC_DELETED, LINKED_DOC_FAILED, SYNCED_DOC_EMPTY_PREVIEW, ThemeProvider, translateKey, whenLinkedDocContentReady, } from '../../../affine-shared/services/index.js';
|
|
38
38
|
import { WithDisposable } from '../../../global/lit/index.js';
|
|
39
39
|
import { ResetIcon } from '@blocksuite/icons/lit';
|
|
40
40
|
import { BlockSelection, isGfxBlockComponent, ShadowlessElement, } from '../../../std/index.js';
|
|
@@ -184,14 +184,15 @@ let EmbedSyncedDocCard = (() => {
|
|
|
184
184
|
: this.block.icon$.value;
|
|
185
185
|
const title = isLoading ? 'Loading...' : this.block.title$;
|
|
186
186
|
const showDefaultNoteContent = isLoading || error || isDeleted || isEmpty;
|
|
187
|
+
const std = this.block.std;
|
|
187
188
|
const defaultNoteContent = error
|
|
188
|
-
?
|
|
189
|
+
? translateKey(std, ...LINKED_DOC_FAILED)
|
|
189
190
|
: isLoading
|
|
190
191
|
? ''
|
|
191
192
|
: isDeleted
|
|
192
|
-
?
|
|
193
|
+
? translateKey(std, ...LINKED_DOC_DELETED)
|
|
193
194
|
: isEmpty
|
|
194
|
-
?
|
|
195
|
+
? translateKey(std, ...SYNCED_DOC_EMPTY_PREVIEW)
|
|
195
196
|
: '';
|
|
196
197
|
const dateText = this.block.docUpdatedAt.toLocaleString();
|
|
197
198
|
const showDefaultBanner = isLoading || error || isDeleted || isEmpty;
|
|
@@ -3,7 +3,7 @@ import { EditorChevronDown } from '../../../affine-components/toolbar/index.js';
|
|
|
3
3
|
import { DEFAULT_NOTE_HEIGHT, DEFAULT_NOTE_WIDTH, EmbedSyncedDocModel, NoteBlockModel, NoteDisplayMode, } from '../../../affine-model/index.js';
|
|
4
4
|
import { draftSelectedModelsCommand, duplicateSelectedModelsCommand, } from '../../../affine-shared/commands/index.js';
|
|
5
5
|
import { REFERENCE_NODE } from '../../../affine-shared/consts/index.js';
|
|
6
|
-
import { ActionPlacement, blockCommentToolbarButton, EditorSettingProvider, ToolbarModuleExtension, } from '../../../affine-shared/services/index.js';
|
|
6
|
+
import { ActionPlacement, blockCommentToolbarButton, EditorSettingProvider, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_CARD_VIEW, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_EMBED_VIEW, TOOLBAR_INLINE_VIEW, ToolbarModuleExtension, translateKey, } from '../../../affine-shared/services/index.js';
|
|
7
7
|
import { getBlockProps, matchModels } from '../../../affine-shared/utils/index.js';
|
|
8
8
|
import { Bound } from '../../../global/gfx/index.js';
|
|
9
9
|
import { CaptionIcon, CopyIcon, DeleteIcon, DuplicateIcon, ExpandFullIcon, InsertIntoPageIcon, OpenInNewIcon, } from '@blocksuite/icons/lit';
|
|
@@ -82,7 +82,7 @@ const conversionsActionGroup = {
|
|
|
82
82
|
actions: [
|
|
83
83
|
{
|
|
84
84
|
id: 'inline',
|
|
85
|
-
|
|
85
|
+
labelWording: TOOLBAR_INLINE_VIEW,
|
|
86
86
|
run(ctx) {
|
|
87
87
|
const block = ctx.getCurrentBlockByType(EmbedSyncedDocBlockComponent);
|
|
88
88
|
block?.convertToInline();
|
|
@@ -99,7 +99,7 @@ const conversionsActionGroup = {
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
id: 'card',
|
|
102
|
-
|
|
102
|
+
labelWording: TOOLBAR_CARD_VIEW,
|
|
103
103
|
run(ctx) {
|
|
104
104
|
const block = ctx.getCurrentBlockByType(EmbedSyncedDocBlockComponent);
|
|
105
105
|
if (isGfxBlockComponent(block)) {
|
|
@@ -116,7 +116,7 @@ const conversionsActionGroup = {
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
id: 'embed',
|
|
119
|
-
|
|
119
|
+
labelWording: TOOLBAR_EMBED_VIEW,
|
|
120
120
|
disabled: true,
|
|
121
121
|
},
|
|
122
122
|
],
|
|
@@ -125,7 +125,7 @@ const conversionsActionGroup = {
|
|
|
125
125
|
if (!model)
|
|
126
126
|
return null;
|
|
127
127
|
const actions = this.actions.map(action => ({ ...action }));
|
|
128
|
-
const viewType$ = signal(
|
|
128
|
+
const viewType$ = signal(translateKey(ctx.std, ...TOOLBAR_EMBED_VIEW));
|
|
129
129
|
const onToggle = createOnToggleFn(ctx, 'OpenedViewSelector', 'switch view');
|
|
130
130
|
return html `${keyed(model, html `<affine-view-dropdown-menu
|
|
131
131
|
@toggle=${onToggle}
|
|
@@ -163,7 +163,7 @@ const builtinToolbarConfig = {
|
|
|
163
163
|
actions: [
|
|
164
164
|
{
|
|
165
165
|
id: 'copy',
|
|
166
|
-
|
|
166
|
+
labelWording: TOOLBAR_COPY,
|
|
167
167
|
icon: CopyIcon(),
|
|
168
168
|
run(ctx) {
|
|
169
169
|
const model = ctx.getCurrentModelByType(EmbedSyncedDocModel);
|
|
@@ -172,13 +172,13 @@ const builtinToolbarConfig = {
|
|
|
172
172
|
const slice = Slice.fromModels(ctx.store, [model]);
|
|
173
173
|
ctx.clipboard
|
|
174
174
|
.copySlice(slice)
|
|
175
|
-
.then(() => toast(ctx.host,
|
|
175
|
+
.then(() => toast(ctx.host, translateKey(ctx.std, ...TOAST_COPIED_TO_CLIPBOARD)))
|
|
176
176
|
.catch(console.error);
|
|
177
177
|
},
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
id: 'duplicate',
|
|
181
|
-
|
|
181
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
182
182
|
icon: DuplicateIcon(),
|
|
183
183
|
run(ctx) {
|
|
184
184
|
const model = ctx.getCurrentModelByType(EmbedSyncedDocModel);
|
|
@@ -195,7 +195,7 @@ const builtinToolbarConfig = {
|
|
|
195
195
|
{
|
|
196
196
|
placement: ActionPlacement.More,
|
|
197
197
|
id: 'c.delete',
|
|
198
|
-
|
|
198
|
+
labelWording: TOOLBAR_DELETE,
|
|
199
199
|
icon: DeleteIcon(),
|
|
200
200
|
variant: 'destructive',
|
|
201
201
|
run(ctx) {
|
|
@@ -2,7 +2,7 @@ import { EdgelessCRUDIdentifier } from '../affine-block-surface/index.js';
|
|
|
2
2
|
import { packColor, } from '../affine-components/color-picker/index.js';
|
|
3
3
|
import { toast } from '../affine-components/toast/index.js';
|
|
4
4
|
import { DEFAULT_NOTE_HEIGHT, DefaultTheme, FrameBlockModel, FrameBlockSchema, NoteBlockModel, NoteBlockSchema, NoteDisplayMode, resolveColor, SurfaceRefBlockSchema, } from '../affine-model/index.js';
|
|
5
|
-
import { NotificationProvider, ToolbarModuleExtension, } from '../affine-shared/services/index.js';
|
|
5
|
+
import { NotificationProvider, TOAST_FRAME_INSERTED_INTO_PAGE, ToolbarModuleExtension, translateKey, } from '../affine-shared/services/index.js';
|
|
6
6
|
import { getMostCommonResolvedValue, matchModels, } from '../affine-shared/utils/index.js';
|
|
7
7
|
import { mountFrameTitleEditor } from '../affine-widget-frame-title/index.js';
|
|
8
8
|
import { Bound } from '../global/gfx/index.js';
|
|
@@ -46,7 +46,7 @@ const builtinSurfaceToolbarConfig = {
|
|
|
46
46
|
const notification = ctx.std.getOptional(NotificationProvider);
|
|
47
47
|
if (notification) {
|
|
48
48
|
notification.notifyWithUndoAction({
|
|
49
|
-
title:
|
|
49
|
+
title: translateKey(ctx.std, ...TOAST_FRAME_INSERTED_INTO_PAGE),
|
|
50
50
|
message: 'Frame has been inserted into doc',
|
|
51
51
|
accent: 'success',
|
|
52
52
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageBlockModel } from '../../affine-model/index.js';
|
|
2
|
-
import { ActionPlacement, blockCommentToolbarButton, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
2
|
+
import { ActionPlacement, blockCommentToolbarButton, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
3
3
|
import { BookmarkIcon, CaptionIcon, CopyIcon, DeleteIcon, DownloadIcon, DuplicateIcon, } from '@blocksuite/icons/lit';
|
|
4
4
|
import { BlockFlavourIdentifier } from '../../std/index.js';
|
|
5
5
|
import { ImageBlockComponent } from '../image-block.js';
|
|
@@ -43,7 +43,7 @@ const builtinToolbarConfig = {
|
|
|
43
43
|
actions: [
|
|
44
44
|
{
|
|
45
45
|
id: 'a.copy',
|
|
46
|
-
|
|
46
|
+
labelWording: TOOLBAR_COPY,
|
|
47
47
|
icon: CopyIcon(),
|
|
48
48
|
run(ctx) {
|
|
49
49
|
const block = ctx.getCurrentBlockByType(ImageBlockComponent);
|
|
@@ -52,7 +52,7 @@ const builtinToolbarConfig = {
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: 'b.duplicate',
|
|
55
|
-
|
|
55
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
56
56
|
icon: DuplicateIcon(),
|
|
57
57
|
run(ctx) {
|
|
58
58
|
const block = ctx.getCurrentBlockByType(ImageBlockComponent);
|
|
@@ -88,7 +88,7 @@ const builtinToolbarConfig = {
|
|
|
88
88
|
{
|
|
89
89
|
placement: ActionPlacement.More,
|
|
90
90
|
id: 'c.delete',
|
|
91
|
-
|
|
91
|
+
labelWording: TOOLBAR_DELETE,
|
|
92
92
|
icon: DeleteIcon(),
|
|
93
93
|
variant: 'destructive',
|
|
94
94
|
run(ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EdgelessLegacySlotIdentifier } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { NoteBlockModel, NoteDisplayMode } from '../../affine-model/index.js';
|
|
3
|
-
import { NotificationProvider, SidebarExtensionIdentifier, ToolbarModuleExtension, } from '../../affine-shared/services/index.js';
|
|
3
|
+
import { NotificationProvider, SidebarExtensionIdentifier, TOAST_NOTE_REMOVED_FROM_PAGE, ToolbarModuleExtension, translateKey, } from '../../affine-shared/services/index.js';
|
|
4
4
|
import { Bound } from '../../global/gfx/index.js';
|
|
5
5
|
import { AutoHeightIcon, CustomizedHeightIcon, InsertIntoPageIcon, ScissorsIcon, } from '@blocksuite/icons/lit';
|
|
6
6
|
import { BlockFlavourIdentifier } from '../../std/index.js';
|
|
@@ -244,7 +244,7 @@ function setDisplayMode(ctx, model, newMode) {
|
|
|
244
244
|
}
|
|
245
245
|
const data = newMode === NoteDisplayMode.EdgelessOnly
|
|
246
246
|
? {
|
|
247
|
-
title:
|
|
247
|
+
title: translateKey(ctx.std, ...TOAST_NOTE_REMOVED_FROM_PAGE),
|
|
248
248
|
message: 'Content removed from your page.',
|
|
249
249
|
}
|
|
250
250
|
: {
|
|
@@ -45,7 +45,9 @@ export declare const builtinToolbarConfig: {
|
|
|
45
45
|
readonly score?: number;
|
|
46
46
|
readonly when?: ((cx: import("../../affine-shared/services/index.js").ToolbarContext) => boolean) | boolean;
|
|
47
47
|
readonly priority?: number;
|
|
48
|
+
readonly labelWording?: import("../../affine-shared/services/index.js").ChromeWording;
|
|
48
49
|
readonly showLabel?: boolean;
|
|
50
|
+
readonly tooltipWording?: import("../../affine-shared/services/index.js").ChromeWording;
|
|
49
51
|
readonly run?: (cx: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
50
52
|
readonly id: "g.comment";
|
|
51
53
|
}, {
|
|
@@ -53,12 +55,12 @@ export declare const builtinToolbarConfig: {
|
|
|
53
55
|
readonly id: "a.clipboard";
|
|
54
56
|
readonly actions: [{
|
|
55
57
|
readonly id: "copy";
|
|
56
|
-
readonly
|
|
58
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
57
59
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
58
|
-
readonly run: ({ chain, host }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
60
|
+
readonly run: ({ chain, host, std }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
59
61
|
}, {
|
|
60
62
|
readonly id: "duplicate";
|
|
61
|
-
readonly
|
|
63
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
62
64
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
63
65
|
readonly run: ({ chain, store, selection }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
64
66
|
}];
|
|
@@ -68,7 +70,7 @@ export declare const builtinToolbarConfig: {
|
|
|
68
70
|
readonly id: "c.delete";
|
|
69
71
|
readonly actions: [{
|
|
70
72
|
readonly id: "delete";
|
|
71
|
-
readonly
|
|
73
|
+
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
72
74
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
73
75
|
readonly variant: "destructive";
|
|
74
76
|
readonly run: ({ chain }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
@@ -7,7 +7,7 @@ import { deleteTextCommand, formatBlockCommand, formatNativeCommand, formatTextC
|
|
|
7
7
|
import { EmbedLinkedDocBlockSchema, EmbedSyncedDocBlockSchema, } from '../../affine-model/index.js';
|
|
8
8
|
import { textConversionConfigs } from '../../affine-rich-text/index.js';
|
|
9
9
|
import { copySelectedModelsCommand, deleteSelectedModelsCommand, draftSelectedModelsCommand, duplicateSelectedModelsCommand, getBlockSelectionsCommand, getImageSelectionsCommand, getSelectedBlocksCommand, getSelectedModelsCommand, getTextSelectionCommand, } from '../../affine-shared/commands/index.js';
|
|
10
|
-
import { ActionPlacement, blockCommentToolbarButton, } from '../../affine-shared/services/index.js';
|
|
10
|
+
import { ActionPlacement, blockCommentToolbarButton, TOAST_COPIED_TO_CLIPBOARD, TOOLBAR_COPY, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, translateKey, } from '../../affine-shared/services/index.js';
|
|
11
11
|
import { tableViewMeta } from '../../data-view/view-presets/index.js';
|
|
12
12
|
import { CopyIcon, DatabaseTableViewIcon, DeleteIcon, DuplicateIcon, LinkedPageIcon, } from '@blocksuite/icons/lit';
|
|
13
13
|
import { BlockSelection, BlockViewIdentifier, } from '../../std/index.js';
|
|
@@ -220,9 +220,9 @@ export const builtinToolbarConfig = {
|
|
|
220
220
|
actions: [
|
|
221
221
|
{
|
|
222
222
|
id: 'copy',
|
|
223
|
-
|
|
223
|
+
labelWording: TOOLBAR_COPY,
|
|
224
224
|
icon: CopyIcon(),
|
|
225
|
-
run({ chain, host }) {
|
|
225
|
+
run({ chain, host, std }) {
|
|
226
226
|
const [ok] = chain
|
|
227
227
|
.pipe(getSelectedModelsCommand)
|
|
228
228
|
.pipe(draftSelectedModelsCommand)
|
|
@@ -230,12 +230,12 @@ export const builtinToolbarConfig = {
|
|
|
230
230
|
.run();
|
|
231
231
|
if (!ok)
|
|
232
232
|
return;
|
|
233
|
-
toast(host,
|
|
233
|
+
toast(host, translateKey(std, ...TOAST_COPIED_TO_CLIPBOARD));
|
|
234
234
|
},
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
id: 'duplicate',
|
|
238
|
-
|
|
238
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
239
239
|
icon: DuplicateIcon(),
|
|
240
240
|
run({ chain, store, selection }) {
|
|
241
241
|
store.captureSync();
|
|
@@ -272,7 +272,7 @@ export const builtinToolbarConfig = {
|
|
|
272
272
|
actions: [
|
|
273
273
|
{
|
|
274
274
|
id: 'delete',
|
|
275
|
-
|
|
275
|
+
labelWording: TOOLBAR_DELETE,
|
|
276
276
|
icon: DeleteIcon(),
|
|
277
277
|
variant: 'destructive',
|
|
278
278
|
run({ chain }) {
|
|
@@ -33,15 +33,15 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
33
33
|
}, {
|
|
34
34
|
placement: ActionPlacement.End;
|
|
35
35
|
id: string;
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
37
|
+
tooltipWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
38
38
|
icon: import("lit-html").TemplateResult<1>;
|
|
39
39
|
when(ctx: ToolbarContext): boolean;
|
|
40
40
|
content(ctx: ToolbarContext): import("lit-html").TemplateResult<1> | null;
|
|
41
41
|
}, {
|
|
42
42
|
readonly placement: ActionPlacement.End;
|
|
43
43
|
readonly id: "b.lock";
|
|
44
|
-
readonly
|
|
44
|
+
readonly tooltipWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
45
45
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
46
46
|
readonly run: (ctx: ToolbarContext) => void;
|
|
47
47
|
}, ...({
|
|
@@ -64,7 +64,7 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
64
64
|
id: "Z.b.reordering";
|
|
65
65
|
actions: [{
|
|
66
66
|
readonly id: "a.bring-to-front";
|
|
67
|
-
readonly
|
|
67
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
68
68
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
69
69
|
readonly run: (ctx: ToolbarContext) => void;
|
|
70
70
|
}, {
|
|
@@ -79,7 +79,7 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
79
79
|
readonly run: (ctx: ToolbarContext) => void;
|
|
80
80
|
}, {
|
|
81
81
|
readonly id: "c.send-to-back";
|
|
82
|
-
readonly
|
|
82
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
83
83
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
84
84
|
readonly run: (ctx: ToolbarContext) => void;
|
|
85
85
|
}];
|
|
@@ -88,12 +88,12 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
88
88
|
id: "a.clipboard";
|
|
89
89
|
actions: [{
|
|
90
90
|
readonly id: "copy";
|
|
91
|
-
readonly
|
|
91
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
92
92
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
93
93
|
readonly run: (ctx: ToolbarContext) => void;
|
|
94
94
|
}, {
|
|
95
95
|
readonly id: "duplicate";
|
|
96
|
-
readonly
|
|
96
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
97
97
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
98
98
|
readonly run: (ctx: ToolbarContext) => void;
|
|
99
99
|
}, {
|
|
@@ -114,13 +114,13 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
114
114
|
readonly run: (ctx: ToolbarContext) => void;
|
|
115
115
|
}, {
|
|
116
116
|
readonly id: "b.create-linked-doc";
|
|
117
|
-
readonly
|
|
117
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
118
118
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
119
119
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
120
120
|
readonly run: (ctx: ToolbarContext) => void;
|
|
121
121
|
}, {
|
|
122
122
|
readonly id: "c.link-element";
|
|
123
|
-
readonly
|
|
123
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
124
124
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
125
125
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
126
126
|
readonly run: (ctx: ToolbarContext) => void;
|
|
@@ -140,7 +140,7 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
140
140
|
} | {
|
|
141
141
|
placement: ActionPlacement;
|
|
142
142
|
id: "e.delete";
|
|
143
|
-
|
|
143
|
+
labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
144
144
|
icon: import("lit-html").TemplateResult<1>;
|
|
145
145
|
variant: "destructive";
|
|
146
146
|
run: (ctx: ToolbarContext) => void;
|
|
@@ -3,7 +3,7 @@ import { EdgelessCRUDIdentifier, getSurfaceComponent, } from '../../../../affine
|
|
|
3
3
|
import { ConnectorTool } from '../../../../affine-gfx-connector/index.js';
|
|
4
4
|
import { createGroupCommand, createGroupFromSelectedCommand, ungroupCommand, } from '../../../../affine-gfx-group/index.js';
|
|
5
5
|
import { ConnectorElementModel, DEFAULT_CONNECTOR_MODE, GroupElementModel, MindmapElementModel, } from '../../../../affine-model/index.js';
|
|
6
|
-
import { ActionPlacement, } from '../../../../affine-shared/services/index.js';
|
|
6
|
+
import { ActionPlacement, TOOLBAR_DRAW_CONNECTOR, TOOLBAR_LOCK, } from '../../../../affine-shared/services/index.js';
|
|
7
7
|
import { Bound } from '../../../../global/gfx/index.js';
|
|
8
8
|
import { AlignLeftIcon, ConnectorCIcon, FrameIcon, GroupingIcon, LockIcon, ReleaseFromGroupIcon, UnlockIcon, } from '@blocksuite/icons/lit';
|
|
9
9
|
import { html } from 'lit';
|
|
@@ -135,8 +135,8 @@ export const builtinMiscToolbarConfig = {
|
|
|
135
135
|
{
|
|
136
136
|
placement: ActionPlacement.End,
|
|
137
137
|
id: 'a.draw-connector',
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
labelWording: TOOLBAR_DRAW_CONNECTOR,
|
|
139
|
+
tooltipWording: TOOLBAR_DRAW_CONNECTOR,
|
|
140
140
|
icon: ConnectorCIcon(),
|
|
141
141
|
when(ctx) {
|
|
142
142
|
const models = ctx.getSurfaceModels();
|
|
@@ -173,7 +173,7 @@ export const builtinMiscToolbarConfig = {
|
|
|
173
173
|
{
|
|
174
174
|
placement: ActionPlacement.End,
|
|
175
175
|
id: 'b.lock',
|
|
176
|
-
|
|
176
|
+
tooltipWording: TOOLBAR_LOCK,
|
|
177
177
|
icon: LockIcon(),
|
|
178
178
|
run(ctx) {
|
|
179
179
|
const models = ctx.getSurfaceModels();
|
|
@@ -17,7 +17,7 @@ export declare const moreActions: [{
|
|
|
17
17
|
readonly id: "Z.b.reordering";
|
|
18
18
|
readonly actions: [{
|
|
19
19
|
readonly id: "a.bring-to-front";
|
|
20
|
-
readonly
|
|
20
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
21
21
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
22
22
|
readonly run: (ctx: ToolbarContext) => void;
|
|
23
23
|
}, {
|
|
@@ -32,7 +32,7 @@ export declare const moreActions: [{
|
|
|
32
32
|
readonly run: (ctx: ToolbarContext) => void;
|
|
33
33
|
}, {
|
|
34
34
|
readonly id: "c.send-to-back";
|
|
35
|
-
readonly
|
|
35
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
36
36
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
37
37
|
readonly run: (ctx: ToolbarContext) => void;
|
|
38
38
|
}];
|
|
@@ -40,12 +40,12 @@ export declare const moreActions: [{
|
|
|
40
40
|
readonly id: "a.clipboard";
|
|
41
41
|
readonly actions: [{
|
|
42
42
|
readonly id: "copy";
|
|
43
|
-
readonly
|
|
43
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
44
44
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
45
45
|
readonly run: (ctx: ToolbarContext) => void;
|
|
46
46
|
}, {
|
|
47
47
|
readonly id: "duplicate";
|
|
48
|
-
readonly
|
|
48
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
49
49
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
50
50
|
readonly run: (ctx: ToolbarContext) => void;
|
|
51
51
|
}, {
|
|
@@ -65,13 +65,13 @@ export declare const moreActions: [{
|
|
|
65
65
|
readonly run: (ctx: ToolbarContext) => void;
|
|
66
66
|
}, {
|
|
67
67
|
readonly id: "b.create-linked-doc";
|
|
68
|
-
readonly
|
|
68
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
69
69
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
70
70
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
71
71
|
readonly run: (ctx: ToolbarContext) => void;
|
|
72
72
|
}, {
|
|
73
73
|
readonly id: "c.link-element";
|
|
74
|
-
readonly
|
|
74
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
75
75
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
76
76
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
77
77
|
readonly run: (ctx: ToolbarContext) => void;
|
|
@@ -90,7 +90,7 @@ export declare const moreActions: [{
|
|
|
90
90
|
}];
|
|
91
91
|
}, {
|
|
92
92
|
readonly id: "e.delete";
|
|
93
|
-
readonly
|
|
93
|
+
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
94
94
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
95
95
|
readonly variant: "destructive";
|
|
96
96
|
readonly run: (ctx: ToolbarContext) => void;
|
|
@@ -6,7 +6,7 @@ import { ImageBlockComponent } from '../../../../affine-block-image/index.js';
|
|
|
6
6
|
import { EdgelessCRUDIdentifier, getSurfaceComponent, } from '../../../../affine-block-surface/index.js';
|
|
7
7
|
import { createGroupFromSelectedCommand } from '../../../../affine-gfx-group/index.js';
|
|
8
8
|
import { AttachmentBlockModel, BookmarkBlockModel, EmbedLinkedDocBlockSchema, EmbedLinkedDocModel, EmbedSyncedDocBlockSchema, EmbedSyncedDocModel, FrameBlockModel, ImageBlockModel, isExternalEmbedModel, MindmapElementModel, NoteBlockModel, ParagraphBlockModel, } from '../../../../affine-model/index.js';
|
|
9
|
-
import { QuickSearchProvider } from '../../../../affine-shared/services/index.js';
|
|
9
|
+
import { QuickSearchProvider, TOOLBAR_BRING_TO_FRONT, TOOLBAR_COPY, TOOLBAR_CREATE_LINKED_DOC, TOOLBAR_DELETE, TOOLBAR_DUPLICATE, TOOLBAR_LINK, TOOLBAR_SEND_TO_BACK, } from '../../../../affine-shared/services/index.js';
|
|
10
10
|
import { matchModels } from '../../../../affine-shared/utils/index.js';
|
|
11
11
|
import { Bound, getCommonBoundWithRotation } from '../../../../global/gfx/index.js';
|
|
12
12
|
import { ArrowDownBigBottomIcon, ArrowDownBigIcon, ArrowUpBigIcon, ArrowUpBigTopIcon, CopyIcon, DeleteIcon, DuplicateIcon, FrameIcon, GroupIcon, LinkIcon, LinkedPageIcon, ResetIcon, UnlinkIcon, } from '@blocksuite/icons/lit';
|
|
@@ -65,7 +65,7 @@ export const moreActions = [
|
|
|
65
65
|
actions: [
|
|
66
66
|
{
|
|
67
67
|
id: 'a.bring-to-front',
|
|
68
|
-
|
|
68
|
+
labelWording: TOOLBAR_BRING_TO_FRONT,
|
|
69
69
|
icon: ArrowUpBigTopIcon(),
|
|
70
70
|
run(ctx) {
|
|
71
71
|
const models = ctx.getSurfaceModels();
|
|
@@ -92,7 +92,7 @@ export const moreActions = [
|
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
id: 'c.send-to-back',
|
|
95
|
-
|
|
95
|
+
labelWording: TOOLBAR_SEND_TO_BACK,
|
|
96
96
|
icon: ArrowDownBigBottomIcon(),
|
|
97
97
|
run(ctx) {
|
|
98
98
|
const models = ctx.getSurfaceModels();
|
|
@@ -108,7 +108,7 @@ export const moreActions = [
|
|
|
108
108
|
actions: [
|
|
109
109
|
{
|
|
110
110
|
id: 'copy',
|
|
111
|
-
|
|
111
|
+
labelWording: TOOLBAR_COPY,
|
|
112
112
|
icon: CopyIcon(),
|
|
113
113
|
run(ctx) {
|
|
114
114
|
const models = ctx.getSurfaceModels();
|
|
@@ -122,7 +122,7 @@ export const moreActions = [
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
id: 'duplicate',
|
|
125
|
-
|
|
125
|
+
labelWording: TOOLBAR_DUPLICATE,
|
|
126
126
|
icon: DuplicateIcon(),
|
|
127
127
|
run(ctx) {
|
|
128
128
|
const models = ctx.getSurfaceModels();
|
|
@@ -234,7 +234,7 @@ export const moreActions = [
|
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
id: 'b.create-linked-doc',
|
|
237
|
-
|
|
237
|
+
labelWording: TOOLBAR_CREATE_LINKED_DOC,
|
|
238
238
|
icon: LinkedPageIcon(),
|
|
239
239
|
when(ctx) {
|
|
240
240
|
const models = ctx.getSurfaceModels();
|
|
@@ -303,7 +303,7 @@ export const moreActions = [
|
|
|
303
303
|
id: 'c.link-element',
|
|
304
304
|
// Attach a link (existing doc or external URL) to a single drawing
|
|
305
305
|
// element. A hover arrow (edgeless-element-link widget) opens it.
|
|
306
|
-
|
|
306
|
+
labelWording: TOOLBAR_LINK,
|
|
307
307
|
icon: LinkIcon(),
|
|
308
308
|
when(ctx) {
|
|
309
309
|
const el = getLinkableElement(ctx);
|
|
@@ -352,7 +352,7 @@ export const moreActions = [
|
|
|
352
352
|
// Deleting Group
|
|
353
353
|
{
|
|
354
354
|
id: 'e.delete',
|
|
355
|
-
|
|
355
|
+
labelWording: TOOLBAR_DELETE,
|
|
356
356
|
icon: DeleteIcon(),
|
|
357
357
|
variant: 'destructive',
|
|
358
358
|
run(ctx) {
|
|
@@ -258,7 +258,9 @@ let EdgelessRootBlockComponent = (() => {
|
|
|
258
258
|
};
|
|
259
259
|
run();
|
|
260
260
|
this._disposables.add(() => {
|
|
261
|
-
|
|
261
|
+
// `saveViewport` skips read-only mounts: a preview of this doc (an
|
|
262
|
+
// embedded mini map) must not overwrite the viewport of the full editor.
|
|
263
|
+
std.get(EditPropsStore).saveViewport({
|
|
262
264
|
centerX: gfx.viewport.centerX,
|
|
263
265
|
centerY: gfx.viewport.centerY,
|
|
264
266
|
zoom: gfx.viewport.zoom,
|