19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/glimmer/dsl/web/component_expression.rb', line 19
def add_content(parent, keyword, *args, &block)
options = args.last.is_a?(Hash) ? args.last : {}
slot = options[:slot] || options['slot']
slot = slot.to_s unless slot.nil?
if block.source_location && (block.source_location == parent.content&.__getobj__&.source_location)
parent.content.call(parent) unless parent.content.called?
else
if slot
if slot == 'markup_root_slot'
super(parent, keyword, *args, &block)
else
slot_element = parent.slot_elements[slot]
slot_element&.content(&block)
end
else
if parent.default_slot
slot = parent.default_slot
slot_element = parent.slot_elements[slot]
slot_element&.content(&block)
else
super(parent, keyword, *args, &block)
end
end
end
parent.post_add_content
end
|