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
|
@@ -8,8 +8,11 @@ import { XMLSerializer } from '@xmldom/xmldom';
|
|
|
8
8
|
import { parseXml } from '../../primitives/xml.js';
|
|
9
9
|
import { CorrelationStatus } from '../../core-types.js';
|
|
10
10
|
import { getLeafText, childElements, findChildByTagName } from '../../primitives/index.js';
|
|
11
|
+
import { allocateRevisionId, buildPPrChangeElement, convertSerializedDeletionContent, createRevisionContext, createRevisionIdState, escapeXmlAttr, formatDate, wrapSerializedContentWithDel, wrapSerializedContentWithIns, } from '../../primitives/track-changes-emitter.js';
|
|
11
12
|
import { serializeToXml, cloneElement } from './xmlToWmlElement.js';
|
|
12
|
-
import { EMPTY_PARAGRAPH_TAG } from '../../atomizer.js';
|
|
13
|
+
import { EMPTY_PARAGRAPH_TAG, isParagraphLevelLeaf, nearestHyperlinkAncestor } from '../../atomizer.js';
|
|
14
|
+
import { enforceConsumerCompatibility } from './consumerCompatibility.js';
|
|
15
|
+
import { placeParagraphMarkRevisionMarker } from './inPlaceModifier-wrappers.js';
|
|
13
16
|
import { areRunPropertiesEqual } from '../../format-detection.js';
|
|
14
17
|
import { debug } from './debug.js';
|
|
15
18
|
const SYNTHETIC_DOC = parseXml('<root xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>');
|
|
@@ -21,21 +24,6 @@ function createEl(tag, attrs) {
|
|
|
21
24
|
el.setAttribute(k, v);
|
|
22
25
|
return el;
|
|
23
26
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Create initial revision ID state.
|
|
26
|
-
*/
|
|
27
|
-
function createRevisionIdState() {
|
|
28
|
-
return {
|
|
29
|
-
nextId: 1,
|
|
30
|
-
moveRangeIds: new Map(),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Allocate a new revision ID.
|
|
35
|
-
*/
|
|
36
|
-
function allocateRevisionId(state) {
|
|
37
|
-
return state.nextId++;
|
|
38
|
-
}
|
|
39
27
|
/**
|
|
40
28
|
* Get or allocate move range IDs for a move name.
|
|
41
29
|
*/
|
|
@@ -50,12 +38,6 @@ function getMoveRangeIds(state, moveName) {
|
|
|
50
38
|
}
|
|
51
39
|
return ids;
|
|
52
40
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Format date for OOXML (ISO 8601).
|
|
55
|
-
*/
|
|
56
|
-
function formatDate(date) {
|
|
57
|
-
return date.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
58
|
-
}
|
|
59
41
|
/**
|
|
60
42
|
* Reconstruct document.xml from merged atoms with track changes.
|
|
61
43
|
*
|
|
@@ -87,7 +69,7 @@ export function reconstructDocument(mergedAtoms, originalXml, options) {
|
|
|
87
69
|
const emptyCounters = getEmptyParagraphCounters();
|
|
88
70
|
debug('reconstructor', `Empty paragraphs: inserted=${emptyCounters.inserted}, deleted=${emptyCounters.deleted}, equal=${emptyCounters.equal}, other=${emptyCounters.other}`);
|
|
89
71
|
// Reconstruct the document, preserving original body structure (tables, SDTs, etc.)
|
|
90
|
-
return buildDocumentPreservingStructure(originalXml, paragraphXmls, paragraphGroups);
|
|
72
|
+
return buildDocumentPreservingStructure(originalXml, paragraphXmls, paragraphGroups, () => allocateRevisionId(revState));
|
|
91
73
|
}
|
|
92
74
|
/**
|
|
93
75
|
* Group atoms by paragraph based on their ancestor chain.
|
|
@@ -342,8 +324,14 @@ function shouldStartNewRunGroup(currentGroup, atom) {
|
|
|
342
324
|
if (currentGroup.moveName !== atom.moveName) {
|
|
343
325
|
return true;
|
|
344
326
|
}
|
|
345
|
-
// Skip rPr splitting for MovedSource/MovedDestination
|
|
346
|
-
//
|
|
327
|
+
// Skip rPr splitting for MovedSource/MovedDestination: every moved run
|
|
328
|
+
// group is wrapped by wrapWithMoveFrom/wrapWithMoveTo, so splitting one
|
|
329
|
+
// move into several groups would emit moveFromRangeStart/End (resp.
|
|
330
|
+
// moveToRangeStart/End) once per slice with the same w:name and range ids.
|
|
331
|
+
// This stays required now that explicit move-range markers atomize: the
|
|
332
|
+
// synthetic-range suppression keyed off those markers is per paragraph, so
|
|
333
|
+
// a detected move in a marker-free paragraph still synthesizes one range
|
|
334
|
+
// pair per moved run group.
|
|
347
335
|
if (currentGroup.status === CorrelationStatus.MovedSource ||
|
|
348
336
|
currentGroup.status === CorrelationStatus.MovedDestination) {
|
|
349
337
|
return false;
|
|
@@ -419,10 +407,28 @@ function isEmptyParagraphGroup(group) {
|
|
|
419
407
|
}
|
|
420
408
|
return group.runGroups.length > 0;
|
|
421
409
|
}
|
|
410
|
+
const NO_EXPLICIT_MOVE_MARKERS = { moveFrom: false, moveTo: false };
|
|
411
|
+
function collectExplicitMoveMarkers(group) {
|
|
412
|
+
let moveFrom = false;
|
|
413
|
+
let moveTo = false;
|
|
414
|
+
for (const runGroup of group.runGroups) {
|
|
415
|
+
for (const atom of runGroup.atoms) {
|
|
416
|
+
const tag = atom.contentElement.tagName;
|
|
417
|
+
if (tag === 'w:moveFromRangeStart' || tag === 'w:moveFromRangeEnd') {
|
|
418
|
+
moveFrom = true;
|
|
419
|
+
}
|
|
420
|
+
else if (tag === 'w:moveToRangeStart' || tag === 'w:moveToRangeEnd') {
|
|
421
|
+
moveTo = true;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return { moveFrom, moveTo };
|
|
426
|
+
}
|
|
422
427
|
/**
|
|
423
428
|
* Build XML for a single paragraph with track changes.
|
|
424
429
|
*/
|
|
425
430
|
function buildParagraphXml(group, author, dateStr, revState) {
|
|
431
|
+
const revisionCtx = createRevisionContext({ author, date: dateStr, idState: revState });
|
|
426
432
|
// Track empty paragraph statuses for debugging
|
|
427
433
|
if (isEmptyParagraphGroup(group)) {
|
|
428
434
|
const status = group.runGroups[0]?.atoms[0]?.correlationStatus;
|
|
@@ -460,33 +466,25 @@ function buildParagraphXml(group, author, dateStr, revState) {
|
|
|
460
466
|
// entirely (instead of leaving behind a stub <w:p> break).
|
|
461
467
|
if (isEntireParagraphWithStatus(group, CorrelationStatus.Inserted)) {
|
|
462
468
|
const paraId = allocateRevisionId(revState);
|
|
463
|
-
const
|
|
464
|
-
|
|
469
|
+
const insertedRunXml = paragraphHasHyperlinkAtoms(group)
|
|
470
|
+
? buildWholeParagraphRevisionContent(group, (runs) => wrapSerializedContentWithIns(runs, revisionCtx))
|
|
471
|
+
: wrapSerializedContentWithIns(group.runGroups.map((runGroup) => buildRunContentAsPlainRun(runGroup)).join(''), revisionCtx);
|
|
472
|
+
const pPrChangeEl = buildPPrChangeElement(group.pPr, revisionCtx);
|
|
465
473
|
const parts = [];
|
|
466
474
|
parts.push('<w:p>');
|
|
467
475
|
parts.push(serializePPrWithParaRevisionMarker(group.pPr, 'w:ins', paraId, author, dateStr, pPrChangeEl));
|
|
468
|
-
parts.push(
|
|
469
|
-
for (const runGroup of group.runGroups) {
|
|
470
|
-
parts.push(buildRunContentAsPlainRun(runGroup));
|
|
471
|
-
}
|
|
472
|
-
parts.push('</w:ins>');
|
|
476
|
+
parts.push(insertedRunXml);
|
|
473
477
|
parts.push('</w:p>');
|
|
474
478
|
return parts.join('');
|
|
475
479
|
}
|
|
476
480
|
if (isEntireParagraphWithStatus(group, CorrelationStatus.Deleted)) {
|
|
477
481
|
const paraId = allocateRevisionId(revState);
|
|
478
|
-
const runId = allocateRevisionId(revState);
|
|
479
482
|
const parts = [];
|
|
480
483
|
parts.push('<w:p>');
|
|
481
484
|
parts.push(serializePPrWithParaRevisionMarker(group.pPr, 'w:del', paraId, author, dateStr));
|
|
482
|
-
parts.push(
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
parts.push(plainRun
|
|
486
|
-
.replace(/<w:t([^>]*)>([^<]*)<\/w:t>/g, '<w:delText$1>$2</w:delText>')
|
|
487
|
-
.replace(/<w:instrText([^>]*)>([^<]*)<\/w:instrText>/g, '<w:delInstrText$1>$2</w:delInstrText>'));
|
|
488
|
-
}
|
|
489
|
-
parts.push('</w:del>');
|
|
485
|
+
parts.push(paragraphHasHyperlinkAtoms(group)
|
|
486
|
+
? buildWholeParagraphRevisionContent(group, (runs) => wrapSerializedContentWithDel(runs, revisionCtx))
|
|
487
|
+
: wrapSerializedContentWithDel(group.runGroups.map((runGroup) => buildRunContentAsPlainRun(runGroup)).join(''), revisionCtx));
|
|
490
488
|
parts.push('</w:p>');
|
|
491
489
|
return parts.join('');
|
|
492
490
|
}
|
|
@@ -495,7 +493,7 @@ function buildParagraphXml(group, author, dateStr, revState) {
|
|
|
495
493
|
// marker inside w:pPr > w:rPr.
|
|
496
494
|
if (isEmptyParagraphWithStatus(group, CorrelationStatus.Inserted)) {
|
|
497
495
|
const paraId = allocateRevisionId(revState);
|
|
498
|
-
const pPrChangeEl = buildPPrChangeElement(group.pPr,
|
|
496
|
+
const pPrChangeEl = buildPPrChangeElement(group.pPr, revisionCtx);
|
|
499
497
|
const pPrXml = serializePPrWithParaRevisionMarker(group.pPr, 'w:ins', paraId, author, dateStr, pPrChangeEl);
|
|
500
498
|
return `<w:p>${pPrXml}</w:p>`;
|
|
501
499
|
}
|
|
@@ -511,10 +509,18 @@ function buildParagraphXml(group, author, dateStr, revState) {
|
|
|
511
509
|
if (group.pPr) {
|
|
512
510
|
parts.push(serializeToXml(group.pPr));
|
|
513
511
|
}
|
|
514
|
-
// Add run groups with track changes
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
512
|
+
// Add run groups with track changes, restoring w:hyperlink wrappers when
|
|
513
|
+
// the paragraph contains hyperlink atoms (issue #368). Hyperlink-free
|
|
514
|
+
// paragraphs keep the legacy per-group emission byte-identical.
|
|
515
|
+
const explicitMoveMarkers = collectExplicitMoveMarkers(group);
|
|
516
|
+
if (paragraphHasHyperlinkAtoms(group)) {
|
|
517
|
+
parts.push(buildRunGroupsWithHyperlinks(group.runGroups, author, dateStr, revState, explicitMoveMarkers));
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
for (const runGroup of group.runGroups) {
|
|
521
|
+
const runXml = buildRunGroupXml(runGroup, author, dateStr, revState, explicitMoveMarkers);
|
|
522
|
+
parts.push(runXml);
|
|
523
|
+
}
|
|
518
524
|
}
|
|
519
525
|
parts.push('</w:p>');
|
|
520
526
|
return parts.join('');
|
|
@@ -542,43 +548,25 @@ function serializePPrWithParaRevisionMarker(pPr, markerTag, id, author, dateStr,
|
|
|
542
548
|
effectivePPr.appendChild(rPr);
|
|
543
549
|
}
|
|
544
550
|
}
|
|
545
|
-
//
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
551
|
+
// Reuse a pre-existing paragraph-mark marker of the same kind cloned from the
|
|
552
|
+
// source pPr (issue #452): CT_ParaRPr allows at most one of each tracked-change
|
|
553
|
+
// child, and the source revision's metadata (author/date/id) outranks a
|
|
554
|
+
// synthetic duplicate. Either way the marker is placed in its schema-correct
|
|
555
|
+
// slot ahead of formatting children.
|
|
556
|
+
const existingMarker = findChildByTagName(rPr, markerTag);
|
|
557
|
+
const marker = existingMarker ??
|
|
558
|
+
createEl(markerTag, {
|
|
559
|
+
'w:id': String(id),
|
|
560
|
+
'w:author': author,
|
|
561
|
+
'w:date': dateStr,
|
|
562
|
+
});
|
|
563
|
+
placeParagraphMarkRevisionMarker(rPr, marker, markerTag);
|
|
552
564
|
// Append pPrChange at end if provided.
|
|
553
565
|
if (pPrChangeEl) {
|
|
554
566
|
effectivePPr.appendChild(pPrChangeEl);
|
|
555
567
|
}
|
|
556
568
|
return serializeToXml(effectivePPr);
|
|
557
569
|
}
|
|
558
|
-
/**
|
|
559
|
-
* Build a `<w:pPrChange>` Element from a pPr DOM element.
|
|
560
|
-
*
|
|
561
|
-
* The child `<w:pPr>` conforms to CT_PPrBase — it excludes w:rPr, w:sectPr,
|
|
562
|
-
* w:rPrChange, and w:pPrChange.
|
|
563
|
-
*/
|
|
564
|
-
function buildPPrChangeElement(pPr, author, dateStr, revState) {
|
|
565
|
-
const id = allocateRevisionId(revState);
|
|
566
|
-
const EXCLUDED = new Set(['w:rPr', 'w:rPrChange', 'w:pPrChange', 'w:sectPr']);
|
|
567
|
-
const pPrChange = createEl('w:pPrChange', {
|
|
568
|
-
'w:id': String(id),
|
|
569
|
-
'w:author': author,
|
|
570
|
-
'w:date': dateStr,
|
|
571
|
-
});
|
|
572
|
-
const oldPPr = createEl('w:pPr');
|
|
573
|
-
if (pPr) {
|
|
574
|
-
for (const child of childElements(pPr)) {
|
|
575
|
-
if (!EXCLUDED.has(child.tagName))
|
|
576
|
-
oldPPr.appendChild(child.cloneNode(true));
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
pPrChange.appendChild(oldPPr);
|
|
580
|
-
return pPrChange;
|
|
581
|
-
}
|
|
582
570
|
/**
|
|
583
571
|
* Returns true if every atom in the paragraph is of the specified status
|
|
584
572
|
* (ignoring EMPTY_PARAGRAPH_TAG markers).
|
|
@@ -622,6 +610,11 @@ function buildRunContentAsPlainRun(group) {
|
|
|
622
610
|
const contentAtoms = group.atoms.filter((atom) => atom.contentElement.tagName !== EMPTY_PARAGRAPH_TAG);
|
|
623
611
|
if (contentAtoms.length === 0)
|
|
624
612
|
return '';
|
|
613
|
+
// Paragraph-level markers must sit outside <w:r>; route through the
|
|
614
|
+
// marker-aware helper which buffers run atoms and flushes on each marker.
|
|
615
|
+
if (groupHasParagraphLevelAtoms(group)) {
|
|
616
|
+
return buildRunContentWithParagraphMarkers(group);
|
|
617
|
+
}
|
|
625
618
|
// If group has explicit rPr, emit a single run
|
|
626
619
|
if (group.rPr !== null) {
|
|
627
620
|
return buildSingleRun(group.atoms, group.rPr);
|
|
@@ -632,8 +625,12 @@ function buildRunContentAsPlainRun(group) {
|
|
|
632
625
|
}
|
|
633
626
|
/**
|
|
634
627
|
* Build XML for a run group with appropriate track changes wrapper.
|
|
628
|
+
*
|
|
629
|
+
* `explicitMoveMarkers` reports whether the surrounding paragraph's atom
|
|
630
|
+
* stream already carries explicit moveFromRange / moveToRange markers; moved
|
|
631
|
+
* groups then skip synthetic range emission (see ExplicitMoveMarkers).
|
|
635
632
|
*/
|
|
636
|
-
function buildRunGroupXml(group, author, dateStr, revState) {
|
|
633
|
+
function buildRunGroupXml(group, author, dateStr, revState, explicitMoveMarkers = NO_EXPLICIT_MOVE_MARKERS) {
|
|
637
634
|
const runContent = buildRunContent(group);
|
|
638
635
|
// If run content is empty (e.g., only empty paragraph atoms), return empty string
|
|
639
636
|
// This avoids generating empty track changes wrappers
|
|
@@ -649,9 +646,9 @@ function buildRunGroupXml(group, author, dateStr, revState) {
|
|
|
649
646
|
case CorrelationStatus.Deleted:
|
|
650
647
|
return wrapWithDel(runContent, author, dateStr, revState);
|
|
651
648
|
case CorrelationStatus.MovedSource:
|
|
652
|
-
return wrapWithMoveFrom(runContent, author, dateStr, group.moveName || 'move1', revState);
|
|
649
|
+
return wrapWithMoveFrom(runContent, author, dateStr, group.moveName || 'move1', revState, explicitMoveMarkers.moveFrom);
|
|
653
650
|
case CorrelationStatus.MovedDestination:
|
|
654
|
-
return wrapWithMoveTo(runContent, author, dateStr, group.moveName || 'move1', revState);
|
|
651
|
+
return wrapWithMoveTo(runContent, author, dateStr, group.moveName || 'move1', revState, explicitMoveMarkers.moveTo);
|
|
655
652
|
case CorrelationStatus.FormatChanged:
|
|
656
653
|
// For format changes, we include the run with rPrChange
|
|
657
654
|
return buildFormatChangeRun(group, author, dateStr, revState);
|
|
@@ -707,6 +704,244 @@ function subGroupByRPr(atoms) {
|
|
|
707
704
|
result.push({ rPr: currentRPr, atoms: currentAtoms });
|
|
708
705
|
return result;
|
|
709
706
|
}
|
|
707
|
+
/**
|
|
708
|
+
* Attribute fingerprint of a w:hyperlink element, used to recognize "the
|
|
709
|
+
* same" hyperlink across the original and revised trees (equal/deleted atoms
|
|
710
|
+
* reference the original tree's element, inserted atoms the revised tree's).
|
|
711
|
+
*/
|
|
712
|
+
function hyperlinkKey(el) {
|
|
713
|
+
const parts = [];
|
|
714
|
+
for (let i = 0; i < el.attributes.length; i++) {
|
|
715
|
+
const attr = el.attributes.item(i);
|
|
716
|
+
if (attr.name.startsWith('xmlns'))
|
|
717
|
+
continue;
|
|
718
|
+
parts.push(`${attr.name}=${attr.value}`);
|
|
719
|
+
}
|
|
720
|
+
return parts.sort().join('\u0000');
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Resolve the hyperlink wrapper an atom belongs to, preferring the
|
|
724
|
+
* original-tree element so the re-emitted r:id resolves against the
|
|
725
|
+
* original-based rebuild package: deleted atoms carry original ancestry
|
|
726
|
+
* directly; equal atoms (revised tree) reach it via comparisonUnitAtomBefore.
|
|
727
|
+
*
|
|
728
|
+
* @conformance ECMA-376 edition 5, Part 1 § 17.16.22
|
|
729
|
+
* @see https://github.com/UseJunior/safe-docx/issues/368
|
|
730
|
+
*/
|
|
731
|
+
function resolveHyperlinkForAtom(atom) {
|
|
732
|
+
const own = nearestHyperlinkAncestor(atom);
|
|
733
|
+
if (!own)
|
|
734
|
+
return null;
|
|
735
|
+
if (atom.sourceDocument === 'original') {
|
|
736
|
+
return { element: own, key: hyperlinkKey(own), fromOriginal: true };
|
|
737
|
+
}
|
|
738
|
+
const before = atom.comparisonUnitAtomBefore;
|
|
739
|
+
const beforeHyperlink = before ? nearestHyperlinkAncestor(before) : null;
|
|
740
|
+
// Attribute to the original wrapper only when both trees agree on the
|
|
741
|
+
// hyperlink's attributes. When they differ (e.g. the revision retargeted
|
|
742
|
+
// the link to a new r:id), emitting the original wrapper would pin the
|
|
743
|
+
// still-equal link text to the STALE target in the accepted document —
|
|
744
|
+
// worse than dropping the wrapper. Such atoms fall through to the
|
|
745
|
+
// revised-only policy below instead.
|
|
746
|
+
// TODO(#376): the faithful tracked representation of a retargeted link
|
|
747
|
+
// is delete-old-link + insert-new-link (what Word emits), which needs the
|
|
748
|
+
// hyperlink fingerprint in atom identity so the LCS stops matching text
|
|
749
|
+
// across different link targets.
|
|
750
|
+
if (beforeHyperlink && hyperlinkKey(beforeHyperlink) === hyperlinkKey(own)) {
|
|
751
|
+
return { element: beforeHyperlink, key: hyperlinkKey(beforeHyperlink), fromOriginal: true };
|
|
752
|
+
}
|
|
753
|
+
// Revised-only attribution (purely inserted hyperlink). Emitting its r:id
|
|
754
|
+
// would dangle against the original-based package, so the caller only
|
|
755
|
+
// wraps when the hyperlink carries no relationship reference (anchor-only).
|
|
756
|
+
return { element: own, key: hyperlinkKey(own), fromOriginal: false };
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Whether a resolved hyperlink is safe to re-emit. Original-attributed
|
|
760
|
+
* wrappers always are; revised-only wrappers are safe only without an r:id
|
|
761
|
+
* (internal anchor links), because the rebuild package ships the ORIGINAL
|
|
762
|
+
* document.xml.rels and a revised-only r:id would be a dangling reference
|
|
763
|
+
* (Word treats those as a corrupt package). Revised-only r:id hyperlinks
|
|
764
|
+
* keep today's behavior — content emitted unwrapped.
|
|
765
|
+
*/
|
|
766
|
+
function isEmittableHyperlink(resolved) {
|
|
767
|
+
return resolved.fromOriginal || resolved.element.getAttribute('r:id') === null;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* True when any atom in the paragraph sits inside a w:hyperlink. Gates the
|
|
771
|
+
* hyperlink-aware emission paths so hyperlink-free paragraphs keep the
|
|
772
|
+
* byte-identical legacy output.
|
|
773
|
+
*/
|
|
774
|
+
function paragraphHasHyperlinkAtoms(group) {
|
|
775
|
+
return group.runGroups.some((rg) => rg.atoms.some((atom) => nearestHyperlinkAncestor(atom) !== null));
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Split a RunGroup into contiguous hyperlink-pure sub-groups.
|
|
779
|
+
*
|
|
780
|
+
* Moved groups are returned whole: splitting them would emit
|
|
781
|
+
* moveFromRangeStart/End once per slice, corrupting the move ranges. A move
|
|
782
|
+
* spanning a hyperlink keeps today's unwrapped emission.
|
|
783
|
+
*/
|
|
784
|
+
function splitRunGroupByHyperlink(group) {
|
|
785
|
+
if (group.status === CorrelationStatus.MovedSource ||
|
|
786
|
+
group.status === CorrelationStatus.MovedDestination) {
|
|
787
|
+
return [{ group, hyperlink: null }];
|
|
788
|
+
}
|
|
789
|
+
const segments = [];
|
|
790
|
+
let current = null;
|
|
791
|
+
for (const atom of group.atoms) {
|
|
792
|
+
// Emit-ability is decided per merged bucket, not per atom: an inserted
|
|
793
|
+
// atom inside an otherwise-original hyperlink folds into the adjacent
|
|
794
|
+
// original-attributed bucket via the shared key.
|
|
795
|
+
const resolved = resolveHyperlinkForAtom(atom);
|
|
796
|
+
const key = resolved?.key ?? null;
|
|
797
|
+
if (current && (current.hyperlink?.key ?? null) === key) {
|
|
798
|
+
current.group.atoms.push(atom);
|
|
799
|
+
// Prefer an original-attributed representative within the segment.
|
|
800
|
+
if (resolved?.fromOriginal && current.hyperlink && !current.hyperlink.fromOriginal) {
|
|
801
|
+
current.hyperlink = resolved;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
current = {
|
|
806
|
+
group: { ...group, atoms: [atom] },
|
|
807
|
+
hyperlink: resolved,
|
|
808
|
+
};
|
|
809
|
+
segments.push(current);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return segments;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Serialize the opening tag of a re-emitted w:hyperlink wrapper, copying the
|
|
816
|
+
* source element's attributes verbatim (r:id, w:anchor, w:history, ...).
|
|
817
|
+
*/
|
|
818
|
+
function serializeHyperlinkOpenTag(el) {
|
|
819
|
+
const attrs = [];
|
|
820
|
+
for (let i = 0; i < el.attributes.length; i++) {
|
|
821
|
+
const attr = el.attributes.item(i);
|
|
822
|
+
if (attr.name.startsWith('xmlns'))
|
|
823
|
+
continue;
|
|
824
|
+
attrs.push(` ${attr.name}="${escapeXmlAttr(attr.value)}"`);
|
|
825
|
+
}
|
|
826
|
+
return `<w:hyperlink${attrs.join('')}>`;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Merge adjacent segments that resolve to the same hyperlink fingerprint, so
|
|
830
|
+
* an equal/deleted/inserted sequence inside one link shares one wrapper.
|
|
831
|
+
*/
|
|
832
|
+
function mergeAdjacentHyperlinkSegments(segments) {
|
|
833
|
+
const buckets = [];
|
|
834
|
+
for (const segment of segments) {
|
|
835
|
+
const last = buckets[buckets.length - 1];
|
|
836
|
+
if (last && (last.hyperlink?.key ?? null) === (segment.hyperlink?.key ?? null)) {
|
|
837
|
+
last.groups.push(segment.group);
|
|
838
|
+
if (segment.hyperlink?.fromOriginal && last.hyperlink && !last.hyperlink.fromOriginal) {
|
|
839
|
+
last.hyperlink = segment.hyperlink;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
buckets.push({ hyperlink: segment.hyperlink, groups: [segment.group] });
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return buckets;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Emit a paragraph's run groups with w:hyperlink wrappers restored around the
|
|
850
|
+
* runs whose atoms came from inside a hyperlink. Track-change wrappers nest
|
|
851
|
+
* INSIDE the hyperlink (`<w:hyperlink><w:ins>…`): CT_Hyperlink admits
|
|
852
|
+
* EG_RunLevelElts (w:ins / w:del / range markers), while CT_RunTrackChange
|
|
853
|
+
* does not admit w:hyperlink.
|
|
854
|
+
*
|
|
855
|
+
* @conformance ECMA-376 edition 5, Part 1 § 17.16.22
|
|
856
|
+
* @see https://github.com/UseJunior/safe-docx/issues/368
|
|
857
|
+
*/
|
|
858
|
+
function buildRunGroupsWithHyperlinks(runGroups, author, dateStr, revState, explicitMoveMarkers = NO_EXPLICIT_MOVE_MARKERS) {
|
|
859
|
+
const buckets = mergeAdjacentHyperlinkSegments(runGroups.flatMap(splitRunGroupByHyperlink));
|
|
860
|
+
const parts = [];
|
|
861
|
+
for (const bucket of buckets) {
|
|
862
|
+
const content = bucket.groups
|
|
863
|
+
.map((g) => buildRunGroupXml(g, author, dateStr, revState, explicitMoveMarkers))
|
|
864
|
+
.join('');
|
|
865
|
+
if (!content)
|
|
866
|
+
continue;
|
|
867
|
+
parts.push(bucket.hyperlink && isEmittableHyperlink(bucket.hyperlink)
|
|
868
|
+
? `${serializeHyperlinkOpenTag(bucket.hyperlink.element)}${content}</w:hyperlink>`
|
|
869
|
+
: content);
|
|
870
|
+
}
|
|
871
|
+
return parts.join('');
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Whole-paragraph insert/delete emission with hyperlink wrappers restored.
|
|
875
|
+
* Each bucket gets its own revision wrapper so the hyperlink can stay
|
|
876
|
+
* OUTSIDE the w:ins / w:del (see buildRunGroupsWithHyperlinks).
|
|
877
|
+
*/
|
|
878
|
+
function buildWholeParagraphRevisionContent(group, wrap) {
|
|
879
|
+
const buckets = mergeAdjacentHyperlinkSegments(group.runGroups.flatMap(splitRunGroupByHyperlink));
|
|
880
|
+
const parts = [];
|
|
881
|
+
for (const bucket of buckets) {
|
|
882
|
+
const runs = bucket.groups.map((g) => buildRunContentAsPlainRun(g)).join('');
|
|
883
|
+
if (!runs)
|
|
884
|
+
continue;
|
|
885
|
+
const wrapped = wrap(runs);
|
|
886
|
+
parts.push(bucket.hyperlink && isEmittableHyperlink(bucket.hyperlink)
|
|
887
|
+
? `${serializeHyperlinkOpenTag(bucket.hyperlink.element)}${wrapped}</w:hyperlink>`
|
|
888
|
+
: wrapped);
|
|
889
|
+
}
|
|
890
|
+
return parts.join('');
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Returns true when any atom in the group is a paragraph-level marker
|
|
894
|
+
* (commentRange / bookmark / moveFromRange / moveToRange / perm) that must
|
|
895
|
+
* be emitted outside <w:r>.
|
|
896
|
+
*/
|
|
897
|
+
function groupHasParagraphLevelAtoms(group) {
|
|
898
|
+
for (const atom of group.atoms) {
|
|
899
|
+
if (isParagraphLevelLeaf(atom.contentElement))
|
|
900
|
+
return true;
|
|
901
|
+
}
|
|
902
|
+
return false;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Marker-aware emission for run groups containing paragraph-level atoms.
|
|
906
|
+
*
|
|
907
|
+
* Walks atoms left-to-right. Run-level atoms accumulate in a buffer; on
|
|
908
|
+
* encountering a paragraph-level atom (or end of group) the buffer is flushed
|
|
909
|
+
* via subGroupByRPr + buildSingleRun (one <w:r> per contiguous rPr) and the
|
|
910
|
+
* marker is emitted as a bare element.
|
|
911
|
+
*
|
|
912
|
+
* group.rPr is intentionally ignored here — RunGroup.rPr is captured from the
|
|
913
|
+
* first atom in groupAtomsByParagraph(), and for moved groups
|
|
914
|
+
* shouldStartNewRunGroup() suppresses rPr-based splitting. Always re-deriving
|
|
915
|
+
* rPr per atom prevents formatting bleed and bogus rPr inheritance from
|
|
916
|
+
* illegally nested markers.
|
|
917
|
+
*/
|
|
918
|
+
function buildRunContentWithParagraphMarkers(group) {
|
|
919
|
+
const parts = [];
|
|
920
|
+
let runBuffer = [];
|
|
921
|
+
const flush = () => {
|
|
922
|
+
if (runBuffer.length === 0)
|
|
923
|
+
return;
|
|
924
|
+
for (const sg of subGroupByRPr(runBuffer)) {
|
|
925
|
+
const run = buildSingleRun(sg.atoms, sg.rPr);
|
|
926
|
+
if (run)
|
|
927
|
+
parts.push(run);
|
|
928
|
+
}
|
|
929
|
+
runBuffer = [];
|
|
930
|
+
};
|
|
931
|
+
for (const atom of group.atoms) {
|
|
932
|
+
if (atom.contentElement.tagName === EMPTY_PARAGRAPH_TAG)
|
|
933
|
+
continue;
|
|
934
|
+
if (isParagraphLevelLeaf(atom.contentElement)) {
|
|
935
|
+
flush();
|
|
936
|
+
parts.push(serializeAtomElement(atom.contentElement));
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
939
|
+
runBuffer.push(atom);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
flush();
|
|
943
|
+
return parts.join('');
|
|
944
|
+
}
|
|
710
945
|
/**
|
|
711
946
|
* Build a single <w:r> element from a set of atoms with the given rPr.
|
|
712
947
|
* Preserves pendingText coalescing, collapsedFieldAtoms expansion,
|
|
@@ -801,6 +1036,11 @@ function buildRunContent(group) {
|
|
|
801
1036
|
if (contentAtoms.length === 0) {
|
|
802
1037
|
return '';
|
|
803
1038
|
}
|
|
1039
|
+
// Paragraph-level markers must sit outside <w:r>; route through the
|
|
1040
|
+
// marker-aware helper which buffers run atoms and flushes on each marker.
|
|
1041
|
+
if (groupHasParagraphLevelAtoms(group)) {
|
|
1042
|
+
return buildRunContentWithParagraphMarkers(group);
|
|
1043
|
+
}
|
|
804
1044
|
// If group has explicit rPr, emit a single run
|
|
805
1045
|
if (group.rPr !== null) {
|
|
806
1046
|
return buildSingleRun(group.atoms, group.rPr);
|
|
@@ -813,38 +1053,49 @@ function buildRunContent(group) {
|
|
|
813
1053
|
* Wrap content with w:ins element.
|
|
814
1054
|
*/
|
|
815
1055
|
function wrapWithIns(content, author, dateStr, revState) {
|
|
816
|
-
|
|
817
|
-
return `<w:ins w:id="${id}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}">${content}</w:ins>`;
|
|
1056
|
+
return wrapSerializedContentWithIns(content, createRevisionContext({ author, date: dateStr, idState: revState }));
|
|
818
1057
|
}
|
|
819
1058
|
/**
|
|
820
1059
|
* Wrap content with w:del element.
|
|
821
1060
|
*/
|
|
822
1061
|
function wrapWithDel(content, author, dateStr, revState) {
|
|
823
|
-
|
|
824
|
-
// For deletions, convert w:t to w:delText and w:instrText to w:delInstrText
|
|
825
|
-
const delContent = content
|
|
826
|
-
.replace(/<w:t([^>]*)>([^<]*)<\/w:t>/g, '<w:delText$1>$2</w:delText>')
|
|
827
|
-
.replace(/<w:instrText([^>]*)>([^<]*)<\/w:instrText>/g, '<w:delInstrText$1>$2</w:delInstrText>');
|
|
828
|
-
return `<w:del w:id="${id}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}">${delContent}</w:del>`;
|
|
1062
|
+
return wrapSerializedContentWithDel(content, createRevisionContext({ author, date: dateStr, idState: revState }));
|
|
829
1063
|
}
|
|
830
1064
|
/**
|
|
831
1065
|
* Wrap content with w:moveFrom elements.
|
|
1066
|
+
*
|
|
1067
|
+
* When `suppressRangeMarkers` is true the paragraph's atom stream already
|
|
1068
|
+
* carries explicit w:moveFromRangeStart/End markers (re-emitted by
|
|
1069
|
+
* buildRunContentWithParagraphMarkers), so only the w:moveFrom wrapper is
|
|
1070
|
+
* synthesized — emitting a second range pair would corrupt the move ranges.
|
|
1071
|
+
*
|
|
1072
|
+
* @see https://github.com/UseJunior/safe-docx/issues/110
|
|
832
1073
|
*/
|
|
833
|
-
function wrapWithMoveFrom(content, author, dateStr, moveName, revState) {
|
|
1074
|
+
function wrapWithMoveFrom(content, author, dateStr, moveName, revState, suppressRangeMarkers = false) {
|
|
1075
|
+
if (suppressRangeMarkers) {
|
|
1076
|
+
const moveId = allocateRevisionId(revState);
|
|
1077
|
+
const delContent = convertSerializedDeletionContent(content);
|
|
1078
|
+
return `<w:moveFrom w:id="${moveId}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}">${delContent}</w:moveFrom>`;
|
|
1079
|
+
}
|
|
834
1080
|
const ids = getMoveRangeIds(revState, moveName);
|
|
835
1081
|
const moveId = allocateRevisionId(revState);
|
|
836
|
-
|
|
837
|
-
const delContent = content
|
|
838
|
-
.replace(/<w:t([^>]*)>([^<]*)<\/w:t>/g, '<w:delText$1>$2</w:delText>')
|
|
839
|
-
.replace(/<w:instrText([^>]*)>([^<]*)<\/w:instrText>/g, '<w:delInstrText$1>$2</w:delInstrText>');
|
|
1082
|
+
const delContent = convertSerializedDeletionContent(content);
|
|
840
1083
|
return (`<w:moveFromRangeStart w:id="${ids.sourceRangeId}" w:name="${moveName}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}"/>` +
|
|
841
1084
|
`<w:moveFrom w:id="${moveId}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}">${delContent}</w:moveFrom>` +
|
|
842
1085
|
`<w:moveFromRangeEnd w:id="${ids.sourceRangeId}"/>`);
|
|
843
1086
|
}
|
|
844
1087
|
/**
|
|
845
1088
|
* Wrap content with w:moveTo elements.
|
|
1089
|
+
*
|
|
1090
|
+
* When `suppressRangeMarkers` is true the paragraph's atom stream already
|
|
1091
|
+
* carries explicit w:moveToRangeStart/End markers, so only the w:moveTo
|
|
1092
|
+
* wrapper is synthesized (see wrapWithMoveFrom).
|
|
846
1093
|
*/
|
|
847
|
-
function wrapWithMoveTo(content, author, dateStr, moveName, revState) {
|
|
1094
|
+
function wrapWithMoveTo(content, author, dateStr, moveName, revState, suppressRangeMarkers = false) {
|
|
1095
|
+
if (suppressRangeMarkers) {
|
|
1096
|
+
const moveId = allocateRevisionId(revState);
|
|
1097
|
+
return `<w:moveTo w:id="${moveId}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}">${content}</w:moveTo>`;
|
|
1098
|
+
}
|
|
848
1099
|
const ids = getMoveRangeIds(revState, moveName);
|
|
849
1100
|
const moveId = allocateRevisionId(revState);
|
|
850
1101
|
return (`<w:moveToRangeStart w:id="${ids.destRangeId}" w:name="${moveName}" w:author="${escapeXmlAttr(author)}" w:date="${dateStr}"/>` +
|
|
@@ -869,7 +1120,13 @@ function buildFormatChangeRun(group, author, dateStr, revState) {
|
|
|
869
1120
|
}
|
|
870
1121
|
}
|
|
871
1122
|
}
|
|
872
|
-
// Add rPrChange with old properties (wrapped in w:rPr per OOXML spec)
|
|
1123
|
+
// Add rPrChange with old properties (wrapped in w:rPr per OOXML spec).
|
|
1124
|
+
// Kept as the original per-child serialization (NOT delegated to
|
|
1125
|
+
// buildRPrChangeElement) to preserve byte-identical output: xmldom emits
|
|
1126
|
+
// inline `xmlns:w="..."` declarations when serializing detached children,
|
|
1127
|
+
// and downstream consumers may pin on that exact serialized form. The
|
|
1128
|
+
// DOM-aware buildRPrChangeElement helper exists for new primitive code
|
|
1129
|
+
// paths (#136 onward).
|
|
873
1130
|
const formatChange = group.atoms[0]?.formatChange;
|
|
874
1131
|
if (formatChange?.oldRunProperties) {
|
|
875
1132
|
const id = allocateRevisionId(revState);
|
|
@@ -946,7 +1203,7 @@ function isRootedGroup(group) {
|
|
|
946
1203
|
* <w:p> slots, inserted paragraphs are placed adjacent to their context, and
|
|
947
1204
|
* all structural wrappers (tables, SDTs, etc.) are preserved.
|
|
948
1205
|
*/
|
|
949
|
-
function buildDocumentPreservingStructure(originalXml, paragraphXmls, paragraphGroups) {
|
|
1206
|
+
function buildDocumentPreservingStructure(originalXml, paragraphXmls, paragraphGroups, allocateRevisionId) {
|
|
950
1207
|
const { doc, body, slots } = parseOriginalBodyStructure(originalXml);
|
|
951
1208
|
let slotCursor = 0;
|
|
952
1209
|
let lastEmittedNode = null;
|
|
@@ -1020,15 +1277,44 @@ function buildDocumentPreservingStructure(originalXml, paragraphXmls, paragraphG
|
|
|
1020
1277
|
const slot = slots[i];
|
|
1021
1278
|
slot.parent.removeChild(slot.element);
|
|
1022
1279
|
}
|
|
1023
|
-
// Strip inter-paragraph bookmark/comment
|
|
1024
|
-
// These are bookmarkStart/End, commentRangeStart/End
|
|
1025
|
-
//
|
|
1026
|
-
//
|
|
1027
|
-
//
|
|
1280
|
+
// Strip inter-paragraph bookmark/comment/move-range/permission markers from
|
|
1281
|
+
// the scaffold. These are bookmarkStart/End, commentRangeStart/End,
|
|
1282
|
+
// moveFromRange*/moveToRange*, and permStart/End elements that were siblings
|
|
1283
|
+
// of <w:p> in the original body. The paragraph rebuilder handles its own
|
|
1284
|
+
// bookmark logic, so keeping these orphaned markers causes unmatched
|
|
1285
|
+
// bookmark IDs. Body-level move-range markers are likewise scaffold
|
|
1286
|
+
// remnants: in-paragraph markers travel through the atom stream, and
|
|
1287
|
+
// detected moves synthesize fresh range pairs inside the reconstructed
|
|
1288
|
+
// paragraphs, so a leftover body-level pair would either dangle or double an
|
|
1289
|
+
// emitted range.
|
|
1290
|
+
//
|
|
1291
|
+
// Comment range markers are treated differently: a sibling-level
|
|
1292
|
+
// commentRangeStart/End is the legitimate shape for a comment range that
|
|
1293
|
+
// spans whole paragraphs, and such markers never enter the atom stream
|
|
1294
|
+
// (see isParagraphLevelLeaf in atomizer.ts), so nothing re-emits them.
|
|
1295
|
+
// Stripping them unconditionally destroys multi-paragraph comment ranges
|
|
1296
|
+
// (issue #103). Instead, strip a sibling-level comment range marker only
|
|
1297
|
+
// when its counterpart (same w:id) is absent from the rebuilt body —
|
|
1298
|
+
// i.e., it is a genuinely orphaned scaffold remnant.
|
|
1028
1299
|
const SCAFFOLD_STRIP_TAGS = new Set([
|
|
1029
1300
|
'w:bookmarkStart', 'w:bookmarkEnd',
|
|
1030
1301
|
'w:commentRangeStart', 'w:commentRangeEnd',
|
|
1302
|
+
'w:moveFromRangeStart', 'w:moveFromRangeEnd',
|
|
1303
|
+
'w:moveToRangeStart', 'w:moveToRangeEnd',
|
|
1304
|
+
'w:permStart', 'w:permEnd',
|
|
1031
1305
|
]);
|
|
1306
|
+
const COMMENT_RANGE_TAGS = new Set(['w:commentRangeStart', 'w:commentRangeEnd']);
|
|
1307
|
+
const commentRangeStartIds = new Set();
|
|
1308
|
+
const commentRangeEndIds = new Set();
|
|
1309
|
+
for (const el of Array.from(body.getElementsByTagName('*'))) {
|
|
1310
|
+
const id = el.getAttribute('w:id');
|
|
1311
|
+
if (id == null)
|
|
1312
|
+
continue;
|
|
1313
|
+
if (el.tagName === 'w:commentRangeStart')
|
|
1314
|
+
commentRangeStartIds.add(id);
|
|
1315
|
+
else if (el.tagName === 'w:commentRangeEnd')
|
|
1316
|
+
commentRangeEndIds.add(id);
|
|
1317
|
+
}
|
|
1032
1318
|
const toRemove = [];
|
|
1033
1319
|
for (const el of Array.from(body.getElementsByTagName('*'))) {
|
|
1034
1320
|
if (SCAFFOLD_STRIP_TAGS.has(el.tagName) && el.parentNode) {
|
|
@@ -1042,14 +1328,28 @@ function buildDocumentPreservingStructure(originalXml, paragraphXmls, paragraphG
|
|
|
1042
1328
|
}
|
|
1043
1329
|
ancestor = ancestor.parentNode;
|
|
1044
1330
|
}
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1331
|
+
if (insideParagraph)
|
|
1332
|
+
continue;
|
|
1333
|
+
if (COMMENT_RANGE_TAGS.has(el.tagName)) {
|
|
1334
|
+
const id = el.getAttribute('w:id');
|
|
1335
|
+
const counterpartIds = el.tagName === 'w:commentRangeStart'
|
|
1336
|
+
? commentRangeEndIds
|
|
1337
|
+
: commentRangeStartIds;
|
|
1338
|
+
if (id != null && counterpartIds.has(id))
|
|
1339
|
+
continue;
|
|
1047
1340
|
}
|
|
1341
|
+
toRemove.push(el);
|
|
1048
1342
|
}
|
|
1049
1343
|
}
|
|
1050
1344
|
for (const el of toRemove) {
|
|
1051
1345
|
el.parentNode.removeChild(el);
|
|
1052
1346
|
}
|
|
1347
|
+
// Balance bookmarks and enforce consumer-compatibility invariants on the
|
|
1348
|
+
// rebuilt body. This dedupes bookmark Names/IDs, hoists bookmarkStart/End
|
|
1349
|
+
// out of <w:ins>/<w:del> wrappers (so they survive accept/reject), and
|
|
1350
|
+
// synthesizes recovery markers for orphaned starts/ends. Mirrors the
|
|
1351
|
+
// post-processing applied in inplace mode (inPlaceModifier.ts).
|
|
1352
|
+
enforceConsumerCompatibility(body, allocateRevisionId);
|
|
1053
1353
|
// Serialize modified body and splice back into original envelope
|
|
1054
1354
|
const serializer = new XMLSerializer();
|
|
1055
1355
|
let newBodyXml = serializer.serializeToString(body);
|
|
@@ -1106,16 +1406,6 @@ function escapeXmlText(text) {
|
|
|
1106
1406
|
.replace(/</g, '<')
|
|
1107
1407
|
.replace(/>/g, '>');
|
|
1108
1408
|
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Escape XML attribute value.
|
|
1111
|
-
*/
|
|
1112
|
-
function escapeXmlAttr(text) {
|
|
1113
|
-
return text
|
|
1114
|
-
.replace(/&/g, '&')
|
|
1115
|
-
.replace(/</g, '<')
|
|
1116
|
-
.replace(/>/g, '>')
|
|
1117
|
-
.replace(/"/g, '"');
|
|
1118
|
-
}
|
|
1119
1409
|
/**
|
|
1120
1410
|
* Count statistics from merged atoms.
|
|
1121
1411
|
*/
|