@celldl/viewer 0.20260807.1 → 0.20260822.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.
@@ -0,0 +1,6 @@
1
+ import { CellDLObject } from '../celldlObjects';
2
+ import { CellDLSVGElement } from '.';
3
+ export declare class BoundedElement extends CellDLSVGElement {
4
+ #private;
5
+ constructor(object: CellDLObject, svgElement: SVGGraphicsElement);
6
+ }
@@ -0,0 +1,27 @@
1
+ import { CellDLObject } from '../celldlObjects';
2
+ import { Point, PointLike } from '../common/points';
3
+ import { Bounds } from '../geometry';
4
+ import { Transform } from '../geometry/transforms';
5
+ export declare class CellDLSVGElement {
6
+ #private;
7
+ readonly celldlObject: CellDLObject;
8
+ constructor(celldlObject: CellDLObject, svgElement: SVGGraphicsElement | null);
9
+ get bounds(): Bounds;
10
+ get centroid(): Point;
11
+ get centroidOffset(): Point;
12
+ get corners(): [Point, Point];
13
+ get globalTransform(): Transform | null;
14
+ get height(): number;
15
+ get id(): string;
16
+ get selected(): boolean;
17
+ get size(): Point;
18
+ get svgElement(): SVGGraphicsElement;
19
+ get topLeft(): Point;
20
+ get width(): number;
21
+ setCentroid(centroid: Point): void;
22
+ svgBounds(recalculate?: boolean): Bounds;
23
+ activate(active?: boolean): void;
24
+ highlight(highlight?: boolean): void;
25
+ pointerEvent(_eventType: string, _svgElement: SVGGraphicsElement, _svgCoords: PointLike): boolean;
26
+ select(selected?: boolean): void;
27
+ }
@@ -0,0 +1,85 @@
1
+ import { NamedNode } from '@celldl/rdf';
2
+ import { PropertiesType } from '../common/types';
3
+ import { CellDLSVGElement } from '../SVGElements';
4
+ import { CellDLModel } from '../viewer/model';
5
+ export declare enum CELLDL_CLASS {
6
+ Annotation = "celldl-Annotation",
7
+ Component = "celldl-Component",
8
+ Connector = "celldl-Connector",
9
+ Connection = "celldl-Connection",
10
+ Conduit = "celldl-Conduit",
11
+ Compartment = "celldl-Compartment",
12
+ Interface = "celldl-InterfacePort",
13
+ Layer = "celldl-Layer",
14
+ UnconnectedPort = "celldl-Unconnected",
15
+ Unknown = ""
16
+ }
17
+ export declare class CellDLObject {
18
+ #private;
19
+ readonly uri: NamedNode;
20
+ readonly options: PropertiesType;
21
+ static celldlClassName: CELLDL_CLASS;
22
+ static celldlType: string;
23
+ constructor(uri: NamedNode, options: PropertiesType | undefined, celldlModel: CellDLModel);
24
+ toString(): string;
25
+ get celldlClassName(): CELLDL_CLASS;
26
+ get celldlModel(): CellDLModel;
27
+ get celldlSvgElement(): CellDLSVGElement | undefined;
28
+ setCelldlSvgElement(celldlSvgElement: CellDLSVGElement): void;
29
+ get hasEditGuides(): boolean;
30
+ get id(): string;
31
+ isA(rdfType: NamedNode): boolean;
32
+ get isAlignable(): boolean;
33
+ get isAnnotation(): boolean;
34
+ get isComponent(): boolean;
35
+ get isConduit(): boolean;
36
+ get isConnectable(): boolean;
37
+ get isConnection(): boolean;
38
+ get isCompartment(): boolean;
39
+ get isInterface(): boolean;
40
+ get selected(): boolean | undefined;
41
+ get svgElement(): SVGGraphicsElement | null;
42
+ get tooltip(): string | undefined;
43
+ set tooltip(tooltip: string);
44
+ activate(active?: boolean): void;
45
+ highlight(highlight?: boolean): void;
46
+ select(selected?: boolean): void;
47
+ assignSvgElement(_svgElement: SVGGraphicsElement): void;
48
+ }
49
+ export declare class CellDLMoveableObject extends CellDLObject {
50
+ assignSvgElement(svgElement: SVGGraphicsElement): void;
51
+ }
52
+ export declare class CellDLAnnotation extends CellDLMoveableObject {
53
+ static celldlClassName: CELLDL_CLASS;
54
+ static celldlType: string;
55
+ }
56
+ export declare class CellDLConnectedObject extends CellDLMoveableObject {
57
+ static celldlType: string;
58
+ get isConnectable(): boolean;
59
+ }
60
+ export declare class CellDLComponent extends CellDLConnectedObject {
61
+ static celldlClassName: CELLDL_CLASS;
62
+ static celldlType: string;
63
+ }
64
+ export declare class CellDLConduit extends CellDLComponent {
65
+ static readonly celldlClassName = CELLDL_CLASS.Conduit;
66
+ static celldlType: string;
67
+ }
68
+ export declare class CellDLCompartment extends CellDLConnectedObject {
69
+ static readonly celldlClassName = CELLDL_CLASS.Compartment;
70
+ static celldlType: string;
71
+ }
72
+ export declare class CellDLConnection extends CellDLObject {
73
+ static readonly celldlClassName = CELLDL_CLASS.Connection;
74
+ static celldlType: string;
75
+ }
76
+ export declare class CellDLInterface extends CellDLConnectedObject {
77
+ #private;
78
+ static readonly celldlClassName = CELLDL_CLASS.Interface;
79
+ static celldlType: string;
80
+ toString(): string;
81
+ }
82
+ export declare class CellDLUnconnectedPort extends CellDLConnectedObject {
83
+ static readonly celldlClassName = CELLDL_CLASS.UnconnectedPort;
84
+ static celldlType: string;
85
+ }
@@ -0,0 +1,7 @@
1
+ export declare function isWindows(): boolean;
2
+ export declare function isLinux(): boolean;
3
+ export declare function isMacOs(): boolean;
4
+ export declare function isDesktop(): boolean;
5
+ export declare function isCtrlOrCmd(event: KeyboardEvent): boolean;
6
+ export declare function formatTime(time: number): string;
7
+ export declare function formatIssue(issue: string): string;
@@ -0,0 +1,56 @@
1
+ /******************************************************************************
2
+
3
+ CellDL Model Viewer
4
+
5
+ Copyright (c) 2022 - 2025 David Brooks
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ******************************************************************************/
20
+ export interface PointLike {
21
+ x: number;
22
+ y: number;
23
+ }
24
+ export type PointArray = [number, number];
25
+ export declare const POINT_EPSILON = 0.0001;
26
+ export declare const POINT_EPSILON_SQUARED: number;
27
+ export declare class Point implements PointLike {
28
+ readonly x: number;
29
+ readonly y: number;
30
+ constructor(x?: number, y?: number);
31
+ static fromPoint(point: PointLike): Point;
32
+ static fromArray(coords: PointArray): Point;
33
+ asArray(): PointArray;
34
+ add(point: PointLike): Point;
35
+ colinear(p1: PointLike, p2: PointLike, between?: boolean): boolean;
36
+ copy(): Point;
37
+ distance(point: PointLike): number;
38
+ equals(point: PointLike): boolean;
39
+ isZero(): boolean;
40
+ apply(fn: (n: number) => number): Point;
41
+ scalarScale(scale: number): Point;
42
+ scale(scale: PointLike): Point;
43
+ subtract(point: PointLike): Point;
44
+ toString(): string;
45
+ }
46
+ export declare class PointMath {
47
+ static add(p1: PointLike, p2: PointLike): Point;
48
+ static apply(p1: PointLike, fn: (number: number) => number): Point;
49
+ static colinear(p0: PointLike, p1: PointLike, p2: PointLike, between?: boolean): boolean;
50
+ static distance(p1: PointLike, p2: PointLike): number;
51
+ static equals(p1: PointLike, p2: PointLike): boolean;
52
+ static isZero(pt: PointLike): boolean;
53
+ static scalarScale(p1: PointLike, scale: number): Point;
54
+ static scale(p1: PointLike, scale: PointLike): Point;
55
+ static subtract(p1: PointLike, p2: PointLike): Point;
56
+ }
@@ -0,0 +1,36 @@
1
+ /******************************************************************************
2
+
3
+ CellDL Model Viewer
4
+
5
+ Copyright (c) 2022 - 2025 David Brooks
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ******************************************************************************/
20
+ export declare const CONNECTION_ARROW_SIZE: number[];
21
+ export declare const CONNECTION_SPLAY_PADDING = 16;
22
+ export declare const MAX_CONNECTION_SPLAY_PADDING = 20;
23
+ export declare const CONNECTION_COLOUR = "#456";
24
+ export declare const OLD_CONNECTION_COLOUR = "#334155";
25
+ export declare const CONNECTION_WIDTH = 2;
26
+ export declare const CONNECTION_DASH = 2;
27
+ export declare const INTERFACE_PORT_RADIUS = 4;
28
+ export declare const SELECTION_STROKE_WIDTH = 3;
29
+ export declare const CELLDL_BACKGROUND_CLASS = "celldl-background";
30
+ export declare function arrowMarkerDefinition(markerId: string, markerType: string): string;
31
+ export type GradientStop = {
32
+ offset: string;
33
+ colour: string;
34
+ };
35
+ export declare function gradientDefinition(type: string, gradientId: string, stops: GradientStop[]): string;
36
+ export declare const CellDLStylesheet: string;
@@ -0,0 +1,41 @@
1
+ import { PointLike } from '../common/points';
2
+ import { StringProperties } from '../common/types';
3
+ import { Extent } from '../geometry';
4
+ export declare const SVG_URI = "http://www.w3.org/2000/svg";
5
+ export interface INodeStyle {
6
+ gradientFill: boolean;
7
+ colours: string[];
8
+ direction?: string;
9
+ }
10
+ export interface IPathStyle {
11
+ colour: string;
12
+ width: number;
13
+ dashed: boolean;
14
+ }
15
+ export interface LatexMathSvgOptions {
16
+ background?: string | string[];
17
+ border?: string;
18
+ 'border-width'?: string;
19
+ class?: string;
20
+ 'corner-radius'?: string;
21
+ 'middle-colour'?: string;
22
+ 'min-height'?: string;
23
+ 'min-width'?: string;
24
+ padding?: string;
25
+ 'vertical-align'?: string;
26
+ }
27
+ export declare function svgSize(svgDocument: Document): PointLike | null;
28
+ export declare function getViewbox(svgElement: SVGGraphicsElement): Extent;
29
+ type Attributes = StringProperties;
30
+ export declare function createSVGElement(tagName: string, attributes: Attributes): SVGElement;
31
+ export declare function svgCircle(centre: PointLike, radius: number, attributes?: Attributes): string;
32
+ export declare function svgCircleElement(centre: PointLike, radius: number, attributes?: Attributes): SVGCircleElement;
33
+ export declare function svgPath(points: PointLike[], attributes?: Attributes): string;
34
+ export declare function svgPathDescription(points: PointLike[]): string;
35
+ export declare function svgPathElement(points: PointLike[], attributes?: Attributes): SVGPathElement;
36
+ export declare function svgRect(topLeft: PointLike, bottomRight: PointLike, attributes?: Attributes): string;
37
+ export declare function svgRectElement(topLeft: PointLike, bottomRight: PointLike, attributes?: StringProperties): SVGRectElement;
38
+ export declare const LatexStyleRules: string;
39
+ export declare function base64Svg(svg: string): string;
40
+ export declare function getSvgImageFromBase64(svgText: string): string | undefined;
41
+ export {};
@@ -0,0 +1,23 @@
1
+ /******************************************************************************
2
+
3
+ CellDL Model Viewer
4
+
5
+ Copyright (c) 2022 - 2025 David Brooks
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ******************************************************************************/
20
+ export type Constructor<T> = new (...args: any[]) => T;
21
+ export type Pair<T> = [T, T];
22
+ export type PropertiesType = Record<string, string | number | boolean>;
23
+ export type StringProperties = Record<string, string>;
@@ -0,0 +1,9 @@
1
+ import { Theme } from '../index';
2
+ import * as vue from 'vue';
3
+ export declare const activeInstanceUid: () => vue.Ref<string | null, string | null>;
4
+ export declare const useTheme: () => {
5
+ theme: () => Theme;
6
+ setTheme: (newTheme: Theme | undefined) => void;
7
+ useLightMode: () => boolean;
8
+ useDarkMode: () => boolean;
9
+ };
@@ -0,0 +1,24 @@
1
+ import { Annotation, Annotations, SvgViewerOptions, Theme } from '../index';
2
+ import * as vue from 'vue';
3
+ export interface SvgViewerProps {
4
+ annotations?: Annotations;
5
+ svgData: string;
6
+ options?: SvgViewerOptions;
7
+ theme?: Theme;
8
+ }
9
+ export type ViewerEvent = {
10
+ type: string;
11
+ component?: {
12
+ id: string;
13
+ annotation?: Annotation;
14
+ };
15
+ };
16
+ declare const __VLS_export: vue.DefineComponent<SvgViewerProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
17
+ error: (msg: string) => any;
18
+ event: (detail: ViewerEvent) => any;
19
+ }, string, vue.PublicProps, Readonly<SvgViewerProps> & Readonly<{
20
+ onError?: ((msg: string) => any) | undefined;
21
+ onEvent?: ((detail: ViewerEvent) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { SvgViewerProps, ViewerEvent } from './ViewerComponent.vue';
2
+ import * as vue from 'vue';
3
+ declare const __VLS_export: vue.DefineComponent<SvgViewerProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
4
+ error: (msg: string) => any;
5
+ event: (detail: ViewerEvent) => any;
6
+ }, string, vue.PublicProps, Readonly<SvgViewerProps> & Readonly<{
7
+ onError?: ((msg: string) => any) | undefined;
8
+ onEvent?: ((detail: ViewerEvent) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { Point } from '../common/points';
2
+ import { StringProperties } from '../common/types';
3
+ import { RestrictedPoint } from '.';
4
+ export declare class ControlRect {
5
+ #private;
6
+ constructor(corner_0: RestrictedPoint, corner_1: RestrictedPoint, centroidOffset?: Point | null);
7
+ get centroid(): RestrictedPoint;
8
+ get dirty(): boolean;
9
+ get fixed(): boolean;
10
+ get svgElement(): SVGRectElement | null;
11
+ get topLeftPoint(): Point;
12
+ clean(): void;
13
+ copy(): ControlRect;
14
+ setCornerPositions(corner_0: RestrictedPoint, corner_1: RestrictedPoint): void;
15
+ setCentroidOffset(centroidOffset: Point): void;
16
+ svg(attributes?: StringProperties): string;
17
+ }
18
+ export declare class FixedControlRect extends ControlRect {
19
+ constructor(bounds: [number, number, number, number]);
20
+ }
@@ -0,0 +1,85 @@
1
+ import { Point, PointLike } from '../common/points';
2
+ import { Transform } from '../geometry/transforms';
3
+ /**
4
+ * [left, top, width, height]
5
+ */
6
+ export type Extent = [number, number, number, number];
7
+ export declare class Bounds {
8
+ #private;
9
+ constructor(left: number, top: number, right: number, bottom: number);
10
+ get left(): number;
11
+ get right(): number;
12
+ get top(): number;
13
+ get bottom(): number;
14
+ static fromPoints(pt0: PointLike, pt1: PointLike): Bounds;
15
+ static fromSvg(svgElement: SVGGraphicsElement, globalTransform?: Transform | null): Bounds;
16
+ get height(): number;
17
+ get topLeft(): Point;
18
+ get width(): number;
19
+ asArray(): [number, number, number, number];
20
+ asPoints(): [Point, Point];
21
+ equal(bounds: Bounds, epsilon?: number): boolean;
22
+ expand(margin: number): Bounds;
23
+ inContainer(container: Bounds): boolean;
24
+ }
25
+ interface NumericRange {
26
+ minimum: number;
27
+ maximum: number;
28
+ }
29
+ export declare class RestrictedValue implements NumericRange {
30
+ #private;
31
+ readonly id: string;
32
+ constructor(value?: number, rangeStart?: number | RestrictedValue, rangeEnd?: number | RestrictedValue);
33
+ clean(): void;
34
+ get dirty(): boolean;
35
+ get fixed(): boolean;
36
+ get minimum(): number;
37
+ get maximum(): number;
38
+ get value(): number;
39
+ set value(value: number);
40
+ copy(): RestrictedValue;
41
+ adjustValue(delta: number): void;
42
+ narrowRange(minimum: number | RestrictedValue, maximum: number | RestrictedValue): void;
43
+ reassignMaximum(maximum: number | RestrictedValue): void;
44
+ reassignMinimum(minimum: number | RestrictedValue): void;
45
+ reassignValue(value: number): void;
46
+ toString(): string;
47
+ }
48
+ export declare class FixedValue extends RestrictedValue {
49
+ constructor(value: number);
50
+ get fixed(): boolean;
51
+ copy(): FixedValue;
52
+ narrowRange(_minimum: number, _maximum: number): void;
53
+ reassignValue(value: number): void;
54
+ }
55
+ export declare class ComputedValue extends RestrictedValue {
56
+ #private;
57
+ constructor(value: () => number, minimum?: number | RestrictedValue, maximum?: number | RestrictedValue);
58
+ get dirty(): boolean;
59
+ get value(): number;
60
+ set value(_: number);
61
+ }
62
+ export declare class RestrictedPoint {
63
+ #private;
64
+ constructor(xValue: RestrictedValue, yValue: RestrictedValue);
65
+ static fromPoint(point: PointLike): RestrictedPoint;
66
+ get dirty(): boolean;
67
+ get fixed(): boolean;
68
+ get point(): Point;
69
+ set point(point: PointLike);
70
+ get x(): number;
71
+ get y(): number;
72
+ get xValue(): RestrictedValue;
73
+ set xValue(value: RestrictedValue);
74
+ get yValue(): RestrictedValue;
75
+ set yValue(value: RestrictedValue);
76
+ clean(): void;
77
+ adjustValue(delta: PointLike): void;
78
+ copy(): RestrictedPoint;
79
+ reassignValue(point: PointLike): void;
80
+ toString(): string;
81
+ }
82
+ export declare class FixedPoint extends RestrictedPoint {
83
+ constructor(xValue: FixedValue, yValue: FixedValue);
84
+ }
85
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Matrix } from 'transformation-matrix';
2
+ import { Point, PointLike } from '../common/points';
3
+ export declare class Transform {
4
+ #private;
5
+ constructor(matrix: Matrix);
6
+ static fromString(matrix: string): Transform;
7
+ static Identity(): Transform;
8
+ get isIdentity(): boolean;
9
+ inverse(): Transform;
10
+ leftMultiply(transform: Transform): Transform;
11
+ toString(): string;
12
+ transformPoint(point: PointLike): Point;
13
+ transformPoints(points: PointLike[]): Point[];
14
+ static Translate(tx: number, ty: number): Transform;
15
+ }
@@ -0,0 +1,23 @@
1
+ /******************************************************************************
2
+
3
+ CellDL Model Viewer
4
+
5
+ Copyright (c) 2022 - 2025 David Brooks
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ******************************************************************************/
20
+ export declare const EM_SIZE = 16;
21
+ export declare const EX_SIZE: number;
22
+ export declare function lengthToPixels(length: string | number | null): number | null;
23
+ export declare function pixelsToLength(pixels: string | number, units: string): string | null;
@@ -0,0 +1,12 @@
1
+ import { SvgViewerProps, ViewerEvent } from './components/ViewerComponent.vue';
2
+ import { default as SvgViewer } from './components/WrappedViewer.vue';
3
+ export type Theme = 'light' | 'dark' | 'system';
4
+ export { SvgViewer };
5
+ export default SvgViewer;
6
+ export type AnnotationValue = string | number | boolean | object;
7
+ export type Annotation = Record<string, AnnotationValue>;
8
+ export type Annotations = Record<string, Annotation>;
9
+ export type SvgViewerOptions = {
10
+ tooltip?: string;
11
+ };
12
+ export type { SvgViewerProps, ViewerEvent };
@@ -0,0 +1,6 @@
1
+ import { Pair } from './common/types';
2
+ export declare function sleep(ms: number): Promise<unknown>;
3
+ export declare function round(length: number, decimalPlaces?: number): number;
4
+ export declare function roundEqual(l1: number, l2: number, decimalPlaces?: number): boolean;
5
+ export declare function range(startOrStop: number, stop?: number | null, step?: number | null): Generator<number, void, unknown>;
6
+ export declare function pairwise<T>(a: T[]): Pair<T>[];
@@ -0,0 +1,14 @@
1
+ import { CellDLModel } from './model';
2
+ export declare function notifyChanges(): void;
3
+ export declare function getElementId(element: SVGGraphicsElement): string;
4
+ export declare class CellDLViewer {
5
+ #private;
6
+ static instance: CellDLViewer | null;
7
+ constructor();
8
+ mount(svgContainer: HTMLElement, scopeId: string): void;
9
+ get celldlModel(): CellDLModel | null;
10
+ get windowSize(): [number, number];
11
+ viewDiagram(celldlModel: CellDLModel): Promise<void>;
12
+ closeDiagram(newDiagram?: boolean): void;
13
+ resetObjectStates(): void;
14
+ }
@@ -0,0 +1,17 @@
1
+ import { MetadataStore } from '@celldl/metadata';
2
+ import { CellDLObject } from '../celldlObjects';
3
+ import { CellDLViewer } from '.';
4
+ import { Annotations, SvgViewerOptions } from '../index';
5
+ import * as $rdf from '@celldl/rdf';
6
+ export declare class CellDLModel {
7
+ #private;
8
+ constructor(celldlViewer: CellDLViewer, celldlData?: string, annotations?: Annotations, options?: SvgViewerOptions | undefined);
9
+ finishSetup(): void;
10
+ viewModel(): Promise<void>;
11
+ viewerEvent(type: string, object?: CellDLObject | undefined): void;
12
+ get rdfStore(): MetadataStore;
13
+ get svgDiagram(): SVGSVGElement | null;
14
+ get uri(): string;
15
+ makeUri(id: string): $rdf.NamedNode;
16
+ objectById(id: string): CellDLObject | null;
17
+ }
@@ -0,0 +1,30 @@
1
+ /******************************************************************************
2
+
3
+ CellDL Model Viewer
4
+
5
+ Copyright (c) 2022 - 2025 David Brooks
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ******************************************************************************/
20
+ export default class PanZoom {
21
+ #private;
22
+ constructor(container: HTMLElement);
23
+ get panning(): boolean;
24
+ get scale(): number;
25
+ enable(svgDiagram: SVGSVGElement): void;
26
+ disable(): void;
27
+ pointerDown(event: PointerEvent): void;
28
+ pointerMove(event: PointerEvent): boolean;
29
+ pointerUp(_event: PointerEvent): void;
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celldl/viewer",
3
- "version": "0.20260807.1",
3
+ "version": "0.20260822.0",
4
4
  "author": {
5
5
  "name": "David Brooks",
6
6
  "email": "d.brooks@auckland.ac.nz"
@@ -38,53 +38,52 @@
38
38
  "./style.css": "./dist/CellDLViewer.css"
39
39
  },
40
40
  "scripts": {
41
- "build": "bun oxigraph:check && vite --config vite.config.ts build app",
42
- "build:lib": "bun oxigraph:check && vite build --config vite.lib.config.ts && cp src/index.d.ts dist/index.d.ts",
41
+ "build": "vite --config vite.config.ts build app",
42
+ "build:lib": "vite build --config vite.lib.config.ts",
43
43
  "clean": "bun scripts/clean.js",
44
- "dev": "bun oxigraph:check && vite --config vite.config.ts app",
44
+ "dev": "vite --config vite.config.ts app",
45
45
  "format": "bunx --bun biome format --fix --max-diagnostics=none",
46
46
  "format:check": "bunx --bun biome format --max-diagnostics=none",
47
47
  "lint": "bunx --bun biome lint --fix --error-on-warnings --max-diagnostics=none",
48
- "oxigraph:check": "bun ./scripts/check-oxigraph.ts",
49
48
  "start": "bun run build && vite preview",
50
49
  "version:new": "bun scripts/version.js"
51
50
  },
52
- "peerDependencies": {
53
- "vue": "3.4.21"
54
- },
55
51
  "dependencies": {
56
52
  "@atomic-ehr/ucum": "^0.2.5",
57
- "@jeswr/pretty-turtle": "^1.8.2",
58
- "@vueuse/core": "14.1.0",
59
- "oxigraph": "^0.5.2",
53
+ "@celldl/metadata": "^1.20260822.0",
54
+ "@celldl/rdf": "^1.20260822.0",
55
+ "@vueuse/core": "14.3.0",
56
+ "primeicons": "^7.0.0",
57
+ "primevue": "4.2.5",
60
58
  "systeminformation": "^5.27.11",
61
59
  "transformation-matrix": "^3.1.0",
62
60
  "ua-parser-js": "^2.0.8",
63
- "vue": "3.4.21",
61
+ "vue": "3.5.40",
64
62
  "vue-tippy": "^6.7.1"
65
63
  },
66
64
  "devDependencies": {
67
65
  "@biomejs/biome": "^2.3.11",
68
66
  "@primeuix/themes": "^2.0.2",
69
67
  "@primevue/auto-import-resolver": "4.2.5",
70
- "@rollup/plugin-typescript": "^12.3.0",
71
68
  "@tailwindcss/postcss": "^4.1.18",
72
69
  "@tailwindcss/vite": "^4.1.18",
73
- "@types/node": "^25.0.9",
70
+ "@types/node": "^26.2.0",
74
71
  "@types/svg-intersections": "^0.4.4",
75
- "@vitejs/plugin-vue": "^6.0.3",
72
+ "@typescript/typescript6": "^6.0.2",
73
+ "@vitejs/plugin-vue": "^6.0.8",
76
74
  "@vue/tsconfig": "^0.8.1",
77
- "autoprefixer": "^10.4.23",
75
+ "autoprefixer": "^10.5.4",
78
76
  "isomorphic-fetch": "^3.0.0",
79
- "primeicons": "^7.0.0",
80
- "primevue": "4.2.5",
81
77
  "pug": "^3.0.3",
82
78
  "pug-plain-loader": "^1.1.0",
83
- "tailwindcss": "^4.1.18",
79
+ "tailwindcss": "^4.3.3",
84
80
  "tailwindcss-primeui": "^0.6.1",
85
81
  "tslib": "^2.8.1",
86
- "typescript": "~6.0.3",
87
- "unplugin-vue-components": "^31.0.0",
88
- "vite": "^7.2.7"
82
+ "typescript": "^7.0.2",
83
+ "typescript-6": "npm:typescript@^6.0.3",
84
+ "unplugin-vue-components": "^32.1.0",
85
+ "vite": "^8.2.0",
86
+ "vite-plugin-dts": "^5.0.3",
87
+ "vue-tsc": "^3.3.8"
89
88
  }
90
89
  }