@formicoidea/labre-core 0.47.0 → 0.48.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.
- package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +2 -2
- package/dist/_pkgs/affine-block-attachment/translations.js +2 -2
- package/dist/_pkgs/affine-block-database/view.js +5 -0
- package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +1 -1
- package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed/translations.d.ts +1 -1
- package/dist/_pkgs/affine-block-embed/translations.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.d.ts +25 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.js +71 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/slash-menu.js +9 -17
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +3 -3
- package/dist/_pkgs/affine-block-embed-doc/translations.d.ts +1 -1
- package/dist/_pkgs/affine-block-embed-doc/translations.js +8 -8
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +2 -2
- package/dist/_pkgs/affine-block-frame/translations.js +1 -1
- package/dist/_pkgs/affine-block-note/translations.js +8 -8
- package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +2 -2
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +1 -1
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +1 -1
- package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +1 -1
- package/dist/_pkgs/affine-block-root/translations.d.ts +1 -1
- package/dist/_pkgs/affine-block-root/translations.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/canvas-grid/commands.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/selection-pane/commands.js +1 -1
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.d.ts +8 -2
- package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +11 -13
- package/dist/_pkgs/affine-block-surface-ref/translations.js +8 -8
- package/dist/_pkgs/affine-components/translations.js +6 -6
- package/dist/_pkgs/affine-fragment-doc-title/index.d.ts +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/index.js +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.d.ts +22 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.js +125 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.d.ts +7 -19
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.js +0 -38
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.d.ts +19 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.js +61 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +28 -18
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +225 -207
- package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +7 -4
- package/dist/_pkgs/affine-fragment-doc-title/translations.js +12 -9
- package/dist/_pkgs/affine-gfx-group/toolbar/config.d.ts +2 -2
- package/dist/_pkgs/affine-gfx-group/toolbar/config.js +2 -2
- package/dist/_pkgs/affine-gfx-group/translations.js +1 -1
- package/dist/_pkgs/affine-gfx-note/translations.js +2 -2
- package/dist/_pkgs/affine-shared/services/linked-doc-creation-service.d.ts +15 -6
- package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +10 -7
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +3 -3
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +17 -17
- package/dist/_pkgs/affine-shared/utils/model/doc.d.ts +10 -2
- package/dist/_pkgs/affine-shared/utils/model/doc.js +17 -7
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/translations.js +2 -2
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/translations.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/translations.js +3 -3
- package/dist/_pkgs/affine-widget-slash-menu/translations.js +1 -1
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +7 -2
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +22 -15
- package/dist/_pkgs/data-view/core/effect.js +2 -0
- package/dist/_pkgs/data-view/core/property/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/property/index.js +1 -0
- package/dist/_pkgs/data-view/core/property/standalone-cell.d.ts +95 -0
- package/dist/_pkgs/data-view/core/property/standalone-cell.js +306 -0
- package/dist/_pkgs/data-view/core/view-manager/property.d.ts +6 -0
- package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +1 -1
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +1 -1
- package/dist/_pkgs/data-view/property-presets/text/cell-renderer.js +3 -1
- package/dist/translations.js +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export const attachmentSlashMenuConfig = {
|
|
|
9
9
|
{
|
|
10
10
|
name: 'Attachment',
|
|
11
11
|
nameWording: ATTACHMENT_SLASH_NAME,
|
|
12
|
-
description: 'Attach a file to
|
|
12
|
+
description: 'Attach a file to the page.',
|
|
13
13
|
descriptionWording: ATTACHMENT_SLASH_DESCRIPTION,
|
|
14
14
|
icon: FileIcon(),
|
|
15
15
|
tooltip: {
|
|
@@ -35,7 +35,7 @@ export const attachmentSlashMenuConfig = {
|
|
|
35
35
|
{
|
|
36
36
|
name: 'PDF',
|
|
37
37
|
nameWording: ATTACHMENT_SLASH_PDF_NAME,
|
|
38
|
-
description: 'Upload a PDF to
|
|
38
|
+
description: 'Upload a PDF to the page.',
|
|
39
39
|
descriptionWording: ATTACHMENT_SLASH_PDF_DESCRIPTION,
|
|
40
40
|
icon: ExportToPdfIcon(),
|
|
41
41
|
tooltip: {
|
|
@@ -9,7 +9,7 @@ import { ATTACHMENT_LABEL, } from '../affine-shared/services/index.js';
|
|
|
9
9
|
export const ATTACHMENT_SLASH_NAME = ATTACHMENT_LABEL;
|
|
10
10
|
export const ATTACHMENT_SLASH_DESCRIPTION = [
|
|
11
11
|
'com.labre.attachment.slash.description',
|
|
12
|
-
'Attach a file to
|
|
12
|
+
'Attach a file to the page.',
|
|
13
13
|
];
|
|
14
14
|
/** The slash-menu "PDF" item, same pattern as {@link ATTACHMENT_SLASH_NAME}. */
|
|
15
15
|
export const ATTACHMENT_SLASH_PDF_NAME = [
|
|
@@ -18,7 +18,7 @@ export const ATTACHMENT_SLASH_PDF_NAME = [
|
|
|
18
18
|
];
|
|
19
19
|
export const ATTACHMENT_SLASH_PDF_DESCRIPTION = [
|
|
20
20
|
'com.labre.attachment.slash.pdf.description',
|
|
21
|
-
'Upload a PDF to
|
|
21
|
+
'Upload a PDF to the page.',
|
|
22
22
|
];
|
|
23
23
|
/** The toolbar's "Replace attachment" tooltip (`configs/toolbar.ts`). */
|
|
24
24
|
export const ATTACHMENT_TOOLBAR_REPLACE = [
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ViewExtensionProvider, } from '../affine-ext-loader/index.js';
|
|
2
2
|
import { DatabaseBlockModel } from '../affine-model/index.js';
|
|
3
3
|
import { SlashMenuConfigExtension } from '../affine-widget-slash-menu/index.js';
|
|
4
|
+
import { StandaloneCellMetaExtension } from '../data-view/index.js';
|
|
4
5
|
import { BlockViewExtension, FlavourExtension } from '../std/index.js';
|
|
5
6
|
import { literal } from 'lit/static-html.js';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
import { DatabaseConfigExtension } from './config.js';
|
|
8
9
|
import { databaseSlashMenuConfig } from './configs/slash-menu.js';
|
|
9
10
|
import { effects } from './effects.js';
|
|
11
|
+
import { linkColumnConfig } from './properties/link/cell-renderer.js';
|
|
10
12
|
const optionsSchema = z.object({
|
|
11
13
|
configure: z
|
|
12
14
|
.function()
|
|
@@ -29,6 +31,9 @@ export class DatabaseViewExtension extends ViewExtensionProvider {
|
|
|
29
31
|
FlavourExtension('affine:database'),
|
|
30
32
|
BlockViewExtension('affine:database', literal `affine-database`),
|
|
31
33
|
SlashMenuConfigExtension('affine:database', databaseSlashMenuConfig),
|
|
34
|
+
// The title band draws a `link` / `url` property with the table's link
|
|
35
|
+
// cell; it sits below this package and cannot import it (ADR 0035 §11).
|
|
36
|
+
StandaloneCellMetaExtension(linkColumnConfig),
|
|
32
37
|
]);
|
|
33
38
|
if (options) {
|
|
34
39
|
context.register(DatabaseConfigExtension({ configure: options.configure }));
|
|
@@ -15,7 +15,7 @@ const trackBaseProps = {
|
|
|
15
15
|
const openDocAction = {
|
|
16
16
|
id: 'a.open-doc',
|
|
17
17
|
icon: ExpandFullIcon(),
|
|
18
|
-
tooltip: 'Open this
|
|
18
|
+
tooltip: 'Open this page',
|
|
19
19
|
tooltipWording: TOOLBAR_OPEN_THIS_DOC,
|
|
20
20
|
run(ctx) {
|
|
21
21
|
const block = ctx.getCurrentBlockByType(EmbedHtmlBlockComponent);
|
|
@@ -18,7 +18,7 @@ export declare const builtinToolbarConfig: {
|
|
|
18
18
|
content(ctx: ToolbarContext): import("lit-html").TemplateResult<1> | null;
|
|
19
19
|
}, ToolbarAction, {
|
|
20
20
|
readonly id: "e.convert-to-linked-doc";
|
|
21
|
-
readonly tooltip: "Create Linked
|
|
21
|
+
readonly tooltip: "Create Linked Page";
|
|
22
22
|
readonly tooltipWording: import("../../../affine-shared/services/index.js").ChromeWording;
|
|
23
23
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
24
24
|
readonly run: (ctx: ToolbarContext) => void;
|
|
@@ -153,7 +153,7 @@ export const builtinToolbarConfig = {
|
|
|
153
153
|
captionAction('d.caption'),
|
|
154
154
|
{
|
|
155
155
|
id: 'e.convert-to-linked-doc',
|
|
156
|
-
tooltip: 'Create Linked
|
|
156
|
+
tooltip: 'Create Linked Page',
|
|
157
157
|
tooltipWording: EMBED_IFRAME_TOOLBAR_CREATE_LINKED_DOC,
|
|
158
158
|
icon: LinkedPageIcon(),
|
|
159
159
|
run(ctx) {
|
|
@@ -38,7 +38,7 @@ export declare const EMBED_IFRAME_TOOLBAR_ORIGINAL: ChromeWording;
|
|
|
38
38
|
/**
|
|
39
39
|
* An alias (L7 dedupe): the same Title Case word as
|
|
40
40
|
* {@link TOOLBAR_CREATE_LINKED_DOC_TITLE}, distinct from the sentence-case
|
|
41
|
-
* `TOOLBAR_CREATE_LINKED_DOC` chrome wording ("Create linked
|
|
41
|
+
* `TOOLBAR_CREATE_LINKED_DOC` chrome wording ("Create linked page").
|
|
42
42
|
*/
|
|
43
43
|
export declare const EMBED_IFRAME_TOOLBAR_CREATE_LINKED_DOC: ChromeWording;
|
|
44
44
|
/** The "no link" notification's message (`embed-iframe-block.ts`). */
|
|
@@ -13,7 +13,7 @@ export const EMBED_CANCEL = ACTION_CANCEL;
|
|
|
13
13
|
/* ── "Create a linked doc" prompt (`common/render-linked-doc.ts`) ────────── */
|
|
14
14
|
export const EMBED_PROMPT_TITLE_MESSAGE = [
|
|
15
15
|
'com.labre.embed.prompt.title-message',
|
|
16
|
-
'Enter a title for the new
|
|
16
|
+
'Enter a title for the new page.',
|
|
17
17
|
];
|
|
18
18
|
export const EMBED_DOC_CREATED_UNDO_MESSAGE = [
|
|
19
19
|
'com.labre.embed.toast.undo-message',
|
|
@@ -103,7 +103,7 @@ export const EMBED_IFRAME_TOOLBAR_ORIGINAL = [
|
|
|
103
103
|
/**
|
|
104
104
|
* An alias (L7 dedupe): the same Title Case word as
|
|
105
105
|
* {@link TOOLBAR_CREATE_LINKED_DOC_TITLE}, distinct from the sentence-case
|
|
106
|
-
* `TOOLBAR_CREATE_LINKED_DOC` chrome wording ("Create linked
|
|
106
|
+
* `TOOLBAR_CREATE_LINKED_DOC` chrome wording ("Create linked page").
|
|
107
107
|
*/
|
|
108
108
|
export const EMBED_IFRAME_TOOLBAR_CREATE_LINKED_DOC = TOOLBAR_CREATE_LINKED_DOC_TITLE;
|
|
109
109
|
/** The "no link" notification's message (`embed-iframe-block.ts`). */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BlockStdScope } from '../../../std/index.js';
|
|
2
|
+
import type { BlockModel } from '../../../store/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the slash menu offers "New Page" here: the card's schema is
|
|
5
|
+
* registered, and the host, if it creates docs, does not refuse it on this
|
|
6
|
+
* editor (`LinkedDocCreationProvider.canCreateLinkedDoc`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function canCreateDocHere(std: BlockStdScope, model: BlockModel): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The slash menu's "New Page": creates a page and leaves a CARD of it
|
|
11
|
+
* (`affine:embed-linked-doc`) right after the block the gesture was typed in.
|
|
12
|
+
* A paragraph the gesture left empty is replaced by the card, as Notion turns
|
|
13
|
+
* the line into the page. A card shows a child where its parent places it; an
|
|
14
|
+
* inline mention is only a reference (Labre ADR-0045 §9, host side).
|
|
15
|
+
*
|
|
16
|
+
* The page comes from the host's `LinkedDocCreationProvider` when there is
|
|
17
|
+
* one (the host persists it, registers it, decides its parent), else from the
|
|
18
|
+
* workspace (`createDefaultDoc`, the playground and standalone editors).
|
|
19
|
+
*
|
|
20
|
+
* One undo step for the card and the removed line. When no card can go there
|
|
21
|
+
* (a parent whose schema refuses it, an edgeless text for one), the gesture
|
|
22
|
+
* falls back on the inline mention it used to leave, so it always yields a way
|
|
23
|
+
* to the page. Returns the new page's id, or null on a read-only store.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createDocFromSlash(std: BlockStdScope, model: BlockModel): string | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { insertContent } from '../../../affine-rich-text/index.js';
|
|
2
|
+
import { REFERENCE_NODE } from '../../../affine-shared/consts/index.js';
|
|
3
|
+
import { LinkedDocCreationProvider, TelemetryProvider, } from '../../../affine-shared/services/index.js';
|
|
4
|
+
import { createDefaultDoc, writeDefaultDocBlocks, } from '../../../affine-shared/utils/index.js';
|
|
5
|
+
const LINKED_DOC = 'affine:embed-linked-doc';
|
|
6
|
+
/**
|
|
7
|
+
* Whether the slash menu offers "New Page" here: the card's schema is
|
|
8
|
+
* registered, and the host, if it creates docs, does not refuse it on this
|
|
9
|
+
* editor (`LinkedDocCreationProvider.canCreateLinkedDoc`).
|
|
10
|
+
*/
|
|
11
|
+
export function canCreateDocHere(std, model) {
|
|
12
|
+
if (!model.store.schema.flavourSchemaMap.has(LINKED_DOC))
|
|
13
|
+
return false;
|
|
14
|
+
const creation = std.getOptional(LinkedDocCreationProvider);
|
|
15
|
+
return creation?.canCreateLinkedDoc?.(std.host) ?? true;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The slash menu's "New Page": creates a page and leaves a CARD of it
|
|
19
|
+
* (`affine:embed-linked-doc`) right after the block the gesture was typed in.
|
|
20
|
+
* A paragraph the gesture left empty is replaced by the card, as Notion turns
|
|
21
|
+
* the line into the page. A card shows a child where its parent places it; an
|
|
22
|
+
* inline mention is only a reference (Labre ADR-0045 §9, host side).
|
|
23
|
+
*
|
|
24
|
+
* The page comes from the host's `LinkedDocCreationProvider` when there is
|
|
25
|
+
* one (the host persists it, registers it, decides its parent), else from the
|
|
26
|
+
* workspace (`createDefaultDoc`, the playground and standalone editors).
|
|
27
|
+
*
|
|
28
|
+
* One undo step for the card and the removed line. When no card can go there
|
|
29
|
+
* (a parent whose schema refuses it, an edgeless text for one), the gesture
|
|
30
|
+
* falls back on the inline mention it used to leave, so it always yields a way
|
|
31
|
+
* to the page. Returns the new page's id, or null on a read-only store.
|
|
32
|
+
*/
|
|
33
|
+
export function createDocFromSlash(std, model) {
|
|
34
|
+
const { store } = std;
|
|
35
|
+
if (store.readonly)
|
|
36
|
+
return null;
|
|
37
|
+
const pageId = createNewDoc(std).id;
|
|
38
|
+
store.captureSync();
|
|
39
|
+
if (insertCard(store, model, pageId)) {
|
|
40
|
+
std.getOptional(TelemetryProvider)?.track('BlockCreated', {
|
|
41
|
+
blockType: LINKED_DOC,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
insertContent(std, model, REFERENCE_NODE, {
|
|
46
|
+
reference: { type: 'LinkedPage', pageId },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return pageId;
|
|
50
|
+
}
|
|
51
|
+
function createNewDoc(std) {
|
|
52
|
+
const creation = std.getOptional(LinkedDocCreationProvider);
|
|
53
|
+
if (!creation)
|
|
54
|
+
return createDefaultDoc(std.store.workspace);
|
|
55
|
+
const doc = creation.createLinkedDoc(std.host, '');
|
|
56
|
+
doc.load(() => writeDefaultDocBlocks(doc));
|
|
57
|
+
// The new page's first undo must not empty it (as in `createDefaultDoc`).
|
|
58
|
+
doc.resetHistory();
|
|
59
|
+
return doc;
|
|
60
|
+
}
|
|
61
|
+
function insertCard(store, anchor, pageId) {
|
|
62
|
+
const parent = store.getParent(anchor);
|
|
63
|
+
if (!parent || !store.schema.isValid(LINKED_DOC, parent.flavour)) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const cardId = store.addBlock(LINKED_DOC, { pageId }, parent, parent.children.indexOf(anchor) + 1);
|
|
67
|
+
if (anchor.flavour === 'affine:paragraph' && anchor.text?.length === 0) {
|
|
68
|
+
store.deleteBlock(anchor);
|
|
69
|
+
}
|
|
70
|
+
return cardId;
|
|
71
|
+
}
|
|
@@ -1,46 +1,38 @@
|
|
|
1
1
|
import { EmbedLinkedDocBlockSchema } from '../../../affine-model/index.js';
|
|
2
|
-
import { insertContent } from '../../../affine-rich-text/index.js';
|
|
3
|
-
import { REFERENCE_NODE } from '../../../affine-shared/consts/index.js';
|
|
4
|
-
import { createDefaultDoc } from '../../../affine-shared/utils/index.js';
|
|
5
2
|
import { SlashMenuConfigIdentifier, } from '../../../affine-widget-slash-menu/index.js';
|
|
6
3
|
import { LinkedPageIcon, PlusIcon } from '@blocksuite/icons/lit';
|
|
7
4
|
import {} from '../../../store/index.js';
|
|
8
5
|
import { EMBED_DOC_SLASH_LINKED_DOC_CAPTION, EMBED_DOC_SLASH_LINKED_DOC_DESCRIPTION, EMBED_DOC_SLASH_LINKED_DOC_NAME, EMBED_DOC_SLASH_NEW_DOC_DESCRIPTION, EMBED_DOC_SLASH_NEW_DOC_NAME, } from '../../translations.js';
|
|
6
|
+
import { canCreateDocHere, createDocFromSlash } from './new-doc.js';
|
|
9
7
|
import { LinkDocTooltip, NewDocTooltip } from './tooltips.js';
|
|
10
8
|
const linkedDocSlashMenuConfig = {
|
|
11
9
|
items: [
|
|
12
10
|
{
|
|
13
|
-
name: 'New
|
|
11
|
+
name: 'New Page',
|
|
14
12
|
nameWording: EMBED_DOC_SLASH_NEW_DOC_NAME,
|
|
15
|
-
description: 'Start a new
|
|
13
|
+
description: 'Start a new page.',
|
|
16
14
|
descriptionWording: EMBED_DOC_SLASH_NEW_DOC_DESCRIPTION,
|
|
17
15
|
icon: PlusIcon(),
|
|
18
16
|
tooltip: {
|
|
19
17
|
figure: NewDocTooltip,
|
|
20
|
-
caption: 'New
|
|
18
|
+
caption: 'New Page',
|
|
21
19
|
captionWording: EMBED_DOC_SLASH_NEW_DOC_NAME,
|
|
22
20
|
},
|
|
23
21
|
group: '3_Page@0',
|
|
24
|
-
when: ({ model }) => model
|
|
22
|
+
when: ({ std, model }) => canCreateDocHere(std, model),
|
|
25
23
|
action: ({ std, model }) => {
|
|
26
|
-
|
|
27
|
-
insertContent(std, model, REFERENCE_NODE, {
|
|
28
|
-
reference: {
|
|
29
|
-
type: 'LinkedPage',
|
|
30
|
-
pageId: newDoc.id,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
24
|
+
createDocFromSlash(std, model);
|
|
33
25
|
},
|
|
34
26
|
},
|
|
35
27
|
{
|
|
36
|
-
name: 'Linked
|
|
28
|
+
name: 'Linked Page',
|
|
37
29
|
nameWording: EMBED_DOC_SLASH_LINKED_DOC_NAME,
|
|
38
|
-
description: 'Link to another
|
|
30
|
+
description: 'Link to another page.',
|
|
39
31
|
descriptionWording: EMBED_DOC_SLASH_LINKED_DOC_DESCRIPTION,
|
|
40
32
|
icon: LinkedPageIcon(),
|
|
41
33
|
tooltip: {
|
|
42
34
|
figure: LinkDocTooltip,
|
|
43
|
-
caption: 'Link
|
|
35
|
+
caption: 'Link Page',
|
|
44
36
|
captionWording: EMBED_DOC_SLASH_LINKED_DOC_CAPTION,
|
|
45
37
|
},
|
|
46
38
|
searchAlias: ['dual link'],
|
|
@@ -32,7 +32,7 @@ const openDocActions = [
|
|
|
32
32
|
{
|
|
33
33
|
mode: 'open-in-active-view',
|
|
34
34
|
id: 'a.open-in-active-view',
|
|
35
|
-
label: 'Open this
|
|
35
|
+
label: 'Open this page',
|
|
36
36
|
labelWording: TOOLBAR_OPEN_THIS_DOC,
|
|
37
37
|
icon: ExpandFullIcon(),
|
|
38
38
|
},
|
|
@@ -228,9 +228,9 @@ const builtinSurfaceToolbarConfig = {
|
|
|
228
228
|
conversionsActionGroup,
|
|
229
229
|
{
|
|
230
230
|
id: 'b.insert-to-page',
|
|
231
|
-
label: 'Insert to
|
|
231
|
+
label: 'Insert to page',
|
|
232
232
|
labelWording: EMBED_DOC_INSERT_TO_PAGE,
|
|
233
|
-
tooltip: 'Insert to
|
|
233
|
+
tooltip: 'Insert to page',
|
|
234
234
|
tooltipWording: EMBED_DOC_INSERT_TO_PAGE,
|
|
235
235
|
icon: InsertIntoPageIcon(),
|
|
236
236
|
run: ctx => {
|
|
@@ -6,7 +6,7 @@ export declare const EMBED_DOC_SLASH_LINKED_DOC_NAME: ChromeWording;
|
|
|
6
6
|
export declare const EMBED_DOC_SLASH_LINKED_DOC_CAPTION: ChromeWording;
|
|
7
7
|
export declare const EMBED_DOC_SLASH_LINKED_DOC_DESCRIPTION: ChromeWording;
|
|
8
8
|
/**
|
|
9
|
-
* The "Open
|
|
9
|
+
* The "Open page" dropdown button — its own `aria-label`/`tooltip` AND the
|
|
10
10
|
* dropdown's single entry label, in both `embed-linked-doc-block/configs/toolbar.ts`
|
|
11
11
|
* and `embed-synced-doc-block/configs/toolbar.ts`.
|
|
12
12
|
*/
|
|
@@ -5,30 +5,30 @@ import { NEW_DOC_LABEL, } from '../affine-shared/services/index.js';
|
|
|
5
5
|
export const EMBED_DOC_SLASH_NEW_DOC_NAME = NEW_DOC_LABEL;
|
|
6
6
|
export const EMBED_DOC_SLASH_NEW_DOC_DESCRIPTION = [
|
|
7
7
|
'com.labre.embed-doc.slash.new-doc.description',
|
|
8
|
-
'Start a new
|
|
8
|
+
'Start a new page.',
|
|
9
9
|
];
|
|
10
10
|
export const EMBED_DOC_SLASH_LINKED_DOC_NAME = [
|
|
11
11
|
'com.labre.embed-doc.slash.linked-doc.name',
|
|
12
|
-
'Linked
|
|
12
|
+
'Linked Page',
|
|
13
13
|
];
|
|
14
14
|
/** The tooltip's own word — distinct from the item's name above. */
|
|
15
15
|
export const EMBED_DOC_SLASH_LINKED_DOC_CAPTION = [
|
|
16
16
|
'com.labre.embed-doc.slash.linked-doc.caption',
|
|
17
|
-
'Link
|
|
17
|
+
'Link Page',
|
|
18
18
|
];
|
|
19
19
|
export const EMBED_DOC_SLASH_LINKED_DOC_DESCRIPTION = [
|
|
20
20
|
'com.labre.embed-doc.slash.linked-doc.description',
|
|
21
|
-
'Link to another
|
|
21
|
+
'Link to another page.',
|
|
22
22
|
];
|
|
23
23
|
/* ── Toolbar chrome shared by the linked-doc and synced-doc toolbars ───── */
|
|
24
24
|
/**
|
|
25
|
-
* The "Open
|
|
25
|
+
* The "Open page" dropdown button — its own `aria-label`/`tooltip` AND the
|
|
26
26
|
* dropdown's single entry label, in both `embed-linked-doc-block/configs/toolbar.ts`
|
|
27
27
|
* and `embed-synced-doc-block/configs/toolbar.ts`.
|
|
28
28
|
*/
|
|
29
29
|
export const EMBED_DOC_OPEN_DOC = [
|
|
30
30
|
'com.labre.embed-doc.toolbar.open-doc',
|
|
31
|
-
'Open
|
|
31
|
+
'Open page',
|
|
32
32
|
];
|
|
33
33
|
/** The card's "last updated" date label (`components/embed-synced-doc-card.ts`, `embed-linked-doc-block.ts`). */
|
|
34
34
|
export const EMBED_DOC_UPDATED_LABEL = [
|
|
@@ -37,7 +37,7 @@ export const EMBED_DOC_UPDATED_LABEL = [
|
|
|
37
37
|
];
|
|
38
38
|
export const EMBED_DOC_INSERT_TO_PAGE = [
|
|
39
39
|
'com.labre.embed-doc.toolbar.insert-to-page',
|
|
40
|
-
'Insert to
|
|
40
|
+
'Insert to page',
|
|
41
41
|
];
|
|
42
42
|
export const EMBED_DOC_DUPLICATE_AS_NOTE = [
|
|
43
43
|
'com.labre.embed-doc.toolbar.duplicate-as-note',
|
|
@@ -54,7 +54,7 @@ export const EMBED_DOC_DUPLICATE_AS_NOTE_TOOLTIP = [
|
|
|
54
54
|
*/
|
|
55
55
|
export const EMBED_DOC_CARD_EMPTY_CONTENT = [
|
|
56
56
|
'com.labre.embed-doc.card.empty-content',
|
|
57
|
-
'This is a linked
|
|
57
|
+
'This is a linked page, you can add content here.',
|
|
58
58
|
];
|
|
59
59
|
/**
|
|
60
60
|
* This package's contribution to the translation-key manifest, listed in
|
|
@@ -22,9 +22,9 @@ const builtinSurfaceToolbarConfig = {
|
|
|
22
22
|
actions: [
|
|
23
23
|
{
|
|
24
24
|
id: 'a.insert-into-page',
|
|
25
|
-
label: 'Insert into
|
|
25
|
+
label: 'Insert into Page',
|
|
26
26
|
labelWording: FRAME_TOOLBAR_INSERT_INTO_PAGE,
|
|
27
|
-
tooltip: 'Insert into
|
|
27
|
+
tooltip: 'Insert into Page',
|
|
28
28
|
tooltipWording: FRAME_TOOLBAR_INSERT_INTO_PAGE,
|
|
29
29
|
icon: InsertIntoPageIcon(),
|
|
30
30
|
when: ctx => ctx.getSurfaceModelsByType(FrameBlockModel).length === 1,
|
|
@@ -45,7 +45,7 @@ export const FRAME_TOOLBAR_INSERT_INTO_PAGE = TOOLBAR_INSERT_INTO_PAGE;
|
|
|
45
45
|
*/
|
|
46
46
|
export const FRAME_TOAST_INSERTED_MESSAGE = [
|
|
47
47
|
'com.labre.frame.toast.inserted-message',
|
|
48
|
-
'Frame has been inserted into
|
|
48
|
+
'Frame has been inserted into page',
|
|
49
49
|
];
|
|
50
50
|
export const FRAME_TOOLBAR_UNGROUP = TOOLBAR_UNGROUP;
|
|
51
51
|
export const FRAME_TOOLBAR_BACKGROUND = [
|
|
@@ -161,23 +161,23 @@ export const NOTE_DISPLAY_MODE_PAGE = DISPLAY_MODE_PAGE;
|
|
|
161
161
|
*/
|
|
162
162
|
export const NOTE_TOAST_DISPLAYED_IN_PAGE_MODE = [
|
|
163
163
|
'com.labre.note.toast.displayed-in-page-mode',
|
|
164
|
-
'Note displayed in
|
|
164
|
+
'Note displayed in Page Mode',
|
|
165
165
|
];
|
|
166
166
|
export const NOTE_TOAST_REMOVED_FROM_PAGE_BODY = [
|
|
167
167
|
'com.labre.note.toast.removed-from-page.body',
|
|
168
|
-
'Content removed from your
|
|
168
|
+
'Content removed from your page. Find it in the TOC for quick navigation.',
|
|
169
169
|
];
|
|
170
170
|
export const NOTE_TOAST_ADDED_TO_PAGE_BODY = [
|
|
171
171
|
'com.labre.note.toast.added-to-page.body',
|
|
172
|
-
'Content added to your
|
|
172
|
+
'Content added to your page. Find it in the TOC for quick navigation.',
|
|
173
173
|
];
|
|
174
174
|
export const NOTE_TOAST_REMOVED_FROM_PAGE_BODY_NO_TOC = [
|
|
175
175
|
'com.labre.note.toast.removed-from-page.body-no-toc',
|
|
176
|
-
'Content removed from your
|
|
176
|
+
'Content removed from your page.',
|
|
177
177
|
];
|
|
178
178
|
export const NOTE_TOAST_ADDED_TO_PAGE_BODY_NO_TOC = [
|
|
179
179
|
'com.labre.note.toast.added-to-page.body-no-toc',
|
|
180
|
-
'Content added to your
|
|
180
|
+
'Content added to your page.',
|
|
181
181
|
];
|
|
182
182
|
export const NOTE_TOAST_VIEW_IN_TOC = [
|
|
183
183
|
'com.labre.note.toast.view-in-toc',
|
|
@@ -185,15 +185,15 @@ export const NOTE_TOAST_VIEW_IN_TOC = [
|
|
|
185
185
|
];
|
|
186
186
|
export const NOTE_TOOLBAR_DISPLAY_IN_PAGE = [
|
|
187
187
|
'com.labre.note.toolbar.display-in-page',
|
|
188
|
-
'Display in
|
|
188
|
+
'Display in Page',
|
|
189
189
|
];
|
|
190
190
|
export const NOTE_TOOLBAR_DISPLAYED_IN_PAGE = [
|
|
191
191
|
'com.labre.note.toolbar.displayed-in-page',
|
|
192
|
-
'Displayed in
|
|
192
|
+
'Displayed in Page',
|
|
193
193
|
];
|
|
194
194
|
export const NOTE_TOOLBAR_REMOVE_FROM_PAGE_TOOLTIP = [
|
|
195
195
|
'com.labre.note.toolbar.remove-from-page-tooltip',
|
|
196
|
-
'This note is part of
|
|
196
|
+
'This note is part of Page Mode. Click to remove it from the page.',
|
|
197
197
|
];
|
|
198
198
|
export const NOTE_TOOLBAR_SLICER = [
|
|
199
199
|
'com.labre.note.toolbar.slicer',
|
|
@@ -91,9 +91,9 @@ const copyDocLink = {
|
|
|
91
91
|
// carry a default chord, and the shortcut namespace would file it as a
|
|
92
92
|
// keymap row for a translator.
|
|
93
93
|
labelKey: 'com.labre.command.doc.copy-link',
|
|
94
|
-
labelFallback: 'Copy
|
|
94
|
+
labelFallback: 'Copy page link',
|
|
95
95
|
descriptionKey: 'com.labre.command.doc.copy-link.description',
|
|
96
|
-
descriptionFallback: 'Copy a link to this
|
|
96
|
+
descriptionFallback: 'Copy a link to this page, anchored on the selection, so it can be ' +
|
|
97
97
|
'pasted into a text as a reference.',
|
|
98
98
|
keywords: ['link', 'url', 'share', 'reference'],
|
|
99
99
|
surfaces: ['palette', 'agent'],
|
|
@@ -30,7 +30,7 @@ export declare const builtinToolbarConfig: {
|
|
|
30
30
|
readonly run: ({ host }: import("../../affine-shared/services/index.js").ToolbarContext) => void;
|
|
31
31
|
}, {
|
|
32
32
|
readonly id: "f.convert-to-linked-doc";
|
|
33
|
-
readonly tooltip: "Create Linked
|
|
33
|
+
readonly tooltip: "Create Linked Page";
|
|
34
34
|
readonly tooltipWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
35
35
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
36
36
|
readonly when: ({ chain, std }: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
@@ -168,7 +168,7 @@ const turnIntoDatabase = {
|
|
|
168
168
|
};
|
|
169
169
|
const turnIntoLinkedDoc = {
|
|
170
170
|
id: 'f.convert-to-linked-doc',
|
|
171
|
-
tooltip: 'Create Linked
|
|
171
|
+
tooltip: 'Create Linked Page',
|
|
172
172
|
tooltipWording: ROOT_TOOLBAR_CREATE_LINKED_DOC,
|
|
173
173
|
icon: LinkedPageIcon(),
|
|
174
174
|
when({ chain, std }) {
|
|
@@ -118,7 +118,7 @@ export declare const builtinMiscToolbarConfig: {
|
|
|
118
118
|
id: "d.conversions";
|
|
119
119
|
actions: [{
|
|
120
120
|
readonly id: "a.turn-into-linked-doc";
|
|
121
|
-
readonly label: "Turn into linked
|
|
121
|
+
readonly label: "Turn into linked page";
|
|
122
122
|
readonly labelWording: import("../../../../affine-shared/services/index.js").ChromeWording;
|
|
123
123
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
124
124
|
readonly when: (ctx: ToolbarContext) => boolean;
|
|
@@ -64,7 +64,7 @@ export declare const moreActions: [{
|
|
|
64
64
|
readonly id: "d.conversions";
|
|
65
65
|
readonly actions: [{
|
|
66
66
|
readonly id: "a.turn-into-linked-doc";
|
|
67
|
-
readonly label: "Turn into linked
|
|
67
|
+
readonly label: "Turn into linked page";
|
|
68
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;
|
|
@@ -15,7 +15,7 @@ export declare const ROOT_TOOLBAR_CREATE_TABLE: ChromeWording;
|
|
|
15
15
|
* An alias (L7 dedupe): the same Title Case word as
|
|
16
16
|
* {@link TOOLBAR_CREATE_LINKED_DOC_TITLE}, distinct from the shared
|
|
17
17
|
* sentence-case `TOOLBAR_CREATE_LINKED_DOC` chrome wording
|
|
18
|
-
* (`com.labre.toolbar.create-linked-doc`, "Create linked
|
|
18
|
+
* (`com.labre.toolbar.create-linked-doc`, "Create linked page").
|
|
19
19
|
*/
|
|
20
20
|
export declare const ROOT_TOOLBAR_CREATE_LINKED_DOC: ChromeWording;
|
|
21
21
|
export declare const ROOT_ALIGNMENT_MENU_ARIA: ChromeWording;
|
|
@@ -19,7 +19,7 @@ export const ROOT_TOOLBAR_CREATE_TABLE = [
|
|
|
19
19
|
* An alias (L7 dedupe): the same Title Case word as
|
|
20
20
|
* {@link TOOLBAR_CREATE_LINKED_DOC_TITLE}, distinct from the shared
|
|
21
21
|
* sentence-case `TOOLBAR_CREATE_LINKED_DOC` chrome wording
|
|
22
|
-
* (`com.labre.toolbar.create-linked-doc`, "Create linked
|
|
22
|
+
* (`com.labre.toolbar.create-linked-doc`, "Create linked page").
|
|
23
23
|
*/
|
|
24
24
|
export const ROOT_TOOLBAR_CREATE_LINKED_DOC = TOOLBAR_CREATE_LINKED_DOC_TITLE;
|
|
25
25
|
/* ── The edgeless alignment menu (`edgeless/configs/toolbar/alignment.ts`) ── */
|
|
@@ -105,7 +105,7 @@ export const ROOT_TOOLBAR_SEND_BACKWARD = [
|
|
|
105
105
|
export const ROOT_TOOLBAR_RELOAD = TOOLBAR_RELOAD;
|
|
106
106
|
export const ROOT_TOOLBAR_TURN_INTO_LINKED_DOC = [
|
|
107
107
|
'com.labre.root.toolbar.turn-into-linked-doc',
|
|
108
|
-
'Turn into linked
|
|
108
|
+
'Turn into linked page',
|
|
109
109
|
];
|
|
110
110
|
export const ROOT_TOOLBAR_EDIT_LINK = [
|
|
111
111
|
'com.labre.root.toolbar.edit-link',
|
|
@@ -58,7 +58,7 @@ const saveGridForEveryone = {
|
|
|
58
58
|
labelKey: 'com.labre.command.canvas.grid.save-for-everyone',
|
|
59
59
|
labelFallback: 'Save the grid for everyone',
|
|
60
60
|
descriptionKey: 'com.labre.command.canvas.grid.save-for-everyone.description',
|
|
61
|
-
descriptionFallback: 'Make the grid as you see it now the setting of this
|
|
61
|
+
descriptionFallback: 'Make the grid as you see it now the setting of this page, for everyone who opens it.',
|
|
62
62
|
category: 'display',
|
|
63
63
|
keywords: ['grid', 'dots', 'background', 'document'],
|
|
64
64
|
surfaces: ['palette', 'agent', 'view-menu'],
|
|
@@ -292,7 +292,7 @@ const IMPORT_DEFAULT_NAME_FALLBACK = 'Imported diagram';
|
|
|
292
292
|
* because nothing is wrong with the FILE.
|
|
293
293
|
*/
|
|
294
294
|
const IMPORT_READONLY_KEY = 'com.labre.interchange.import.readonly';
|
|
295
|
-
const IMPORT_READONLY_FALLBACK = 'This
|
|
295
|
+
const IMPORT_READONLY_FALLBACK = 'This page became read-only while the file was being read, so nothing was imported.';
|
|
296
296
|
const IMPORT_REMARKS_KEY = 'com.labre.interchange.import.remarks';
|
|
297
297
|
const IMPORT_REMARKS_FALLBACK = 'What the import could not keep as it was';
|
|
298
298
|
const IMPORT_CONSOLE_KEY = 'com.labre.interchange.import.console';
|
|
@@ -293,7 +293,7 @@ const hideForEveryone = {
|
|
|
293
293
|
labelKey: 'com.labre.command.canvas.visibility.hide-for-everyone',
|
|
294
294
|
labelFallback: 'Hide for everyone',
|
|
295
295
|
descriptionKey: 'com.labre.command.canvas.visibility.hide-for-everyone.description',
|
|
296
|
-
descriptionFallback: 'Hide the selected elements for everyone who opens this
|
|
296
|
+
descriptionFallback: 'Hide the selected elements for everyone who opens this page. They stay in the page and in the selection pane.',
|
|
297
297
|
surfaces: ['palette', 'agent'],
|
|
298
298
|
scope: 'edgeless',
|
|
299
299
|
defaultKeys: { mac: [], other: [] },
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { GfxController } from '../../std/gfx/index.js';
|
|
2
2
|
import { Overlay } from './overlay.js';
|
|
3
3
|
/**
|
|
4
|
-
* Draws the transient emphasis
|
|
5
|
-
*
|
|
4
|
+
* Draws the transient emphasis around the elements held by `gfx.highlight`
|
|
5
|
+
* (`ElementHighlightManager`).
|
|
6
|
+
*
|
|
7
|
+
* The emphasis is the canvas's existing vocabulary, a square border on the
|
|
8
|
+
* element's bounds like the selection frame (`edgeless-selected-rect`), not a
|
|
9
|
+
* second, detached ring: the product owner asked for the border alone after
|
|
10
|
+
* the P1 recette, so a selection-pane hover reads as « this one » and not as a
|
|
11
|
+
* new kind of mark.
|
|
6
12
|
*
|
|
7
13
|
* The overlay is a pure renderer: it owns no state, reads nothing from the
|
|
8
14
|
* store and mutates nothing, which makes it safe on a read-only editor.
|