open-agreements 0.7.7 → 0.8.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/LICENSE +201 -21
- package/README.de.md +16 -29
- package/README.es.md +16 -29
- package/README.md +45 -54
- package/README.pt-br.md +16 -29
- package/README.template.md +19 -25
- package/README.zh.md +16 -29
- package/content/recipes/nvca-certificate-of-incorporation/fields/acquisition_exception_shares.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/adjustment_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/common_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/company_name.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/conversion_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_formula_alt.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_per_share.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_percent.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/effective_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/number_of_classes.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/original_issue_price.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/par_value.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_director_seats.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_designated_portion.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_outstanding_threshold.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/qualified_financing_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_interest_rate.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_start_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_address.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_name.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/series_designation.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/signature_page_marker.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/specify_percentage.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/strategic_partnership_exception_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/time_zone.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/total_authorized_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/template-manifest.json +77 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_date_month_day.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_year_two_digits.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/company_name.json +25 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/investor_counsel.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/minimum_shares_initial_closing.json +39 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/optional_plural_suffix.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/par_value_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/purchase_price_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/series_designation.json +159 -0
- package/content/recipes/nvca-stock-purchase-agreement/metadata.yaml +1 -1
- package/content/recipes/nvca-stock-purchase-agreement/template-manifest.json +24 -0
- package/content/templates/bonterms-mutual-nda/template.docx +0 -0
- package/content/templates/openagreements-board-consent-safe/.template.generated.json +0 -1
- package/content/templates/openagreements-employee-ip-inventions-assignment/.template.generated.json +9 -5
- package/content/templates/openagreements-employee-ip-inventions-assignment/README.md +2 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/metadata.yaml +8 -9
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.docx +0 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.md +3 -4
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/metadata.yaml +0 -9
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.docx +0 -0
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.json +0 -1
- package/content/templates/openagreements-employment-offer-letter/.template.generated.json +9 -5
- package/content/templates/openagreements-employment-offer-letter/README.md +17 -5
- package/content/templates/openagreements-employment-offer-letter/metadata.yaml +8 -9
- package/content/templates/openagreements-employment-offer-letter/template.docx +0 -0
- package/content/templates/openagreements-employment-offer-letter/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-florida/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-florida/README.md +2 -2
- package/content/templates/openagreements-restrictive-covenant-florida/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-florida/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-florida/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-wyoming/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-wyoming/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.md +3 -4
- package/content/templates/openagreements-stockholder-consent-safe/.template.generated.json +0 -1
- package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
- package/dist/core/checklist/format-checklist-docx.js +4 -1
- package/dist/core/checklist/format-checklist-docx.js.map +1 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/engine.js +2 -40
- package/dist/core/engine.js.map +1 -1
- package/dist/core/fill-pipeline.d.ts +0 -8
- package/dist/core/fill-pipeline.d.ts.map +1 -1
- package/dist/core/fill-pipeline.js +54 -30
- package/dist/core/fill-pipeline.js.map +1 -1
- package/dist/core/humanize-docx.d.ts.map +1 -1
- package/dist/core/humanize-docx.js +16 -6
- package/dist/core/humanize-docx.js.map +1 -1
- package/dist/core/recipe/bracket-normalizer.d.ts.map +1 -1
- package/dist/core/recipe/bracket-normalizer.js +3 -7
- package/dist/core/recipe/bracket-normalizer.js.map +1 -1
- package/dist/core/recipe/cleaner.js +5 -5
- package/dist/core/recipe/cleaner.js.map +1 -1
- package/dist/core/recipe/index.d.ts +1 -1
- package/dist/core/recipe/index.d.ts.map +1 -1
- package/dist/core/recipe/index.js +57 -4
- package/dist/core/recipe/index.js.map +1 -1
- package/dist/core/recipe/ooxml-parts.d.ts +11 -0
- package/dist/core/recipe/ooxml-parts.d.ts.map +1 -1
- package/dist/core/recipe/ooxml-parts.js +22 -0
- package/dist/core/recipe/ooxml-parts.js.map +1 -1
- package/dist/core/recipe/patcher.d.ts.map +1 -1
- package/dist/core/recipe/patcher.js +2 -5
- package/dist/core/recipe/patcher.js.map +1 -1
- package/dist/core/recipe/source-drift.d.ts +19 -0
- package/dist/core/recipe/source-drift.d.ts.map +1 -1
- package/dist/core/recipe/source-drift.js +32 -2
- package/dist/core/recipe/source-drift.js.map +1 -1
- package/dist/core/selector.d.ts.map +1 -1
- package/dist/core/selector.js +49 -4
- package/dist/core/selector.js.map +1 -1
- package/dist/core/selectors/index.d.ts +40 -0
- package/dist/core/selectors/index.d.ts.map +1 -0
- package/dist/core/selectors/index.js +64 -0
- package/dist/core/selectors/index.js.map +1 -0
- package/dist/core/selectors/loader.d.ts +16 -0
- package/dist/core/selectors/loader.d.ts.map +1 -0
- package/dist/core/selectors/loader.js +80 -0
- package/dist/core/selectors/loader.js.map +1 -0
- package/dist/core/selectors/manifest-schema.d.ts +123 -0
- package/dist/core/selectors/manifest-schema.d.ts.map +1 -0
- package/dist/core/selectors/manifest-schema.js +93 -0
- package/dist/core/selectors/manifest-schema.js.map +1 -0
- package/dist/core/selectors/patch.d.ts +24 -0
- package/dist/core/selectors/patch.d.ts.map +1 -0
- package/dist/core/selectors/patch.js +68 -0
- package/dist/core/selectors/patch.js.map +1 -0
- package/dist/core/selectors/postconditions.d.ts +24 -0
- package/dist/core/selectors/postconditions.d.ts.map +1 -0
- package/dist/core/selectors/postconditions.js +50 -0
- package/dist/core/selectors/postconditions.js.map +1 -0
- package/dist/core/selectors/resolve.d.ts +32 -0
- package/dist/core/selectors/resolve.d.ts.map +1 -0
- package/dist/core/selectors/resolve.js +36 -0
- package/dist/core/selectors/resolve.js.map +1 -0
- package/dist/core/unified-pipeline.d.ts +3 -1
- package/dist/core/unified-pipeline.d.ts.map +1 -1
- package/dist/core/unified-pipeline.js +19 -5
- package/dist/core/unified-pipeline.js.map +1 -1
- package/gemini-extension.json +1 -1
- package/node_modules/@usejunior/docx-core/LICENSE +202 -21
- package/node_modules/@usejunior/docx-core/NOTICE +2 -0
- package/node_modules/@usejunior/docx-core/README.md +2 -2
- package/node_modules/@usejunior/docx-core/dist/.tsbuildinfo +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +55 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.js +139 -14
- package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js +415 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +403 -113
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js +449 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts +74 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js +171 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts +88 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js +326 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts +85 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js +402 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts +39 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js +265 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts +62 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js +139 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts +198 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js +475 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +6 -290
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +23 -1828
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +36 -2
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +456 -224
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +199 -173
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +7 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +3 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts +3 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js +93 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts +197 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.js +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js +58 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts +42 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js +65 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js +116 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js +60 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts +28 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js +74 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts +23 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js +57 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js +102 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js +121 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js +157 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js +71 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js +117 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js +68 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js +82 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts +26 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js +209 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts +21 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js +151 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts +46 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js +119 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts +87 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js +232 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js +318 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts +4 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js +18 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts +266 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js +363 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/index.d.ts +9 -150
- package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/index.js +14 -0
- package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js +84 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts +49 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js +290 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts +134 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js +298 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +163 -77
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +12 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +374 -97
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +94 -15
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js +377 -234
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts +18 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js +160 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts +45 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js +247 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js +104 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js +199 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +50 -101
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +287 -326
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +9 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +10 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +232 -44
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +22 -11
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +45 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts +76 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js +223 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +32 -10
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts +38 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +53 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +59 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +6 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +187 -91
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js +39 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +23 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js +395 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js +300 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js +154 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +33 -22
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +13 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +2 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js +116 -12
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts +148 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js +291 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts +14 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js +166 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/package.json +13 -9
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +186 -70
- package/node_modules/@xmldom/xmldom/index.d.ts +144 -19
- package/node_modules/@xmldom/xmldom/lib/dom.js +705 -343
- package/node_modules/@xmldom/xmldom/lib/grammar.js +14 -0
- package/node_modules/@xmldom/xmldom/package.json +13 -10
- package/package.json +7 -7
- package/server.json +3 -3
- package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/SKILL.md +2 -2
- package/skills/{nda → agreements/cloud-service-agreement}/template-filling-execution.md +2 -2
- package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/SKILL.md +15 -4
- package/skills/{safe → agreements/data-privacy-agreement}/template-filling-execution.md +12 -6
- package/skills/{employment-contract → agreements/employment-contract}/SKILL.md +3 -3
- package/skills/{cloud-service-agreement → agreements/employment-contract}/template-filling-execution.md +12 -6
- package/skills/{nda → agreements/nda}/SKILL.md +2 -2
- package/skills/{open-agreements → agreements/nda}/template-filling-execution.md +12 -6
- package/skills/{open-agreements → agreements/open-agreements}/SKILL.md +13 -30
- package/skills/agreements/open-agreements/template-filling-execution.md +98 -0
- package/skills/{safe → agreements/safe}/SKILL.md +2 -2
- package/skills/agreements/safe/template-filling-execution.md +98 -0
- package/skills/{services-agreement → agreements/services-agreement}/SKILL.md +3 -3
- package/skills/agreements/services-agreement/template-filling-execution.md +98 -0
- package/skills/{venture-financing → agreements/venture-financing}/SKILL.md +3 -3
- package/skills/agreements/venture-financing/template-filling-execution.md +98 -0
- package/skills/{client-email → client-workflows/client-email}/SKILL.md +1 -1
- package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/SKILL.md +1 -1
- package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/SKILL.md +1 -1
- package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/SKILL.md +1 -1
- package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/SKILL.md +1 -1
- package/skills/{soc2-readiness → compliance/soc2-readiness}/SKILL.md +1 -1
- package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/SKILL.md +2 -3
- package/skills/{recipe-quality-audit → internal/recipe-quality-audit}/SKILL.md +2 -1
- package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/SKILL.md +2 -0
- package/skills/legal-explainers/data-privacy-law-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/LICENSE +269 -0
- package/skills/legal-explainers/data-privacy-law-explainer/NOTICE +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/SKILL.md +113 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alabama.md +211 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alaska.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arizona.md +181 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arkansas.md +219 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/california.md +107 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/colorado.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/connecticut.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/delaware.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/district-of-columbia.md +153 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/florida.md +234 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/georgia.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/hawaii.md +167 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/idaho.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/illinois.md +238 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/indiana.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/iowa.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kansas.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kentucky.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/louisiana.md +209 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maine.md +163 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maryland.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/massachusetts.md +260 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/michigan.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/minnesota.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/mississippi.md +132 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/missouri.md +179 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/montana.md +105 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nebraska.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nevada.md +212 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-hampshire.md +91 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-jersey.md +95 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-mexico.md +174 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-york.md +195 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-carolina.md +205 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-dakota.md +169 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/ohio.md +171 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oklahoma.md +168 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oregon.md +103 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/pennsylvania.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/rhode-island.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-carolina.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-dakota.md +176 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/tennessee.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/texas.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/utah.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/vermont.md +267 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/virginia.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/washington.md +247 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/west-virginia.md +141 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wisconsin.md +156 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wyoming.md +185 -0
- package/skills/legal-explainers/data-privacy-law-explainer/manifest.json +519 -0
- package/skills/legal-explainers/non-compete-contract-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/non-compete-contract-explainer/LICENSE +269 -0
- package/skills/legal-explainers/non-compete-contract-explainer/NOTICE +7 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/SKILL.md +1 -1
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alabama.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alaska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/american-samoa.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arizona.md +6 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arkansas.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/au.md +208 -0
- package/skills/legal-explainers/non-compete-contract-explainer/content/australian-capital-territory.md +220 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/california.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/cnmi.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/colorado.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/connecticut.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/delaware.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/district-of-columbia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/florida.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/georgia.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/guam.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/hawaii.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/idaho.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/illinois.md +5 -5
- package/skills/{non-compete-contract-explainer/content/india.md → legal-explainers/non-compete-contract-explainer/content/in.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/indiana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/iowa.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kansas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kentucky.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/louisiana.md +9 -9
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maine.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maryland.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/massachusetts.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/michigan.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/minnesota.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/mississippi.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/missouri.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/montana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nebraska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nevada.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-hampshire.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-jersey.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-mexico.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/new-south-wales.md +218 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-york.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/northern-territory.md +214 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/ohio.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oklahoma.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oregon.md +12 -12
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/pennsylvania.md +5 -5
- package/skills/{non-compete-contract-explainer/content/philippines.md → legal-explainers/non-compete-contract-explainer/content/ph.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/puerto-rico.md +4 -4
- package/skills/legal-explainers/non-compete-contract-explainer/content/queensland.md +206 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/rhode-island.md +5 -5
- package/skills/{non-compete-contract-explainer/content/singapore.md → legal-explainers/non-compete-contract-explainer/content/sg.md} +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/south-australia.md +236 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/tasmania.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/tennessee.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/texas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/utah.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/vermont.md +29 -11
- package/skills/legal-explainers/non-compete-contract-explainer/content/victoria.md +218 -0
- package/skills/{non-compete-contract-explainer/content/us-virgin-islands.md → legal-explainers/non-compete-contract-explainer/content/virgin-islands.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/virginia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/washington.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/west-virginia.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/western-australia.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wisconsin.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wyoming.md +19 -15
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/manifest.json +225 -76
- package/content/templates/bonterms-mutual-nda/signing.yaml +0 -35
- package/dist/core/signing-config.d.ts +0 -46
- package/dist/core/signing-config.d.ts.map +0 -1
- package/dist/core/signing-config.js +0 -67
- package/dist/core/signing-config.js.map +0 -1
- package/skills/services-agreement/template-filling-execution.md +0 -81
- package/skills/shared/template-filling-execution.md +0 -92
- /package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/CONNECTORS.md +0 -0
- /package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/CONNECTORS.md +0 -0
- /package/skills/{employment-contract → agreements/employment-contract}/CONNECTORS.md +0 -0
- /package/skills/{nda → agreements/nda}/CONNECTORS.md +0 -0
- /package/skills/{open-agreements → agreements/open-agreements}/CONNECTORS.md +0 -0
- /package/skills/{safe → agreements/safe}/CONNECTORS.md +0 -0
- /package/skills/{services-agreement → agreements/services-agreement}/CONNECTORS.md +0 -0
- /package/skills/{venture-financing → agreements/venture-financing}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/ecorp-portal-playwright-notes.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/faq.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/filing-instructions.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/tax-calculation.md +0 -0
- /package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/api-exports.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/evidence-types.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/screenshot-guide.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/access-control.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/business-continuity.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/change-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/encryption.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/incident-response.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/isms-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/logging-monitoring.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/people-controls.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/supplier-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/CONNECTORS.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/change-vendor-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/communication-info.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-environment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/logical-access.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/monitoring-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/optional-categories.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/privacy-criteria.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/risk-assessment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/system-operations.md +0 -0
- /package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/CONNECTORS.md +0 -0
- /package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/references/allure-test-spec-writing-guide.md +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
// DOCX → Markdown serializer.
|
|
2
|
+
//
|
|
3
|
+
// This is a *serializer over the existing structured document model* — it does no OOXML
|
|
4
|
+
// parsing. `DocxDocument.buildDocumentView({ showFormatting: true })` already yields a
|
|
5
|
+
// `DocumentViewNode[]` carrying headings, list metadata, grid-aware table context, injected
|
|
6
|
+
// `[^n]` footnote markers, and an HTML-shaped inline-tag string (`tagged_text`). This module
|
|
7
|
+
// turns that model into GitHub-Flavored Markdown.
|
|
8
|
+
//
|
|
9
|
+
// Markdown is intentionally *lossy*: there is no round-trip guarantee. Constructs without a
|
|
10
|
+
// Markdown equivalent (highlighting, font runs, merged/nested table cells, layout) are
|
|
11
|
+
// downgraded as documented below rather than preserved.
|
|
12
|
+
//
|
|
13
|
+
// The inline tokenizer (`inlineTagsToMarkdown`) is the reusable core; the planned HTML
|
|
14
|
+
// emitter (#304) renders the same tokens, so neither serializer reasons about the tag
|
|
15
|
+
// grammar independently and drifts from the emitter in `formatting_tags.ts`.
|
|
16
|
+
import { tokenizeToonInline } from './document_view.js';
|
|
17
|
+
import { LabelType } from './list_labels.js';
|
|
18
|
+
/** Footnote markers already injected into `tagged_text`, e.g. `[^1]`, `[^12]`. */
|
|
19
|
+
const FOOTNOTE_MARKER_RE = /\[\^\d+\]/g;
|
|
20
|
+
/**
|
|
21
|
+
* Backslash-escape the inline Markdown-significant characters that would otherwise be
|
|
22
|
+
* interpreted mid-line. GFM honours backslash escapes for ASCII punctuation, so `\*`
|
|
23
|
+
* renders a literal `*`. We escape only the characters that trigger *inline* constructs
|
|
24
|
+
* (emphasis, code, links, raw HTML, table pipes); block-level triggers (`#`, `-`, `>`, …)
|
|
25
|
+
* are handled per-line by {@link escapeLeadingBlockSyntax} so we don't litter prose with
|
|
26
|
+
* `\.` and `\-` on every sentence.
|
|
27
|
+
*
|
|
28
|
+
* Already-present `[^n]` footnote markers are protected: escaping their `[`/`]`/`^` would
|
|
29
|
+
* sever them from the appended `[^n]: …` definitions.
|
|
30
|
+
*/
|
|
31
|
+
function escapeInlineText(text) {
|
|
32
|
+
const escapeSpan = (s) => s.replace(/[\\`*_[\]<|]/g, (c) => `\\${c}`);
|
|
33
|
+
let out = '';
|
|
34
|
+
let lastIndex = 0;
|
|
35
|
+
for (const match of text.matchAll(FOOTNOTE_MARKER_RE)) {
|
|
36
|
+
const idx = match.index ?? 0;
|
|
37
|
+
out += escapeSpan(text.slice(lastIndex, idx));
|
|
38
|
+
out += match[0]; // leave the footnote marker untouched
|
|
39
|
+
lastIndex = idx + match[0].length;
|
|
40
|
+
}
|
|
41
|
+
out += escapeSpan(text.slice(lastIndex));
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Escape a leading block-level trigger so a normal paragraph whose visible text begins with
|
|
46
|
+
* `#`, `>`, `-`, `+`, `* `, or `N.`/`N)` is not mis-read as a heading, quote, or list.
|
|
47
|
+
* Block triggers always require a trailing space, whereas the emphasis we emit (`**`, `*`)
|
|
48
|
+
* never does — so matching the space-terminated forms cannot corrupt generated Markdown.
|
|
49
|
+
*/
|
|
50
|
+
function escapeLeadingBlockSyntax(line) {
|
|
51
|
+
return line.replace(/^(\s*)(#{1,6}(?= )|>(?= )|[-+*](?= )|\d+[.)](?= ))/, (_m, ws, trig) => {
|
|
52
|
+
if (/^\d/.test(trig)) {
|
|
53
|
+
// ordered-list trigger: escape the delimiter (the `.` or `)`), keep the digits
|
|
54
|
+
return `${ws}${trig.slice(0, -1)}\\${trig.slice(-1)}`;
|
|
55
|
+
}
|
|
56
|
+
return `${ws}\\${trig[0]}${trig.slice(1)}`;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export function inlineTagsToMarkdown(text) {
|
|
60
|
+
const ops = [];
|
|
61
|
+
const linkUrls = []; // stack of open <a> hrefs (links don't nest meaningfully)
|
|
62
|
+
for (const token of tokenizeToonInline(text)) {
|
|
63
|
+
if (token.kind === 'text') {
|
|
64
|
+
ops.push({ t: 'md', v: escapeInlineText(token.value) });
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const tag = token.value;
|
|
68
|
+
if (tag === '<b>')
|
|
69
|
+
ops.push({ t: 'emph', kind: 'b', dir: 1 });
|
|
70
|
+
else if (tag === '</b>')
|
|
71
|
+
ops.push({ t: 'emph', kind: 'b', dir: -1 });
|
|
72
|
+
else if (tag === '<i>')
|
|
73
|
+
ops.push({ t: 'emph', kind: 'i', dir: 1 });
|
|
74
|
+
else if (tag === '</i>')
|
|
75
|
+
ops.push({ t: 'emph', kind: 'i', dir: -1 });
|
|
76
|
+
else if (tag === '<u>' || tag === '</u>')
|
|
77
|
+
ops.push({ t: 'md', v: tag }); // raw HTML passthrough
|
|
78
|
+
else if (tag.startsWith('<a ')) {
|
|
79
|
+
linkUrls.push(/href="([^"]*)"/.exec(tag)?.[1] ?? '');
|
|
80
|
+
ops.push({ t: 'md', v: '[' });
|
|
81
|
+
}
|
|
82
|
+
else if (tag === '</a>') {
|
|
83
|
+
ops.push({ t: 'md', v: `](${linkUrls.pop() ?? ''})` });
|
|
84
|
+
}
|
|
85
|
+
// <highlight>, </highlight>, <font …>, </font> → strip (emit nothing, keep inner text)
|
|
86
|
+
}
|
|
87
|
+
// Defensive: an unbalanced <a> (no closing tag) would leave a dangling "["; close it.
|
|
88
|
+
while (linkUrls.length > 0) {
|
|
89
|
+
ops.push({ t: 'md', v: `](${linkUrls.pop()})` });
|
|
90
|
+
}
|
|
91
|
+
// Emit emphasis delimiters only where the *active* emphasis state actually changes
|
|
92
|
+
// between two text spans. Word splits a single formatted phrase into many runs, so
|
|
93
|
+
// `tagged_text` carries boundary noise: `</b></i><b><i>` (state unchanged across the
|
|
94
|
+
// boundary), interleaved different-kind toggles `</b></i><i><b>`, or empty `<b></b>`
|
|
95
|
+
// pairs. Mapping each toggle naively yields runs like `******` / `****` that render as
|
|
96
|
+
// literal asterisks. Tracking the state and reconciling on a stack collapses all of that
|
|
97
|
+
// to the minimal delimiters while keeping nesting well-formed (`**a*b*c**`).
|
|
98
|
+
const DELIM = { b: '**', i: '*' };
|
|
99
|
+
let out = '';
|
|
100
|
+
const activeStack = []; // emphasis kinds currently open, in open order
|
|
101
|
+
const desired = new Set(); // running target state as we scan emph ops
|
|
102
|
+
const reconcile = () => {
|
|
103
|
+
// Close from the top until every still-open kind is wanted, remembering any wanted
|
|
104
|
+
// kinds we had to close (because they sat above an unwanted one) so we can reopen them.
|
|
105
|
+
const reopen = [];
|
|
106
|
+
while (activeStack.length > 0 && !activeStack.every((k) => desired.has(k))) {
|
|
107
|
+
const k = activeStack.pop();
|
|
108
|
+
out += DELIM[k];
|
|
109
|
+
if (desired.has(k))
|
|
110
|
+
reopen.push(k);
|
|
111
|
+
}
|
|
112
|
+
// Open the kinds that are wanted but not currently open: the reopened ones first (in
|
|
113
|
+
// their original open order), then any brand-new kinds in a stable order (b before i).
|
|
114
|
+
const active = new Set(activeStack);
|
|
115
|
+
const toOpen = [...reopen.reverse(), ...['b', 'i'].filter((k) => desired.has(k))];
|
|
116
|
+
for (const k of toOpen) {
|
|
117
|
+
if (active.has(k))
|
|
118
|
+
continue;
|
|
119
|
+
active.add(k);
|
|
120
|
+
activeStack.push(k);
|
|
121
|
+
out += DELIM[k];
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
for (const op of ops) {
|
|
125
|
+
if (op.t === 'emph') {
|
|
126
|
+
if (op.dir === 1)
|
|
127
|
+
desired.add(op.kind);
|
|
128
|
+
else
|
|
129
|
+
desired.delete(op.kind);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
reconcile(); // realize pending state changes before emitting literal text/Markdown
|
|
133
|
+
out += op.v;
|
|
134
|
+
}
|
|
135
|
+
desired.clear();
|
|
136
|
+
reconcile(); // close any still-open emphasis at end of string
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
/** A heading is structural (gets `#`) only when Word's style told us so and gave a level. */
|
|
140
|
+
function isStructuralHeading(node) {
|
|
141
|
+
return node.heading?.source === 'word_style' && typeof node.heading.level === 'number';
|
|
142
|
+
}
|
|
143
|
+
function renderListItem(node) {
|
|
144
|
+
const lm = node.list_metadata;
|
|
145
|
+
const level = Math.max(0, lm.list_level);
|
|
146
|
+
const indent = ' '.repeat(level);
|
|
147
|
+
const text = inlineTagsToMarkdown(node.tagged_text).trim();
|
|
148
|
+
const label = lm.label_string?.trim() ?? '';
|
|
149
|
+
// True auto-numbered numeric lists render as a Markdown ordered list (let the renderer
|
|
150
|
+
// number them). Everything else preserves the *literal* label — legal documents carry
|
|
151
|
+
// meaningful labels like `Section 2.1`, `Article IV`, `(a)`, `(i)` that a bare `1.` would
|
|
152
|
+
// silently destroy.
|
|
153
|
+
if (lm.label_type === LabelType.NUMBER && lm.is_auto_numbered) {
|
|
154
|
+
return `${indent}1. ${text}`.trimEnd();
|
|
155
|
+
}
|
|
156
|
+
if (label) {
|
|
157
|
+
return `${indent}- ${label} ${text}`.trimEnd();
|
|
158
|
+
}
|
|
159
|
+
return `${indent}- ${text}`.trimEnd();
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Render a run of nodes that share a `table_context.table_id` as a GFM table.
|
|
163
|
+
*
|
|
164
|
+
* Lossy by design (GFM has no merged/nested-cell support):
|
|
165
|
+
* - Horizontally merged cells (`gridSpan`) advance `col_index`, leaving grid gaps that we
|
|
166
|
+
* fill with empty cells so the column count stays consistent and viewers don't break.
|
|
167
|
+
* - Vertically merged cells (`vMerge`) and nested tables are flattened into the body-level
|
|
168
|
+
* grid; multi-paragraph cells are joined with `<br>`.
|
|
169
|
+
*/
|
|
170
|
+
function renderTable(group) {
|
|
171
|
+
let totalCols = 0;
|
|
172
|
+
for (const n of group) {
|
|
173
|
+
const tc = n.table_context;
|
|
174
|
+
if (!tc)
|
|
175
|
+
continue;
|
|
176
|
+
totalCols = Math.max(totalCols, tc.total_cols, tc.col_index + 1);
|
|
177
|
+
}
|
|
178
|
+
if (totalCols <= 0)
|
|
179
|
+
return [];
|
|
180
|
+
const rows = new Map();
|
|
181
|
+
const rowOrder = [];
|
|
182
|
+
const headerRows = new Set();
|
|
183
|
+
for (const n of group) {
|
|
184
|
+
const tc = n.table_context;
|
|
185
|
+
if (!tc)
|
|
186
|
+
continue;
|
|
187
|
+
if (!rows.has(tc.row_index)) {
|
|
188
|
+
rows.set(tc.row_index, new Map());
|
|
189
|
+
rowOrder.push(tc.row_index);
|
|
190
|
+
}
|
|
191
|
+
const cellMap = rows.get(tc.row_index);
|
|
192
|
+
// A raw newline inside a cell (from a line break) would split the GFM table row and
|
|
193
|
+
// break the whole table, so collapse intra-cell newlines to `<br>`.
|
|
194
|
+
const cellText = inlineTagsToMarkdown(n.tagged_text).replace(/\s*\n+\s*/g, '<br>').trim();
|
|
195
|
+
const parts = cellMap.get(tc.col_index) ?? [];
|
|
196
|
+
if (cellText)
|
|
197
|
+
parts.push(cellText);
|
|
198
|
+
cellMap.set(tc.col_index, parts);
|
|
199
|
+
if (tc.is_header_row)
|
|
200
|
+
headerRows.add(tc.row_index);
|
|
201
|
+
}
|
|
202
|
+
rowOrder.sort((a, b) => a - b);
|
|
203
|
+
if (rowOrder.length === 0)
|
|
204
|
+
return [];
|
|
205
|
+
const cellsFor = (rowIndex) => {
|
|
206
|
+
const cellMap = rows.get(rowIndex) ?? new Map();
|
|
207
|
+
const cells = [];
|
|
208
|
+
for (let c = 0; c < totalCols; c++) {
|
|
209
|
+
cells.push((cellMap.get(c) ?? []).join('<br>'));
|
|
210
|
+
}
|
|
211
|
+
return cells;
|
|
212
|
+
};
|
|
213
|
+
// GFM requires exactly one header row. Prefer the first row Word flagged as a header;
|
|
214
|
+
// otherwise treat the first row as the header (the common case).
|
|
215
|
+
const headerRowIndex = rowOrder.find((ri) => headerRows.has(ri)) ?? rowOrder[0];
|
|
216
|
+
const lines = [];
|
|
217
|
+
lines.push(`| ${cellsFor(headerRowIndex).join(' | ')} |`);
|
|
218
|
+
lines.push(`| ${Array.from({ length: totalCols }, () => '---').join(' | ')} |`);
|
|
219
|
+
for (const ri of rowOrder) {
|
|
220
|
+
if (ri === headerRowIndex)
|
|
221
|
+
continue;
|
|
222
|
+
lines.push(`| ${cellsFor(ri).join(' | ')} |`);
|
|
223
|
+
}
|
|
224
|
+
return lines;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Serialize a structured document view to GitHub-Flavored Markdown.
|
|
228
|
+
*
|
|
229
|
+
* @param nodes Block nodes from `buildDocumentView({ showFormatting: true }).nodes`.
|
|
230
|
+
* @param footnotes Footnotes from `DocxDocument.getFootnotes()` (already sorted by
|
|
231
|
+
* `displayNumber`); appended as `[^n]: …` definitions.
|
|
232
|
+
*/
|
|
233
|
+
export function serializeToMarkdown(nodes, footnotes = [], _opts = {}) {
|
|
234
|
+
const blocks = [];
|
|
235
|
+
let inList = false;
|
|
236
|
+
const closeList = () => {
|
|
237
|
+
if (inList) {
|
|
238
|
+
blocks.push('');
|
|
239
|
+
inList = false;
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
243
|
+
const node = nodes[i];
|
|
244
|
+
// ── Tables: consume the whole run of same-table_id nodes at once ──
|
|
245
|
+
if (node.table_context) {
|
|
246
|
+
closeList();
|
|
247
|
+
const tableId = node.table_context.table_id;
|
|
248
|
+
const group = [];
|
|
249
|
+
while (i < nodes.length && nodes[i].table_context?.table_id === tableId) {
|
|
250
|
+
group.push(nodes[i]);
|
|
251
|
+
i++;
|
|
252
|
+
}
|
|
253
|
+
i--; // for-loop will re-increment
|
|
254
|
+
const tableLines = renderTable(group);
|
|
255
|
+
if (tableLines.length > 0) {
|
|
256
|
+
blocks.push(tableLines.join('\n'));
|
|
257
|
+
blocks.push('');
|
|
258
|
+
}
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
// ── Structural (Word-styled) headings ──
|
|
262
|
+
if (isStructuralHeading(node)) {
|
|
263
|
+
closeList();
|
|
264
|
+
const level = Math.min(6, Math.max(1, node.heading.level));
|
|
265
|
+
const text = inlineTagsToMarkdown(node.tagged_text).trim();
|
|
266
|
+
blocks.push(`${'#'.repeat(level)} ${text}`.trimEnd());
|
|
267
|
+
blocks.push('');
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
// ── List items ──
|
|
271
|
+
if (node.list_metadata.list_level >= 0) {
|
|
272
|
+
inList = true;
|
|
273
|
+
blocks.push(renderListItem(node));
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
// ── Normal paragraphs (heuristic headings land here: their run-in bold already lives
|
|
277
|
+
// in the inline tags, so we keep them as paragraphs rather than inventing a `#`). ──
|
|
278
|
+
closeList();
|
|
279
|
+
const text = escapeLeadingBlockSyntax(inlineTagsToMarkdown(node.tagged_text));
|
|
280
|
+
if (text.trim() === '') {
|
|
281
|
+
blocks.push('');
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
blocks.push(text);
|
|
285
|
+
blocks.push('');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
closeList();
|
|
289
|
+
// ── Footnote definitions ──
|
|
290
|
+
const defs = footnotes.filter((fn) => fn.displayNumber > 0);
|
|
291
|
+
if (defs.length > 0) {
|
|
292
|
+
blocks.push('');
|
|
293
|
+
for (const fn of defs) {
|
|
294
|
+
const body = escapeInlineText(fn.text.replace(/\s+/g, ' ').trim());
|
|
295
|
+
blocks.push(`[^${fn.displayNumber}]: ${body}`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return `${blocks.join('\n').replace(/\n{3,}/g, '\n\n').trim()}\n`;
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=serialize_markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize_markdown.js","sourceRoot":"","sources":["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CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DocumentViewNode } from './document_view.js';
|
|
2
|
+
import type { Footnote } from './footnotes.js';
|
|
3
|
+
export interface SerializePlainTextOptions {
|
|
4
|
+
/** Reserved for future knobs (footnote policy, table layout). Currently unused. */
|
|
5
|
+
readonly _reserved?: never;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Serialize a structured document view to plain text.
|
|
9
|
+
*
|
|
10
|
+
* @param nodes Block nodes from `buildDocumentView({ showFormatting: true }).nodes`.
|
|
11
|
+
* @param footnotes Footnotes from `DocxDocument.getFootnotes()` (already sorted by
|
|
12
|
+
* `displayNumber`); appended as `[^n] …` definitions.
|
|
13
|
+
*/
|
|
14
|
+
export declare function serializeToPlainText(nodes: DocumentViewNode[], footnotes?: Footnote[], _opts?: SerializePlainTextOptions): string;
|
|
15
|
+
//# sourceMappingURL=serialize_plaintext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize_plaintext.d.ts","sourceRoot":"","sources":["../../src/primitives/serialize_plaintext.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA2E/C,MAAM,WAAW,yBAAyB;IACxC,mFAAmF;IACnF,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,gBAAgB,EAAE,EACzB,SAAS,GAAE,QAAQ,EAAO,EAC1B,KAAK,GAAE,yBAA8B,GACpC,MAAM,CA4DR"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// DOCX → plain text serializer.
|
|
2
|
+
//
|
|
3
|
+
// The thinnest member of the export family. Like `serialize_markdown.ts`, this is a
|
|
4
|
+
// *serializer over the existing structured document model* — it does no OOXML parsing.
|
|
5
|
+
// `DocxDocument.buildDocumentView({ showFormatting: true })` already yields a
|
|
6
|
+
// `DocumentViewNode[]` carrying headings, list metadata, grid-aware table context, injected
|
|
7
|
+
// `[^n]` footnote markers, and an HTML-shaped inline-tag string (`tagged_text`). This module
|
|
8
|
+
// turns that model into plain text with no markup.
|
|
9
|
+
//
|
|
10
|
+
// Where the Markdown emitter *maps* inline tags to Markdown syntax, the plain-text emitter
|
|
11
|
+
// *strips* them (via `stripAllInlineTags`) and keeps only sensible block separators:
|
|
12
|
+
// - a blank line between block-level paragraphs (including headings),
|
|
13
|
+
// - simple `- ` list bullets (preserving literal legal labels like `Section 2.1`),
|
|
14
|
+
// - tab-separated table cells, one row per line,
|
|
15
|
+
// - injected `[^n]` footnote markers kept inline, definitions appended at the end.
|
|
16
|
+
//
|
|
17
|
+
// Plain text is intentionally *lossy*: all formatting (bold/italic/underline, highlight,
|
|
18
|
+
// fonts, links, merged/nested table cells, layout) is discarded — that is the whole point of
|
|
19
|
+
// a "just give me the text" rendering.
|
|
20
|
+
import { stripAllInlineTags } from './semantic_tags.js';
|
|
21
|
+
/** Convert one `tagged_text` value to plain text: strip all inline/semantic tags, keep text. */
|
|
22
|
+
function toPlainInline(text) {
|
|
23
|
+
return stripAllInlineTags(text);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Render a list item as a simple bullet. Auto-numbered numeric items and unlabeled items get
|
|
27
|
+
* a bare `- ` bullet; items carrying a literal label (legal documents use meaningful labels
|
|
28
|
+
* like `Section 2.1`, `Article IV`, `(a)`, `(i)`) keep that label so it isn't silently lost.
|
|
29
|
+
* Indentation tracks the list level.
|
|
30
|
+
*/
|
|
31
|
+
function renderListItem(node) {
|
|
32
|
+
const lm = node.list_metadata;
|
|
33
|
+
const level = Math.max(0, lm.list_level);
|
|
34
|
+
const indent = ' '.repeat(level);
|
|
35
|
+
const text = toPlainInline(node.tagged_text).trim();
|
|
36
|
+
const label = lm.label_string?.trim() ?? '';
|
|
37
|
+
if (label) {
|
|
38
|
+
return `${indent}- ${label} ${text}`.trimEnd();
|
|
39
|
+
}
|
|
40
|
+
return `${indent}- ${text}`.trimEnd();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Render a run of nodes sharing a `table_context.table_id` as tab-separated rows.
|
|
44
|
+
*
|
|
45
|
+
* Lossy by design (plain text has no table model):
|
|
46
|
+
* - Horizontally merged cells (`gridSpan`) leave grid gaps; we fill them with empty fields so
|
|
47
|
+
* every row keeps the same tab-delimited column count (a row `X<gap>Z` → `X\t\tZ`).
|
|
48
|
+
* - Vertically merged cells (`vMerge`) and nested tables are flattened into the body grid.
|
|
49
|
+
* - Multi-paragraph / multi-node cells and intra-cell line breaks are joined with a space
|
|
50
|
+
* (a raw newline would split the tab-delimited row).
|
|
51
|
+
*/
|
|
52
|
+
function renderTable(group) {
|
|
53
|
+
let totalCols = 0;
|
|
54
|
+
for (const n of group) {
|
|
55
|
+
const tc = n.table_context;
|
|
56
|
+
if (!tc)
|
|
57
|
+
continue;
|
|
58
|
+
totalCols = Math.max(totalCols, tc.total_cols, tc.col_index + 1);
|
|
59
|
+
}
|
|
60
|
+
if (totalCols <= 0)
|
|
61
|
+
return [];
|
|
62
|
+
const rows = new Map();
|
|
63
|
+
const rowOrder = [];
|
|
64
|
+
for (const n of group) {
|
|
65
|
+
const tc = n.table_context;
|
|
66
|
+
if (!tc)
|
|
67
|
+
continue;
|
|
68
|
+
if (!rows.has(tc.row_index)) {
|
|
69
|
+
rows.set(tc.row_index, new Map());
|
|
70
|
+
rowOrder.push(tc.row_index);
|
|
71
|
+
}
|
|
72
|
+
const cellMap = rows.get(tc.row_index);
|
|
73
|
+
const cellText = toPlainInline(n.tagged_text).replace(/\s*\n+\s*/g, ' ').trim();
|
|
74
|
+
const parts = cellMap.get(tc.col_index) ?? [];
|
|
75
|
+
if (cellText)
|
|
76
|
+
parts.push(cellText);
|
|
77
|
+
cellMap.set(tc.col_index, parts);
|
|
78
|
+
}
|
|
79
|
+
rowOrder.sort((a, b) => a - b);
|
|
80
|
+
const lines = [];
|
|
81
|
+
for (const ri of rowOrder) {
|
|
82
|
+
const cellMap = rows.get(ri) ?? new Map();
|
|
83
|
+
const cells = [];
|
|
84
|
+
for (let c = 0; c < totalCols; c++) {
|
|
85
|
+
cells.push((cellMap.get(c) ?? []).join(' '));
|
|
86
|
+
}
|
|
87
|
+
lines.push(cells.join('\t'));
|
|
88
|
+
}
|
|
89
|
+
return lines;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Serialize a structured document view to plain text.
|
|
93
|
+
*
|
|
94
|
+
* @param nodes Block nodes from `buildDocumentView({ showFormatting: true }).nodes`.
|
|
95
|
+
* @param footnotes Footnotes from `DocxDocument.getFootnotes()` (already sorted by
|
|
96
|
+
* `displayNumber`); appended as `[^n] …` definitions.
|
|
97
|
+
*/
|
|
98
|
+
export function serializeToPlainText(nodes, footnotes = [], _opts = {}) {
|
|
99
|
+
const blocks = [];
|
|
100
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
101
|
+
const node = nodes[i];
|
|
102
|
+
// ── Tables: consume the whole run of same-table_id nodes at once ──
|
|
103
|
+
if (node.table_context) {
|
|
104
|
+
const tableId = node.table_context.table_id;
|
|
105
|
+
const group = [];
|
|
106
|
+
while (i < nodes.length && nodes[i].table_context?.table_id === tableId) {
|
|
107
|
+
group.push(nodes[i]);
|
|
108
|
+
i++;
|
|
109
|
+
}
|
|
110
|
+
i--; // for-loop will re-increment
|
|
111
|
+
const tableLines = renderTable(group);
|
|
112
|
+
if (tableLines.length > 0) {
|
|
113
|
+
blocks.push(tableLines.join('\n'));
|
|
114
|
+
blocks.push('');
|
|
115
|
+
}
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
// ── List items: a bullet per item, no surrounding blank lines ──
|
|
119
|
+
if (node.list_metadata.list_level >= 0) {
|
|
120
|
+
blocks.push(renderListItem(node));
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
// ── Headings and normal paragraphs alike: plain text, blank line between blocks ──
|
|
124
|
+
// Plain text has no heading syntax, so a Word-styled heading is just its text.
|
|
125
|
+
const text = toPlainInline(node.tagged_text).trim();
|
|
126
|
+
if (text === '') {
|
|
127
|
+
blocks.push('');
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
blocks.push(text);
|
|
131
|
+
blocks.push('');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// ── Footnote definitions ──
|
|
135
|
+
const defs = footnotes.filter((fn) => fn.displayNumber > 0);
|
|
136
|
+
if (defs.length > 0) {
|
|
137
|
+
blocks.push('');
|
|
138
|
+
for (const fn of defs) {
|
|
139
|
+
const body = fn.text.replace(/\s+/g, ' ').trim();
|
|
140
|
+
blocks.push(`[^${fn.displayNumber}] ${body}`.trimEnd());
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Trim only blank *lines* at the document boundary — not all whitespace. A plain `.trim()`
|
|
144
|
+
// would eat a leading/trailing tab that is a meaningful empty TSV field when the document
|
|
145
|
+
// starts or ends with a table whose boundary cell is empty (e.g. a row `\tZ`), breaking the
|
|
146
|
+
// "every row keeps the same column count" contract.
|
|
147
|
+
const rendered = blocks
|
|
148
|
+
.join('\n')
|
|
149
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
150
|
+
.replace(/^\n+/, '')
|
|
151
|
+
.replace(/\n+$/, '');
|
|
152
|
+
return `${rendered}\n`;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=serialize_plaintext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize_plaintext.js","sourceRoot":"","sources":["../../src/primitives/serialize_plaintext.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,EAAE;AACF,oFAAoF;AACpF,uFAAuF;AACvF,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I,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,2FAA2F;IAC3F,0FAA0F;IAC1F,4FAA4F;IAC5F,oDAAoD;IACpD,MAAM,QAAQ,GAAG,MAAM;SACpB,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;SACnB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,OAAO,GAAG,QAAQ,IAAI,CAAC;AACzB,CAAC"}
|
|
@@ -27,6 +27,21 @@ export type RunFormatting = {
|
|
|
27
27
|
fontSizePt: number;
|
|
28
28
|
colorHex: string | null;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Tri-state run formatting resolved from a named style's `basedOn` chain: `null` means no
|
|
32
|
+
* chain member specifies the property (distinct from an explicit `w:val="0"` → `false`).
|
|
33
|
+
* Consumers seeding their own style templates (e.g. the DOCX → ODT converter's `styles.xml`)
|
|
34
|
+
* use `null` to fall back to template defaults instead of overriding them.
|
|
35
|
+
*/
|
|
36
|
+
export type StyleRunFormatting = {
|
|
37
|
+
bold: boolean | null;
|
|
38
|
+
italic: boolean | null;
|
|
39
|
+
fontName: string | null;
|
|
40
|
+
fontSizePt: number | null;
|
|
41
|
+
colorHex: string | null;
|
|
42
|
+
};
|
|
43
|
+
/** Resolve a named style's effective run formatting through its `basedOn` chain. */
|
|
44
|
+
export declare function extractStyleRunFormatting(styles: StylesModel, styleId: string | null): StyleRunFormatting;
|
|
30
45
|
export declare function extractEffectiveRunFormatting(params: {
|
|
31
46
|
run: Element;
|
|
32
47
|
paragraphPPr: Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/primitives/styles.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IACh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