@miragon/context-maps-renderer 0.4.1 → 0.5.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/README.md +21 -8
- package/dist/CmBaseViewer.d.ts +12 -4
- package/dist/CmBaseViewer.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeContextMaps.d.ts +2 -1
- package/dist/collaborative/CollaborativeContextMaps.d.ts.map +1 -1
- package/dist/draw/ContextMapsRenderer.d.ts.map +1 -1
- package/dist/draw/contextLayout.d.ts +33 -0
- package/dist/draw/contextLayout.d.ts.map +1 -0
- package/dist/draw/textMetrics.d.ts +6 -0
- package/dist/draw/textMetrics.d.ts.map +1 -0
- package/dist/index.js +537 -462
- package/dist/index.js.map +1 -1
- package/dist/legend/CmLegend.d.ts +4 -0
- package/dist/legend/CmLegend.d.ts.map +1 -1
- package/dist/model/contentBounds.d.ts +12 -0
- package/dist/model/contentBounds.d.ts.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/palette.d.ts +2 -1
- package/dist/theme/palette.d.ts.map +1 -1
- package/dist/theme/sizes.d.ts +13 -0
- package/dist/theme/sizes.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { default as Canvas } from 'diagram-js/lib/core/Canvas';
|
|
2
2
|
import { default as EventBus } from 'diagram-js/lib/core/EventBus';
|
|
3
3
|
export default class CmLegend {
|
|
4
|
+
private readonly canvas;
|
|
4
5
|
static $inject: string[];
|
|
5
6
|
private openState;
|
|
7
|
+
/** Set once the container had a size to start from, or the host chose a state. */
|
|
8
|
+
private started;
|
|
6
9
|
private readonly host;
|
|
7
10
|
constructor(canvas: Canvas, eventBus: EventBus);
|
|
8
11
|
isOpen(): boolean;
|
|
9
12
|
setOpen(open: boolean): void;
|
|
13
|
+
private startFromContainerSize;
|
|
10
14
|
toggle(): void;
|
|
11
15
|
private render;
|
|
12
16
|
private panel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmLegend.d.ts","sourceRoot":"","sources":["../../src/legend/CmLegend.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CmLegend.d.ts","sourceRoot":"","sources":["../../src/legend/CmLegend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAmDzD,MAAM,CAAC,OAAO,OAAO,QAAQ;IASzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IARzB,MAAM,CAAC,OAAO,WAA0B;IAExC,OAAO,CAAC,SAAS,CAAS;IAC1B,kFAAkF;IAClF,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;gBAGhB,MAAM,EAAE,MAAM,EAC/B,QAAQ,EAAE,QAAQ;IAapB,MAAM,IAAI,OAAO;IAIjB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAO5B,OAAO,CAAC,sBAAsB;IAW9B,MAAM,IAAI,IAAI;IAId,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,KAAK;IA4Bb,OAAO,CAAC,eAAe;CAUxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElementBounds } from '@miragon/modeler-api';
|
|
2
|
+
/**
|
|
3
|
+
* The tight box around what the canvas draws of the map, in diagram coordinates, without a margin:
|
|
4
|
+
* every context's box with the type's name and the team row where they run past its sides, and
|
|
5
|
+
* every relationship's waypoints. The markers and role chips on a relationship sit between the
|
|
6
|
+
* contexts it connects. `undefined` while there is nothing to draw.
|
|
7
|
+
*
|
|
8
|
+
* Read from the model, never from the SVG: Chromium measures SVG text at the scaled font size, so a
|
|
9
|
+
* measured box would change with the zoom.
|
|
10
|
+
*/
|
|
11
|
+
export declare function contentBoundsOf(elements: Iterable<unknown>): ElementBounds | undefined;
|
|
12
|
+
//# sourceMappingURL=contentBounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentBounds.d.ts","sourceRoot":"","sources":["../../src/model/contentBounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,aAAa,GAAG,SAAS,CAsBtF"}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/theme/palette.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Values mirror the Miragon design system: the `miragon-brand:modeler-tool-design` skill in
|
|
6
6
|
* `Miragon/corporate-identity`, whose files are vendored unchanged next to this module
|
|
7
|
-
* (`cd-tokens.generated.css`, `cd-tokens.generated.json`, `cd-canvas.css`; design system 1.
|
|
7
|
+
* (`cd-tokens.generated.css`, `cd-tokens.generated.json`, `cd-canvas.css`; design system 1.15.0,
|
|
8
|
+
* unchanged since 1.13.0).
|
|
8
9
|
* Re-copy them from the skill to update; never fork the hex values by hand. SVG attributes need
|
|
9
10
|
* literal values (exports carry presentation attributes, never `var()`), so `draw/styles.ts`
|
|
10
11
|
* derives its colours from `MIRAGON`; the in-canvas chrome in `assets/context-maps.css` reads the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../src/theme/palette.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../src/theme/palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iGAAiG;AACjG,eAAO,MAAM,OAAO;IAClB,iEAAiE;;IAEjE,sEAAsE;;IAEtE,4FAA4F;;IAE5F,gGAAgG;;IAEhG,kEAAkE;;IAElE,qCAAqC;;;IAGrC,kEAAkE;;IAElE;;;OAGG;;;;;IAKH,mEAAmE;;CAE3D,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAc5C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sizes of the design system's `shell` tokens that the renderer's own chrome needs, for hosts
|
|
3
|
+
* without the modeler shell: the values of `cd-tokens.generated.json` (`test/theme.sync.test.ts`
|
|
4
|
+
* fails when one drifts). Pure data — no DOM, no imports.
|
|
5
|
+
*/
|
|
6
|
+
/** Guide §5.10: up to these container sizes a legend without a stored state starts closed. */
|
|
7
|
+
export declare const LEGEND_CLOSED_UP_TO: {
|
|
8
|
+
/** `--cd-shell-sehr-schmal` */
|
|
9
|
+
readonly width: 440;
|
|
10
|
+
/** `--cd-shell-niedrig` */
|
|
11
|
+
readonly height: 820;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=sizes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../src/theme/sizes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB;IAC9B,+BAA+B;;IAE/B,2BAA2B;;CAEnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miragon/context-maps-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Render and edit Context Maps diagrams in the browser, with a framework-agnostic viewer and modeler built on diagram-js.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@miragon/context-maps-schema-model": "0.4.0",
|
|
41
|
-
"@miragon/modeler-api": "1.
|
|
41
|
+
"@miragon/modeler-api": "1.3.0",
|
|
42
42
|
"diagram-js-direct-editing": "3.6.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|