@formicoidea/labre-core 0.59.0 → 0.60.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/architecture/code.c4 +83 -81
- package/architecture/domain.c4 +4 -4
- package/architecture/likec4.config.json +3 -3
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-label.d.ts +11 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-label.js +16 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +1 -11
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +2 -11
- package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
- package/dist/_pkgs/affine-block-surface/extensions/toolbox.d.ts +62 -0
- package/dist/_pkgs/affine-block-surface/extensions/toolbox.js +1 -0
- package/dist/_pkgs/affine-block-surface/interchange-headless.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/interchange-headless.js +2 -0
- 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-model/elements/c4/board.d.ts +0 -22
- package/dist/_pkgs/affine-model/elements/c4/board.js +1 -22
- package/dist/_pkgs/affine-model/elements/c4/consts.d.ts +29 -0
- package/dist/_pkgs/affine-model/elements/c4/consts.js +29 -0
- package/dist/_pkgs/affine-model/elements/c4/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/c4/index.js +1 -0
- package/dist/_pkgs/affine-model/headless.d.ts +1 -0
- package/dist/_pkgs/affine-model/headless.js +1 -0
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
- package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "blocksuite"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "blocksuite"
|
|
3
|
+
}
|
|
@@ -10,6 +10,7 @@ export * from './element-renderer.js';
|
|
|
10
10
|
export * from './export-manager/index.js';
|
|
11
11
|
export * from './export-svg/index.js';
|
|
12
12
|
export * from './interchange.js';
|
|
13
|
+
export * from './toolbox.js';
|
|
13
14
|
export * from './interchange-export.js';
|
|
14
15
|
export * from './interchange-import.js';
|
|
15
16
|
export * from './legacy-slot-extension.js';
|
|
@@ -10,6 +10,7 @@ export * from './element-renderer.js';
|
|
|
10
10
|
export * from './export-manager/index.js';
|
|
11
11
|
export * from './export-svg/index.js';
|
|
12
12
|
export * from './interchange.js';
|
|
13
|
+
export * from './toolbox.js';
|
|
13
14
|
export * from './interchange-export.js';
|
|
14
15
|
export * from './interchange-import.js';
|
|
15
16
|
export * from './legacy-slot-extension.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ink and the type a notation writes its labels in: the legend box's rows,
|
|
3
|
+
* and the words the DDD prefabs set beside a dot or a marker.
|
|
4
|
+
*
|
|
5
|
+
* Declared HERE and re-exported by `@labre/affine-gfx-ddd-shared`, rather than
|
|
6
|
+
* the other way round, because that bundle depends on this one and a legend
|
|
7
|
+
* must not depend on a DDD bundle to be drawn.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LABEL_COLOR: string;
|
|
10
|
+
export declare const LABEL_FONT = "blocksuite:surface:Inter";
|
|
11
|
+
export declare const LABEL_FONT_SIZE = 14;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NOTATION_NEUTRALS } from '../../affine-shared/headless.js';
|
|
2
|
+
// Its own module so the headless interchange entry (`./interchange`) can read
|
|
3
|
+
// it without the legend's editor graph: the DDD element builders of
|
|
4
|
+
// `@labre/affine-gfx-ddd-shared/headless` write their captions in these three
|
|
5
|
+
// values (`docs/adr/0045`). `legend.ts` re-exports them unchanged.
|
|
6
|
+
/**
|
|
7
|
+
* The ink and the type a notation writes its labels in: the legend box's rows,
|
|
8
|
+
* and the words the DDD prefabs set beside a dot or a marker.
|
|
9
|
+
*
|
|
10
|
+
* Declared HERE and re-exported by `@labre/affine-gfx-ddd-shared`, rather than
|
|
11
|
+
* the other way round, because that bundle depends on this one and a legend
|
|
12
|
+
* must not depend on a DDD bundle to be drawn.
|
|
13
|
+
*/
|
|
14
|
+
export const LABEL_COLOR = NOTATION_NEUTRALS.ink;
|
|
15
|
+
export const LABEL_FONT = 'blocksuite:surface:Inter';
|
|
16
|
+
export const LABEL_FONT_SIZE = 14;
|
|
@@ -46,17 +46,7 @@ export interface LegendLayout {
|
|
|
46
46
|
}
|
|
47
47
|
/** A block of the box that is not a row. See {@link CommandLegendBox.extras}. */
|
|
48
48
|
export type LegendExtra = CommandLegendExtra;
|
|
49
|
-
|
|
50
|
-
* The ink and the type a notation writes its labels in: this box's rows, and
|
|
51
|
-
* the words the DDD prefabs set beside a dot or a marker.
|
|
52
|
-
*
|
|
53
|
-
* Declared HERE and re-exported by `@labre/affine-gfx-ddd-shared`, rather than
|
|
54
|
-
* the other way round, because that bundle depends on this one and a legend
|
|
55
|
-
* must not depend on a DDD bundle to be drawn.
|
|
56
|
-
*/
|
|
57
|
-
export declare const LABEL_COLOR: string;
|
|
58
|
-
export declare const LABEL_FONT = "blocksuite:surface:Inter";
|
|
59
|
-
export declare const LABEL_FONT_SIZE = 14;
|
|
49
|
+
export { LABEL_COLOR, LABEL_FONT, LABEL_FONT_SIZE } from './legend-label.js';
|
|
60
50
|
export { LEGEND_ROLE };
|
|
61
51
|
/**
|
|
62
52
|
* How big the box {@link addLegend} would draw for these sections is — without
|
|
@@ -5,18 +5,9 @@ import { Bound } from '../../global/gfx/index.js';
|
|
|
5
5
|
import { CATALOGUE_CATEGORY_KEY_PREFIX, getRegisteredCommands, humanizeCategory, } from '../../std/index.js';
|
|
6
6
|
import { GfxControllerIdentifier, roleIsA, RoleVocabularyIdentifier, } from '../../std/gfx/index.js';
|
|
7
7
|
import { EdgelessCRUDIdentifier } from './crud-extension.js';
|
|
8
|
+
import { LABEL_COLOR, LABEL_FONT, LABEL_FONT_SIZE } from './legend-label.js';
|
|
8
9
|
import { LEGEND_ROLE } from './legend-role.js';
|
|
9
|
-
|
|
10
|
-
* The ink and the type a notation writes its labels in: this box's rows, and
|
|
11
|
-
* the words the DDD prefabs set beside a dot or a marker.
|
|
12
|
-
*
|
|
13
|
-
* Declared HERE and re-exported by `@labre/affine-gfx-ddd-shared`, rather than
|
|
14
|
-
* the other way round, because that bundle depends on this one and a legend
|
|
15
|
-
* must not depend on a DDD bundle to be drawn.
|
|
16
|
-
*/
|
|
17
|
-
export const LABEL_COLOR = NOTATION_NEUTRALS.ink;
|
|
18
|
-
export const LABEL_FONT = 'blocksuite:surface:Inter';
|
|
19
|
-
export const LABEL_FONT_SIZE = 14;
|
|
10
|
+
export { LABEL_COLOR, LABEL_FONT, LABEL_FONT_SIZE } from './legend-label.js';
|
|
20
11
|
const NO_STROKE = '#00000000';
|
|
21
12
|
/**
|
|
22
13
|
* The box's geometry, in one place because two callers need it: the one that
|
|
@@ -58,18 +58,18 @@ const READ_LABEL_FALLBACK = 'Read this component';
|
|
|
58
58
|
* Drawn inline like its neighbours: this package does not depend on
|
|
59
59
|
* `@blocksuite/icons` and one glyph is not worth a new dependency.
|
|
60
60
|
*/
|
|
61
|
-
const ReadIcon = html `<svg
|
|
62
|
-
width="20"
|
|
63
|
-
height="20"
|
|
64
|
-
viewBox="0 0 24 24"
|
|
65
|
-
fill="none"
|
|
66
|
-
stroke="currentColor"
|
|
67
|
-
stroke-width="2"
|
|
68
|
-
stroke-linecap="round"
|
|
69
|
-
stroke-linejoin="round"
|
|
70
|
-
>
|
|
71
|
-
<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6z" />
|
|
72
|
-
<circle cx="12" cy="12" r="3" />
|
|
61
|
+
const ReadIcon = html `<svg
|
|
62
|
+
width="20"
|
|
63
|
+
height="20"
|
|
64
|
+
viewBox="0 0 24 24"
|
|
65
|
+
fill="none"
|
|
66
|
+
stroke="currentColor"
|
|
67
|
+
stroke-width="2"
|
|
68
|
+
stroke-linecap="round"
|
|
69
|
+
stroke-linejoin="round"
|
|
70
|
+
>
|
|
71
|
+
<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6z" />
|
|
72
|
+
<circle cx="12" cy="12" r="3" />
|
|
73
73
|
</svg>`;
|
|
74
74
|
/** The command this module drives. Spelled once. */
|
|
75
75
|
const ELEMENT_READ_ID = 'element.read';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SerializedElementProps } from './interchange.js';
|
|
2
|
+
/**
|
|
3
|
+
* A framework's TOOLBOX, with no editor behind it (`docs/adr/0045`): every
|
|
4
|
+
* item of its toolbar as a pure builder, so a host with no editor — the Labre
|
|
5
|
+
* workspace connector, labre-mcp — places the very elements a user places
|
|
6
|
+
* from the toolbar, never shapes that imitate them.
|
|
7
|
+
*
|
|
8
|
+
* ## The same contract as a reader's result
|
|
9
|
+
*
|
|
10
|
+
* A builder returns what an import capability returns (ADR 0012 D3): element
|
|
11
|
+
* props in painting order, each composite's members before the group that
|
|
12
|
+
* holds them, and LOCAL `id`s the group's `children` and a link's ends name.
|
|
13
|
+
* `surface.addElement` mints the real ids and the materializer
|
|
14
|
+
* (`materializeInterchangeImport`) rewrites the references, so one writer
|
|
15
|
+
* serves a whole file read by a reader and one item built here.
|
|
16
|
+
*
|
|
17
|
+
* ## What a builder does not do
|
|
18
|
+
*
|
|
19
|
+
* It places ONE item at the point it is given: where things go on a board is
|
|
20
|
+
* the caller's. It writes the texts it is given, or the English seed: a seed
|
|
21
|
+
* in the host's language is resolved by the editor's creation site, which has
|
|
22
|
+
* the catalogue (ADR 0023). It persists nothing.
|
|
23
|
+
*/
|
|
24
|
+
/** Where an item lands: the top-left of its box, in canvas units. */
|
|
25
|
+
export interface ToolboxPoint {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
}
|
|
29
|
+
/** One toolbar item that places elements. */
|
|
30
|
+
export interface ToolboxItem {
|
|
31
|
+
/** Stable within the framework, kebab-case: `container`, `system-boundary`. */
|
|
32
|
+
readonly id: string;
|
|
33
|
+
/** The toolbar command's own label, so a host names it as the toolbar does. */
|
|
34
|
+
readonly labelKey: string;
|
|
35
|
+
readonly labelFallback: string;
|
|
36
|
+
/** The text slots `build` fills, in reading order (`title`, `description`…). */
|
|
37
|
+
readonly texts: readonly string[];
|
|
38
|
+
/** The box the item is born with. */
|
|
39
|
+
readonly size: {
|
|
40
|
+
readonly w: number;
|
|
41
|
+
readonly h: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The elements, with local ids and the group last. `local` prefixes those
|
|
45
|
+
* ids, so two items built for one batch never share a name.
|
|
46
|
+
*/
|
|
47
|
+
build(at: ToolboxPoint, texts?: Readonly<Record<string, string>>, local?: string): SerializedElementProps[];
|
|
48
|
+
}
|
|
49
|
+
/** One relation style of the framework: a connector between two elements. */
|
|
50
|
+
export interface ToolboxLink {
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly labelKey: string;
|
|
53
|
+
readonly labelFallback: string;
|
|
54
|
+
/** The connector props; `from` and `to` are element ids or local ids. */
|
|
55
|
+
build(from: string, to: string, label?: string): SerializedElementProps;
|
|
56
|
+
}
|
|
57
|
+
export interface FrameworkToolbox {
|
|
58
|
+
/** The framework's descriptor id (`c4`, `bpmn`…). */
|
|
59
|
+
readonly framework: string;
|
|
60
|
+
readonly items: readonly ToolboxItem[];
|
|
61
|
+
readonly links: readonly ToolboxLink[];
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export * from './extensions/export-svg/marker-version.js';
|
|
20
20
|
export * from './extensions/interchange.js';
|
|
21
|
+
export * from './extensions/toolbox.js';
|
|
22
|
+
export * from './extensions/legend-label.js';
|
|
21
23
|
export * from './extensions/legend-role.js';
|
|
22
24
|
export * from './extensions/svg-sanitize.js';
|
|
23
25
|
export * from './extensions/svg-sketch.js';
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export * from './extensions/export-svg/marker-version.js';
|
|
20
20
|
export * from './extensions/interchange.js';
|
|
21
|
+
export * from './extensions/toolbox.js';
|
|
22
|
+
export * from './extensions/legend-label.js';
|
|
21
23
|
export * from './extensions/legend-role.js';
|
|
22
24
|
export * from './extensions/svg-sanitize.js';
|
|
23
25
|
export * from './extensions/svg-sketch.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HighLightDuotoneIcon } from '@blocksuite/icons/lit';
|
|
2
2
|
import { css, LitElement } from 'lit';
|
|
3
3
|
export class HighlightDuotoneIcon extends LitElement {
|
|
4
|
-
static { this.styles = css `
|
|
5
|
-
svg {
|
|
6
|
-
display: flex;
|
|
7
|
-
font-size: 20px;
|
|
8
|
-
}
|
|
9
|
-
svg > path:nth-child(1) {
|
|
10
|
-
fill: var(--color, unset);
|
|
11
|
-
}
|
|
4
|
+
static { this.styles = css `
|
|
5
|
+
svg {
|
|
6
|
+
display: flex;
|
|
7
|
+
font-size: 20px;
|
|
8
|
+
}
|
|
9
|
+
svg > path:nth-child(1) {
|
|
10
|
+
fill: var(--color, unset);
|
|
11
|
+
}
|
|
12
12
|
`; }
|
|
13
13
|
render() {
|
|
14
14
|
return HighLightDuotoneIcon();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TextBackgroundDuotoneIcon } from '@blocksuite/icons/lit';
|
|
2
2
|
import { css, LitElement } from 'lit';
|
|
3
3
|
export class TextDuotoneIcon extends LitElement {
|
|
4
|
-
static { this.styles = css `
|
|
5
|
-
svg {
|
|
6
|
-
display: flex;
|
|
7
|
-
font-size: 20px;
|
|
8
|
-
}
|
|
9
|
-
svg > path:nth-child(1) {
|
|
10
|
-
fill: var(--background, unset);
|
|
11
|
-
}
|
|
12
|
-
svg > path:nth-child(3) {
|
|
13
|
-
fill: var(--color, unset);
|
|
14
|
-
}
|
|
4
|
+
static { this.styles = css `
|
|
5
|
+
svg {
|
|
6
|
+
display: flex;
|
|
7
|
+
font-size: 20px;
|
|
8
|
+
}
|
|
9
|
+
svg > path:nth-child(1) {
|
|
10
|
+
fill: var(--background, unset);
|
|
11
|
+
}
|
|
12
|
+
svg > path:nth-child(3) {
|
|
13
|
+
fill: var(--color, unset);
|
|
14
|
+
}
|
|
15
15
|
`; }
|
|
16
16
|
render() {
|
|
17
17
|
return TextBackgroundDuotoneIcon();
|
|
@@ -2,28 +2,6 @@ import type { SerializedXYWH } from '../../../global/gfx/index.js';
|
|
|
2
2
|
import type { PointTestOptions } from '../../../std/gfx/index.js';
|
|
3
3
|
import type { FrameworkBackgroundProps } from '../framework-background/index.js';
|
|
4
4
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Height of the board's title band — the header strip across the top of the
|
|
7
|
-
* sheet the diagram title is written in, in model units.
|
|
8
|
-
*
|
|
9
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-c4` rather
|
|
10
|
-
* than the other way round, for the reason `POOL_BAND_WIDTH` is: the
|
|
11
|
-
* board's own hit test needs it (a board is clickable by its title band as well
|
|
12
|
-
* as its border), and `affine-model` cannot reach into `affine-block-surface`
|
|
13
|
-
* where the declaration is resolved. One number, owned by the layer that both
|
|
14
|
-
* the declaration and the hit test can read.
|
|
15
|
-
*
|
|
16
|
-
* It is the board's TOP MARGIN, and it always was — the deep inset the plot
|
|
17
|
-
* gives up so the title has somewhere to be written. Naming it says out loud
|
|
18
|
-
* what was already true, so the strip that is painted, the strip that is picked
|
|
19
|
-
* and the strip that opens the rename are one number rather than three.
|
|
20
|
-
*
|
|
21
|
-
* 56 is what the title has been written in since the pack shipped: a 20-unit
|
|
22
|
-
* title, sitting on a baseline a third of the band up from its foot, with the
|
|
23
|
-
* rest as breathing room above and below. Changing it moves the title, so it is
|
|
24
|
-
* a visual decision and not a hit-test one.
|
|
25
|
-
*/
|
|
26
|
-
export declare const C4_BOARD_TITLE_BAND_HEIGHT = 56;
|
|
27
5
|
/**
|
|
28
6
|
* Which of C4's levels this board draws — the DECLARED fact, as opposed to the
|
|
29
7
|
* title, which is free text and says whatever its author wants it to.
|
|
@@ -35,28 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { rotatePoint } from '../../../global/gfx/index.js';
|
|
36
36
|
import { field } from '../../../std/gfx/index.js';
|
|
37
37
|
import { FrameworkBackgroundElementModel } from '../framework-background/index.js';
|
|
38
|
-
|
|
39
|
-
* Height of the board's title band — the header strip across the top of the
|
|
40
|
-
* sheet the diagram title is written in, in model units.
|
|
41
|
-
*
|
|
42
|
-
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-c4` rather
|
|
43
|
-
* than the other way round, for the reason `POOL_BAND_WIDTH` is: the
|
|
44
|
-
* board's own hit test needs it (a board is clickable by its title band as well
|
|
45
|
-
* as its border), and `affine-model` cannot reach into `affine-block-surface`
|
|
46
|
-
* where the declaration is resolved. One number, owned by the layer that both
|
|
47
|
-
* the declaration and the hit test can read.
|
|
48
|
-
*
|
|
49
|
-
* It is the board's TOP MARGIN, and it always was — the deep inset the plot
|
|
50
|
-
* gives up so the title has somewhere to be written. Naming it says out loud
|
|
51
|
-
* what was already true, so the strip that is painted, the strip that is picked
|
|
52
|
-
* and the strip that opens the rename are one number rather than three.
|
|
53
|
-
*
|
|
54
|
-
* 56 is what the title has been written in since the pack shipped: a 20-unit
|
|
55
|
-
* title, sitting on a baseline a third of the band up from its foot, with the
|
|
56
|
-
* rest as breathing room above and below. Changing it moves the title, so it is
|
|
57
|
-
* a visual decision and not a hit-test one.
|
|
58
|
-
*/
|
|
59
|
-
export const C4_BOARD_TITLE_BAND_HEIGHT = 56;
|
|
38
|
+
import { C4_BOARD_TITLE_BAND_HEIGHT } from './consts.js';
|
|
60
39
|
/**
|
|
61
40
|
* The C4 board: the sheet one diagram of the model is drawn on — a context
|
|
62
41
|
* diagram, a container diagram, a component diagram. A framework background like
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants moved out of the element-class files of this folder, unchanged, so
|
|
3
|
+
* the model's headless entry (`@labre/affine-model/headless`) exports them
|
|
4
|
+
* without `@labre/std/gfx` behind them (ADR 0012, P3 as amended 2026-10-14;
|
|
5
|
+
* the C4 toolbox of `docs/adr/0045` reads the board's metrics from there).
|
|
6
|
+
* The folder index re-exports this file.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Height of the board's title band — the header strip across the top of the
|
|
10
|
+
* sheet the diagram title is written in, in model units.
|
|
11
|
+
*
|
|
12
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-c4` rather
|
|
13
|
+
* than the other way round, for the reason `POOL_BAND_WIDTH` is: the
|
|
14
|
+
* board's own hit test needs it (a board is clickable by its title band as well
|
|
15
|
+
* as its border), and `affine-model` cannot reach into `affine-block-surface`
|
|
16
|
+
* where the declaration is resolved. One number, owned by the layer that both
|
|
17
|
+
* the declaration and the hit test can read.
|
|
18
|
+
*
|
|
19
|
+
* It is the board's TOP MARGIN, and it always was — the deep inset the plot
|
|
20
|
+
* gives up so the title has somewhere to be written. Naming it says out loud
|
|
21
|
+
* what was already true, so the strip that is painted, the strip that is picked
|
|
22
|
+
* and the strip that opens the rename are one number rather than three.
|
|
23
|
+
*
|
|
24
|
+
* 56 is what the title has been written in since the pack shipped: a 20-unit
|
|
25
|
+
* title, sitting on a baseline a third of the band up from its foot, with the
|
|
26
|
+
* rest as breathing room above and below. Changing it moves the title, so it is
|
|
27
|
+
* a visual decision and not a hit-test one.
|
|
28
|
+
*/
|
|
29
|
+
export declare const C4_BOARD_TITLE_BAND_HEIGHT = 56;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants moved out of the element-class files of this folder, unchanged, so
|
|
3
|
+
* the model's headless entry (`@labre/affine-model/headless`) exports them
|
|
4
|
+
* without `@labre/std/gfx` behind them (ADR 0012, P3 as amended 2026-10-14;
|
|
5
|
+
* the C4 toolbox of `docs/adr/0045` reads the board's metrics from there).
|
|
6
|
+
* The folder index re-exports this file.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Height of the board's title band — the header strip across the top of the
|
|
10
|
+
* sheet the diagram title is written in, in model units.
|
|
11
|
+
*
|
|
12
|
+
* Declared HERE, in the model, and re-exported by `@labre/affine-gfx-c4` rather
|
|
13
|
+
* than the other way round, for the reason `POOL_BAND_WIDTH` is: the
|
|
14
|
+
* board's own hit test needs it (a board is clickable by its title band as well
|
|
15
|
+
* as its border), and `affine-model` cannot reach into `affine-block-surface`
|
|
16
|
+
* where the declaration is resolved. One number, owned by the layer that both
|
|
17
|
+
* the declaration and the hit test can read.
|
|
18
|
+
*
|
|
19
|
+
* It is the board's TOP MARGIN, and it always was — the deep inset the plot
|
|
20
|
+
* gives up so the title has somewhere to be written. Naming it says out loud
|
|
21
|
+
* what was already true, so the strip that is painted, the strip that is picked
|
|
22
|
+
* and the strip that opens the rename are one number rather than three.
|
|
23
|
+
*
|
|
24
|
+
* 56 is what the title has been written in since the pack shipped: a 20-unit
|
|
25
|
+
* title, sitting on a baseline a third of the band up from its foot, with the
|
|
26
|
+
* rest as breathing room above and below. Changing it moves the title, so it is
|
|
27
|
+
* a visual decision and not a hit-test one.
|
|
28
|
+
*/
|
|
29
|
+
export const C4_BOARD_TITLE_BAND_HEIGHT = 56;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export * from './consts/index.js';
|
|
15
15
|
export * from './elements/bpmn/consts.js';
|
|
16
|
+
export * from './elements/c4/consts.js';
|
|
16
17
|
export * from './elements/connector/end-label.js';
|
|
17
18
|
export { DEFAULT_POLYGON_VERTICES } from './elements/shape/api/polygon.js';
|
|
18
19
|
export * from './elements/uml/consts.js';
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export * from './consts/index.js';
|
|
15
15
|
export * from './elements/bpmn/consts.js';
|
|
16
|
+
export * from './elements/c4/consts.js';
|
|
16
17
|
export * from './elements/connector/end-label.js';
|
|
17
18
|
export { DEFAULT_POLYGON_VERTICES } from './elements/shape/api/polygon.js';
|
|
18
19
|
export * from './elements/uml/consts.js';
|
|
@@ -52,29 +52,29 @@ let AffineEdgelessZoomToolbarWidget = (() => {
|
|
|
52
52
|
__esDecorate(this, null, __hide_decorators, { kind: "accessor", name: "_hide", static: false, private: false, access: { has: obj => "_hide" in obj, get: obj => obj._hide, set: (obj, value) => { obj._hide = value; } }, metadata: _metadata }, __hide_initializers, __hide_extraInitializers);
|
|
53
53
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
54
54
|
}
|
|
55
|
-
static { this.styles = css `
|
|
56
|
-
:host {
|
|
57
|
-
position: absolute;
|
|
58
|
-
bottom: 20px;
|
|
59
|
-
left: 12px;
|
|
60
|
-
z-index: var(--affine-z-index-popover);
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: center;
|
|
63
|
-
-webkit-user-select: none;
|
|
64
|
-
user-select: none;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@container viewport (width <= 1200px) {
|
|
68
|
-
edgeless-zoom-toolbar {
|
|
69
|
-
display: none;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@container viewport (width > 1200px) {
|
|
74
|
-
zoom-bar-toggle-button {
|
|
75
|
-
display: none;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
55
|
+
static { this.styles = css `
|
|
56
|
+
:host {
|
|
57
|
+
position: absolute;
|
|
58
|
+
bottom: 20px;
|
|
59
|
+
left: 12px;
|
|
60
|
+
z-index: var(--affine-z-index-popover);
|
|
61
|
+
display: flex;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
-webkit-user-select: none;
|
|
64
|
+
user-select: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@container viewport (width <= 1200px) {
|
|
68
|
+
edgeless-zoom-toolbar {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@container viewport (width > 1200px) {
|
|
74
|
+
zoom-bar-toggle-button {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
78
|
`; }
|
|
79
79
|
get edgeless() {
|
|
80
80
|
return this.block;
|
|
@@ -105,9 +105,9 @@ let AffineEdgelessZoomToolbarWidget = (() => {
|
|
|
105
105
|
if (this._hide || !this.edgeless) {
|
|
106
106
|
return nothing;
|
|
107
107
|
}
|
|
108
|
-
return html `
|
|
109
|
-
<edgeless-zoom-toolbar .std=${this.std}></edgeless-zoom-toolbar>
|
|
110
|
-
<zoom-bar-toggle-button .std=${this.std}></zoom-bar-toggle-button>
|
|
108
|
+
return html `
|
|
109
|
+
<edgeless-zoom-toolbar .std=${this.std}></edgeless-zoom-toolbar>
|
|
110
|
+
<zoom-bar-toggle-button .std=${this.std}></zoom-bar-toggle-button>
|
|
111
111
|
`;
|
|
112
112
|
}
|
|
113
113
|
#_hide_accessor_storage = __runInitializers(this, __hide_initializers, false);
|