drawio_dsl 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,8 +47,8 @@ module DrawioDsl
47
47
  current_page.id = SecureRandom.alphanumeric(3) unless current_page.id
48
48
 
49
49
  # add anchor nodes
50
- page_anchor = DrawioDsl::Schema::Anchor.new(self, id: "page_root_#{current_page.id}", type: :page_root)
51
- node_anchor = DrawioDsl::Schema::Anchor.new(self, id: "node_root_#{current_page.id}", type: :node_root)
50
+ page_anchor = DrawioDsl::Schema::Anchor.new(self, id: "page_root_#{current_page.id}", key: :page_root)
51
+ node_anchor = DrawioDsl::Schema::Anchor.new(self, id: "node_root_#{current_page.id}", key: :node_root)
52
52
  page_anchor.add_node(node_anchor)
53
53
 
54
54
  @focus_node = node_anchor
@@ -15,7 +15,7 @@ module DrawioDsl
15
15
  def initialize(**args)
16
16
  @host = args[:host] || SecureRandom.alphanumeric(3)
17
17
  # TODO: assess and resolve this inconsistency
18
- @theme = args[:theme] || KConfig.configuration.drawio.theme.random_background_type
18
+ @theme = args[:theme] || KConfig.configuration.drawio.theme.random_background_key
19
19
  @bg_theme = args[:bg_theme] || :not_set
20
20
 
21
21
  @style = DrawioDsl::Schema::CommonStyle.new(**args) do
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ module Schema
5
+ class EmbedCol200 < Element
6
+ configure_as(:embed_col200)
7
+ end
8
+ end
9
+ end
@@ -15,7 +15,7 @@ module DrawioDsl
15
15
  @gap = args[:gap] || 20
16
16
  @perpendicular_max = 0
17
17
 
18
- super(page, **args.merge(type: :flex_layout))
18
+ super(page, **args.merge(key: :flex_layout))
19
19
  end
20
20
 
21
21
  def position_shape(shape)
@@ -24,7 +24,7 @@ module DrawioDsl
24
24
  @v_align = args[:v_align] || :center
25
25
  @cell_no = 1
26
26
 
27
- super(page, **args.merge(type: :grid_layout))
27
+ super(page, **args.merge(key: :grid_layout))
28
28
  end
29
29
  # rubocop:enable Metrics/CyclomaticComplexity
30
30
 
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ module Schema
5
+ class Solid < Line
6
+ configure_as(:solid)
7
+ end
8
+ end
9
+ end
@@ -9,7 +9,7 @@ module DrawioDsl
9
9
  attr_accessor :page
10
10
  attr_accessor :parent
11
11
  attr_accessor :classification
12
- attr_accessor :type
12
+ attr_accessor :key
13
13
  attr_accessor :nodes
14
14
 
15
15
  def initialize(page, **args)
@@ -17,7 +17,7 @@ module DrawioDsl
17
17
  @id = args[:id]
18
18
  @parent = args[:parent]
19
19
  @classification = args[:classification] || :unknown
20
- @type = args[:type] || :unknown
20
+ @key = args[:key] || :unknown
21
21
  @nodes = NodeList.new
22
22
  end
23
23
 
@@ -26,7 +26,7 @@ module DrawioDsl
26
26
  id: id,
27
27
  parent_id: parent&.id,
28
28
  classification: classification,
29
- type: type
29
+ key: key
30
30
  }
31
31
  result[:nodes] = nodes.to_h if nodes.any?
32
32
  result
@@ -58,11 +58,11 @@ module DrawioDsl
58
58
  end
59
59
 
60
60
  # rubocop:disable Metrics/ParameterLists
61
- def debug_row(classification, id, type = nil, x = nil, y = nil, width = nil, height = nil)
61
+ def debug_row(classification, id, key = nil, x = nil, y = nil, width = nil, height = nil)
62
62
  row = []
63
63
  row << classification.to_s.ljust(11)
64
64
  row << id.to_s.ljust(6)
65
- row << (type.nil? ? '' : type).to_s.ljust(15)
65
+ row << (key.nil? ? '' : key).to_s.ljust(15)
66
66
  row << (x.nil? ? '' : x).to_s.rjust(5)
67
67
  row << (y.nil? ? '' : y).to_s.rjust(5)
68
68
  row << (width.nil? ? '' : width).to_s.rjust(5)
@@ -75,7 +75,7 @@ module DrawioDsl
75
75
  @sketch = args[:sketch] || page.style.sketch
76
76
  @glass = args[:glass] || page.style.glass
77
77
 
78
- @type = args[:type] || shape_defaults.type
78
+ @key = args[:key] || shape_defaults.key
79
79
  @x = args[:x] || shape_defaults.x
80
80
  @y = args[:y] || shape_defaults.y
81
81
  @w = args[:w] || shape_defaults.w
@@ -83,9 +83,9 @@ module DrawioDsl
83
83
  @style_modifiers = args[:style_modifiers] || shape_defaults.style_modifiers
84
84
  end
85
85
 
86
- def format(type = nil)
87
- type ||= self.class.shape_key
88
- format_instance(type)
86
+ def format(key = nil)
87
+ key ||= self.class.shape_key
88
+ format_instance(key)
89
89
  end
90
90
 
91
91
  def style
@@ -108,7 +108,7 @@ module DrawioDsl
108
108
 
109
109
  def as_xml(xml)
110
110
  # log.error category
111
- # log.error type
111
+ # log.error key
112
112
  draw_element(xml) if is_a?(Element) || is_a?(Text)
113
113
  draw_line(xml) if is_a?(Line)
114
114
  end
@@ -130,7 +130,7 @@ module DrawioDsl
130
130
  id: id,
131
131
  parent_id: parent&.id,
132
132
  classification: classification,
133
- type: type,
133
+ key: key,
134
134
  x: x,
135
135
  y: y,
136
136
  w: w,
@@ -153,9 +153,9 @@ module DrawioDsl
153
153
  # :nocov:
154
154
  def debug(format: :detail)
155
155
  if format == :detail
156
- debug_detail({ id: id, classification: classification, type: type })
156
+ debug_detail({ id: id, classification: classification, key: key })
157
157
  else
158
- debug_row(classification, id, type, x, y, w, h)
158
+ debug_row(classification, id, key, x, y, w, h)
159
159
  end
160
160
  end
161
161
  # :nocov:
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DrawioDsl
4
+ module Schema
5
+ class P < Text
6
+ configure_as(:p)
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DrawioDsl
4
- VERSION = '0.11.0'
4
+ VERSION = '0.11.1'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "drawio_dsl",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "drawio_dsl",
9
- "version": "0.11.0",
9
+ "version": "0.11.1",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.1",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drawio_dsl",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "DrawIO DSL can build DrawIO diagrams using a Domain Specific Language",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drawio_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -303,6 +303,7 @@ files:
303
303
  - lib/drawio_dsl/schema/default_palette.rb
304
304
  - lib/drawio_dsl/schema/diagram.rb
305
305
  - lib/drawio_dsl/schema/element.rb
306
+ - lib/drawio_dsl/schema/elements/.rb
306
307
  - lib/drawio_dsl/schema/elements/actor.rb
307
308
  - lib/drawio_dsl/schema/elements/actor2.rb
308
309
  - lib/drawio_dsl/schema/elements/callout.rb
@@ -343,12 +344,14 @@ files:
343
344
  - lib/drawio_dsl/schema/layouts/grid_layout.rb
344
345
  - lib/drawio_dsl/schema/layouts/layout.rb
345
346
  - lib/drawio_dsl/schema/line.rb
347
+ - lib/drawio_dsl/schema/lines/.rb
346
348
  - lib/drawio_dsl/schema/lines/solid.rb
347
349
  - lib/drawio_dsl/schema/node.rb
348
350
  - lib/drawio_dsl/schema/node_list.rb
349
351
  - lib/drawio_dsl/schema/page.rb
350
352
  - lib/drawio_dsl/schema/shape.rb
351
353
  - lib/drawio_dsl/schema/text.rb
354
+ - lib/drawio_dsl/schema/texts/.rb
352
355
  - lib/drawio_dsl/schema/texts/h1.rb
353
356
  - lib/drawio_dsl/schema/texts/h2.rb
354
357
  - lib/drawio_dsl/schema/texts/h3.rb