@formicoidea/labre-core 0.46.2 → 0.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_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-data-view/columns/index.d.ts +1 -1
- package/dist/_pkgs/affine-block-database/data-source.d.ts +1 -1
- package/dist/_pkgs/affine-block-database/properties/converts.d.ts +4 -4
- package/dist/_pkgs/affine-block-database/properties/index.d.ts +1 -1
- 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/slash-menu.js +6 -6
- 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/commands.js +41 -1
- package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +1 -1
- 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-frame/view.js +7 -2
- package/dist/_pkgs/affine-block-note/components/edgeless-page-block-title.d.ts +7 -0
- package/dist/_pkgs/affine-block-note/components/edgeless-page-block-title.js +15 -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 +21 -7
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/commands.js +79 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.d.ts +18 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +53 -30
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/index.js +1 -0
- 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/view.js +11 -2
- 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/doc-title.d.ts +8 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +65 -4
- package/dist/_pkgs/affine-fragment-doc-title/effects.d.ts +2 -0
- package/dist/_pkgs/affine-fragment-doc-title/effects.js +2 -0
- package/dist/_pkgs/affine-fragment-doc-title/index.d.ts +2 -0
- package/dist/_pkgs/affine-fragment-doc-title/index.js +2 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.d.ts +69 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.js +182 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +62 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +649 -0
- package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +21 -0
- package/dist/_pkgs/affine-fragment-doc-title/translations.js +58 -0
- 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/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/services/index.js +2 -0
- package/dist/_pkgs/affine-shared/services/linked-doc-creation-service.d.ts +1 -1
- package/dist/_pkgs/affine-shared/services/properties-panel-service.d.ts +50 -0
- package/dist/_pkgs/affine-shared/services/properties-panel-service.js +17 -0
- package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +124 -0
- package/dist/_pkgs/affine-shared/services/title-band-service.js +17 -0
- 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-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/property-presets/converts.d.ts +2 -2
- package/dist/_pkgs/data-view/property-presets/index.d.ts +1 -1
- package/dist/_pkgs/data-view/property-presets/number/cell-renderer.d.ts +1 -1
- package/dist/_pkgs/data-view/property-presets/number/define.d.ts +1 -1
- package/dist/_pkgs/data-view/property-presets/number/types.d.ts +2 -2
- package/dist/_pkgs/data-view/property-presets/pure-index.d.ts +2 -1
- package/dist/_pkgs/data-view/property-presets/pure-index.js +4 -0
- package/dist/_pkgs/std/extension/command-registry.d.ts +50 -1
- package/dist/_pkgs/std/extension/command-registry.js +26 -7
- package/dist/commands.js +2 -1
- package/dist/host-panels.d.ts +83 -2
- package/dist/host-panels.js +82 -1
- package/dist/translations.js +1 -1
- package/package.json +1 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/file-exporter.d.ts +0 -26
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/file-exporter.js +0 -73
|
@@ -11,7 +11,65 @@ export const DOC_TITLE_PLACEHOLDER = [
|
|
|
11
11
|
'com.labre.doc-title.placeholder',
|
|
12
12
|
'Title',
|
|
13
13
|
];
|
|
14
|
+
/* ── The title band (ADR 0035 §11), `./title-band/title-band.ts` ───────── */
|
|
15
|
+
/** The band's accessible name: the group of property chips. */
|
|
16
|
+
export const TITLE_BAND_LABEL = [
|
|
17
|
+
'com.labre.title-band.label',
|
|
18
|
+
'Page properties',
|
|
19
|
+
];
|
|
20
|
+
/** What an empty chip says after the property's name (REQ-PR-1). */
|
|
21
|
+
export const TITLE_BAND_EMPTY = [
|
|
22
|
+
'com.labre.title-band.empty',
|
|
23
|
+
'Not set',
|
|
24
|
+
];
|
|
25
|
+
/** The "+" (REQ-PR-4); what it does is the host's. */
|
|
26
|
+
export const TITLE_BAND_ADD = [
|
|
27
|
+
'com.labre.title-band.add',
|
|
28
|
+
'Add a property',
|
|
29
|
+
];
|
|
30
|
+
/** The button beside the "+" that opens the host's properties panel. */
|
|
31
|
+
export const TITLE_BAND_OPEN_PANEL = [
|
|
32
|
+
'com.labre.title-band.open-panel',
|
|
33
|
+
'Open the properties panel',
|
|
34
|
+
];
|
|
35
|
+
/** Folds the chips away. */
|
|
36
|
+
export const TITLE_BAND_COLLAPSE = [
|
|
37
|
+
'com.labre.title-band.collapse',
|
|
38
|
+
'Hide properties',
|
|
39
|
+
];
|
|
40
|
+
/** The folded band's only button; `count` is the number of chips. */
|
|
41
|
+
export const TITLE_BAND_EXPAND = [
|
|
42
|
+
'com.labre.title-band.expand',
|
|
43
|
+
'Properties ({{count}})',
|
|
44
|
+
];
|
|
45
|
+
/** The accessible name of the skeleton drawn while the sheet loads. */
|
|
46
|
+
export const TITLE_BAND_LOADING = [
|
|
47
|
+
'com.labre.title-band.loading',
|
|
48
|
+
'Loading properties',
|
|
49
|
+
];
|
|
50
|
+
/** Clears a select or a date from its editor. */
|
|
51
|
+
export const TITLE_BAND_CLEAR = [
|
|
52
|
+
'com.labre.title-band.clear',
|
|
53
|
+
'Clear value',
|
|
54
|
+
];
|
|
55
|
+
/**
|
|
56
|
+
* The note header's row of child pages the document holds but does not
|
|
57
|
+
* display (ADR 0035 §9d, canvas view only).
|
|
58
|
+
*/
|
|
59
|
+
export const TITLE_BAND_NOT_SHOWN = [
|
|
60
|
+
'com.labre.title-band.not-shown',
|
|
61
|
+
'Not shown in this page',
|
|
62
|
+
];
|
|
14
63
|
/** Every wording this package declares, in the order it renders them. */
|
|
15
64
|
export const DOC_TITLE_WORDINGS = [
|
|
16
65
|
DOC_TITLE_PLACEHOLDER,
|
|
66
|
+
TITLE_BAND_ADD,
|
|
67
|
+
TITLE_BAND_CLEAR,
|
|
68
|
+
TITLE_BAND_COLLAPSE,
|
|
69
|
+
TITLE_BAND_EMPTY,
|
|
70
|
+
TITLE_BAND_EXPAND,
|
|
71
|
+
TITLE_BAND_LABEL,
|
|
72
|
+
TITLE_BAND_LOADING,
|
|
73
|
+
TITLE_BAND_NOT_SHOWN,
|
|
74
|
+
TITLE_BAND_OPEN_PANEL,
|
|
17
75
|
];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const groupToolbarConfig: {
|
|
2
2
|
readonly actions: [{
|
|
3
3
|
readonly id: "a.insert-into-page";
|
|
4
|
-
readonly label: "Insert into
|
|
4
|
+
readonly label: "Insert into Page";
|
|
5
5
|
readonly labelWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
6
|
-
readonly tooltip: "Insert into
|
|
6
|
+
readonly tooltip: "Insert into Page";
|
|
7
7
|
readonly tooltipWording: import("../../affine-shared/services/index.js").ChromeWording;
|
|
8
8
|
readonly icon: import("lit-html").TemplateResult<1>;
|
|
9
9
|
readonly when: (ctx: import("../../affine-shared/services/index.js").ToolbarContext) => boolean;
|
|
@@ -13,9 +13,9 @@ export const groupToolbarConfig = {
|
|
|
13
13
|
actions: [
|
|
14
14
|
{
|
|
15
15
|
id: 'a.insert-into-page',
|
|
16
|
-
label: 'Insert into
|
|
16
|
+
label: 'Insert into Page',
|
|
17
17
|
labelWording: GROUP_TOOLBAR_INSERT_INTO_PAGE,
|
|
18
|
-
tooltip: 'Insert into
|
|
18
|
+
tooltip: 'Insert into Page',
|
|
19
19
|
tooltipWording: GROUP_TOOLBAR_INSERT_INTO_PAGE,
|
|
20
20
|
icon: InsertIntoPageIcon(),
|
|
21
21
|
when: ctx => ctx.getSurfaceModelsByType(GroupElementModel).length === 1,
|
|
@@ -20,7 +20,7 @@ export const GROUP_WORDINGS = [GROUP_SEED_NAME];
|
|
|
20
20
|
export const GROUP_TOOLBAR_INSERT_INTO_PAGE = TOOLBAR_INSERT_INTO_PAGE;
|
|
21
21
|
export const GROUP_TOAST_INSERTED = [
|
|
22
22
|
'com.labre.group.toast.inserted',
|
|
23
|
-
'Group has been inserted into
|
|
23
|
+
'Group has been inserted into page',
|
|
24
24
|
];
|
|
25
25
|
export const GROUP_TOOLBAR_RENAME = TOOLBAR_RENAME;
|
|
26
26
|
export const GROUP_TOOLBAR_UNGROUP = TOOLBAR_UNGROUP;
|
|
@@ -19,7 +19,7 @@ export const GFX_NOTE_SHADOW_FLOATION = [
|
|
|
19
19
|
/* ── `./components/note-display-mode-panel.ts` ────────────────────────────
|
|
20
20
|
* A different wording from `blocks/note`'s own display-mode dropdown (which
|
|
21
21
|
* says "Both" / "Edgeless" / "Page"): this panel's labels read "In Both" /
|
|
22
|
-
* "In
|
|
22
|
+
* "In Page Only" / "In Canvas Only", so they get their own keys.
|
|
23
23
|
*/
|
|
24
24
|
export const GFX_NOTE_DISPLAY_MODE_BOTH = [
|
|
25
25
|
'com.labre.gfx-note.display-mode.in-both',
|
|
@@ -27,7 +27,7 @@ export const GFX_NOTE_DISPLAY_MODE_BOTH = [
|
|
|
27
27
|
];
|
|
28
28
|
export const GFX_NOTE_DISPLAY_MODE_PAGE_ONLY = [
|
|
29
29
|
'com.labre.gfx-note.display-mode.in-page-only',
|
|
30
|
-
'In
|
|
30
|
+
'In Page Only',
|
|
31
31
|
];
|
|
32
32
|
export const GFX_NOTE_DISPLAY_MODE_EDGELESS_ONLY = [
|
|
33
33
|
'com.labre.gfx-note.display-mode.in-edgeless-only',
|
|
@@ -30,10 +30,12 @@ export * from './page-viewport-service.js';
|
|
|
30
30
|
export * from './parse-url-service.js';
|
|
31
31
|
export * from './pivot-materiality-publisher.js';
|
|
32
32
|
export * from './pivot-properties-service.js';
|
|
33
|
+
export * from './properties-panel-service.js';
|
|
33
34
|
export * from './quick-search-service.js';
|
|
34
35
|
export * from './selection-pane-service.js';
|
|
35
36
|
export * from './telemetry-service/index.js';
|
|
36
37
|
export * from './theme-service.js';
|
|
38
|
+
export * from './title-band-service.js';
|
|
37
39
|
export * from './toolbar-service/index.js';
|
|
38
40
|
export * from './translation-service/index.js';
|
|
39
41
|
export * from './universe-tag-defs-service.js';
|
|
@@ -30,10 +30,12 @@ export * from './page-viewport-service.js';
|
|
|
30
30
|
export * from './parse-url-service.js';
|
|
31
31
|
export * from './pivot-materiality-publisher.js';
|
|
32
32
|
export * from './pivot-properties-service.js';
|
|
33
|
+
export * from './properties-panel-service.js';
|
|
33
34
|
export * from './quick-search-service.js';
|
|
34
35
|
export * from './selection-pane-service.js';
|
|
35
36
|
export * from './telemetry-service/index.js';
|
|
36
37
|
export * from './theme-service.js';
|
|
38
|
+
export * from './title-band-service.js';
|
|
37
39
|
export * from './toolbar-service/index.js';
|
|
38
40
|
export * from './translation-service/index.js';
|
|
39
41
|
export * from './universe-tag-defs-service.js';
|
|
@@ -2,7 +2,7 @@ import type { EditorHost } from '../../std/index.js';
|
|
|
2
2
|
import { type ExtensionType, type Store } from '../../store/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Creates the new doc that the linked-doc features populate (the edgeless
|
|
5
|
-
* "Create linked
|
|
5
|
+
* "Create linked page" / "Turn into linked page" actions). By default this is a
|
|
6
6
|
* fresh in-workspace doc; a host app can override it to ALSO persist or register
|
|
7
7
|
* the doc (assign a stored id, create a metadata row, attach sync) before the
|
|
8
8
|
* editor writes blocks into the returned store.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ExtensionType } from '../../store/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the properties panel is asked to show (ADR 0035 §9b): one panel with a
|
|
4
|
+
* typed request, like the artefact catalogue's `open(owner)`.
|
|
5
|
+
*
|
|
6
|
+
* - `page`: the property sheet of one document — the button beside the title
|
|
7
|
+
* band's "+" sends it, under the page title and in the note header alike.
|
|
8
|
+
* - `source`: the properties of one data source of a database, as a view
|
|
9
|
+
* shows them. Declared now so the host's `open` is written once against the
|
|
10
|
+
* whole union; the library sends it from the database view bar and the view
|
|
11
|
+
* settings when they ship (ADR 0035, issue B10), never before.
|
|
12
|
+
*
|
|
13
|
+
* The union only widens: a new scope is a new member, and an existing member
|
|
14
|
+
* never gains a required field.
|
|
15
|
+
*/
|
|
16
|
+
export type PropertiesPanelRequest = {
|
|
17
|
+
scope: 'page';
|
|
18
|
+
docId: string;
|
|
19
|
+
} | {
|
|
20
|
+
scope: 'source';
|
|
21
|
+
docId: string;
|
|
22
|
+
blockId: string;
|
|
23
|
+
sourceId: string;
|
|
24
|
+
viewId?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The properties panel (ADR 0035 §9b), shaped as every panel seam of
|
|
28
|
+
* ADR 0034 §1: two verbs, nothing else. The host draws the panel where it
|
|
29
|
+
* wants it (the Labre app, in its left sidebar); the library never mounts one
|
|
30
|
+
* and keeps no "is it open" state, so a second `open` with another request
|
|
31
|
+
* retargets the host's panel rather than toggling anything here.
|
|
32
|
+
*
|
|
33
|
+
* Absent or `null`, the title band draws no panel button: a button that opens
|
|
34
|
+
* nothing is a lie. A database's properties stay reachable through the
|
|
35
|
+
* data-view's own properties popover.
|
|
36
|
+
*/
|
|
37
|
+
export interface PropertiesPanelService {
|
|
38
|
+
/** Show the panel for `request`. */
|
|
39
|
+
open(request: PropertiesPanelRequest): void;
|
|
40
|
+
/** Put it away. Writes nothing. */
|
|
41
|
+
close(): void;
|
|
42
|
+
}
|
|
43
|
+
export declare const PropertiesPanelProvider: import("../../global/di/types.js").ServiceIdentifier<PropertiesPanelService> & (<U extends PropertiesPanelService = PropertiesPanelService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
|
|
44
|
+
/**
|
|
45
|
+
* Host seam: the host's properties panel, or `null` to say there is none.
|
|
46
|
+
*
|
|
47
|
+
* `di.override`, like `OutlinePanelExtension`, so a later registration always
|
|
48
|
+
* wins and registering twice never throws at boot.
|
|
49
|
+
*/
|
|
50
|
+
export declare function PropertiesPanelExtension(service: PropertiesPanelService | null): ExtensionType;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createIdentifier } from '../../global/di/index.js';
|
|
2
|
+
export const PropertiesPanelProvider = createIdentifier('LabrePropertiesPanel');
|
|
3
|
+
/**
|
|
4
|
+
* Host seam: the host's properties panel, or `null` to say there is none.
|
|
5
|
+
*
|
|
6
|
+
* `di.override`, like `OutlinePanelExtension`, so a later registration always
|
|
7
|
+
* wins and registering twice never throws at boot.
|
|
8
|
+
*/
|
|
9
|
+
export function PropertiesPanelExtension(service) {
|
|
10
|
+
return {
|
|
11
|
+
setup: di => {
|
|
12
|
+
// `null` rides through the factory on purpose: `getOptional` then
|
|
13
|
+
// reports the panel as absent, which is the whole "no button" story.
|
|
14
|
+
di.override(PropertiesPanelProvider, () => service);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { ExtensionType } from '../../store/index.js';
|
|
2
|
+
import type { ReadonlySignal } from '@preact/signals-core';
|
|
3
|
+
/**
|
|
4
|
+
* `TitleBandProvider` — the one seam that feeds the band of property chips
|
|
5
|
+
* under the page title and at the head of the page's note on the canvas
|
|
6
|
+
* (ADR 0035 §9d and §11, REQ-PR-1 and PR-7).
|
|
7
|
+
*
|
|
8
|
+
* **No value lives in the document.** A page's property values are the
|
|
9
|
+
* host's (the Labre app keeps them in SQL, labre ADR-0047); the library reads
|
|
10
|
+
* them here, draws them, and hands every edit back through `set`. It never
|
|
11
|
+
* learns where they live, never caches them and never applies a value itself:
|
|
12
|
+
* the host's store does, and owns the rollback.
|
|
13
|
+
*
|
|
14
|
+
* Not `PivotPropertiesProvider` (ADR 0006): that seam is keyed by an element's
|
|
15
|
+
* `pivotDocId`, read-only, with its own value union; this one is keyed by a
|
|
16
|
+
* document, written, and speaks the data-view property types, so a chip and a
|
|
17
|
+
* database cell read the same `type`, `data` and value.
|
|
18
|
+
*
|
|
19
|
+
* Absent, there is no band at all: no chips, no "+", no panel button, no "Not
|
|
20
|
+
* shown in this document" row, and nothing else changes.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* One visible property of a page's sheet, in the order the band draws it.
|
|
24
|
+
*
|
|
25
|
+
* `type` and `data` are a data-view property type and its config (`select`
|
|
26
|
+
* with `{ options }`, `number` with `{ format }`, …); `value` is the JSON a
|
|
27
|
+
* data-view cell of that type holds (`select`: an option id, `multi-select`:
|
|
28
|
+
* option ids, `date`: epoch milliseconds, `checkbox`: a boolean, text types: a
|
|
29
|
+
* string). `null` or `undefined` is an empty value, drawn as an empty chip
|
|
30
|
+
* that can still be clicked (REQ-PR-1).
|
|
31
|
+
*
|
|
32
|
+
* Visibility is resolved by the host: what is in the list is visible, in that
|
|
33
|
+
* order, including a visible property with no value.
|
|
34
|
+
*/
|
|
35
|
+
export interface TitleBandProperty {
|
|
36
|
+
/** Stable, host-defined id; what `set` receives back. */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Whose definition this is: the workspace's, or the database's of a row. */
|
|
39
|
+
namespace: 'workspace' | 'database';
|
|
40
|
+
/** Display name, already localized by the host. */
|
|
41
|
+
name: string;
|
|
42
|
+
/** A data-view property type (`text`, `number`, `select`, …). */
|
|
43
|
+
type: string;
|
|
44
|
+
/** That type's config, as a data-view property holds it. */
|
|
45
|
+
data: Record<string, unknown>;
|
|
46
|
+
/** The JSON a data-view cell of that type holds; nullish is empty. */
|
|
47
|
+
value: unknown;
|
|
48
|
+
/** A read-only property draws its chip and opens no editor. */
|
|
49
|
+
readonly: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The state of one page's sheet. Same four states as ADR 0006: the signal may
|
|
53
|
+
* start at `loading` and settle later, and the library never awaits it.
|
|
54
|
+
*/
|
|
55
|
+
export type TitleBandSheetState = {
|
|
56
|
+
status: 'loading';
|
|
57
|
+
} | {
|
|
58
|
+
status: 'ready';
|
|
59
|
+
properties: readonly TitleBandProperty[];
|
|
60
|
+
}
|
|
61
|
+
/** The page has no sheet this viewer may read. The band draws nothing. */
|
|
62
|
+
| {
|
|
63
|
+
status: 'missing';
|
|
64
|
+
} | {
|
|
65
|
+
status: 'error';
|
|
66
|
+
reason?: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* A child page this document holds but does not display (labre ADR-0045):
|
|
70
|
+
* the host decides what belongs here, the library never computes a parent or
|
|
71
|
+
* a child.
|
|
72
|
+
*/
|
|
73
|
+
export interface TitleBandNotShownPage {
|
|
74
|
+
docId: string;
|
|
75
|
+
/** The page's title; an empty one is drawn as "Untitled". */
|
|
76
|
+
title: string;
|
|
77
|
+
}
|
|
78
|
+
export interface TitleBandService {
|
|
79
|
+
/**
|
|
80
|
+
* The sheet of document `docId`. MUST return synchronously and MUST NOT
|
|
81
|
+
* throw; the same signal for the same document is the host's business (the
|
|
82
|
+
* band asks once per mounted document).
|
|
83
|
+
*/
|
|
84
|
+
sheet$(docId: string): ReadonlySignal<TitleBandSheetState>;
|
|
85
|
+
/**
|
|
86
|
+
* Write one value. The band shows the chip as pending until the promise
|
|
87
|
+
* settles and never applies the value itself: the new value arrives through
|
|
88
|
+
* `sheet$`. A rejection is the host's to report and roll back; the band only
|
|
89
|
+
* clears its pending state. `value` is `null` to clear.
|
|
90
|
+
*/
|
|
91
|
+
set(docId: string, propertyId: string, value: unknown): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* The band's "+" (REQ-PR-4): what it does is the host's (open the
|
|
94
|
+
* workspace's property settings, or create a database property directly
|
|
95
|
+
* on a row). Absent, there is no "+".
|
|
96
|
+
*/
|
|
97
|
+
add?(docId: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* Whether the band is collapsed for this document. The host decides where
|
|
100
|
+
* that is remembered (the Labre app: per device, REQ-PR-6). Absent, the
|
|
101
|
+
* band opens expanded every time and a collapse lasts while it is mounted.
|
|
102
|
+
*/
|
|
103
|
+
collapsed$?(docId: string): ReadonlySignal<boolean>;
|
|
104
|
+
setCollapsed?(docId: string, collapsed: boolean): void;
|
|
105
|
+
/**
|
|
106
|
+
* The child pages this document holds but does not display. Read **in the
|
|
107
|
+
* canvas view only**, drawn in the note header as a "Not shown in this
|
|
108
|
+
* document" row of page links that open through the linked-document path
|
|
109
|
+
* (`RefNodeSlotsProvider.docLinkClicked`). In the page view the host draws
|
|
110
|
+
* that row under the title itself, so a document never shows two. Absent
|
|
111
|
+
* or empty, no row.
|
|
112
|
+
*/
|
|
113
|
+
notShown$?(docId: string): ReadonlySignal<readonly TitleBandNotShownPage[]>;
|
|
114
|
+
}
|
|
115
|
+
export declare const TitleBandProvider: import("../../global/di/types.js").ServiceIdentifier<TitleBandService> & (<U extends TitleBandService = TitleBandService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
|
|
116
|
+
/**
|
|
117
|
+
* Host seam: the service that feeds the title band. **No default is
|
|
118
|
+
* registered**: absence is a meaningful state (the playground without a mock,
|
|
119
|
+
* a host with no properties), and the band then draws nothing.
|
|
120
|
+
*
|
|
121
|
+
* `di.override`, so a later registration always wins and registering twice
|
|
122
|
+
* never throws at boot.
|
|
123
|
+
*/
|
|
124
|
+
export declare function TitleBandExtension(service: TitleBandService): ExtensionType;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createIdentifier } from '../../global/di/index.js';
|
|
2
|
+
export const TitleBandProvider = createIdentifier('LabreTitleBand');
|
|
3
|
+
/**
|
|
4
|
+
* Host seam: the service that feeds the title band. **No default is
|
|
5
|
+
* registered**: absence is a meaningful state (the playground without a mock,
|
|
6
|
+
* a host with no properties), and the band then draws nothing.
|
|
7
|
+
*
|
|
8
|
+
* `di.override`, so a later registration always wins and registering twice
|
|
9
|
+
* never throws at boot.
|
|
10
|
+
*/
|
|
11
|
+
export function TitleBandExtension(service) {
|
|
12
|
+
return {
|
|
13
|
+
setup: di => {
|
|
14
|
+
di.override(TitleBandProvider, () => service);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -457,8 +457,8 @@ export declare const ACTION_CANCEL: ChromeWording;
|
|
|
457
457
|
export declare const COLOR_LABEL: ChromeWording;
|
|
458
458
|
export declare const FILL_COLOR_LABEL: ChromeWording;
|
|
459
459
|
/**
|
|
460
|
-
* "Create Linked
|
|
461
|
-
* {@link TOOLBAR_CREATE_LINKED_DOC} above ("Create linked
|
|
460
|
+
* "Create Linked Page" - Title Case, unlike the sentence-case
|
|
461
|
+
* {@link TOOLBAR_CREATE_LINKED_DOC} above ("Create linked page"): a different
|
|
462
462
|
* literal, so it keeps its own key. Said identically by the root block's
|
|
463
463
|
* edgeless "More" sub-menu AND the generic iframe embed's own toolbar. Was
|
|
464
464
|
* `ROOT_TOOLBAR_CREATE_LINKED_DOC` (`blocks/root`).
|
|
@@ -516,7 +516,7 @@ export declare const TOOLBAR_UNGROUP: ChromeWording;
|
|
|
516
516
|
*/
|
|
517
517
|
export declare const MINDMAP_NAME: ChromeWording;
|
|
518
518
|
/**
|
|
519
|
-
* "New
|
|
519
|
+
* "New Page" — the "@" menu's own popover group, said identically by the
|
|
520
520
|
* linked-doc embed's slash-menu item. Was `LINKED_DOC_NEW_DOC`
|
|
521
521
|
* (`widgets/linked-doc`).
|
|
522
522
|
*/
|
|
@@ -38,15 +38,15 @@ export const TOAST_COPIED_TO_CLIPBOARD = [
|
|
|
38
38
|
];
|
|
39
39
|
export const TOAST_LINKED_DOC_CREATED = [
|
|
40
40
|
'com.labre.toast.linked-doc-created',
|
|
41
|
-
'Linked
|
|
41
|
+
'Linked page created',
|
|
42
42
|
];
|
|
43
43
|
export const TOAST_NOTE_REMOVED_FROM_PAGE = [
|
|
44
44
|
'com.labre.toast.note-removed-from-page-mode',
|
|
45
|
-
'Note removed from
|
|
45
|
+
'Note removed from Page Mode',
|
|
46
46
|
];
|
|
47
47
|
export const TOAST_FRAME_INSERTED_INTO_PAGE = [
|
|
48
48
|
'com.labre.toast.frame-inserted-into-page',
|
|
49
|
-
'Frame inserted into
|
|
49
|
+
'Frame inserted into Page.',
|
|
50
50
|
];
|
|
51
51
|
export const TOAST_NO_LINK_FOUND = [
|
|
52
52
|
'com.labre.toast.no-link-found',
|
|
@@ -90,7 +90,7 @@ export const TOOLBAR_MORE = ['com.labre.toolbar.more', 'More'];
|
|
|
90
90
|
export const TOOLBAR_LINK = ['com.labre.toolbar.link', 'Link'];
|
|
91
91
|
export const TOOLBAR_CREATE_LINKED_DOC = [
|
|
92
92
|
'com.labre.toolbar.create-linked-doc',
|
|
93
|
-
'Create linked
|
|
93
|
+
'Create linked page',
|
|
94
94
|
];
|
|
95
95
|
export const TOOLBAR_DRAW_CONNECTOR = [
|
|
96
96
|
'com.labre.toolbar.draw-connector',
|
|
@@ -147,19 +147,19 @@ export const TOOLBAR_EMBED_VIEW = [
|
|
|
147
147
|
*/
|
|
148
148
|
export const LINKED_DOC_DELETED = [
|
|
149
149
|
'com.labre.embed.linked-doc.deleted',
|
|
150
|
-
'This linked
|
|
150
|
+
'This linked page is deleted.',
|
|
151
151
|
];
|
|
152
152
|
export const LINKED_DOC_FAILED = [
|
|
153
153
|
'com.labre.embed.linked-doc.failed',
|
|
154
|
-
'This linked
|
|
154
|
+
'This linked page failed to load.',
|
|
155
155
|
];
|
|
156
156
|
export const LINKED_DOC_EMPTY_PREVIEW = [
|
|
157
157
|
'com.labre.embed.linked-doc.empty-preview',
|
|
158
|
-
'Preview of the
|
|
158
|
+
'Preview of the page will be displayed here.',
|
|
159
159
|
];
|
|
160
160
|
export const SYNCED_DOC_EMPTY_PREVIEW = [
|
|
161
161
|
'com.labre.embed.synced-doc.empty-preview',
|
|
162
|
-
'Preview of the
|
|
162
|
+
'Preview of the page will be displayed here.',
|
|
163
163
|
];
|
|
164
164
|
/* ── The board toolbars every framework shares ────────────────────────── */
|
|
165
165
|
/**
|
|
@@ -615,7 +615,7 @@ export const CHROME_UNTITLED = DOC_UNTITLED;
|
|
|
615
615
|
/** The doc-display-meta service's own fallback for a doc that no longer exists. */
|
|
616
616
|
export const CHROME_DELETED_DOC = [
|
|
617
617
|
'com.labre.doc.deleted',
|
|
618
|
-
'Deleted
|
|
618
|
+
'Deleted page',
|
|
619
619
|
];
|
|
620
620
|
/* ── Palette swatch names (default theme) ──────────────────────────────
|
|
621
621
|
*
|
|
@@ -908,7 +908,7 @@ export const TOOLBAR_PLAYBACK_SETTINGS = [
|
|
|
908
908
|
];
|
|
909
909
|
export const TOOLBAR_OPEN_THIS_DOC = [
|
|
910
910
|
'com.labre.toolbar.open-this-doc',
|
|
911
|
-
'Open this
|
|
911
|
+
'Open this page',
|
|
912
912
|
];
|
|
913
913
|
/**
|
|
914
914
|
* The card-style switcher's four wordings — the bookmark's, the linked-doc
|
|
@@ -993,7 +993,7 @@ export const DISPLAY_MODE_EDGELESS = [
|
|
|
993
993
|
];
|
|
994
994
|
export const DISPLAY_MODE_PAGE = [
|
|
995
995
|
'com.labre.note.display-mode.page',
|
|
996
|
-
'
|
|
996
|
+
'Page',
|
|
997
997
|
];
|
|
998
998
|
export const DISPLAY_MODE_SHOW_IN = [
|
|
999
999
|
'com.labre.note.display-mode.show-in',
|
|
@@ -1024,15 +1024,15 @@ export const FILL_COLOR_LABEL = [
|
|
|
1024
1024
|
'Fill color',
|
|
1025
1025
|
];
|
|
1026
1026
|
/**
|
|
1027
|
-
* "Create Linked
|
|
1028
|
-
* {@link TOOLBAR_CREATE_LINKED_DOC} above ("Create linked
|
|
1027
|
+
* "Create Linked Page" - Title Case, unlike the sentence-case
|
|
1028
|
+
* {@link TOOLBAR_CREATE_LINKED_DOC} above ("Create linked page"): a different
|
|
1029
1029
|
* literal, so it keeps its own key. Said identically by the root block's
|
|
1030
1030
|
* edgeless "More" sub-menu AND the generic iframe embed's own toolbar. Was
|
|
1031
1031
|
* `ROOT_TOOLBAR_CREATE_LINKED_DOC` (`blocks/root`).
|
|
1032
1032
|
*/
|
|
1033
1033
|
export const TOOLBAR_CREATE_LINKED_DOC_TITLE = [
|
|
1034
1034
|
'com.labre.root.toolbar.create-linked-doc',
|
|
1035
|
-
'Create Linked
|
|
1035
|
+
'Create Linked Page',
|
|
1036
1036
|
];
|
|
1037
1037
|
/**
|
|
1038
1038
|
* "Turn into" — the block toolbar's conversions dropdown, said identically by
|
|
@@ -1090,7 +1090,7 @@ export const IMAGE_LABEL = ['com.labre.image.label', 'Image'];
|
|
|
1090
1090
|
*/
|
|
1091
1091
|
export const TOOLBAR_INSERT_INTO_PAGE = [
|
|
1092
1092
|
'com.labre.frame.toolbar.insert-into-page',
|
|
1093
|
-
'Insert into
|
|
1093
|
+
'Insert into Page',
|
|
1094
1094
|
];
|
|
1095
1095
|
/**
|
|
1096
1096
|
* "Ungroup" — a group's own surface-toolbar action, said identically by a
|
|
@@ -1110,13 +1110,13 @@ export const MINDMAP_NAME = [
|
|
|
1110
1110
|
'Mind Map',
|
|
1111
1111
|
];
|
|
1112
1112
|
/**
|
|
1113
|
-
* "New
|
|
1113
|
+
* "New Page" — the "@" menu's own popover group, said identically by the
|
|
1114
1114
|
* linked-doc embed's slash-menu item. Was `LINKED_DOC_NEW_DOC`
|
|
1115
1115
|
* (`widgets/linked-doc`).
|
|
1116
1116
|
*/
|
|
1117
1117
|
export const NEW_DOC_LABEL = [
|
|
1118
1118
|
'com.labre.linked-doc.group.new-doc',
|
|
1119
|
-
'New
|
|
1119
|
+
'New Page',
|
|
1120
1120
|
];
|
|
1121
1121
|
/**
|
|
1122
1122
|
* The artefact catalogue sidepanel's "Other" group header (used inline at its
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** The note-index badge's two tooltips, in page vs. edgeless-only mode. */
|
|
2
2
|
export const AUTO_CONNECT_HIDDEN_ON_PAGE = [
|
|
3
3
|
'com.labre.auto-connect.hidden-on-page',
|
|
4
|
-
'Hidden on
|
|
4
|
+
'Hidden on page',
|
|
5
5
|
];
|
|
6
6
|
export const AUTO_CONNECT_PAGE_MODE_INDEX = [
|
|
7
7
|
'com.labre.auto-connect.page-mode-index',
|
|
8
|
-
'
|
|
8
|
+
'Page mode index',
|
|
9
9
|
];
|
|
10
10
|
/** Every wording this package declares, in the order it renders them. */
|
|
11
11
|
export const AUTO_CONNECT_WORDINGS = [
|
|
@@ -16,7 +16,7 @@ export const AUTO_COMPLETE_ADD_SAME_OBJECT = [
|
|
|
16
16
|
/** The floating "open link" button drawn over a linked element. */
|
|
17
17
|
export const EDGELESS_LINK_OPEN_DOC = [
|
|
18
18
|
'com.labre.edgeless-element-link.open-doc',
|
|
19
|
-
'Open linked
|
|
19
|
+
'Open linked page',
|
|
20
20
|
];
|
|
21
21
|
export const EDGELESS_LINK_OPEN_LINK = [
|
|
22
22
|
'com.labre.edgeless-element-link.open-link',
|
|
@@ -12,7 +12,7 @@ export const LINKED_DOC_FORMAT_HTML = FORMAT_HTML;
|
|
|
12
12
|
/* ── Popover groups (config.ts) ─────────────────────────────────────────── */
|
|
13
13
|
export const LINKED_DOC_LINK_TO_DOC = [
|
|
14
14
|
'com.labre.linked-doc.group.link-to-doc',
|
|
15
|
-
'Link to
|
|
15
|
+
'Link to Page',
|
|
16
16
|
];
|
|
17
17
|
export const LINKED_DOC_NEW_DOC = NEW_DOC_LABEL;
|
|
18
18
|
/**
|
|
@@ -28,7 +28,7 @@ export const LINKED_DOC_IMPORT = [
|
|
|
28
28
|
/** The "Create doc" item's own wording, interpolated with the truncated name. */
|
|
29
29
|
export const LINKED_DOC_CREATE_DOC = [
|
|
30
30
|
'com.labre.linked-doc.create-doc',
|
|
31
|
-
'Create "{{name}}"
|
|
31
|
+
'Create "{{name}}" page',
|
|
32
32
|
];
|
|
33
33
|
/**
|
|
34
34
|
* The import-success toast — `{{count}}` interpolated, the English fallback
|
|
@@ -37,7 +37,7 @@ export const LINKED_DOC_CREATE_DOC = [
|
|
|
37
37
|
*/
|
|
38
38
|
export const LINKED_DOC_IMPORT_SUCCESS_TOAST = [
|
|
39
39
|
'com.labre.linked-doc.import-success',
|
|
40
|
-
'Successfully imported {{count}}
|
|
40
|
+
'Successfully imported {{count}} Page(s).',
|
|
41
41
|
];
|
|
42
42
|
/**
|
|
43
43
|
* The overflow item's own fallback label ("N more docs" is a different
|
|
@@ -133,7 +133,7 @@ export const SLASH_MENU_GROUP_CONTENT_MEDIA = [
|
|
|
133
133
|
];
|
|
134
134
|
export const SLASH_MENU_GROUP_PAGE = [
|
|
135
135
|
'com.labre.slash-menu.group.page',
|
|
136
|
-
'
|
|
136
|
+
'Page',
|
|
137
137
|
];
|
|
138
138
|
export const SLASH_MENU_GROUP_EDGELESS_ELEMENT = [
|
|
139
139
|
'com.labre.slash-menu.group.edgeless-element',
|
|
@@ -18,14 +18,14 @@ export declare const presetPropertyConverts: ({
|
|
|
18
18
|
from: any;
|
|
19
19
|
to: any;
|
|
20
20
|
convert: import("../index.js").ConvertFunction<import("../index.js").PropertyModel<"number", {
|
|
21
|
-
format: "number" | "
|
|
21
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
22
22
|
decimal?: number | undefined;
|
|
23
23
|
}, number | null, number | null>, import("../index.js").PropertyModel<"progress", {}, number, number>>;
|
|
24
24
|
} | {
|
|
25
25
|
from: any;
|
|
26
26
|
to: any;
|
|
27
27
|
convert: import("../index.js").ConvertFunction<import("../index.js").PropertyModel<"progress", {}, number, number>, import("../index.js").PropertyModel<"number", {
|
|
28
|
-
format: "number" | "
|
|
28
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
29
29
|
decimal?: number | undefined;
|
|
30
30
|
}, number | null, number | null>>;
|
|
31
31
|
} | {
|
|
@@ -13,7 +13,7 @@ export declare const propertyPresets: {
|
|
|
13
13
|
}[];
|
|
14
14
|
}, string[], string[]>;
|
|
15
15
|
numberPropertyConfig: import("../index.js").PropertyMetaConfig<"number", {
|
|
16
|
-
format: "number" | "
|
|
16
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
17
17
|
decimal?: number | undefined;
|
|
18
18
|
}, number | null, number | null>;
|
|
19
19
|
progressPropertyConfig: import("../index.js").PropertyMetaConfig<"progress", {}, number, number>;
|
|
@@ -13,6 +13,6 @@ export declare class NumberCell extends BaseCellRenderer<number, number, NumberP
|
|
|
13
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
14
|
}
|
|
15
15
|
export declare const numberPropertyConfig: import("../../index.js").PropertyMetaConfig<"number", {
|
|
16
|
-
format: "number" | "
|
|
16
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
17
17
|
decimal?: number | undefined;
|
|
18
18
|
}, number | null, number | null>;
|
|
@@ -3,6 +3,6 @@ export declare const numberPropertyType: {
|
|
|
3
3
|
modelConfig: <PropertyData extends Record<string, unknown> = Record<string, never>, RawValue = unknown, JsonValue = unknown>(ops: import("../../index.js").PropertyConfig<PropertyData, RawValue, JsonValue>) => import("../../index.js").PropertyModel<"number", PropertyData, RawValue, JsonValue>;
|
|
4
4
|
};
|
|
5
5
|
export declare const numberPropertyModelConfig: import("../../index.js").PropertyModel<"number", {
|
|
6
|
-
format: "number" | "
|
|
6
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
7
7
|
decimal?: number | undefined;
|
|
8
8
|
}, number | null, number | null>;
|
|
@@ -3,10 +3,10 @@ export declare const NumberPropertySchema: zod.ZodObject<{
|
|
|
3
3
|
decimal: zod.ZodOptional<zod.ZodNumber>;
|
|
4
4
|
format: zod.ZodEnum<["number", "numberWithCommas", "percent", "currencyYen", "currencyINR", "currencyCNY", "currencyUSD", "currencyEUR", "currencyGBP"]>;
|
|
5
5
|
}, "strip", zod.ZodTypeAny, {
|
|
6
|
-
format: "number" | "
|
|
6
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
7
7
|
decimal?: number | undefined;
|
|
8
8
|
}, {
|
|
9
|
-
format: "number" | "
|
|
9
|
+
format: "number" | "percent" | "numberWithCommas" | "currencyINR" | "currencyYen" | "currencyCNY" | "currencyUSD" | "currencyEUR" | "currencyGBP";
|
|
10
10
|
decimal?: number | undefined;
|
|
11
11
|
}>;
|
|
12
12
|
export type NumberPropertyDataType = zod.infer<typeof NumberPropertySchema>;
|