uniword 1.0.9 → 1.0.11
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 +4 -4
- data/data/themes/office_format_scheme.xml +137 -0
- data/data/themes/office_theme.xml +2 -0
- data/lib/uniword/builder/footnote_builder.rb +4 -2
- data/lib/uniword/builder/run_builder.rb +5 -0
- data/lib/uniword/document_factory.rb +1 -0
- data/lib/uniword/docx/package.rb +18 -0
- data/lib/uniword/docx/package_defaults.rb +1 -0
- data/lib/uniword/docx/package_serialization.rb +38 -0
- data/lib/uniword/docx/reconciler.rb +195 -13
- data/lib/uniword/lazy_loader.rb +1 -1
- data/lib/uniword/properties/boolean_element_factory.rb +8 -15
- data/lib/uniword/schema/schema_loader.rb +1 -1
- data/lib/uniword/transformation/mhtml_style_builder.rb +9 -2
- data/lib/uniword/transformation/ooxml_to_mhtml_converter.rb +7 -15
- data/lib/uniword/transformation/yaml_css_generator.rb +815 -0
- data/lib/uniword/transformation.rb +2 -0
- data/lib/uniword/version.rb +1 -1
- data/lib/uniword/wordprocessingml/attached_template.rb +18 -0
- data/lib/uniword/wordprocessingml/body.rb +34 -34
- data/lib/uniword/wordprocessingml/brk_bin.rb +17 -0
- data/lib/uniword/wordprocessingml/brk_bin_sub.rb +17 -0
- data/lib/uniword/wordprocessingml/character_spacing_control.rb +17 -0
- data/lib/uniword/wordprocessingml/clr_scheme_mapping.rb +39 -0
- data/lib/uniword/wordprocessingml/compat.rb +16 -0
- data/lib/uniword/wordprocessingml/decimal_symbol.rb +17 -0
- data/lib/uniword/wordprocessingml/def_jc.rb +17 -0
- data/lib/uniword/wordprocessingml/default_tab_stop.rb +17 -0
- data/lib/uniword/wordprocessingml/disp_def.rb +14 -0
- data/lib/uniword/wordprocessingml/do_not_display_page_boundaries.rb +14 -0
- data/lib/uniword/wordprocessingml/do_not_include_subdocs_in_stats.rb +17 -0
- data/lib/uniword/wordprocessingml/doc_vars.rb +36 -0
- data/lib/uniword/wordprocessingml/document_root.rb +8 -5
- data/lib/uniword/wordprocessingml/endnote_pr.rb +18 -0
- data/lib/uniword/wordprocessingml/endnotes.rb +18 -0
- data/lib/uniword/wordprocessingml/even_and_odd_headers.rb +17 -0
- data/lib/uniword/wordprocessingml/footnote_pos.rb +17 -0
- data/lib/uniword/wordprocessingml/footnote_pr.rb +20 -0
- data/lib/uniword/wordprocessingml/footnotes.rb +18 -0
- data/lib/uniword/wordprocessingml/hdr_shape_defaults.rb +19 -0
- data/lib/uniword/wordprocessingml/hyphenation_zone.rb +20 -0
- data/lib/uniword/wordprocessingml/int_lim.rb +17 -0
- data/lib/uniword/wordprocessingml/l_margin.rb +17 -0
- data/lib/uniword/wordprocessingml/list_separator.rb +17 -0
- data/lib/uniword/wordprocessingml/math_font.rb +17 -0
- data/lib/uniword/wordprocessingml/math_pr.rb +49 -0
- data/lib/uniword/wordprocessingml/mirror_margins.rb +17 -0
- data/lib/uniword/wordprocessingml/nary_lim.rb +17 -0
- data/lib/uniword/wordprocessingml/proof_state.rb +19 -0
- data/lib/uniword/wordprocessingml/r_margin.rb +17 -0
- data/lib/uniword/wordprocessingml/rsid.rb +17 -0
- data/lib/uniword/wordprocessingml/rsid_root.rb +17 -0
- data/lib/uniword/wordprocessingml/rsids.rb +22 -0
- data/lib/uniword/wordprocessingml/settings.rb +45 -511
- data/lib/uniword/wordprocessingml/shape_defaults.rb +21 -0
- data/lib/uniword/wordprocessingml/small_frac.rb +17 -0
- data/lib/uniword/wordprocessingml/style_pane_format_filter.rb +50 -0
- data/lib/uniword/wordprocessingml/style_pane_sort_method.rb +20 -0
- data/lib/uniword/wordprocessingml/table_cell.rb +6 -0
- data/lib/uniword/wordprocessingml/table_row_properties.rb +2 -0
- data/lib/uniword/wordprocessingml/theme_font_lang.rb +19 -0
- data/lib/uniword/wordprocessingml/w14_doc_id.rb +17 -0
- data/lib/uniword/wordprocessingml/w15_chart_tracking_ref_based.rb +14 -0
- data/lib/uniword/wordprocessingml/w15_doc_id.rb +17 -0
- data/lib/uniword/wordprocessingml/wrap_indent.rb +17 -0
- data/lib/uniword/wordprocessingml.rb +42 -56
- data/lib/uniword.rb +12 -5
- metadata +50 -2
|
@@ -14,23 +14,16 @@ module Uniword
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
# Helper to define val= override after attribute declaration.
|
|
17
|
-
# Uses alias_method to save the generated setter, then overrides it.
|
|
18
17
|
module BooleanValSetter
|
|
19
18
|
def self.included(base)
|
|
20
|
-
base.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
nil
|
|
29
|
-
else
|
|
30
|
-
v
|
|
31
|
-
end
|
|
32
|
-
value_set_for(:val)
|
|
33
|
-
end
|
|
19
|
+
base.define_method(:val=) do |v|
|
|
20
|
+
@val = case v
|
|
21
|
+
when nil then nil
|
|
22
|
+
when false, "false" then "false"
|
|
23
|
+
when true, "true" then nil
|
|
24
|
+
else v
|
|
25
|
+
end
|
|
26
|
+
value_set_for(:val)
|
|
34
27
|
end
|
|
35
28
|
end
|
|
36
29
|
end
|
|
@@ -697,6 +697,12 @@ module Uniword
|
|
|
697
697
|
</style>
|
|
698
698
|
LSB_STYLE
|
|
699
699
|
|
|
700
|
+
class << self
|
|
701
|
+
# Custom CSS override set by callers (e.g., ISO adapter).
|
|
702
|
+
# When set, #style_block returns this instead of the default.
|
|
703
|
+
attr_accessor :custom_style_block
|
|
704
|
+
end
|
|
705
|
+
|
|
700
706
|
# Build the w:LatentStyles block.
|
|
701
707
|
# @return [String] Static latent styles XML
|
|
702
708
|
def self.latent_styles
|
|
@@ -704,9 +710,10 @@ module Uniword
|
|
|
704
710
|
end
|
|
705
711
|
|
|
706
712
|
# Build the CSS style block.
|
|
707
|
-
#
|
|
713
|
+
# Returns custom CSS if set via custom_style_block=, otherwise default.
|
|
714
|
+
# @return [String] CSS style block
|
|
708
715
|
def self.style_block
|
|
709
|
-
STYLE_BLOCK
|
|
716
|
+
custom_style_block || STYLE_BLOCK
|
|
710
717
|
end
|
|
711
718
|
end
|
|
712
719
|
end
|
|
@@ -18,7 +18,8 @@ module Uniword
|
|
|
18
18
|
# output = Uniword::Infrastructure::MimePackager.new(mhtml_doc).build_mime_content
|
|
19
19
|
#
|
|
20
20
|
class OoxmlToMhtmlConverter
|
|
21
|
-
# Static MsoNormalTable CSS (used in wrap_html_document head)
|
|
21
|
+
# Static MsoNormalTable CSS (used in wrap_html_document head).
|
|
22
|
+
# Only used when MhtmlStyleBuilder does not provide custom CSS.
|
|
22
23
|
MSO_NORMAL_TABLE_STYLE = <<~CSS
|
|
23
24
|
<!--[if gte mso 10]>
|
|
24
25
|
<style>
|
|
@@ -30,21 +31,12 @@ module Uniword
|
|
|
30
31
|
mso-style-noshow:yes;
|
|
31
32
|
mso-style-priority:99;
|
|
32
33
|
mso-style-parent:"";
|
|
33
|
-
mso-padding-alt:
|
|
34
|
-
mso-para-margin
|
|
35
|
-
mso-para-margin-
|
|
36
|
-
mso-para-margin-bottom:8.0pt;
|
|
37
|
-
mso-para-margin-left:0in;
|
|
38
|
-
line-height:115%;
|
|
34
|
+
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
|
|
35
|
+
mso-para-margin:0cm;
|
|
36
|
+
mso-para-margin-bottom:.0001pt;
|
|
39
37
|
mso-pagination:widow-orphan;
|
|
40
|
-
font-size:
|
|
41
|
-
font-family:"
|
|
42
|
-
mso-ascii-font-family:Aptos;
|
|
43
|
-
mso-ascii-theme-font:minor-latin;
|
|
44
|
-
mso-hansi-font-family:Aptos;
|
|
45
|
-
mso-hansi-theme-font:minor-latin;
|
|
46
|
-
mso-font-kerning:1.0pt;
|
|
47
|
-
mso-ligatures:standardcontextual;}
|
|
38
|
+
font-size:10pt;
|
|
39
|
+
font-family:"Cambria",serif;}
|
|
48
40
|
</style>
|
|
49
41
|
<![endif]-->
|
|
50
42
|
CSS
|