open-agreements 0.7.7 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -21
- package/README.de.md +16 -29
- package/README.es.md +16 -29
- package/README.md +45 -54
- package/README.pt-br.md +16 -29
- package/README.template.md +19 -25
- package/README.zh.md +16 -29
- package/content/recipes/nvca-certificate-of-incorporation/fields/acquisition_exception_shares.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/adjustment_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/common_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/company_name.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/conversion_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_formula_alt.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_per_share.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_percent.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/effective_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/number_of_classes.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/original_issue_price.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/par_value.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_director_seats.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_designated_portion.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_outstanding_threshold.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/qualified_financing_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_interest_rate.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_start_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_address.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_name.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/series_designation.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/signature_page_marker.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/specify_percentage.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/strategic_partnership_exception_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/time_zone.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/total_authorized_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/template-manifest.json +77 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_date_month_day.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_year_two_digits.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/company_name.json +25 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/investor_counsel.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/minimum_shares_initial_closing.json +39 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/optional_plural_suffix.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/par_value_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/purchase_price_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/series_designation.json +159 -0
- package/content/recipes/nvca-stock-purchase-agreement/metadata.yaml +1 -1
- package/content/recipes/nvca-stock-purchase-agreement/template-manifest.json +24 -0
- package/content/templates/bonterms-mutual-nda/template.docx +0 -0
- package/content/templates/openagreements-board-consent-safe/.template.generated.json +0 -1
- package/content/templates/openagreements-employee-ip-inventions-assignment/.template.generated.json +9 -5
- package/content/templates/openagreements-employee-ip-inventions-assignment/README.md +2 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/metadata.yaml +8 -9
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.docx +0 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.md +3 -4
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/metadata.yaml +0 -9
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.docx +0 -0
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.json +0 -1
- package/content/templates/openagreements-employment-offer-letter/.template.generated.json +9 -5
- package/content/templates/openagreements-employment-offer-letter/README.md +17 -5
- package/content/templates/openagreements-employment-offer-letter/metadata.yaml +8 -9
- package/content/templates/openagreements-employment-offer-letter/template.docx +0 -0
- package/content/templates/openagreements-employment-offer-letter/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-florida/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-florida/README.md +2 -2
- package/content/templates/openagreements-restrictive-covenant-florida/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-florida/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-florida/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-wyoming/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-wyoming/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.md +3 -4
- package/content/templates/openagreements-stockholder-consent-safe/.template.generated.json +0 -1
- package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
- package/dist/core/checklist/format-checklist-docx.js +4 -1
- package/dist/core/checklist/format-checklist-docx.js.map +1 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/engine.js +2 -40
- package/dist/core/engine.js.map +1 -1
- package/dist/core/fill-pipeline.d.ts +0 -8
- package/dist/core/fill-pipeline.d.ts.map +1 -1
- package/dist/core/fill-pipeline.js +54 -30
- package/dist/core/fill-pipeline.js.map +1 -1
- package/dist/core/humanize-docx.d.ts.map +1 -1
- package/dist/core/humanize-docx.js +16 -6
- package/dist/core/humanize-docx.js.map +1 -1
- package/dist/core/recipe/bracket-normalizer.d.ts.map +1 -1
- package/dist/core/recipe/bracket-normalizer.js +3 -7
- package/dist/core/recipe/bracket-normalizer.js.map +1 -1
- package/dist/core/recipe/cleaner.js +5 -5
- package/dist/core/recipe/cleaner.js.map +1 -1
- package/dist/core/recipe/index.d.ts +1 -1
- package/dist/core/recipe/index.d.ts.map +1 -1
- package/dist/core/recipe/index.js +57 -4
- package/dist/core/recipe/index.js.map +1 -1
- package/dist/core/recipe/ooxml-parts.d.ts +11 -0
- package/dist/core/recipe/ooxml-parts.d.ts.map +1 -1
- package/dist/core/recipe/ooxml-parts.js +22 -0
- package/dist/core/recipe/ooxml-parts.js.map +1 -1
- package/dist/core/recipe/patcher.d.ts.map +1 -1
- package/dist/core/recipe/patcher.js +2 -5
- package/dist/core/recipe/patcher.js.map +1 -1
- package/dist/core/recipe/source-drift.d.ts +19 -0
- package/dist/core/recipe/source-drift.d.ts.map +1 -1
- package/dist/core/recipe/source-drift.js +32 -2
- package/dist/core/recipe/source-drift.js.map +1 -1
- package/dist/core/selector.d.ts.map +1 -1
- package/dist/core/selector.js +49 -4
- package/dist/core/selector.js.map +1 -1
- package/dist/core/selectors/index.d.ts +40 -0
- package/dist/core/selectors/index.d.ts.map +1 -0
- package/dist/core/selectors/index.js +64 -0
- package/dist/core/selectors/index.js.map +1 -0
- package/dist/core/selectors/loader.d.ts +16 -0
- package/dist/core/selectors/loader.d.ts.map +1 -0
- package/dist/core/selectors/loader.js +80 -0
- package/dist/core/selectors/loader.js.map +1 -0
- package/dist/core/selectors/manifest-schema.d.ts +123 -0
- package/dist/core/selectors/manifest-schema.d.ts.map +1 -0
- package/dist/core/selectors/manifest-schema.js +93 -0
- package/dist/core/selectors/manifest-schema.js.map +1 -0
- package/dist/core/selectors/patch.d.ts +24 -0
- package/dist/core/selectors/patch.d.ts.map +1 -0
- package/dist/core/selectors/patch.js +68 -0
- package/dist/core/selectors/patch.js.map +1 -0
- package/dist/core/selectors/postconditions.d.ts +24 -0
- package/dist/core/selectors/postconditions.d.ts.map +1 -0
- package/dist/core/selectors/postconditions.js +50 -0
- package/dist/core/selectors/postconditions.js.map +1 -0
- package/dist/core/selectors/resolve.d.ts +32 -0
- package/dist/core/selectors/resolve.d.ts.map +1 -0
- package/dist/core/selectors/resolve.js +36 -0
- package/dist/core/selectors/resolve.js.map +1 -0
- package/dist/core/unified-pipeline.d.ts +3 -1
- package/dist/core/unified-pipeline.d.ts.map +1 -1
- package/dist/core/unified-pipeline.js +19 -5
- package/dist/core/unified-pipeline.js.map +1 -1
- package/gemini-extension.json +1 -1
- package/node_modules/@usejunior/docx-core/LICENSE +202 -21
- package/node_modules/@usejunior/docx-core/NOTICE +2 -0
- package/node_modules/@usejunior/docx-core/README.md +2 -2
- package/node_modules/@usejunior/docx-core/dist/.tsbuildinfo +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +55 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.js +139 -14
- package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js +415 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +403 -113
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js +449 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts +74 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js +171 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts +88 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js +326 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts +85 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js +402 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts +39 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js +265 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts +62 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js +139 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts +198 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js +475 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +6 -290
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +23 -1828
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +36 -2
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +456 -224
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +199 -173
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +7 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +3 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts +3 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js +93 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts +197 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.js +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js +58 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts +42 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js +65 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js +116 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js +60 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts +28 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js +74 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts +23 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js +57 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js +102 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js +121 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js +157 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js +71 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js +117 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js +68 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js +82 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts +26 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js +209 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts +21 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js +151 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts +46 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js +119 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts +87 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js +232 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js +318 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts +4 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js +18 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts +266 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js +363 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/index.d.ts +9 -150
- package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/index.js +14 -0
- package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js +84 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts +49 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js +290 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts +134 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js +298 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +163 -77
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +12 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +374 -97
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +94 -15
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js +377 -234
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts +18 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js +160 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts +45 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js +247 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js +104 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js +199 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +50 -101
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +287 -326
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +9 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +10 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +232 -44
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +22 -11
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +45 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts +76 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js +223 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +32 -10
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts +38 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +53 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +59 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +6 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +187 -91
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js +39 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +23 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js +395 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js +300 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js +154 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +33 -22
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +13 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +2 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js +116 -12
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts +148 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js +291 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts +14 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js +166 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/package.json +13 -9
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +186 -70
- package/node_modules/@xmldom/xmldom/index.d.ts +144 -19
- package/node_modules/@xmldom/xmldom/lib/dom.js +705 -343
- package/node_modules/@xmldom/xmldom/lib/grammar.js +14 -0
- package/node_modules/@xmldom/xmldom/package.json +13 -10
- package/package.json +7 -7
- package/server.json +3 -3
- package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/SKILL.md +2 -2
- package/skills/{nda → agreements/cloud-service-agreement}/template-filling-execution.md +2 -2
- package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/SKILL.md +15 -4
- package/skills/{safe → agreements/data-privacy-agreement}/template-filling-execution.md +12 -6
- package/skills/{employment-contract → agreements/employment-contract}/SKILL.md +3 -3
- package/skills/{cloud-service-agreement → agreements/employment-contract}/template-filling-execution.md +12 -6
- package/skills/{nda → agreements/nda}/SKILL.md +2 -2
- package/skills/{open-agreements → agreements/nda}/template-filling-execution.md +12 -6
- package/skills/{open-agreements → agreements/open-agreements}/SKILL.md +13 -30
- package/skills/agreements/open-agreements/template-filling-execution.md +98 -0
- package/skills/{safe → agreements/safe}/SKILL.md +2 -2
- package/skills/agreements/safe/template-filling-execution.md +98 -0
- package/skills/{services-agreement → agreements/services-agreement}/SKILL.md +3 -3
- package/skills/agreements/services-agreement/template-filling-execution.md +98 -0
- package/skills/{venture-financing → agreements/venture-financing}/SKILL.md +3 -3
- package/skills/agreements/venture-financing/template-filling-execution.md +98 -0
- package/skills/{client-email → client-workflows/client-email}/SKILL.md +1 -1
- package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/SKILL.md +1 -1
- package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/SKILL.md +1 -1
- package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/SKILL.md +1 -1
- package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/SKILL.md +1 -1
- package/skills/{soc2-readiness → compliance/soc2-readiness}/SKILL.md +1 -1
- package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/SKILL.md +2 -3
- package/skills/{recipe-quality-audit → internal/recipe-quality-audit}/SKILL.md +2 -1
- package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/SKILL.md +2 -0
- package/skills/legal-explainers/data-privacy-law-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/LICENSE +269 -0
- package/skills/legal-explainers/data-privacy-law-explainer/NOTICE +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/SKILL.md +113 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alabama.md +211 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alaska.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arizona.md +181 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arkansas.md +219 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/california.md +107 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/colorado.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/connecticut.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/delaware.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/district-of-columbia.md +153 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/florida.md +234 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/georgia.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/hawaii.md +167 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/idaho.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/illinois.md +238 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/indiana.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/iowa.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kansas.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kentucky.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/louisiana.md +209 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maine.md +163 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maryland.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/massachusetts.md +260 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/michigan.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/minnesota.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/mississippi.md +132 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/missouri.md +179 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/montana.md +105 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nebraska.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nevada.md +212 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-hampshire.md +91 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-jersey.md +95 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-mexico.md +174 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-york.md +195 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-carolina.md +205 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-dakota.md +169 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/ohio.md +171 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oklahoma.md +168 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oregon.md +103 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/pennsylvania.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/rhode-island.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-carolina.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-dakota.md +176 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/tennessee.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/texas.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/utah.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/vermont.md +267 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/virginia.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/washington.md +247 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/west-virginia.md +141 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wisconsin.md +156 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wyoming.md +185 -0
- package/skills/legal-explainers/data-privacy-law-explainer/manifest.json +519 -0
- package/skills/legal-explainers/non-compete-contract-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/non-compete-contract-explainer/LICENSE +269 -0
- package/skills/legal-explainers/non-compete-contract-explainer/NOTICE +7 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/SKILL.md +1 -1
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alabama.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alaska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/american-samoa.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arizona.md +6 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arkansas.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/au.md +208 -0
- package/skills/legal-explainers/non-compete-contract-explainer/content/australian-capital-territory.md +220 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/california.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/cnmi.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/colorado.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/connecticut.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/delaware.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/district-of-columbia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/florida.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/georgia.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/guam.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/hawaii.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/idaho.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/illinois.md +5 -5
- package/skills/{non-compete-contract-explainer/content/india.md → legal-explainers/non-compete-contract-explainer/content/in.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/indiana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/iowa.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kansas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kentucky.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/louisiana.md +9 -9
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maine.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maryland.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/massachusetts.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/michigan.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/minnesota.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/mississippi.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/missouri.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/montana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nebraska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nevada.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-hampshire.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-jersey.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-mexico.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/new-south-wales.md +218 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-york.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/northern-territory.md +214 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/ohio.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oklahoma.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oregon.md +12 -12
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/pennsylvania.md +5 -5
- package/skills/{non-compete-contract-explainer/content/philippines.md → legal-explainers/non-compete-contract-explainer/content/ph.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/puerto-rico.md +4 -4
- package/skills/legal-explainers/non-compete-contract-explainer/content/queensland.md +206 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/rhode-island.md +5 -5
- package/skills/{non-compete-contract-explainer/content/singapore.md → legal-explainers/non-compete-contract-explainer/content/sg.md} +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/south-australia.md +236 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/tasmania.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/tennessee.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/texas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/utah.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/vermont.md +29 -11
- package/skills/legal-explainers/non-compete-contract-explainer/content/victoria.md +218 -0
- package/skills/{non-compete-contract-explainer/content/us-virgin-islands.md → legal-explainers/non-compete-contract-explainer/content/virgin-islands.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/virginia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/washington.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/west-virginia.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/western-australia.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wisconsin.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wyoming.md +19 -15
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/manifest.json +225 -76
- package/content/templates/bonterms-mutual-nda/signing.yaml +0 -35
- package/dist/core/signing-config.d.ts +0 -46
- package/dist/core/signing-config.d.ts.map +0 -1
- package/dist/core/signing-config.js +0 -67
- package/dist/core/signing-config.js.map +0 -1
- package/skills/services-agreement/template-filling-execution.md +0 -81
- package/skills/shared/template-filling-execution.md +0 -92
- /package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/CONNECTORS.md +0 -0
- /package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/CONNECTORS.md +0 -0
- /package/skills/{employment-contract → agreements/employment-contract}/CONNECTORS.md +0 -0
- /package/skills/{nda → agreements/nda}/CONNECTORS.md +0 -0
- /package/skills/{open-agreements → agreements/open-agreements}/CONNECTORS.md +0 -0
- /package/skills/{safe → agreements/safe}/CONNECTORS.md +0 -0
- /package/skills/{services-agreement → agreements/services-agreement}/CONNECTORS.md +0 -0
- /package/skills/{venture-financing → agreements/venture-financing}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/ecorp-portal-playwright-notes.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/faq.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/filing-instructions.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/tax-calculation.md +0 -0
- /package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/api-exports.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/evidence-types.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/screenshot-guide.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/access-control.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/business-continuity.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/change-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/encryption.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/incident-response.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/isms-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/logging-monitoring.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/people-controls.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/supplier-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/CONNECTORS.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/change-vendor-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/communication-info.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-environment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/logical-access.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/monitoring-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/optional-categories.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/privacy-criteria.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/risk-assessment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/system-operations.md +0 -0
- /package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/CONNECTORS.md +0 -0
- /package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/references/allure-test-spec-writing-guide.md +0 -0
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { OOXML, W } from './namespaces.js';
|
|
2
|
+
import { getAttributeSafe, getFirstChild } from './xml-helpers.js';
|
|
2
3
|
import { getParagraphText, getParagraphRuns } from './text.js';
|
|
3
|
-
import {
|
|
4
|
+
import { getParagraphBookmarkId } from './bookmarks.js';
|
|
5
|
+
import { buildTableMetaMap, deriveTableContext } from './table_context.js';
|
|
6
|
+
import { extractListLabel, stripListLabel } from './list_labels.js';
|
|
4
7
|
import { parseNumberingXml, computeListLabelForParagraph } from './numbering.js';
|
|
5
8
|
import { parseStylesXml, extractParagraphFormatting, extractEffectiveRunFormatting } from './styles.js';
|
|
6
9
|
import { HIGHLIGHT_TAG } from './semantic_tags.js';
|
|
7
10
|
import { computeModalBaseline, computeParagraphFontBaseline, emitFormattingTags, mergeAdjacentTags } from './formatting_tags.js';
|
|
8
11
|
import { isReservedFootnote } from './footnotes.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
import { deriveHeading, detectRunInHeader, detectTitleCapsCentered, extractHeaderInfo, suppressSignatureClusters, } from './document_view-headings.js';
|
|
13
|
+
import { discoverStyles, fingerprintKey } from './document_view-styles.js';
|
|
14
|
+
import { findTaggedTextInsertionIndex } from './document_view-comments.js';
|
|
15
|
+
export { discoverStyles } from './document_view-styles.js';
|
|
16
|
+
export { INLINE_COMMENT_MARKER_RUNTIME, TOON_INLINE_TAG_RE, collectInlineCommentMarkers, tokenizeToonInline } from './document_view-comments.js';
|
|
17
|
+
export { collectTableMarkerInfo, formatTableMarker, formatToonCommentEndnoteLines, formatToonCommentLines, formatToonCommentsEndnotesBlock, formatToonDataLine, renderToon, renderToonWithCommentEndnotes, } from './document_view-toon.js';
|
|
12
18
|
function getWAttr(el, localName) {
|
|
13
|
-
return el
|
|
19
|
+
return getAttributeSafe(el, OOXML.W_NS, localName, 'w');
|
|
14
20
|
}
|
|
15
21
|
function runHighlightVal(run) {
|
|
16
|
-
const rPr = run
|
|
22
|
+
const rPr = getFirstChild(run, OOXML.W_NS, W.rPr);
|
|
17
23
|
if (!rPr)
|
|
18
24
|
return null;
|
|
19
|
-
const h = rPr
|
|
25
|
+
const h = getFirstChild(rPr, OOXML.W_NS, W.highlight);
|
|
20
26
|
if (!h)
|
|
21
27
|
return null;
|
|
22
28
|
const v = getWAttr(h, 'val');
|
|
@@ -46,304 +52,55 @@ function emitHighlightTagsFromParagraph(p) {
|
|
|
46
52
|
out.push(`</${HIGHLIGHT_TAG}>`);
|
|
47
53
|
return out.join('');
|
|
48
54
|
}
|
|
49
|
-
function fingerprintKey(fp) {
|
|
50
|
-
// Stable JSON-ish key used for Map lookups.
|
|
51
|
-
return `${fp.list_level}|${fp.left_indent_pt.toFixed(1)}|${fp.first_line_indent_pt.toFixed(1)}|${fp.style_name}|${fp.alignment}`;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* v0.3: Compact style fingerprint token.
|
|
55
|
-
* Concatenates style name, list level, alignment, and indentation for token-efficient LLM context.
|
|
56
|
-
* Example: "Normal:L-1:LEFT:I0:H0"
|
|
57
|
-
*/
|
|
58
|
-
function computeFingerprintToken(fp, styleId) {
|
|
59
|
-
const name = styleId || fp.style_name || 'body';
|
|
60
|
-
const level = `L${fp.list_level}`;
|
|
61
|
-
const align = fp.alignment;
|
|
62
|
-
const indent = `I${Math.round(fp.left_indent_pt)}`;
|
|
63
|
-
const hanging = `H${Math.round(fp.first_line_indent_pt)}`;
|
|
64
|
-
return `${name}:${level}:${align}:${indent}:${hanging}`;
|
|
65
|
-
}
|
|
66
|
-
// Pattern-based header detection fallback (ported from Python ingestor._extract_header_info).
|
|
67
|
-
const HEADER_PATTERN = /^([A-Z][^.!?:]*(?:\s+[A-Z][^.!?:]*)*)([.:]?)(?:\s|$)/;
|
|
68
|
-
function extractHeaderInfo(cleanText) {
|
|
69
|
-
if (!cleanText || cleanText.length < 2)
|
|
70
|
-
return { header_text: null, header_style: null };
|
|
71
|
-
if (!/^[A-Z]/.test(cleanText))
|
|
72
|
-
return { header_text: null, header_style: null };
|
|
73
|
-
const stripped = cleanText.trim();
|
|
74
|
-
if (stripped.length <= SHORT_HEADER_MAX_LENGTH) {
|
|
75
|
-
if (stripped.endsWith('.'))
|
|
76
|
-
return { header_text: stripped.slice(0, -1), header_style: 'title_with_period' };
|
|
77
|
-
if (stripped.endsWith(':'))
|
|
78
|
-
return { header_text: stripped.slice(0, -1), header_style: 'title_with_colon' };
|
|
79
|
-
const words = stripped.split(/\s+/);
|
|
80
|
-
if (words.length <= 5)
|
|
81
|
-
return { header_text: stripped, header_style: 'title_bare' };
|
|
82
|
-
return { header_text: null, header_style: null };
|
|
83
|
-
}
|
|
84
|
-
const m = HEADER_PATTERN.exec(stripped);
|
|
85
|
-
if (!m)
|
|
86
|
-
return { header_text: null, header_style: null };
|
|
87
|
-
const headerText = (m[1] ?? '').trim();
|
|
88
|
-
const terminator = m[2] ?? '';
|
|
89
|
-
const remaining = stripped.slice(m[0].length);
|
|
90
|
-
if (!remaining || headerText.length > MAX_HEADER_TEXT_LENGTH)
|
|
91
|
-
return { header_text: null, header_style: null };
|
|
92
|
-
if (terminator === '.')
|
|
93
|
-
return { header_text: headerText, header_style: 'title_with_period' };
|
|
94
|
-
if (terminator === ':')
|
|
95
|
-
return { header_text: headerText, header_style: 'title_with_colon' };
|
|
96
|
-
return { header_text: headerText, header_style: 'title_bare' };
|
|
97
|
-
}
|
|
98
|
-
function detectRunInHeader(params) {
|
|
99
|
-
const { paragraph, paragraphPPr, paragraphStyleId, styles } = params;
|
|
100
|
-
const punct = new Set(['.', ':', '-']);
|
|
101
|
-
// Use visible runs only (field code text stripped in getParagraphRuns()).
|
|
102
|
-
const runs = getParagraphRuns(paragraph);
|
|
103
|
-
if (runs.length === 0)
|
|
104
|
-
return null;
|
|
105
|
-
// Group by run element, preserving order.
|
|
106
|
-
const orderedUniqueRuns = [];
|
|
107
|
-
const seen = new Set();
|
|
108
|
-
for (const tr of runs) {
|
|
109
|
-
if (!seen.has(tr.r)) {
|
|
110
|
-
seen.add(tr.r);
|
|
111
|
-
orderedUniqueRuns.push(tr.r);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
let headerText = '';
|
|
115
|
-
let formatting = null;
|
|
116
|
-
let headerCharCount = 0;
|
|
117
|
-
for (const r of orderedUniqueRuns) {
|
|
118
|
-
const fmt = extractEffectiveRunFormatting({ run: r, paragraphPPr, paragraphStyleId, styles });
|
|
119
|
-
const isHeaderStyle = fmt.bold || fmt.underline;
|
|
120
|
-
if (!isHeaderStyle)
|
|
121
|
-
break;
|
|
122
|
-
// Accumulate run text.
|
|
123
|
-
const ts = Array.from(r.getElementsByTagNameNS(OOXML.W_NS, W.t));
|
|
124
|
-
for (const t of ts) {
|
|
125
|
-
const tc = t.textContent ?? '';
|
|
126
|
-
headerText += tc;
|
|
127
|
-
headerCharCount += tc.length;
|
|
128
|
-
}
|
|
129
|
-
if (!formatting)
|
|
130
|
-
formatting = { bold: fmt.bold, italic: fmt.italic, underline: fmt.underline };
|
|
131
|
-
}
|
|
132
|
-
const trimmed = headerText.trim();
|
|
133
|
-
if (!trimmed)
|
|
134
|
-
return null;
|
|
135
|
-
if (!punct.has(trimmed[trimmed.length - 1]))
|
|
136
|
-
return null;
|
|
137
|
-
if (!formatting)
|
|
138
|
-
return null;
|
|
139
|
-
return { raw_text: trimmed, formatting, headerCharCount };
|
|
140
|
-
}
|
|
141
|
-
function inferSemanticName(params) {
|
|
142
|
-
const { fp, nodes } = params;
|
|
143
|
-
// Find first label_type if present.
|
|
144
|
-
let labelType = null;
|
|
145
|
-
for (const n of nodes) {
|
|
146
|
-
if (n.list_metadata.label_type) {
|
|
147
|
-
labelType = n.list_metadata.label_type;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const listLevel = fp.list_level;
|
|
152
|
-
if (listLevel >= 0) {
|
|
153
|
-
if (listLevel === 0) {
|
|
154
|
-
if (labelType === LabelType.ARTICLE)
|
|
155
|
-
return { base_id: 'article', display_name: 'Article Heading' };
|
|
156
|
-
if (labelType === LabelType.SECTION)
|
|
157
|
-
return { base_id: 'section', display_name: 'Section Heading' };
|
|
158
|
-
if (labelType === LabelType.ROMAN)
|
|
159
|
-
return { base_id: 'roman_section', display_name: 'Roman Numeral Section' };
|
|
160
|
-
return { base_id: 'top_level', display_name: 'Top-Level List Item' };
|
|
161
|
-
}
|
|
162
|
-
if (listLevel === 1) {
|
|
163
|
-
if (labelType === LabelType.LETTER)
|
|
164
|
-
return { base_id: 'subsection', display_name: 'Subsection (a)/(A)' };
|
|
165
|
-
if (labelType === LabelType.NUMBER)
|
|
166
|
-
return { base_id: 'subsection_number', display_name: 'Numbered Subsection' };
|
|
167
|
-
if (labelType === LabelType.ROMAN)
|
|
168
|
-
return { base_id: 'subsection_roman', display_name: 'Roman Subsection' };
|
|
169
|
-
return { base_id: 'level_1', display_name: `Level ${listLevel} List Item` };
|
|
170
|
-
}
|
|
171
|
-
if (labelType === LabelType.ROMAN)
|
|
172
|
-
return { base_id: `level_${listLevel}_roman`, display_name: `Level ${listLevel} Roman` };
|
|
173
|
-
if (labelType === LabelType.LETTER)
|
|
174
|
-
return { base_id: `level_${listLevel}_letter`, display_name: `Level ${listLevel} Letter` };
|
|
175
|
-
return { base_id: `level_${listLevel}`, display_name: `Level ${listLevel} List Item` };
|
|
176
|
-
}
|
|
177
|
-
// Non-list.
|
|
178
|
-
const styleName = fp.style_name.toLowerCase().replace(/\s+/g, '_');
|
|
179
|
-
if (fp.left_indent_pt > 0)
|
|
180
|
-
return { base_id: 'indent_block', display_name: 'Indented Block' };
|
|
181
|
-
if (styleName.includes('heading') || styleName.includes('title'))
|
|
182
|
-
return { base_id: 'heading', display_name: 'Heading' };
|
|
183
|
-
if (styleName.includes('quote') || styleName.includes('block'))
|
|
184
|
-
return { base_id: 'block_quote', display_name: 'Block Quote' };
|
|
185
|
-
return { base_id: 'body', display_name: 'Body Text' };
|
|
186
|
-
}
|
|
187
|
-
export function discoverStyles(nodes) {
|
|
188
|
-
const groups = new Map();
|
|
189
|
-
for (const n of nodes) {
|
|
190
|
-
const key = fingerprintKey(n.style_fingerprint);
|
|
191
|
-
const g = groups.get(key);
|
|
192
|
-
if (g)
|
|
193
|
-
g.nodes.push(n);
|
|
194
|
-
else
|
|
195
|
-
groups.set(key, { fp: n.style_fingerprint, nodes: [n] });
|
|
196
|
-
}
|
|
197
|
-
const used = {};
|
|
198
|
-
const styles = new Map();
|
|
199
|
-
const fpToStyle = new Map();
|
|
200
|
-
for (const [fpKey, g] of groups.entries()) {
|
|
201
|
-
const { base_id, display_name } = inferSemanticName({ fp: g.fp, nodes: g.nodes });
|
|
202
|
-
let styleId = base_id;
|
|
203
|
-
if (used[base_id] !== undefined) {
|
|
204
|
-
used[base_id] += 1;
|
|
205
|
-
styleId = `${base_id}_${used[base_id]}`;
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
used[base_id] = 0;
|
|
209
|
-
}
|
|
210
|
-
const median = g.nodes[Math.floor(g.nodes.length / 2)];
|
|
211
|
-
const info = {
|
|
212
|
-
style_id: styleId,
|
|
213
|
-
display_name,
|
|
214
|
-
fingerprint: g.fp,
|
|
215
|
-
example_node_id: median.id,
|
|
216
|
-
example_text: median.clean_text.slice(0, STYLE_EXAMPLE_TEXT_PREVIEW_LENGTH),
|
|
217
|
-
count: g.nodes.length,
|
|
218
|
-
dominant_alignment: g.fp.alignment,
|
|
219
|
-
};
|
|
220
|
-
styles.set(styleId, info);
|
|
221
|
-
fpToStyle.set(fpKey, styleId);
|
|
222
|
-
}
|
|
223
|
-
return { styles, fingerprint_to_style: fpToStyle };
|
|
224
|
-
}
|
|
225
|
-
function headerStripFromText(params) {
|
|
226
|
-
// Mirrors Python TOONRenderer header stripping.
|
|
227
|
-
const { header } = params;
|
|
228
|
-
let { text } = params;
|
|
229
|
-
if (!header)
|
|
230
|
-
return text;
|
|
231
|
-
const headerNorm = header.trim().toLowerCase();
|
|
232
|
-
const textLower = text.toLowerCase();
|
|
233
|
-
for (const punct of [':', '.', '-', ';', '']) {
|
|
234
|
-
const testPrefix = `${headerNorm}${punct}`;
|
|
235
|
-
if (textLower.startsWith(testPrefix)) {
|
|
236
|
-
text = text.slice(testPrefix.length).trimStart();
|
|
237
|
-
return text;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
if (text.startsWith(header)) {
|
|
241
|
-
text = text.slice(header.length).replace(/^[.:\-;]+/, '').trimStart();
|
|
242
|
-
}
|
|
243
|
-
return text;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Format a single toon data line for one DocumentViewNode.
|
|
247
|
-
* Handles table-context-aware style (th/td) and header stripping.
|
|
248
|
-
*/
|
|
249
|
-
export function formatToonDataLine(n, options) {
|
|
250
|
-
let text = n.tagged_text;
|
|
251
|
-
if (n.header)
|
|
252
|
-
text = headerStripFromText({ header: n.header, text });
|
|
253
|
-
let header = n.header;
|
|
254
|
-
if (header && !text) {
|
|
255
|
-
text = header;
|
|
256
|
-
header = '';
|
|
257
|
-
}
|
|
258
|
-
const tc = n.table_context;
|
|
259
|
-
let style;
|
|
260
|
-
if (tc) {
|
|
261
|
-
style = tc.is_header_row
|
|
262
|
-
? `th(${tc.row_index},${tc.col_index})`
|
|
263
|
-
: `td(${tc.row_index},${tc.col_index})`;
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
style = options?.compact
|
|
267
|
-
? computeFingerprintToken(n.style_fingerprint, n.style)
|
|
268
|
-
: n.style;
|
|
269
|
-
}
|
|
270
|
-
return `${n.id} | ${n.list_label} | ${header} | ${style} | ${text}`;
|
|
271
|
-
}
|
|
272
55
|
/**
|
|
273
|
-
* Collect
|
|
274
|
-
*
|
|
56
|
+
* Collect the bookmarked paragraphs of a document, each with its derived table
|
|
57
|
+
* context, in document order. This is the shared paragraph-collection core used
|
|
58
|
+
* by BOTH `DocxDocument.buildDocumentView()` and the free `buildDocumentView()`
|
|
59
|
+
* so the two produce identical node sets.
|
|
60
|
+
*
|
|
61
|
+
* Only paragraphs carrying a `_bk_*` bookmark id are included (the document view
|
|
62
|
+
* addresses nodes by that id). This function does NOT insert bookmarks — a
|
|
63
|
+
* consumer operating on un-bookmarked source DOCX MUST call
|
|
64
|
+
* `DocxDocument.insertParagraphBookmarks()` first, or the result is empty.
|
|
275
65
|
*/
|
|
276
|
-
export function
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return info;
|
|
66
|
+
export function collectViewParagraphs(documentXml) {
|
|
67
|
+
const body = documentXml.getElementsByTagNameNS(OOXML.W_NS, W.body).item(0);
|
|
68
|
+
if (!body)
|
|
69
|
+
return [];
|
|
70
|
+
const tableMetaMap = buildTableMetaMap(body);
|
|
71
|
+
return Array.from(body.getElementsByTagNameNS(OOXML.W_NS, W.p))
|
|
72
|
+
.map((p) => {
|
|
73
|
+
const id = getParagraphBookmarkId(p);
|
|
74
|
+
if (!id)
|
|
75
|
+
return null;
|
|
76
|
+
const tableContext = deriveTableContext(p, tableMetaMap);
|
|
77
|
+
return tableContext ? { id, p, tableContext } : { id, p };
|
|
78
|
+
})
|
|
79
|
+
.filter((x) => x !== null);
|
|
291
80
|
}
|
|
292
81
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
82
|
+
* Free function form of the document-view builder. Delegates to the same shared
|
|
83
|
+
* core (`collectViewParagraphs` + `buildNodesForDocumentView`) as
|
|
84
|
+
* `DocxDocument.buildDocumentView()`, so it returns populated nodes — one per
|
|
85
|
+
* bookmarked paragraph — rather than the empty stub it used to be.
|
|
86
|
+
*
|
|
87
|
+
* Like the method, it includes only paragraphs carrying a `_bk_*` bookmark id
|
|
88
|
+
* and does NOT insert bookmarks itself.
|
|
295
89
|
*/
|
|
296
|
-
export function formatTableMarker(info) {
|
|
297
|
-
return `#TABLE ${info.id} | ${info.totalRows} rows × ${info.totalCols} cols`;
|
|
298
|
-
}
|
|
299
|
-
export function renderToon(nodes, options = {}) {
|
|
300
|
-
const lines = ['#SCHEMA id | list_label | header | style | text'];
|
|
301
|
-
// Pre-scan: collect table marker info for #TABLE lines
|
|
302
|
-
const tableInfo = collectTableMarkerInfo(nodes);
|
|
303
|
-
let currentTableIndex = null;
|
|
304
|
-
for (const n of nodes) {
|
|
305
|
-
const tc = n.table_context;
|
|
306
|
-
const nodeTableIndex = tc ? tc.table_index : null;
|
|
307
|
-
// Close previous table if we left it or moved to a different table
|
|
308
|
-
if (currentTableIndex !== null && nodeTableIndex !== currentTableIndex) {
|
|
309
|
-
lines.push('#END_TABLE');
|
|
310
|
-
currentTableIndex = null;
|
|
311
|
-
}
|
|
312
|
-
// Open new table if entering one
|
|
313
|
-
if (nodeTableIndex !== null && currentTableIndex === null) {
|
|
314
|
-
const info = tableInfo.get(nodeTableIndex);
|
|
315
|
-
if (info)
|
|
316
|
-
lines.push(formatTableMarker(info));
|
|
317
|
-
currentTableIndex = nodeTableIndex;
|
|
318
|
-
}
|
|
319
|
-
lines.push(formatToonDataLine(n, options));
|
|
320
|
-
}
|
|
321
|
-
// Close any open table at end
|
|
322
|
-
if (currentTableIndex !== null) {
|
|
323
|
-
lines.push('#END_TABLE');
|
|
324
|
-
}
|
|
325
|
-
return lines.join('\n');
|
|
326
|
-
}
|
|
327
90
|
export function buildDocumentView(params) {
|
|
328
|
-
const { documentXml, stylesXml, numberingXml, opts } = params;
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
const nodes = [];
|
|
342
|
-
for (const p of paragraphs) {
|
|
343
|
-
const prev = p.previousSibling;
|
|
344
|
-
void prev;
|
|
345
|
-
}
|
|
346
|
-
return { nodes, styles: { styles: new Map(), fingerprint_to_style: new Map() } };
|
|
91
|
+
const { documentXml, stylesXml, numberingXml, footnotesXml, relsMap, opts } = params;
|
|
92
|
+
const paragraphs = collectViewParagraphs(documentXml);
|
|
93
|
+
return buildNodesForDocumentView({
|
|
94
|
+
paragraphs,
|
|
95
|
+
stylesXml,
|
|
96
|
+
numberingXml,
|
|
97
|
+
include_semantic_tags: opts?.include_semantic_tags ?? true,
|
|
98
|
+
show_formatting: opts?.show_formatting ?? false,
|
|
99
|
+
formatting_mode: opts?.formatting_mode ?? 'compact',
|
|
100
|
+
relsMap,
|
|
101
|
+
documentXml,
|
|
102
|
+
footnotesXml: footnotesXml ?? null,
|
|
103
|
+
});
|
|
347
104
|
}
|
|
348
105
|
// ── Helpers for building AnnotatedRun arrays ─────────────────────────
|
|
349
106
|
/**
|
|
@@ -357,9 +114,7 @@ function resolveRunHyperlinkUrl(runEl, relsMap) {
|
|
|
357
114
|
if (!parent || parent.localName !== W.hyperlink)
|
|
358
115
|
return null;
|
|
359
116
|
// r:id attribute can be namespaced or prefixed.
|
|
360
|
-
const rId = parent
|
|
361
|
-
parent.getAttribute('r:id') ??
|
|
362
|
-
null;
|
|
117
|
+
const rId = getAttributeSafe(parent, OOXML.R_NS, 'id', 'r', { bareFallback: false });
|
|
363
118
|
if (!rId)
|
|
364
119
|
return null;
|
|
365
120
|
return relsMap.get(rId) ?? null;
|
|
@@ -439,9 +194,11 @@ function buildFootnoteDisplayMap(documentXml, footnotesXml) {
|
|
|
439
194
|
return map;
|
|
440
195
|
}
|
|
441
196
|
/**
|
|
442
|
-
* Compute footnote
|
|
443
|
-
*
|
|
444
|
-
*
|
|
197
|
+
* Compute the footnote references a paragraph visibly anchors, in document
|
|
198
|
+
* order. This is the single derivation of "which footnotes does this paragraph
|
|
199
|
+
* reference, and with what display number" — the view injects [^N] markers
|
|
200
|
+
* from it AND exposes it as DocumentViewNode.footnote_refs so consumers
|
|
201
|
+
* (read_file's clean_text suffix) never re-walk the DOM. @see #393
|
|
445
202
|
*
|
|
446
203
|
* Self-contained: only inspects the paragraph DOM for w:footnoteReference
|
|
447
204
|
* elements. Does NOT modify getParagraphRuns or getParagraphText.
|
|
@@ -500,28 +257,85 @@ function getFootnoteMarkersForParagraph(p, displayMap) {
|
|
|
500
257
|
if (displayNum != null) {
|
|
501
258
|
markers.push({
|
|
502
259
|
offset: visibleOffset + runVisibleLen,
|
|
503
|
-
|
|
260
|
+
id: footnoteId,
|
|
261
|
+
display: displayNum,
|
|
504
262
|
});
|
|
505
263
|
}
|
|
506
264
|
}
|
|
507
265
|
visibleOffset += runVisibleLen;
|
|
508
266
|
}
|
|
509
|
-
// Sort descending by offset for safe right-to-left insertion
|
|
510
|
-
markers.sort((a, b) => b.offset - a.offset);
|
|
511
267
|
return markers;
|
|
512
268
|
}
|
|
513
269
|
/**
|
|
514
|
-
*
|
|
515
|
-
*
|
|
270
|
+
* Paragraph content that makes a text-empty paragraph meaningful on its own:
|
|
271
|
+
* an endnote or comment anchored to the paragraph (the comment range markers
|
|
272
|
+
* are what `getComments` resolves `anchored_paragraph_id`/`end_paragraph_id`
|
|
273
|
+
* from, so dropping their paragraph leaves a dangling anchor ID no node_ids
|
|
274
|
+
* probe can resolve), or embedded visual content (DrawingML drawing, VML
|
|
275
|
+
* picture, embedded object). Dropping such a paragraph from the document view
|
|
276
|
+
* severs the anchored note/comment from every read surface and silently
|
|
277
|
+
* hides images.
|
|
278
|
+
*
|
|
279
|
+
* Footnote references are handled separately via the display map so their
|
|
280
|
+
* [^N] markers render; the shapes here only need the node to exist.
|
|
281
|
+
* @see #383
|
|
282
|
+
*/
|
|
283
|
+
const ANCHORING_CONTENT = [
|
|
284
|
+
W.endnoteReference,
|
|
285
|
+
W.commentReference,
|
|
286
|
+
W.commentRangeStart,
|
|
287
|
+
W.commentRangeEnd,
|
|
288
|
+
W.drawing,
|
|
289
|
+
W.pict,
|
|
290
|
+
W.object,
|
|
291
|
+
];
|
|
292
|
+
/**
|
|
293
|
+
* True when `el` sits inside a `w:del` or `w:moveFrom` revision wrapper below
|
|
294
|
+
* the paragraph. Deleted/moved-from content is invisible to the view's text
|
|
295
|
+
* extraction (`getParagraphText` reads `w:t`, never `w:delText`), so an
|
|
296
|
+
* anchor that only survives inside a tracked deletion — e.g. the
|
|
297
|
+
* `w:commentReference` a tracked comment-delete leaves under `w:del` — must
|
|
298
|
+
* not resurrect its paragraph as a blank visible node.
|
|
299
|
+
*/
|
|
300
|
+
function isInsideRemovedRevisionWrapper(el, paragraph) {
|
|
301
|
+
let cur = el.parentNode;
|
|
302
|
+
while (cur && cur !== paragraph) {
|
|
303
|
+
if (cur.namespaceURI === OOXML.W_NS && (cur.localName === W.del || cur.localName === W.moveFrom)) {
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
cur = cur.parentNode;
|
|
307
|
+
}
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
function paragraphHasAnchoringContent(p) {
|
|
311
|
+
return ANCHORING_CONTENT.some((localName) => {
|
|
312
|
+
const els = p.getElementsByTagNameNS(OOXML.W_NS, localName);
|
|
313
|
+
for (let i = 0; i < els.length; i++) {
|
|
314
|
+
if (!isInsideRemovedRevisionWrapper(els.item(i), p))
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
return false;
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Inject [^N] footnote markers into a text string at the given offsets.
|
|
322
|
+
* Markers arrive in document order; insertion happens right-to-left (offset
|
|
323
|
+
* descending) so earlier offsets stay valid as text grows.
|
|
324
|
+
*
|
|
325
|
+
* Offsets are *visible*-character offsets (they count document text, not the inline
|
|
326
|
+
* formatting tags emitted by `emitFormattingTags`). When `text` carries formatting tags
|
|
327
|
+
* we therefore map each visible offset to a tag-aware insertion index, exactly as the
|
|
328
|
+
* comment-marker path does (`findTaggedTextInsertionIndex`). A naive `slice(offset)` would
|
|
329
|
+
* land the `[^n]` marker inside a tag or mid-word once formatting is present.
|
|
516
330
|
*/
|
|
517
331
|
function injectFootnoteMarkers(text, markers) {
|
|
518
332
|
if (markers.length === 0)
|
|
519
333
|
return text;
|
|
334
|
+
const descending = [...markers].sort((a, b) => b.offset - a.offset);
|
|
520
335
|
let result = text;
|
|
521
|
-
for (const { offset,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
result = result.slice(0, pos) + marker + result.slice(pos);
|
|
336
|
+
for (const { offset, display } of descending) {
|
|
337
|
+
const insertionIndex = findTaggedTextInsertionIndex(result, offset);
|
|
338
|
+
result = result.slice(0, insertionIndex) + `[^${display}]` + result.slice(insertionIndex);
|
|
525
339
|
}
|
|
526
340
|
return result;
|
|
527
341
|
}
|
|
@@ -544,7 +358,7 @@ export function buildNodesForDocumentView(params) {
|
|
|
544
358
|
const allBodyRuns = [];
|
|
545
359
|
if (showFormatting) {
|
|
546
360
|
for (const { p } of paragraphs) {
|
|
547
|
-
const paraPPr = p
|
|
361
|
+
const paraPPr = getFirstChild(p, OOXML.W_NS, W.pPr);
|
|
548
362
|
const paraFmt = extractParagraphFormatting(paraPPr ?? null, stylesModel);
|
|
549
363
|
const runs = buildAnnotatedRuns({
|
|
550
364
|
p,
|
|
@@ -593,20 +407,39 @@ export function buildNodesForDocumentView(params) {
|
|
|
593
407
|
const nodes = [];
|
|
594
408
|
for (let idx = 0; idx < paragraphs.length; idx++) {
|
|
595
409
|
const { id, p, tableContext } = paragraphs[idx];
|
|
596
|
-
const paraPPr = p
|
|
410
|
+
const paraPPr = getFirstChild(p, OOXML.W_NS, W.pPr);
|
|
597
411
|
const paraFmt = extractParagraphFormatting(paraPPr ?? null, stylesModel);
|
|
412
|
+
// Raw visible text (field codes stripped, but NOT CR/LF-stripped or trimmed).
|
|
413
|
+
// This is the coordinate system `replaceParagraphTextRange`/`replaceTextAtRange`
|
|
414
|
+
// operate in; it is carried on the node so the clean_text → raw offset map can
|
|
415
|
+
// be rebuilt deterministically. @see buildCleanToRawOffsetMap
|
|
416
|
+
const rawText = getParagraphText(p);
|
|
598
417
|
// Visible clean text (field codes stripped).
|
|
599
|
-
const fullText =
|
|
600
|
-
//
|
|
601
|
-
|
|
418
|
+
const fullText = rawText.replace(/\r/g, '').replace(/\n/g, '').trim();
|
|
419
|
+
// Computed once per paragraph: gates the empty-paragraph skip below, drives
|
|
420
|
+
// the [^N] marker injection, and is exposed as node.footnote_refs.
|
|
421
|
+
const fnMarkers = getFootnoteMarkersForParagraph(p, footnoteDisplayMap);
|
|
422
|
+
// Preserve empty table cell paragraphs for structural completeness, and
|
|
423
|
+
// text-empty paragraphs that carry anchoring content — a visible footnote
|
|
424
|
+
// reference (its [^N] marker renders via the injection pass below), an
|
|
425
|
+
// endnote reference, a comment reference or comment range marker, or an
|
|
426
|
+
// embedded drawing/picture/object. Dropping those loses the anchored
|
|
427
|
+
// note/comment/image from every rendering of the document view. Anchors
|
|
428
|
+
// that survive only inside a tracked deletion don't count, and paragraphs
|
|
429
|
+
// that are empty for spacing only are still skipped.
|
|
430
|
+
// @see #185, #383
|
|
431
|
+
if (!fullText &&
|
|
432
|
+
!tableContext &&
|
|
433
|
+
fnMarkers.length === 0 &&
|
|
434
|
+
!paragraphHasAnchoringContent(p))
|
|
602
435
|
continue;
|
|
603
436
|
// Numbering (auto-numbered) info from numPr.
|
|
604
437
|
let numId = null;
|
|
605
438
|
let ilvl = null;
|
|
606
|
-
const numPr = paraPPr ? paraPPr
|
|
439
|
+
const numPr = paraPPr ? getFirstChild(paraPPr, OOXML.W_NS, W.numPr) : null;
|
|
607
440
|
if (numPr) {
|
|
608
|
-
const numIdEl = numPr
|
|
609
|
-
const ilvlEl = numPr
|
|
441
|
+
const numIdEl = getFirstChild(numPr, OOXML.W_NS, W.numId);
|
|
442
|
+
const ilvlEl = getFirstChild(numPr, OOXML.W_NS, W.ilvl);
|
|
610
443
|
const numIdVal = numIdEl ? getWAttr(numIdEl, 'val') : null;
|
|
611
444
|
const ilvlVal = ilvlEl ? getWAttr(ilvlEl, 'val') : null;
|
|
612
445
|
if (numIdVal)
|
|
@@ -649,7 +482,13 @@ export function buildNodesForDocumentView(params) {
|
|
|
649
482
|
let headerFormatting = null;
|
|
650
483
|
let headerCharCount = 0;
|
|
651
484
|
try {
|
|
652
|
-
|
|
485
|
+
// Skip in-table run-in header detection — table cells are key/value
|
|
486
|
+
// layout and a bold prefix is a label, not a section heading.
|
|
487
|
+
// Mirrors the !tableContext gates on detectTitleCapsCentered and
|
|
488
|
+
// extractHeaderInfo below.
|
|
489
|
+
const hdr = tableContext
|
|
490
|
+
? null
|
|
491
|
+
: detectRunInHeader({ paragraph: p, paragraphPPr: paraPPr ?? null, paragraphStyleId: paraFmt.styleId, styles: stylesModel });
|
|
653
492
|
if (hdr) {
|
|
654
493
|
headerText = hdr.raw_text.replace(/[.:\-]+$/g, '');
|
|
655
494
|
headerStyle = 'run_in_header';
|
|
@@ -660,11 +499,39 @@ export function buildNodesForDocumentView(params) {
|
|
|
660
499
|
catch {
|
|
661
500
|
// ignore
|
|
662
501
|
}
|
|
663
|
-
|
|
502
|
+
// Centered ALL-CAPS bold standalone titles (e.g. an NVCA SPA's
|
|
503
|
+
// `SERIES […] PREFERRED STOCK PURCHASE AGREEMENT`). Runs before
|
|
504
|
+
// extractHeaderInfo so the documented precedence (title_caps_centered
|
|
505
|
+
// outranks short standalone title_bare/title_with_period/title_with_colon)
|
|
506
|
+
// matches the implementation. Only fires when run_in_header did not match
|
|
507
|
+
// AND the paragraph has no list label AND is not in a table cell. The
|
|
508
|
+
// try/catch is defensive against malformed XML in user documents.
|
|
509
|
+
if (!headerText && !labelString && !tableContext) {
|
|
510
|
+
try {
|
|
511
|
+
const titleHdr = detectTitleCapsCentered({
|
|
512
|
+
paragraph: p,
|
|
513
|
+
paragraphPPr: paraPPr ?? null,
|
|
514
|
+
paragraphStyleId: paraFmt.styleId,
|
|
515
|
+
alignment: paraFmt.alignment,
|
|
516
|
+
cleanTextNoLabel,
|
|
517
|
+
styles: stylesModel,
|
|
518
|
+
});
|
|
519
|
+
if (titleHdr) {
|
|
520
|
+
headerText = titleHdr.raw_text;
|
|
521
|
+
headerStyle = 'title_caps_centered';
|
|
522
|
+
headerFormatting = titleHdr.formatting;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
catch {
|
|
526
|
+
// ignore: malformed run/style data falls through to extractHeaderInfo.
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (!headerText && !tableContext) {
|
|
664
530
|
const fallback = extractHeaderInfo(cleanTextNoLabel);
|
|
665
531
|
headerText = fallback.header_text;
|
|
666
532
|
headerStyle = fallback.header_style;
|
|
667
533
|
}
|
|
534
|
+
const heading = deriveHeading(paraFmt.styleId, cleanTextNoLabel, headerText, headerStyle, tableContext != null);
|
|
668
535
|
// ── Tag emission ──
|
|
669
536
|
let tagged = cleanTextNoLabel;
|
|
670
537
|
if (showFormatting) {
|
|
@@ -721,7 +588,7 @@ export function buildNodesForDocumentView(params) {
|
|
|
721
588
|
}
|
|
722
589
|
// Emit formatting tags from run-level metadata.
|
|
723
590
|
const paraFontBaseline = computeParagraphFontBaseline(bodyRuns, { formattingMode });
|
|
724
|
-
tagged = emitFormattingTags({ runs: bodyRuns, baseline: docBaseline, fontBaseline: paraFontBaseline });
|
|
591
|
+
tagged = emitFormattingTags({ runs: bodyRuns, baseline: docBaseline, fontBaseline: paraFontBaseline, formattingMode });
|
|
725
592
|
tagged = mergeAdjacentTags(tagged);
|
|
726
593
|
}
|
|
727
594
|
else if (includeSemantic) {
|
|
@@ -774,10 +641,13 @@ export function buildNodesForDocumentView(params) {
|
|
|
774
641
|
bodyFmt = null;
|
|
775
642
|
}
|
|
776
643
|
// Inject footnote [^N] markers into view text (view-only, not shared text primitives)
|
|
777
|
-
const fnMarkers = getFootnoteMarkersForParagraph(p, footnoteDisplayMap);
|
|
778
644
|
if (fnMarkers.length > 0) {
|
|
779
645
|
tagged = injectFootnoteMarkers(tagged, fnMarkers);
|
|
780
646
|
}
|
|
647
|
+
// Visible characters stripped from the raw paragraph head when extracting a manual
|
|
648
|
+
// label (label text + trailing whitespace). Auto-numbered paragraphs leave fullText
|
|
649
|
+
// intact, so this is 0 for them.
|
|
650
|
+
const visibleOffsetCorrection = isAutoNumbered ? 0 : Math.max(0, fullText.length - cleanTextNoLabel.length);
|
|
781
651
|
const node = {
|
|
782
652
|
id,
|
|
783
653
|
list_label: labelString,
|
|
@@ -785,7 +655,9 @@ export function buildNodesForDocumentView(params) {
|
|
|
785
655
|
style: '', // filled after style discovery
|
|
786
656
|
text: tagged, // filled after header stripping at render time
|
|
787
657
|
clean_text: cleanTextNoLabel,
|
|
658
|
+
raw_text: rawText,
|
|
788
659
|
tagged_text: tagged,
|
|
660
|
+
visible_offset_correction: visibleOffsetCorrection > 0 ? visibleOffsetCorrection : undefined,
|
|
789
661
|
list_metadata: {
|
|
790
662
|
list_level: listLevel,
|
|
791
663
|
label_type: labelType,
|
|
@@ -804,10 +676,16 @@ export function buildNodesForDocumentView(params) {
|
|
|
804
676
|
header_formatting: headerFormatting,
|
|
805
677
|
body_run_formatting: bodyFmt,
|
|
806
678
|
};
|
|
679
|
+
if (heading)
|
|
680
|
+
node.heading = heading;
|
|
681
|
+
if (fnMarkers.length > 0) {
|
|
682
|
+
node.footnote_refs = fnMarkers.map(({ id: fnId, display }) => ({ id: fnId, display }));
|
|
683
|
+
}
|
|
807
684
|
if (tableContext)
|
|
808
685
|
node.table_context = tableContext;
|
|
809
686
|
nodes.push(node);
|
|
810
687
|
}
|
|
688
|
+
suppressSignatureClusters(nodes);
|
|
811
689
|
const styles = discoverStyles(nodes);
|
|
812
690
|
for (const n of nodes) {
|
|
813
691
|
const sid = styles.fingerprint_to_style.get(fingerprintKey(n.style_fingerprint));
|
|
@@ -816,4 +694,87 @@ export function buildNodesForDocumentView(params) {
|
|
|
816
694
|
}
|
|
817
695
|
return { nodes, styles };
|
|
818
696
|
}
|
|
697
|
+
// ── clean_text → raw offset map (the #1 offset hazard, centralized) ──
|
|
698
|
+
//
|
|
699
|
+
// Selector patterns are authored against the stable, normalized `clean_text`,
|
|
700
|
+
// but mutation (`replaceParagraphTextRange` / `DocxDocument.replaceTextAtRange`)
|
|
701
|
+
// operates on RAW offsets — `getParagraphText(p)` coordinates. `clean_text` is
|
|
702
|
+
// derived from `raw_text` by removing CR/LF, trimming leading/trailing
|
|
703
|
+
// whitespace, and (for manually-labelled list paragraphs) stripping the label
|
|
704
|
+
// prefix. Each removed character shifts every following offset, so a scalar
|
|
705
|
+
// correction (`visible_offset_correction`) is insufficient when CR/LF appear in
|
|
706
|
+
// the interior. This builds a per-character map so a matched clean-text span can
|
|
707
|
+
// be translated to exact raw offsets.
|
|
708
|
+
//
|
|
709
|
+
// `clean_text` does NOT collapse internal whitespace (that lives only in
|
|
710
|
+
// `computeContentFingerprint`), so the map deliberately does not handle that.
|
|
711
|
+
/**
|
|
712
|
+
* Build a `clean_text → raw_text` offset map for a node. The returned array has
|
|
713
|
+
* length `clean_text.length + 1`: index `o` (a clean-text offset, `0..length`)
|
|
714
|
+
* holds the corresponding raw-text offset. A clean span `[cs, ce)` therefore
|
|
715
|
+
* maps to the raw span `[map[cs], map[ce])`, ready for `replaceTextAtRange`.
|
|
716
|
+
*
|
|
717
|
+
* When `node.raw_text` is absent (legacy hand-built fixtures), the map is the
|
|
718
|
+
* identity — callers operating on real builder output always have `raw_text`.
|
|
719
|
+
*/
|
|
720
|
+
export function buildCleanToRawOffsetMap(node) {
|
|
721
|
+
const clean = node.clean_text;
|
|
722
|
+
const raw = node.raw_text;
|
|
723
|
+
// Identity fallback when raw text is unavailable.
|
|
724
|
+
if (raw === undefined) {
|
|
725
|
+
const map = new Array(clean.length + 1);
|
|
726
|
+
for (let i = 0; i <= clean.length; i++)
|
|
727
|
+
map[i] = i;
|
|
728
|
+
return map;
|
|
729
|
+
}
|
|
730
|
+
// Phase A: drop CR/LF, recording the raw index of every surviving character.
|
|
731
|
+
const survivingRawIdx = [];
|
|
732
|
+
let stripped = '';
|
|
733
|
+
for (let i = 0; i < raw.length; i++) {
|
|
734
|
+
const c = raw[i];
|
|
735
|
+
if (c === '\r' || c === '\n')
|
|
736
|
+
continue;
|
|
737
|
+
stripped += c;
|
|
738
|
+
survivingRawIdx.push(i);
|
|
739
|
+
}
|
|
740
|
+
// Phase B: trim leading/trailing whitespace (String.prototype.trim semantics,
|
|
741
|
+
// matching the `.trim()` in the clean_text derivation).
|
|
742
|
+
const leadingTrim = stripped.length - stripped.replace(/^\s+/, '').length;
|
|
743
|
+
const trimmed = stripped.trim();
|
|
744
|
+
const fullRawIdx = survivingRawIdx.slice(leadingTrim, leadingTrim + trimmed.length);
|
|
745
|
+
// Phase C: manual-list-label prefix. `clean_text` is a front-stripped suffix
|
|
746
|
+
// of the trimmed full text, so locate where it begins.
|
|
747
|
+
let prefixLen = 0;
|
|
748
|
+
if (clean.length <= trimmed.length && trimmed.endsWith(clean)) {
|
|
749
|
+
prefixLen = trimmed.length - clean.length;
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
const idx = trimmed.indexOf(clean);
|
|
753
|
+
prefixLen = idx >= 0 ? idx : 0;
|
|
754
|
+
}
|
|
755
|
+
const cleanRawIdx = fullRawIdx.slice(prefixLen, prefixLen + clean.length);
|
|
756
|
+
const map = new Array(clean.length + 1);
|
|
757
|
+
for (let o = 0; o < clean.length; o++) {
|
|
758
|
+
map[o] = cleanRawIdx[o] ?? o;
|
|
759
|
+
}
|
|
760
|
+
// End offset (one past the last clean char).
|
|
761
|
+
if (clean.length === 0) {
|
|
762
|
+
map[0] = fullRawIdx[0] ?? survivingRawIdx[0] ?? 0;
|
|
763
|
+
}
|
|
764
|
+
else {
|
|
765
|
+
const lastRaw = cleanRawIdx[clean.length - 1];
|
|
766
|
+
map[clean.length] = (lastRaw ?? clean.length - 1) + 1;
|
|
767
|
+
}
|
|
768
|
+
return map;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Translate a single `clean_text` offset to its `raw_text` offset for a node.
|
|
772
|
+
* Convenience wrapper over {@link buildCleanToRawOffsetMap}; for translating
|
|
773
|
+
* many offsets on one node, build the map once and index it directly.
|
|
774
|
+
*/
|
|
775
|
+
export function cleanToRawOffset(node, cleanOffset) {
|
|
776
|
+
const map = buildCleanToRawOffsetMap(node);
|
|
777
|
+
const clamped = Math.max(0, Math.min(cleanOffset, map.length - 1));
|
|
778
|
+
return map[clamped];
|
|
779
|
+
}
|
|
819
780
|
//# sourceMappingURL=document_view.js.map
|