@formicoidea/labre-framework-edgy 0.33.0 → 0.34.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/actions.js +6 -3
- package/dist/commands-manifest.d.ts +18 -0
- package/dist/commands-manifest.js +82 -0
- package/dist/element-view.d.ts +14 -0
- package/dist/element-view.js +25 -7
- package/dist/node/consts.d.ts +12 -0
- package/dist/node/consts.js +12 -0
- package/dist/toolbar/config.d.ts +7 -9
- package/dist/toolbar/config.js +13 -7
- package/dist/translations.js +17 -2
- package/dist/view.d.ts +3 -3
- package/dist/view.js +6 -5
- package/package.json +7 -3
package/dist/actions.js
CHANGED
|
@@ -3,10 +3,11 @@ import { ConnectorTool } from '@formicoidea/labre-core/gfx/connector';
|
|
|
3
3
|
import { createGroupCommand } from '@formicoidea/labre-core/gfx/group';
|
|
4
4
|
import { createTemplateJob } from '@formicoidea/labre-core/gfx/template';
|
|
5
5
|
import { ConnectorMode, FontFamily, PointStyle, ShapeStyle, StrokeStyle, } from '@formicoidea/labre-core/model';
|
|
6
|
+
import { translateKey } from '@formicoidea/labre-core/shared/services';
|
|
6
7
|
import { Bound } from '@formicoidea/labre-core/global/gfx';
|
|
7
8
|
import { GfxControllerIdentifier } from '@formicoidea/labre-core/std/gfx';
|
|
8
9
|
import { CROP_LABELED } from './consts.js';
|
|
9
|
-
import { ACTIVITY_VERTICES, INNER_FONT_SIZE, LABEL_FONT_SIZE, LABEL_GAP, NODE_FILL, NODE_LABEL, NODE_SIZE, NODE_STROKE, NODE_STROKE_WIDTH, OUTCOME_RADIUS, } from './node/consts.js';
|
|
10
|
+
import { ACTIVITY_VERTICES, INNER_FONT_SIZE, LABEL_FONT_SIZE, LABEL_GAP, NODE_FILL, NODE_LABEL, nodeLabelKey, NODE_SIZE, NODE_STROKE, NODE_STROKE_WIDTH, OUTCOME_RADIUS, } from './node/consts.js';
|
|
10
11
|
import { EDGY_ROLE } from './roles.js';
|
|
11
12
|
import { edgyDynamicTemplate } from './templates/index.js';
|
|
12
13
|
/** Stroke width the 24 template relations are drawn with. */
|
|
@@ -125,7 +126,9 @@ export function createEdgyBox(std, kind) {
|
|
|
125
126
|
strokeWidth: NODE_STROKE_WIDTH,
|
|
126
127
|
radius: kind === 'outcome' ? OUTCOME_RADIUS : 0,
|
|
127
128
|
vertices: kind === 'activity' ? ACTIVITY_VERTICES : null,
|
|
128
|
-
|
|
129
|
+
// Translated HERE and once: what a gesture writes onto the canvas is
|
|
130
|
+
// document content the moment it lands (`nodeLabelKey`).
|
|
131
|
+
text: translateKey(std, nodeLabelKey(kind), NODE_LABEL[kind]),
|
|
129
132
|
color: NODE_STROKE,
|
|
130
133
|
fontFamily: FontFamily.Inter,
|
|
131
134
|
fontSize: INNER_FONT_SIZE,
|
|
@@ -152,7 +155,7 @@ export function createEdgyPeople(std) {
|
|
|
152
155
|
strokeWidth: 0,
|
|
153
156
|
xywh: new Bound(cx - w / 2, cy - h / 2, w, h).serialize(),
|
|
154
157
|
});
|
|
155
|
-
const labelId = addLabel(surface, NODE_LABEL.people, cx - 60, cy + h / 2 + LABEL_GAP);
|
|
158
|
+
const labelId = addLabel(surface, translateKey(std, nodeLabelKey('people'), NODE_LABEL.people), cx - 60, cy + h / 2 + LABEL_GAP);
|
|
156
159
|
const [, result] = std.command.exec(createGroupCommand, {
|
|
157
160
|
elements: [nodeId, labelId],
|
|
158
161
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ShortcutManifestEntry } from '@formicoidea/labre-core/std';
|
|
2
|
+
/**
|
|
3
|
+
* The EDGY commands as SHORTCUT-MANIFEST rows — id, label, chord, scope,
|
|
4
|
+
* owner — and nothing else.
|
|
5
|
+
*
|
|
6
|
+
* DATA ONLY, and that is the whole point (`docs/adr/0008` § Packaging). A
|
|
7
|
+
* `CommandDescriptor` carries its `run`, so a host settings pane that imports
|
|
8
|
+
* the package entry to list names and chords drags the entire action graph —
|
|
9
|
+
* the import/export machinery, the surface and gfx deep paths — into its
|
|
10
|
+
* chunk. This module has type-only imports, so the published bundle exposes it
|
|
11
|
+
* as `./commands-manifest`: a few hundred bytes that reference nothing.
|
|
12
|
+
*
|
|
13
|
+
* GENERATED-SHAPED, hand-committed: `commands-manifest.unit.spec.ts` asserts
|
|
14
|
+
* row-for-row equality with `toShortcutManifestEntry` over {@link edgyCommands},
|
|
15
|
+
* so this file cannot drift from the commands it projects. Add a command and
|
|
16
|
+
* the test says exactly what to add here.
|
|
17
|
+
*/
|
|
18
|
+
export declare const edgyCommandsManifest: ShortcutManifestEntry[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The EDGY commands as SHORTCUT-MANIFEST rows — id, label, chord, scope,
|
|
3
|
+
* owner — and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* DATA ONLY, and that is the whole point (`docs/adr/0008` § Packaging). A
|
|
6
|
+
* `CommandDescriptor` carries its `run`, so a host settings pane that imports
|
|
7
|
+
* the package entry to list names and chords drags the entire action graph —
|
|
8
|
+
* the import/export machinery, the surface and gfx deep paths — into its
|
|
9
|
+
* chunk. This module has type-only imports, so the published bundle exposes it
|
|
10
|
+
* as `./commands-manifest`: a few hundred bytes that reference nothing.
|
|
11
|
+
*
|
|
12
|
+
* GENERATED-SHAPED, hand-committed: `commands-manifest.unit.spec.ts` asserts
|
|
13
|
+
* row-for-row equality with `toShortcutManifestEntry` over {@link edgyCommands},
|
|
14
|
+
* so this file cannot drift from the commands it projects. Add a command and
|
|
15
|
+
* the test says exactly what to add here.
|
|
16
|
+
*/
|
|
17
|
+
export const edgyCommandsManifest = [
|
|
18
|
+
{
|
|
19
|
+
id: 'edgy.addFacets',
|
|
20
|
+
owner: 'edgy',
|
|
21
|
+
labelKey: 'com.labre.commands.edgy.addFacets',
|
|
22
|
+
labelFallback: 'Enterprise Design facets',
|
|
23
|
+
scope: 'edgeless',
|
|
24
|
+
defaultKeys: { mac: [], other: [] },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'edgy.insertDynamic',
|
|
28
|
+
owner: 'edgy',
|
|
29
|
+
labelKey: 'com.labre.commands.edgy.insertDynamic',
|
|
30
|
+
labelFallback: 'EDGY dynamic (elements & relations)',
|
|
31
|
+
scope: 'edgeless',
|
|
32
|
+
defaultKeys: { mac: [], other: [] },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'edgy.addBoard',
|
|
36
|
+
owner: 'edgy',
|
|
37
|
+
labelKey: 'com.labre.commands.edgy.addBoard',
|
|
38
|
+
labelFallback: 'EDGY board (hover spotlight)',
|
|
39
|
+
scope: 'edgeless',
|
|
40
|
+
defaultKeys: { mac: [], other: [] },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'edgy.addPeople',
|
|
44
|
+
owner: 'edgy',
|
|
45
|
+
labelKey: 'com.labre.commands.edgy.addPeople',
|
|
46
|
+
labelFallback: 'People',
|
|
47
|
+
scope: 'edgeless',
|
|
48
|
+
defaultKeys: { mac: [], other: [] },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'edgy.addOutcome',
|
|
52
|
+
owner: 'edgy',
|
|
53
|
+
labelKey: 'com.labre.commands.edgy.addOutcome',
|
|
54
|
+
labelFallback: 'Outcome',
|
|
55
|
+
scope: 'edgeless',
|
|
56
|
+
defaultKeys: { mac: [], other: [] },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'edgy.addObject',
|
|
60
|
+
owner: 'edgy',
|
|
61
|
+
labelKey: 'com.labre.commands.edgy.addObject',
|
|
62
|
+
labelFallback: 'Object',
|
|
63
|
+
scope: 'edgeless',
|
|
64
|
+
defaultKeys: { mac: [], other: [] },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'edgy.addActivity',
|
|
68
|
+
owner: 'edgy',
|
|
69
|
+
labelKey: 'com.labre.commands.edgy.addActivity',
|
|
70
|
+
labelFallback: 'Activity',
|
|
71
|
+
scope: 'edgeless',
|
|
72
|
+
defaultKeys: { mac: [], other: [] },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'edgy.addRelation',
|
|
76
|
+
owner: 'edgy',
|
|
77
|
+
labelKey: 'com.labre.commands.edgy.addRelation',
|
|
78
|
+
labelFallback: 'Relation',
|
|
79
|
+
scope: 'edgeless',
|
|
80
|
+
defaultKeys: { mac: [], other: [] },
|
|
81
|
+
},
|
|
82
|
+
];
|
package/dist/element-view.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { EdgyFacetsElementModel } from '@formicoidea/labre-core/model';
|
|
2
|
+
import type { EditorHost } from '@formicoidea/labre-core/std';
|
|
3
|
+
import type { PointTestOptions } from '@formicoidea/labre-core/std/gfx';
|
|
2
4
|
import { GfxElementModelView } from '@formicoidea/labre-core/std/gfx';
|
|
3
5
|
export declare class EdgyView extends GfxElementModelView<EdgyFacetsElementModel> {
|
|
4
6
|
static type: string;
|
|
@@ -6,6 +8,18 @@ export declare class EdgyView extends GfxElementModelView<EdgyFacetsElementModel
|
|
|
6
8
|
private _labelEditor;
|
|
7
9
|
onCreated(): void;
|
|
8
10
|
onDestroyed(): void;
|
|
11
|
+
/** The editable facet label under a MODEL-space point, or null. */
|
|
12
|
+
private _labelAt;
|
|
13
|
+
/**
|
|
14
|
+
* The diagram is SELECTED by its border (`EdgyFacetsElementModel`), but its
|
|
15
|
+
* three facet labels must still receive the double-click that renames them.
|
|
16
|
+
*
|
|
17
|
+
* Same seam Wardley uses, for the same reason: the pointer router asks the
|
|
18
|
+
* VIEW, so a framework declares its own gesture zones next to the code that
|
|
19
|
+
* draws them, and the model layer keeps a hit test that only says what a
|
|
20
|
+
* click SELECTS.
|
|
21
|
+
*/
|
|
22
|
+
includesPoint(x: number, y: number, options: PointTestOptions, host: EditorHost): boolean;
|
|
9
23
|
/** Double-click on a label → edit its text in place. */
|
|
10
24
|
private _onDblClick;
|
|
11
25
|
private _openLabelEditor;
|
package/dist/element-view.js
CHANGED
|
@@ -18,14 +18,11 @@ export class EdgyView extends GfxElementModelView {
|
|
|
18
18
|
this._closeLabelEditor();
|
|
19
19
|
super.onDestroyed();
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
if (this.model.isLocked())
|
|
24
|
-
return;
|
|
21
|
+
/** The editable facet label under a MODEL-space point, or null. */
|
|
22
|
+
_labelAt(mx, my) {
|
|
25
23
|
// No labels shown → nothing to edit (and the cropped mapping differs).
|
|
26
24
|
if (!this.model.showLabels)
|
|
27
|
-
return;
|
|
28
|
-
const [mx, my] = this.gfx.viewport.toModelCoord(e.x, e.y);
|
|
25
|
+
return null;
|
|
29
26
|
const [bx, by, w, h] = this.model.deserializedXYWH;
|
|
30
27
|
// Convert the model-space point into element-local coordinates, undoing the
|
|
31
28
|
// element rotation around its center.
|
|
@@ -45,7 +42,28 @@ export class EdgyView extends GfxElementModelView {
|
|
|
45
42
|
: refScale(w, h);
|
|
46
43
|
const rx = (lx - ox) / s;
|
|
47
44
|
const ry = (ly - oy) / s;
|
|
48
|
-
|
|
45
|
+
return hitTestEdgyLabel(getEdgyLabelHits(this.model), rx, ry);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The diagram is SELECTED by its border (`EdgyFacetsElementModel`), but its
|
|
49
|
+
* three facet labels must still receive the double-click that renames them.
|
|
50
|
+
*
|
|
51
|
+
* Same seam Wardley uses, for the same reason: the pointer router asks the
|
|
52
|
+
* VIEW, so a framework declares its own gesture zones next to the code that
|
|
53
|
+
* draws them, and the model layer keeps a hit test that only says what a
|
|
54
|
+
* click SELECTS.
|
|
55
|
+
*/
|
|
56
|
+
includesPoint(x, y, options, host) {
|
|
57
|
+
if (super.includesPoint(x, y, options, host))
|
|
58
|
+
return true;
|
|
59
|
+
return this._labelAt(x, y) !== null;
|
|
60
|
+
}
|
|
61
|
+
/** Double-click on a label → edit its text in place. */
|
|
62
|
+
_onDblClick(e) {
|
|
63
|
+
if (this.model.isLocked())
|
|
64
|
+
return;
|
|
65
|
+
const [mx, my] = this.gfx.viewport.toModelCoord(e.x, e.y);
|
|
66
|
+
const hit = this._labelAt(mx, my);
|
|
49
67
|
if (!hit)
|
|
50
68
|
return;
|
|
51
69
|
this._openLabelEditor(hit.field, e);
|
package/dist/node/consts.d.ts
CHANGED
|
@@ -21,6 +21,18 @@ export declare const NODE_SIZE: Record<EdgyNodeKind, {
|
|
|
21
21
|
export declare const INNER_FONT_SIZE = 20;
|
|
22
22
|
export declare const LABEL_FONT_SIZE = 18;
|
|
23
23
|
export declare const LABEL_GAP = 8;
|
|
24
|
+
/**
|
|
25
|
+
* The i18n key {@link NODE_LABEL} is the English default of, when the label is
|
|
26
|
+
* written onto the canvas.
|
|
27
|
+
*
|
|
28
|
+
* Resolved AT PLACEMENT (`createEdgyBox`, `createEdgyPeople`) and never
|
|
29
|
+
* afterwards: the text a gesture writes is content the author owns from that
|
|
30
|
+
* moment on, and re-translating it on every paint would overwrite a name
|
|
31
|
+
* somebody typed. The same words also name the ROLES (`roles.ts`), under their
|
|
32
|
+
* own keys — a role is a fact about an element and is read live, which is a
|
|
33
|
+
* different question with a different answer.
|
|
34
|
+
*/
|
|
35
|
+
export declare const nodeLabelKey: (kind: EdgyNodeKind) => string;
|
|
24
36
|
/** Default inner text / label per kind. */
|
|
25
37
|
export declare const NODE_LABEL: Record<EdgyNodeKind, string>;
|
|
26
38
|
/**
|
package/dist/node/consts.js
CHANGED
|
@@ -28,6 +28,18 @@ export const NODE_SIZE = {
|
|
|
28
28
|
export const INNER_FONT_SIZE = 20;
|
|
29
29
|
export const LABEL_FONT_SIZE = 18;
|
|
30
30
|
export const LABEL_GAP = 8;
|
|
31
|
+
/**
|
|
32
|
+
* The i18n key {@link NODE_LABEL} is the English default of, when the label is
|
|
33
|
+
* written onto the canvas.
|
|
34
|
+
*
|
|
35
|
+
* Resolved AT PLACEMENT (`createEdgyBox`, `createEdgyPeople`) and never
|
|
36
|
+
* afterwards: the text a gesture writes is content the author owns from that
|
|
37
|
+
* moment on, and re-translating it on every paint would overwrite a name
|
|
38
|
+
* somebody typed. The same words also name the ROLES (`roles.ts`), under their
|
|
39
|
+
* own keys — a role is a fact about an element and is read live, which is a
|
|
40
|
+
* different question with a different answer.
|
|
41
|
+
*/
|
|
42
|
+
export const nodeLabelKey = (kind) => `com.labre.edgy.seed.${kind}`;
|
|
31
43
|
/** Default inner text / label per kind. */
|
|
32
44
|
export const NODE_LABEL = {
|
|
33
45
|
people: 'People',
|
package/dist/toolbar/config.d.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { type ToolbarContext } from '@formicoidea/labre-core/shared/services';
|
|
1
|
+
import { type ChromeWording, type ToolbarContext } from '@formicoidea/labre-core/shared/services';
|
|
2
2
|
import { type TemplateResult } from 'lit';
|
|
3
3
|
export declare const edgyToolbarConfig: {
|
|
4
4
|
readonly actions: [{
|
|
5
5
|
id: string;
|
|
6
6
|
tooltip: string;
|
|
7
|
+
tooltipWording: ChromeWording | undefined;
|
|
7
8
|
icon: TemplateResult;
|
|
8
9
|
active(ctx: ToolbarContext): boolean;
|
|
9
10
|
run(ctx: ToolbarContext): void;
|
|
10
11
|
}, {
|
|
11
12
|
id: string;
|
|
12
13
|
tooltip: string;
|
|
14
|
+
tooltipWording: ChromeWording | undefined;
|
|
13
15
|
icon: TemplateResult;
|
|
14
16
|
active(ctx: ToolbarContext): boolean;
|
|
15
17
|
run(ctx: ToolbarContext): void;
|
|
16
18
|
}, {
|
|
17
19
|
id: string;
|
|
18
|
-
|
|
19
|
-
icon: TemplateResult;
|
|
20
|
-
active(ctx: ToolbarContext): boolean;
|
|
21
|
-
run(ctx: ToolbarContext): void;
|
|
22
|
-
}, {
|
|
23
|
-
id: string;
|
|
24
|
-
tooltip: string;
|
|
20
|
+
tooltipWording: ChromeWording;
|
|
25
21
|
icon: TemplateResult<1>;
|
|
26
22
|
run(ctx: ToolbarContext): void;
|
|
27
23
|
}];
|
|
@@ -32,18 +28,20 @@ export declare const edgyBoardToolbarConfig: {
|
|
|
32
28
|
readonly actions: [{
|
|
33
29
|
id: string;
|
|
34
30
|
tooltip: string;
|
|
31
|
+
tooltipWording: ChromeWording | undefined;
|
|
35
32
|
icon: TemplateResult;
|
|
36
33
|
active(ctx: ToolbarContext): boolean;
|
|
37
34
|
run(ctx: ToolbarContext): void;
|
|
38
35
|
}, {
|
|
39
36
|
id: string;
|
|
40
37
|
tooltip: string;
|
|
38
|
+
tooltipWording: ChromeWording | undefined;
|
|
41
39
|
icon: TemplateResult;
|
|
42
40
|
active(ctx: ToolbarContext): boolean;
|
|
43
41
|
run(ctx: ToolbarContext): void;
|
|
44
42
|
}, {
|
|
45
43
|
id: string;
|
|
46
|
-
|
|
44
|
+
tooltipWording: ChromeWording;
|
|
47
45
|
icon: TemplateResult<1>;
|
|
48
46
|
run(ctx: ToolbarContext): void;
|
|
49
47
|
}];
|
package/dist/toolbar/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EdgelessCRUDIdentifier } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { createAutoLegend, dddLegendIcon } from '@formicoidea/labre-ddd-shared';
|
|
3
3
|
import { EdgyBoardElementModel, EdgyFacetsElementModel, } from '@formicoidea/labre-core/model';
|
|
4
|
-
import { TelemetryProvider, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
|
|
4
|
+
import { BOARD_LEGEND_NOTATION, BOARD_RESIZE_TOGGLE, TelemetryProvider, ToolbarModuleExtension, } from '@formicoidea/labre-core/shared/services';
|
|
5
5
|
import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
6
6
|
import { html } from 'lit';
|
|
7
7
|
import { EDGY_AUTO_LEGEND } from '../legend.js';
|
|
@@ -56,7 +56,12 @@ function booleanToggle(Model, id, tooltip, icon, prop) {
|
|
|
56
56
|
const models = (ctx) => ctx.getSurfaceModelsByType(Model);
|
|
57
57
|
return {
|
|
58
58
|
id,
|
|
59
|
-
tooltip,
|
|
59
|
+
tooltip: typeof tooltip === 'string' ? tooltip : tooltip[1],
|
|
60
|
+
// The declared wording, when the caller gave one instead of a literal:
|
|
61
|
+
// `combine` resolves it against the host's catalogue and writes it over
|
|
62
|
+
// the English default above, so a playground with no catalogue reads
|
|
63
|
+
// exactly what it read before (#183).
|
|
64
|
+
tooltipWording: typeof tooltip === 'string' ? undefined : tooltip,
|
|
60
65
|
icon,
|
|
61
66
|
active(ctx) {
|
|
62
67
|
const all = models(ctx);
|
|
@@ -90,7 +95,7 @@ function booleanToggle(Model, id, tooltip, icon, prop) {
|
|
|
90
95
|
function legendAction(Model, id) {
|
|
91
96
|
return {
|
|
92
97
|
id,
|
|
93
|
-
|
|
98
|
+
tooltipWording: BOARD_LEGEND_NOTATION,
|
|
94
99
|
icon: dddLegendIcon,
|
|
95
100
|
run(ctx) {
|
|
96
101
|
const background = ctx.getSurfaceModelsByType(Model)[0];
|
|
@@ -112,10 +117,11 @@ function legendAction(Model, id) {
|
|
|
112
117
|
}
|
|
113
118
|
export const edgyToolbarConfig = {
|
|
114
119
|
actions: [
|
|
115
|
-
booleanToggle(EdgyFacetsElementModel, 'a.toggle-resize',
|
|
120
|
+
booleanToggle(EdgyFacetsElementModel, 'a.toggle-resize', BOARD_RESIZE_TOGGLE, ResizeIcon, 'resizeEnabled'),
|
|
116
121
|
booleanToggle(EdgyFacetsElementModel, 'b.toggle-labels', 'Show / hide facet labels', LabelsIcon, 'showLabels'),
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
// No spotlight toggle here: the hover spotlight is BOARD logic and lives on
|
|
123
|
+
// the EDGY board toolbar below. The Venn only carries APPEARANCE (#195).
|
|
124
|
+
legendAction(EdgyFacetsElementModel, 'c.legend'),
|
|
119
125
|
],
|
|
120
126
|
when: ctx => ctx.getSurfaceModelsByType(EdgyFacetsElementModel).length > 0,
|
|
121
127
|
};
|
|
@@ -125,7 +131,7 @@ export const edgyToolbarExtension = ToolbarModuleExtension({
|
|
|
125
131
|
});
|
|
126
132
|
export const edgyBoardToolbarConfig = {
|
|
127
133
|
actions: [
|
|
128
|
-
booleanToggle(EdgyBoardElementModel, 'a.toggle-resize',
|
|
134
|
+
booleanToggle(EdgyBoardElementModel, 'a.toggle-resize', BOARD_RESIZE_TOGGLE, ResizeIcon, 'resizeEnabled'),
|
|
129
135
|
booleanToggle(EdgyBoardElementModel, 'b.toggle-spotlight', 'Enable / disable hover spotlight', SpotlightIcon, 'spotlightEnabled'),
|
|
130
136
|
legendAction(EdgyBoardElementModel, 'c.legend'),
|
|
131
137
|
],
|
package/dist/translations.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { collectTranslationKeys, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
|
|
1
|
+
import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from '@formicoidea/labre-core/std';
|
|
2
2
|
import { edgyCommands } from './commands.js';
|
|
3
|
+
import { NODE_LABEL, nodeLabelKey } from './node/consts.js';
|
|
3
4
|
import { EDGY_NUDGES } from './nudges.js';
|
|
4
5
|
import { EDGY_PROFILES } from './profiles.js';
|
|
5
6
|
import { EDGY_ROLES } from './roles.js';
|
|
@@ -26,4 +27,18 @@ import { EDGY_RULES } from './rules.js';
|
|
|
26
27
|
* composes it into its catalogue exactly as it already composes `edgyCommands`
|
|
27
28
|
* into the command registry. See `packages/affine/all/src/translations.ts`.
|
|
28
29
|
*/
|
|
29
|
-
export const edgyTranslationEntries = mergeTranslationEntries(commandTranslationEntries(edgyCommands),
|
|
30
|
+
export const edgyTranslationEntries = mergeTranslationEntries(commandTranslationEntries(edgyCommands),
|
|
31
|
+
// The catalogue's own group headers, derived from the very categories
|
|
32
|
+
// these commands declare. They ship WITH the framework because core's
|
|
33
|
+
// registry names no framework category in the bundled distribution, so a
|
|
34
|
+
// host that composed core's manifest alone drew translated entries under
|
|
35
|
+
// English headers (#183).
|
|
36
|
+
commandCategoryTranslationEntries(edgyCommands), collectTranslationKeys('role', EDGY_ROLES), collectTranslationKeys('rule', EDGY_RULES), collectTranslationKeys('nudge', EDGY_NUDGES), collectTranslationKeys('profile', EDGY_PROFILES),
|
|
37
|
+
// The captions a placed base element is seeded with. Derived from
|
|
38
|
+
// `NODE_LABEL`, the very table the gesture writes from, so the wording a
|
|
39
|
+
// host is offered is the wording the canvas would have carried.
|
|
40
|
+
Object.entries(NODE_LABEL).map(([kind, label]) => ({
|
|
41
|
+
key: nodeLabelKey(kind),
|
|
42
|
+
fallback: label,
|
|
43
|
+
source: 'seed',
|
|
44
|
+
})));
|
package/dist/view.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { type ViewExtensionContext, ViewExtensionProvider } from '@formicoidea/l
|
|
|
2
2
|
/**
|
|
3
3
|
* EDGY rendering — ALWAYS registered, independent of any flag. Disabling `edgy`
|
|
4
4
|
* hides only the creation tooling (see {@link EdgyViewExtension}); boards and
|
|
5
|
-
* facets already drawn must still paint, stay selectable, stay editable
|
|
6
|
-
* their contextual toolbar and keep the dependency
|
|
7
|
-
* `docs/adr/0009`.
|
|
5
|
+
* facets already drawn must still paint, stay selectable, stay editable and
|
|
6
|
+
* keep their contextual toolbar — and a board must keep the dependency
|
|
7
|
+
* spotlight it hosts. See `docs/adr/0009`.
|
|
8
8
|
*/
|
|
9
9
|
export declare class EdgyRenderViewExtension extends ViewExtensionProvider {
|
|
10
10
|
name: string;
|
package/dist/view.js
CHANGED
|
@@ -24,9 +24,9 @@ import { edgySeniorTool } from './toolbar/senior-tool.js';
|
|
|
24
24
|
/**
|
|
25
25
|
* EDGY rendering — ALWAYS registered, independent of any flag. Disabling `edgy`
|
|
26
26
|
* hides only the creation tooling (see {@link EdgyViewExtension}); boards and
|
|
27
|
-
* facets already drawn must still paint, stay selectable, stay editable
|
|
28
|
-
* their contextual toolbar and keep the dependency
|
|
29
|
-
* `docs/adr/0009`.
|
|
27
|
+
* facets already drawn must still paint, stay selectable, stay editable and
|
|
28
|
+
* keep their contextual toolbar — and a board must keep the dependency
|
|
29
|
+
* spotlight it hosts. See `docs/adr/0009`.
|
|
30
30
|
*/
|
|
31
31
|
export class EdgyRenderViewExtension extends ViewExtensionProvider {
|
|
32
32
|
constructor() {
|
|
@@ -54,8 +54,9 @@ export class EdgyRenderViewExtension extends ViewExtensionProvider {
|
|
|
54
54
|
context.register(edgyToolbarExtension);
|
|
55
55
|
context.register(edgyBoardToolbarExtension);
|
|
56
56
|
context.register(edgyNodeToolbarExtension);
|
|
57
|
-
//
|
|
58
|
-
|
|
57
|
+
// The dependency spotlight on hover is BOARD logic: only the EDGY board
|
|
58
|
+
// grants it. The facets Venn is a drawing — it keeps its appearance
|
|
59
|
+
// toggles (labels, pictos, crop, resize) and nothing else (#195).
|
|
59
60
|
context.register(SpotlightHostExtension('edgyBoard'));
|
|
60
61
|
}
|
|
61
62
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-edgy",
|
|
3
3
|
"description": "Labre edgy framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -21,14 +21,18 @@
|
|
|
21
21
|
"./descriptor": {
|
|
22
22
|
"types": "./dist/descriptor.d.ts",
|
|
23
23
|
"import": "./dist/descriptor.js"
|
|
24
|
+
},
|
|
25
|
+
"./commands-manifest": {
|
|
26
|
+
"types": "./dist/commands-manifest.d.ts",
|
|
27
|
+
"import": "./dist/commands-manifest.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"files": [
|
|
27
31
|
"dist"
|
|
28
32
|
],
|
|
29
33
|
"dependencies": {
|
|
30
|
-
"@formicoidea/labre-core": "0.
|
|
31
|
-
"@formicoidea/labre-ddd-shared": "0.
|
|
34
|
+
"@formicoidea/labre-core": "0.34.1",
|
|
35
|
+
"@formicoidea/labre-ddd-shared": "0.34.1",
|
|
32
36
|
"@preact/signals-core": "^1.8.0",
|
|
33
37
|
"lit": "^3.2.0",
|
|
34
38
|
"yjs": "^13.6.21"
|