dknowc-dsh 1.0.3 → 1.1.0
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.
- package/README.md +9 -4
- package/package.json +2 -2
- package/skills/dknowc-official-doc-writer/SKILL.md +17 -8
- package/skills/dknowc-official-doc-writer/reference/sample_search_result.md +48 -0
- package/skills/dknowc-official-doc-writer/reference/sample_trace_report.html +75 -0
- package/skills/dknowc-official-doc-writer/reference/search_intro.md +72 -8
- package/skills/dknowc-official-doc-writer/scripts/register.mjs +1 -1
- package/skills/dknowc-ppt-assistant/README.md +54 -0
- package/skills/dknowc-ppt-assistant/SKILL.md +151 -0
- package/skills/dknowc-ppt-assistant/THIRD_PARTY_NOTICES.md +36 -0
- package/skills/dknowc-ppt-assistant/official-docs/output/.gitkeep +0 -0
- package/skills/dknowc-ppt-assistant/official-docs/search-results/.gitkeep +0 -0
- package/skills/dknowc-ppt-assistant/projects/.gitkeep +0 -0
- package/skills/dknowc-ppt-assistant/references/content-pack.md +55 -0
- package/skills/dknowc-ppt-assistant/references/material_usage.md +51 -0
- package/skills/dknowc-ppt-assistant/references/sample_effect.html +89 -0
- package/skills/dknowc-ppt-assistant/references/sample_search_result.md +48 -0
- package/skills/dknowc-ppt-assistant/references/search_intro.md +79 -0
- package/skills/dknowc-ppt-assistant/references/style-presets.md +126 -0
- package/skills/dknowc-ppt-assistant/references/svg-authoring.md +81 -0
- package/skills/dknowc-ppt-assistant/references/upstream-docs/svg-pipeline.md +842 -0
- package/skills/dknowc-ppt-assistant/references/upstream-example/01_cover.svg +28 -0
- package/skills/dknowc-ppt-assistant/references/upstream-example/02_quote.svg +38 -0
- package/skills/dknowc-ppt-assistant/references/upstream-example/03_origin.svg +96 -0
- package/skills/dknowc-ppt-assistant/references/upstream-example/README.md +15 -0
- package/skills/dknowc-ppt-assistant/references/upstream-example/design_spec.md +408 -0
- package/skills/dknowc-ppt-assistant/references/upstream-example/spec_lock.md +78 -0
- package/skills/dknowc-ppt-assistant/scripts/adapt_mcp_result.py +279 -0
- package/skills/dknowc-ppt-assistant/scripts/check_release.py +106 -0
- package/skills/dknowc-ppt-assistant/scripts/compact_svg_coordinates.py +345 -0
- package/skills/dknowc-ppt-assistant/scripts/config.py +707 -0
- package/skills/dknowc-ppt-assistant/scripts/console_encoding.py +33 -0
- package/skills/dknowc-ppt-assistant/scripts/error_helper.py +434 -0
- package/skills/dknowc-ppt-assistant/scripts/finalize_svg.py +507 -0
- package/skills/dknowc-ppt-assistant/scripts/hyperlink_contract.py +399 -0
- package/skills/dknowc-ppt-assistant/scripts/initialize.py +182 -0
- package/skills/dknowc-ppt-assistant/scripts/language_tags.py +283 -0
- package/skills/dknowc-ppt-assistant/scripts/mcp_direct.py +158 -0
- package/skills/dknowc-ppt-assistant/scripts/native_payloads.py +655 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_animation_presets.json +3440 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_animations.py +3965 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_effects.py +143 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_opc_validation.py +346 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/__init__.py +130 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/data/LICENSE-APACHE-2.0.txt +202 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/data/LICENSE-OPEN-XML-SDK-MIT.txt +23 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/data/NOTICE.md +54 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/data/presetShapeDefinitions.xml +19898 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/data/presetShapeSemantics.json +1217 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/data/shape_type_values.txt +187 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/errors.py +39 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/formula.py +336 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/loader.py +364 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/models.py +201 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/registry.py +270 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantic_hash.py +456 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/semantics.py +543 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_shapes/xml_safety.py +21 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/__init__.py +21 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/animation_import.py +287 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/chart_to_svg.py +2377 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/chartex_to_svg.py +422 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/color_resolver.py +894 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/converter.py +1143 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/custgeom_to_svg.py +165 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/effect_to_svg.py +410 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/emu_units.py +258 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/fill_to_svg.py +816 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/formula_import.py +611 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/hyperlinks.py +93 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/import_diagnostics.py +37 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/ln_to_svg.py +362 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/normalized_chart_svg.py +1217 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/ooxml_loader.py +506 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/pic_to_svg.py +653 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_authoring.py +894 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_registry_to_svg.py +216 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/preset_svg_markup.py +198 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/prstgeom_to_svg.py +162 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/shape_walker.py +556 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/slide_to_svg.py +2002 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/tbl_to_svg.py +1841 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/transition_import.py +201 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_to_svg/txbody_to_svg.py +1433 -0
- package/skills/dknowc-ppt-assistant/scripts/pptx_transitions.py +3153 -0
- package/skills/dknowc-ppt-assistant/scripts/preset_shape_svg.py +450 -0
- package/skills/dknowc-ppt-assistant/scripts/project_utils.py +645 -0
- package/skills/dknowc-ppt-assistant/scripts/register_key.mjs +183 -0
- package/skills/dknowc-ppt-assistant/scripts/register_template.py +1327 -0
- package/skills/dknowc-ppt-assistant/scripts/render_trace_html.py +1048 -0
- package/skills/dknowc-ppt-assistant/scripts/resource_paths.py +282 -0
- package/skills/dknowc-ppt-assistant/scripts/shape_boolean_svg.py +189 -0
- package/skills/dknowc-ppt-assistant/scripts/slide_roster.py +44 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/__init__.py +12 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/align_embed_images.py +672 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/crop_images.py +370 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/embed_icons.py +564 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/embed_images.py +288 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/fix_image_aspect.py +389 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/flatten_tspan.py +948 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_finalize/svg_rect_to_path.py +346 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/__init__.py +15 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/checker.py +7791 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/cli.py +193 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/svg_contracts.py +1121 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_quality/xml_support.py +35 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_quality_checker.py +59 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/__init__.py +37 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/animation_config.py +1622 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/canvas_contract.py +226 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/__init__.py +1 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/context.py +291 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/converter.py +1980 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/elements.py +5272 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/hyperlinks.py +162 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/paths.py +847 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/styles.py +752 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/text_properties.py +796 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_colors.py +283 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/theme_fonts.py +330 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/drawingml/utils.py +3555 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/geometry_properties.py +140 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/__init__.py +356 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/chart_data.py +1449 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/chart_style.py +886 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/chart_xml.py +1495 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/chartex.py +272 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/fallback_hash.py +161 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula.py +243 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_ast.py +592 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_compiler.py +96 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_omml.py +1049 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_parser.py +2181 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_profile.py +739 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/formula_run_properties.py +234 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/inline_formula.py +311 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/marker_attributes.py +182 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/marker_common.py +806 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/marker_status.py +190 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/table.py +1113 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/native_objects/workbook.py +216 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/__init__.py +1 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/builder.py +6273 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/cli.py +2059 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/dimensions.py +189 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/discovery.py +120 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/media.py +160 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/narration.py +696 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/notes.py +336 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/slide_xml.py +138 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_structure.py +3457 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/pptx_package/template_validation.py +1536 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/semantic_markers.py +240 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/shape_boolean.py +1355 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/text_outline.py +1121 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/tspan_flattener.py +64 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx/use_expander.py +577 -0
- package/skills/dknowc-ppt-assistant/scripts/svg_to_pptx.py +21 -0
- package/skills/dknowc-ppt-assistant/scripts/trusted_search.py +336 -0
- package/skills/dknowc-ppt-assistant/scripts/update_spec.py +404 -0
- package/skills/dknowc-ppt-assistant/workflows/generate-pptx.md +142 -0
- package/skills/dknowc-ppt-assistant/workflows/routing.md +38 -0
- package/skills/dknowc-trusted-consulting/SKILL.md +21 -5
- package/skills/dknowc-trusted-consulting/reference/consult_intro.md +79 -0
- package/skills/dknowc-trusted-consulting/reference/sample_consult_answer.md +31 -0
- package/skills/dknowc-trusted-consulting/reference/sample_trace_report.html +76 -0
- package/skills/dknowc-trusted-consulting/scripts/register_key.mjs +1 -0
- package/skills/dknowc-trusted-search/SKILL.md +30 -2
- package/skills/dknowc-trusted-search/reference/sample_search_result.md +33 -0
- package/skills/dknowc-trusted-search/reference/sample_trace_report.html +450 -0
- package/skills/dknowc-trusted-search/reference/search_intro.md +79 -0
- package/skills/dknowc-trusted-search/scripts/register_key.mjs +1 -0
- package/src/index.js +7 -2
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
line
|
|
2
|
+
lineInv
|
|
3
|
+
triangle
|
|
4
|
+
rtTriangle
|
|
5
|
+
rect
|
|
6
|
+
diamond
|
|
7
|
+
parallelogram
|
|
8
|
+
trapezoid
|
|
9
|
+
nonIsoscelesTrapezoid
|
|
10
|
+
pentagon
|
|
11
|
+
hexagon
|
|
12
|
+
heptagon
|
|
13
|
+
octagon
|
|
14
|
+
decagon
|
|
15
|
+
dodecagon
|
|
16
|
+
star4
|
|
17
|
+
star5
|
|
18
|
+
star6
|
|
19
|
+
star7
|
|
20
|
+
star8
|
|
21
|
+
star10
|
|
22
|
+
star12
|
|
23
|
+
star16
|
|
24
|
+
star24
|
|
25
|
+
star32
|
|
26
|
+
roundRect
|
|
27
|
+
round1Rect
|
|
28
|
+
round2SameRect
|
|
29
|
+
round2DiagRect
|
|
30
|
+
snipRoundRect
|
|
31
|
+
snip1Rect
|
|
32
|
+
snip2SameRect
|
|
33
|
+
snip2DiagRect
|
|
34
|
+
plaque
|
|
35
|
+
ellipse
|
|
36
|
+
teardrop
|
|
37
|
+
homePlate
|
|
38
|
+
chevron
|
|
39
|
+
pieWedge
|
|
40
|
+
pie
|
|
41
|
+
blockArc
|
|
42
|
+
donut
|
|
43
|
+
noSmoking
|
|
44
|
+
rightArrow
|
|
45
|
+
leftArrow
|
|
46
|
+
upArrow
|
|
47
|
+
downArrow
|
|
48
|
+
stripedRightArrow
|
|
49
|
+
notchedRightArrow
|
|
50
|
+
bentUpArrow
|
|
51
|
+
leftRightArrow
|
|
52
|
+
upDownArrow
|
|
53
|
+
leftUpArrow
|
|
54
|
+
leftRightUpArrow
|
|
55
|
+
quadArrow
|
|
56
|
+
leftArrowCallout
|
|
57
|
+
rightArrowCallout
|
|
58
|
+
upArrowCallout
|
|
59
|
+
downArrowCallout
|
|
60
|
+
leftRightArrowCallout
|
|
61
|
+
upDownArrowCallout
|
|
62
|
+
quadArrowCallout
|
|
63
|
+
bentArrow
|
|
64
|
+
uturnArrow
|
|
65
|
+
circularArrow
|
|
66
|
+
leftCircularArrow
|
|
67
|
+
leftRightCircularArrow
|
|
68
|
+
curvedRightArrow
|
|
69
|
+
curvedLeftArrow
|
|
70
|
+
curvedUpArrow
|
|
71
|
+
curvedDownArrow
|
|
72
|
+
swooshArrow
|
|
73
|
+
cube
|
|
74
|
+
can
|
|
75
|
+
lightningBolt
|
|
76
|
+
heart
|
|
77
|
+
sun
|
|
78
|
+
moon
|
|
79
|
+
smileyFace
|
|
80
|
+
irregularSeal1
|
|
81
|
+
irregularSeal2
|
|
82
|
+
foldedCorner
|
|
83
|
+
bevel
|
|
84
|
+
frame
|
|
85
|
+
halfFrame
|
|
86
|
+
corner
|
|
87
|
+
diagStripe
|
|
88
|
+
chord
|
|
89
|
+
arc
|
|
90
|
+
leftBracket
|
|
91
|
+
rightBracket
|
|
92
|
+
leftBrace
|
|
93
|
+
rightBrace
|
|
94
|
+
bracketPair
|
|
95
|
+
bracePair
|
|
96
|
+
straightConnector1
|
|
97
|
+
bentConnector2
|
|
98
|
+
bentConnector3
|
|
99
|
+
bentConnector4
|
|
100
|
+
bentConnector5
|
|
101
|
+
curvedConnector2
|
|
102
|
+
curvedConnector3
|
|
103
|
+
curvedConnector4
|
|
104
|
+
curvedConnector5
|
|
105
|
+
callout1
|
|
106
|
+
callout2
|
|
107
|
+
callout3
|
|
108
|
+
accentCallout1
|
|
109
|
+
accentCallout2
|
|
110
|
+
accentCallout3
|
|
111
|
+
borderCallout1
|
|
112
|
+
borderCallout2
|
|
113
|
+
borderCallout3
|
|
114
|
+
accentBorderCallout1
|
|
115
|
+
accentBorderCallout2
|
|
116
|
+
accentBorderCallout3
|
|
117
|
+
wedgeRectCallout
|
|
118
|
+
wedgeRoundRectCallout
|
|
119
|
+
wedgeEllipseCallout
|
|
120
|
+
cloudCallout
|
|
121
|
+
cloud
|
|
122
|
+
ribbon
|
|
123
|
+
ribbon2
|
|
124
|
+
ellipseRibbon
|
|
125
|
+
ellipseRibbon2
|
|
126
|
+
leftRightRibbon
|
|
127
|
+
verticalScroll
|
|
128
|
+
horizontalScroll
|
|
129
|
+
wave
|
|
130
|
+
doubleWave
|
|
131
|
+
plus
|
|
132
|
+
flowChartProcess
|
|
133
|
+
flowChartDecision
|
|
134
|
+
flowChartInputOutput
|
|
135
|
+
flowChartPredefinedProcess
|
|
136
|
+
flowChartInternalStorage
|
|
137
|
+
flowChartDocument
|
|
138
|
+
flowChartMultidocument
|
|
139
|
+
flowChartTerminator
|
|
140
|
+
flowChartPreparation
|
|
141
|
+
flowChartManualInput
|
|
142
|
+
flowChartManualOperation
|
|
143
|
+
flowChartConnector
|
|
144
|
+
flowChartPunchedCard
|
|
145
|
+
flowChartPunchedTape
|
|
146
|
+
flowChartSummingJunction
|
|
147
|
+
flowChartOr
|
|
148
|
+
flowChartCollate
|
|
149
|
+
flowChartSort
|
|
150
|
+
flowChartExtract
|
|
151
|
+
flowChartMerge
|
|
152
|
+
flowChartOfflineStorage
|
|
153
|
+
flowChartOnlineStorage
|
|
154
|
+
flowChartMagneticTape
|
|
155
|
+
flowChartMagneticDisk
|
|
156
|
+
flowChartMagneticDrum
|
|
157
|
+
flowChartDisplay
|
|
158
|
+
flowChartDelay
|
|
159
|
+
flowChartAlternateProcess
|
|
160
|
+
flowChartOffpageConnector
|
|
161
|
+
actionButtonBlank
|
|
162
|
+
actionButtonHome
|
|
163
|
+
actionButtonHelp
|
|
164
|
+
actionButtonInformation
|
|
165
|
+
actionButtonForwardNext
|
|
166
|
+
actionButtonBackPrevious
|
|
167
|
+
actionButtonEnd
|
|
168
|
+
actionButtonBeginning
|
|
169
|
+
actionButtonReturn
|
|
170
|
+
actionButtonDocument
|
|
171
|
+
actionButtonSound
|
|
172
|
+
actionButtonMovie
|
|
173
|
+
gear6
|
|
174
|
+
gear9
|
|
175
|
+
funnel
|
|
176
|
+
mathPlus
|
|
177
|
+
mathMinus
|
|
178
|
+
mathMultiply
|
|
179
|
+
mathDivide
|
|
180
|
+
mathEqual
|
|
181
|
+
mathNotEqual
|
|
182
|
+
cornerTabs
|
|
183
|
+
squareTabs
|
|
184
|
+
plaqueTabs
|
|
185
|
+
chartX
|
|
186
|
+
chartStar
|
|
187
|
+
chartPlus
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
PPT Master - PPTX Shape Errors
|
|
4
|
+
|
|
5
|
+
Shared exception types for the DrawingML preset-geometry package.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
Import exception classes from pptx_shapes.errors.
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
from pptx_shapes.errors import FormulaEvaluationError
|
|
12
|
+
|
|
13
|
+
Dependencies:
|
|
14
|
+
None (only uses standard library)
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PresetShapeError(ValueError):
|
|
19
|
+
"""Base error for invalid preset-shape data or evaluation input."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class PresetShapeDataError(PresetShapeError):
|
|
23
|
+
"""Raised when the bundled preset catalog is incomplete or malformed."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class FormulaSyntaxError(PresetShapeError):
|
|
27
|
+
"""Raised when a DrawingML guide formula has invalid syntax."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class FormulaEvaluationError(PresetShapeError):
|
|
31
|
+
"""Raised when a syntactically valid formula cannot be evaluated."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class UnknownGuideError(PresetShapeError):
|
|
35
|
+
"""Raised when a formula references an unknown guide token."""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class UnknownPresetShapeError(KeyError):
|
|
39
|
+
"""Raised when a preset name is absent from the locked shape catalog."""
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
PPT Master - DrawingML Formula Evaluator
|
|
4
|
+
|
|
5
|
+
Evaluate DrawingML geometry guide formulas and standard built-in guides.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
Import FormulaEvaluator or evaluate_formula from pptx_shapes.formula.
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
evaluator = FormulaEvaluator(width=200, height=100)
|
|
12
|
+
evaluator.evaluate("*/ w 1 2")
|
|
13
|
+
|
|
14
|
+
Dependencies:
|
|
15
|
+
None (only uses standard library)
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import math
|
|
21
|
+
import re
|
|
22
|
+
from types import MappingProxyType
|
|
23
|
+
from typing import Mapping
|
|
24
|
+
|
|
25
|
+
from .errors import (
|
|
26
|
+
FormulaEvaluationError,
|
|
27
|
+
FormulaSyntaxError,
|
|
28
|
+
UnknownGuideError,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
OOXML_DEGREE = 60000.0
|
|
33
|
+
FULL_CIRCLE = 360.0 * OOXML_DEGREE
|
|
34
|
+
OOXML_COORDINATE_MIN = -27273042329600
|
|
35
|
+
OOXML_COORDINATE_MAX = 27273042316900
|
|
36
|
+
OOXML_LINE_WIDTH_MAX = 20116800
|
|
37
|
+
|
|
38
|
+
_OPERATOR_ARITY = {
|
|
39
|
+
"val": 1,
|
|
40
|
+
"*/": 3,
|
|
41
|
+
"+-": 3,
|
|
42
|
+
"+/": 3,
|
|
43
|
+
"?:": 3,
|
|
44
|
+
"abs": 1,
|
|
45
|
+
"at2": 2,
|
|
46
|
+
"cat2": 3,
|
|
47
|
+
"cos": 2,
|
|
48
|
+
"max": 2,
|
|
49
|
+
"min": 2,
|
|
50
|
+
"mod": 3,
|
|
51
|
+
"pin": 3,
|
|
52
|
+
"sat2": 3,
|
|
53
|
+
"sin": 2,
|
|
54
|
+
"sqrt": 1,
|
|
55
|
+
"tan": 2,
|
|
56
|
+
}
|
|
57
|
+
SUPPORTED_OPERATORS = frozenset(_OPERATOR_ARITY)
|
|
58
|
+
|
|
59
|
+
_DIMENSION_GUIDE_RE = re.compile(r"^(wd|hd|ssd)([1-9][0-9]*)$")
|
|
60
|
+
_ANGLE_GUIDE_RE = re.compile(r"^(?:(\d+))?cd([1-9][0-9]*)$")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def validate_ooxml_xfrm(
|
|
64
|
+
off_x: int,
|
|
65
|
+
off_y: int,
|
|
66
|
+
ext_cx: int,
|
|
67
|
+
ext_cy: int,
|
|
68
|
+
) -> None:
|
|
69
|
+
"""Validate DrawingML shape offsets and extents in EMU."""
|
|
70
|
+
for name, value in (("x", off_x), ("y", off_y)):
|
|
71
|
+
if not OOXML_COORDINATE_MIN <= value <= OOXML_COORDINATE_MAX:
|
|
72
|
+
raise ValueError(
|
|
73
|
+
f"DrawingML xfrm offset {name}={value} is outside the "
|
|
74
|
+
"OOXML coordinate range"
|
|
75
|
+
)
|
|
76
|
+
for name, value in (("cx", ext_cx), ("cy", ext_cy)):
|
|
77
|
+
if value < 0 or value > OOXML_COORDINATE_MAX:
|
|
78
|
+
raise ValueError(
|
|
79
|
+
f"DrawingML xfrm extent {name}={value} is outside the "
|
|
80
|
+
"OOXML positive-coordinate range"
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def validate_ooxml_line_width(width: int) -> None:
|
|
85
|
+
"""Validate one DrawingML ``ST_LineWidth`` value in EMU."""
|
|
86
|
+
if width < 0 or width > OOXML_LINE_WIDTH_MAX:
|
|
87
|
+
raise ValueError(
|
|
88
|
+
f"DrawingML line width {width} is outside the OOXML line-width range"
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def build_builtin_guides(
|
|
93
|
+
width: float,
|
|
94
|
+
height: float,
|
|
95
|
+
*,
|
|
96
|
+
left: float = 0.0,
|
|
97
|
+
top: float = 0.0,
|
|
98
|
+
) -> Mapping[str, float]:
|
|
99
|
+
"""Build the standard DrawingML geometry guide context for one frame."""
|
|
100
|
+
|
|
101
|
+
width = _finite_number(width, "width")
|
|
102
|
+
height = _finite_number(height, "height")
|
|
103
|
+
left = _finite_number(left, "left")
|
|
104
|
+
top = _finite_number(top, "top")
|
|
105
|
+
if width < 0 or height < 0:
|
|
106
|
+
raise FormulaEvaluationError("Shape width and height must be non-negative")
|
|
107
|
+
|
|
108
|
+
right = left + width
|
|
109
|
+
bottom = top + height
|
|
110
|
+
short_side = min(width, height)
|
|
111
|
+
long_side = max(width, height)
|
|
112
|
+
values = {
|
|
113
|
+
"l": left,
|
|
114
|
+
"t": top,
|
|
115
|
+
"r": right,
|
|
116
|
+
"b": bottom,
|
|
117
|
+
"w": width,
|
|
118
|
+
"h": height,
|
|
119
|
+
"hc": left + width / 2.0,
|
|
120
|
+
"vc": top + height / 2.0,
|
|
121
|
+
"ss": short_side,
|
|
122
|
+
"ls": long_side,
|
|
123
|
+
"cd2": FULL_CIRCLE / 2.0,
|
|
124
|
+
"cd3": FULL_CIRCLE / 3.0,
|
|
125
|
+
"cd4": FULL_CIRCLE / 4.0,
|
|
126
|
+
"cd8": FULL_CIRCLE / 8.0,
|
|
127
|
+
"3cd4": FULL_CIRCLE * 3.0 / 4.0,
|
|
128
|
+
"3cd8": FULL_CIRCLE * 3.0 / 8.0,
|
|
129
|
+
"5cd8": FULL_CIRCLE * 5.0 / 8.0,
|
|
130
|
+
"7cd8": FULL_CIRCLE * 7.0 / 8.0,
|
|
131
|
+
}
|
|
132
|
+
for divisor in (2, 3, 4, 5, 6, 8, 10, 12, 16, 32):
|
|
133
|
+
values[f"wd{divisor}"] = width / divisor
|
|
134
|
+
values[f"hd{divisor}"] = height / divisor
|
|
135
|
+
values[f"ssd{divisor}"] = short_side / divisor
|
|
136
|
+
return MappingProxyType(values)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class FormulaEvaluator:
|
|
140
|
+
"""Evaluate guide formulas against a shape-local DrawingML context."""
|
|
141
|
+
|
|
142
|
+
def __init__(
|
|
143
|
+
self,
|
|
144
|
+
width: float,
|
|
145
|
+
height: float,
|
|
146
|
+
*,
|
|
147
|
+
left: float = 0.0,
|
|
148
|
+
top: float = 0.0,
|
|
149
|
+
values: Mapping[str, float] | None = None,
|
|
150
|
+
) -> None:
|
|
151
|
+
self._builtins = dict(
|
|
152
|
+
build_builtin_guides(width, height, left=left, top=top)
|
|
153
|
+
)
|
|
154
|
+
self._values: dict[str, float] = {}
|
|
155
|
+
if values:
|
|
156
|
+
for name, value in values.items():
|
|
157
|
+
self.bind(name, value)
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
def values(self) -> Mapping[str, float]:
|
|
161
|
+
"""Return a detached, read-only view of explicitly bound guides."""
|
|
162
|
+
|
|
163
|
+
return MappingProxyType(dict(self._values))
|
|
164
|
+
|
|
165
|
+
@property
|
|
166
|
+
def builtins(self) -> Mapping[str, float]:
|
|
167
|
+
"""Return the resolved built-in guide values."""
|
|
168
|
+
|
|
169
|
+
return MappingProxyType(dict(self._builtins))
|
|
170
|
+
|
|
171
|
+
def bind(self, name: str, value: float) -> float:
|
|
172
|
+
"""Bind one evaluated adjustment or guide and return its numeric value."""
|
|
173
|
+
|
|
174
|
+
if not name or name.isspace():
|
|
175
|
+
raise FormulaEvaluationError("Guide name must not be empty")
|
|
176
|
+
number = _finite_number(value, f"guide {name!r}")
|
|
177
|
+
self._values[name] = number
|
|
178
|
+
return number
|
|
179
|
+
|
|
180
|
+
def resolve(self, token: str) -> float:
|
|
181
|
+
"""Resolve a literal, bound guide, or DrawingML built-in guide token."""
|
|
182
|
+
|
|
183
|
+
token = token.strip()
|
|
184
|
+
if not token:
|
|
185
|
+
raise UnknownGuideError("Guide token must not be empty")
|
|
186
|
+
try:
|
|
187
|
+
return _finite_number(float(token), f"literal {token!r}")
|
|
188
|
+
except ValueError:
|
|
189
|
+
pass
|
|
190
|
+
|
|
191
|
+
if token in self._values:
|
|
192
|
+
return self._values[token]
|
|
193
|
+
if token in self._builtins:
|
|
194
|
+
return self._builtins[token]
|
|
195
|
+
|
|
196
|
+
dynamic = self._resolve_dynamic_builtin(token)
|
|
197
|
+
if dynamic is not None:
|
|
198
|
+
self._builtins[token] = dynamic
|
|
199
|
+
return dynamic
|
|
200
|
+
raise UnknownGuideError(f"Unknown DrawingML guide token: {token!r}")
|
|
201
|
+
|
|
202
|
+
def evaluate(self, formula: str) -> float:
|
|
203
|
+
"""Evaluate one complete DrawingML geometry formula."""
|
|
204
|
+
|
|
205
|
+
parts = formula.split()
|
|
206
|
+
if not parts:
|
|
207
|
+
raise FormulaSyntaxError("DrawingML formula must not be empty")
|
|
208
|
+
operator = parts[0]
|
|
209
|
+
expected = _OPERATOR_ARITY.get(operator)
|
|
210
|
+
if expected is None:
|
|
211
|
+
raise FormulaSyntaxError(
|
|
212
|
+
f"Unsupported DrawingML formula operator: {operator!r}"
|
|
213
|
+
)
|
|
214
|
+
if len(parts) < expected + 1:
|
|
215
|
+
raise FormulaSyntaxError(
|
|
216
|
+
f"Operator {operator!r} expects {expected} operands, "
|
|
217
|
+
f"received {len(parts) - 1}: {formula!r}"
|
|
218
|
+
)
|
|
219
|
+
trailing = parts[expected + 1 :]
|
|
220
|
+
if trailing and not (
|
|
221
|
+
operator == "+-" and all(token == "0" for token in trailing)
|
|
222
|
+
):
|
|
223
|
+
raise FormulaSyntaxError(
|
|
224
|
+
f"Operator {operator!r} expects {expected} operands, "
|
|
225
|
+
f"received {len(parts) - 1}: {formula!r}"
|
|
226
|
+
)
|
|
227
|
+
# POI 5.4.1 carries three circular-arrow formulas with one inert
|
|
228
|
+
# trailing zero ("+- xH 0 dxB 0"). Apache POI ignores surplus tokens;
|
|
229
|
+
# accept only this harmless form while keeping all other arity errors.
|
|
230
|
+
operands = tuple(self.resolve(token) for token in parts[1 : expected + 1])
|
|
231
|
+
try:
|
|
232
|
+
result = _apply_operator(operator, operands)
|
|
233
|
+
except (OverflowError, ValueError) as exc:
|
|
234
|
+
raise FormulaEvaluationError(
|
|
235
|
+
f"Cannot evaluate DrawingML formula {formula!r}: {exc}"
|
|
236
|
+
) from exc
|
|
237
|
+
return _finite_number(result, f"result of {formula!r}")
|
|
238
|
+
|
|
239
|
+
def evaluate_value(self, value: str | int | float) -> float:
|
|
240
|
+
"""Evaluate a formula string, guide token, or numeric adjustment value."""
|
|
241
|
+
|
|
242
|
+
if isinstance(value, str):
|
|
243
|
+
parts = value.split()
|
|
244
|
+
if not parts:
|
|
245
|
+
raise FormulaSyntaxError("DrawingML value must not be empty")
|
|
246
|
+
if parts[0] in SUPPORTED_OPERATORS:
|
|
247
|
+
return self.evaluate(value)
|
|
248
|
+
if len(parts) == 1:
|
|
249
|
+
return self.resolve(parts[0])
|
|
250
|
+
raise FormulaSyntaxError(f"Invalid DrawingML value: {value!r}")
|
|
251
|
+
return _finite_number(value, "guide value")
|
|
252
|
+
|
|
253
|
+
def _resolve_dynamic_builtin(self, token: str) -> float | None:
|
|
254
|
+
dimension_match = _DIMENSION_GUIDE_RE.fullmatch(token)
|
|
255
|
+
if dimension_match:
|
|
256
|
+
family, divisor_text = dimension_match.groups()
|
|
257
|
+
divisor = int(divisor_text)
|
|
258
|
+
base_name = {"wd": "w", "hd": "h", "ssd": "ss"}[family]
|
|
259
|
+
return self._builtins[base_name] / divisor
|
|
260
|
+
|
|
261
|
+
angle_match = _ANGLE_GUIDE_RE.fullmatch(token)
|
|
262
|
+
if angle_match:
|
|
263
|
+
numerator_text, divisor_text = angle_match.groups()
|
|
264
|
+
numerator = int(numerator_text or "1")
|
|
265
|
+
divisor = int(divisor_text)
|
|
266
|
+
return FULL_CIRCLE * numerator / divisor
|
|
267
|
+
return None
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def evaluate_formula(
|
|
271
|
+
formula: str,
|
|
272
|
+
*,
|
|
273
|
+
width: float,
|
|
274
|
+
height: float,
|
|
275
|
+
left: float = 0.0,
|
|
276
|
+
top: float = 0.0,
|
|
277
|
+
values: Mapping[str, float] | None = None,
|
|
278
|
+
) -> float:
|
|
279
|
+
"""Evaluate one formula without manually constructing an evaluator."""
|
|
280
|
+
|
|
281
|
+
evaluator = FormulaEvaluator(
|
|
282
|
+
width,
|
|
283
|
+
height,
|
|
284
|
+
left=left,
|
|
285
|
+
top=top,
|
|
286
|
+
values=values,
|
|
287
|
+
)
|
|
288
|
+
return evaluator.evaluate(formula)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def _apply_operator(operator: str, values: tuple[float, ...]) -> float:
|
|
292
|
+
if operator == "val":
|
|
293
|
+
return values[0]
|
|
294
|
+
if operator == "*/":
|
|
295
|
+
return 0.0 if values[2] == 0 else values[0] * values[1] / values[2]
|
|
296
|
+
if operator == "+-":
|
|
297
|
+
return values[0] + values[1] - values[2]
|
|
298
|
+
if operator == "+/":
|
|
299
|
+
return 0.0 if values[2] == 0 else (values[0] + values[1]) / values[2]
|
|
300
|
+
if operator == "?:":
|
|
301
|
+
return values[1] if values[0] > 0 else values[2]
|
|
302
|
+
if operator == "abs":
|
|
303
|
+
return abs(values[0])
|
|
304
|
+
if operator == "at2":
|
|
305
|
+
return math.degrees(math.atan2(values[1], values[0])) * OOXML_DEGREE
|
|
306
|
+
if operator == "cat2":
|
|
307
|
+
return values[0] * math.cos(math.atan2(values[2], values[1]))
|
|
308
|
+
if operator == "cos":
|
|
309
|
+
return values[0] * math.cos(math.radians(values[1] / OOXML_DEGREE))
|
|
310
|
+
if operator == "max":
|
|
311
|
+
return max(values[0], values[1])
|
|
312
|
+
if operator == "min":
|
|
313
|
+
return min(values[0], values[1])
|
|
314
|
+
if operator == "mod":
|
|
315
|
+
return math.sqrt(sum(value * value for value in values))
|
|
316
|
+
if operator == "pin":
|
|
317
|
+
return max(values[0], min(values[1], values[2]))
|
|
318
|
+
if operator == "sat2":
|
|
319
|
+
return values[0] * math.sin(math.atan2(values[2], values[1]))
|
|
320
|
+
if operator == "sin":
|
|
321
|
+
return values[0] * math.sin(math.radians(values[1] / OOXML_DEGREE))
|
|
322
|
+
if operator == "sqrt":
|
|
323
|
+
return math.sqrt(values[0])
|
|
324
|
+
if operator == "tan":
|
|
325
|
+
return values[0] * math.tan(math.radians(values[1] / OOXML_DEGREE))
|
|
326
|
+
raise FormulaSyntaxError(f"Unsupported DrawingML formula operator: {operator!r}")
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def _finite_number(value: float, label: str) -> float:
|
|
330
|
+
try:
|
|
331
|
+
number = float(value)
|
|
332
|
+
except (TypeError, ValueError) as exc:
|
|
333
|
+
raise FormulaEvaluationError(f"{label} must be numeric") from exc
|
|
334
|
+
if not math.isfinite(number):
|
|
335
|
+
raise FormulaEvaluationError(f"{label} must be finite")
|
|
336
|
+
return number
|