@aglyn/aglyn 1.0.0-beta.143
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 -0
- package/README.md +11 -0
- package/package.json +66 -0
- package/src/index.d.ts +25 -0
- package/src/index.js +26 -0
- package/src/index.js.map +1 -0
- package/src/lib/aglyn.d.ts +31 -0
- package/src/lib/aglyn.js +114 -0
- package/src/lib/aglyn.js.map +1 -0
- package/src/lib/app-utils/abuse-report.d.ts +193 -0
- package/src/lib/app-utils/abuse-report.js +321 -0
- package/src/lib/app-utils/abuse-report.js.map +1 -0
- package/src/lib/app-utils/accept-negotiation.d.ts +129 -0
- package/src/lib/app-utils/accept-negotiation.js +266 -0
- package/src/lib/app-utils/accept-negotiation.js.map +1 -0
- package/src/lib/app-utils/account-emails.d.ts +263 -0
- package/src/lib/app-utils/account-emails.js +264 -0
- package/src/lib/app-utils/account-emails.js.map +1 -0
- package/src/lib/app-utils/actions.d.ts +717 -0
- package/src/lib/app-utils/actions.js +1031 -0
- package/src/lib/app-utils/actions.js.map +1 -0
- package/src/lib/app-utils/activity-presenter.d.ts +152 -0
- package/src/lib/app-utils/activity-presenter.js +326 -0
- package/src/lib/app-utils/activity-presenter.js.map +1 -0
- package/src/lib/app-utils/advertising-tag-mounts.d.ts +133 -0
- package/src/lib/app-utils/advertising-tag-mounts.js +118 -0
- package/src/lib/app-utils/advertising-tag-mounts.js.map +1 -0
- package/src/lib/app-utils/advertising-tags.d.ts +307 -0
- package/src/lib/app-utils/advertising-tags.js +525 -0
- package/src/lib/app-utils/advertising-tags.js.map +1 -0
- package/src/lib/app-utils/agent-api-catalog.d.ts +94 -0
- package/src/lib/app-utils/agent-api-catalog.js +106 -0
- package/src/lib/app-utils/agent-api-catalog.js.map +1 -0
- package/src/lib/app-utils/agent-openapi.d.ts +103 -0
- package/src/lib/app-utils/agent-openapi.js +1128 -0
- package/src/lib/app-utils/agent-openapi.js.map +1 -0
- package/src/lib/app-utils/analytics-beacon.d.ts +154 -0
- package/src/lib/app-utils/analytics-beacon.js +152 -0
- package/src/lib/app-utils/analytics-beacon.js.map +1 -0
- package/src/lib/app-utils/analytics-environment.d.ts +133 -0
- package/src/lib/app-utils/analytics-environment.js +152 -0
- package/src/lib/app-utils/analytics-environment.js.map +1 -0
- package/src/lib/app-utils/analytics-events.d.ts +744 -0
- package/src/lib/app-utils/analytics-events.js +650 -0
- package/src/lib/app-utils/analytics-events.js.map +1 -0
- package/src/lib/app-utils/analytics-link-clicks.d.ts +102 -0
- package/src/lib/app-utils/analytics-link-clicks.js +267 -0
- package/src/lib/app-utils/analytics-link-clicks.js.map +1 -0
- package/src/lib/app-utils/analytics-path-key.d.ts +46 -0
- package/src/lib/app-utils/analytics-path-key.js +46 -0
- package/src/lib/app-utils/analytics-path-key.js.map +1 -0
- package/src/lib/app-utils/api-adapter.d.ts +47 -0
- package/src/lib/app-utils/api-adapter.js +367 -0
- package/src/lib/app-utils/api-adapter.js.map +1 -0
- package/src/lib/app-utils/api-idempotency.d.ts +169 -0
- package/src/lib/app-utils/api-idempotency.js +213 -0
- package/src/lib/app-utils/api-idempotency.js.map +1 -0
- package/src/lib/app-utils/api-plugins.d.ts +210 -0
- package/src/lib/app-utils/api-plugins.js +221 -0
- package/src/lib/app-utils/api-plugins.js.map +1 -0
- package/src/lib/app-utils/assist-credits.d.ts +482 -0
- package/src/lib/app-utils/assist-credits.js +509 -0
- package/src/lib/app-utils/assist-credits.js.map +1 -0
- package/src/lib/app-utils/attribution-attribute.d.ts +34 -0
- package/src/lib/app-utils/attribution-attribute.js +34 -0
- package/src/lib/app-utils/attribution-attribute.js.map +1 -0
- package/src/lib/app-utils/attribution-guard.d.ts +130 -0
- package/src/lib/app-utils/attribution-guard.js +410 -0
- package/src/lib/app-utils/attribution-guard.js.map +1 -0
- package/src/lib/app-utils/author-css.d.ts +123 -0
- package/src/lib/app-utils/author-css.js +275 -0
- package/src/lib/app-utils/author-css.js.map +1 -0
- package/src/lib/app-utils/author-html-markdown.d.ts +31 -0
- package/src/lib/app-utils/author-html-markdown.js +497 -0
- package/src/lib/app-utils/author-html-markdown.js.map +1 -0
- package/src/lib/app-utils/author-html.d.ts +135 -0
- package/src/lib/app-utils/author-html.js +1037 -0
- package/src/lib/app-utils/author-html.js.map +1 -0
- package/src/lib/app-utils/automation-placeholders.d.ts +72 -0
- package/src/lib/app-utils/automation-placeholders.js +207 -0
- package/src/lib/app-utils/automation-placeholders.js.map +1 -0
- package/src/lib/app-utils/bandwidth-cap.d.ts +183 -0
- package/src/lib/app-utils/bandwidth-cap.js +193 -0
- package/src/lib/app-utils/bandwidth-cap.js.map +1 -0
- package/src/lib/app-utils/binding-token-catalog.d.ts +82 -0
- package/src/lib/app-utils/binding-token-catalog.js +293 -0
- package/src/lib/app-utils/binding-token-catalog.js.map +1 -0
- package/src/lib/app-utils/binding-tokens.d.ts +157 -0
- package/src/lib/app-utils/binding-tokens.js +251 -0
- package/src/lib/app-utils/binding-tokens.js.map +1 -0
- package/src/lib/app-utils/breadcrumb-json-ld.d.ts +57 -0
- package/src/lib/app-utils/breadcrumb-json-ld.js +67 -0
- package/src/lib/app-utils/breadcrumb-json-ld.js.map +1 -0
- package/src/lib/app-utils/campaign-attribution.d.ts +117 -0
- package/src/lib/app-utils/campaign-attribution.js +162 -0
- package/src/lib/app-utils/campaign-attribution.js.map +1 -0
- package/src/lib/app-utils/campaign-forwarding.d.ts +220 -0
- package/src/lib/app-utils/campaign-forwarding.js +332 -0
- package/src/lib/app-utils/campaign-forwarding.js.map +1 -0
- package/src/lib/app-utils/campaign-membership.d.ts +109 -0
- package/src/lib/app-utils/campaign-membership.js +176 -0
- package/src/lib/app-utils/campaign-membership.js.map +1 -0
- package/src/lib/app-utils/campaign-touch.d.ts +206 -0
- package/src/lib/app-utils/campaign-touch.js +326 -0
- package/src/lib/app-utils/campaign-touch.js.map +1 -0
- package/src/lib/app-utils/child-contract-compose.d.ts +28 -0
- package/src/lib/app-utils/child-contract-compose.js +140 -0
- package/src/lib/app-utils/child-contract-compose.js.map +1 -0
- package/src/lib/app-utils/child-contract.d.ts +129 -0
- package/src/lib/app-utils/child-contract.js +153 -0
- package/src/lib/app-utils/child-contract.js.map +1 -0
- package/src/lib/app-utils/collection-delete.d.ts +113 -0
- package/src/lib/app-utils/collection-delete.js +120 -0
- package/src/lib/app-utils/collection-delete.js.map +1 -0
- package/src/lib/app-utils/collection-entries.d.ts +833 -0
- package/src/lib/app-utils/collection-entries.js +1285 -0
- package/src/lib/app-utils/collection-entries.js.map +1 -0
- package/src/lib/app-utils/collection-entry-date.d.ts +129 -0
- package/src/lib/app-utils/collection-entry-date.js +183 -0
- package/src/lib/app-utils/collection-entry-date.js.map +1 -0
- package/src/lib/app-utils/collection-kind.d.ts +55 -0
- package/src/lib/app-utils/collection-kind.js +69 -0
- package/src/lib/app-utils/collection-kind.js.map +1 -0
- package/src/lib/app-utils/collection-slug.d.ts +79 -0
- package/src/lib/app-utils/collection-slug.js +70 -0
- package/src/lib/app-utils/collection-slug.js.map +1 -0
- package/src/lib/app-utils/compose-layout-nodes.d.ts +147 -0
- package/src/lib/app-utils/compose-layout-nodes.js +261 -0
- package/src/lib/app-utils/compose-layout-nodes.js.map +1 -0
- package/src/lib/app-utils/compose-layout-props.d.ts +71 -0
- package/src/lib/app-utils/compose-layout-props.js +61 -0
- package/src/lib/app-utils/compose-layout-props.js.map +1 -0
- package/src/lib/app-utils/compose-reusable-components.d.ts +504 -0
- package/src/lib/app-utils/compose-reusable-components.js +1366 -0
- package/src/lib/app-utils/compose-reusable-components.js.map +1 -0
- package/src/lib/app-utils/compress.d.ts +35 -0
- package/src/lib/app-utils/compress.js +38 -0
- package/src/lib/app-utils/compress.js.map +1 -0
- package/src/lib/app-utils/consent-banner-ui.d.ts +226 -0
- package/src/lib/app-utils/consent-banner-ui.js +583 -0
- package/src/lib/app-utils/consent-banner-ui.js.map +1 -0
- package/src/lib/app-utils/consent-groups.d.ts +189 -0
- package/src/lib/app-utils/consent-groups.js +219 -0
- package/src/lib/app-utils/consent-groups.js.map +1 -0
- package/src/lib/app-utils/consent-preferences-dialog.d.ts +58 -0
- package/src/lib/app-utils/consent-preferences-dialog.js +106 -0
- package/src/lib/app-utils/consent-preferences-dialog.js.map +1 -0
- package/src/lib/app-utils/console-record-links.d.ts +163 -0
- package/src/lib/app-utils/console-record-links.js +178 -0
- package/src/lib/app-utils/console-record-links.js.map +1 -0
- package/src/lib/app-utils/console-routes.d.ts +658 -0
- package/src/lib/app-utils/console-routes.js +489 -0
- package/src/lib/app-utils/console-routes.js.map +1 -0
- package/src/lib/app-utils/console-widget-slot-context.d.ts +46 -0
- package/src/lib/app-utils/console-widget-slot-context.js +23 -0
- package/src/lib/app-utils/console-widget-slot-context.js.map +1 -0
- package/src/lib/app-utils/contact-custom-fields.d.ts +191 -0
- package/src/lib/app-utils/contact-custom-fields.js +349 -0
- package/src/lib/app-utils/contact-custom-fields.js.map +1 -0
- package/src/lib/app-utils/contact-holder.d.ts +52 -0
- package/src/lib/app-utils/contact-holder.js +98 -0
- package/src/lib/app-utils/contact-holder.js.map +1 -0
- package/src/lib/app-utils/contact-merge.d.ts +136 -0
- package/src/lib/app-utils/contact-merge.js +379 -0
- package/src/lib/app-utils/contact-merge.js.map +1 -0
- package/src/lib/app-utils/contacts.d.ts +554 -0
- package/src/lib/app-utils/contacts.js +401 -0
- package/src/lib/app-utils/contacts.js.map +1 -0
- package/src/lib/app-utils/content-author-profile.d.ts +68 -0
- package/src/lib/app-utils/content-author-profile.js +118 -0
- package/src/lib/app-utils/content-author-profile.js.map +1 -0
- package/src/lib/app-utils/content-authors.d.ts +662 -0
- package/src/lib/app-utils/content-authors.js +771 -0
- package/src/lib/app-utils/content-authors.js.map +1 -0
- package/src/lib/app-utils/content-schema-type.d.ts +81 -0
- package/src/lib/app-utils/content-schema-type.js +87 -0
- package/src/lib/app-utils/content-schema-type.js.map +1 -0
- package/src/lib/app-utils/contexts.d.ts +35 -0
- package/src/lib/app-utils/contexts.js +35 -0
- package/src/lib/app-utils/contexts.js.map +1 -0
- package/src/lib/app-utils/create-resource-uid.d.ts +18 -0
- package/src/lib/app-utils/create-resource-uid.js +23 -0
- package/src/lib/app-utils/create-resource-uid.js.map +1 -0
- package/src/lib/app-utils/crm-booking.d.ts +75 -0
- package/src/lib/app-utils/crm-booking.js +133 -0
- package/src/lib/app-utils/crm-booking.js.map +1 -0
- package/src/lib/app-utils/crm-csv.d.ts +232 -0
- package/src/lib/app-utils/crm-csv.js +432 -0
- package/src/lib/app-utils/crm-csv.js.map +1 -0
- package/src/lib/app-utils/crm-digest.d.ts +179 -0
- package/src/lib/app-utils/crm-digest.js +271 -0
- package/src/lib/app-utils/crm-digest.js.map +1 -0
- package/src/lib/app-utils/crm-email-templates.d.ts +172 -0
- package/src/lib/app-utils/crm-email-templates.js +382 -0
- package/src/lib/app-utils/crm-email-templates.js.map +1 -0
- package/src/lib/app-utils/crm-inbound.d.ts +245 -0
- package/src/lib/app-utils/crm-inbound.js +407 -0
- package/src/lib/app-utils/crm-inbound.js.map +1 -0
- package/src/lib/app-utils/crm-kinds.d.ts +73 -0
- package/src/lib/app-utils/crm-kinds.js +92 -0
- package/src/lib/app-utils/crm-kinds.js.map +1 -0
- package/src/lib/app-utils/crm-next-activity.d.ts +107 -0
- package/src/lib/app-utils/crm-next-activity.js +140 -0
- package/src/lib/app-utils/crm-next-activity.js.map +1 -0
- package/src/lib/app-utils/crm-reports.d.ts +479 -0
- package/src/lib/app-utils/crm-reports.js +680 -0
- package/src/lib/app-utils/crm-reports.js.map +1 -0
- package/src/lib/app-utils/crm-task-reminders.d.ts +129 -0
- package/src/lib/app-utils/crm-task-reminders.js +139 -0
- package/src/lib/app-utils/crm-task-reminders.js.map +1 -0
- package/src/lib/app-utils/crm.d.ts +1546 -0
- package/src/lib/app-utils/crm.js +1814 -0
- package/src/lib/app-utils/crm.js.map +1 -0
- package/src/lib/app-utils/csp-report.d.ts +84 -0
- package/src/lib/app-utils/csp-report.js +177 -0
- package/src/lib/app-utils/csp-report.js.map +1 -0
- package/src/lib/app-utils/csv-import.d.ts +192 -0
- package/src/lib/app-utils/csv-import.js +279 -0
- package/src/lib/app-utils/csv-import.js.map +1 -0
- package/src/lib/app-utils/dataset-csv.d.ts +109 -0
- package/src/lib/app-utils/dataset-csv.js +235 -0
- package/src/lib/app-utils/dataset-csv.js.map +1 -0
- package/src/lib/app-utils/dataset-models.d.ts +194 -0
- package/src/lib/app-utils/dataset-models.js +409 -0
- package/src/lib/app-utils/dataset-models.js.map +1 -0
- package/src/lib/app-utils/dataset-query.d.ts +57 -0
- package/src/lib/app-utils/dataset-query.js +126 -0
- package/src/lib/app-utils/dataset-query.js.map +1 -0
- package/src/lib/app-utils/datasets.d.ts +136 -0
- package/src/lib/app-utils/datasets.js +177 -0
- package/src/lib/app-utils/datasets.js.map +1 -0
- package/src/lib/app-utils/decompress.d.ts +36 -0
- package/src/lib/app-utils/decompress.js +32 -0
- package/src/lib/app-utils/decompress.js.map +1 -0
- package/src/lib/app-utils/dedicated-sending-domain.d.ts +47 -0
- package/src/lib/app-utils/dedicated-sending-domain.js +114 -0
- package/src/lib/app-utils/dedicated-sending-domain.js.map +1 -0
- package/src/lib/app-utils/deferred-image.d.ts +86 -0
- package/src/lib/app-utils/deferred-image.js +83 -0
- package/src/lib/app-utils/deferred-image.js.map +1 -0
- package/src/lib/app-utils/definition-canvas-tree.d.ts +61 -0
- package/src/lib/app-utils/definition-canvas-tree.js +126 -0
- package/src/lib/app-utils/definition-canvas-tree.js.map +1 -0
- package/src/lib/app-utils/deployment-shape.d.ts +167 -0
- package/src/lib/app-utils/deployment-shape.js +238 -0
- package/src/lib/app-utils/deployment-shape.js.map +1 -0
- package/src/lib/app-utils/detect-template-placeholders.d.ts +30 -0
- package/src/lib/app-utils/detect-template-placeholders.js +53 -0
- package/src/lib/app-utils/detect-template-placeholders.js.map +1 -0
- package/src/lib/app-utils/dmca-counter-notice.d.ts +185 -0
- package/src/lib/app-utils/dmca-counter-notice.js +277 -0
- package/src/lib/app-utils/dmca-counter-notice.js.map +1 -0
- package/src/lib/app-utils/docs-deflection.d.ts +156 -0
- package/src/lib/app-utils/docs-deflection.js +547 -0
- package/src/lib/app-utils/docs-deflection.js.map +1 -0
- package/src/lib/app-utils/docs-help.d.ts +57 -0
- package/src/lib/app-utils/docs-help.generated.d.ts +303 -0
- package/src/lib/app-utils/docs-help.generated.js +867 -0
- package/src/lib/app-utils/docs-help.generated.js.map +1 -0
- package/src/lib/app-utils/docs-help.js +46 -0
- package/src/lib/app-utils/docs-help.js.map +1 -0
- package/src/lib/app-utils/docs-index.generated.d.ts +29 -0
- package/src/lib/app-utils/docs-index.generated.js +8388 -0
- package/src/lib/app-utils/docs-index.generated.js.map +1 -0
- package/src/lib/app-utils/docs-retrieval.d.ts +67 -0
- package/src/lib/app-utils/docs-retrieval.js +188 -0
- package/src/lib/app-utils/docs-retrieval.js.map +1 -0
- package/src/lib/app-utils/document-landmark.d.ts +50 -0
- package/src/lib/app-utils/document-landmark.js +100 -0
- package/src/lib/app-utils/document-landmark.js.map +1 -0
- package/src/lib/app-utils/duplicate-resource.d.ts +101 -0
- package/src/lib/app-utils/duplicate-resource.js +206 -0
- package/src/lib/app-utils/duplicate-resource.js.map +1 -0
- package/src/lib/app-utils/dynamic-list-rule.d.ts +471 -0
- package/src/lib/app-utils/dynamic-list-rule.js +914 -0
- package/src/lib/app-utils/dynamic-list-rule.js.map +1 -0
- package/src/lib/app-utils/element-animation.d.ts +200 -0
- package/src/lib/app-utils/element-animation.js +233 -0
- package/src/lib/app-utils/element-animation.js.map +1 -0
- package/src/lib/app-utils/element-hidden-style.d.ts +46 -0
- package/src/lib/app-utils/element-hidden-style.js +48 -0
- package/src/lib/app-utils/element-hidden-style.js.map +1 -0
- package/src/lib/app-utils/element-ui.d.ts +243 -0
- package/src/lib/app-utils/element-ui.js +459 -0
- package/src/lib/app-utils/element-ui.js.map +1 -0
- package/src/lib/app-utils/email-starter-policy.d.ts +160 -0
- package/src/lib/app-utils/email-starter-policy.js +327 -0
- package/src/lib/app-utils/email-starter-policy.js.map +1 -0
- package/src/lib/app-utils/email-topics.d.ts +310 -0
- package/src/lib/app-utils/email-topics.js +336 -0
- package/src/lib/app-utils/email-topics.js.map +1 -0
- package/src/lib/app-utils/enabled-plugins-context.d.ts +100 -0
- package/src/lib/app-utils/enabled-plugins-context.js +113 -0
- package/src/lib/app-utils/enabled-plugins-context.js.map +1 -0
- package/src/lib/app-utils/ensure-canvas-root.d.ts +38 -0
- package/src/lib/app-utils/ensure-canvas-root.js +61 -0
- package/src/lib/app-utils/ensure-canvas-root.js.map +1 -0
- package/src/lib/app-utils/entity-picker-context.d.ts +199 -0
- package/src/lib/app-utils/entity-picker-context.js +93 -0
- package/src/lib/app-utils/entity-picker-context.js.map +1 -0
- package/src/lib/app-utils/error-beacon.d.ts +107 -0
- package/src/lib/app-utils/error-beacon.js +296 -0
- package/src/lib/app-utils/error-beacon.js.map +1 -0
- package/src/lib/app-utils/expand-repeatables.d.ts +172 -0
- package/src/lib/app-utils/expand-repeatables.js +299 -0
- package/src/lib/app-utils/expand-repeatables.js.map +1 -0
- package/src/lib/app-utils/foreign-script.d.ts +82 -0
- package/src/lib/app-utils/foreign-script.js +102 -0
- package/src/lib/app-utils/foreign-script.js.map +1 -0
- package/src/lib/app-utils/form-abuse-ceiling.d.ts +146 -0
- package/src/lib/app-utils/form-abuse-ceiling.js +158 -0
- package/src/lib/app-utils/form-abuse-ceiling.js.map +1 -0
- package/src/lib/app-utils/form-contract.d.ts +198 -0
- package/src/lib/app-utils/form-contract.js +282 -0
- package/src/lib/app-utils/form-contract.js.map +1 -0
- package/src/lib/app-utils/form-dataset-binding.d.ts +50 -0
- package/src/lib/app-utils/form-dataset-binding.js +74 -0
- package/src/lib/app-utils/form-dataset-binding.js.map +1 -0
- package/src/lib/app-utils/forms.d.ts +727 -0
- package/src/lib/app-utils/forms.js +777 -0
- package/src/lib/app-utils/forms.js.map +1 -0
- package/src/lib/app-utils/functions.d.ts +188 -0
- package/src/lib/app-utils/functions.js +529 -0
- package/src/lib/app-utils/functions.js.map +1 -0
- package/src/lib/app-utils/guarded-version-save.d.ts +91 -0
- package/src/lib/app-utils/guarded-version-save.js +131 -0
- package/src/lib/app-utils/guarded-version-save.js.map +1 -0
- package/src/lib/app-utils/health-report.d.ts +1766 -0
- package/src/lib/app-utils/health-report.js +2072 -0
- package/src/lib/app-utils/health-report.js.map +1 -0
- package/src/lib/app-utils/host-naming.d.ts +135 -0
- package/src/lib/app-utils/host-naming.js +188 -0
- package/src/lib/app-utils/host-naming.js.map +1 -0
- package/src/lib/app-utils/host-permissions.d.ts +76 -0
- package/src/lib/app-utils/host-permissions.js +119 -0
- package/src/lib/app-utils/host-permissions.js.map +1 -0
- package/src/lib/app-utils/host-tokens.d.ts +228 -0
- package/src/lib/app-utils/host-tokens.js +304 -0
- package/src/lib/app-utils/host-tokens.js.map +1 -0
- package/src/lib/app-utils/idp-profile.d.ts +83 -0
- package/src/lib/app-utils/idp-profile.js +268 -0
- package/src/lib/app-utils/idp-profile.js.map +1 -0
- package/src/lib/app-utils/image-upload-types.d.ts +49 -0
- package/src/lib/app-utils/image-upload-types.js +86 -0
- package/src/lib/app-utils/image-upload-types.js.map +1 -0
- package/src/lib/app-utils/index.d.ts +18 -0
- package/src/lib/app-utils/index.js +23 -0
- package/src/lib/app-utils/index.js.map +1 -0
- package/src/lib/app-utils/internal-traffic.d.ts +197 -0
- package/src/lib/app-utils/internal-traffic.js +288 -0
- package/src/lib/app-utils/internal-traffic.js.map +1 -0
- package/src/lib/app-utils/lineal-order.d.ts +62 -0
- package/src/lib/app-utils/lineal-order.js +65 -0
- package/src/lib/app-utils/lineal-order.js.map +1 -0
- package/src/lib/app-utils/link-references.d.ts +36 -0
- package/src/lib/app-utils/link-references.js +89 -0
- package/src/lib/app-utils/link-references.js.map +1 -0
- package/src/lib/app-utils/link-target-search-context.d.ts +123 -0
- package/src/lib/app-utils/link-target-search-context.js +221 -0
- package/src/lib/app-utils/link-target-search-context.js.map +1 -0
- package/src/lib/app-utils/list-assignment-policy.d.ts +169 -0
- package/src/lib/app-utils/list-assignment-policy.js +170 -0
- package/src/lib/app-utils/list-assignment-policy.js.map +1 -0
- package/src/lib/app-utils/list-import.d.ts +158 -0
- package/src/lib/app-utils/list-import.js +332 -0
- package/src/lib/app-utils/list-import.js.map +1 -0
- package/src/lib/app-utils/llms-txt.d.ts +104 -0
- package/src/lib/app-utils/llms-txt.js +144 -0
- package/src/lib/app-utils/llms-txt.js.map +1 -0
- package/src/lib/app-utils/local-storage-budget.d.ts +75 -0
- package/src/lib/app-utils/local-storage-budget.js +153 -0
- package/src/lib/app-utils/local-storage-budget.js.map +1 -0
- package/src/lib/app-utils/lockdown.d.ts +698 -0
- package/src/lib/app-utils/lockdown.js +929 -0
- package/src/lib/app-utils/lockdown.js.map +1 -0
- package/src/lib/app-utils/margin-utilization.d.ts +267 -0
- package/src/lib/app-utils/margin-utilization.js +351 -0
- package/src/lib/app-utils/margin-utilization.js.map +1 -0
- package/src/lib/app-utils/markdown-lite.d.ts +297 -0
- package/src/lib/app-utils/markdown-lite.js +705 -0
- package/src/lib/app-utils/markdown-lite.js.map +1 -0
- package/src/lib/app-utils/marketing-consent.d.ts +704 -0
- package/src/lib/app-utils/marketing-consent.js +783 -0
- package/src/lib/app-utils/marketing-consent.js.map +1 -0
- package/src/lib/app-utils/marketplace-listing-visibility.d.ts +120 -0
- package/src/lib/app-utils/marketplace-listing-visibility.js +139 -0
- package/src/lib/app-utils/marketplace-listing-visibility.js.map +1 -0
- package/src/lib/app-utils/marketplace-overrides.d.ts +271 -0
- package/src/lib/app-utils/marketplace-overrides.js +462 -0
- package/src/lib/app-utils/marketplace-overrides.js.map +1 -0
- package/src/lib/app-utils/marketplace-provenance.d.ts +150 -0
- package/src/lib/app-utils/marketplace-provenance.js +136 -0
- package/src/lib/app-utils/marketplace-provenance.js.map +1 -0
- package/src/lib/app-utils/marketplace-theme.d.ts +237 -0
- package/src/lib/app-utils/marketplace-theme.js +525 -0
- package/src/lib/app-utils/marketplace-theme.js.map +1 -0
- package/src/lib/app-utils/marketplace-update-state.d.ts +119 -0
- package/src/lib/app-utils/marketplace-update-state.js +132 -0
- package/src/lib/app-utils/marketplace-update-state.js.map +1 -0
- package/src/lib/app-utils/marketplace-verification.d.ts +95 -0
- package/src/lib/app-utils/marketplace-verification.js +81 -0
- package/src/lib/app-utils/marketplace-verification.js.map +1 -0
- package/src/lib/app-utils/measure-node-map.d.ts +76 -0
- package/src/lib/app-utils/measure-node-map.js +111 -0
- package/src/lib/app-utils/measure-node-map.js.map +1 -0
- package/src/lib/app-utils/media-alt.d.ts +55 -0
- package/src/lib/app-utils/media-alt.js +58 -0
- package/src/lib/app-utils/media-alt.js.map +1 -0
- package/src/lib/app-utils/media-asset-facts.d.ts +125 -0
- package/src/lib/app-utils/media-asset-facts.js +467 -0
- package/src/lib/app-utils/media-asset-facts.js.map +1 -0
- package/src/lib/app-utils/media-cdn-scope.d.ts +65 -0
- package/src/lib/app-utils/media-cdn-scope.js +75 -0
- package/src/lib/app-utils/media-cdn-scope.js.map +1 -0
- package/src/lib/app-utils/media-folders.d.ts +161 -0
- package/src/lib/app-utils/media-folders.js +230 -0
- package/src/lib/app-utils/media-folders.js.map +1 -0
- package/src/lib/app-utils/media-metadata.d.ts +277 -0
- package/src/lib/app-utils/media-metadata.js +388 -0
- package/src/lib/app-utils/media-metadata.js.map +1 -0
- package/src/lib/app-utils/media-picker-context.d.ts +93 -0
- package/src/lib/app-utils/media-picker-context.js +26 -0
- package/src/lib/app-utils/media-picker-context.js.map +1 -0
- package/src/lib/app-utils/media-quarantine.d.ts +247 -0
- package/src/lib/app-utils/media-quarantine.js +323 -0
- package/src/lib/app-utils/media-quarantine.js.map +1 -0
- package/src/lib/app-utils/media-ref.d.ts +661 -0
- package/src/lib/app-utils/media-ref.js +1055 -0
- package/src/lib/app-utils/media-ref.js.map +1 -0
- package/src/lib/app-utils/media-takedown-reach.d.ts +126 -0
- package/src/lib/app-utils/media-takedown-reach.js +143 -0
- package/src/lib/app-utils/media-takedown-reach.js.map +1 -0
- package/src/lib/app-utils/member-email-aliases.d.ts +180 -0
- package/src/lib/app-utils/member-email-aliases.js +217 -0
- package/src/lib/app-utils/member-email-aliases.js.map +1 -0
- package/src/lib/app-utils/merge-node-sx.d.ts +47 -0
- package/src/lib/app-utils/merge-node-sx.js +123 -0
- package/src/lib/app-utils/merge-node-sx.js.map +1 -0
- package/src/lib/app-utils/name-match.d.ts +155 -0
- package/src/lib/app-utils/name-match.js +175 -0
- package/src/lib/app-utils/name-match.js.map +1 -0
- package/src/lib/app-utils/name-search.d.ts +117 -0
- package/src/lib/app-utils/name-search.js +145 -0
- package/src/lib/app-utils/name-search.js.map +1 -0
- package/src/lib/app-utils/node-capabilities.d.ts +85 -0
- package/src/lib/app-utils/node-capabilities.js +88 -0
- package/src/lib/app-utils/node-capabilities.js.map +1 -0
- package/src/lib/app-utils/node-definition-sanitizer.d.ts +164 -0
- package/src/lib/app-utils/node-definition-sanitizer.js +402 -0
- package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -0
- package/src/lib/app-utils/node-identity.d.ts +47 -0
- package/src/lib/app-utils/node-identity.js +50 -0
- package/src/lib/app-utils/node-identity.js.map +1 -0
- package/src/lib/app-utils/node-interactions.d.ts +102 -0
- package/src/lib/app-utils/node-interactions.js +192 -0
- package/src/lib/app-utils/node-interactions.js.map +1 -0
- package/src/lib/app-utils/node-url-policy.d.ts +54 -0
- package/src/lib/app-utils/node-url-policy.js +72 -0
- package/src/lib/app-utils/node-url-policy.js.map +1 -0
- package/src/lib/app-utils/notifications.d.ts +71 -0
- package/src/lib/app-utils/notifications.js +101 -0
- package/src/lib/app-utils/notifications.js.map +1 -0
- package/src/lib/app-utils/onboarding-deep-link.d.ts +120 -0
- package/src/lib/app-utils/onboarding-deep-link.js +142 -0
- package/src/lib/app-utils/onboarding-deep-link.js.map +1 -0
- package/src/lib/app-utils/operator-identity.d.ts +207 -0
- package/src/lib/app-utils/operator-identity.js +186 -0
- package/src/lib/app-utils/operator-identity.js.map +1 -0
- package/src/lib/app-utils/org-billing-doc.d.ts +231 -0
- package/src/lib/app-utils/org-billing-doc.js +238 -0
- package/src/lib/app-utils/org-billing-doc.js.map +1 -0
- package/src/lib/app-utils/org-override-reason.d.ts +100 -0
- package/src/lib/app-utils/org-override-reason.js +116 -0
- package/src/lib/app-utils/org-override-reason.js.map +1 -0
- package/src/lib/app-utils/org-permissions.d.ts +194 -0
- package/src/lib/app-utils/org-permissions.js +357 -0
- package/src/lib/app-utils/org-permissions.js.map +1 -0
- package/src/lib/app-utils/org-roles.d.ts +72 -0
- package/src/lib/app-utils/org-roles.js +131 -0
- package/src/lib/app-utils/org-roles.js.map +1 -0
- package/src/lib/app-utils/organizations.d.ts +407 -0
- package/src/lib/app-utils/organizations.js +511 -0
- package/src/lib/app-utils/organizations.js.map +1 -0
- package/src/lib/app-utils/page-header-actions-context.d.ts +83 -0
- package/src/lib/app-utils/page-header-actions-context.js +58 -0
- package/src/lib/app-utils/page-header-actions-context.js.map +1 -0
- package/src/lib/app-utils/page-header-record-context.d.ts +80 -0
- package/src/lib/app-utils/page-header-record-context.js +64 -0
- package/src/lib/app-utils/page-header-record-context.js.map +1 -0
- package/src/lib/app-utils/page-markdown.d.ts +103 -0
- package/src/lib/app-utils/page-markdown.js +385 -0
- package/src/lib/app-utils/page-markdown.js.map +1 -0
- package/src/lib/app-utils/paid-media-source.d.ts +90 -0
- package/src/lib/app-utils/paid-media-source.js +184 -0
- package/src/lib/app-utils/paid-media-source.js.map +1 -0
- package/src/lib/app-utils/palette-sx.d.ts +34 -0
- package/src/lib/app-utils/palette-sx.js +150 -0
- package/src/lib/app-utils/palette-sx.js.map +1 -0
- package/src/lib/app-utils/password-policy.d.ts +47 -0
- package/src/lib/app-utils/password-policy.js +46 -0
- package/src/lib/app-utils/password-policy.js.map +1 -0
- package/src/lib/app-utils/payments-configured.d.ts +84 -0
- package/src/lib/app-utils/payments-configured.js +88 -0
- package/src/lib/app-utils/payments-configured.js.map +1 -0
- package/src/lib/app-utils/person-erasure.d.ts +126 -0
- package/src/lib/app-utils/person-erasure.js +121 -0
- package/src/lib/app-utils/person-erasure.js.map +1 -0
- package/src/lib/app-utils/person-key.d.ts +32 -0
- package/src/lib/app-utils/person-key.js +62 -0
- package/src/lib/app-utils/person-key.js.map +1 -0
- package/src/lib/app-utils/plan-entitlements.d.ts +2756 -0
- package/src/lib/app-utils/plan-entitlements.js +4085 -0
- package/src/lib/app-utils/plan-entitlements.js.map +1 -0
- package/src/lib/app-utils/platform-ad-conversions.d.ts +122 -0
- package/src/lib/app-utils/platform-ad-conversions.js +174 -0
- package/src/lib/app-utils/platform-ad-conversions.js.map +1 -0
- package/src/lib/app-utils/platform-advertising-tags.d.ts +139 -0
- package/src/lib/app-utils/platform-advertising-tags.js +203 -0
- package/src/lib/app-utils/platform-advertising-tags.js.map +1 -0
- package/src/lib/app-utils/platform-brand.d.ts +151 -0
- package/src/lib/app-utils/platform-brand.js +175 -0
- package/src/lib/app-utils/platform-brand.js.map +1 -0
- package/src/lib/app-utils/platform-consent-default.d.ts +142 -0
- package/src/lib/app-utils/platform-consent-default.js +295 -0
- package/src/lib/app-utils/platform-consent-default.js.map +1 -0
- package/src/lib/app-utils/platform-marketing-consent.d.ts +151 -0
- package/src/lib/app-utils/platform-marketing-consent.js +182 -0
- package/src/lib/app-utils/platform-marketing-consent.js.map +1 -0
- package/src/lib/app-utils/platform-marketing-host.d.ts +33 -0
- package/src/lib/app-utils/platform-marketing-host.js +97 -0
- package/src/lib/app-utils/platform-marketing-host.js.map +1 -0
- package/src/lib/app-utils/platform-visitor-consent.d.ts +252 -0
- package/src/lib/app-utils/platform-visitor-consent.js +533 -0
- package/src/lib/app-utils/platform-visitor-consent.js.map +1 -0
- package/src/lib/app-utils/plugin-api-cross-origin.d.ts +61 -0
- package/src/lib/app-utils/plugin-api-cross-origin.js +202 -0
- package/src/lib/app-utils/plugin-api-cross-origin.js.map +1 -0
- package/src/lib/app-utils/plugin-api-rate-limit.d.ts +192 -0
- package/src/lib/app-utils/plugin-api-rate-limit.js +270 -0
- package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -0
- package/src/lib/app-utils/plugin-artifact-path.d.ts +32 -0
- package/src/lib/app-utils/plugin-artifact-path.js +33 -0
- package/src/lib/app-utils/plugin-artifact-path.js.map +1 -0
- package/src/lib/app-utils/plugin-bundle-checks.d.ts +148 -0
- package/src/lib/app-utils/plugin-bundle-checks.js +989 -0
- package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -0
- package/src/lib/app-utils/plugin-manifest.d.ts +516 -0
- package/src/lib/app-utils/plugin-manifest.js +687 -0
- package/src/lib/app-utils/plugin-manifest.js.map +1 -0
- package/src/lib/app-utils/published-legal-pages.d.ts +71 -0
- package/src/lib/app-utils/published-legal-pages.js +90 -0
- package/src/lib/app-utils/published-legal-pages.js.map +1 -0
- package/src/lib/app-utils/publisher-agreement.d.ts +254 -0
- package/src/lib/app-utils/publisher-agreement.js +274 -0
- package/src/lib/app-utils/publisher-agreement.js.map +1 -0
- package/src/lib/app-utils/publisher-attestation.d.ts +99 -0
- package/src/lib/app-utils/publisher-attestation.js +158 -0
- package/src/lib/app-utils/publisher-attestation.js.map +1 -0
- package/src/lib/app-utils/recipient-email-render.d.ts +216 -0
- package/src/lib/app-utils/recipient-email-render.js +221 -0
- package/src/lib/app-utils/recipient-email-render.js.map +1 -0
- package/src/lib/app-utils/redispatch-caught-error.d.ts +38 -0
- package/src/lib/app-utils/redispatch-caught-error.js +46 -0
- package/src/lib/app-utils/redispatch-caught-error.js.map +1 -0
- package/src/lib/app-utils/registering-plugin.d.ts +19 -0
- package/src/lib/app-utils/registering-plugin.js +38 -0
- package/src/lib/app-utils/registering-plugin.js.map +1 -0
- package/src/lib/app-utils/release-flags.d.ts +283 -0
- package/src/lib/app-utils/release-flags.js +518 -0
- package/src/lib/app-utils/release-flags.js.map +1 -0
- package/src/lib/app-utils/repair-canvas-nodes.d.ts +130 -0
- package/src/lib/app-utils/repair-canvas-nodes.js +298 -0
- package/src/lib/app-utils/repair-canvas-nodes.js.map +1 -0
- package/src/lib/app-utils/repeat-infringer.d.ts +166 -0
- package/src/lib/app-utils/repeat-infringer.js +188 -0
- package/src/lib/app-utils/repeat-infringer.js.map +1 -0
- package/src/lib/app-utils/repeat-sources.d.ts +115 -0
- package/src/lib/app-utils/repeat-sources.js +86 -0
- package/src/lib/app-utils/repeat-sources.js.map +1 -0
- package/src/lib/app-utils/request-geo.d.ts +114 -0
- package/src/lib/app-utils/request-geo.js +247 -0
- package/src/lib/app-utils/request-geo.js.map +1 -0
- package/src/lib/app-utils/request-ip.d.ts +213 -0
- package/src/lib/app-utils/request-ip.js +344 -0
- package/src/lib/app-utils/request-ip.js.map +1 -0
- package/src/lib/app-utils/resolve-named-tokens.d.ts +26 -0
- package/src/lib/app-utils/resolve-named-tokens.js +59 -0
- package/src/lib/app-utils/resolve-named-tokens.js.map +1 -0
- package/src/lib/app-utils/responsive-typography-sx.d.ts +77 -0
- package/src/lib/app-utils/responsive-typography-sx.js +122 -0
- package/src/lib/app-utils/responsive-typography-sx.js.map +1 -0
- package/src/lib/app-utils/reusable-component-keys.d.ts +135 -0
- package/src/lib/app-utils/reusable-component-keys.js +140 -0
- package/src/lib/app-utils/reusable-component-keys.js.map +1 -0
- package/src/lib/app-utils/reusable-prop-values.d.ts +199 -0
- package/src/lib/app-utils/reusable-prop-values.js +494 -0
- package/src/lib/app-utils/reusable-prop-values.js.map +1 -0
- package/src/lib/app-utils/safe-json-ld.d.ts +29 -0
- package/src/lib/app-utils/safe-json-ld.js +37 -0
- package/src/lib/app-utils/safe-json-ld.js.map +1 -0
- package/src/lib/app-utils/sanitize-svg.d.ts +55 -0
- package/src/lib/app-utils/sanitize-svg.js +460 -0
- package/src/lib/app-utils/sanitize-svg.js.map +1 -0
- package/src/lib/app-utils/scheme-sx.d.ts +84 -0
- package/src/lib/app-utils/scheme-sx.js +148 -0
- package/src/lib/app-utils/scheme-sx.js.map +1 -0
- package/src/lib/app-utils/scope-tokens.d.ts +249 -0
- package/src/lib/app-utils/scope-tokens.js +331 -0
- package/src/lib/app-utils/scope-tokens.js.map +1 -0
- package/src/lib/app-utils/screen-link-context-value.d.ts +57 -0
- package/src/lib/app-utils/screen-link-context-value.js +43 -0
- package/src/lib/app-utils/screen-link-context-value.js.map +1 -0
- package/src/lib/app-utils/screen-link-context.d.ts +185 -0
- package/src/lib/app-utils/screen-link-context.js +304 -0
- package/src/lib/app-utils/screen-link-context.js.map +1 -0
- package/src/lib/app-utils/screen-link-value.d.ts +269 -0
- package/src/lib/app-utils/screen-link-value.js +384 -0
- package/src/lib/app-utils/screen-link-value.js.map +1 -0
- package/src/lib/app-utils/screen-route.d.ts +669 -0
- package/src/lib/app-utils/screen-route.js +751 -0
- package/src/lib/app-utils/screen-route.js.map +1 -0
- package/src/lib/app-utils/screen-seo-fields.d.ts +37 -0
- package/src/lib/app-utils/screen-seo-fields.js +42 -0
- package/src/lib/app-utils/screen-seo-fields.js.map +1 -0
- package/src/lib/app-utils/search-indexing.d.ts +162 -0
- package/src/lib/app-utils/search-indexing.js +207 -0
- package/src/lib/app-utils/search-indexing.js.map +1 -0
- package/src/lib/app-utils/seo-listing-fields.d.ts +70 -0
- package/src/lib/app-utils/seo-listing-fields.js +75 -0
- package/src/lib/app-utils/seo-listing-fields.js.map +1 -0
- package/src/lib/app-utils/seo-locale.d.ts +119 -0
- package/src/lib/app-utils/seo-locale.js +133 -0
- package/src/lib/app-utils/seo-locale.js.map +1 -0
- package/src/lib/app-utils/seo-title-variables.d.ts +149 -0
- package/src/lib/app-utils/seo-title-variables.js +190 -0
- package/src/lib/app-utils/seo-title-variables.js.map +1 -0
- package/src/lib/app-utils/seo-title.d.ts +70 -0
- package/src/lib/app-utils/seo-title.js +117 -0
- package/src/lib/app-utils/seo-title.js.map +1 -0
- package/src/lib/app-utils/server.d.ts +174 -0
- package/src/lib/app-utils/server.js +314 -0
- package/src/lib/app-utils/server.js.map +1 -0
- package/src/lib/app-utils/site-context.d.ts +106 -0
- package/src/lib/app-utils/site-context.js +100 -0
- package/src/lib/app-utils/site-context.js.map +1 -0
- package/src/lib/app-utils/sitemap.d.ts +117 -0
- package/src/lib/app-utils/sitemap.js +183 -0
- package/src/lib/app-utils/sitemap.js.map +1 -0
- package/src/lib/app-utils/social-image.d.ts +112 -0
- package/src/lib/app-utils/social-image.js +191 -0
- package/src/lib/app-utils/social-image.js.map +1 -0
- package/src/lib/app-utils/starter-templates.d.ts +99 -0
- package/src/lib/app-utils/starter-templates.js +579 -0
- package/src/lib/app-utils/starter-templates.js.map +1 -0
- package/src/lib/app-utils/stored-nodes.d.ts +120 -0
- package/src/lib/app-utils/stored-nodes.js +174 -0
- package/src/lib/app-utils/stored-nodes.js.map +1 -0
- package/src/lib/app-utils/strip-undefined.d.ts +59 -0
- package/src/lib/app-utils/strip-undefined.js +95 -0
- package/src/lib/app-utils/strip-undefined.js.map +1 -0
- package/src/lib/app-utils/stripe-deployment-mode.d.ts +47 -0
- package/src/lib/app-utils/stripe-deployment-mode.js +70 -0
- package/src/lib/app-utils/stripe-deployment-mode.js.map +1 -0
- package/src/lib/app-utils/support-tiers.d.ts +108 -0
- package/src/lib/app-utils/support-tiers.js +201 -0
- package/src/lib/app-utils/support-tiers.js.map +1 -0
- package/src/lib/app-utils/timezone-geo-hint.d.ts +36 -0
- package/src/lib/app-utils/timezone-geo-hint.js +180 -0
- package/src/lib/app-utils/timezone-geo-hint.js.map +1 -0
- package/src/lib/app-utils/upload-cors.d.ts +155 -0
- package/src/lib/app-utils/upload-cors.js +254 -0
- package/src/lib/app-utils/upload-cors.js.map +1 -0
- package/src/lib/app-utils/upload-inspection.d.ts +159 -0
- package/src/lib/app-utils/upload-inspection.js +539 -0
- package/src/lib/app-utils/upload-inspection.js.map +1 -0
- package/src/lib/app-utils/url-slug.d.ts +40 -0
- package/src/lib/app-utils/url-slug.js +42 -0
- package/src/lib/app-utils/url-slug.js.map +1 -0
- package/src/lib/app-utils/usage-budget.d.ts +429 -0
- package/src/lib/app-utils/usage-budget.js +421 -0
- package/src/lib/app-utils/usage-budget.js.map +1 -0
- package/src/lib/app-utils/variables.d.ts +96 -0
- package/src/lib/app-utils/variables.js +233 -0
- package/src/lib/app-utils/variables.js.map +1 -0
- package/src/lib/app-utils/video-asset-facts.d.ts +61 -0
- package/src/lib/app-utils/video-asset-facts.js +70 -0
- package/src/lib/app-utils/video-asset-facts.js.map +1 -0
- package/src/lib/app-utils/video-object.d.ts +89 -0
- package/src/lib/app-utils/video-object.js +245 -0
- package/src/lib/app-utils/video-object.js.map +1 -0
- package/src/lib/app-utils/visitor-consent.d.ts +757 -0
- package/src/lib/app-utils/visitor-consent.js +981 -0
- package/src/lib/app-utils/visitor-consent.js.map +1 -0
- package/src/lib/app-utils/visitor-record-ceiling.d.ts +223 -0
- package/src/lib/app-utils/visitor-record-ceiling.js +215 -0
- package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -0
- package/src/lib/app-utils/web-vitals-rum.d.ts +53 -0
- package/src/lib/app-utils/web-vitals-rum.js +278 -0
- package/src/lib/app-utils/web-vitals-rum.js.map +1 -0
- package/src/lib/app-utils/webhook-delivery.d.ts +324 -0
- package/src/lib/app-utils/webhook-delivery.js +413 -0
- package/src/lib/app-utils/webhook-delivery.js.map +1 -0
- package/src/lib/app-utils/where-used.d.ts +57 -0
- package/src/lib/app-utils/where-used.js +59 -0
- package/src/lib/app-utils/where-used.js.map +1 -0
- package/src/lib/app-utils/wistia-embed.d.ts +86 -0
- package/src/lib/app-utils/wistia-embed.js +119 -0
- package/src/lib/app-utils/wistia-embed.js.map +1 -0
- package/src/lib/app-utils/workflows.d.ts +136 -0
- package/src/lib/app-utils/workflows.js +346 -0
- package/src/lib/app-utils/workflows.js.map +1 -0
- package/src/lib/canvas-manager/canvas-manager-tree.d.ts +109 -0
- package/src/lib/canvas-manager/canvas-manager-tree.js +139 -0
- package/src/lib/canvas-manager/canvas-manager-tree.js.map +1 -0
- package/src/lib/canvas-manager/canvas-manager.d.ts +549 -0
- package/src/lib/canvas-manager/canvas-manager.js +1311 -0
- package/src/lib/canvas-manager/canvas-manager.js.map +1 -0
- package/src/lib/canvas-manager/index.d.ts +20 -0
- package/src/lib/canvas-manager/index.js +21 -0
- package/src/lib/canvas-manager/index.js.map +1 -0
- package/src/lib/canvas-manager/stores/index.d.ts +17 -0
- package/src/lib/canvas-manager/stores/index.js +18 -0
- package/src/lib/canvas-manager/stores/index.js.map +1 -0
- package/src/lib/canvas-manager/stores/node.store.d.ts +30 -0
- package/src/lib/canvas-manager/stores/node.store.js +45 -0
- package/src/lib/canvas-manager/stores/node.store.js.map +1 -0
- package/src/lib/components-manager/components-manager.d.ts +56 -0
- package/src/lib/components-manager/components-manager.js +191 -0
- package/src/lib/components-manager/components-manager.js.map +1 -0
- package/src/lib/components-manager/index.d.ts +18 -0
- package/src/lib/components-manager/index.js +19 -0
- package/src/lib/components-manager/index.js.map +1 -0
- package/src/lib/emit-manager/emit-manager.d.ts +56 -0
- package/src/lib/emit-manager/emit-manager.js +60 -0
- package/src/lib/emit-manager/emit-manager.js.map +1 -0
- package/src/lib/emit-manager/index.d.ts +18 -0
- package/src/lib/emit-manager/index.js +19 -0
- package/src/lib/emit-manager/index.js.map +1 -0
- package/src/lib/foundation/constants/_internal.d.ts +18 -0
- package/src/lib/foundation/constants/_internal.js +62 -0
- package/src/lib/foundation/constants/_internal.js.map +1 -0
- package/src/lib/foundation/constants/app.d.ts +23 -0
- package/src/lib/foundation/constants/app.js +25 -0
- package/src/lib/foundation/constants/app.js.map +1 -0
- package/src/lib/foundation/constants/canvas.d.ts +18 -0
- package/src/lib/foundation/constants/canvas.js +18 -0
- package/src/lib/foundation/constants/canvas.js.map +1 -0
- package/src/lib/foundation/constants/components.d.ts +54 -0
- package/src/lib/foundation/constants/components.js +61 -0
- package/src/lib/foundation/constants/components.js.map +1 -0
- package/src/lib/foundation/constants/shared.d.ts +50 -0
- package/src/lib/foundation/constants/shared.js +49 -0
- package/src/lib/foundation/constants/shared.js.map +1 -0
- package/src/lib/foundation/constants/symbol.d.ts +63 -0
- package/src/lib/foundation/constants/symbol.js +75 -0
- package/src/lib/foundation/constants/symbol.js.map +1 -0
- package/src/lib/foundation/definitions/components.types.d.ts +372 -0
- package/src/lib/foundation/definitions/components.types.js +180 -0
- package/src/lib/foundation/definitions/components.types.js.map +1 -0
- package/src/lib/foundation/definitions/contact.types.d.ts +73 -0
- package/src/lib/foundation/definitions/contact.types.js +107 -0
- package/src/lib/foundation/definitions/contact.types.js.map +1 -0
- package/src/lib/foundation/definitions/host-content-collections.d.ts +137 -0
- package/src/lib/foundation/definitions/host-content-collections.js +219 -0
- package/src/lib/foundation/definitions/host-content-collections.js.map +1 -0
- package/src/lib/foundation/definitions/org-billing.types.d.ts +1361 -0
- package/src/lib/foundation/definitions/org-billing.types.js +77 -0
- package/src/lib/foundation/definitions/org-billing.types.js.map +1 -0
- package/src/lib/foundation/definitions/organization.types.d.ts +307 -0
- package/src/lib/foundation/definitions/organization.types.js +42 -0
- package/src/lib/foundation/definitions/organization.types.js.map +1 -0
- package/src/lib/foundation/definitions/platform.types.d.ts +1326 -0
- package/src/lib/foundation/definitions/platform.types.js +124 -0
- package/src/lib/foundation/definitions/platform.types.js.map +1 -0
- package/src/lib/foundation/definitions/property-kinds.d.ts +189 -0
- package/src/lib/foundation/definitions/property-kinds.js +565 -0
- package/src/lib/foundation/definitions/property-kinds.js.map +1 -0
- package/src/lib/foundation/definitions/shared.d.ts +23 -0
- package/src/lib/foundation/definitions/shared.js +18 -0
- package/src/lib/foundation/definitions/shared.js.map +1 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +249 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.js +499 -0
- package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -0
- package/src/lib/foundation/index.d.ts +32 -0
- package/src/lib/foundation/index.js +67 -0
- package/src/lib/foundation/index.js.map +1 -0
- package/src/lib/lifecycle.d.ts +24 -0
- package/src/lib/lifecycle.js +39 -0
- package/src/lib/lifecycle.js.map +1 -0
- package/src/lib/mst/common.d.ts +17 -0
- package/src/lib/mst/common.js +23 -0
- package/src/lib/mst/common.js.map +1 -0
- package/src/lib/mst/index.d.ts +19 -0
- package/src/lib/mst/index.js +20 -0
- package/src/lib/mst/index.js.map +1 -0
- package/src/lib/mst/json.d.ts +22 -0
- package/src/lib/mst/json.js +23 -0
- package/src/lib/mst/json.js.map +1 -0
- package/src/lib/mst/types.d.ts +20 -0
- package/src/lib/mst/types.js +18 -0
- package/src/lib/mst/types.js.map +1 -0
- package/src/lib/plugin-manager/billing-webhook-hooks.d.ts +77 -0
- package/src/lib/plugin-manager/billing-webhook-hooks.js +55 -0
- package/src/lib/plugin-manager/billing-webhook-hooks.js.map +1 -0
- package/src/lib/plugin-manager/commerce-zone-props.d.ts +172 -0
- package/src/lib/plugin-manager/commerce-zone-props.js +31 -0
- package/src/lib/plugin-manager/commerce-zone-props.js.map +1 -0
- package/src/lib/plugin-manager/custom-fields.d.ts +60 -0
- package/src/lib/plugin-manager/custom-fields.js +39 -0
- package/src/lib/plugin-manager/custom-fields.js.map +1 -0
- package/src/lib/plugin-manager/editor-sessions.d.ts +109 -0
- package/src/lib/plugin-manager/editor-sessions.js +137 -0
- package/src/lib/plugin-manager/editor-sessions.js.map +1 -0
- package/src/lib/plugin-manager/enabled-plugins.d.ts +438 -0
- package/src/lib/plugin-manager/enabled-plugins.js +403 -0
- package/src/lib/plugin-manager/enabled-plugins.js.map +1 -0
- package/src/lib/plugin-manager/feature-plugins.d.ts +1314 -0
- package/src/lib/plugin-manager/feature-plugins.js +609 -0
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +11 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js +149 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -0
- package/src/lib/plugin-manager/index.d.ts +42 -0
- package/src/lib/plugin-manager/index.js +46 -0
- package/src/lib/plugin-manager/index.js.map +1 -0
- package/src/lib/plugin-manager/install-presets.d.ts +93 -0
- package/src/lib/plugin-manager/install-presets.js +86 -0
- package/src/lib/plugin-manager/install-presets.js.map +1 -0
- package/src/lib/plugin-manager/media-delivery-provider.d.ts +124 -0
- package/src/lib/plugin-manager/media-delivery-provider.js +53 -0
- package/src/lib/plugin-manager/media-delivery-provider.js.map +1 -0
- package/src/lib/plugin-manager/order-fulfilment.d.ts +142 -0
- package/src/lib/plugin-manager/order-fulfilment.js +104 -0
- package/src/lib/plugin-manager/order-fulfilment.js.map +1 -0
- package/src/lib/plugin-manager/plugin-activity-actions.d.ts +122 -0
- package/src/lib/plugin-manager/plugin-activity-actions.js +140 -0
- package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -0
- package/src/lib/plugin-manager/plugin-bridge.d.ts +98 -0
- package/src/lib/plugin-manager/plugin-bridge.js +154 -0
- package/src/lib/plugin-manager/plugin-bridge.js.map +1 -0
- package/src/lib/plugin-manager/plugin-config.d.ts +148 -0
- package/src/lib/plugin-manager/plugin-config.js +228 -0
- package/src/lib/plugin-manager/plugin-config.js.map +1 -0
- package/src/lib/plugin-manager/plugin-console-crons.d.ts +139 -0
- package/src/lib/plugin-manager/plugin-console-crons.js +177 -0
- package/src/lib/plugin-manager/plugin-console-crons.js.map +1 -0
- package/src/lib/plugin-manager/plugin-contact-capture.d.ts +220 -0
- package/src/lib/plugin-manager/plugin-contact-capture.js +89 -0
- package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -0
- package/src/lib/plugin-manager/plugin-contributions.d.ts +244 -0
- package/src/lib/plugin-manager/plugin-contributions.js +283 -0
- package/src/lib/plugin-manager/plugin-contributions.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entitlement-keys.d.ts +169 -0
- package/src/lib/plugin-manager/plugin-entitlement-keys.js +84 -0
- package/src/lib/plugin-manager/plugin-entitlement-keys.js.map +1 -0
- package/src/lib/plugin-manager/plugin-entitlements.d.ts +181 -0
- package/src/lib/plugin-manager/plugin-entitlements.js +188 -0
- package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -0
- package/src/lib/plugin-manager/plugin-events.d.ts +145 -0
- package/src/lib/plugin-manager/plugin-events.js +79 -0
- package/src/lib/plugin-manager/plugin-events.js.map +1 -0
- package/src/lib/plugin-manager/plugin-figures.d.ts +251 -0
- package/src/lib/plugin-manager/plugin-figures.js +252 -0
- package/src/lib/plugin-manager/plugin-figures.js.map +1 -0
- package/src/lib/plugin-manager/plugin-host-collections.d.ts +146 -0
- package/src/lib/plugin-manager/plugin-host-collections.js +116 -0
- package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -0
- package/src/lib/plugin-manager/plugin-jobs.d.ts +130 -0
- package/src/lib/plugin-manager/plugin-jobs.js +182 -0
- package/src/lib/plugin-manager/plugin-jobs.js.map +1 -0
- package/src/lib/plugin-manager/plugin-loader.d.ts +86 -0
- package/src/lib/plugin-manager/plugin-loader.js +223 -0
- package/src/lib/plugin-manager/plugin-loader.js.map +1 -0
- package/src/lib/plugin-manager/plugin-manager.d.ts +95 -0
- package/src/lib/plugin-manager/plugin-manager.js +343 -0
- package/src/lib/plugin-manager/plugin-manager.js.map +1 -0
- package/src/lib/plugin-manager/plugin-metered-lines.d.ts +97 -0
- package/src/lib/plugin-manager/plugin-metered-lines.js +123 -0
- package/src/lib/plugin-manager/plugin-metered-lines.js.map +1 -0
- package/src/lib/plugin-manager/plugin-org-erasure.d.ts +52 -0
- package/src/lib/plugin-manager/plugin-org-erasure.js +100 -0
- package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -0
- package/src/lib/plugin-manager/plugin-permissions.d.ts +69 -0
- package/src/lib/plugin-manager/plugin-permissions.js +77 -0
- package/src/lib/plugin-manager/plugin-permissions.js.map +1 -0
- package/src/lib/plugin-manager/plugin-person-erasure.d.ts +58 -0
- package/src/lib/plugin-manager/plugin-person-erasure.js +109 -0
- package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-cards.d.ts +99 -0
- package/src/lib/plugin-manager/plugin-record-cards.js +59 -0
- package/src/lib/plugin-manager/plugin-record-cards.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-facts.d.ts +111 -0
- package/src/lib/plugin-manager/plugin-record-facts.js +51 -0
- package/src/lib/plugin-manager/plugin-record-facts.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-routes.d.ts +129 -0
- package/src/lib/plugin-manager/plugin-record-routes.js +93 -0
- package/src/lib/plugin-manager/plugin-record-routes.js.map +1 -0
- package/src/lib/plugin-manager/plugin-record-timeline.d.ts +147 -0
- package/src/lib/plugin-manager/plugin-record-timeline.js +39 -0
- package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -0
- package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +137 -0
- package/src/lib/plugin-manager/plugin-resource-drafts.js +51 -0
- package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -0
- package/src/lib/plugin-manager/plugin-services.d.ts +94 -0
- package/src/lib/plugin-manager/plugin-services.js +153 -0
- package/src/lib/plugin-manager/plugin-services.js.map +1 -0
- package/src/lib/plugin-manager/plugin-styles-ui.d.ts +71 -0
- package/src/lib/plugin-manager/plugin-styles-ui.js +80 -0
- package/src/lib/plugin-manager/plugin-styles-ui.js.map +1 -0
- package/src/lib/plugin-manager/plugin-styles.d.ts +176 -0
- package/src/lib/plugin-manager/plugin-styles.js +186 -0
- package/src/lib/plugin-manager/plugin-styles.js.map +1 -0
- package/src/lib/plugin-manager/plugin-subprocessors.d.ts +135 -0
- package/src/lib/plugin-manager/plugin-subprocessors.js +129 -0
- package/src/lib/plugin-manager/plugin-subprocessors.js.map +1 -0
- package/src/lib/plugin-manager/plugin-tax-profile.d.ts +84 -0
- package/src/lib/plugin-manager/plugin-tax-profile.js +39 -0
- package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -0
- package/src/lib/plugin-manager/plugin-user-erasure.d.ts +53 -0
- package/src/lib/plugin-manager/plugin-user-erasure.js +84 -0
- package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -0
- package/src/lib/plugin-manager/plugin-zones.d.ts +121 -0
- package/src/lib/plugin-manager/plugin-zones.js +74 -0
- package/src/lib/plugin-manager/plugin-zones.js.map +1 -0
- package/src/lib/plugin-manager/realm-plugins.d.ts +112 -0
- package/src/lib/plugin-manager/realm-plugins.js +196 -0
- package/src/lib/plugin-manager/realm-plugins.js.map +1 -0
- package/src/lib/plugin-manager/realm-server.d.ts +54 -0
- package/src/lib/plugin-manager/realm-server.js +88 -0
- package/src/lib/plugin-manager/realm-server.js.map +1 -0
- package/src/lib/plugin-manager/record-zone-props.d.ts +126 -0
- package/src/lib/plugin-manager/record-zone-props.js +31 -0
- package/src/lib/plugin-manager/record-zone-props.js.map +1 -0
- package/src/lib/plugin-manager/site-page-hooks.d.ts +102 -0
- package/src/lib/plugin-manager/site-page-hooks.js +114 -0
- package/src/lib/plugin-manager/site-page-hooks.js.map +1 -0
- package/src/lib/plugin-manager/site-runtime.d.ts +57 -0
- package/src/lib/plugin-manager/site-runtime.js +25 -0
- package/src/lib/plugin-manager/site-runtime.js.map +1 -0
- package/src/lib/plugin-manager/usage-alert-contributors.d.ts +115 -0
- package/src/lib/plugin-manager/usage-alert-contributors.js +106 -0
- package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -0
- package/src/lib/types/ast.d.ts +199 -0
- package/src/lib/types/ast.js +20 -0
- package/src/lib/types/ast.js.map +1 -0
- package/src/lib/types/index.d.ts +20 -0
- package/src/lib/types/index.js +21 -0
- package/src/lib/types/index.js.map +1 -0
- package/src/lib/types/nodes.d.ts +608 -0
- package/src/lib/types/nodes.js +28 -0
- package/src/lib/types/nodes.js.map +1 -0
- package/src/lib/types/routing.d.ts +17 -0
- package/src/lib/types/routing.js +18 -0
- package/src/lib/types/routing.js.map +1 -0
- package/src/lib/types/screen.d.ts +23 -0
- package/src/lib/types/screen.js +18 -0
- package/src/lib/types/screen.js.map +1 -0
- package/src/lib/utils.d.ts +25 -0
- package/src/lib/utils.js +42 -0
- package/src/lib/utils.js.map +1 -0
- package/src/server.d.ts +37 -0
- package/src/server.js +55 -0
- package/src/server.js.map +1 -0
|
@@ -0,0 +1,1037 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* An ISOMORPHIC sanitizer for AUTHOR-WRITTEN HTML (AGL-1901).
|
|
18
|
+
*
|
|
19
|
+
* ## Why this exists
|
|
20
|
+
*
|
|
21
|
+
* Rich text (`typography.tsx`'s `html` prop) and Custom HTML
|
|
22
|
+
* (`custom-html.tsx`) are the two places a site author's raw markup reaches
|
|
23
|
+
* `dangerouslySetInnerHTML`. Both sanitized with DOMPurify, which needs a
|
|
24
|
+
* real DOM, so both deferred the sanitize into a `useEffect` — server render
|
|
25
|
+
* and first client render agreed only because BOTH were empty (AGL-1268).
|
|
26
|
+
* That fixed hydration and left every rich-text body and every Custom HTML
|
|
27
|
+
* block absent from the server response: a crawler that does not run JS saw
|
|
28
|
+
* nothing, on a product sold on "build a site and be found".
|
|
29
|
+
*
|
|
30
|
+
* AGL-1901 named two ways out. Isomorphic DOMPurify over jsdom keeps one
|
|
31
|
+
* engine but puts jsdom in the tenant SERVER bundle, landing on the open
|
|
32
|
+
* cold-start 502s (AGL-1152). A second sanitizer on the server is light but
|
|
33
|
+
* re-encodes the policy in a second engine, and any drift between the two
|
|
34
|
+
* becomes a stored-XSS hole rather than a rendering bug.
|
|
35
|
+
*
|
|
36
|
+
* This module takes the second shape and DELETES the drift risk instead of
|
|
37
|
+
* managing it: it is the ONLY sanitizer on the render path, on both sides.
|
|
38
|
+
* The server renders `sanitizeAuthorHtml(html)`; the first client render
|
|
39
|
+
* calls the same pure function on the same string and gets the same bytes,
|
|
40
|
+
* so hydration is clean by construction and there is no second engine to
|
|
41
|
+
* drift from. DOMPurify remains the reference the parity spec measures this
|
|
42
|
+
* against (`author-html-dompurify-parity.spec.ts`), not a second gate at
|
|
43
|
+
* runtime — a runtime second pass would be worthless anyway, because the
|
|
44
|
+
* server string is parsed and executed by the browser BEFORE any client code
|
|
45
|
+
* runs.
|
|
46
|
+
*
|
|
47
|
+
* The safety argument is therefore a SUBSET argument, and the parity spec
|
|
48
|
+
* asserts it: every tag and every attribute this emits is one DOMPurify
|
|
49
|
+
* would also have kept under the same config. Where the two differ, this one
|
|
50
|
+
* keeps less. Keeping less can only cost an author some markup; keeping more
|
|
51
|
+
* would be the hole.
|
|
52
|
+
*
|
|
53
|
+
* ## How it is safe without a DOM
|
|
54
|
+
*
|
|
55
|
+
* A source-level sanitizer is only sound if the string it emits re-parses to
|
|
56
|
+
* the tree it thinks it built — the mXSS class. Four rules make that true
|
|
57
|
+
* here, and each is load-bearing:
|
|
58
|
+
*
|
|
59
|
+
* 1. **No foreign content, ever.** `<svg>` and `<math>` switch the parser
|
|
60
|
+
* into a namespace with different tokenization rules; they are dropped
|
|
61
|
+
* with their contents, as are `<template>`, `<noscript>`, `<noembed>`,
|
|
62
|
+
* `<xmp>` and `<plaintext>`, whose contents parse under rules of their
|
|
63
|
+
* own. Nothing this emits can re-enter foreign or raw-text mode.
|
|
64
|
+
* 2. **Everything is re-serialized, never passed through.** Text is emitted
|
|
65
|
+
* with `&`, `<` and `>` escaped; attribute values are always double
|
|
66
|
+
* quoted with `&`, `<`, `>` and `"` escaped. There are no unquoted
|
|
67
|
+
* attribute values and no raw `<` in text for a re-parse to misread.
|
|
68
|
+
* 3. **Character references are decoded BEFORE any value is judged.** A
|
|
69
|
+
* tokenizer that reads source rather than a DOM is otherwise trivially
|
|
70
|
+
* defeated by `href="javascript:alert(1)"`, which the browser
|
|
71
|
+
* decodes and this would not. {@link decodeCharacterReferences} handles
|
|
72
|
+
* every numeric reference generically, plus the named references that can
|
|
73
|
+
* contribute a colon or whitespace to a scheme. ASCII letters have NO
|
|
74
|
+
* named references in HTML, so no named reference this does not know can
|
|
75
|
+
* help spell a scheme; only numeric ones could, and those are all
|
|
76
|
+
* decoded. The decoded value is what is validated AND what is re-escaped
|
|
77
|
+
* on the way out, so the browser sees exactly the string that was judged.
|
|
78
|
+
* 4. **Allowlists, not denylists**, for elements and for attributes, with
|
|
79
|
+
* every URL-bearing attribute scheme-checked.
|
|
80
|
+
*
|
|
81
|
+
* ## Relationship to the CSS rule
|
|
82
|
+
*
|
|
83
|
+
* `style` attributes go through {@link sanitizeAuthorCss} exactly as the
|
|
84
|
+
* per-instance DOMPurify hook AGL-1725 added did, because DOMPurify performs
|
|
85
|
+
* no CSS filtering of its own. A `<style>` ELEMENT is dropped rather than
|
|
86
|
+
* filtered, which is what both DOMPurify configs already did — the `css`
|
|
87
|
+
* component attribute remains the only route to a style block on a page.
|
|
88
|
+
*/ import { sanitizeAuthorCss } from "./author-css.js";
|
|
89
|
+
/**
|
|
90
|
+
* Elements that survive: HTML flow and phrasing content, a strict subset of
|
|
91
|
+
* DOMPurify's `USE_PROFILES: { html: true }` set minus the tags both callers
|
|
92
|
+
* already forbade (`script`, `iframe`, `object`, `embed`, `form`, `base`)
|
|
93
|
+
* and minus every interactive form control, which no author markup on a
|
|
94
|
+
* rendered page has a use for and which carries `formaction` shapes.
|
|
95
|
+
*/ export const ALLOWED_AUTHOR_HTML_ELEMENTS = new Set([
|
|
96
|
+
'a',
|
|
97
|
+
'abbr',
|
|
98
|
+
'address',
|
|
99
|
+
'article',
|
|
100
|
+
'aside',
|
|
101
|
+
'audio',
|
|
102
|
+
'b',
|
|
103
|
+
'bdi',
|
|
104
|
+
'bdo',
|
|
105
|
+
'blockquote',
|
|
106
|
+
'br',
|
|
107
|
+
'caption',
|
|
108
|
+
'cite',
|
|
109
|
+
'code',
|
|
110
|
+
'col',
|
|
111
|
+
'colgroup',
|
|
112
|
+
'data',
|
|
113
|
+
'dd',
|
|
114
|
+
'del',
|
|
115
|
+
'details',
|
|
116
|
+
'dfn',
|
|
117
|
+
'div',
|
|
118
|
+
'dl',
|
|
119
|
+
'dt',
|
|
120
|
+
'em',
|
|
121
|
+
'figcaption',
|
|
122
|
+
'figure',
|
|
123
|
+
'footer',
|
|
124
|
+
'h1',
|
|
125
|
+
'h2',
|
|
126
|
+
'h3',
|
|
127
|
+
'h4',
|
|
128
|
+
'h5',
|
|
129
|
+
'h6',
|
|
130
|
+
'header',
|
|
131
|
+
'hgroup',
|
|
132
|
+
// `main` is a deliberate subtraction from the DOMPurify profile (AGL-2486):
|
|
133
|
+
// a published page carries exactly one `main` landmark, placed by
|
|
134
|
+
// composition on the page's content region, so author markup carrying
|
|
135
|
+
// another can only make the landmark ambiguous. It is
|
|
136
|
+
// UNWRAPPED like any other unlisted tag, not dropped, so the author's content
|
|
137
|
+
// survives verbatim and only the competing landmark goes.
|
|
138
|
+
'hr',
|
|
139
|
+
'i',
|
|
140
|
+
'img',
|
|
141
|
+
'ins',
|
|
142
|
+
'kbd',
|
|
143
|
+
'li',
|
|
144
|
+
'mark',
|
|
145
|
+
'nav',
|
|
146
|
+
'ol',
|
|
147
|
+
'p',
|
|
148
|
+
'picture',
|
|
149
|
+
'pre',
|
|
150
|
+
'q',
|
|
151
|
+
'rp',
|
|
152
|
+
'rt',
|
|
153
|
+
'ruby',
|
|
154
|
+
's',
|
|
155
|
+
'samp',
|
|
156
|
+
'section',
|
|
157
|
+
'small',
|
|
158
|
+
'source',
|
|
159
|
+
'span',
|
|
160
|
+
'strong',
|
|
161
|
+
'sub',
|
|
162
|
+
'summary',
|
|
163
|
+
'sup',
|
|
164
|
+
'table',
|
|
165
|
+
'tbody',
|
|
166
|
+
'td',
|
|
167
|
+
'tfoot',
|
|
168
|
+
'th',
|
|
169
|
+
'thead',
|
|
170
|
+
'time',
|
|
171
|
+
'tr',
|
|
172
|
+
'track',
|
|
173
|
+
'u',
|
|
174
|
+
'ul',
|
|
175
|
+
'var',
|
|
176
|
+
'video',
|
|
177
|
+
'wbr'
|
|
178
|
+
]);
|
|
179
|
+
/**
|
|
180
|
+
* The subset of {@link ALLOWED_AUTHOR_HTML_ELEMENTS} that may appear inside a
|
|
181
|
+
* control — a `<button>` or an `<a>` (AGL-2557).
|
|
182
|
+
*
|
|
183
|
+
* Both have a content model of phrasing content with NO interactive
|
|
184
|
+
* descendant. Serving a `<ul>`, a `<div>` or a nested `<a>` inside one is not
|
|
185
|
+
* a styling problem: the parser closes the control early and promotes the
|
|
186
|
+
* rest to a sibling, so React hydrates against a tree it did not describe and
|
|
187
|
+
* reports the mismatch — the same shape `authorHtmlBreaksContainer` exists to
|
|
188
|
+
* head off for a `<p>`. A nested control is also unreachable by keyboard and
|
|
189
|
+
* announces as neither of the two things it is.
|
|
190
|
+
*
|
|
191
|
+
* Narrowing keeps LESS than the full allowlist, so the subset argument in
|
|
192
|
+
* this module's header still holds: everything emitted under it is something
|
|
193
|
+
* the full policy would also have kept. `img` is out with the rest of the
|
|
194
|
+
* embedded content — an author who wants an icon on a button has the icon
|
|
195
|
+
* fields for it, and nothing in the inline editor can produce one.
|
|
196
|
+
*/ export const INLINE_AUTHOR_HTML_ELEMENTS = new Set([
|
|
197
|
+
'abbr',
|
|
198
|
+
'b',
|
|
199
|
+
'bdi',
|
|
200
|
+
'bdo',
|
|
201
|
+
'br',
|
|
202
|
+
'cite',
|
|
203
|
+
'code',
|
|
204
|
+
'data',
|
|
205
|
+
'del',
|
|
206
|
+
'dfn',
|
|
207
|
+
'em',
|
|
208
|
+
'i',
|
|
209
|
+
'ins',
|
|
210
|
+
'kbd',
|
|
211
|
+
'mark',
|
|
212
|
+
'q',
|
|
213
|
+
'rp',
|
|
214
|
+
'rt',
|
|
215
|
+
'ruby',
|
|
216
|
+
's',
|
|
217
|
+
'samp',
|
|
218
|
+
'small',
|
|
219
|
+
'span',
|
|
220
|
+
'strong',
|
|
221
|
+
'sub',
|
|
222
|
+
'sup',
|
|
223
|
+
'time',
|
|
224
|
+
'u',
|
|
225
|
+
'var',
|
|
226
|
+
'wbr'
|
|
227
|
+
]);
|
|
228
|
+
/**
|
|
229
|
+
* Void elements — emitted WITHOUT a closing tag and never pushed on the open
|
|
230
|
+
* stack. A void element that carries children is not merely wrong markup
|
|
231
|
+
* here: `<img>` with children is an SSR 500 in this codebase, so the
|
|
232
|
+
* serializer must be structurally incapable of producing one.
|
|
233
|
+
*/ const VOID_ELEMENTS = new Set([
|
|
234
|
+
'br',
|
|
235
|
+
'col',
|
|
236
|
+
'hr',
|
|
237
|
+
'img',
|
|
238
|
+
'source',
|
|
239
|
+
'track',
|
|
240
|
+
'wbr'
|
|
241
|
+
]);
|
|
242
|
+
/**
|
|
243
|
+
* Elements dropped WITH their contents rather than unwrapped.
|
|
244
|
+
*
|
|
245
|
+
* Two reasons, both about the parser rather than about the tag: raw-text and
|
|
246
|
+
* escapable-raw-text elements (`script`, `style`, `textarea`, `title`,
|
|
247
|
+
* `xmp`, `plaintext`, `noscript`, `noembed`, `noframes`, `iframe`) tokenize
|
|
248
|
+
* their contents under different rules, and foreign-content roots (`svg`,
|
|
249
|
+
* `math`) switch namespace. Unwrapping either would hand the re-parse a
|
|
250
|
+
* string this never modelled.
|
|
251
|
+
*
|
|
252
|
+
* `<style>` is in this set for BOTH callers, because both DOMPurify configs
|
|
253
|
+
* dropped it: `typography.tsx` listed it in `FORBID_TAGS` and the `html`
|
|
254
|
+
* profile does not carry it, which `custom-html-author-css.spec.tsx` pins.
|
|
255
|
+
* The `css` component attribute stays the only route to a style block, and
|
|
256
|
+
* it goes through {@link sanitizeAuthorCss} where it always did.
|
|
257
|
+
*/ const CONTENT_DROPPING = new Set([
|
|
258
|
+
'script',
|
|
259
|
+
'style',
|
|
260
|
+
'textarea',
|
|
261
|
+
'title',
|
|
262
|
+
'xmp',
|
|
263
|
+
'plaintext',
|
|
264
|
+
'noscript',
|
|
265
|
+
'noembed',
|
|
266
|
+
'noframes',
|
|
267
|
+
'iframe',
|
|
268
|
+
'svg',
|
|
269
|
+
'math',
|
|
270
|
+
'template',
|
|
271
|
+
'object',
|
|
272
|
+
'applet',
|
|
273
|
+
'frame',
|
|
274
|
+
'frameset',
|
|
275
|
+
'canvas'
|
|
276
|
+
]);
|
|
277
|
+
/** Attributes any allowed element may carry. */ export const GLOBAL_AUTHOR_HTML_ATTRIBUTES = new Set([
|
|
278
|
+
'class',
|
|
279
|
+
'id',
|
|
280
|
+
'title',
|
|
281
|
+
'lang',
|
|
282
|
+
'dir',
|
|
283
|
+
'style',
|
|
284
|
+
'role'
|
|
285
|
+
]);
|
|
286
|
+
/** Attributes allowed only on the elements that define them. */ export const AUTHOR_HTML_ELEMENT_ATTRIBUTES = {
|
|
287
|
+
// No `target`. DOMPurify's html profile drops it, so both callers already
|
|
288
|
+
// dropped it, and the parity spec measures this table against that profile
|
|
289
|
+
// — putting it back here would be this sanitizer keeping MORE than the
|
|
290
|
+
// policy it replaced, which is the one direction that is not allowed to
|
|
291
|
+
// happen quietly. Giving authors `target="_blank"` is a product decision
|
|
292
|
+
// about the allowlist, not a side effect of moving the sanitizer.
|
|
293
|
+
a: new Set([
|
|
294
|
+
'href',
|
|
295
|
+
'rel',
|
|
296
|
+
'name',
|
|
297
|
+
'download',
|
|
298
|
+
'hreflang',
|
|
299
|
+
'type'
|
|
300
|
+
]),
|
|
301
|
+
audio: new Set([
|
|
302
|
+
'src',
|
|
303
|
+
'controls',
|
|
304
|
+
'loop',
|
|
305
|
+
'muted',
|
|
306
|
+
'preload'
|
|
307
|
+
]),
|
|
308
|
+
blockquote: new Set([
|
|
309
|
+
'cite'
|
|
310
|
+
]),
|
|
311
|
+
col: new Set([
|
|
312
|
+
'span'
|
|
313
|
+
]),
|
|
314
|
+
colgroup: new Set([
|
|
315
|
+
'span'
|
|
316
|
+
]),
|
|
317
|
+
data: new Set([
|
|
318
|
+
'value'
|
|
319
|
+
]),
|
|
320
|
+
del: new Set([
|
|
321
|
+
'cite',
|
|
322
|
+
'datetime'
|
|
323
|
+
]),
|
|
324
|
+
details: new Set([
|
|
325
|
+
'open'
|
|
326
|
+
]),
|
|
327
|
+
img: new Set([
|
|
328
|
+
'src',
|
|
329
|
+
'srcset',
|
|
330
|
+
'alt',
|
|
331
|
+
'width',
|
|
332
|
+
'height',
|
|
333
|
+
'loading',
|
|
334
|
+
'decoding',
|
|
335
|
+
'sizes'
|
|
336
|
+
]),
|
|
337
|
+
ins: new Set([
|
|
338
|
+
'cite',
|
|
339
|
+
'datetime'
|
|
340
|
+
]),
|
|
341
|
+
li: new Set([
|
|
342
|
+
'value'
|
|
343
|
+
]),
|
|
344
|
+
ol: new Set([
|
|
345
|
+
'start',
|
|
346
|
+
'reversed',
|
|
347
|
+
'type'
|
|
348
|
+
]),
|
|
349
|
+
q: new Set([
|
|
350
|
+
'cite'
|
|
351
|
+
]),
|
|
352
|
+
source: new Set([
|
|
353
|
+
'src',
|
|
354
|
+
'srcset',
|
|
355
|
+
'type',
|
|
356
|
+
'media',
|
|
357
|
+
'sizes',
|
|
358
|
+
'width',
|
|
359
|
+
'height'
|
|
360
|
+
]),
|
|
361
|
+
td: new Set([
|
|
362
|
+
'colspan',
|
|
363
|
+
'rowspan',
|
|
364
|
+
'headers'
|
|
365
|
+
]),
|
|
366
|
+
// No `abbr`: DOMPurify's html profile drops it on `th`, same reason as
|
|
367
|
+
// `target` on `a` — this table may not be wider than the policy it replaced.
|
|
368
|
+
th: new Set([
|
|
369
|
+
'colspan',
|
|
370
|
+
'rowspan',
|
|
371
|
+
'headers',
|
|
372
|
+
'scope'
|
|
373
|
+
]),
|
|
374
|
+
time: new Set([
|
|
375
|
+
'datetime'
|
|
376
|
+
]),
|
|
377
|
+
track: new Set([
|
|
378
|
+
'src',
|
|
379
|
+
'kind',
|
|
380
|
+
'srclang',
|
|
381
|
+
'label',
|
|
382
|
+
'default'
|
|
383
|
+
]),
|
|
384
|
+
video: new Set([
|
|
385
|
+
'src',
|
|
386
|
+
'poster',
|
|
387
|
+
'controls',
|
|
388
|
+
'loop',
|
|
389
|
+
'muted',
|
|
390
|
+
'preload',
|
|
391
|
+
'playsinline',
|
|
392
|
+
'width',
|
|
393
|
+
'height'
|
|
394
|
+
])
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Start tags that force an open `<p>` closed (HTML "in body", the
|
|
398
|
+
* `close a p element` clause).
|
|
399
|
+
*
|
|
400
|
+
* These exist here because the emitted string has to be a FIXED POINT of the
|
|
401
|
+
* parser. A crawler and a browser both read the server response through the
|
|
402
|
+
* document parser, which reparents `<p>a<div>b</div></p>` into
|
|
403
|
+
* `<p>a</p><div>b</div><p></p>` — and React, hydrating, compares the
|
|
404
|
+
* container's `innerHTML` to the `__html` it was handed and reports the
|
|
405
|
+
* difference as a mismatch. Emitting the implied end tag ourselves is what
|
|
406
|
+
* makes "what we wrote" and "what the browser will hold" the same string.
|
|
407
|
+
* That is not a theoretical tidiness: it is the hydration regression this
|
|
408
|
+
* change would otherwise have traded the SSR gap for.
|
|
409
|
+
*/ const CLOSES_OPEN_P = new Set([
|
|
410
|
+
'address',
|
|
411
|
+
'article',
|
|
412
|
+
'aside',
|
|
413
|
+
'blockquote',
|
|
414
|
+
'details',
|
|
415
|
+
'div',
|
|
416
|
+
'dl',
|
|
417
|
+
'dd',
|
|
418
|
+
'dt',
|
|
419
|
+
'figcaption',
|
|
420
|
+
'figure',
|
|
421
|
+
'footer',
|
|
422
|
+
'h1',
|
|
423
|
+
'h2',
|
|
424
|
+
'h3',
|
|
425
|
+
'h4',
|
|
426
|
+
'h5',
|
|
427
|
+
'h6',
|
|
428
|
+
'header',
|
|
429
|
+
'hgroup',
|
|
430
|
+
'hr',
|
|
431
|
+
'li',
|
|
432
|
+
'main',
|
|
433
|
+
'nav',
|
|
434
|
+
'ol',
|
|
435
|
+
'p',
|
|
436
|
+
'pre',
|
|
437
|
+
'section',
|
|
438
|
+
'summary',
|
|
439
|
+
'table',
|
|
440
|
+
'ul'
|
|
441
|
+
]);
|
|
442
|
+
/**
|
|
443
|
+
* Elements whose children the parser accepts ONLY as table parts. Text and
|
|
444
|
+
* ordinary elements written here are foster-parented OUT of the table, which
|
|
445
|
+
* is a reparenting this cannot express — so they are dropped instead, and
|
|
446
|
+
* the emitted string round-trips.
|
|
447
|
+
*/ const TABLE_CONTEXTS = new Set([
|
|
448
|
+
'table',
|
|
449
|
+
'thead',
|
|
450
|
+
'tbody',
|
|
451
|
+
'tfoot',
|
|
452
|
+
'tr'
|
|
453
|
+
]);
|
|
454
|
+
/** Elements the parser only accepts inside a table. */ const TABLE_PARTS = new Set([
|
|
455
|
+
'caption',
|
|
456
|
+
'colgroup',
|
|
457
|
+
'col',
|
|
458
|
+
'thead',
|
|
459
|
+
'tbody',
|
|
460
|
+
'tfoot',
|
|
461
|
+
'tr',
|
|
462
|
+
'td',
|
|
463
|
+
'th'
|
|
464
|
+
]);
|
|
465
|
+
/** Attributes whose value is a URL and must clear the scheme rule. */ const URL_ATTRIBUTES = new Set([
|
|
466
|
+
'href',
|
|
467
|
+
'src',
|
|
468
|
+
'poster',
|
|
469
|
+
'cite'
|
|
470
|
+
]);
|
|
471
|
+
/** Attributes whose value is a comma-separated candidate list of URLs. */ const URL_LIST_ATTRIBUTES = new Set([
|
|
472
|
+
'srcset'
|
|
473
|
+
]);
|
|
474
|
+
/**
|
|
475
|
+
* Schemes a URL attribute may name. Mirrors DOMPurify's default
|
|
476
|
+
* `ALLOWED_URI_REGEXP` minus `javascript:`-adjacent shapes it also refuses;
|
|
477
|
+
* `data:` is handled separately because it is only safe on the media
|
|
478
|
+
* attributes and only for raster types.
|
|
479
|
+
*/ const ALLOWED_SCHEMES = new Set([
|
|
480
|
+
'http',
|
|
481
|
+
'https',
|
|
482
|
+
'ftp',
|
|
483
|
+
'ftps',
|
|
484
|
+
'mailto',
|
|
485
|
+
'tel',
|
|
486
|
+
'callto',
|
|
487
|
+
'sms',
|
|
488
|
+
'cid',
|
|
489
|
+
'xmpp'
|
|
490
|
+
]);
|
|
491
|
+
/** Tag/attribute pairs on which a `data:` URL is considered at all. */ const DATA_URI_ATTRIBUTES = new Set([
|
|
492
|
+
'img:src',
|
|
493
|
+
'img:srcset',
|
|
494
|
+
'source:src',
|
|
495
|
+
'source:srcset',
|
|
496
|
+
'video:src',
|
|
497
|
+
'video:poster',
|
|
498
|
+
'audio:src'
|
|
499
|
+
]);
|
|
500
|
+
/**
|
|
501
|
+
* `data:` payloads accepted on those pairs: raster images only.
|
|
502
|
+
*
|
|
503
|
+
* `image/svg+xml` is deliberately absent. An SVG document can carry
|
|
504
|
+
* `<script>`, and a `data:` SVG in an `img` is same-origin-ish enough in
|
|
505
|
+
* enough engines that treating it as an image is a bet this does not need to
|
|
506
|
+
* take — the author has real image hosting.
|
|
507
|
+
*/ const DATA_URI_PAYLOAD = /^data:image\/(?:png|jpe?g|gif|webp|avif|bmp|x-icon)\s*;\s*base64\s*,/i;
|
|
508
|
+
/**
|
|
509
|
+
* Named character references this decodes, beyond the numeric forms.
|
|
510
|
+
*
|
|
511
|
+
* The list is short on purpose and the reasoning is in the module header:
|
|
512
|
+
* HTML has no named reference for an ASCII letter, so no reference outside
|
|
513
|
+
* this table can contribute to spelling `javascript`. What a reference CAN
|
|
514
|
+
* contribute is the colon and the leading whitespace a browser tolerates
|
|
515
|
+
* before a scheme, so those are the ones that must be understood rather than
|
|
516
|
+
* passed through.
|
|
517
|
+
*/ const NAMED_REFERENCES = {
|
|
518
|
+
amp: '&',
|
|
519
|
+
AMP: '&',
|
|
520
|
+
lt: '<',
|
|
521
|
+
LT: '<',
|
|
522
|
+
gt: '>',
|
|
523
|
+
GT: '>',
|
|
524
|
+
quot: '"',
|
|
525
|
+
QUOT: '"',
|
|
526
|
+
apos: "'",
|
|
527
|
+
nbsp: ' ',
|
|
528
|
+
colon: ':',
|
|
529
|
+
semi: ';',
|
|
530
|
+
sol: '/',
|
|
531
|
+
bsol: '\\',
|
|
532
|
+
num: '#',
|
|
533
|
+
period: '.',
|
|
534
|
+
comma: ',',
|
|
535
|
+
excl: '!',
|
|
536
|
+
quest: '?',
|
|
537
|
+
lpar: '(',
|
|
538
|
+
rpar: ')',
|
|
539
|
+
Tab: '\t',
|
|
540
|
+
NewLine: '\n',
|
|
541
|
+
equals: '=',
|
|
542
|
+
ast: '*',
|
|
543
|
+
commat: '@',
|
|
544
|
+
dollar: '$',
|
|
545
|
+
percnt: '%',
|
|
546
|
+
plus: '+',
|
|
547
|
+
minus: '-',
|
|
548
|
+
lowbar: '_'
|
|
549
|
+
};
|
|
550
|
+
/**
|
|
551
|
+
* Decodes character references in an attribute value the way a browser will,
|
|
552
|
+
* so the value can be JUDGED as the browser will see it.
|
|
553
|
+
*
|
|
554
|
+
* Numeric references are decoded generically — that is the form that can
|
|
555
|
+
* produce any character at all, and the only form that can spell a scheme.
|
|
556
|
+
* Named references are decoded from {@link NAMED_REFERENCES}; anything else
|
|
557
|
+
* is left verbatim, which is safe precisely because it cannot become a
|
|
558
|
+
* letter or a colon. Everything decoded here is re-escaped on output, so the
|
|
559
|
+
* emitted attribute value and the validated value are the same string.
|
|
560
|
+
*/ export function decodeCharacterReferences(value) {
|
|
561
|
+
if (!value.includes('&')) return value;
|
|
562
|
+
return value.replace(/&(?:#([0-9]{1,7})|#[xX]([0-9a-fA-F]{1,6})|([a-zA-Z][a-zA-Z0-9]{1,31}))(;?)/g, (match, dec, hex, name)=>{
|
|
563
|
+
if (dec !== undefined || hex !== undefined) {
|
|
564
|
+
const code = dec !== undefined ? parseInt(dec, 10) : parseInt(hex, 16);
|
|
565
|
+
// Surrogates and out-of-range values have no scalar; dropping them
|
|
566
|
+
// is safer than inventing a replacement a re-parse would disagree
|
|
567
|
+
// with.
|
|
568
|
+
if (!Number.isFinite(code) || code <= 0 || code > 0x10ffff) return '';
|
|
569
|
+
if (code >= 0xd800 && code <= 0xdfff) return '';
|
|
570
|
+
return String.fromCodePoint(code);
|
|
571
|
+
}
|
|
572
|
+
const named = NAMED_REFERENCES[name];
|
|
573
|
+
return named === undefined ? match : named;
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Escapes text content EXACTLY as the HTML serialization algorithm does.
|
|
578
|
+
*
|
|
579
|
+
* The byte-for-byte match is the requirement, not a nicety: React compares
|
|
580
|
+
* the container's `innerHTML` against the `__html` it was given when it
|
|
581
|
+
* hydrates, so a string that merely PARSES the same but SERIALIZES
|
|
582
|
+
* differently is reported as a hydration mismatch. `escapeAuthorHtmlText`
|
|
583
|
+
* and {@link escapeAttributeValue} together are the "serialize" half of the
|
|
584
|
+
* fixed point `author-html-round-trip.spec.ts` asserts.
|
|
585
|
+
*/ function escapeText(text) {
|
|
586
|
+
return text.replace(/&/g, '&').replace(/\u00a0/g, ' ').replace(/</g, '<').replace(/>/g, '>');
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Escapes a decoded attribute value for a double-quoted slot.
|
|
590
|
+
*
|
|
591
|
+
* Deliberately does NOT escape `<` or `>`: the serialization algorithm
|
|
592
|
+
* escapes only `&`, U+00A0 and `"` in an attribute value, and inside a
|
|
593
|
+
* quoted value a raw `<` is literal to the parser, so escaping it would be
|
|
594
|
+
* safe but would not round-trip.
|
|
595
|
+
*
|
|
596
|
+
* That is also why this is NOT `@aglyn/shared-util-tools/escape-html`, which
|
|
597
|
+
* every other string-built HTML surface in the repo now shares. That one
|
|
598
|
+
* escapes the five characters a SAFE escaper needs; this one has to emit
|
|
599
|
+
* exactly the characters a browser's serializer emits and no others. Pointing
|
|
600
|
+
* it at the shared escaper was measured (AGL-2706): the `<` inside a quoted
|
|
601
|
+
* href comes back `<`, and `author-html-round-trip.spec.tsx` fails on the
|
|
602
|
+
* fixed point — the string no longer re-serializes to itself, which is the
|
|
603
|
+
* hydration mismatch this pair exists to prevent. U+00A0 is the same argument
|
|
604
|
+
* in the other direction: the shared escaper leaves it alone, the serializer
|
|
605
|
+
* writes ` `.
|
|
606
|
+
*/ function escapeAttribute(value) {
|
|
607
|
+
return value.replace(/&/g, '&').replace(/\u00a0/g, ' ').replace(/"/g, '"');
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Whether a decoded URL clears the scheme rule for this tag/attribute.
|
|
611
|
+
*
|
|
612
|
+
* The comparison is made on a copy with every C0 control and space removed
|
|
613
|
+
* and folded to lower case, because browsers strip exactly those while
|
|
614
|
+
* resolving a scheme — `"java\tscript:alert(1)"` navigates.
|
|
615
|
+
*
|
|
616
|
+
* Exported because the sanitizer is not the only reader of author markup
|
|
617
|
+
* (AGL-2740). The Markdown representation of a page converts the same stored
|
|
618
|
+
* fragment without sanitizing it, and a scheme rule it re-spelled for itself
|
|
619
|
+
* is a scheme rule that can disagree — which is how `screen:` survived into a
|
|
620
|
+
* link target the page itself refuses to render.
|
|
621
|
+
*/ export function isAllowedAuthorHtmlUrl(tag, attribute, decoded) {
|
|
622
|
+
// eslint-disable-next-line no-control-regex
|
|
623
|
+
const stripped = decoded.replace(/[\u0000-\u0020\u007f]/g, '').toLowerCase();
|
|
624
|
+
if (!stripped) return true;
|
|
625
|
+
const scheme = /^([a-z][a-z0-9+.-]*):/.exec(stripped);
|
|
626
|
+
// No scheme at all: a relative path, a query, or a fragment. Nothing to
|
|
627
|
+
// refuse — it resolves against the site's own origin.
|
|
628
|
+
if (!scheme) return true;
|
|
629
|
+
if (scheme[1] === 'data') {
|
|
630
|
+
if (!DATA_URI_ATTRIBUTES.has(`${tag}:${attribute}`)) return false;
|
|
631
|
+
return DATA_URI_PAYLOAD.test(stripped);
|
|
632
|
+
}
|
|
633
|
+
return ALLOWED_SCHEMES.has(scheme[1]);
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Filters a `srcset`, keeping only candidates whose URL clears the rule.
|
|
637
|
+
*
|
|
638
|
+
* Returns `null` when nothing survives, so the caller drops the attribute
|
|
639
|
+
* rather than emitting an empty one.
|
|
640
|
+
*/ function filterSrcset(tag, attribute, decoded) {
|
|
641
|
+
const kept = decoded.split(',').map((candidate)=>candidate.trim()).filter((candidate)=>{
|
|
642
|
+
var _candidate_split_;
|
|
643
|
+
if (!candidate) return false;
|
|
644
|
+
const url = (_candidate_split_ = candidate.split(/\s+/)[0]) != null ? _candidate_split_ : '';
|
|
645
|
+
return isAllowedAuthorHtmlUrl(tag, attribute, url);
|
|
646
|
+
});
|
|
647
|
+
return kept.length ? kept.join(', ') : null;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* CSS shapes dropped outright rather than filtered.
|
|
651
|
+
*
|
|
652
|
+
* {@link sanitizeAuthorCss} is a `url()` scheme rule and says so; it does not
|
|
653
|
+
* claim to understand these. They are legacy script-in-CSS vectors, dead in
|
|
654
|
+
* current engines, and no author has a use for them — refusing the whole
|
|
655
|
+
* declaration block is both cheaper and more honest than pretending to parse
|
|
656
|
+
* it. This is one of the places this sanitizer keeps LESS than DOMPurify,
|
|
657
|
+
* which filters no CSS at all.
|
|
658
|
+
*/ const REFUSED_CSS = /expression\s*\(|behaviou?r\s*:|-moz-binding|@import|javascript\s*:|vbscript\s*:/i;
|
|
659
|
+
/** Applies the CSS rule to a decoded `style` attribute or `<style>` body. */ function sanitizeStyleValue(css) {
|
|
660
|
+
if (REFUSED_CSS.test(css)) return null;
|
|
661
|
+
const safe = sanitizeAuthorCss(css);
|
|
662
|
+
return safe.trim() ? safe : null;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Reads the attributes of a start tag beginning at `index` (just past the
|
|
666
|
+
* tag name). Returns where the tag ends and whether it self-closed.
|
|
667
|
+
*/ function readAttributes(source, start) {
|
|
668
|
+
const attributes = [];
|
|
669
|
+
let index = start;
|
|
670
|
+
let selfClosing = false;
|
|
671
|
+
while(index < source.length){
|
|
672
|
+
while(index < source.length && /[\s/]/.test(source[index])){
|
|
673
|
+
if (source[index] === '/') selfClosing = true;
|
|
674
|
+
index += 1;
|
|
675
|
+
}
|
|
676
|
+
if (index >= source.length) break;
|
|
677
|
+
if (source[index] === '>') {
|
|
678
|
+
index += 1;
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
selfClosing = false;
|
|
682
|
+
const nameMatch = /^[^\s"'>/=]+/.exec(source.slice(index));
|
|
683
|
+
if (!nameMatch) {
|
|
684
|
+
index += 1;
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
const name = nameMatch[0];
|
|
688
|
+
index += name.length;
|
|
689
|
+
while(index < source.length && /\s/.test(source[index]))index += 1;
|
|
690
|
+
let value = '';
|
|
691
|
+
if (source[index] === '=') {
|
|
692
|
+
index += 1;
|
|
693
|
+
while(index < source.length && /\s/.test(source[index]))index += 1;
|
|
694
|
+
const quote = source[index];
|
|
695
|
+
if (quote === '"' || quote === "'") {
|
|
696
|
+
index += 1;
|
|
697
|
+
const close = source.indexOf(quote, index);
|
|
698
|
+
const stop = close === -1 ? source.length : close;
|
|
699
|
+
value = source.slice(index, stop);
|
|
700
|
+
index = close === -1 ? source.length : close + 1;
|
|
701
|
+
} else {
|
|
702
|
+
const unquoted = /^[^\s>]*/.exec(source.slice(index));
|
|
703
|
+
value = unquoted ? unquoted[0] : '';
|
|
704
|
+
index += value.length;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
attributes.push({
|
|
708
|
+
name,
|
|
709
|
+
value
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
return {
|
|
713
|
+
attributes,
|
|
714
|
+
end: index,
|
|
715
|
+
selfClosing
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Skips a raw-text element's contents, returning the index just past its end
|
|
720
|
+
* tag and the raw body.
|
|
721
|
+
*
|
|
722
|
+
* Raw text is the one place this cannot escape its way to safety: the
|
|
723
|
+
* browser will not decode references or recognize tags inside it, so there
|
|
724
|
+
* is no serialization that makes such a body safe to re-emit. Every element
|
|
725
|
+
* in {@link CONTENT_DROPPING} therefore loses its contents entirely.
|
|
726
|
+
*/ function readRawTextElement(source, tag, contentStart) {
|
|
727
|
+
const closing = new RegExp(`</${tag}[\\s/>]`, 'i');
|
|
728
|
+
const rest = source.slice(contentStart);
|
|
729
|
+
const match = closing.exec(rest);
|
|
730
|
+
if (!match) return {
|
|
731
|
+
body: rest,
|
|
732
|
+
end: source.length
|
|
733
|
+
};
|
|
734
|
+
const body = rest.slice(0, match.index);
|
|
735
|
+
const afterTag = source.indexOf('>', contentStart + match.index);
|
|
736
|
+
return {
|
|
737
|
+
body,
|
|
738
|
+
end: afterTag === -1 ? source.length : afterTag + 1
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Whether `container` would be TORN OPEN by the sanitized body put inside it.
|
|
743
|
+
*
|
|
744
|
+
* The caller renders the body with `dangerouslySetInnerHTML` inside an
|
|
745
|
+
* element of its own choosing, and that element is part of the served
|
|
746
|
+
* document — so the parser's implied end tags apply to it exactly as they do
|
|
747
|
+
* inside the body. A `<p>` holding an `<h2>`, or an `<h2>` holding an
|
|
748
|
+
* `<h2>`, is closed early by the parser, the rest of the body becomes a
|
|
749
|
+
* SIBLING, and React hydrates against a tree it did not describe.
|
|
750
|
+
*
|
|
751
|
+
* Lives here rather than in the caller so the rule and the
|
|
752
|
+
* {@link CLOSES_OPEN_P} table cannot drift apart; `typography.tsx` uses it to
|
|
753
|
+
* fall back to a `<div>`, which no start tag implies an end tag for.
|
|
754
|
+
*
|
|
755
|
+
* Pure, so the server and the client reach the same answer.
|
|
756
|
+
*/ export function authorHtmlBreaksContainer(sanitized, container) {
|
|
757
|
+
var _sanitized_match;
|
|
758
|
+
if (!sanitized) return false;
|
|
759
|
+
const tags = (_sanitized_match = sanitized.match(/<([a-z][a-z0-9]*)[\s/>]/gi)) != null ? _sanitized_match : [];
|
|
760
|
+
const names = tags.map((tag)=>tag.slice(1, -1).toLowerCase());
|
|
761
|
+
if (container === 'p') return names.some((name)=>CLOSES_OPEN_P.has(name));
|
|
762
|
+
if (/^h[1-6]$/.test(container)) {
|
|
763
|
+
return names.some((name)=>/^h[1-6]$/.test(name));
|
|
764
|
+
}
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Sanitizes author-written HTML to a string safe to hand
|
|
769
|
+
* `dangerouslySetInnerHTML`, on the server and in the browser alike.
|
|
770
|
+
*
|
|
771
|
+
* Pure and deterministic: the same input yields the same bytes in Node and
|
|
772
|
+
* in a browser, which is what lets the server render and the first client
|
|
773
|
+
* render agree without an effect (AGL-1901).
|
|
774
|
+
*
|
|
775
|
+
* `removals`, when passed, is APPENDED to with an {@link AuthorHtmlRemoval}
|
|
776
|
+
* for each thing dropped (AGL-2486). It changes nothing about the output —
|
|
777
|
+
* every existing caller is byte-identical whether it passes one or not — so
|
|
778
|
+
* the render path stays exactly as pure as it was and only the editor pays
|
|
779
|
+
* for the bookkeeping.
|
|
780
|
+
*
|
|
781
|
+
* `options.allowedElements` narrows the element allowlist for one call
|
|
782
|
+
* (AGL-2557). The only value it is given in this repo is
|
|
783
|
+
* {@link INLINE_AUTHOR_HTML_ELEMENTS}, by the components that render their
|
|
784
|
+
* label inside a control. A caller may narrow but never widen: a set with a
|
|
785
|
+
* tag the module's own allowlist refuses would reopen the policy, so the two
|
|
786
|
+
* are intersected rather than substituted.
|
|
787
|
+
*/ export function sanitizeAuthorHtml(html, removals, options) {
|
|
788
|
+
const narrowed = options == null ? void 0 : options.allowedElements;
|
|
789
|
+
const allowedElements = narrowed ? new Set(Array.from(narrowed).filter((tag)=>ALLOWED_AUTHOR_HTML_ELEMENTS.has(tag))) : ALLOWED_AUTHOR_HTML_ELEMENTS;
|
|
790
|
+
/** Records one removal, deduped so a repeated tag reads once. */ const note = (kind, message)=>{
|
|
791
|
+
if (!removals) return;
|
|
792
|
+
if (removals.some((entry)=>entry.message === message)) return;
|
|
793
|
+
removals.push({
|
|
794
|
+
kind,
|
|
795
|
+
message
|
|
796
|
+
});
|
|
797
|
+
};
|
|
798
|
+
if (!html) return '';
|
|
799
|
+
const out = [];
|
|
800
|
+
const open = [];
|
|
801
|
+
let index = 0;
|
|
802
|
+
/** Set right after a `<pre>` start tag — see {@link emitText}. */ let justOpenedPre = false;
|
|
803
|
+
/** Emits end tags down to and including `depth`. */ const closeTo = (depth)=>{
|
|
804
|
+
for(let cursor = open.length - 1; cursor >= depth; cursor -= 1){
|
|
805
|
+
out.push(`</${open[cursor]}>`);
|
|
806
|
+
}
|
|
807
|
+
open.length = depth;
|
|
808
|
+
};
|
|
809
|
+
/** Closes the nearest open `tag`, if one is open. */ const closeNearest = (tag)=>{
|
|
810
|
+
const at = open.lastIndexOf(tag);
|
|
811
|
+
if (at !== -1) closeTo(at);
|
|
812
|
+
};
|
|
813
|
+
/**
|
|
814
|
+
* The end tags the PARSER would imply before this start tag, emitted so the
|
|
815
|
+
* string we write is the string a document parse will hold — see
|
|
816
|
+
* {@link CLOSES_OPEN_P}.
|
|
817
|
+
*/ const applyImpliedEndTags = (tag)=>{
|
|
818
|
+
if (CLOSES_OPEN_P.has(tag)) closeNearest('p');
|
|
819
|
+
// A heading start tag closes an open heading — h2 inside h2 is not
|
|
820
|
+
// nesting to the parser, it is a sibling.
|
|
821
|
+
if (/^h[1-6]$/.test(tag)) {
|
|
822
|
+
const at = [
|
|
823
|
+
'h1',
|
|
824
|
+
'h2',
|
|
825
|
+
'h3',
|
|
826
|
+
'h4',
|
|
827
|
+
'h5',
|
|
828
|
+
'h6'
|
|
829
|
+
].map((heading)=>open.lastIndexOf(heading)).reduce((best, found)=>Math.max(best, found), -1);
|
|
830
|
+
if (at !== -1) closeTo(at);
|
|
831
|
+
}
|
|
832
|
+
if (tag === 'li') closeNearest('li');
|
|
833
|
+
if (tag === 'dd' || tag === 'dt') {
|
|
834
|
+
const at = Math.max(open.lastIndexOf('dd'), open.lastIndexOf('dt'));
|
|
835
|
+
if (at !== -1) closeTo(at);
|
|
836
|
+
}
|
|
837
|
+
// A nested anchor is not nesting — the parser closes the outer one.
|
|
838
|
+
if (tag === 'a') closeNearest('a');
|
|
839
|
+
if (tag === 'td' || tag === 'th') {
|
|
840
|
+
const at = Math.max(open.lastIndexOf('td'), open.lastIndexOf('th'));
|
|
841
|
+
if (at !== -1) closeTo(at);
|
|
842
|
+
}
|
|
843
|
+
if (tag === 'tr') closeNearest('tr');
|
|
844
|
+
if (tag === 'thead' || tag === 'tbody' || tag === 'tfoot') {
|
|
845
|
+
closeNearest('tr');
|
|
846
|
+
for (const section of [
|
|
847
|
+
'thead',
|
|
848
|
+
'tbody',
|
|
849
|
+
'tfoot'
|
|
850
|
+
])closeNearest(section);
|
|
851
|
+
}
|
|
852
|
+
if (tag === 'table') closeNearest('table');
|
|
853
|
+
};
|
|
854
|
+
/** Whether the insertion point is directly inside a table's structure. */ const inTableContext = ()=>open.length > 0 && TABLE_CONTEXTS.has(open[open.length - 1]);
|
|
855
|
+
/**
|
|
856
|
+
* Emits the `<tbody>` and `<tr>` the parser would have INSERTED.
|
|
857
|
+
*
|
|
858
|
+
* `<table><tr>` is held by every browser as `<table><tbody><tr>`, and a
|
|
859
|
+
* `<td>` with no row around it gets both. Writing them out is the same
|
|
860
|
+
* fixed-point rule as the implied end tags: whatever the parser will add,
|
|
861
|
+
* this has to have said already, or the served string and the hydrated DOM
|
|
862
|
+
* are different documents.
|
|
863
|
+
*/ const openImpliedTableParents = (tag)=>{
|
|
864
|
+
const parent = ()=>open[open.length - 1];
|
|
865
|
+
if (tag === 'tr' && parent() === 'table') {
|
|
866
|
+
out.push('<tbody>');
|
|
867
|
+
open.push('tbody');
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
if (tag === 'td' || tag === 'th') {
|
|
871
|
+
if (parent() === 'table') {
|
|
872
|
+
out.push('<tbody>');
|
|
873
|
+
open.push('tbody');
|
|
874
|
+
}
|
|
875
|
+
if (parent() === 'thead' || parent() === 'tbody' || parent() === 'tfoot') {
|
|
876
|
+
out.push('<tr>');
|
|
877
|
+
open.push('tr');
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
const emitStart = (tag, attributes)=>{
|
|
882
|
+
const perElement = AUTHOR_HTML_ELEMENT_ATTRIBUTES[tag];
|
|
883
|
+
const parts = [
|
|
884
|
+
tag
|
|
885
|
+
];
|
|
886
|
+
for (const attribute of attributes){
|
|
887
|
+
const name = attribute.name.toLowerCase();
|
|
888
|
+
// Event handlers, `data-*` (ALLOW_DATA_ATTR: false on both callers),
|
|
889
|
+
// namespaced names, and the two shapes both configs forbade by name.
|
|
890
|
+
if (!/^[a-z][a-z0-9-]*$/.test(name)) continue;
|
|
891
|
+
if (name.startsWith('on')) {
|
|
892
|
+
note('attribute', `${name}="…" is removed — a published page cannot run author JavaScript from an event handler.`);
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (name.startsWith('data-')) continue;
|
|
896
|
+
if (name === 'srcdoc' || name === 'formaction' || name === 'is') continue;
|
|
897
|
+
if (!GLOBAL_AUTHOR_HTML_ATTRIBUTES.has(name) && !(perElement == null ? void 0 : perElement.has(name))) continue;
|
|
898
|
+
let value = decodeCharacterReferences(attribute.value);
|
|
899
|
+
if (name === 'style') {
|
|
900
|
+
const safe = sanitizeStyleValue(value);
|
|
901
|
+
if (safe === null) {
|
|
902
|
+
note('style', `the style attribute on <${tag}> is removed — inline CSS cannot use @import, expression(), behavior:, -moz-binding or javascript:.`);
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
// Identity return means nothing was refused; anything else means a
|
|
906
|
+
// `url()` was neutered, which is invisible on the page (the image
|
|
907
|
+
// simply never appears) and therefore the case most worth naming.
|
|
908
|
+
if (safe !== value) {
|
|
909
|
+
note('url', `a url() in the style attribute on <${tag}> will not load — inline CSS may only fetch over https:, data: or blob:.`);
|
|
910
|
+
}
|
|
911
|
+
value = safe;
|
|
912
|
+
} else if (URL_LIST_ATTRIBUTES.has(name)) {
|
|
913
|
+
const safe = filterSrcset(tag, name, value);
|
|
914
|
+
if (safe === null) {
|
|
915
|
+
note('url', `${name} on <${tag}> is removed — only https:, data: and blob: URLs are allowed.`);
|
|
916
|
+
continue;
|
|
917
|
+
}
|
|
918
|
+
value = safe;
|
|
919
|
+
} else if (URL_ATTRIBUTES.has(name)) {
|
|
920
|
+
if (!isAllowedAuthorHtmlUrl(tag, name, value)) {
|
|
921
|
+
note('url', `${name} on <${tag}> is removed — only https:, data: and blob: URLs are allowed.`);
|
|
922
|
+
continue;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
parts.push(`${name}="${escapeAttribute(value)}"`);
|
|
926
|
+
}
|
|
927
|
+
out.push(`<${parts.join(' ')}>`);
|
|
928
|
+
};
|
|
929
|
+
/**
|
|
930
|
+
* Text between a table's own elements is foster-parented OUT of the table
|
|
931
|
+
* by the parser, which is a move this serializer cannot express — so it is
|
|
932
|
+
* dropped and the emitted string round-trips.
|
|
933
|
+
*/ const emitText = (text)=>{
|
|
934
|
+
if (!text || inTableContext()) return;
|
|
935
|
+
let value = text;
|
|
936
|
+
// The parser drops ONE U+000A immediately after a `<pre>` start tag. The
|
|
937
|
+
// serializer is supposed to put one back when the text still begins with
|
|
938
|
+
// one, but that half is not implemented everywhere (jsdom does not), so
|
|
939
|
+
// the ONLY string that survives both a browser and a test DOM unchanged
|
|
940
|
+
// is one with no leading newline at all. Emitting that costs an author a
|
|
941
|
+
// blank first line inside a `<pre>` and buys a fixed point.
|
|
942
|
+
if (justOpenedPre && open[open.length - 1] === 'pre') {
|
|
943
|
+
value = value.replace(/^\n+/, '');
|
|
944
|
+
}
|
|
945
|
+
justOpenedPre = false;
|
|
946
|
+
if (!value) return;
|
|
947
|
+
out.push(escapeText(value));
|
|
948
|
+
};
|
|
949
|
+
while(index < html.length){
|
|
950
|
+
const next = html.indexOf('<', index);
|
|
951
|
+
if (next === -1) {
|
|
952
|
+
emitText(html.slice(index));
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
if (next > index) emitText(html.slice(index, next));
|
|
956
|
+
const rest = html.slice(next);
|
|
957
|
+
// Comments, doctypes and processing instructions: no content of ours.
|
|
958
|
+
if (rest.startsWith('<!--')) {
|
|
959
|
+
const close = html.indexOf('-->', next + 4);
|
|
960
|
+
index = close === -1 ? html.length : close + 3;
|
|
961
|
+
continue;
|
|
962
|
+
}
|
|
963
|
+
if (rest.startsWith('<!') || rest.startsWith('<?')) {
|
|
964
|
+
const close = html.indexOf('>', next);
|
|
965
|
+
index = close === -1 ? html.length : close + 1;
|
|
966
|
+
continue;
|
|
967
|
+
}
|
|
968
|
+
const endTag = /^<\/([a-zA-Z][a-zA-Z0-9]*)/.exec(rest);
|
|
969
|
+
if (endTag) {
|
|
970
|
+
const tag = endTag[1].toLowerCase();
|
|
971
|
+
const close = html.indexOf('>', next);
|
|
972
|
+
index = close === -1 ? html.length : close + 1;
|
|
973
|
+
const at = open.lastIndexOf(tag);
|
|
974
|
+
// A stray end tag closes nothing — the browser ignores it too.
|
|
975
|
+
if (at === -1) continue;
|
|
976
|
+
closeTo(at);
|
|
977
|
+
continue;
|
|
978
|
+
}
|
|
979
|
+
const startTag = /^<([a-zA-Z][a-zA-Z0-9]*)/.exec(rest);
|
|
980
|
+
if (!startTag) {
|
|
981
|
+
// A `<` that begins no tag is literal text, exactly as the parser
|
|
982
|
+
// treats it.
|
|
983
|
+
emitText('<');
|
|
984
|
+
index = next + 1;
|
|
985
|
+
continue;
|
|
986
|
+
}
|
|
987
|
+
const tag = startTag[1].toLowerCase();
|
|
988
|
+
const { attributes, end, selfClosing } = readAttributes(html, next + startTag[0].length);
|
|
989
|
+
if (CONTENT_DROPPING.has(tag)) {
|
|
990
|
+
note('element', `<${tag}> and everything inside it is removed — this element is not allowed in author HTML.`);
|
|
991
|
+
const { end: bodyEnd } = readRawTextElement(html, tag, end);
|
|
992
|
+
index = bodyEnd;
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
index = end;
|
|
996
|
+
if (!allowedElements.has(tag)) {
|
|
997
|
+
// Unwrapped, not dropped — matches DOMPurify's `KEEP_CONTENT` default,
|
|
998
|
+
// so a `<form>` or an unknown tag loses the element and keeps the words
|
|
999
|
+
// inside it.
|
|
1000
|
+
note('element', `<${tag}> is removed — the text inside it is kept, but the element itself is not allowed in author HTML.`);
|
|
1001
|
+
continue;
|
|
1002
|
+
}
|
|
1003
|
+
// Context rules, both of them about reparenting rather than about safety.
|
|
1004
|
+
// A non-table element written directly inside a table is foster-parented
|
|
1005
|
+
// out of it; a table part written outside a table has its tag dropped and
|
|
1006
|
+
// its contents kept. Following the parser here is what keeps the emitted
|
|
1007
|
+
// string a fixed point of it.
|
|
1008
|
+
if (inTableContext() && !TABLE_PARTS.has(tag)) {
|
|
1009
|
+
const { end: bodyEnd } = readRawTextElement(html, tag, end);
|
|
1010
|
+
index = bodyEnd;
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
if (TABLE_PARTS.has(tag) && !open.includes('table')) continue;
|
|
1014
|
+
applyImpliedEndTags(tag);
|
|
1015
|
+
// `caption`, `colgroup` and `col` are only accepted in one place each;
|
|
1016
|
+
// written anywhere else the parser moves or drops them, so this does the
|
|
1017
|
+
// dropping and keeps the string stable.
|
|
1018
|
+
const parentTag = open[open.length - 1];
|
|
1019
|
+
if ((tag === 'caption' || tag === 'colgroup') && parentTag !== 'table') {
|
|
1020
|
+
continue;
|
|
1021
|
+
}
|
|
1022
|
+
if (tag === 'col' && parentTag !== 'colgroup') continue;
|
|
1023
|
+
openImpliedTableParents(tag);
|
|
1024
|
+
if (VOID_ELEMENTS.has(tag)) {
|
|
1025
|
+
emitStart(tag, attributes);
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
emitStart(tag, attributes);
|
|
1029
|
+
justOpenedPre = tag === 'pre';
|
|
1030
|
+
if (!selfClosing) open.push(tag);
|
|
1031
|
+
else out.push(`</${tag}>`);
|
|
1032
|
+
}
|
|
1033
|
+
closeTo(0);
|
|
1034
|
+
return out.join('');
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
//# sourceMappingURL=author-html.js.map
|