open-agreements 0.7.7 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -21
- package/README.de.md +16 -29
- package/README.es.md +16 -29
- package/README.md +45 -54
- package/README.pt-br.md +16 -29
- package/README.template.md +19 -25
- package/README.zh.md +16 -29
- package/content/recipes/nvca-certificate-of-incorporation/fields/acquisition_exception_shares.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/adjustment_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/common_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/company_name.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/conversion_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_formula_alt.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_per_share.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_percent.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/effective_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/number_of_classes.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/original_issue_price.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/par_value.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_director_seats.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_designated_portion.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_outstanding_threshold.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/qualified_financing_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_interest_rate.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_start_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_address.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_name.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/series_designation.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/signature_page_marker.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/specify_percentage.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/strategic_partnership_exception_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/time_zone.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/total_authorized_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/template-manifest.json +77 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_date_month_day.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_year_two_digits.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/company_name.json +25 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/investor_counsel.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/minimum_shares_initial_closing.json +39 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/optional_plural_suffix.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/par_value_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/purchase_price_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/series_designation.json +159 -0
- package/content/recipes/nvca-stock-purchase-agreement/metadata.yaml +1 -1
- package/content/recipes/nvca-stock-purchase-agreement/template-manifest.json +24 -0
- package/content/templates/bonterms-mutual-nda/template.docx +0 -0
- package/content/templates/openagreements-board-consent-safe/.template.generated.json +0 -1
- package/content/templates/openagreements-employee-ip-inventions-assignment/.template.generated.json +9 -5
- package/content/templates/openagreements-employee-ip-inventions-assignment/README.md +2 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/metadata.yaml +8 -9
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.docx +0 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.md +3 -4
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/metadata.yaml +0 -9
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.docx +0 -0
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.json +0 -1
- package/content/templates/openagreements-employment-offer-letter/.template.generated.json +9 -5
- package/content/templates/openagreements-employment-offer-letter/README.md +17 -5
- package/content/templates/openagreements-employment-offer-letter/metadata.yaml +8 -9
- package/content/templates/openagreements-employment-offer-letter/template.docx +0 -0
- package/content/templates/openagreements-employment-offer-letter/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-florida/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-florida/README.md +2 -2
- package/content/templates/openagreements-restrictive-covenant-florida/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-florida/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-florida/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-wyoming/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-wyoming/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.md +3 -4
- package/content/templates/openagreements-stockholder-consent-safe/.template.generated.json +0 -1
- package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
- package/dist/core/checklist/format-checklist-docx.js +4 -1
- package/dist/core/checklist/format-checklist-docx.js.map +1 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/engine.js +2 -40
- package/dist/core/engine.js.map +1 -1
- package/dist/core/fill-pipeline.d.ts +0 -8
- package/dist/core/fill-pipeline.d.ts.map +1 -1
- package/dist/core/fill-pipeline.js +54 -30
- package/dist/core/fill-pipeline.js.map +1 -1
- package/dist/core/humanize-docx.d.ts.map +1 -1
- package/dist/core/humanize-docx.js +16 -6
- package/dist/core/humanize-docx.js.map +1 -1
- package/dist/core/recipe/bracket-normalizer.d.ts.map +1 -1
- package/dist/core/recipe/bracket-normalizer.js +3 -7
- package/dist/core/recipe/bracket-normalizer.js.map +1 -1
- package/dist/core/recipe/cleaner.js +5 -5
- package/dist/core/recipe/cleaner.js.map +1 -1
- package/dist/core/recipe/index.d.ts +1 -1
- package/dist/core/recipe/index.d.ts.map +1 -1
- package/dist/core/recipe/index.js +57 -4
- package/dist/core/recipe/index.js.map +1 -1
- package/dist/core/recipe/ooxml-parts.d.ts +11 -0
- package/dist/core/recipe/ooxml-parts.d.ts.map +1 -1
- package/dist/core/recipe/ooxml-parts.js +22 -0
- package/dist/core/recipe/ooxml-parts.js.map +1 -1
- package/dist/core/recipe/patcher.d.ts.map +1 -1
- package/dist/core/recipe/patcher.js +2 -5
- package/dist/core/recipe/patcher.js.map +1 -1
- package/dist/core/recipe/source-drift.d.ts +19 -0
- package/dist/core/recipe/source-drift.d.ts.map +1 -1
- package/dist/core/recipe/source-drift.js +32 -2
- package/dist/core/recipe/source-drift.js.map +1 -1
- package/dist/core/selector.d.ts.map +1 -1
- package/dist/core/selector.js +49 -4
- package/dist/core/selector.js.map +1 -1
- package/dist/core/selectors/index.d.ts +40 -0
- package/dist/core/selectors/index.d.ts.map +1 -0
- package/dist/core/selectors/index.js +64 -0
- package/dist/core/selectors/index.js.map +1 -0
- package/dist/core/selectors/loader.d.ts +16 -0
- package/dist/core/selectors/loader.d.ts.map +1 -0
- package/dist/core/selectors/loader.js +80 -0
- package/dist/core/selectors/loader.js.map +1 -0
- package/dist/core/selectors/manifest-schema.d.ts +123 -0
- package/dist/core/selectors/manifest-schema.d.ts.map +1 -0
- package/dist/core/selectors/manifest-schema.js +93 -0
- package/dist/core/selectors/manifest-schema.js.map +1 -0
- package/dist/core/selectors/patch.d.ts +24 -0
- package/dist/core/selectors/patch.d.ts.map +1 -0
- package/dist/core/selectors/patch.js +68 -0
- package/dist/core/selectors/patch.js.map +1 -0
- package/dist/core/selectors/postconditions.d.ts +24 -0
- package/dist/core/selectors/postconditions.d.ts.map +1 -0
- package/dist/core/selectors/postconditions.js +50 -0
- package/dist/core/selectors/postconditions.js.map +1 -0
- package/dist/core/selectors/resolve.d.ts +32 -0
- package/dist/core/selectors/resolve.d.ts.map +1 -0
- package/dist/core/selectors/resolve.js +36 -0
- package/dist/core/selectors/resolve.js.map +1 -0
- package/dist/core/unified-pipeline.d.ts +3 -1
- package/dist/core/unified-pipeline.d.ts.map +1 -1
- package/dist/core/unified-pipeline.js +19 -5
- package/dist/core/unified-pipeline.js.map +1 -1
- package/gemini-extension.json +1 -1
- package/node_modules/@usejunior/docx-core/LICENSE +202 -21
- package/node_modules/@usejunior/docx-core/NOTICE +2 -0
- package/node_modules/@usejunior/docx-core/README.md +2 -2
- package/node_modules/@usejunior/docx-core/dist/.tsbuildinfo +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +55 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.js +139 -14
- package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js +415 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +403 -113
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js +449 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts +74 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js +171 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts +88 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js +326 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts +85 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js +402 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts +39 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js +265 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts +62 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js +139 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts +198 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js +475 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +6 -290
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +23 -1828
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +36 -2
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +456 -224
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +199 -173
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +7 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +3 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts +3 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js +93 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts +197 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.js +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js +58 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts +42 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js +65 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js +116 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js +60 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts +28 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js +74 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts +23 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js +57 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js +102 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js +121 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js +157 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js +71 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js +117 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js +68 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js +82 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts +26 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js +209 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts +21 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js +151 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts +46 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js +119 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts +87 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js +232 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js +318 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts +4 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js +18 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts +266 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js +363 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/index.d.ts +9 -150
- package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/index.js +14 -0
- package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js +84 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts +49 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js +290 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts +134 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js +298 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +163 -77
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +12 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +374 -97
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +94 -15
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js +377 -234
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts +18 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js +160 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts +45 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js +247 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js +104 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js +199 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +50 -101
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +287 -326
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +9 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +10 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +232 -44
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +22 -11
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +45 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts +76 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js +223 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +32 -10
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts +38 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +53 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +59 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +6 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +187 -91
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js +39 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +23 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js +395 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js +300 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js +154 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +33 -22
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +13 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +2 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js +116 -12
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts +148 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js +291 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts +14 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js +166 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/package.json +13 -9
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +186 -70
- package/node_modules/@xmldom/xmldom/index.d.ts +144 -19
- package/node_modules/@xmldom/xmldom/lib/dom.js +705 -343
- package/node_modules/@xmldom/xmldom/lib/grammar.js +14 -0
- package/node_modules/@xmldom/xmldom/package.json +13 -10
- package/package.json +7 -7
- package/server.json +3 -3
- package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/SKILL.md +2 -2
- package/skills/{nda → agreements/cloud-service-agreement}/template-filling-execution.md +2 -2
- package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/SKILL.md +15 -4
- package/skills/{safe → agreements/data-privacy-agreement}/template-filling-execution.md +12 -6
- package/skills/{employment-contract → agreements/employment-contract}/SKILL.md +3 -3
- package/skills/{cloud-service-agreement → agreements/employment-contract}/template-filling-execution.md +12 -6
- package/skills/{nda → agreements/nda}/SKILL.md +2 -2
- package/skills/{open-agreements → agreements/nda}/template-filling-execution.md +12 -6
- package/skills/{open-agreements → agreements/open-agreements}/SKILL.md +13 -30
- package/skills/agreements/open-agreements/template-filling-execution.md +98 -0
- package/skills/{safe → agreements/safe}/SKILL.md +2 -2
- package/skills/agreements/safe/template-filling-execution.md +98 -0
- package/skills/{services-agreement → agreements/services-agreement}/SKILL.md +3 -3
- package/skills/agreements/services-agreement/template-filling-execution.md +98 -0
- package/skills/{venture-financing → agreements/venture-financing}/SKILL.md +3 -3
- package/skills/agreements/venture-financing/template-filling-execution.md +98 -0
- package/skills/{client-email → client-workflows/client-email}/SKILL.md +1 -1
- package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/SKILL.md +1 -1
- package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/SKILL.md +1 -1
- package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/SKILL.md +1 -1
- package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/SKILL.md +1 -1
- package/skills/{soc2-readiness → compliance/soc2-readiness}/SKILL.md +1 -1
- package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/SKILL.md +2 -3
- package/skills/{recipe-quality-audit → internal/recipe-quality-audit}/SKILL.md +2 -1
- package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/SKILL.md +2 -0
- package/skills/legal-explainers/data-privacy-law-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/LICENSE +269 -0
- package/skills/legal-explainers/data-privacy-law-explainer/NOTICE +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/SKILL.md +113 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alabama.md +211 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alaska.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arizona.md +181 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arkansas.md +219 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/california.md +107 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/colorado.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/connecticut.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/delaware.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/district-of-columbia.md +153 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/florida.md +234 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/georgia.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/hawaii.md +167 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/idaho.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/illinois.md +238 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/indiana.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/iowa.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kansas.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kentucky.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/louisiana.md +209 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maine.md +163 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maryland.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/massachusetts.md +260 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/michigan.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/minnesota.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/mississippi.md +132 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/missouri.md +179 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/montana.md +105 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nebraska.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nevada.md +212 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-hampshire.md +91 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-jersey.md +95 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-mexico.md +174 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-york.md +195 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-carolina.md +205 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-dakota.md +169 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/ohio.md +171 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oklahoma.md +168 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oregon.md +103 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/pennsylvania.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/rhode-island.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-carolina.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-dakota.md +176 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/tennessee.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/texas.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/utah.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/vermont.md +267 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/virginia.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/washington.md +247 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/west-virginia.md +141 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wisconsin.md +156 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wyoming.md +185 -0
- package/skills/legal-explainers/data-privacy-law-explainer/manifest.json +519 -0
- package/skills/legal-explainers/non-compete-contract-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/non-compete-contract-explainer/LICENSE +269 -0
- package/skills/legal-explainers/non-compete-contract-explainer/NOTICE +7 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/SKILL.md +1 -1
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alabama.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alaska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/american-samoa.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arizona.md +6 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arkansas.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/au.md +208 -0
- package/skills/legal-explainers/non-compete-contract-explainer/content/australian-capital-territory.md +220 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/california.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/cnmi.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/colorado.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/connecticut.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/delaware.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/district-of-columbia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/florida.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/georgia.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/guam.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/hawaii.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/idaho.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/illinois.md +5 -5
- package/skills/{non-compete-contract-explainer/content/india.md → legal-explainers/non-compete-contract-explainer/content/in.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/indiana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/iowa.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kansas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kentucky.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/louisiana.md +9 -9
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maine.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maryland.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/massachusetts.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/michigan.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/minnesota.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/mississippi.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/missouri.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/montana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nebraska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nevada.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-hampshire.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-jersey.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-mexico.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/new-south-wales.md +218 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-york.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/northern-territory.md +214 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/ohio.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oklahoma.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oregon.md +12 -12
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/pennsylvania.md +5 -5
- package/skills/{non-compete-contract-explainer/content/philippines.md → legal-explainers/non-compete-contract-explainer/content/ph.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/puerto-rico.md +4 -4
- package/skills/legal-explainers/non-compete-contract-explainer/content/queensland.md +206 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/rhode-island.md +5 -5
- package/skills/{non-compete-contract-explainer/content/singapore.md → legal-explainers/non-compete-contract-explainer/content/sg.md} +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/south-australia.md +236 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/tasmania.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/tennessee.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/texas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/utah.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/vermont.md +29 -11
- package/skills/legal-explainers/non-compete-contract-explainer/content/victoria.md +218 -0
- package/skills/{non-compete-contract-explainer/content/us-virgin-islands.md → legal-explainers/non-compete-contract-explainer/content/virgin-islands.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/virginia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/washington.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/west-virginia.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/western-australia.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wisconsin.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wyoming.md +19 -15
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/manifest.json +225 -76
- package/content/templates/bonterms-mutual-nda/signing.yaml +0 -35
- package/dist/core/signing-config.d.ts +0 -46
- package/dist/core/signing-config.d.ts.map +0 -1
- package/dist/core/signing-config.js +0 -67
- package/dist/core/signing-config.js.map +0 -1
- package/skills/services-agreement/template-filling-execution.md +0 -81
- package/skills/shared/template-filling-execution.md +0 -92
- /package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/CONNECTORS.md +0 -0
- /package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/CONNECTORS.md +0 -0
- /package/skills/{employment-contract → agreements/employment-contract}/CONNECTORS.md +0 -0
- /package/skills/{nda → agreements/nda}/CONNECTORS.md +0 -0
- /package/skills/{open-agreements → agreements/open-agreements}/CONNECTORS.md +0 -0
- /package/skills/{safe → agreements/safe}/CONNECTORS.md +0 -0
- /package/skills/{services-agreement → agreements/services-agreement}/CONNECTORS.md +0 -0
- /package/skills/{venture-financing → agreements/venture-financing}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/ecorp-portal-playwright-notes.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/faq.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/filing-instructions.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/tax-calculation.md +0 -0
- /package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/api-exports.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/evidence-types.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/screenshot-guide.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/access-control.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/business-continuity.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/change-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/encryption.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/incident-response.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/isms-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/logging-monitoring.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/people-controls.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/supplier-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/CONNECTORS.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/change-vendor-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/communication-info.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-environment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/logical-access.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/monitoring-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/optional-categories.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/privacy-criteria.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/risk-assessment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/system-operations.md +0 -0
- /package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/CONNECTORS.md +0 -0
- /package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/references/allure-test-spec-writing-guide.md +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { DocumentViewNode } from './document_view-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic locator primitive over a `DocumentView`.
|
|
4
|
+
*
|
|
5
|
+
* A locator resolves a SINGLE span (raw-text offsets within one node) and never
|
|
6
|
+
* heals, scores, or guesses. Ambiguity — zero matches or more than one — is a
|
|
7
|
+
* drift signal reported as `unresolved`, so a caller updates the selector rather
|
|
8
|
+
* than silently filling the wrong place. Redundant `assertions` corroborate the
|
|
9
|
+
* `primary` match the moment an upstream change makes them disagree.
|
|
10
|
+
*
|
|
11
|
+
* Patterns are authored against the stable, normalized `clean_text`; resolved
|
|
12
|
+
* spans are returned as RAW offsets (`getParagraphText` / `replaceTextAtRange`
|
|
13
|
+
* coordinates) via {@link buildCleanToRawOffsetMap}.
|
|
14
|
+
*/
|
|
15
|
+
export type LocatorStep = {
|
|
16
|
+
kind: 'section';
|
|
17
|
+
/** Exact match against the node's derived heading text. */
|
|
18
|
+
headingText?: string;
|
|
19
|
+
/** Regex (un-anchored) tested against the node's derived heading text. */
|
|
20
|
+
headingRegex?: string;
|
|
21
|
+
/** Exact match against the paragraph's Word style id. */
|
|
22
|
+
headingStyleId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Outline level at which the region ends: the region runs from the matched
|
|
25
|
+
* heading until the next heading whose level is `<= untilLevel`. Defaults
|
|
26
|
+
* to the matched heading's own level (so the region ends at the next
|
|
27
|
+
* sibling-or-higher heading); when the matched heading has no level and no
|
|
28
|
+
* `untilLevel` is given, the region runs to the end of the current scope.
|
|
29
|
+
*/
|
|
30
|
+
untilLevel?: number;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'regex';
|
|
33
|
+
pattern: string;
|
|
34
|
+
flags?: string;
|
|
35
|
+
group?: number;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'contextual';
|
|
38
|
+
contextPattern: string;
|
|
39
|
+
targetPattern: string;
|
|
40
|
+
rowLabelPattern?: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'fingerprint';
|
|
43
|
+
contentFingerprint: string;
|
|
44
|
+
};
|
|
45
|
+
export interface Locator {
|
|
46
|
+
/** Ordered `section` steps narrowing to a region (Scrapy-style nesting). */
|
|
47
|
+
scope?: LocatorStep[];
|
|
48
|
+
/** The deterministic single-span resolver. Must be regex | contextual | fingerprint. */
|
|
49
|
+
primary: LocatorStep;
|
|
50
|
+
/** Corroborators that never select. Must be regex | contextual | fingerprint. */
|
|
51
|
+
assertions?: LocatorStep[];
|
|
52
|
+
}
|
|
53
|
+
export interface LocatorAssertionResult {
|
|
54
|
+
ok: boolean;
|
|
55
|
+
kind: string;
|
|
56
|
+
detail?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface LocatorResolution {
|
|
59
|
+
/** RAW-offset span, or null when the primary did not resolve to exactly one span. */
|
|
60
|
+
match: {
|
|
61
|
+
nodeId: string;
|
|
62
|
+
start: number;
|
|
63
|
+
end: number;
|
|
64
|
+
} | null;
|
|
65
|
+
/** True when the primary matched zero or more than one span (a drift signal). */
|
|
66
|
+
unresolved: boolean;
|
|
67
|
+
/** Per-assertion corroboration results (empty when `unresolved`). */
|
|
68
|
+
assertionResults: LocatorAssertionResult[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Resolve a {@link Locator} against a document view. Deterministic: the same
|
|
72
|
+
* `(view, locator)` always yields the same result, with no randomness, scoring,
|
|
73
|
+
* or tie-breaking.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveLocator(view: DocumentViewNode[], locator: Locator): LocatorResolution;
|
|
76
|
+
//# sourceMappingURL=locator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locator.d.ts","sourceRoot":"","sources":["../../src/primitives/locator.ts"],"names":[],"mappings":"AAAA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AAE,OAAO,CAAC;IACpB,qEAAqE;IACrE,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;CAC5C;AAkND;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAe5F"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { buildCleanToRawOffsetMap } from './document_view.js';
|
|
2
|
+
import { computeContentFingerprint } from './content_fingerprint.js';
|
|
3
|
+
const SPAN_KINDS = new Set(['regex', 'contextual', 'fingerprint']);
|
|
4
|
+
/** Raw visible text of a node — the fingerprint basis and offset coordinate space. */
|
|
5
|
+
function rawTextOf(node) {
|
|
6
|
+
return node.raw_text ?? node.text;
|
|
7
|
+
}
|
|
8
|
+
function dedupeFlags(flags) {
|
|
9
|
+
return Array.from(new Set(flags.split(''))).join('');
|
|
10
|
+
}
|
|
11
|
+
function collectRegexSpans(nodes, pattern, flags, group) {
|
|
12
|
+
const needIndices = group > 0;
|
|
13
|
+
const reFlags = dedupeFlags(`${flags ?? ''}g${needIndices ? 'd' : ''}`);
|
|
14
|
+
const spans = [];
|
|
15
|
+
for (const node of nodes) {
|
|
16
|
+
const re = new RegExp(pattern, reFlags);
|
|
17
|
+
const text = node.clean_text;
|
|
18
|
+
let m;
|
|
19
|
+
while ((m = re.exec(text)) !== null) {
|
|
20
|
+
let cs;
|
|
21
|
+
let ce;
|
|
22
|
+
if (needIndices) {
|
|
23
|
+
const idx = m.indices?.[group];
|
|
24
|
+
if (!idx) {
|
|
25
|
+
if (m.index === re.lastIndex)
|
|
26
|
+
re.lastIndex++;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
cs = idx[0];
|
|
30
|
+
ce = idx[1];
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
cs = m.index;
|
|
34
|
+
ce = m.index + m[0].length;
|
|
35
|
+
}
|
|
36
|
+
spans.push({ node, nodeId: node.id, cleanStart: cs, cleanEnd: ce });
|
|
37
|
+
if (m.index === re.lastIndex)
|
|
38
|
+
re.lastIndex++;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return spans;
|
|
42
|
+
}
|
|
43
|
+
function collectContextualSpans(nodes, step) {
|
|
44
|
+
const ctxRe = new RegExp(step.contextPattern);
|
|
45
|
+
const rowRe = step.rowLabelPattern ? new RegExp(step.rowLabelPattern) : null;
|
|
46
|
+
const spans = [];
|
|
47
|
+
for (const node of nodes) {
|
|
48
|
+
if (!ctxRe.test(node.clean_text))
|
|
49
|
+
continue;
|
|
50
|
+
if (rowRe && !rowRe.test(node.table_context?.col_header ?? ''))
|
|
51
|
+
continue;
|
|
52
|
+
const tre = new RegExp(step.targetPattern, 'g');
|
|
53
|
+
const text = node.clean_text;
|
|
54
|
+
let m;
|
|
55
|
+
while ((m = tre.exec(text)) !== null) {
|
|
56
|
+
spans.push({ node, nodeId: node.id, cleanStart: m.index, cleanEnd: m.index + m[0].length });
|
|
57
|
+
if (m.index === tre.lastIndex)
|
|
58
|
+
tre.lastIndex++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return spans;
|
|
62
|
+
}
|
|
63
|
+
function collectFingerprintNodes(nodes, fingerprint) {
|
|
64
|
+
return nodes.filter((n) => computeContentFingerprint(rawTextOf(n)) === fingerprint);
|
|
65
|
+
}
|
|
66
|
+
function headingMatches(node, step) {
|
|
67
|
+
let matched = false;
|
|
68
|
+
if (step.headingStyleId !== undefined) {
|
|
69
|
+
if (node.paragraph_style_id !== step.headingStyleId)
|
|
70
|
+
return false;
|
|
71
|
+
matched = true;
|
|
72
|
+
}
|
|
73
|
+
if (step.headingText !== undefined) {
|
|
74
|
+
if (node.heading?.text !== step.headingText)
|
|
75
|
+
return false;
|
|
76
|
+
matched = true;
|
|
77
|
+
}
|
|
78
|
+
if (step.headingRegex !== undefined) {
|
|
79
|
+
if (!new RegExp(step.headingRegex).test(node.heading?.text ?? ''))
|
|
80
|
+
return false;
|
|
81
|
+
matched = true;
|
|
82
|
+
}
|
|
83
|
+
return matched;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Narrow `nodes` to the region selected by one `section` step. Returns null when
|
|
87
|
+
* the heading does not match EXACTLY one node (zero or many → unresolved).
|
|
88
|
+
*/
|
|
89
|
+
function narrowToSection(nodes, step) {
|
|
90
|
+
const headingIdx = [];
|
|
91
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
92
|
+
if (headingMatches(nodes[i], step))
|
|
93
|
+
headingIdx.push(i);
|
|
94
|
+
}
|
|
95
|
+
if (headingIdx.length !== 1)
|
|
96
|
+
return null;
|
|
97
|
+
const start = headingIdx[0];
|
|
98
|
+
const startLevel = nodes[start].heading?.level ?? null;
|
|
99
|
+
const untilLevel = step.untilLevel ?? startLevel;
|
|
100
|
+
let end = nodes.length;
|
|
101
|
+
if (untilLevel !== null) {
|
|
102
|
+
for (let j = start + 1; j < nodes.length; j++) {
|
|
103
|
+
const lvl = nodes[j].heading?.level;
|
|
104
|
+
if (lvl != null && lvl <= untilLevel) {
|
|
105
|
+
end = j;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return nodes.slice(start, end);
|
|
111
|
+
}
|
|
112
|
+
function narrowScope(view, scope) {
|
|
113
|
+
let nodes = view;
|
|
114
|
+
for (const step of scope) {
|
|
115
|
+
if (step.kind !== 'section') {
|
|
116
|
+
throw new Error(`Locator scope steps must be 'section'; got '${step.kind}'`);
|
|
117
|
+
}
|
|
118
|
+
const narrowed = narrowToSection(nodes, step);
|
|
119
|
+
if (narrowed === null)
|
|
120
|
+
return null;
|
|
121
|
+
nodes = narrowed;
|
|
122
|
+
}
|
|
123
|
+
return nodes;
|
|
124
|
+
}
|
|
125
|
+
function resolvePrimary(nodes, step) {
|
|
126
|
+
if (step.kind === 'fingerprint') {
|
|
127
|
+
const hits = collectFingerprintNodes(nodes, step.contentFingerprint);
|
|
128
|
+
if (hits.length !== 1)
|
|
129
|
+
return null;
|
|
130
|
+
const node = hits[0];
|
|
131
|
+
return { nodeId: node.id, start: 0, end: rawTextOf(node).length };
|
|
132
|
+
}
|
|
133
|
+
let spans;
|
|
134
|
+
if (step.kind === 'regex') {
|
|
135
|
+
spans = collectRegexSpans(nodes, step.pattern, step.flags, step.group ?? 0);
|
|
136
|
+
}
|
|
137
|
+
else if (step.kind === 'contextual') {
|
|
138
|
+
spans = collectContextualSpans(nodes, step);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
// 'section' is rejected by validateLocator before we get here.
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
if (spans.length !== 1)
|
|
145
|
+
return null;
|
|
146
|
+
const span = spans[0];
|
|
147
|
+
if (span.cleanEnd <= span.cleanStart)
|
|
148
|
+
return null; // zero-length match is invalid
|
|
149
|
+
const map = buildCleanToRawOffsetMap(span.node);
|
|
150
|
+
return { nodeId: span.nodeId, start: map[span.cleanStart], end: map[span.cleanEnd] };
|
|
151
|
+
}
|
|
152
|
+
function resolveAssertion(nodes, step, primary) {
|
|
153
|
+
if (step.kind === 'fingerprint') {
|
|
154
|
+
const hits = collectFingerprintNodes(nodes, step.contentFingerprint);
|
|
155
|
+
if (hits.length !== 1) {
|
|
156
|
+
return { ok: false, kind: 'fingerprint', detail: `expected exactly 1 node, found ${hits.length}` };
|
|
157
|
+
}
|
|
158
|
+
const ok = hits[0].id === primary.nodeId;
|
|
159
|
+
return { ok, kind: 'fingerprint', detail: ok ? undefined : `node ${hits[0].id} != primary node ${primary.nodeId}` };
|
|
160
|
+
}
|
|
161
|
+
let spans;
|
|
162
|
+
if (step.kind === 'regex') {
|
|
163
|
+
spans = collectRegexSpans(nodes, step.pattern, step.flags, step.group ?? 0);
|
|
164
|
+
}
|
|
165
|
+
else if (step.kind === 'contextual') {
|
|
166
|
+
spans = collectContextualSpans(nodes, step);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return { ok: false, kind: step.kind, detail: "'section' is not a valid assertion kind" };
|
|
170
|
+
}
|
|
171
|
+
if (spans.length !== 1) {
|
|
172
|
+
return { ok: false, kind: step.kind, detail: `expected exactly 1 span, found ${spans.length}` };
|
|
173
|
+
}
|
|
174
|
+
const span = spans[0];
|
|
175
|
+
if (span.cleanEnd <= span.cleanStart) {
|
|
176
|
+
return { ok: false, kind: step.kind, detail: 'zero-length match' };
|
|
177
|
+
}
|
|
178
|
+
const map = buildCleanToRawOffsetMap(span.node);
|
|
179
|
+
const start = map[span.cleanStart];
|
|
180
|
+
const end = map[span.cleanEnd];
|
|
181
|
+
const ok = span.nodeId === primary.nodeId && start === primary.start && end === primary.end;
|
|
182
|
+
return {
|
|
183
|
+
ok,
|
|
184
|
+
kind: step.kind,
|
|
185
|
+
detail: ok
|
|
186
|
+
? undefined
|
|
187
|
+
: `span {${span.nodeId},${start},${end}} != primary {${primary.nodeId},${primary.start},${primary.end}}`,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function validateLocator(locator) {
|
|
191
|
+
if (!SPAN_KINDS.has(locator.primary.kind)) {
|
|
192
|
+
throw new Error(`Locator primary must be regex | contextual | fingerprint; got '${locator.primary.kind}'`);
|
|
193
|
+
}
|
|
194
|
+
for (const a of locator.assertions ?? []) {
|
|
195
|
+
if (!SPAN_KINDS.has(a.kind)) {
|
|
196
|
+
throw new Error(`Locator assertion must be regex | contextual | fingerprint; got '${a.kind}'`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
for (const s of locator.scope ?? []) {
|
|
200
|
+
if (s.kind !== 'section') {
|
|
201
|
+
throw new Error(`Locator scope steps must be 'section'; got '${s.kind}'`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Resolve a {@link Locator} against a document view. Deterministic: the same
|
|
207
|
+
* `(view, locator)` always yields the same result, with no randomness, scoring,
|
|
208
|
+
* or tie-breaking.
|
|
209
|
+
*/
|
|
210
|
+
export function resolveLocator(view, locator) {
|
|
211
|
+
validateLocator(locator);
|
|
212
|
+
const scoped = locator.scope && locator.scope.length > 0 ? narrowScope(view, locator.scope) : view;
|
|
213
|
+
if (scoped === null) {
|
|
214
|
+
return { match: null, unresolved: true, assertionResults: [] };
|
|
215
|
+
}
|
|
216
|
+
const match = resolvePrimary(scoped, locator.primary);
|
|
217
|
+
if (match === null) {
|
|
218
|
+
return { match: null, unresolved: true, assertionResults: [] };
|
|
219
|
+
}
|
|
220
|
+
const assertionResults = (locator.assertions ?? []).map((a) => resolveAssertion(scoped, a, match));
|
|
221
|
+
return { match, unresolved: false, assertionResults };
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=locator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locator.js","sourceRoot":"","sources":["../../src/primitives/locator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AA6DrE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAEnE,sFAAsF;AACtF,SAAS,SAAS,CAAC,IAAsB;IACvC,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;AACpC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,CAAC;AAID,SAAS,iBAAiB,CAAC,KAAyB,EAAE,OAAe,EAAE,KAAyB,EAAE,KAAa;IAC7G,MAAM,WAAW,GAAG,KAAK,GAAG,CAAC,CAAC;IAC9B,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,KAAK,IAAI,EAAE,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AAC;IAED,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACnG,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -8,10 +8,28 @@ export type MergeRunsResult = {
|
|
|
8
8
|
runsMerged: number;
|
|
9
9
|
proofErrRemoved: number;
|
|
10
10
|
};
|
|
11
|
+
export type MergeRunsOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* When true, adjacent runs that differ in any `w:rsid*` attribute are
|
|
14
|
+
* NOT merged, and existing rsid attributes on live runs are not stripped.
|
|
15
|
+
* Use this from edit pipelines (e.g. `replace_text`) so that mutations
|
|
16
|
+
* to one run do not silently rewrite rsid identity on neighbouring runs
|
|
17
|
+
* the caller never touched. The default (`false`) preserves the
|
|
18
|
+
* normalize-on-open behaviour: every run in the body is first stripped
|
|
19
|
+
* of its `w:rsid*` attributes, then format-identical adjacent runs are
|
|
20
|
+
* merged unconditionally.
|
|
21
|
+
*/
|
|
22
|
+
preserveRsidIdentity?: boolean;
|
|
23
|
+
};
|
|
11
24
|
/**
|
|
12
25
|
* Merge adjacent format-identical runs across all paragraphs in the
|
|
13
|
-
* document body. Removes `<w:proofErr>` elements
|
|
14
|
-
*
|
|
26
|
+
* document body. Removes `<w:proofErr>` elements.
|
|
27
|
+
*
|
|
28
|
+
* Pass `{ preserveRsidIdentity: true }` from edit pipelines that must not
|
|
29
|
+
* disturb rsid attributes on runs the caller did not touch (see #286).
|
|
30
|
+
* The default omits that guard and matches the historical normalize-on-open
|
|
31
|
+
* behaviour, which consolidates rsid-fragmented runs that Word produces
|
|
32
|
+
* across edit sessions.
|
|
15
33
|
*
|
|
16
34
|
* Safety barriers prevent merges across:
|
|
17
35
|
* - Field boundaries (fldChar, instrText)
|
|
@@ -19,5 +37,5 @@ export type MergeRunsResult = {
|
|
|
19
37
|
* - Bookmark boundaries (bookmarkStart, bookmarkEnd)
|
|
20
38
|
* - Tracked-change wrapper boundaries (ins, del, moveFrom, moveTo)
|
|
21
39
|
*/
|
|
22
|
-
export declare function mergeRuns(doc: Document): MergeRunsResult;
|
|
40
|
+
export declare function mergeRuns(doc: Document, opts?: MergeRunsOptions): MergeRunsResult;
|
|
23
41
|
//# sourceMappingURL=merge_runs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge_runs.d.ts","sourceRoot":"","sources":["../../src/primitives/merge_runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge_runs.d.ts","sourceRoot":"","sources":["../../src/primitives/merge_runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA2PF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAE,gBAAqB,GAAG,eAAe,CA0BrF"}
|
|
@@ -59,6 +59,20 @@ function runFormattingKey(run) {
|
|
|
59
59
|
stripRsidAttributes(clone);
|
|
60
60
|
return serializer.serializeToString(clone);
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Canonical key for a run's rsid attributes. Two runs with the same key
|
|
64
|
+
* carry identical revision-save-id provenance and are mergeable; runs
|
|
65
|
+
* with differing rsids represent distinct edit sessions and must not be
|
|
66
|
+
* merged (Word preserves the boundary as part of its revision-tracking
|
|
67
|
+
* heuristics).
|
|
68
|
+
*/
|
|
69
|
+
function runRsidKey(run) {
|
|
70
|
+
return Array.from(run.attributes)
|
|
71
|
+
.filter((attr) => /^rsid/i.test(attr.localName ?? attr.name))
|
|
72
|
+
.map((attr) => `${attr.namespaceURI ?? ''}:${attr.localName ?? attr.name}=${attr.value}`)
|
|
73
|
+
.sort()
|
|
74
|
+
.join('|');
|
|
75
|
+
}
|
|
62
76
|
/** Check whether a run contains barrier content (fldChar, instrText). */
|
|
63
77
|
function runContainsBarrierContent(run) {
|
|
64
78
|
let child = run.firstChild;
|
|
@@ -180,7 +194,7 @@ function collectMergeableRunGroups(paragraph) {
|
|
|
180
194
|
return allGroups;
|
|
181
195
|
}
|
|
182
196
|
/** Merge adjacent format-identical runs within a paragraph. */
|
|
183
|
-
function mergeParagraphRuns(paragraph) {
|
|
197
|
+
function mergeParagraphRuns(paragraph, preserveRsidIdentity) {
|
|
184
198
|
let merged = 0;
|
|
185
199
|
const groups = collectMergeableRunGroups(paragraph);
|
|
186
200
|
for (const group of groups) {
|
|
@@ -192,7 +206,8 @@ function mergeParagraphRuns(paragraph) {
|
|
|
192
206
|
const next = group[i + 1];
|
|
193
207
|
if (!runContainsBarrierContent(current) &&
|
|
194
208
|
!runContainsBarrierContent(next) &&
|
|
195
|
-
runFormattingKey(current) === runFormattingKey(next)
|
|
209
|
+
runFormattingKey(current) === runFormattingKey(next) &&
|
|
210
|
+
(!preserveRsidIdentity || runRsidKey(current) === runRsidKey(next))) {
|
|
196
211
|
// Move all content children of `next` into `current`.
|
|
197
212
|
for (const node of runContentChildren(next)) {
|
|
198
213
|
current.appendChild(node);
|
|
@@ -213,8 +228,13 @@ function mergeParagraphRuns(paragraph) {
|
|
|
213
228
|
// ── Public API ─────────────────────────────────────────────────────────
|
|
214
229
|
/**
|
|
215
230
|
* Merge adjacent format-identical runs across all paragraphs in the
|
|
216
|
-
* document body. Removes `<w:proofErr>` elements
|
|
217
|
-
*
|
|
231
|
+
* document body. Removes `<w:proofErr>` elements.
|
|
232
|
+
*
|
|
233
|
+
* Pass `{ preserveRsidIdentity: true }` from edit pipelines that must not
|
|
234
|
+
* disturb rsid attributes on runs the caller did not touch (see #286).
|
|
235
|
+
* The default omits that guard and matches the historical normalize-on-open
|
|
236
|
+
* behaviour, which consolidates rsid-fragmented runs that Word produces
|
|
237
|
+
* across edit sessions.
|
|
218
238
|
*
|
|
219
239
|
* Safety barriers prevent merges across:
|
|
220
240
|
* - Field boundaries (fldChar, instrText)
|
|
@@ -222,21 +242,23 @@ function mergeParagraphRuns(paragraph) {
|
|
|
222
242
|
* - Bookmark boundaries (bookmarkStart, bookmarkEnd)
|
|
223
243
|
* - Tracked-change wrapper boundaries (ins, del, moveFrom, moveTo)
|
|
224
244
|
*/
|
|
225
|
-
export function mergeRuns(doc) {
|
|
245
|
+
export function mergeRuns(doc, opts = {}) {
|
|
226
246
|
const body = doc.getElementsByTagNameNS(OOXML.W_NS, W.body).item(0);
|
|
227
247
|
if (!body)
|
|
228
248
|
return { runsMerged: 0, proofErrRemoved: 0 };
|
|
249
|
+
const preserveRsidIdentity = opts.preserveRsidIdentity === true;
|
|
229
250
|
let totalMerged = 0;
|
|
230
251
|
let totalProofErr = 0;
|
|
231
252
|
const paragraphs = Array.from(body.getElementsByTagNameNS(OOXML.W_NS, W.p));
|
|
232
253
|
for (const p of paragraphs) {
|
|
233
254
|
totalProofErr += removeProofErrors(p);
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
255
|
+
if (!preserveRsidIdentity) {
|
|
256
|
+
const runs = Array.from(p.getElementsByTagNameNS(OOXML.W_NS, W.r));
|
|
257
|
+
for (const r of runs) {
|
|
258
|
+
stripRsidAttributes(r);
|
|
259
|
+
}
|
|
238
260
|
}
|
|
239
|
-
totalMerged += mergeParagraphRuns(p);
|
|
261
|
+
totalMerged += mergeParagraphRuns(p, preserveRsidIdentity);
|
|
240
262
|
}
|
|
241
263
|
return { runsMerged: totalMerged, proofErrRemoved: totalProofErr };
|
|
242
264
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge_runs.js","sourceRoot":"","sources":["../../src/primitives/merge_runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge_runs.js","sourceRoot":"","sources":["../../src/primitives/merge_runs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAqB3C,0EAA0E;AAE1E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,WAAW;IACb,mBAAmB;IACnB,iBAAiB;CAClB,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,KAAK;IACL,KAAK;IACL,UAAU;IACV,QAAQ;CACT,CAAC,CAAC;AAEH,0EAA0E;AAE1E,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;AAEvC,SAAS,GAAG,CAAC,EAAW,EAAE,SAAiB;IACzC,OAAO,EAAE,CAAC,YAAY,KAAK,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC;AACtE,CAAC;AAED,SAAS,MAAM,CAAC,IAAU;IACxB,OAAO,CACL,IAAI,CAAC,QAAQ,KAAK,CAAC;QAClB,IAAgB,CAAC,YAAY,KAAK,KAAK,CAAC,IAAI;QAC5C,IAAgB,CAAC,SAAS,KAAK,CAAC,CA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IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAC7C,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,aAAa,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;gBACrB,mBAAmB,CAAC,CAAC,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QAED,WAAW,IAAI,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* minimal_save — restore untouched top-level body blocks from the original
|
|
3
|
+
* document.xml at save time.
|
|
4
|
+
*
|
|
5
|
+
* The in-memory session DOM is normalized at open (`mergeRuns` +
|
|
6
|
+
* `simplifyRedlines`) because text addressing, bookmarks, and comparison
|
|
7
|
+
* baselines all assume the normalized shape. Serializing that DOM wholesale
|
|
8
|
+
* persists the normalization for every paragraph, so a one-paragraph edit
|
|
9
|
+
* rewrites the whole document on disk (proofErr stripped, runs merged) and
|
|
10
|
+
* downstream diffs lie about the edit's blast radius.
|
|
11
|
+
*
|
|
12
|
+
* This module reconciles at save time instead: any body block (w:p, w:tbl,
|
|
13
|
+
* w:sectPr, ...) whose serialization equals the corresponding block of a
|
|
14
|
+
* freshly-normalized re-parse of the original XML was, by construction,
|
|
15
|
+
* untouched by edits — so it is replaced with the pristine original block.
|
|
16
|
+
* Edited blocks that are tables are descended into (rows → cells →
|
|
17
|
+
* paragraphs) so a one-cell edit doesn't churn the rest of the table.
|
|
18
|
+
* Edited or inserted leaves have no equal counterpart and are kept as-is.
|
|
19
|
+
* The output contract is element-for-element preservation of untouched
|
|
20
|
+
* blocks (the XML still passes through the serializer, so byte-identity
|
|
21
|
+
* with the original file is not guaranteed).
|
|
22
|
+
*
|
|
23
|
+
* @see https://github.com/UseJunior/safe-docx/issues/408
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Replace every block of `currentDoc` that is untouched — i.e.
|
|
27
|
+
* serialization-equal to the same block of the original document.xml after
|
|
28
|
+
* open-time normalization — with the pristine original block, descending
|
|
29
|
+
* into edited tables so their untouched rows/cells/paragraphs restore too.
|
|
30
|
+
*
|
|
31
|
+
* `currentDoc` must already have internal bookmarks removed (untouched
|
|
32
|
+
* blocks otherwise never match the bookmark-free reference). Returns the
|
|
33
|
+
* number of elements restored; 0 means the document is fully edited or the
|
|
34
|
+
* reference could not be aligned (output then matches today's full
|
|
35
|
+
* re-serialization, never anything worse).
|
|
36
|
+
*/
|
|
37
|
+
export declare function restoreUntouchedBlocks(currentDoc: Document, originalXmlText: string): number;
|
|
38
|
+
//# sourceMappingURL=minimal_save.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimal_save.d.ts","sourceRoot":"","sources":["../../src/primitives/minimal_save.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAiTH;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,MAAM,GACtB,MAAM,CAaR"}
|