@file-viewer/assets-drawing 3.0.1 → 3.0.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/assets-drawing",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Independent self-hosted Draw.io offline viewer runtime for opt-in File Viewer integration.",
@@ -20,7 +20,7 @@
20
20
  "file-viewer-assets-drawing": "./bin/install.mjs"
21
21
  },
22
22
  "dependencies": {
23
- "@file-viewer/asset-installer": "3.0.1"
23
+ "@file-viewer/asset-installer": "3.0.2"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=20"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@file-viewer/assets-drawing",
4
- "packageVersion": "3.0.1",
4
+ "packageVersion": "3.0.2",
5
5
  "copyGroups": [
6
6
  "drawing"
7
7
  ],
@@ -1,256 +1,256 @@
1
- /**
2
- * Copyright (c) 2006-2014, JGraph Holdings Ltd
3
- */
4
-
5
- //**********************************************************************************************************************************************************
6
- //Cabinet
7
- //**********************************************************************************************************************************************************
8
- /**
9
- * Extends mxShape.
10
- */
11
- function mxCabinetsCabinet(bounds, fill, stroke, strokewidth)
12
- {
13
- mxShape.call(this);
14
- this.bounds = bounds;
15
- this.fill = fill;
16
- this.stroke = stroke;
17
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
18
- };
19
-
20
- /**
21
- * Extends mxShape.
22
- */
23
- mxUtils.extend(mxCabinetsCabinet, mxShape);
24
-
25
- mxCabinetsCabinet.prototype.cst = {
26
- HAS_STAND : 'hasStand',
27
- CABINET : 'mxgraph.cabinets.cabinet'
28
- };
29
-
30
- mxCabinetsCabinet.prototype.customProperties = [
31
- {name: 'hasStand', dispName:'Has Stand', type:'bool', defVal:true}
32
- ];
33
-
34
- /**
35
- * Function: paintVertexShape
36
- *
37
- * Paints the vertex shape.
38
- */
39
- mxCabinetsCabinet.prototype.paintVertexShape = function(c, x, y, w, h)
40
- {
41
- c.translate(x, y);
42
- this.background(c, 0, 0, w, h);
43
- c.setShadow(false);
44
- this.foreground(c, 0, 0, w, h);
45
- };
46
-
47
- mxCabinetsCabinet.prototype.background = function(c, x, y, w, h)
48
- {
49
- c.rect(0, 0, w, h);
50
- c.fillAndStroke();
51
- };
52
-
53
- mxCabinetsCabinet.prototype.foreground = function(c, x, y, w, h)
54
- {
55
- var wallTh = 15;
56
- c.rect(0, 0, w, wallTh);
57
- c.stroke();
58
-
59
- c.begin();
60
- c.moveTo(wallTh, wallTh);
61
- c.lineTo(wallTh, h);
62
- c.moveTo(w - wallTh, wallTh);
63
- c.lineTo(w - wallTh, h);
64
- c.stroke();
65
-
66
- var hasStand = mxUtils.getValue(this.style, mxCabinetsCabinet.prototype.cst.HAS_STAND, '1');
67
-
68
- if (hasStand === 1)
69
- {
70
- c.rect(0, h - 40, w, 40);
71
- c.fillAndStroke();
72
- }
73
- else
74
- {
75
- c.rect(0, h - wallTh, w, wallTh);
76
- c.fillAndStroke();
77
- };
78
- };
79
-
80
- mxCellRenderer.registerShape(mxCabinetsCabinet.prototype.cst.CABINET, mxCabinetsCabinet);
81
-
82
- //**********************************************************************************************************************************************************
83
- //Cover Plate
84
- //**********************************************************************************************************************************************************
85
- /**
86
- * Extends mxShape.
87
- */
88
- function mxCabinetsCoverPlate(bounds, fill, stroke, strokewidth)
89
- {
90
- mxShape.call(this);
91
- this.bounds = bounds;
92
- this.fill = fill;
93
- this.stroke = stroke;
94
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
95
- };
96
-
97
- /**
98
- * Extends mxShape.
99
- */
100
- mxUtils.extend(mxCabinetsCoverPlate, mxShape);
101
-
102
- mxCabinetsCoverPlate.prototype.cst = {
103
- COVER_PLATE : 'mxgraph.cabinets.coverPlate'
104
- };
105
-
106
-
107
-
108
- /**
109
- * Function: paintVertexShape
110
- *
111
- * Paints the vertex shape.
112
- */
113
- mxCabinetsCoverPlate.prototype.paintVertexShape = function(c, x, y, w, h)
114
- {
115
- c.translate(x, y);
116
- this.background(c, 0, 0, w, h);
117
- c.setShadow(false);
118
- this.foreground(c, 0, 0, w, h);
119
- };
120
-
121
- mxCabinetsCoverPlate.prototype.background = function(c, x, y, w, h)
122
- {
123
- c.begin();
124
- c.moveTo(0, 0);
125
- c.lineTo(w, 0);
126
- c.lineTo(w, h);
127
- c.lineTo(0, h);
128
- c.close();
129
- c.moveTo(10, h * 0.5 - 12.5);
130
- c.lineTo(10, h * 0.5 + 12.5);
131
- c.lineTo(w - 10, h * 0.5 + 12.5);
132
- c.lineTo(w - 10, h * 0.5 - 12.5);
133
- c.close();
134
- c.fillAndStroke();
135
- };
136
-
137
- mxCabinetsCoverPlate.prototype.foreground = function(c, x, y, w, h)
138
- {
139
- };
140
-
141
- mxCellRenderer.registerShape(mxCabinetsCoverPlate.prototype.cst.COVER_PLATE, mxCabinetsCoverPlate);
142
-
143
- //**********************************************************************************************************************************************************
144
- //Dimension
145
- //**********************************************************************************************************************************************************
146
- /**
147
- * Extends mxShape.
148
- */
149
- function mxCabinetsDimension(bounds, fill, stroke, strokewidth)
150
- {
151
- mxShape.call(this);
152
- this.bounds = bounds;
153
- this.fill = fill;
154
- this.stroke = stroke;
155
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
156
- };
157
-
158
- /**
159
- * Extends mxShape.
160
- */
161
- mxUtils.extend(mxCabinetsDimension, mxShape);
162
-
163
- mxCabinetsDimension.prototype.cst = {
164
- DIMENSION : 'mxgraph.cabinets.dimension'
165
- };
166
-
167
-
168
-
169
- /**
170
- * Function: paintVertexShape
171
- *
172
- * Paints the vertex shape.
173
- */
174
- mxCabinetsDimension.prototype.paintVertexShape = function(c, x, y, w, h)
175
- {
176
- c.translate(x, y);
177
- this.background(c, x, y, w, h);
178
- };
179
-
180
- mxCabinetsDimension.prototype.background = function(c, x, y, w, h)
181
- {
182
- c.begin();
183
- c.moveTo(0, 20);
184
- c.lineTo(w, 20);
185
- c.moveTo(10, 15);
186
- c.lineTo(0, 20);
187
- c.lineTo(10, 25);
188
- c.moveTo(w - 10, 15);
189
- c.lineTo(w, 20);
190
- c.lineTo(w - 10, 25);
191
- c.moveTo(0, 15);
192
- c.lineTo(0, h);
193
- c.moveTo(w, 15);
194
- c.lineTo(w, h);
195
- c.stroke();
196
- };
197
-
198
- mxCellRenderer.registerShape(mxCabinetsDimension.prototype.cst.DIMENSION, mxCabinetsDimension);
199
-
200
- //**********************************************************************************************************************************************************
201
- //Dimension Bottom
202
- //**********************************************************************************************************************************************************
203
- /**
204
- * Extends mxShape.
205
- */
206
- function mxCabinetsDimensionBottom(bounds, fill, stroke, strokewidth)
207
- {
208
- mxShape.call(this);
209
- this.bounds = bounds;
210
- this.fill = fill;
211
- this.stroke = stroke;
212
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
213
- };
214
-
215
- /**
216
- * Extends mxShape.
217
- */
218
- mxUtils.extend(mxCabinetsDimensionBottom, mxShape);
219
-
220
- mxCabinetsDimensionBottom.prototype.cst = {
221
- DIMENSION : 'mxgraph.cabinets.dimensionBottom'
222
- };
223
-
224
-
225
-
226
- /**
227
- * Function: paintVertexShape
228
- *
229
- * Paints the vertex shape.
230
- */
231
- mxCabinetsDimensionBottom.prototype.paintVertexShape = function(c, x, y, w, h)
232
- {
233
- c.translate(x, y);
234
- this.background(c, x, y, w, h);
235
- };
236
-
237
- mxCabinetsDimensionBottom.prototype.background = function(c, x, y, w, h)
238
- {
239
- c.begin();
240
- c.moveTo(0, h - 20);
241
- c.lineTo(w, h - 20);
242
- c.moveTo(10, h - 15);
243
- c.lineTo(0, h - 20);
244
- c.lineTo(10, h - 25);
245
- c.moveTo(w - 10, h - 15);
246
- c.lineTo(w, h - 20);
247
- c.lineTo(w - 10, h - 25);
248
- c.moveTo(0, h - 15);
249
- c.lineTo(0, 0);
250
- c.moveTo(w, h - 15);
251
- c.lineTo(w, 0);
252
- c.stroke();
253
- };
254
-
255
- mxCellRenderer.registerShape(mxCabinetsDimensionBottom.prototype.cst.DIMENSION, mxCabinetsDimensionBottom);
256
-
1
+ /**
2
+ * Copyright (c) 2006-2014, JGraph Holdings Ltd
3
+ */
4
+
5
+ //**********************************************************************************************************************************************************
6
+ //Cabinet
7
+ //**********************************************************************************************************************************************************
8
+ /**
9
+ * Extends mxShape.
10
+ */
11
+ function mxCabinetsCabinet(bounds, fill, stroke, strokewidth)
12
+ {
13
+ mxShape.call(this);
14
+ this.bounds = bounds;
15
+ this.fill = fill;
16
+ this.stroke = stroke;
17
+ this.strokewidth = (strokewidth != null) ? strokewidth : 1;
18
+ };
19
+
20
+ /**
21
+ * Extends mxShape.
22
+ */
23
+ mxUtils.extend(mxCabinetsCabinet, mxShape);
24
+
25
+ mxCabinetsCabinet.prototype.cst = {
26
+ HAS_STAND : 'hasStand',
27
+ CABINET : 'mxgraph.cabinets.cabinet'
28
+ };
29
+
30
+ mxCabinetsCabinet.prototype.customProperties = [
31
+ {name: 'hasStand', dispName:'Has Stand', type:'bool', defVal:true}
32
+ ];
33
+
34
+ /**
35
+ * Function: paintVertexShape
36
+ *
37
+ * Paints the vertex shape.
38
+ */
39
+ mxCabinetsCabinet.prototype.paintVertexShape = function(c, x, y, w, h)
40
+ {
41
+ c.translate(x, y);
42
+ this.background(c, 0, 0, w, h);
43
+ c.setShadow(false);
44
+ this.foreground(c, 0, 0, w, h);
45
+ };
46
+
47
+ mxCabinetsCabinet.prototype.background = function(c, x, y, w, h)
48
+ {
49
+ c.rect(0, 0, w, h);
50
+ c.fillAndStroke();
51
+ };
52
+
53
+ mxCabinetsCabinet.prototype.foreground = function(c, x, y, w, h)
54
+ {
55
+ var wallTh = 15;
56
+ c.rect(0, 0, w, wallTh);
57
+ c.stroke();
58
+
59
+ c.begin();
60
+ c.moveTo(wallTh, wallTh);
61
+ c.lineTo(wallTh, h);
62
+ c.moveTo(w - wallTh, wallTh);
63
+ c.lineTo(w - wallTh, h);
64
+ c.stroke();
65
+
66
+ var hasStand = mxUtils.getValue(this.style, mxCabinetsCabinet.prototype.cst.HAS_STAND, '1');
67
+
68
+ if (hasStand === 1)
69
+ {
70
+ c.rect(0, h - 40, w, 40);
71
+ c.fillAndStroke();
72
+ }
73
+ else
74
+ {
75
+ c.rect(0, h - wallTh, w, wallTh);
76
+ c.fillAndStroke();
77
+ };
78
+ };
79
+
80
+ mxCellRenderer.registerShape(mxCabinetsCabinet.prototype.cst.CABINET, mxCabinetsCabinet);
81
+
82
+ //**********************************************************************************************************************************************************
83
+ //Cover Plate
84
+ //**********************************************************************************************************************************************************
85
+ /**
86
+ * Extends mxShape.
87
+ */
88
+ function mxCabinetsCoverPlate(bounds, fill, stroke, strokewidth)
89
+ {
90
+ mxShape.call(this);
91
+ this.bounds = bounds;
92
+ this.fill = fill;
93
+ this.stroke = stroke;
94
+ this.strokewidth = (strokewidth != null) ? strokewidth : 1;
95
+ };
96
+
97
+ /**
98
+ * Extends mxShape.
99
+ */
100
+ mxUtils.extend(mxCabinetsCoverPlate, mxShape);
101
+
102
+ mxCabinetsCoverPlate.prototype.cst = {
103
+ COVER_PLATE : 'mxgraph.cabinets.coverPlate'
104
+ };
105
+
106
+
107
+
108
+ /**
109
+ * Function: paintVertexShape
110
+ *
111
+ * Paints the vertex shape.
112
+ */
113
+ mxCabinetsCoverPlate.prototype.paintVertexShape = function(c, x, y, w, h)
114
+ {
115
+ c.translate(x, y);
116
+ this.background(c, 0, 0, w, h);
117
+ c.setShadow(false);
118
+ this.foreground(c, 0, 0, w, h);
119
+ };
120
+
121
+ mxCabinetsCoverPlate.prototype.background = function(c, x, y, w, h)
122
+ {
123
+ c.begin();
124
+ c.moveTo(0, 0);
125
+ c.lineTo(w, 0);
126
+ c.lineTo(w, h);
127
+ c.lineTo(0, h);
128
+ c.close();
129
+ c.moveTo(10, h * 0.5 - 12.5);
130
+ c.lineTo(10, h * 0.5 + 12.5);
131
+ c.lineTo(w - 10, h * 0.5 + 12.5);
132
+ c.lineTo(w - 10, h * 0.5 - 12.5);
133
+ c.close();
134
+ c.fillAndStroke();
135
+ };
136
+
137
+ mxCabinetsCoverPlate.prototype.foreground = function(c, x, y, w, h)
138
+ {
139
+ };
140
+
141
+ mxCellRenderer.registerShape(mxCabinetsCoverPlate.prototype.cst.COVER_PLATE, mxCabinetsCoverPlate);
142
+
143
+ //**********************************************************************************************************************************************************
144
+ //Dimension
145
+ //**********************************************************************************************************************************************************
146
+ /**
147
+ * Extends mxShape.
148
+ */
149
+ function mxCabinetsDimension(bounds, fill, stroke, strokewidth)
150
+ {
151
+ mxShape.call(this);
152
+ this.bounds = bounds;
153
+ this.fill = fill;
154
+ this.stroke = stroke;
155
+ this.strokewidth = (strokewidth != null) ? strokewidth : 1;
156
+ };
157
+
158
+ /**
159
+ * Extends mxShape.
160
+ */
161
+ mxUtils.extend(mxCabinetsDimension, mxShape);
162
+
163
+ mxCabinetsDimension.prototype.cst = {
164
+ DIMENSION : 'mxgraph.cabinets.dimension'
165
+ };
166
+
167
+
168
+
169
+ /**
170
+ * Function: paintVertexShape
171
+ *
172
+ * Paints the vertex shape.
173
+ */
174
+ mxCabinetsDimension.prototype.paintVertexShape = function(c, x, y, w, h)
175
+ {
176
+ c.translate(x, y);
177
+ this.background(c, x, y, w, h);
178
+ };
179
+
180
+ mxCabinetsDimension.prototype.background = function(c, x, y, w, h)
181
+ {
182
+ c.begin();
183
+ c.moveTo(0, 20);
184
+ c.lineTo(w, 20);
185
+ c.moveTo(10, 15);
186
+ c.lineTo(0, 20);
187
+ c.lineTo(10, 25);
188
+ c.moveTo(w - 10, 15);
189
+ c.lineTo(w, 20);
190
+ c.lineTo(w - 10, 25);
191
+ c.moveTo(0, 15);
192
+ c.lineTo(0, h);
193
+ c.moveTo(w, 15);
194
+ c.lineTo(w, h);
195
+ c.stroke();
196
+ };
197
+
198
+ mxCellRenderer.registerShape(mxCabinetsDimension.prototype.cst.DIMENSION, mxCabinetsDimension);
199
+
200
+ //**********************************************************************************************************************************************************
201
+ //Dimension Bottom
202
+ //**********************************************************************************************************************************************************
203
+ /**
204
+ * Extends mxShape.
205
+ */
206
+ function mxCabinetsDimensionBottom(bounds, fill, stroke, strokewidth)
207
+ {
208
+ mxShape.call(this);
209
+ this.bounds = bounds;
210
+ this.fill = fill;
211
+ this.stroke = stroke;
212
+ this.strokewidth = (strokewidth != null) ? strokewidth : 1;
213
+ };
214
+
215
+ /**
216
+ * Extends mxShape.
217
+ */
218
+ mxUtils.extend(mxCabinetsDimensionBottom, mxShape);
219
+
220
+ mxCabinetsDimensionBottom.prototype.cst = {
221
+ DIMENSION : 'mxgraph.cabinets.dimensionBottom'
222
+ };
223
+
224
+
225
+
226
+ /**
227
+ * Function: paintVertexShape
228
+ *
229
+ * Paints the vertex shape.
230
+ */
231
+ mxCabinetsDimensionBottom.prototype.paintVertexShape = function(c, x, y, w, h)
232
+ {
233
+ c.translate(x, y);
234
+ this.background(c, x, y, w, h);
235
+ };
236
+
237
+ mxCabinetsDimensionBottom.prototype.background = function(c, x, y, w, h)
238
+ {
239
+ c.begin();
240
+ c.moveTo(0, h - 20);
241
+ c.lineTo(w, h - 20);
242
+ c.moveTo(10, h - 15);
243
+ c.lineTo(0, h - 20);
244
+ c.lineTo(10, h - 25);
245
+ c.moveTo(w - 10, h - 15);
246
+ c.lineTo(w, h - 20);
247
+ c.lineTo(w - 10, h - 25);
248
+ c.moveTo(0, h - 15);
249
+ c.lineTo(0, 0);
250
+ c.moveTo(w, h - 15);
251
+ c.lineTo(w, 0);
252
+ c.stroke();
253
+ };
254
+
255
+ mxCellRenderer.registerShape(mxCabinetsDimensionBottom.prototype.cst.DIMENSION, mxCabinetsDimensionBottom);
256
+