@formicoidea/labre-framework-cynefin 0.23.1 → 0.23.2
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/package.json +6 -15
- package/src/cynefin/consts.ts +188 -0
- package/src/cynefin/element-renderer.ts +156 -0
- package/src/cynefin/element-view.ts +32 -0
- package/src/cynefin/toolbar/config.ts +60 -0
- package/{dist/descriptor.js → src/descriptor.ts} +1 -1
- package/src/effects.ts +20 -0
- package/src/estuarine/consts.ts +69 -0
- package/src/estuarine/element-renderer.ts +122 -0
- package/src/estuarine/element-view.ts +32 -0
- package/src/estuarine/toolbar/config.ts +65 -0
- package/src/index.ts +1 -0
- package/src/templates/index.ts +130 -0
- package/{dist/toolbar/icons.js → src/toolbar/icons.ts} +17 -14
- package/{dist/toolbar/menu.js → src/toolbar/menu.ts} +156 -133
- package/{dist/toolbar/senior-button.js → src/toolbar/senior-button.ts} +95 -90
- package/{dist/toolbar/senior-tool.js → src/toolbar/senior-tool.ts} +15 -12
- package/{dist/utils.js → src/utils.ts} +11 -11
- package/src/view.ts +44 -0
- package/dist/cynefin/consts.d.ts +0 -80
- package/dist/cynefin/consts.js +0 -142
- package/dist/cynefin/element-renderer.d.ts +0 -15
- package/dist/cynefin/element-renderer.js +0 -115
- package/dist/cynefin/element-view.d.ts +0 -15
- package/dist/cynefin/element-view.js +0 -24
- package/dist/cynefin/toolbar/config.d.ts +0 -32
- package/dist/cynefin/toolbar/config.js +0 -44
- package/dist/descriptor.d.ts +0 -7
- package/dist/effects.d.ts +0 -10
- package/dist/effects.js +0 -7
- package/dist/estuarine/consts.d.ts +0 -85
- package/dist/estuarine/consts.js +0 -55
- package/dist/estuarine/element-renderer.d.ts +0 -14
- package/dist/estuarine/element-renderer.js +0 -84
- package/dist/estuarine/element-view.d.ts +0 -15
- package/dist/estuarine/element-view.js +0 -24
- package/dist/estuarine/toolbar/config.d.ts +0 -38
- package/dist/estuarine/toolbar/config.js +0 -48
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/templates/index.d.ts +0 -4
- package/dist/templates/index.js +0 -95
- package/dist/toolbar/cynefin-menu.d.ts +0 -12
- package/dist/toolbar/cynefin-menu.js +0 -66
- package/dist/toolbar/cynefin-senior-button.d.ts +0 -13
- package/dist/toolbar/cynefin-senior-button.js +0 -90
- package/dist/toolbar/estuarine-menu.d.ts +0 -14
- package/dist/toolbar/estuarine-menu.js +0 -113
- package/dist/toolbar/estuarine-senior-button.d.ts +0 -13
- package/dist/toolbar/estuarine-senior-button.js +0 -90
- package/dist/toolbar/icons.d.ts +0 -9
- package/dist/toolbar/menu.d.ts +0 -18
- package/dist/toolbar/senior-button.d.ts +0 -13
- package/dist/toolbar/senior-tool.d.ts +0 -3
- package/dist/utils.d.ts +0 -12
- package/dist/view.d.ts +0 -7
- package/dist/view.js +0 -38
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { DefaultTool } from '@blocksuite/affine-block-surface';
|
|
2
|
-
import { EmptyTool } from '@blocksuite/affine-gfx-pointer';
|
|
3
|
-
import { EdgelessToolbarToolMixin } from '@blocksuite/affine-widget-edgeless-toolbar';
|
|
4
|
-
import { SignalWatcher } from '@blocksuite/global/lit';
|
|
5
|
-
import { css, html, LitElement } from 'lit';
|
|
6
|
-
import { estuarineToolbarIcon } from './icons';
|
|
7
|
-
/** Main toolbar button that opens the Estuarine toolbox sub-menu. */
|
|
8
|
-
export class EdgelessEstuarineSeniorButton extends EdgelessToolbarToolMixin(SignalWatcher(LitElement)) {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.enableActiveBackground = true;
|
|
12
|
-
this.type = EmptyTool;
|
|
13
|
-
}
|
|
14
|
-
static { this.styles = css `
|
|
15
|
-
:host,
|
|
16
|
-
.estuarine-button {
|
|
17
|
-
display: block;
|
|
18
|
-
width: 100%;
|
|
19
|
-
height: 100%;
|
|
20
|
-
}
|
|
21
|
-
:host {
|
|
22
|
-
position: relative;
|
|
23
|
-
}
|
|
24
|
-
.estuarine-root {
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 64px;
|
|
27
|
-
position: relative;
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: flex-end;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
}
|
|
34
|
-
.estuarine-card {
|
|
35
|
-
--y: 6px;
|
|
36
|
-
--s: 1;
|
|
37
|
-
position: absolute;
|
|
38
|
-
bottom: 0;
|
|
39
|
-
width: 54px;
|
|
40
|
-
height: 54px;
|
|
41
|
-
transform: translateY(var(--y)) scale(var(--s));
|
|
42
|
-
transition: transform 0.3s ease;
|
|
43
|
-
}
|
|
44
|
-
.estuarine-card svg {
|
|
45
|
-
display: block;
|
|
46
|
-
width: 100%;
|
|
47
|
-
height: 100%;
|
|
48
|
-
}
|
|
49
|
-
.estuarine-root:hover .estuarine-card {
|
|
50
|
-
--y: -2px;
|
|
51
|
-
--s: 1.07;
|
|
52
|
-
}
|
|
53
|
-
`; }
|
|
54
|
-
_toggleMenu() {
|
|
55
|
-
if (this.popper) {
|
|
56
|
-
this.popper.dispose();
|
|
57
|
-
this.popper = null;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
this.setEdgelessTool(DefaultTool);
|
|
61
|
-
const menu = this.createPopper('edgeless-estuarine-menu', this);
|
|
62
|
-
menu.element.edgeless = this.edgeless;
|
|
63
|
-
const el = menu.element;
|
|
64
|
-
const wrap = el.parentElement;
|
|
65
|
-
if (wrap) {
|
|
66
|
-
wrap.style.overflow = 'visible';
|
|
67
|
-
wrap.style.justifyContent = 'flex-end';
|
|
68
|
-
}
|
|
69
|
-
Object.assign(el.style, {
|
|
70
|
-
position: 'static',
|
|
71
|
-
width: 'max-content',
|
|
72
|
-
maxWidth: 'calc(100vw - 16px)',
|
|
73
|
-
marginLeft: '0',
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
render() {
|
|
77
|
-
return html `<edgeless-toolbar-button
|
|
78
|
-
class="estuarine-button"
|
|
79
|
-
.tooltip=${this.popper ? '' : 'Estuarine'}
|
|
80
|
-
.tooltipOffset=${4}
|
|
81
|
-
.active=${!!this.popper}
|
|
82
|
-
@click=${this._toggleMenu}
|
|
83
|
-
>
|
|
84
|
-
<div class="estuarine-root">
|
|
85
|
-
<div class="estuarine-card">${estuarineToolbarIcon}</div>
|
|
86
|
-
</div>
|
|
87
|
-
</edgeless-toolbar-button>`;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=estuarine-senior-button.js.map
|
package/dist/toolbar/icons.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Colored Cynefin glyph for the main toolbar button. */
|
|
2
|
-
export declare const cynefinToolbarIcon: import("lit-html").TemplateResult<2>;
|
|
3
|
-
/** Menu icon — create the Cynefin diagram. */
|
|
4
|
-
export declare const cynefinMenuIcon: import("lit-html").TemplateResult<2>;
|
|
5
|
-
/** Menu icon — create the Estuarine map. */
|
|
6
|
-
export declare const estuarineMenuIcon: import("lit-html").TemplateResult<2>;
|
|
7
|
-
/** Menu icon — hexagon constraint node. */
|
|
8
|
-
export declare const hexagonMenuIcon: import("lit-html").TemplateResult<2>;
|
|
9
|
-
//# sourceMappingURL=icons.d.ts.map
|
package/dist/toolbar/menu.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { EmptyTool } from '@formicoidea/labre-core/gfx/pointer';
|
|
2
|
-
import { LitElement } from 'lit';
|
|
3
|
-
declare const EdgelessCynefinEstuarineMenu_base: typeof LitElement & import("@formicoidea/labre-core/global/utils").Constructor<import("@formicoidea/labre-core/widgets/edgeless-toolbar").EdgelessToolbarToolClass>;
|
|
4
|
-
/**
|
|
5
|
-
* The popover above the toolbar hosting both frameworks: create the Cynefin
|
|
6
|
-
* diagram, the Estuarine map, or a hexagon constraint node.
|
|
7
|
-
*/
|
|
8
|
-
export declare class EdgelessCynefinEstuarineMenu extends EdgelessCynefinEstuarineMenu_base {
|
|
9
|
-
static styles: import("lit").CSSResult;
|
|
10
|
-
type: typeof EmptyTool;
|
|
11
|
-
private _finish;
|
|
12
|
-
private _createCynefin;
|
|
13
|
-
private _createMap;
|
|
14
|
-
private _createHexagon;
|
|
15
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EmptyTool } from '@formicoidea/labre-core/gfx/pointer';
|
|
2
|
-
import { LitElement } from 'lit';
|
|
3
|
-
declare const EdgelessCynefinEstuarineSeniorButton_base: typeof LitElement & import("@formicoidea/labre-core/global/utils").Constructor<import("@formicoidea/labre-core/widgets/edgeless-toolbar").EdgelessToolbarToolClass>;
|
|
4
|
-
/** Main toolbar button that opens the combined Cynefin / Estuarine sub-menu. */
|
|
5
|
-
export declare class EdgelessCynefinEstuarineSeniorButton extends EdgelessCynefinEstuarineSeniorButton_base {
|
|
6
|
-
static styles: import("lit").CSSResult;
|
|
7
|
-
enableActiveBackground: boolean;
|
|
8
|
-
type: typeof EmptyTool;
|
|
9
|
-
private _toggleMenu;
|
|
10
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=senior-button.d.ts.map
|
package/dist/utils.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Uniform fit of a fixed reference design (`refW × refH`) into an element of
|
|
3
|
-
* size `w × h`: the scale factor plus the centering offsets (letterboxed).
|
|
4
|
-
* Keeps the artwork undistorted at any element size.
|
|
5
|
-
*/
|
|
6
|
-
export declare function refScale(w: number, h: number, refW: number, refH: number): {
|
|
7
|
-
s: number;
|
|
8
|
-
ox: number;
|
|
9
|
-
oy: number;
|
|
10
|
-
};
|
|
11
|
-
export declare const FONT_FAMILY = "Inter, sans-serif";
|
|
12
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/view.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type ViewExtensionContext, ViewExtensionProvider } from '@formicoidea/labre-core/ext-loader';
|
|
2
|
-
export declare class CynefinEstuarineViewExtension extends ViewExtensionProvider {
|
|
3
|
-
name: string;
|
|
4
|
-
effect(): void;
|
|
5
|
-
setup(context: ViewExtensionContext): void;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=view.d.ts.map
|
package/dist/view.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
|
|
2
|
-
import { extendTemplateCategory } from '@formicoidea/labre-core/gfx/template';
|
|
3
|
-
import { CynefinRendererExtension } from './cynefin/element-renderer';
|
|
4
|
-
import { CynefinInteraction, CynefinView } from './cynefin/element-view';
|
|
5
|
-
import { cynefinToolbarExtension } from './cynefin/toolbar/config';
|
|
6
|
-
import { effects } from './effects';
|
|
7
|
-
import { EstuarineRendererExtension } from './estuarine/element-renderer';
|
|
8
|
-
import { EstuarineInteraction, EstuarineView } from './estuarine/element-view';
|
|
9
|
-
import { estuarineToolbarExtension } from './estuarine/toolbar/config';
|
|
10
|
-
import { cynefinTemplateCategory, estuarineTemplateCategory, } from './templates';
|
|
11
|
-
import { cynefinEstuarineSeniorTool } from './toolbar/senior-tool';
|
|
12
|
-
export class CynefinEstuarineViewExtension extends ViewExtensionProvider {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.name = 'affine-cynefin-estuarine-gfx';
|
|
16
|
-
}
|
|
17
|
-
effect() {
|
|
18
|
-
super.effect();
|
|
19
|
-
effects();
|
|
20
|
-
extendTemplateCategory(cynefinTemplateCategory);
|
|
21
|
-
extendTemplateCategory(estuarineTemplateCategory);
|
|
22
|
-
}
|
|
23
|
-
setup(context) {
|
|
24
|
-
super.setup(context);
|
|
25
|
-
context.register(CynefinView);
|
|
26
|
-
context.register(CynefinRendererExtension);
|
|
27
|
-
context.register(EstuarineView);
|
|
28
|
-
context.register(EstuarineRendererExtension);
|
|
29
|
-
if (this.isEdgeless(context.scope)) {
|
|
30
|
-
context.register(CynefinInteraction);
|
|
31
|
-
context.register(EstuarineInteraction);
|
|
32
|
-
context.register(cynefinEstuarineSeniorTool);
|
|
33
|
-
context.register(cynefinToolbarExtension);
|
|
34
|
-
context.register(estuarineToolbarExtension);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=view.js.map
|