lutaml 0.10.6 → 0.10.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d14c7a5bae3898f5e06b776dd0ccd99585a31dc8e64b46399f5b72300723b74
4
- data.tar.gz: 589966db805d8628b18553b40422d87897953733b39afcecbe575068f00328dd
3
+ metadata.gz: 84ecefe8a15ae033ee203318b3db70ac20ea3f727d4a94cb98ffdd6444f0111f
4
+ data.tar.gz: afe30e1675098ee1248114e4999117b0b8b159c902ae304e5d4b8212ac801bfa
5
5
  SHA512:
6
- metadata.gz: e9d7775ce3d857dcc2aade2b031b290d25ed836a403b523144529504432b6c70329a7f1afcedbfbf8993456ede5503d2285e17faf43a5e56a85d7675a302ca92
7
- data.tar.gz: 02aad1765ea02693cfe909e0bded8c0b39fe7590a8476ffd0afce505d3fd5757834b7fdf725bea739f7a8898a4f4d50560c3e5f7a84a241f2b0e532d4be18706
6
+ metadata.gz: 4ac75c14a3991c8b7885f4fc62fbe29640be5fe7b4d2cc9a5abfc01c585e038dd50a495a69cdab4483fb6840671b1a1ab35a66263e570c1da7cc005ce9fda626
7
+ data.tar.gz: 92f724a84ddfc10d49800a2f118bdc31d6d80054d9238a2feacc0a1f9e74312ea1fc96ac95b58893f5ec24d88f1fbe09f2b2eff64be6b45f879208babfa162b8
data/.rubocop_todo.yml CHANGED
@@ -1,102 +1,21 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-05-06 18:53:03 UTC using RuboCop version 1.86.1.
3
+ # on 2026-05-07 04:34:28 UTC using RuboCop version 1.86.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 8
9
+ # Offense count: 7
10
10
  # This cop supports safe autocorrection (--autocorrect).
11
11
  # Configuration parameters: EnforcedStyle, IndentationWidth.
12
12
  # SupportedStyles: with_first_argument, with_fixed_indentation
13
13
  Layout/ArgumentAlignment:
14
14
  Exclude:
15
- - 'lib/lutaml/qea/factory/generalization_builder.rb'
16
- - 'lib/lutaml/uml_repository/exporters/markdown_exporter.rb'
17
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
18
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
19
-
20
- # Offense count: 11
21
- # This cop supports safe autocorrection (--autocorrect).
22
- # Configuration parameters: EnforcedStyleAlignWith.
23
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
24
- Layout/BlockAlignment:
25
- Exclude:
26
- - 'lib/lutaml/qea/factory/class_transformer.rb'
27
- - 'lib/lutaml/uml_repository/exporters/markdown/class_page_builder.rb'
28
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
29
- - 'lib/lutaml/uml_repository/static_site/serializers/package_serializer.rb'
30
- - 'lib/lutaml/uml_repository/static_site/serializers/package_tree_builder.rb'
31
- - 'spec/lutaml/uml_repository/package_exporter_spec.rb'
32
- - 'spec/lutaml/uml_repository/static_site/template_file_system_spec.rb'
33
-
34
- # Offense count: 11
35
- # This cop supports safe autocorrection (--autocorrect).
36
- Layout/BlockEndNewline:
37
- Exclude:
38
- - 'lib/lutaml/qea/factory/class_transformer.rb'
39
- - 'lib/lutaml/uml_repository/exporters/markdown/class_page_builder.rb'
40
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
41
- - 'lib/lutaml/uml_repository/static_site/serializers/package_serializer.rb'
42
- - 'lib/lutaml/uml_repository/static_site/serializers/package_tree_builder.rb'
43
- - 'spec/lutaml/uml_repository/package_exporter_spec.rb'
44
- - 'spec/lutaml/uml_repository/static_site/template_file_system_spec.rb'
45
-
46
- # Offense count: 2
47
- # This cop supports safe autocorrection (--autocorrect).
48
- Layout/ClosingParenthesisIndentation:
49
- Exclude:
50
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
51
-
52
- # Offense count: 1
53
- # This cop supports safe autocorrection (--autocorrect).
54
- Layout/ElseAlignment:
55
- Exclude:
56
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
57
-
58
- # Offense count: 16
59
- # This cop supports safe autocorrection (--autocorrect).
60
- Layout/EmptyLineAfterGuardClause:
61
- Exclude:
62
- - 'lib/lutaml/qea/factory/association_builder.rb'
63
- - 'lib/lutaml/uml/inheritance_walker.rb'
64
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
65
- - 'lib/lutaml/uml_repository/static_site/serializers/class_serializer.rb'
66
- - 'lib/lutaml/uml_repository/static_site/serializers/diagram_serializer.rb'
67
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
68
- - 'lib/lutaml/uml_repository/static_site/serializers/package_serializer.rb'
69
-
70
- # Offense count: 4
71
- # This cop supports safe autocorrection (--autocorrect).
72
- # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
73
- Layout/EmptyLineBetweenDefs:
74
- Exclude:
75
- - 'lib/lutaml/cli/interactive_shell/command_base.rb'
76
-
77
- # Offense count: 1
78
- # This cop supports safe autocorrection (--autocorrect).
79
- Layout/EmptyLinesAfterModuleInclusion:
80
- Exclude:
81
- - 'lib/lutaml/uml_repository/repository.rb'
82
-
83
- # Offense count: 1
84
- # This cop supports safe autocorrection (--autocorrect).
85
- # Configuration parameters: EnforcedStyleAlignWith.
86
- # SupportedStylesAlignWith: keyword, variable, start_of_line
87
- Layout/EndAlignment:
88
- Exclude:
89
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
90
-
91
- # Offense count: 2
92
- # This cop supports safe autocorrection (--autocorrect).
93
- # Configuration parameters: EnforcedStyle, IndentationWidth.
94
- # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
95
- Layout/FirstArgumentIndentation:
96
- Exclude:
97
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
15
+ - 'lib/lutaml/uml_repository/static_site/generator.rb'
16
+ - 'spec/lutaml/uml_repository/static_site/serializers/diagram_serializer_spec.rb'
98
17
 
99
- # Offense count: 2
18
+ # Offense count: 6
100
19
  # This cop supports safe autocorrection (--autocorrect).
101
20
  # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
102
21
  # SupportedHashRocketStyles: key, separator, table
@@ -104,59 +23,21 @@ Layout/FirstArgumentIndentation:
104
23
  # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
105
24
  Layout/HashAlignment:
106
25
  Exclude:
107
- - 'lib/lutaml/uml_repository/static_site/serializers/class_serializer.rb'
108
- - 'spec/lutaml/uml_repository/package_exporter_spec.rb'
26
+ - 'spec/lutaml/uml_repository/static_site/serializers/diagram_serializer_spec.rb'
109
27
 
110
- # Offense count: 24
111
- # This cop supports safe autocorrection (--autocorrect).
112
- # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
113
- # SupportedStylesAlignWith: start_of_line, relative_to_receiver
114
- Layout/IndentationWidth:
115
- Exclude:
116
- - 'lib/lutaml/qea/factory/class_transformer.rb'
117
- - 'lib/lutaml/uml_repository/exporters/markdown/class_page_builder.rb'
118
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
119
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
120
- - 'lib/lutaml/uml_repository/static_site/serializers/package_serializer.rb'
121
- - 'lib/lutaml/uml_repository/static_site/serializers/package_tree_builder.rb'
122
- - 'spec/lutaml/uml_repository/package_exporter_spec.rb'
123
- - 'spec/lutaml/uml_repository/static_site/template_file_system_spec.rb'
124
-
125
- # Offense count: 192
28
+ # Offense count: 175
126
29
  # This cop supports safe autocorrection (--autocorrect).
127
30
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
128
31
  # URISchemes: http, https
129
32
  Layout/LineLength:
130
33
  Enabled: false
131
34
 
132
- # Offense count: 1
133
- # This cop supports safe autocorrection (--autocorrect).
134
- # Configuration parameters: EnforcedStyle.
135
- # SupportedStyles: symmetrical, new_line, same_line
136
- Layout/MultilineMethodCallBraceLayout:
137
- Exclude:
138
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
139
-
140
- # Offense count: 2
141
- # This cop supports safe autocorrection (--autocorrect).
142
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
143
- # SupportedStyles: space, no_space, compact
144
- # SupportedStylesForEmptyBraces: space, no_space
145
- Layout/SpaceInsideHashLiteralBraces:
146
- Exclude:
147
- - 'lib/lutaml/uml/model_helpers.rb'
148
-
149
- # Offense count: 11
35
+ # Offense count: 3
150
36
  # This cop supports safe autocorrection (--autocorrect).
151
37
  # Configuration parameters: AllowInHeredoc.
152
38
  Layout/TrailingWhitespace:
153
39
  Exclude:
154
- - 'lib/lutaml/qea/factory/generalization_builder.rb'
155
- - 'lib/lutaml/uml_repository/exporters/markdown_exporter.rb'
156
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
157
- - 'lib/lutaml/uml_repository/static_site/serializers/class_serializer.rb'
158
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
159
- - 'spec/lutaml/uml_repository/package_exporter_spec.rb'
40
+ - 'spec/lutaml/uml_repository/static_site/serializers/diagram_serializer_spec.rb'
160
41
 
161
42
  # Offense count: 1
162
43
  Lint/BinaryOperatorWithIdenticalOperands:
@@ -209,13 +90,6 @@ Lint/MissingSuper:
209
90
  Exclude:
210
91
  - 'lib/lutaml/uml_repository/lazy_repository.rb'
211
92
 
212
- # Offense count: 2
213
- # This cop supports safe autocorrection (--autocorrect).
214
- Lint/RedundantRequireStatement:
215
- Exclude:
216
- - 'lib/lutaml/qea/factory/generalization_builder.rb'
217
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
218
-
219
93
  # Offense count: 1
220
94
  # This cop supports safe autocorrection (--autocorrect).
221
95
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
@@ -245,7 +119,7 @@ Metrics/BlockLength:
245
119
  Metrics/CyclomaticComplexity:
246
120
  Enabled: false
247
121
 
248
- # Offense count: 66
122
+ # Offense count: 67
249
123
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
250
124
  Metrics/MethodLength:
251
125
  Max: 62
@@ -320,7 +194,7 @@ RSpec/ContextWording:
320
194
  RSpec/DescribeClass:
321
195
  Enabled: false
322
196
 
323
- # Offense count: 651
197
+ # Offense count: 654
324
198
  # Configuration parameters: CountAsOne.
325
199
  RSpec/ExampleLength:
326
200
  Max: 30
@@ -374,7 +248,7 @@ RSpec/MessageSpies:
374
248
  - 'spec/lutaml/uml_repository/presenters/diagram_presenter_spec.rb'
375
249
  - 'spec/lutaml/uml_repository/repository_spec.rb'
376
250
 
377
- # Offense count: 37
251
+ # Offense count: 38
378
252
  RSpec/MultipleExpectations:
379
253
  Max: 6
380
254
 
@@ -396,6 +270,12 @@ RSpec/NoExpectationExample:
396
270
  - 'spec/lutaml/qea/verification/comprehensive_equivalence_spec.rb'
397
271
  - 'spec/lutaml/uml_repository/static_site/generator_spec.rb'
398
272
 
273
+ # Offense count: 6
274
+ # This cop supports unsafe autocorrection (--autocorrect-all).
275
+ RSpec/ReceiveMessages:
276
+ Exclude:
277
+ - 'spec/lutaml/uml_repository/static_site/serializers/diagram_serializer_spec.rb'
278
+
399
279
  # Offense count: 12
400
280
  RSpec/RepeatedExample:
401
281
  Exclude:
@@ -420,6 +300,12 @@ RSpec/SpecFilePathFormat:
420
300
  - 'spec/lutaml/parsers/serialize_xmi_to_liquid_spec.rb'
421
301
  - 'spec/lutaml/uml_repository/web_ui/app_spec.rb'
422
302
 
303
+ # Offense count: 10
304
+ # This cop supports unsafe autocorrection (--autocorrect-all).
305
+ RSpec/VerifiedDoubleReference:
306
+ Exclude:
307
+ - 'spec/lutaml/uml_repository/static_site/serializers/diagram_serializer_spec.rb'
308
+
423
309
  # Offense count: 3
424
310
  Security/Eval:
425
311
  Exclude:
@@ -430,23 +316,6 @@ Security/MarshalLoad:
430
316
  Exclude:
431
317
  - 'lib/lutaml/uml_repository/package_loader.rb'
432
318
 
433
- # Offense count: 15
434
- # This cop supports safe autocorrection (--autocorrect).
435
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
436
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
437
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
438
- # FunctionalMethods: let, let!, subject, watch
439
- # AllowedMethods: lambda, proc, it
440
- Style/BlockDelimiters:
441
- Exclude:
442
- - 'lib/lutaml/qea/factory/class_transformer.rb'
443
- - 'lib/lutaml/uml_repository/exporters/markdown/class_page_builder.rb'
444
- - 'lib/lutaml/uml_repository/static_site/serializers/inheritance_resolver.rb'
445
- - 'lib/lutaml/uml_repository/static_site/serializers/package_serializer.rb'
446
- - 'lib/lutaml/uml_repository/static_site/serializers/package_tree_builder.rb'
447
- - 'spec/lutaml/uml_repository/package_exporter_spec.rb'
448
- - 'spec/lutaml/uml_repository/static_site/template_file_system_spec.rb'
449
-
450
319
  # Offense count: 2
451
320
  # This cop supports safe autocorrection (--autocorrect).
452
321
  Style/ComparableClamp:
@@ -464,19 +333,6 @@ Style/EvalWithLocation:
464
333
  Exclude:
465
334
  - 'spec/lutaml/cli/uml/search_command_spec.rb'
466
335
 
467
- # Offense count: 1
468
- # This cop supports safe autocorrection (--autocorrect).
469
- Style/MultilineTernaryOperator:
470
- Exclude:
471
- - 'lib/lutaml/uml_repository/static_site/data_transformer.rb'
472
-
473
- # Offense count: 1
474
- # This cop supports safe autocorrection (--autocorrect).
475
- # Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
476
- Style/MultipleComparison:
477
- Exclude:
478
- - 'lib/lutaml/cli/interactive_shell.rb'
479
-
480
336
  # Offense count: 1
481
337
  # This cop supports unsafe autocorrection (--autocorrect-all).
482
338
  Style/PartitionInsteadOfDoubleSelect:
@@ -489,19 +345,3 @@ Style/SafeNavigationChainLength:
489
345
  Exclude:
490
346
  - 'lib/lutaml/qea/validation/attribute_validator.rb'
491
347
  - 'lib/lutaml/qea/validation/operation_validator.rb'
492
-
493
- # Offense count: 1
494
- # This cop supports safe autocorrection (--autocorrect).
495
- # Configuration parameters: EnforcedStyleForMultiline.
496
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
497
- Style/TrailingCommaInArguments:
498
- Exclude:
499
- - 'lib/lutaml/qea/factory/class_transformer.rb'
500
-
501
- # Offense count: 2
502
- # This cop supports safe autocorrection (--autocorrect).
503
- # Configuration parameters: EnforcedStyleForMultiline.
504
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
505
- Style/TrailingCommaInHashLiteral:
506
- Exclude:
507
- - 'lib/lutaml/cli/interactive_shell.rb'
@@ -47,6 +47,9 @@ module Lutaml
47
47
  desc: "Minify HTML/CSS/JS output"
48
48
  thor_class.option :theme, type: :string, default: "light",
49
49
  desc: "Default theme: 'light' or 'dark'"
50
+ thor_class.option :render_diagrams, type: :boolean, default: false,
51
+ desc: "Render diagram SVGs " \
52
+ "(may increase output size)"
50
53
  end
51
54
 
52
55
  def run(input_path) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
@@ -169,6 +172,7 @@ module Lutaml
169
172
  title: options[:title] || "UML Model Browser",
170
173
  minify: options[:minify] || false,
171
174
  theme: options[:theme] || "light",
175
+ render_diagrams: options[:render_diagrams] || false,
172
176
  }
173
177
 
174
178
  Lutaml::UmlRepository::StaticSite.generate(repository,
@@ -164,7 +164,8 @@ module Lutaml
164
164
  include_diagrams: config_opts["include_diagrams"] != false,
165
165
  format_definitions: config_opts["format_definitions"] != false,
166
166
  max_definition_length: config_opts["max_definition_length"],
167
- }.merge(@options.slice(:include_diagrams, :format_definitions))
167
+ }.merge(@options.slice(:include_diagrams, :format_definitions,
168
+ :render_diagrams))
168
169
  end
169
170
 
170
171
  def search_options
@@ -358,6 +359,7 @@ module Lutaml
358
359
  "03-layout.css",
359
360
  "04-components.css",
360
361
  "05-utilities.css",
362
+ "06-diagrams.css",
361
363
  ]
362
364
 
363
365
  css_parts = css_files.map do |file|
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../../presenters/diagram_presenter"
4
+
3
5
  module Lutaml
4
6
  module UmlRepository
5
7
  module StaticSite
@@ -25,13 +27,31 @@ module Lutaml
25
27
  private
26
28
 
27
29
  def serialize(diagram, id)
28
- {
30
+ data = {
29
31
  id: id,
30
32
  xmiId: diagram.xmi_id,
31
33
  name: diagram.name,
32
34
  type: diagram.diagram_type,
33
35
  package: find_diagram_package(diagram),
36
+ objectCount: (diagram.diagram_objects || []).size,
37
+ linkCount: (diagram.diagram_links || []).size,
34
38
  }
39
+
40
+ if @options[:render_diagrams]
41
+ svg = render_svg(diagram)
42
+ data[:svg] = svg if svg
43
+ end
44
+
45
+ data
46
+ end
47
+
48
+ def render_svg(diagram)
49
+ return nil unless diagram.diagram_objects&.any?
50
+
51
+ presenter = Presenters::DiagramPresenter.new(diagram, @repository)
52
+ presenter.svg_output
53
+ rescue StandardError
54
+ nil
35
55
  end
36
56
 
37
57
  def find_diagram_package(diagram)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lutaml
4
- VERSION = "0.10.6"
4
+ VERSION = "0.10.7"
5
5
  end
@@ -10,9 +10,10 @@ document.addEventListener('alpine:init', () => {
10
10
  config: window.APP_CONFIG || {},
11
11
 
12
12
  // Current State
13
- currentView: 'welcome', // 'welcome' | 'package' | 'class' | 'search'
13
+ currentView: 'welcome', // 'welcome' | 'package' | 'class' | 'search' | 'diagram'
14
14
  currentPackage: null,
15
15
  currentClass: null,
16
+ currentDiagram: null,
16
17
  searchQuery: '',
17
18
  searchResults: [],
18
19
 
@@ -86,6 +87,7 @@ document.addEventListener('alpine:init', () => {
86
87
  this.currentView = 'welcome';
87
88
  this.currentPackage = null;
88
89
  this.currentClass = null;
90
+ this.currentDiagram = null;
89
91
  this.breadcrumbs = [];
90
92
  this.pushState();
91
93
  },
@@ -118,6 +120,21 @@ document.addEventListener('alpine:init', () => {
118
120
  this.pushState();
119
121
  },
120
122
 
123
+ selectDiagram(diagramId) {
124
+ if (!this.data || !this.data.diagrams[diagramId]) {
125
+ console.warn('Diagram not found:', diagramId);
126
+ return;
127
+ }
128
+
129
+ const diag = this.data.diagrams[diagramId];
130
+
131
+ this.currentDiagram = diagramId;
132
+ this.currentPackage = diag.package;
133
+ this.currentView = 'diagram';
134
+ this.updateBreadcrumbs();
135
+ this.pushState();
136
+ },
137
+
121
138
  performSearch(query) {
122
139
  if (!query || query.length < 2) {
123
140
  this.searchResults = [];
@@ -196,6 +213,8 @@ document.addEventListener('alpine:init', () => {
196
213
  this.breadcrumbs = this.buildPackageBreadcrumbs(this.currentPackage);
197
214
  } else if (this.currentView === 'class' && this.currentClass) {
198
215
  this.breadcrumbs = this.buildClassBreadcrumbs(this.currentClass);
216
+ } else if (this.currentView === 'diagram' && this.currentDiagram) {
217
+ this.breadcrumbs = [{ name: `Diagram: ${this.data.diagrams[this.currentDiagram]?.name || ''}`, type: 'diagram' }];
199
218
  } else if (this.currentView === 'search') {
200
219
  this.breadcrumbs = [{ name: `Search: ${this.searchQuery}`, type: 'search' }];
201
220
  }
@@ -275,6 +294,8 @@ document.addEventListener('alpine:init', () => {
275
294
  this.selectPackage(decodeURIComponent(parts[1]));
276
295
  } else if (parts[0] === 'class' && parts[1]) {
277
296
  this.selectClass(decodeURIComponent(parts[1]));
297
+ } else if (parts[0] === 'diagram' && parts[1]) {
298
+ this.selectDiagram(decodeURIComponent(parts[1]));
278
299
  } else if (parts[0] === 'search') {
279
300
  const params = new URLSearchParams(queryString);
280
301
  const query = params.get('q');
@@ -294,6 +315,8 @@ document.addEventListener('alpine:init', () => {
294
315
  hash = `#/package/${encodeURIComponent(this.currentPackage)}`;
295
316
  } else if (this.currentView === 'class' && this.currentClass) {
296
317
  hash = `#/class/${encodeURIComponent(this.currentClass)}`;
318
+ } else if (this.currentView === 'diagram' && this.currentDiagram) {
319
+ hash = `#/diagram/${encodeURIComponent(this.currentDiagram)}`;
297
320
  } else if (this.currentView === 'search' && this.searchQuery) {
298
321
  hash = `#/search?q=${encodeURIComponent(this.searchQuery)}`;
299
322
  }
@@ -370,6 +393,7 @@ function app() {
370
393
  get currentView() { return Alpine.store('app').currentView; },
371
394
  get currentPackage() { return Alpine.store('app').currentPackage; },
372
395
  get currentClass() { return Alpine.store('app').currentClass; },
396
+ get currentDiagram() { return Alpine.store('app').currentDiagram; },
373
397
  get sidebarVisible() {
374
398
  return Alpine.store('app').sidebarVisible;
375
399
  },
@@ -392,6 +416,9 @@ function app() {
392
416
  selectClass(id) {
393
417
  Alpine.store('app').selectClass(id);
394
418
  },
419
+ selectDiagram(id) {
420
+ Alpine.store('app').selectDiagram(id);
421
+ },
395
422
  toggleTheme() {
396
423
  Alpine.store('app').toggleTheme();
397
424
  },
@@ -274,4 +274,52 @@
274
274
  .diagram-wrapper svg {
275
275
  filter: brightness(0.9);
276
276
  }
277
+ }
278
+
279
+ /* Inline Diagram Viewer (content pane) */
280
+ .diagram-toolbar {
281
+ display: flex;
282
+ gap: 0.5rem;
283
+ padding: 0.75rem 0;
284
+ margin-bottom: 1rem;
285
+ }
286
+
287
+ .diagram-toolbar .btn-sm {
288
+ padding: 0.375rem 0.75rem;
289
+ font-size: 0.8rem;
290
+ background: var(--bg-secondary, #f8f9fa);
291
+ border: 1px solid var(--color-border, #dcdfe6);
292
+ border-radius: 4px;
293
+ cursor: pointer;
294
+ transition: all 0.15s ease;
295
+ }
296
+
297
+ .diagram-toolbar .btn-sm:hover {
298
+ background: var(--color-primary, #3498db);
299
+ color: white;
300
+ border-color: var(--color-primary, #3498db);
301
+ }
302
+
303
+ .diagram-svg-container {
304
+ background: white;
305
+ border: 1px solid var(--color-border, #dcdfe6);
306
+ border-radius: 8px;
307
+ padding: 1rem;
308
+ overflow: hidden;
309
+ transition: transform 0.1s ease-out;
310
+ min-height: 400px;
311
+ display: flex;
312
+ align-items: center;
313
+ justify-content: center;
314
+ }
315
+
316
+ .diagram-svg-container svg {
317
+ max-width: 100%;
318
+ display: block;
319
+ }
320
+
321
+ .diagram-item .diagram-objects {
322
+ font-size: 0.8rem;
323
+ color: var(--color-text-secondary, #7f8c8d);
324
+ margin-left: auto;
277
325
  }
@@ -73,7 +73,7 @@
73
73
  <h3>Diagrams (<span x-text="pkg.diagrams.length"></span>)</h3>
74
74
  <ul class="diagram-list">
75
75
  <template x-for="diagramId in pkg.diagrams" :key="diagramId">
76
- <li class="diagram-item">
76
+ <li class="diagram-item clickable-row" @click="$store.app.selectDiagram(diagramId)">
77
77
  <svg class="item-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
78
78
  <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
79
79
  <line x1="3" y1="9" x2="21" y2="9"></line>
@@ -81,6 +81,7 @@
81
81
  </svg>
82
82
  <span class="diagram-name" x-text="$store.app.data.diagrams[diagramId] && $store.app.data.diagrams[diagramId].name"></span>
83
83
  <span class="diagram-type" x-text="$store.app.data.diagrams[diagramId] && `(${$store.app.data.diagrams[diagramId].type})`"></span>
84
+ <span class="diagram-objects" x-show="$store.app.data.diagrams[diagramId] && $store.app.data.diagrams[diagramId].objectCount" x-text="`${$store.app.data.diagrams[diagramId].objectCount} objects`"></span>
84
85
  </li>
85
86
  </template>
86
87
  </ul>
@@ -503,6 +504,75 @@
503
504
  </template>
504
505
  </div>
505
506
  </div>
507
+
508
+ <!-- Diagram View -->
509
+ <div x-show="currentView === 'diagram'" x-transition class="view-diagram">
510
+ <template x-if="currentDiagram && data.diagrams[currentDiagram]">
511
+ <div class="diagram-details" x-data="{
512
+ get diag() { return data.diagrams[currentDiagram]; },
513
+ get pkg() { return diag.package ? data.packages[diag.package] : null; },
514
+ diagramScale: 1.0,
515
+ diagramPanX: 0,
516
+ diagramPanY: 0,
517
+ isPanning: false,
518
+ panStartX: 0,
519
+ panStartY: 0,
520
+ zoom(factor) { this.diagramScale = Math.max(0.1, Math.min(5.0, this.diagramScale * factor)); },
521
+ resetView() { this.diagramScale = 1.0; this.diagramPanX = 0; this.diagramPanY = 0; },
522
+ startPan(e) { this.isPanning = true; this.panStartX = e.clientX - this.diagramPanX; this.panStartY = e.clientY - this.diagramPanY; },
523
+ doPan(e) { if (!this.isPanning) return; this.diagramPanX = e.clientX - this.panStartX; this.diagramPanY = e.clientY - this.panStartY; },
524
+ endPan() { this.isPanning = false; },
525
+ downloadSvg() {
526
+ const svgEl = document.querySelector('.diagram-svg-container svg');
527
+ if (!svgEl) return;
528
+ const data = new XMLSerializer().serializeToString(svgEl);
529
+ const blob = new Blob([data], { type: 'image/svg+xml' });
530
+ const url = URL.createObjectURL(blob);
531
+ const a = document.createElement('a');
532
+ a.href = url; a.download = (this.diag.name || 'diagram').replace(/[^a-zA-Z0-9_-]/g, '_') + '.svg';
533
+ a.click(); URL.revokeObjectURL(url);
534
+ }
535
+ }">
536
+ <div class="entity-header">
537
+ <div class="entity-title">
538
+ <h1 class="entity-name" x-text="diag.name"></h1>
539
+ <p class="entity-subtitle">
540
+ <span x-text="diag.type"></span>
541
+ <span x-show="diag.objectCount"> - <span x-text="diag.objectCount"></span> elements, <span x-text="diag.linkCount"></span> connectors</span>
542
+ </p>
543
+ </div>
544
+ <div style="display: flex; gap: 0.5rem; align-items: center;">
545
+ <button class="link-button" x-show="diag.package" @click="selectPackage(diag.package)">
546
+ &larr; Back to package
547
+ </button>
548
+ <span class="entity-type-badge">Diagram</span>
549
+ </div>
550
+ </div>
551
+
552
+ <div class="diagram-toolbar" x-show="diag.svg">
553
+ <button class="btn btn-sm" @click="zoom(1.2)">Zoom In</button>
554
+ <button class="btn btn-sm" @click="zoom(0.8)">Zoom Out</button>
555
+ <button class="btn btn-sm" @click="resetView()">Reset</button>
556
+ <button class="btn btn-sm" @click="downloadSvg()">Download SVG</button>
557
+ </div>
558
+
559
+ <div class="diagram-svg-container"
560
+ x-show="diag.svg"
561
+ x-ref="diagramContainer"
562
+ @wheel.prevent="zoom($event.deltaY > 0 ? 0.9 : 1.1)"
563
+ @mousedown="startPan($event)"
564
+ @mousemove="doPan($event)"
565
+ @mouseup="endPan()"
566
+ @mouseleave="endPan()"
567
+ :style="`transform: translate(${diagramPanX}px, ${diagramPanY}px) scale(${diagramScale}); transform-origin: center; cursor: ${isPanning ? 'grabbing' : 'grab'};`">
568
+ <div x-html="diag.svg"></div>
569
+ </div>
570
+
571
+ <div x-show="!diag.svg" class="empty-state">
572
+ <p class="empty-state-message">SVG rendering not available for this diagram. Re-generate with <code>--render-diagrams</code> to include SVG.</p>
573
+ </div>
574
+ </div>
575
+ </template>
506
576
  </div>
507
- </div>
508
- </main>
577
+
578
+ </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.6
4
+ version: 0.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.