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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/config/configuration.json +328 -328
- data/docs/project-plan/project.drawio +85 -85
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/docs/samples/styles-glass.svg +1 -1
- data/docs/samples/styles-plain.svg +1 -1
- data/docs/samples/styles-rounded.svg +1 -1
- data/docs/samples/styles-shadow.svg +1 -1
- data/docs/samples/styles-sketch.svg +1 -1
- data/docs/samples/themes-random.svg +1 -1
- data/lib/drawio_dsl/configuration.rb +66 -66
- data/lib/drawio_dsl/dom_builder.rb +2 -2
- data/lib/drawio_dsl/schema/diagram.rb +1 -1
- data/lib/drawio_dsl/schema/elements/.rb +9 -0
- data/lib/drawio_dsl/schema/layouts/flex_layout.rb +1 -1
- data/lib/drawio_dsl/schema/layouts/grid_layout.rb +1 -1
- data/lib/drawio_dsl/schema/lines/.rb +9 -0
- data/lib/drawio_dsl/schema/node.rb +5 -5
- data/lib/drawio_dsl/schema/shape.rb +8 -8
- data/lib/drawio_dsl/schema/texts/.rb +9 -0
- data/lib/drawio_dsl/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +4 -1
@@ -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}",
|
51
|
-
node_anchor = DrawioDsl::Schema::Anchor.new(self, id: "node_root_#{current_page.id}",
|
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.
|
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
|
@@ -9,7 +9,7 @@ module DrawioDsl
|
|
9
9
|
attr_accessor :page
|
10
10
|
attr_accessor :parent
|
11
11
|
attr_accessor :classification
|
12
|
-
attr_accessor :
|
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
|
-
@
|
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
|
-
|
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,
|
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 << (
|
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
|
-
@
|
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(
|
87
|
-
|
88
|
-
format_instance(
|
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
|
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
|
-
|
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,
|
156
|
+
debug_detail({ id: id, classification: classification, key: key })
|
157
157
|
else
|
158
|
-
debug_row(classification, id,
|
158
|
+
debug_row(classification, id, key, x, y, w, h)
|
159
159
|
end
|
160
160
|
end
|
161
161
|
# :nocov:
|
data/lib/drawio_dsl/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "drawio_dsl",
|
3
|
-
"version": "0.11.
|
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.
|
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
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.
|
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
|