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,190 @@
|
|
|
1
|
+
"""Validate native replacement fallback and release-route attributes."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from xml.etree import ElementTree as ET
|
|
6
|
+
|
|
7
|
+
from .marker_attributes import (
|
|
8
|
+
FALLBACK_KIND_ATTR,
|
|
9
|
+
IMPORT_SOURCE_ATTR,
|
|
10
|
+
LEGACY_FALLBACK_KIND_ATTR,
|
|
11
|
+
LEGACY_IMPORT_SOURCE_ATTR,
|
|
12
|
+
LEGACY_REPLACEMENT_STATUS_ATTR,
|
|
13
|
+
LEGACY_REPLACE_WITH_ATTR,
|
|
14
|
+
LEGACY_ROUTE_STATUS_ATTR,
|
|
15
|
+
REPLACEMENT_STATUS_ATTR,
|
|
16
|
+
REPLACE_WITH_ATTR,
|
|
17
|
+
NativeMarkerAttributeError,
|
|
18
|
+
native_fallback_kind,
|
|
19
|
+
native_import_source,
|
|
20
|
+
native_replacement_kind,
|
|
21
|
+
native_replacement_status,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
VISUAL_STATUSES = frozenset({"source-preview", "normalized", "placeholder"})
|
|
26
|
+
ROUTE_STATUSES = frozenset({"reconstruction-only"})
|
|
27
|
+
REPLACEMENT_KINDS = frozenset({"chart", "formula", "table"})
|
|
28
|
+
# Closed importer outputs from chart_to_svg, chartex_to_svg, and tbl_to_svg.
|
|
29
|
+
# This includes codes forwarded through their dynamic ``status`` parameters.
|
|
30
|
+
REPLACEMENT_STATUS_CODES = frozenset({
|
|
31
|
+
"unsupported-3d-chart",
|
|
32
|
+
"unsupported-chart-analysis-features",
|
|
33
|
+
"unsupported-chart-axis-number-format",
|
|
34
|
+
"unsupported-chart-axis-options",
|
|
35
|
+
"unsupported-chart-axis-titles",
|
|
36
|
+
"unsupported-chart-bar-options",
|
|
37
|
+
"unsupported-chart-bubble-options",
|
|
38
|
+
"unsupported-chart-cache",
|
|
39
|
+
"unsupported-chart-category-format",
|
|
40
|
+
"unsupported-chart-data-labels",
|
|
41
|
+
"unsupported-chart-data-table",
|
|
42
|
+
"unsupported-chart-doughnut-options",
|
|
43
|
+
"unsupported-chart-legend-position",
|
|
44
|
+
"unsupported-chart-line-style",
|
|
45
|
+
"unsupported-chart-of-pie-options",
|
|
46
|
+
"unsupported-chart-parse",
|
|
47
|
+
"unsupported-chart-part",
|
|
48
|
+
"unsupported-chart-pie-options",
|
|
49
|
+
"unsupported-chart-plot",
|
|
50
|
+
"unsupported-chart-point-labels",
|
|
51
|
+
"unsupported-chart-radar-style",
|
|
52
|
+
"unsupported-chart-reference",
|
|
53
|
+
"unsupported-chart-relationship",
|
|
54
|
+
"unsupported-chart-scatter-style",
|
|
55
|
+
"unsupported-chart-schema",
|
|
56
|
+
"unsupported-chart-series-data-labels",
|
|
57
|
+
"unsupported-chart-series-order",
|
|
58
|
+
"unsupported-chart-series-style",
|
|
59
|
+
"unsupported-chart-type",
|
|
60
|
+
"unsupported-chart-uri",
|
|
61
|
+
"unsupported-chartex-cache",
|
|
62
|
+
"unsupported-chartex-data-id",
|
|
63
|
+
"unsupported-chartex-dimension",
|
|
64
|
+
"unsupported-chartex-parse",
|
|
65
|
+
"unsupported-chartex-part",
|
|
66
|
+
"unsupported-chartex-schema",
|
|
67
|
+
"unsupported-chartex-series",
|
|
68
|
+
"unsupported-chartex-structure",
|
|
69
|
+
"unsupported-chartex-type",
|
|
70
|
+
"unsupported-combo-category-format",
|
|
71
|
+
"unsupported-combo-category-layout",
|
|
72
|
+
"unsupported-combo-chart",
|
|
73
|
+
"unsupported-combo-series-order",
|
|
74
|
+
"unsupported-date-axis",
|
|
75
|
+
"unsupported-date-system",
|
|
76
|
+
"unsupported-formatted-category-cache",
|
|
77
|
+
"unsupported-merge-topology",
|
|
78
|
+
"unsupported-native-transform",
|
|
79
|
+
"unsupported-stock-chart",
|
|
80
|
+
"unsupported-table-direct-formatting",
|
|
81
|
+
"unsupported-table-geometry",
|
|
82
|
+
"unsupported-table-size",
|
|
83
|
+
"unsupported-table-style",
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def native_marker_status_errors(elem: ET.Element) -> list[str]:
|
|
88
|
+
"""Return invalid or contradictory replacement status declarations."""
|
|
89
|
+
errors: list[str] = []
|
|
90
|
+
native_raw_values = {
|
|
91
|
+
REPLACE_WITH_ATTR: elem.get(REPLACE_WITH_ATTR),
|
|
92
|
+
LEGACY_REPLACE_WITH_ATTR: elem.get(LEGACY_REPLACE_WITH_ATTR),
|
|
93
|
+
}
|
|
94
|
+
fallback_status_raw_values = {
|
|
95
|
+
REPLACEMENT_STATUS_ATTR: elem.get(REPLACEMENT_STATUS_ATTR),
|
|
96
|
+
LEGACY_REPLACEMENT_STATUS_ATTR: elem.get(LEGACY_REPLACEMENT_STATUS_ATTR),
|
|
97
|
+
}
|
|
98
|
+
import_source_raw_values = {
|
|
99
|
+
IMPORT_SOURCE_ATTR: elem.get(IMPORT_SOURCE_ATTR),
|
|
100
|
+
LEGACY_IMPORT_SOURCE_ATTR: elem.get(LEGACY_IMPORT_SOURCE_ATTR),
|
|
101
|
+
}
|
|
102
|
+
visual_raw = elem.get(FALLBACK_KIND_ATTR)
|
|
103
|
+
legacy_visual_raw = elem.get(LEGACY_FALLBACK_KIND_ATTR)
|
|
104
|
+
route_raw = elem.get(LEGACY_ROUTE_STATUS_ATTR)
|
|
105
|
+
try:
|
|
106
|
+
visual = native_fallback_kind(elem)
|
|
107
|
+
native = native_replacement_kind(elem)
|
|
108
|
+
fallback = native_replacement_status(elem)
|
|
109
|
+
native_import_source(elem)
|
|
110
|
+
except NativeMarkerAttributeError as exc:
|
|
111
|
+
errors.append(str(exc))
|
|
112
|
+
return errors
|
|
113
|
+
|
|
114
|
+
route = route_raw.strip() if route_raw is not None else None
|
|
115
|
+
|
|
116
|
+
for attr, raw in (
|
|
117
|
+
*native_raw_values.items(),
|
|
118
|
+
*fallback_status_raw_values.items(),
|
|
119
|
+
*import_source_raw_values.items(),
|
|
120
|
+
):
|
|
121
|
+
if raw is not None and raw != raw.strip():
|
|
122
|
+
errors.append(f"{attr} must not contain surrounding whitespace")
|
|
123
|
+
canonical_kind_raw = native_raw_values[REPLACE_WITH_ATTR]
|
|
124
|
+
if (
|
|
125
|
+
canonical_kind_raw is not None
|
|
126
|
+
and canonical_kind_raw == canonical_kind_raw.strip()
|
|
127
|
+
and canonical_kind_raw != canonical_kind_raw.lower()
|
|
128
|
+
):
|
|
129
|
+
errors.append(
|
|
130
|
+
f"{REPLACE_WITH_ATTR} must use lowercase chart, formula, or table"
|
|
131
|
+
)
|
|
132
|
+
if visual_raw is not None and visual_raw != visual_raw.strip():
|
|
133
|
+
errors.append(f"{FALLBACK_KIND_ATTR} must not contain surrounding whitespace")
|
|
134
|
+
if legacy_visual_raw is not None and legacy_visual_raw != legacy_visual_raw.strip():
|
|
135
|
+
errors.append(
|
|
136
|
+
f"{LEGACY_FALLBACK_KIND_ATTR} must not contain surrounding whitespace"
|
|
137
|
+
)
|
|
138
|
+
if route_raw is not None and route_raw != route:
|
|
139
|
+
errors.append(f"{LEGACY_ROUTE_STATUS_ATTR} must not contain surrounding whitespace")
|
|
140
|
+
if visual is not None and visual not in VISUAL_STATUSES:
|
|
141
|
+
errors.append(f"unsupported {FALLBACK_KIND_ATTR} value: {visual!r}")
|
|
142
|
+
if route is not None and route not in ROUTE_STATUSES:
|
|
143
|
+
errors.append(f"unsupported {LEGACY_ROUTE_STATUS_ATTR} value: {route!r}")
|
|
144
|
+
if any(raw is not None for raw in native_raw_values.values()):
|
|
145
|
+
if native not in REPLACEMENT_KINDS:
|
|
146
|
+
errors.append(f"unsupported {REPLACE_WITH_ATTR} value: {native!r}")
|
|
147
|
+
if any(raw is not None for raw in fallback_status_raw_values.values()):
|
|
148
|
+
if not fallback:
|
|
149
|
+
errors.append(f"{REPLACEMENT_STATUS_ATTR} must not be empty")
|
|
150
|
+
elif fallback not in REPLACEMENT_STATUS_CODES:
|
|
151
|
+
errors.append(
|
|
152
|
+
f"unsupported {REPLACEMENT_STATUS_ATTR} value: {fallback!r}"
|
|
153
|
+
)
|
|
154
|
+
if any(raw is not None for raw in import_source_raw_values.values()):
|
|
155
|
+
source = native_import_source(elem)
|
|
156
|
+
if source != "pptx":
|
|
157
|
+
errors.append(f"unsupported {IMPORT_SOURCE_ATTR} value: {source!r}")
|
|
158
|
+
if (
|
|
159
|
+
visual_raw is None
|
|
160
|
+
and legacy_visual_raw is not None
|
|
161
|
+
and visual == "placeholder"
|
|
162
|
+
and route != "reconstruction-only"
|
|
163
|
+
):
|
|
164
|
+
errors.append(
|
|
165
|
+
f"{LEGACY_FALLBACK_KIND_ATTR}='placeholder' requires "
|
|
166
|
+
f"{LEGACY_ROUTE_STATUS_ATTR}='reconstruction-only'"
|
|
167
|
+
)
|
|
168
|
+
if route == "reconstruction-only" and visual != "placeholder":
|
|
169
|
+
errors.append(
|
|
170
|
+
f"{LEGACY_ROUTE_STATUS_ATTR}='reconstruction-only' requires "
|
|
171
|
+
f"{FALLBACK_KIND_ATTR}='placeholder'"
|
|
172
|
+
)
|
|
173
|
+
if native and fallback:
|
|
174
|
+
errors.append(
|
|
175
|
+
f"data-pptx-replace-with and {REPLACEMENT_STATUS_ATTR} are mutually exclusive"
|
|
176
|
+
)
|
|
177
|
+
return errors
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def native_marker_release_block_reason(elem: ET.Element) -> str | None:
|
|
181
|
+
"""Return invalid status metadata that must block an export.
|
|
182
|
+
|
|
183
|
+
A valid ``reconstruction-only`` declaration is diagnostic rather than a
|
|
184
|
+
release block: default export keeps its visible placeholder, while an
|
|
185
|
+
an active replacement marker may still reconstruct a native Chart/Table.
|
|
186
|
+
"""
|
|
187
|
+
errors = native_marker_status_errors(elem)
|
|
188
|
+
if errors:
|
|
189
|
+
return f"invalid-status: {errors[0]}"
|
|
190
|
+
return None
|