drawio_dsl 0.11.0 → 0.11.3

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/config/configuration.json +564 -370
  4. data/docs/domain_model.drawio +89 -89
  5. data/docs/domain_model.json +267 -267
  6. data/docs/printspeak-architecture-controllers-custom.drawio +9 -9
  7. data/docs/printspeak-architecture-controllers.drawio +47 -47
  8. data/docs/printspeak-architecture-generator-custom.drawio +16 -10
  9. data/docs/printspeak-architecture-generator.drawio +268 -0
  10. data/docs/project-plan/project.drawio +89 -89
  11. data/docs/project-plan/project_done.svg +1 -1
  12. data/docs/project-plan/project_in_progress.svg +1 -1
  13. data/docs/project-plan/project_todo.svg +1 -1
  14. data/docs/samples/styles-glass.svg +1 -1
  15. data/docs/samples/styles-plain.svg +1 -1
  16. data/docs/samples/styles-rounded.svg +1 -1
  17. data/docs/samples/styles-shadow.svg +1 -1
  18. data/docs/samples/styles-sketch.svg +1 -1
  19. data/docs/samples/themes-random.svg +1 -1
  20. data/docs/tailwind_domain_model-custom.drawio +104 -0
  21. data/docs/tailwind_domain_model.json +288 -0
  22. data/docs/tailwind_domain_model.svg +3 -0
  23. data/lib/drawio_dsl/configuration.rb +96 -84
  24. data/lib/drawio_dsl/dom_builder.rb +2 -2
  25. data/lib/drawio_dsl/dom_builder_shapes.rb +60 -0
  26. data/lib/drawio_dsl/drawio_shapes.rb +103 -43
  27. data/lib/drawio_dsl/schema/_.rb +10 -0
  28. data/lib/drawio_dsl/schema/diagram.rb +1 -1
  29. data/lib/drawio_dsl/schema/element.rb +4 -0
  30. data/lib/drawio_dsl/schema/layouts/flex_layout.rb +1 -1
  31. data/lib/drawio_dsl/schema/layouts/grid_layout.rb +1 -1
  32. data/lib/drawio_dsl/schema/line.rb +24 -3
  33. data/lib/drawio_dsl/schema/lines/dash_dot.rb +9 -0
  34. data/lib/drawio_dsl/schema/lines/dash_dot_dot.rb +9 -0
  35. data/lib/drawio_dsl/schema/lines/dash_long_dash.rb +9 -0
  36. data/lib/drawio_dsl/schema/lines/dashed.rb +9 -0
  37. data/lib/drawio_dsl/schema/lines/dashed24.rb +9 -0
  38. data/lib/drawio_dsl/schema/lines/dashed32.rb +9 -0
  39. data/lib/drawio_dsl/schema/lines/dashed44.rb +9 -0
  40. data/lib/drawio_dsl/schema/lines/dot_dot_dot.rb +9 -0
  41. data/lib/drawio_dsl/schema/lines/dotted.rb +9 -0
  42. data/lib/drawio_dsl/schema/lines/long_dash.rb +9 -0
  43. data/lib/drawio_dsl/schema/node.rb +5 -5
  44. data/lib/drawio_dsl/schema/shape.rb +14 -9
  45. data/lib/drawio_dsl/schema/text.rb +4 -0
  46. data/lib/drawio_dsl/version.rb +1 -1
  47. data/package-lock.json +2 -2
  48. data/package.json +1 -1
  49. metadata +16 -2
@@ -18,8 +18,8 @@ module DrawioDsl
18
18
  @base_style = BaseStyle.new(white_space: :wrap, html: 1, rounded: nil, shadow: nil, sketch: nil, glass: nil)
19
19
  end
20
20
 
21
- def stroke(type)
22
- strokes[type] || ''
21
+ def stroke(key)
22
+ strokes[key] || ''
23
23
  end
24
24
 
25
25
  def strokes
@@ -27,21 +27,21 @@ module DrawioDsl
27
27
 
28
28
  @strokes = {}
29
29
  source_config['strokes'].each do |stroke|
30
- @strokes[stroke['type'].to_sym] = stroke['style']
30
+ @strokes[stroke['key'].to_sym] = stroke['style']
31
31
  end
32
32
 
33
33
  @strokes
34
34
  end
35
35
 
36
36
  # need test
37
- def get_item_by_category(type, category)
37
+ def get_item_by_category(key, category)
38
38
  case category
39
39
  when :text
40
- text(type)
40
+ text(key)
41
41
  when :line
42
- line(type)
42
+ line(key)
43
43
  else
44
- element(type)
44
+ element(key)
45
45
  end
46
46
  end
47
47
 
@@ -69,9 +69,9 @@ module DrawioDsl
69
69
  class Shape
70
70
  attr_reader :source_config
71
71
 
72
- ElementShapeConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
73
- LineShapeConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
74
- TextShapeConfig = Struct.new(:type, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
72
+ ElementShapeConfig = Struct.new(:key, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
73
+ LineShapeConfig = Struct.new(:key, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
74
+ TextShapeConfig = Struct.new(:key, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
75
75
 
76
76
  def initialize(source_config)
77
77
  @source_config = source_config
@@ -79,15 +79,8 @@ module DrawioDsl
79
79
 
80
80
  # Elements
81
81
 
82
- def element(type)
83
- elements[type] || ElementShapeConfig.new(
84
- type: :square,
85
- x: 0,
86
- y: 0,
87
- w: 160,
88
- h: 160,
89
- style_modifiers: ''
90
- )
82
+ def element(key)
83
+ elements[key] || default_element
91
84
  end
92
85
 
93
86
  def elements
@@ -95,8 +88,8 @@ module DrawioDsl
95
88
 
96
89
  @elements = {}
97
90
  source_config['elements'].each do |element|
98
- @elements[element['type'].to_sym] = ElementShapeConfig.new(
99
- type: element['type'].to_sym,
91
+ @elements[element['key'].to_sym] = ElementShapeConfig.new(
92
+ key: element['key'].to_sym,
100
93
  x: element['x'].to_i,
101
94
  y: element['y'].to_i,
102
95
  w: element['w'].to_i,
@@ -108,25 +101,29 @@ module DrawioDsl
108
101
  @elements
109
102
  end
110
103
 
111
- def element_types
104
+ def default_element
105
+ @default_element ||= ElementShapeConfig.new(
106
+ key: :square,
107
+ x: 0,
108
+ y: 0,
109
+ w: 160,
110
+ h: 160,
111
+ style_modifiers: ''
112
+ )
113
+ end
114
+
115
+ def element_keys
112
116
  elements.keys
113
117
  end
114
118
 
115
- def random_element_type
116
- elements.values.sample.type
119
+ def random_element_key
120
+ elements.values.sample.key
117
121
  end
118
122
 
119
123
  # Lines
120
124
 
121
- def line(type)
122
- lines[type] || LineShapeConfig.new(
123
- type: :solid,
124
- x: 0,
125
- y: 0,
126
- w: 50,
127
- h: 50,
128
- style_modifiers: 'edgeStyle=none;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0'
129
- )
125
+ def line(key)
126
+ lines[key] || default_line
130
127
  end
131
128
 
132
129
  def lines
@@ -134,8 +131,8 @@ module DrawioDsl
134
131
 
135
132
  @lines = {}
136
133
  source_config['lines'].each do |line|
137
- @lines[line['type'].to_sym] = LineShapeConfig.new(
138
- type: line['type'].to_sym,
134
+ @lines[line['key'].to_sym] = LineShapeConfig.new(
135
+ key: line['key'].to_sym,
139
136
  x: line['x'].to_i,
140
137
  y: line['y'].to_i,
141
138
  w: line['w'].to_i,
@@ -147,23 +144,27 @@ module DrawioDsl
147
144
  @lines
148
145
  end
149
146
 
150
- def line_types
147
+ def default_line
148
+ @default_line ||= LineShapeConfig.new(
149
+ key: :solid,
150
+ x: 0,
151
+ y: 0,
152
+ w: 50,
153
+ h: 50,
154
+ style_modifiers: 'edgeStyle=none;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0'
155
+ )
156
+ end
157
+
158
+ def line_keys
151
159
  lines.keys
152
160
  end
153
161
 
154
- def random_line_type
155
- lines.values.sample.type
162
+ def random_line_key
163
+ lines.values.sample.key
156
164
  end
157
165
 
158
- def text(type)
159
- texts[type] || TextShapeConfig.new(
160
- type: :p,
161
- x: 0,
162
- y: 0,
163
- w: 100,
164
- h: 50,
165
- style_modifiers: 'text;fontSize=16;fontStyle=1;fillColor=none'
166
- )
166
+ def text(key)
167
+ texts[key] || default_text
167
168
  end
168
169
 
169
170
  # Texts
@@ -173,8 +174,8 @@ module DrawioDsl
173
174
 
174
175
  @texts = {}
175
176
  source_config['texts'].each do |text|
176
- @texts[text['type'].to_sym] = TextShapeConfig.new(
177
- type: text['type'].to_sym,
177
+ @texts[text['key'].to_sym] = TextShapeConfig.new(
178
+ key: text['key'].to_sym,
178
179
  x: text['x'].to_i,
179
180
  y: text['y'].to_i,
180
181
  w: text['w'].to_i,
@@ -186,12 +187,23 @@ module DrawioDsl
186
187
  @texts
187
188
  end
188
189
 
189
- def text_types
190
+ def default_text
191
+ @default_line ||= TextShapeConfig.new(
192
+ key: :p,
193
+ x: 0,
194
+ y: 0,
195
+ w: 100,
196
+ h: 50,
197
+ style_modifiers: 'text;fontSize=16;fontStyle=1;fillColor=none'
198
+ )
199
+ end
200
+
201
+ def text_keys
190
202
  texts.keys
191
203
  end
192
204
 
193
- def random_text_type
194
- texts.values.sample.type
205
+ def random_text_key
206
+ texts.values.sample.key
195
207
  end
196
208
  end
197
209
 
@@ -205,8 +217,8 @@ module DrawioDsl
205
217
  @source_config = source_config
206
218
  end
207
219
 
208
- def compass_point(type)
209
- compass_points[type] || XyConfig.new(x: 0, y: 0)
220
+ def compass_point(key)
221
+ compass_points[key] || XyConfig.new(x: 0, y: 0)
210
222
  end
211
223
 
212
224
  def compass_points
@@ -214,14 +226,14 @@ module DrawioDsl
214
226
 
215
227
  @compass_points = {}
216
228
  source_config['compass_points'].each do |compass_point|
217
- @compass_points[compass_point['type'].to_sym] = XyConfig.new(x: compass_point['x'], y: compass_point['y'])
229
+ @compass_points[compass_point['key'].to_sym] = XyConfig.new(x: compass_point['x'], y: compass_point['y'])
218
230
  end
219
231
 
220
232
  @compass_points
221
233
  end
222
234
 
223
- def waypoint(type)
224
- waypoints[type] || ''
235
+ def waypoint(key)
236
+ waypoints[key] || ''
225
237
  end
226
238
 
227
239
  def waypoints
@@ -229,14 +241,14 @@ module DrawioDsl
229
241
 
230
242
  @waypoints = {}
231
243
  source_config['waypoints'].each do |waypoint|
232
- @waypoints[waypoint['type'].to_sym] = waypoint['style']
244
+ @waypoints[waypoint['key'].to_sym] = waypoint['style']
233
245
  end
234
246
 
235
247
  @waypoints
236
248
  end
237
249
 
238
- def arrow(type)
239
- arrows[type] || 'open'
250
+ def arrow(key)
251
+ arrows[key] || 'open'
240
252
  end
241
253
 
242
254
  def arrows
@@ -244,14 +256,14 @@ module DrawioDsl
244
256
 
245
257
  @arrows = {}
246
258
  source_config['arrows'].each do |arrow|
247
- @arrows[arrow['type'].to_sym] = arrow['style']
259
+ @arrows[arrow['key'].to_sym] = arrow['style']
248
260
  end
249
261
 
250
262
  @arrows
251
263
  end
252
264
 
253
- def design(type)
254
- designs[type] || ''
265
+ def design(key)
266
+ designs[key] || ''
255
267
  end
256
268
 
257
269
  def designs
@@ -259,7 +271,7 @@ module DrawioDsl
259
271
 
260
272
  @designs = {}
261
273
  source_config['designs'].each do |design|
262
- @designs[design['type'].to_sym] = design['style']
274
+ @designs[design['key'].to_sym] = design['style']
263
275
  end
264
276
 
265
277
  @designs
@@ -269,16 +281,16 @@ module DrawioDsl
269
281
  class Theme
270
282
  attr_reader :source_config
271
283
 
272
- BackgroundThemeConfig = Struct.new(:type, :bg_color, :font_color, :favourite, keyword_init: true)
273
- ElementThemeConfig = Struct.new(:type, :fill_color, :stroke_color, :font_color, :gradient, keyword_init: true)
284
+ BackgroundThemeConfig = Struct.new(:key, :bg_color, :font_color, :favourite, keyword_init: true)
285
+ ElementThemeConfig = Struct.new(:key, :fill_color, :stroke_color, :font_color, :gradient, keyword_init: true)
274
286
 
275
287
  def initialize(source_config)
276
288
  @source_config = source_config
277
289
  end
278
290
 
279
- def background(type)
280
- backgrounds[type] || BackgroundThemeConfig.new(
281
- type: type,
291
+ def background(key)
292
+ backgrounds[key] || BackgroundThemeConfig.new(
293
+ key: key,
282
294
  bg_color: '#000000',
283
295
  font_color: '#FFFFFF',
284
296
  favourite: false
@@ -290,8 +302,8 @@ module DrawioDsl
290
302
 
291
303
  @backgrounds = {}
292
304
  source_config['backgrounds'].each do |background|
293
- @backgrounds[background['type'].to_sym] = BackgroundThemeConfig.new(
294
- type: background['type'].to_sym,
305
+ @backgrounds[background['key'].to_sym] = BackgroundThemeConfig.new(
306
+ key: background['key'].to_sym,
295
307
  bg_color: background['bg_color'],
296
308
  font_color: background['font_color'],
297
309
  favourite: background['favourite'] == 1
@@ -301,21 +313,21 @@ module DrawioDsl
301
313
  @backgrounds
302
314
  end
303
315
 
304
- def background_types
316
+ def background_keys
305
317
  backgrounds.keys
306
318
  end
307
319
 
308
- def favourite_background_types
309
- backgrounds.values.select(&:favourite).map(&:type)
320
+ def favourite_background_keys
321
+ backgrounds.values.select(&:favourite).map(&:key)
310
322
  end
311
323
 
312
- def random_background_type
313
- backgrounds.values.sample.type
324
+ def random_background_key
325
+ backgrounds.values.sample.key
314
326
  end
315
327
 
316
- def element(type)
317
- elements[type] || ElementThemeConfig.new(
318
- type: type,
328
+ def element(key)
329
+ elements[key] || ElementThemeConfig.new(
330
+ key: key,
319
331
  fill_color: '#ffffff',
320
332
  stroke_color: '#000000',
321
333
  font_color: '#000000',
@@ -328,8 +340,8 @@ module DrawioDsl
328
340
 
329
341
  @elements = {}
330
342
  source_config['elements'].each do |element|
331
- @elements[element['type'].to_sym] = ElementThemeConfig.new(
332
- type: element['type'].to_sym,
343
+ @elements[element['key'].to_sym] = ElementThemeConfig.new(
344
+ key: element['key'].to_sym,
333
345
  fill_color: element['fill_color'],
334
346
  stroke_color: element['stroke_color'],
335
347
  font_color: element['font_color'],
@@ -340,12 +352,12 @@ module DrawioDsl
340
352
  @elements
341
353
  end
342
354
 
343
- def element_types
355
+ def element_keys
344
356
  elements.keys
345
357
  end
346
358
 
347
- def random_element_type
348
- elements.values.sample.type
359
+ def random_element_key
360
+ elements.values.sample.key
349
361
  end
350
362
  end
351
363
  end
@@ -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
@@ -10,6 +10,66 @@ module DrawioDsl
10
10
  add_shape(solid)
11
11
  end
12
12
 
13
+ def add_dashed(id = nil, **opts, &block)
14
+ opts = { id: id }.merge(opts) if id
15
+ dashed = DrawioDsl::Schema::Dashed.new(current_page, **opts, &block)
16
+ add_shape(dashed)
17
+ end
18
+
19
+ def add_dotted(id = nil, **opts, &block)
20
+ opts = { id: id }.merge(opts) if id
21
+ dotted = DrawioDsl::Schema::Dotted.new(current_page, **opts, &block)
22
+ add_shape(dotted)
23
+ end
24
+
25
+ def add_dash_dot(id = nil, **opts, &block)
26
+ opts = { id: id }.merge(opts) if id
27
+ dash_dot = DrawioDsl::Schema::DashDot.new(current_page, **opts, &block)
28
+ add_shape(dash_dot)
29
+ end
30
+
31
+ def add_dash_dot_dot(id = nil, **opts, &block)
32
+ opts = { id: id }.merge(opts) if id
33
+ dash_dot_dot = DrawioDsl::Schema::DashDotDot.new(current_page, **opts, &block)
34
+ add_shape(dash_dot_dot)
35
+ end
36
+
37
+ def add_dot_dot_dot(id = nil, **opts, &block)
38
+ opts = { id: id }.merge(opts) if id
39
+ dot_dot_dot = DrawioDsl::Schema::DotDotDot.new(current_page, **opts, &block)
40
+ add_shape(dot_dot_dot)
41
+ end
42
+
43
+ def add_long_dash(id = nil, **opts, &block)
44
+ opts = { id: id }.merge(opts) if id
45
+ long_dash = DrawioDsl::Schema::LongDash.new(current_page, **opts, &block)
46
+ add_shape(long_dash)
47
+ end
48
+
49
+ def add_dash_long_dash(id = nil, **opts, &block)
50
+ opts = { id: id }.merge(opts) if id
51
+ dash_long_dash = DrawioDsl::Schema::DashLongDash.new(current_page, **opts, &block)
52
+ add_shape(dash_long_dash)
53
+ end
54
+
55
+ def add_dashed24(id = nil, **opts, &block)
56
+ opts = { id: id }.merge(opts) if id
57
+ dashed24 = DrawioDsl::Schema::Dashed24.new(current_page, **opts, &block)
58
+ add_shape(dashed24)
59
+ end
60
+
61
+ def add_dashed32(id = nil, **opts, &block)
62
+ opts = { id: id }.merge(opts) if id
63
+ dashed32 = DrawioDsl::Schema::Dashed32.new(current_page, **opts, &block)
64
+ add_shape(dashed32)
65
+ end
66
+
67
+ def add_dashed44(id = nil, **opts, &block)
68
+ opts = { id: id }.merge(opts) if id
69
+ dashed44 = DrawioDsl::Schema::Dashed44.new(current_page, **opts, &block)
70
+ add_shape(dashed44)
71
+ end
72
+
13
73
  def add_h1(id = nil, **opts, &block)
14
74
  opts = { id: id }.merge(opts) if id
15
75
  h1 = DrawioDsl::Schema::H1.new(current_page, **opts, &block)
@@ -5,94 +5,114 @@ module DrawioDsl
5
5
  # :nocov:
6
6
  module DrawioShapes
7
7
  def random(**opts)
8
- case rand(44)
8
+ case rand(54)
9
9
  when 0
10
10
  solid(**opts)
11
11
  when 1
12
- h1(**opts)
12
+ dashed(**opts)
13
13
  when 2
14
- h2(**opts)
14
+ dotted(**opts)
15
15
  when 3
16
- h3(**opts)
16
+ dash_dot(**opts)
17
17
  when 4
18
- h4(**opts)
18
+ dash_dot_dot(**opts)
19
19
  when 5
20
- h5(**opts)
20
+ dot_dot_dot(**opts)
21
21
  when 6
22
- h6(**opts)
22
+ long_dash(**opts)
23
23
  when 7
24
- p(**opts)
24
+ dash_long_dash(**opts)
25
25
  when 8
26
- actor(**opts)
26
+ dashed24(**opts)
27
27
  when 9
28
- actor2(**opts)
28
+ dashed32(**opts)
29
29
  when 10
30
- callout(**opts)
30
+ dashed44(**opts)
31
31
  when 11
32
- callout2(**opts)
32
+ h1(**opts)
33
33
  when 12
34
- callout3(**opts)
34
+ h2(**opts)
35
35
  when 13
36
- callout4(**opts)
36
+ h3(**opts)
37
37
  when 14
38
- circle(**opts)
38
+ h4(**opts)
39
39
  when 15
40
- cloud(**opts)
40
+ h5(**opts)
41
41
  when 16
42
- container(**opts)
42
+ h6(**opts)
43
43
  when 17
44
- container2(**opts)
44
+ p(**opts)
45
45
  when 18
46
- container3(**opts)
46
+ actor(**opts)
47
47
  when 19
48
- container4(**opts)
48
+ actor2(**opts)
49
49
  when 20
50
- cross(**opts)
50
+ callout(**opts)
51
51
  when 21
52
- envelop(**opts)
52
+ callout2(**opts)
53
53
  when 22
54
- database(**opts)
54
+ callout3(**opts)
55
55
  when 23
56
- db_json(**opts)
56
+ callout4(**opts)
57
57
  when 24
58
- diamond(**opts)
58
+ circle(**opts)
59
59
  when 25
60
- document(**opts)
60
+ cloud(**opts)
61
61
  when 26
62
- ellipse(**opts)
62
+ container(**opts)
63
63
  when 27
64
- group(**opts)
64
+ container2(**opts)
65
65
  when 28
66
- hexagon(**opts)
66
+ container3(**opts)
67
67
  when 29
68
- interface(**opts)
68
+ container4(**opts)
69
69
  when 30
70
- klass(**opts)
70
+ cross(**opts)
71
71
  when 31
72
- note(**opts)
72
+ envelop(**opts)
73
73
  when 32
74
- process(**opts)
74
+ database(**opts)
75
75
  when 33
76
- rectangle(**opts)
76
+ db_json(**opts)
77
77
  when 34
78
- rectangle2(**opts)
78
+ diamond(**opts)
79
79
  when 35
80
- square(**opts)
80
+ document(**opts)
81
81
  when 36
82
- step(**opts)
82
+ ellipse(**opts)
83
83
  when 37
84
- tick(**opts)
84
+ group(**opts)
85
85
  when 38
86
- todo(**opts)
86
+ hexagon(**opts)
87
87
  when 39
88
- face(**opts)
88
+ interface(**opts)
89
89
  when 40
90
- triangle(**opts)
90
+ klass(**opts)
91
91
  when 41
92
- embed_row(**opts)
92
+ note(**opts)
93
93
  when 42
94
- embed_col50(**opts)
94
+ process(**opts)
95
95
  when 43
96
+ rectangle(**opts)
97
+ when 44
98
+ rectangle2(**opts)
99
+ when 45
100
+ square(**opts)
101
+ when 46
102
+ step(**opts)
103
+ when 47
104
+ tick(**opts)
105
+ when 48
106
+ todo(**opts)
107
+ when 49
108
+ face(**opts)
109
+ when 50
110
+ triangle(**opts)
111
+ when 51
112
+ embed_row(**opts)
113
+ when 52
114
+ embed_col50(**opts)
115
+ when 53
96
116
  embed_col200(**opts)
97
117
  end
98
118
  end
@@ -101,6 +121,46 @@ module DrawioDsl
101
121
  builder.add_solid(id, **opts, &block)
102
122
  end
103
123
 
124
+ def dashed(id = nil, **opts, &block)
125
+ builder.add_dashed(id, **opts, &block)
126
+ end
127
+
128
+ def dotted(id = nil, **opts, &block)
129
+ builder.add_dotted(id, **opts, &block)
130
+ end
131
+
132
+ def dash_dot(id = nil, **opts, &block)
133
+ builder.add_dash_dot(id, **opts, &block)
134
+ end
135
+
136
+ def dash_dot_dot(id = nil, **opts, &block)
137
+ builder.add_dash_dot_dot(id, **opts, &block)
138
+ end
139
+
140
+ def dot_dot_dot(id = nil, **opts, &block)
141
+ builder.add_dot_dot_dot(id, **opts, &block)
142
+ end
143
+
144
+ def long_dash(id = nil, **opts, &block)
145
+ builder.add_long_dash(id, **opts, &block)
146
+ end
147
+
148
+ def dash_long_dash(id = nil, **opts, &block)
149
+ builder.add_dash_long_dash(id, **opts, &block)
150
+ end
151
+
152
+ def dashed24(id = nil, **opts, &block)
153
+ builder.add_dashed24(id, **opts, &block)
154
+ end
155
+
156
+ def dashed32(id = nil, **opts, &block)
157
+ builder.add_dashed32(id, **opts, &block)
158
+ end
159
+
160
+ def dashed44(id = nil, **opts, &block)
161
+ builder.add_dashed44(id, **opts, &block)
162
+ end
163
+
104
164
  def h1(id = nil, **opts, &block)
105
165
  builder.add_h1(id, **opts, &block)
106
166
  end
@@ -56,6 +56,16 @@ require_relative 'elements/embed_col200'
56
56
 
57
57
  # Connector lines
58
58
  require_relative 'lines/solid'
59
+ require_relative 'lines/dashed'
60
+ require_relative 'lines/dotted'
61
+ require_relative 'lines/dash_dot'
62
+ require_relative 'lines/dash_dot_dot'
63
+ require_relative 'lines/dot_dot_dot'
64
+ require_relative 'lines/long_dash'
65
+ require_relative 'lines/dash_long_dash'
66
+ require_relative 'lines/dashed24'
67
+ require_relative 'lines/dashed32'
68
+ require_relative 'lines/dashed44'
59
69
 
60
70
  # Text elements such as h1, h2, p, etc.
61
71
  require_relative 'texts/h1'
@@ -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
@@ -18,6 +18,10 @@ module DrawioDsl
18
18
  @gradient = args[:gradient] || theme_palette.gradient
19
19
  @font_color = args[:font_color] || theme_palette.font_color
20
20
  end
21
+
22
+ def default_configuration
23
+ KConfig.configuration.drawio.shape.default_element
24
+ end
21
25
  end
22
26
  end
23
27
  end