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
|
@@ -1,21 +1,101 @@
|
|
|
1
1
|
import { DocxZip } from './zip.js';
|
|
2
2
|
import { parseXml, serializeXml } from './xml.js';
|
|
3
|
+
import { maybeCaptureEmittedDocumentXml } from './schema-corpus-capture.js';
|
|
3
4
|
import { OOXML, W } from './namespaces.js';
|
|
4
|
-
import { isW, getDirectChildrenByName } from './dom-helpers.js';
|
|
5
|
+
import { createWmlElement, isW, getDirectChildrenByName } from './dom-helpers.js';
|
|
5
6
|
import { findParagraphByBookmarkId, insertParagraphBookmarks, cleanupInternalBookmarks, getParagraphBookmarkId, insertSingleParagraphBookmark, } from './bookmarks.js';
|
|
6
7
|
import { getParagraphRuns, getParagraphText, replaceParagraphTextRange } from './text.js';
|
|
7
|
-
import {
|
|
8
|
+
import { allocateRevisionId, createRevisionContainer, } from './track-changes-emitter.js';
|
|
9
|
+
import { buildNodesForDocumentView, collectViewParagraphs } from './document_view.js';
|
|
10
|
+
import { serializeToMarkdown } from './serialize_markdown.js';
|
|
11
|
+
import { serializeToHtml } from './serialize_html.js';
|
|
12
|
+
import { serializeToPlainText } from './serialize_plaintext.js';
|
|
13
|
+
import { parseStylesXml } from './styles.js';
|
|
14
|
+
import { parseNumberingXml } from './numbering.js';
|
|
8
15
|
import { findUniqueSubstringMatch } from './matching.js';
|
|
9
16
|
import { parseDocumentRels } from './relationships.js';
|
|
10
17
|
import { setParagraphSpacing, setTableCellPadding, setTableRowHeight, } from './layout.js';
|
|
11
18
|
import { extractTables, } from './tables.js';
|
|
12
19
|
import { mergeRuns } from './merge_runs.js';
|
|
20
|
+
import { restoreUntouchedBlocks } from './minimal_save.js';
|
|
13
21
|
import { simplifyRedlines } from './simplify_redlines.js';
|
|
14
22
|
import { preventDoubleElevation } from './prevent_double_elevation.js';
|
|
15
23
|
import { validateDocument } from './validate_document.js';
|
|
24
|
+
import { validateAiRevisions as validateAiRevisionsImpl, } from './validate_ai_revisions.js';
|
|
25
|
+
import { enumerateRevisionStoryPartPaths, REVISION_STORY_PART_PATHS, } from './revision-parts.js';
|
|
16
26
|
import { acceptChanges as acceptChangesImpl } from './accept_changes.js';
|
|
27
|
+
import { rejectChanges as rejectChangesImpl } from './reject_changes.js';
|
|
17
28
|
import { bootstrapCommentParts, addComment as addCommentImpl, addCommentReply as addCommentReplyImpl, getComments as getCommentsImpl, getComment as getCommentImpl, deleteComment as deleteCommentImpl, } from './comments.js';
|
|
18
29
|
import { bootstrapFootnoteParts, getFootnotes as getFootnotesImpl, getFootnote as getFootnoteImpl, addFootnote as addFootnoteImpl, updateFootnoteText as updateFootnoteTextImpl, deleteFootnote as deleteFootnoteImpl, } from './footnotes.js';
|
|
30
|
+
function emptyAcceptChangesResult() {
|
|
31
|
+
return { insertionsAccepted: 0, deletionsAccepted: 0, movesResolved: 0, propertyChangesResolved: 0 };
|
|
32
|
+
}
|
|
33
|
+
function hasAcceptedChanges(result) {
|
|
34
|
+
return (result.insertionsAccepted > 0 ||
|
|
35
|
+
result.deletionsAccepted > 0 ||
|
|
36
|
+
result.movesResolved > 0 ||
|
|
37
|
+
result.propertyChangesResolved > 0);
|
|
38
|
+
}
|
|
39
|
+
function addAcceptChangesResult(total, result) {
|
|
40
|
+
total.insertionsAccepted += result.insertionsAccepted;
|
|
41
|
+
total.deletionsAccepted += result.deletionsAccepted;
|
|
42
|
+
total.movesResolved += result.movesResolved;
|
|
43
|
+
total.propertyChangesResolved += result.propertyChangesResolved;
|
|
44
|
+
}
|
|
45
|
+
function emptyRejectChangesResult() {
|
|
46
|
+
return { insertionsRemoved: 0, deletionsRestored: 0, movesReverted: 0, propertyChangesReverted: 0 };
|
|
47
|
+
}
|
|
48
|
+
function hasRejectedChanges(result) {
|
|
49
|
+
return (result.insertionsRemoved > 0 ||
|
|
50
|
+
result.deletionsRestored > 0 ||
|
|
51
|
+
result.movesReverted > 0 ||
|
|
52
|
+
result.propertyChangesReverted > 0);
|
|
53
|
+
}
|
|
54
|
+
function addRejectChangesResult(total, result) {
|
|
55
|
+
total.insertionsRemoved += result.insertionsRemoved;
|
|
56
|
+
total.deletionsRestored += result.deletionsRestored;
|
|
57
|
+
total.movesReverted += result.movesReverted;
|
|
58
|
+
total.propertyChangesReverted += result.propertyChangesReverted;
|
|
59
|
+
}
|
|
60
|
+
function parseWId(el) {
|
|
61
|
+
const idStr = el.getAttributeNS(OOXML.W_NS, 'id') ?? el.getAttribute('w:id');
|
|
62
|
+
if (!idStr)
|
|
63
|
+
return null;
|
|
64
|
+
const n = parseInt(idStr, 10);
|
|
65
|
+
return Number.isNaN(n) ? null : n;
|
|
66
|
+
}
|
|
67
|
+
function collectLiveFootnoteRefIds(doc) {
|
|
68
|
+
const ids = new Set();
|
|
69
|
+
const refs = doc.getElementsByTagNameNS(OOXML.W_NS, W.footnoteReference);
|
|
70
|
+
for (let i = 0; i < refs.length; i++) {
|
|
71
|
+
const id = parseWId(refs.item(i));
|
|
72
|
+
if (id !== null)
|
|
73
|
+
ids.add(id);
|
|
74
|
+
}
|
|
75
|
+
return ids;
|
|
76
|
+
}
|
|
77
|
+
// Side-effect of accept/reject on document.xml: a body w:footnoteReference that
|
|
78
|
+
// lived inside a removed w:del (accept) or w:ins (reject) is gone afterwards.
|
|
79
|
+
// The corresponding <w:footnote w:id=N> in footnotes.xml is then unreachable —
|
|
80
|
+
// remove it so the side part matches the post-sweep body. Reserved separator /
|
|
81
|
+
// continuationSeparator entries are preserved unconditionally.
|
|
82
|
+
function pruneOrphanedFootnotes(footnotesDoc, liveRefIds) {
|
|
83
|
+
const entries = Array.from(footnotesDoc.getElementsByTagNameNS(OOXML.W_NS, W.footnote));
|
|
84
|
+
let pruned = 0;
|
|
85
|
+
for (const fn of entries) {
|
|
86
|
+
const typ = fn.getAttributeNS(OOXML.W_NS, 'type') ?? fn.getAttribute('w:type');
|
|
87
|
+
if (typ === W.separator || typ === W.continuationSeparator)
|
|
88
|
+
continue;
|
|
89
|
+
const id = parseWId(fn);
|
|
90
|
+
if (id === null)
|
|
91
|
+
continue;
|
|
92
|
+
if (liveRefIds.has(id))
|
|
93
|
+
continue;
|
|
94
|
+
fn.parentNode?.removeChild(fn);
|
|
95
|
+
pruned++;
|
|
96
|
+
}
|
|
97
|
+
return pruned;
|
|
98
|
+
}
|
|
19
99
|
function prevElementSibling(node) {
|
|
20
100
|
let cur = node?.previousSibling ?? null;
|
|
21
101
|
while (cur) {
|
|
@@ -34,191 +114,6 @@ function nextElementSibling(node) {
|
|
|
34
114
|
}
|
|
35
115
|
return null;
|
|
36
116
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Collect all w:tr descendants of a table element, descending through
|
|
39
|
-
* w:ins/w:del/w:sdt wrappers but not into nested w:tbl elements.
|
|
40
|
-
*/
|
|
41
|
-
function collectTableRows(tbl) {
|
|
42
|
-
const rows = [];
|
|
43
|
-
function walk(parent) {
|
|
44
|
-
for (let i = 0; i < parent.childNodes.length; i++) {
|
|
45
|
-
const child = parent.childNodes[i];
|
|
46
|
-
if (child.nodeType !== 1)
|
|
47
|
-
continue;
|
|
48
|
-
const el = child;
|
|
49
|
-
if (isW(el, W.tr)) {
|
|
50
|
-
rows.push(el);
|
|
51
|
-
}
|
|
52
|
-
else if (!isW(el, W.tbl)) {
|
|
53
|
-
walk(el);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
walk(tbl);
|
|
58
|
-
return rows;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Collect all w:tc descendants of a row element, descending through
|
|
62
|
-
* w:ins/w:del/w:sdt wrappers but not into nested w:tr or w:tbl elements.
|
|
63
|
-
*/
|
|
64
|
-
function collectRowCells(tr) {
|
|
65
|
-
const cells = [];
|
|
66
|
-
function walk(parent) {
|
|
67
|
-
for (let i = 0; i < parent.childNodes.length; i++) {
|
|
68
|
-
const child = parent.childNodes[i];
|
|
69
|
-
if (child.nodeType !== 1)
|
|
70
|
-
continue;
|
|
71
|
-
const el = child;
|
|
72
|
-
if (isW(el, W.tc)) {
|
|
73
|
-
cells.push(el);
|
|
74
|
-
}
|
|
75
|
-
else if (!isW(el, W.tr) && !isW(el, W.tbl)) {
|
|
76
|
-
walk(el);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
walk(tr);
|
|
81
|
-
return cells;
|
|
82
|
-
}
|
|
83
|
-
/** Get the gridSpan value for a table cell (default 1). */
|
|
84
|
-
function getCellGridSpan(tc) {
|
|
85
|
-
const tcPrList = getDirectChildrenByName(tc, W.tcPr);
|
|
86
|
-
if (tcPrList.length === 0)
|
|
87
|
-
return 1;
|
|
88
|
-
const gridSpanEls = getDirectChildrenByName(tcPrList[0], 'gridSpan');
|
|
89
|
-
if (gridSpanEls.length === 0)
|
|
90
|
-
return 1;
|
|
91
|
-
const val = gridSpanEls[0].getAttributeNS(OOXML.W_NS, W.val) ??
|
|
92
|
-
gridSpanEls[0].getAttribute('w:val') ??
|
|
93
|
-
gridSpanEls[0].getAttribute(W.val);
|
|
94
|
-
if (!val)
|
|
95
|
-
return 1;
|
|
96
|
-
const n = parseInt(val, 10);
|
|
97
|
-
return n > 0 ? n : 1;
|
|
98
|
-
}
|
|
99
|
-
/** Get visible text from a cell's direct paragraphs (excludes nested tables). */
|
|
100
|
-
function getCellHeaderText(tc) {
|
|
101
|
-
const parts = [];
|
|
102
|
-
for (let i = 0; i < tc.childNodes.length; i++) {
|
|
103
|
-
const child = tc.childNodes[i];
|
|
104
|
-
if (child.nodeType === 1 && isW(child, W.p)) {
|
|
105
|
-
parts.push(getParagraphText(child).trim());
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return parts.join(' ').trim();
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Build metadata map for body-level tables.
|
|
112
|
-
* Only indexes direct w:tbl children of w:body (consistent with extractTables).
|
|
113
|
-
*/
|
|
114
|
-
function buildTableMetaMap(body) {
|
|
115
|
-
const map = new Map();
|
|
116
|
-
const tables = getDirectChildrenByName(body, W.tbl);
|
|
117
|
-
for (let tableIndex = 0; tableIndex < tables.length; tableIndex++) {
|
|
118
|
-
const tbl = tables[tableIndex];
|
|
119
|
-
const rows = collectTableRows(tbl);
|
|
120
|
-
if (rows.length === 0)
|
|
121
|
-
continue;
|
|
122
|
-
// Compute max grid columns across all rows
|
|
123
|
-
let maxGridCols = 0;
|
|
124
|
-
for (const row of rows) {
|
|
125
|
-
const cells = collectRowCells(row);
|
|
126
|
-
let gridCols = 0;
|
|
127
|
-
for (const cell of cells) {
|
|
128
|
-
gridCols += getCellGridSpan(cell);
|
|
129
|
-
}
|
|
130
|
-
if (gridCols > maxGridCols)
|
|
131
|
-
maxGridCols = gridCols;
|
|
132
|
-
}
|
|
133
|
-
// Extract headers from row 0
|
|
134
|
-
const headerRow = rows[0];
|
|
135
|
-
const headerCells = collectRowCells(headerRow);
|
|
136
|
-
const headers = [];
|
|
137
|
-
for (const cell of headerCells) {
|
|
138
|
-
const span = getCellGridSpan(cell);
|
|
139
|
-
const text = getCellHeaderText(cell);
|
|
140
|
-
headers.push(text);
|
|
141
|
-
for (let s = 1; s < span; s++)
|
|
142
|
-
headers.push('');
|
|
143
|
-
}
|
|
144
|
-
while (headers.length < maxGridCols)
|
|
145
|
-
headers.push('');
|
|
146
|
-
if (headers.length > maxGridCols)
|
|
147
|
-
headers.length = maxGridCols;
|
|
148
|
-
map.set(tbl, {
|
|
149
|
-
tableIndex,
|
|
150
|
-
tableId: `_tbl_${tableIndex}`,
|
|
151
|
-
rows,
|
|
152
|
-
headers,
|
|
153
|
-
totalCols: maxGridCols,
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
return map;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Derive table context for a paragraph by walking up the DOM.
|
|
160
|
-
* Returns undefined if the paragraph is not inside a body-level table.
|
|
161
|
-
*/
|
|
162
|
-
function deriveTableContext(p, tableMetaMap) {
|
|
163
|
-
let tc = null;
|
|
164
|
-
let tr = null;
|
|
165
|
-
let tbl = null;
|
|
166
|
-
let current = p.parentNode;
|
|
167
|
-
while (current && current.nodeType === 1) {
|
|
168
|
-
const el = current;
|
|
169
|
-
if (isW(el, W.body))
|
|
170
|
-
break;
|
|
171
|
-
if (isW(el, W.tc))
|
|
172
|
-
tc = el;
|
|
173
|
-
if (isW(el, W.tr))
|
|
174
|
-
tr = el;
|
|
175
|
-
if (isW(el, W.tbl)) {
|
|
176
|
-
if (tableMetaMap.has(el)) {
|
|
177
|
-
tbl = el;
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
// Nested table: reset tc/tr, keep walking to find body-level table
|
|
181
|
-
tc = null;
|
|
182
|
-
tr = null;
|
|
183
|
-
}
|
|
184
|
-
current = el.parentNode;
|
|
185
|
-
}
|
|
186
|
-
if (!tbl || !tr || !tc)
|
|
187
|
-
return undefined;
|
|
188
|
-
const meta = tableMetaMap.get(tbl);
|
|
189
|
-
// Compute row_index
|
|
190
|
-
const rowIndex = meta.rows.indexOf(tr);
|
|
191
|
-
if (rowIndex < 0)
|
|
192
|
-
return undefined;
|
|
193
|
-
// Compute grid-aware col_index by summing gridSpan for preceding cells
|
|
194
|
-
const rowCells = collectRowCells(tr);
|
|
195
|
-
let gridCol = 0;
|
|
196
|
-
let cellFound = false;
|
|
197
|
-
for (const cell of rowCells) {
|
|
198
|
-
if (cell === tc) {
|
|
199
|
-
cellFound = true;
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
gridCol += getCellGridSpan(cell);
|
|
203
|
-
}
|
|
204
|
-
if (!cellFound)
|
|
205
|
-
return undefined;
|
|
206
|
-
// Compute para_in_cell and cell_para_count
|
|
207
|
-
const allCellPs = Array.from(tc.getElementsByTagNameNS(OOXML.W_NS, W.p));
|
|
208
|
-
const paraInCell = allCellPs.indexOf(p);
|
|
209
|
-
return {
|
|
210
|
-
table_id: meta.tableId,
|
|
211
|
-
table_index: meta.tableIndex,
|
|
212
|
-
row_index: rowIndex,
|
|
213
|
-
col_index: gridCol,
|
|
214
|
-
col_header: meta.headers[gridCol] ?? '',
|
|
215
|
-
total_rows: meta.rows.length,
|
|
216
|
-
total_cols: meta.totalCols,
|
|
217
|
-
is_header_row: rowIndex === 0,
|
|
218
|
-
para_in_cell: paraInCell >= 0 ? paraInCell : 0,
|
|
219
|
-
cell_para_count: allCellPs.length,
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
117
|
export class DocxDocument {
|
|
223
118
|
zip;
|
|
224
119
|
documentXml;
|
|
@@ -228,7 +123,13 @@ export class DocxDocument {
|
|
|
228
123
|
relsMap;
|
|
229
124
|
dirty;
|
|
230
125
|
documentViewCache;
|
|
231
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Raw document.xml text as loaded, before normalize()/edits mutate the DOM.
|
|
128
|
+
* Reference for minimal re-serialization in toBuffer(); null for instances
|
|
129
|
+
* not created via load().
|
|
130
|
+
*/
|
|
131
|
+
originalDocumentXmlText;
|
|
132
|
+
constructor(zip, documentXml, stylesXml, numberingXml, footnotesXml, relsMap, originalDocumentXmlText = null) {
|
|
232
133
|
this.zip = zip;
|
|
233
134
|
this.documentXml = documentXml;
|
|
234
135
|
this.stylesXml = stylesXml;
|
|
@@ -237,6 +138,7 @@ export class DocxDocument {
|
|
|
237
138
|
this.relsMap = relsMap;
|
|
238
139
|
this.dirty = false;
|
|
239
140
|
this.documentViewCache = null;
|
|
141
|
+
this.originalDocumentXmlText = originalDocumentXmlText;
|
|
240
142
|
}
|
|
241
143
|
static async load(buffer) {
|
|
242
144
|
const zip = await DocxZip.load(buffer);
|
|
@@ -253,7 +155,7 @@ export class DocxDocument {
|
|
|
253
155
|
// Load document relationships for hyperlink resolution.
|
|
254
156
|
const relsText = await zip.readTextOrNull('word/_rels/document.xml.rels');
|
|
255
157
|
const relsMap = relsText ? parseDocumentRels(parseXml(relsText)) : new Map();
|
|
256
|
-
return new DocxDocument(zip, doc, stylesXml, numberingXml, footnotesXml, relsMap);
|
|
158
|
+
return new DocxDocument(zip, doc, stylesXml, numberingXml, footnotesXml, relsMap, xml);
|
|
257
159
|
}
|
|
258
160
|
getParagraphs() {
|
|
259
161
|
const body = this.documentXml.getElementsByTagNameNS(OOXML.W_NS, W.body).item(0);
|
|
@@ -310,20 +212,96 @@ export class DocxDocument {
|
|
|
310
212
|
validate() {
|
|
311
213
|
return validateDocument(this.documentXml);
|
|
312
214
|
}
|
|
215
|
+
async validateAiRevisions(aiAuthor, touched) {
|
|
216
|
+
const stories = [{ part: 'word/document.xml', doc: this.documentXml }];
|
|
217
|
+
for (const partPath of enumerateRevisionStoryPartPaths(this.zip)) {
|
|
218
|
+
const xml = await this.zip.readTextOrNull(partPath);
|
|
219
|
+
if (!xml)
|
|
220
|
+
continue;
|
|
221
|
+
stories.push({ part: partPath, doc: parseXml(xml) });
|
|
222
|
+
}
|
|
223
|
+
return validateAiRevisionsImpl({
|
|
224
|
+
aiAuthor,
|
|
225
|
+
stories,
|
|
226
|
+
packageZip: this.zip,
|
|
227
|
+
touched,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
313
230
|
/**
|
|
314
|
-
* Accept all tracked changes in
|
|
315
|
-
*
|
|
231
|
+
* Accept all tracked changes in document.xml plus supported revisionable
|
|
232
|
+
* side-story parts, producing clean XML with no revision markup.
|
|
316
233
|
*/
|
|
317
|
-
acceptChanges() {
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
234
|
+
async acceptChanges() {
|
|
235
|
+
const total = emptyAcceptChangesResult();
|
|
236
|
+
const bodyResult = acceptChangesImpl(this.documentXml);
|
|
237
|
+
addAcceptChangesResult(total, bodyResult);
|
|
238
|
+
// After accepting, footnotes whose body reference lived inside a removed
|
|
239
|
+
// w:del are orphaned. Only worth checking when the body sweep removed
|
|
240
|
+
// deletions (the only operation that can drop a footnoteReference).
|
|
241
|
+
const liveFootnoteRefIds = bodyResult.deletionsAccepted > 0
|
|
242
|
+
? collectLiveFootnoteRefIds(this.documentXml)
|
|
243
|
+
: null;
|
|
244
|
+
for (const partPath of REVISION_STORY_PART_PATHS) {
|
|
245
|
+
const xml = await this.zip.readTextOrNull(partPath);
|
|
246
|
+
if (!xml)
|
|
247
|
+
continue;
|
|
248
|
+
const partDoc = parseXml(xml);
|
|
249
|
+
const partResult = acceptChangesImpl(partDoc);
|
|
250
|
+
addAcceptChangesResult(total, partResult);
|
|
251
|
+
let footnotesPruned = 0;
|
|
252
|
+
if (partPath === 'word/footnotes.xml' && liveFootnoteRefIds) {
|
|
253
|
+
footnotesPruned = pruneOrphanedFootnotes(partDoc, liveFootnoteRefIds);
|
|
254
|
+
}
|
|
255
|
+
if (hasAcceptedChanges(partResult) || footnotesPruned > 0) {
|
|
256
|
+
this.zip.writeText(partPath, serializeXml(partDoc));
|
|
257
|
+
if (partPath === 'word/footnotes.xml') {
|
|
258
|
+
this.footnotesXml = partDoc;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (hasAcceptedChanges(total)) {
|
|
323
263
|
this.dirty = true;
|
|
324
264
|
this.documentViewCache = null;
|
|
325
265
|
}
|
|
326
|
-
return
|
|
266
|
+
return total;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Reject all tracked changes in document.xml plus supported revisionable
|
|
270
|
+
* side-story parts, restoring their pre-edit state where possible.
|
|
271
|
+
*/
|
|
272
|
+
async rejectChanges() {
|
|
273
|
+
const total = emptyRejectChangesResult();
|
|
274
|
+
const bodyResult = rejectChangesImpl(this.documentXml);
|
|
275
|
+
addRejectChangesResult(total, bodyResult);
|
|
276
|
+
// After rejecting, footnotes whose body reference lived inside a removed
|
|
277
|
+
// w:ins are orphaned. Only worth checking when the body sweep removed
|
|
278
|
+
// insertions (the only operation that can drop a footnoteReference).
|
|
279
|
+
const liveFootnoteRefIds = bodyResult.insertionsRemoved > 0
|
|
280
|
+
? collectLiveFootnoteRefIds(this.documentXml)
|
|
281
|
+
: null;
|
|
282
|
+
for (const partPath of REVISION_STORY_PART_PATHS) {
|
|
283
|
+
const xml = await this.zip.readTextOrNull(partPath);
|
|
284
|
+
if (!xml)
|
|
285
|
+
continue;
|
|
286
|
+
const partDoc = parseXml(xml);
|
|
287
|
+
const partResult = rejectChangesImpl(partDoc);
|
|
288
|
+
addRejectChangesResult(total, partResult);
|
|
289
|
+
let footnotesPruned = 0;
|
|
290
|
+
if (partPath === 'word/footnotes.xml' && liveFootnoteRefIds) {
|
|
291
|
+
footnotesPruned = pruneOrphanedFootnotes(partDoc, liveFootnoteRefIds);
|
|
292
|
+
}
|
|
293
|
+
if (hasRejectedChanges(partResult) || footnotesPruned > 0) {
|
|
294
|
+
this.zip.writeText(partPath, serializeXml(partDoc));
|
|
295
|
+
if (partPath === 'word/footnotes.xml') {
|
|
296
|
+
this.footnotesXml = partDoc;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (hasRejectedChanges(total)) {
|
|
301
|
+
this.dirty = true;
|
|
302
|
+
this.documentViewCache = null;
|
|
303
|
+
}
|
|
304
|
+
return total;
|
|
327
305
|
}
|
|
328
306
|
removeJuniorBookmarks() {
|
|
329
307
|
const removed = cleanupInternalBookmarks(this.documentXml);
|
|
@@ -360,6 +338,23 @@ export class DocxDocument {
|
|
|
360
338
|
const endIdx = typeof limit === 'number' ? Math.min(total, startIdx + limit) : total;
|
|
361
339
|
return { paragraphs: all.slice(startIdx, endIdx), totalParagraphs: total };
|
|
362
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Parsed `word/numbering.xml` model (abstract numberings + instances), or null when the
|
|
343
|
+
* document has no numbering part. The document view's `numbering` field only carries
|
|
344
|
+
* `num_id`/`ilvl`; semantic converters (DOCX → ODT) need `numFmt`/`lvlText`/`start` to
|
|
345
|
+
* synthesize target-format list styles, so the full model is exposed here.
|
|
346
|
+
*/
|
|
347
|
+
getNumberingModel() {
|
|
348
|
+
return this.numberingXml ? parseNumberingXml(this.numberingXml) : null;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Parsed named-style model of the loaded document (empty when the package has no
|
|
352
|
+
* `word/styles.xml`). Semantic converters (DOCX → ODT) resolve heading/body style chains
|
|
353
|
+
* through it to seed their own style templates from the source's definitions.
|
|
354
|
+
*/
|
|
355
|
+
getStylesModel() {
|
|
356
|
+
return parseStylesXml(this.stylesXml);
|
|
357
|
+
}
|
|
363
358
|
buildDocumentView(opts) {
|
|
364
359
|
const includeSemanticTags = opts?.includeSemanticTags ?? true;
|
|
365
360
|
const showFormatting = opts?.showFormatting ?? false;
|
|
@@ -368,18 +363,9 @@ export class DocxDocument {
|
|
|
368
363
|
if (!this.dirty && cached && cached.includeSemanticTags === includeSemanticTags && cached.showFormatting === showFormatting && cached.formattingMode === formattingMode) {
|
|
369
364
|
return { nodes: cached.nodes, styles: cached.styles };
|
|
370
365
|
}
|
|
371
|
-
//
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
const paragraphs = this.getParagraphs()
|
|
375
|
-
.map((p) => {
|
|
376
|
-
const id = getParagraphBookmarkId(p);
|
|
377
|
-
if (!id)
|
|
378
|
-
return null;
|
|
379
|
-
const tableContext = deriveTableContext(p, tableMetaMap);
|
|
380
|
-
return tableContext ? { id, p, tableContext } : { id, p };
|
|
381
|
-
})
|
|
382
|
-
.filter((x) => x !== null);
|
|
366
|
+
// Shared paragraph-collection core (also used by the free buildDocumentView):
|
|
367
|
+
// attaches each bookmarked paragraph's table context.
|
|
368
|
+
const paragraphs = collectViewParagraphs(this.documentXml);
|
|
383
369
|
const { nodes, styles } = buildNodesForDocumentView({
|
|
384
370
|
paragraphs,
|
|
385
371
|
stylesXml: this.stylesXml,
|
|
@@ -425,7 +411,7 @@ export class DocxDocument {
|
|
|
425
411
|
this.dirty = true;
|
|
426
412
|
this.documentViewCache = null;
|
|
427
413
|
}
|
|
428
|
-
insertParagraph(params) {
|
|
414
|
+
insertParagraph(params, ctx) {
|
|
429
415
|
const { positionalAnchorNodeId, relativePosition, newText, newParagraphId: _newParagraphId, styleSourceId } = params;
|
|
430
416
|
const anchor = findParagraphByBookmarkId(this.documentXml, positionalAnchorNodeId);
|
|
431
417
|
if (!anchor)
|
|
@@ -505,8 +491,86 @@ export class DocxDocument {
|
|
|
505
491
|
continue;
|
|
506
492
|
newP.removeChild(child);
|
|
507
493
|
}
|
|
494
|
+
// sectPr is the section terminator — must stay on the anchor, not propagate to the new paragraph.
|
|
495
|
+
const clonedPPr = getDirectChildrenByName(newP, W.pPr)[0];
|
|
496
|
+
if (clonedPPr) {
|
|
497
|
+
for (const sectPr of getDirectChildrenByName(clonedPPr, 'sectPr')) {
|
|
498
|
+
clonedPPr.removeChild(sectPr);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
508
501
|
return newP;
|
|
509
502
|
}
|
|
503
|
+
function ensureParagraphProperties(paragraph) {
|
|
504
|
+
const existing = getDirectChildrenByName(paragraph, W.pPr)[0];
|
|
505
|
+
if (existing)
|
|
506
|
+
return existing;
|
|
507
|
+
const pPr = createWmlElement(doc, W.pPr);
|
|
508
|
+
paragraph.insertBefore(pPr, paragraph.firstChild);
|
|
509
|
+
return pPr;
|
|
510
|
+
}
|
|
511
|
+
function ensureParagraphRunProperties(pPr) {
|
|
512
|
+
const existing = getDirectChildrenByName(pPr, W.rPr)[0];
|
|
513
|
+
if (existing)
|
|
514
|
+
return existing;
|
|
515
|
+
const rPr = createWmlElement(doc, W.rPr);
|
|
516
|
+
const sectPr = getDirectChildrenByName(pPr, 'sectPr')[0];
|
|
517
|
+
const pPrChange = getDirectChildrenByName(pPr, 'pPrChange')[0];
|
|
518
|
+
const insertBefore = sectPr ?? pPrChange ?? null;
|
|
519
|
+
if (insertBefore) {
|
|
520
|
+
pPr.insertBefore(rPr, insertBefore);
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
pPr.appendChild(rPr);
|
|
524
|
+
}
|
|
525
|
+
return rPr;
|
|
526
|
+
}
|
|
527
|
+
function addParagraphInsertionMarker(paragraph, revisionCtx) {
|
|
528
|
+
const pPr = ensureParagraphProperties(paragraph);
|
|
529
|
+
const rPr = ensureParagraphRunProperties(pPr);
|
|
530
|
+
const marker = createWmlElement(doc, 'ins', {
|
|
531
|
+
'w:id': String(allocateRevisionId(revisionCtx.idState)),
|
|
532
|
+
'w:author': revisionCtx.author,
|
|
533
|
+
'w:date': revisionCtx.date,
|
|
534
|
+
});
|
|
535
|
+
rPr.insertBefore(marker, rPr.firstChild);
|
|
536
|
+
}
|
|
537
|
+
function clearRunPropertyRevisionMarkup(run) {
|
|
538
|
+
const rPr = getDirectChildrenByName(run, W.rPr)[0];
|
|
539
|
+
if (!rPr)
|
|
540
|
+
return;
|
|
541
|
+
for (const child of Array.from(rPr.childNodes)) {
|
|
542
|
+
if (child.nodeType !== 1)
|
|
543
|
+
continue;
|
|
544
|
+
const element = child;
|
|
545
|
+
if (isW(element, 'rPrChange')) {
|
|
546
|
+
rPr.removeChild(element);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function clearParagraphPropertyRevisionMarkup(paragraph) {
|
|
551
|
+
const pPr = getDirectChildrenByName(paragraph, W.pPr)[0];
|
|
552
|
+
if (!pPr)
|
|
553
|
+
return;
|
|
554
|
+
for (const pPrChange of getDirectChildrenByName(pPr, 'pPrChange')) {
|
|
555
|
+
pPr.removeChild(pPrChange);
|
|
556
|
+
}
|
|
557
|
+
const rPr = getDirectChildrenByName(pPr, W.rPr)[0];
|
|
558
|
+
if (!rPr)
|
|
559
|
+
return;
|
|
560
|
+
for (const child of Array.from(rPr.childNodes)) {
|
|
561
|
+
if (child.nodeType !== 1)
|
|
562
|
+
continue;
|
|
563
|
+
const element = child;
|
|
564
|
+
// CT_ParaRPr revision children: w:ins, w:del, w:moveFrom, w:moveTo, w:rPrChange.
|
|
565
|
+
if (isW(element, 'ins') ||
|
|
566
|
+
isW(element, 'del') ||
|
|
567
|
+
isW(element, 'moveFrom') ||
|
|
568
|
+
isW(element, 'moveTo') ||
|
|
569
|
+
isW(element, 'rPrChange')) {
|
|
570
|
+
rPr.removeChild(element);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
510
574
|
function getInsertionRefNode() {
|
|
511
575
|
if (relativePosition === 'BEFORE') {
|
|
512
576
|
const prev = prevElementSibling(anchorP);
|
|
@@ -538,7 +602,17 @@ export class DocxDocument {
|
|
|
538
602
|
const newP = cloneParagraphShell(formattingSource);
|
|
539
603
|
const newRun = cloneRunFormattingOnly(templateRun);
|
|
540
604
|
appendTextToRun(newRun, paraText);
|
|
541
|
-
|
|
605
|
+
if (ctx) {
|
|
606
|
+
clearRunPropertyRevisionMarkup(newRun);
|
|
607
|
+
clearParagraphPropertyRevisionMarkup(newP);
|
|
608
|
+
addParagraphInsertionMarker(newP, ctx);
|
|
609
|
+
const insertion = createRevisionContainer(doc, 'ins', ctx);
|
|
610
|
+
insertion.appendChild(newRun);
|
|
611
|
+
newP.appendChild(insertion);
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
newP.appendChild(newRun);
|
|
615
|
+
}
|
|
542
616
|
parent.insertBefore(newP, cursor);
|
|
543
617
|
const id = insertSingleParagraphBookmark(doc, newP);
|
|
544
618
|
insertedIds.push(id);
|
|
@@ -557,24 +631,24 @@ export class DocxDocument {
|
|
|
557
631
|
result.styleSourceFallback = true;
|
|
558
632
|
return result;
|
|
559
633
|
}
|
|
560
|
-
setParagraphSpacing(mutation) {
|
|
561
|
-
const result = setParagraphSpacing(this.documentXml, mutation);
|
|
634
|
+
setParagraphSpacing(mutation, ctx) {
|
|
635
|
+
const result = setParagraphSpacing(this.documentXml, mutation, ctx);
|
|
562
636
|
if (result.affectedParagraphs > 0) {
|
|
563
637
|
this.dirty = true;
|
|
564
638
|
this.documentViewCache = null;
|
|
565
639
|
}
|
|
566
640
|
return result;
|
|
567
641
|
}
|
|
568
|
-
setTableRowHeight(mutation) {
|
|
569
|
-
const result = setTableRowHeight(this.documentXml, mutation);
|
|
642
|
+
setTableRowHeight(mutation, ctx) {
|
|
643
|
+
const result = setTableRowHeight(this.documentXml, mutation, ctx);
|
|
570
644
|
if (result.affectedRows > 0) {
|
|
571
645
|
this.dirty = true;
|
|
572
646
|
this.documentViewCache = null;
|
|
573
647
|
}
|
|
574
648
|
return result;
|
|
575
649
|
}
|
|
576
|
-
setTableCellPadding(mutation) {
|
|
577
|
-
const result = setTableCellPadding(this.documentXml, mutation);
|
|
650
|
+
setTableCellPadding(mutation, ctx) {
|
|
651
|
+
const result = setTableCellPadding(this.documentXml, mutation, ctx);
|
|
578
652
|
if (result.affectedCells > 0) {
|
|
579
653
|
this.dirty = true;
|
|
580
654
|
this.documentViewCache = null;
|
|
@@ -591,9 +665,11 @@ export class DocxDocument {
|
|
|
591
665
|
/**
|
|
592
666
|
* Merge format-identical adjacent runs only (no redline simplification).
|
|
593
667
|
* Useful as a pre-processing step before text search when runs may be fragmented.
|
|
668
|
+
* Pass `{ preserveRsidIdentity: true }` from edit pipelines that must not
|
|
669
|
+
* disturb rsid attributes on runs the caller did not touch (#286).
|
|
594
670
|
*/
|
|
595
|
-
mergeRunsOnly() {
|
|
596
|
-
const result = mergeRuns(this.documentXml);
|
|
671
|
+
mergeRunsOnly(opts = {}) {
|
|
672
|
+
const result = mergeRuns(this.documentXml, opts);
|
|
597
673
|
if (result.runsMerged > 0) {
|
|
598
674
|
this.dirty = true;
|
|
599
675
|
this.documentViewCache = null;
|
|
@@ -606,7 +682,7 @@ export class DocxDocument {
|
|
|
606
682
|
* Bootstraps comment parts if missing (idempotent).
|
|
607
683
|
* Returns the allocated comment ID.
|
|
608
684
|
*/
|
|
609
|
-
async addComment(params) {
|
|
685
|
+
async addComment(params, ctx) {
|
|
610
686
|
const p = findParagraphByBookmarkId(this.documentXml, params.paragraphId);
|
|
611
687
|
if (!p)
|
|
612
688
|
throw new Error(`Paragraph not found: ${params.paragraphId}`);
|
|
@@ -618,7 +694,7 @@ export class DocxDocument {
|
|
|
618
694
|
author: params.author,
|
|
619
695
|
text: params.text,
|
|
620
696
|
initials: params.initials,
|
|
621
|
-
});
|
|
697
|
+
}, ctx);
|
|
622
698
|
this.dirty = true;
|
|
623
699
|
this.documentViewCache = null;
|
|
624
700
|
return result;
|
|
@@ -629,14 +705,14 @@ export class DocxDocument {
|
|
|
629
705
|
* Bootstraps comment parts if missing (idempotent).
|
|
630
706
|
* Returns the allocated comment ID and parent ID.
|
|
631
707
|
*/
|
|
632
|
-
async addCommentReply(params) {
|
|
708
|
+
async addCommentReply(params, ctx) {
|
|
633
709
|
await bootstrapCommentParts(this.zip);
|
|
634
710
|
const result = await addCommentReplyImpl(this.documentXml, this.zip, {
|
|
635
711
|
parentCommentId: params.parentCommentId,
|
|
636
712
|
author: params.author,
|
|
637
713
|
text: params.text,
|
|
638
714
|
initials: params.initials,
|
|
639
|
-
});
|
|
715
|
+
}, ctx);
|
|
640
716
|
this.dirty = true;
|
|
641
717
|
this.documentViewCache = null;
|
|
642
718
|
return result;
|
|
@@ -647,8 +723,8 @@ export class DocxDocument {
|
|
|
647
723
|
async getComment(commentId) {
|
|
648
724
|
return getCommentImpl(this.zip, this.documentXml, commentId);
|
|
649
725
|
}
|
|
650
|
-
async deleteComment(params) {
|
|
651
|
-
await deleteCommentImpl(this.documentXml, this.zip, params);
|
|
726
|
+
async deleteComment(params, ctx) {
|
|
727
|
+
await deleteCommentImpl(this.documentXml, this.zip, params, ctx);
|
|
652
728
|
this.dirty = true;
|
|
653
729
|
this.documentViewCache = null;
|
|
654
730
|
}
|
|
@@ -660,6 +736,47 @@ export class DocxDocument {
|
|
|
660
736
|
async getFootnotes() {
|
|
661
737
|
return getFootnotesImpl(this.zip, this.documentXml);
|
|
662
738
|
}
|
|
739
|
+
/**
|
|
740
|
+
* Serialize the document to GitHub-Flavored Markdown. Convenience wrapper that wires the
|
|
741
|
+
* structured document view (with inline formatting) and footnotes into
|
|
742
|
+
* {@link serializeToMarkdown}. Markdown is intentionally lossy — see that serializer.
|
|
743
|
+
*
|
|
744
|
+
* Async because footnote extraction reads the footnotes part from the zip.
|
|
745
|
+
*/
|
|
746
|
+
async toMarkdown(opts) {
|
|
747
|
+
const { nodes } = this.buildDocumentView({ showFormatting: true });
|
|
748
|
+
const footnotes = await this.getFootnotes();
|
|
749
|
+
return serializeToMarkdown(nodes, footnotes, opts);
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Serialize the document to semantic HTML. Convenience wrapper that wires the structured
|
|
753
|
+
* document view (with inline formatting) and footnotes into {@link serializeToHtml}. The
|
|
754
|
+
* default output is a complete `<!DOCTYPE html>` document; pass `{ fragment: true }` for the
|
|
755
|
+
* body-level elements only. This is the semantic tier — exact layout is not reproduced.
|
|
756
|
+
*
|
|
757
|
+
* Async because footnote extraction reads the footnotes part from the zip.
|
|
758
|
+
*/
|
|
759
|
+
async toHtml(opts) {
|
|
760
|
+
const { nodes } = this.buildDocumentView({ showFormatting: true });
|
|
761
|
+
const footnotes = await this.getFootnotes();
|
|
762
|
+
return serializeToHtml(nodes, footnotes, opts);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Serialize the document to plain text (no markup). Convenience wrapper that wires the
|
|
766
|
+
* structured document view and footnotes into {@link serializeToPlainText}. All formatting
|
|
767
|
+
* is stripped; block structure survives as blank-line-separated paragraphs, `- ` bullets,
|
|
768
|
+
* and tab-separated table rows. Intentionally lossy — see that serializer.
|
|
769
|
+
*
|
|
770
|
+
* Uses the same `showFormatting: true` view as {@link toMarkdown} so the block structure
|
|
771
|
+
* and injected `[^n]` footnote markers match; the inline tags it produces are then stripped.
|
|
772
|
+
*
|
|
773
|
+
* Async because footnote extraction reads the footnotes part from the zip.
|
|
774
|
+
*/
|
|
775
|
+
async toPlainText(opts) {
|
|
776
|
+
const { nodes } = this.buildDocumentView({ showFormatting: true });
|
|
777
|
+
const footnotes = await this.getFootnotes();
|
|
778
|
+
return serializeToPlainText(nodes, footnotes, opts);
|
|
779
|
+
}
|
|
663
780
|
async getFootnote(noteId) {
|
|
664
781
|
return getFootnoteImpl(this.zip, this.documentXml, noteId);
|
|
665
782
|
}
|
|
@@ -669,7 +786,7 @@ export class DocxDocument {
|
|
|
669
786
|
* Bootstraps footnote parts if missing (idempotent).
|
|
670
787
|
* Returns the allocated footnote ID.
|
|
671
788
|
*/
|
|
672
|
-
async addFootnote(params) {
|
|
789
|
+
async addFootnote(params, ctx) {
|
|
673
790
|
const p = findParagraphByBookmarkId(this.documentXml, params.paragraphId);
|
|
674
791
|
if (!p)
|
|
675
792
|
throw new Error(`Paragraph not found: ${params.paragraphId}`);
|
|
@@ -678,7 +795,7 @@ export class DocxDocument {
|
|
|
678
795
|
paragraphEl: p,
|
|
679
796
|
afterText: params.afterText,
|
|
680
797
|
text: params.text,
|
|
681
|
-
});
|
|
798
|
+
}, ctx);
|
|
682
799
|
await this.refreshFootnotesXml();
|
|
683
800
|
this.dirty = true;
|
|
684
801
|
this.documentViewCache = null;
|
|
@@ -687,8 +804,8 @@ export class DocxDocument {
|
|
|
687
804
|
/**
|
|
688
805
|
* Update the text content of an existing footnote.
|
|
689
806
|
*/
|
|
690
|
-
async updateFootnoteText(params) {
|
|
691
|
-
await updateFootnoteTextImpl(this.zip, params);
|
|
807
|
+
async updateFootnoteText(params, ctx) {
|
|
808
|
+
await updateFootnoteTextImpl(this.zip, params, ctx);
|
|
692
809
|
await this.refreshFootnotesXml();
|
|
693
810
|
this.dirty = true;
|
|
694
811
|
this.documentViewCache = null;
|
|
@@ -696,8 +813,8 @@ export class DocxDocument {
|
|
|
696
813
|
/**
|
|
697
814
|
* Delete a footnote and its references from the document.
|
|
698
815
|
*/
|
|
699
|
-
async deleteFootnote(params) {
|
|
700
|
-
await deleteFootnoteImpl(this.documentXml, this.zip, params);
|
|
816
|
+
async deleteFootnote(params, ctx) {
|
|
817
|
+
await deleteFootnoteImpl(this.documentXml, this.zip, params, ctx);
|
|
701
818
|
await this.refreshFootnotesXml();
|
|
702
819
|
this.dirty = true;
|
|
703
820
|
this.documentViewCache = null;
|
|
@@ -720,23 +837,49 @@ export class DocxDocument {
|
|
|
720
837
|
return null;
|
|
721
838
|
return parseXml(commentsText);
|
|
722
839
|
}
|
|
840
|
+
/**
|
|
841
|
+
* Serialize the document to a .docx buffer.
|
|
842
|
+
*
|
|
843
|
+
* With `minimalReserialization` (requires `cleanBookmarks`), top-level body
|
|
844
|
+
* blocks that no edit touched are restored element-for-element from the
|
|
845
|
+
* original document.xml instead of carrying the open-time normalization
|
|
846
|
+
* (proofErr stripping, run merging) to disk — so output diffs reflect the
|
|
847
|
+
* actual edit blast radius. Edited/inserted blocks are emitted as-is.
|
|
848
|
+
* Falls back to full re-serialization (blocksRestored: 0) when no original
|
|
849
|
+
* text was captured or reconciliation fails.
|
|
850
|
+
*
|
|
851
|
+
* @see https://github.com/UseJunior/safe-docx/issues/408
|
|
852
|
+
*/
|
|
723
853
|
async toBuffer(opts) {
|
|
724
854
|
// Always write the latest document.xml when saving.
|
|
725
855
|
// Important: when cleanBookmarks=true (download), we must NOT mutate session state.
|
|
726
856
|
const xmlWithBookmarks = serializeXml(this.documentXml);
|
|
857
|
+
maybeCaptureEmittedDocumentXml(xmlWithBookmarks);
|
|
727
858
|
this.zip.writeText('word/document.xml', xmlWithBookmarks);
|
|
728
859
|
if (opts?.cleanBookmarks) {
|
|
729
860
|
const cloned = parseXml(xmlWithBookmarks);
|
|
730
861
|
const bookmarksRemoved = cleanupInternalBookmarks(cloned);
|
|
862
|
+
let blocksRestored = 0;
|
|
863
|
+
if (opts.minimalReserialization && this.originalDocumentXmlText !== null) {
|
|
864
|
+
try {
|
|
865
|
+
blocksRestored = restoreUntouchedBlocks(cloned, this.originalDocumentXmlText);
|
|
866
|
+
}
|
|
867
|
+
catch {
|
|
868
|
+
// Reconciliation is best-effort; the fully re-serialized DOM is
|
|
869
|
+
// always a correct (if non-minimal) save.
|
|
870
|
+
blocksRestored = 0;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
731
873
|
const cleanedXml = serializeXml(cloned);
|
|
732
874
|
// Temporarily swap document.xml in the zip for output, then restore.
|
|
875
|
+
maybeCaptureEmittedDocumentXml(cleanedXml);
|
|
733
876
|
this.zip.writeText('word/document.xml', cleanedXml);
|
|
734
877
|
const buffer = await this.zip.toBuffer();
|
|
735
878
|
this.zip.writeText('word/document.xml', xmlWithBookmarks);
|
|
736
|
-
return { buffer, bookmarksRemoved };
|
|
879
|
+
return { buffer, bookmarksRemoved, blocksRestored };
|
|
737
880
|
}
|
|
738
881
|
const buffer = await this.zip.toBuffer();
|
|
739
|
-
return { buffer, bookmarksRemoved: 0 };
|
|
882
|
+
return { buffer, bookmarksRemoved: 0, blocksRestored: 0 };
|
|
740
883
|
}
|
|
741
884
|
}
|
|
742
885
|
//# sourceMappingURL=document.js.map
|