@formicoidea/labre-framework-cynefin 0.29.0 → 0.30.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.
|
@@ -82,3 +82,13 @@ export declare const AXIS_LABELS: {
|
|
|
82
82
|
readonly size: 34;
|
|
83
83
|
};
|
|
84
84
|
export declare const LABEL_LETTER_SPACING = 4;
|
|
85
|
+
/**
|
|
86
|
+
* Hexi constraint node (Estuarine mapping). Pointy-top regular hexagon —
|
|
87
|
+
* two vertices on the VERTICAL symmetry axis (top/bottom) — as normalized
|
|
88
|
+
* polygon vertices, clockwise from the top vertex. Shared by the toolbar
|
|
89
|
+
* menu and the templates so the two can never drift apart.
|
|
90
|
+
*/
|
|
91
|
+
export declare const HEX_SIZE = 120;
|
|
92
|
+
export declare const HEX_FILL = "#34c724";
|
|
93
|
+
export declare const HEX_STROKE = "#1f1f1f";
|
|
94
|
+
export declare const HEX_VERTICES: number[][];
|
package/dist/estuarine/consts.js
CHANGED
|
@@ -52,3 +52,20 @@ export const AXIS_LABELS = {
|
|
|
52
52
|
size: 34,
|
|
53
53
|
};
|
|
54
54
|
export const LABEL_LETTER_SPACING = 4;
|
|
55
|
+
/**
|
|
56
|
+
* Hexi constraint node (Estuarine mapping). Pointy-top regular hexagon —
|
|
57
|
+
* two vertices on the VERTICAL symmetry axis (top/bottom) — as normalized
|
|
58
|
+
* polygon vertices, clockwise from the top vertex. Shared by the toolbar
|
|
59
|
+
* menu and the templates so the two can never drift apart.
|
|
60
|
+
*/
|
|
61
|
+
export const HEX_SIZE = 120;
|
|
62
|
+
export const HEX_FILL = '#34c724';
|
|
63
|
+
export const HEX_STROKE = '#1f1f1f';
|
|
64
|
+
export const HEX_VERTICES = [
|
|
65
|
+
[0.5, 0],
|
|
66
|
+
[0.933, 0.25],
|
|
67
|
+
[0.933, 0.75],
|
|
68
|
+
[0.5, 1],
|
|
69
|
+
[0.067, 0.75],
|
|
70
|
+
[0.067, 0.25],
|
|
71
|
+
];
|
package/dist/templates/index.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { makeTemplateSnapshot, surfaceText, } from '@formicoidea/labre-core/gfx/template';
|
|
2
2
|
import { FontFamily, ShapeStyle, TextAlign } from '@formicoidea/labre-core/model';
|
|
3
3
|
import { REF_H as CYN_H, REF_W as CYN_W } from '../cynefin/consts';
|
|
4
|
-
import { REF_H as EST_H, REF_W as EST_W } from '../estuarine/consts';
|
|
5
|
-
const HEX_SIZE = 60;
|
|
6
|
-
const HEX_FILL = '#34c724';
|
|
7
|
-
const HEX_STROKE = '#1f1f1f';
|
|
8
|
-
const HEX_VERTICES = [
|
|
9
|
-
[1, 0.5],
|
|
10
|
-
[0.75, 0.933],
|
|
11
|
-
[0.25, 0.933],
|
|
12
|
-
[0, 0.5],
|
|
13
|
-
[0.25, 0.067],
|
|
14
|
-
[0.75, 0.067],
|
|
15
|
-
];
|
|
4
|
+
import { HEX_FILL, HEX_SIZE, HEX_STROKE, HEX_VERTICES, REF_H as EST_H, REF_W as EST_W, } from '../estuarine/consts';
|
|
16
5
|
function sticky(x, y, text) {
|
|
17
6
|
return {
|
|
18
7
|
type: 'shape',
|
package/dist/toolbar/menu.js
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
import { DefaultTool } from '@formicoidea/labre-core/blocks/surface';
|
|
2
2
|
import { EmptyTool } from '@formicoidea/labre-core/gfx/pointer';
|
|
3
|
-
import { ShapeStyle } from '@formicoidea/labre-core/model';
|
|
3
|
+
import { ShapeStyle, TextFitMode } from '@formicoidea/labre-core/model';
|
|
4
4
|
import { EdgelessToolbarToolMixin } from '@formicoidea/labre-core/widgets/edgeless-toolbar';
|
|
5
5
|
import { Bound } from '@formicoidea/labre-core/global/gfx';
|
|
6
6
|
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { REF_H as CYN_H, REF_W as CYN_W } from '../cynefin/consts';
|
|
8
|
-
import { REF_H as EST_H, REF_W as EST_W } from '../estuarine/consts';
|
|
8
|
+
import { HEX_FILL, HEX_SIZE, HEX_STROKE, HEX_VERTICES, REF_H as EST_H, REF_W as EST_W, } from '../estuarine/consts';
|
|
9
9
|
import { cynefinMenuIcon, estuarineMenuIcon, hexagonMenuIcon, } from './icons';
|
|
10
10
|
/** Estuarine map default size (REF aspect, scaled up so it reads on canvas). */
|
|
11
11
|
const MAP_SCALE = 1.2;
|
|
12
|
-
const HEX_SIZE = 60;
|
|
13
|
-
const HEX_FILL = '#34c724';
|
|
14
|
-
const HEX_STROKE = '#1f1f1f';
|
|
15
|
-
/** Flat-top regular hexagon, normalized vertices. */
|
|
16
|
-
const HEX_VERTICES = [
|
|
17
|
-
[1, 0.5],
|
|
18
|
-
[0.75, 0.933],
|
|
19
|
-
[0.25, 0.933],
|
|
20
|
-
[0, 0.5],
|
|
21
|
-
[0.25, 0.067],
|
|
22
|
-
[0.75, 0.067],
|
|
23
|
-
];
|
|
24
12
|
/**
|
|
25
13
|
* The popover above the toolbar hosting both frameworks: create the Cynefin
|
|
26
14
|
* diagram, the Estuarine map, or a hexagon constraint node.
|
|
@@ -97,6 +85,8 @@ export class EdgelessCynefinEstuarineMenu extends EdgelessToolbarToolMixin(LitEl
|
|
|
97
85
|
strokeWidth: 2,
|
|
98
86
|
shapeStyle: ShapeStyle.General,
|
|
99
87
|
roughness: 0,
|
|
88
|
+
// hexi constraints behave like post-its: fixed hex, text shrinks
|
|
89
|
+
textFitMode: TextFitMode.Contained,
|
|
100
90
|
xywh: new Bound(cx - HEX_SIZE / 2, cy - HEX_SIZE / 2, HEX_SIZE, HEX_SIZE).serialize(),
|
|
101
91
|
});
|
|
102
92
|
this._finish(id);
|
|
@@ -24,6 +24,8 @@ export class EdgelessCynefinEstuarineSeniorButton extends EdgelessToolbarToolMix
|
|
|
24
24
|
position: relative;
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
cursor: pointer;
|
|
27
|
+
/* no double-tap-zoom / 300ms tap delay on touch screens */
|
|
28
|
+
touch-action: manipulation;
|
|
27
29
|
display: flex;
|
|
28
30
|
align-items: flex-end;
|
|
29
31
|
justify-content: center;
|
|
@@ -43,7 +45,8 @@ export class EdgelessCynefinEstuarineSeniorButton extends EdgelessToolbarToolMix
|
|
|
43
45
|
width: 100%;
|
|
44
46
|
height: 100%;
|
|
45
47
|
}
|
|
46
|
-
.ce-root:hover .ce-card
|
|
48
|
+
.ce-root:hover .ce-card,
|
|
49
|
+
.ce-root:active .ce-card {
|
|
47
50
|
--y: -10px;
|
|
48
51
|
--s: 1.07;
|
|
49
52
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-framework-cynefin",
|
|
3
3
|
"description": "Labre cynefin framework for @formicoidea/labre-core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@formicoidea/labre-core": "0.
|
|
30
|
+
"@formicoidea/labre-core": "0.30.1",
|
|
31
31
|
"lit": "^3.2.0"
|
|
32
32
|
}
|
|
33
33
|
}
|