@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,1366 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2026 Aglyn LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/ // By path: the naming rule alone, without the icon catalog's loader beside it.
|
|
19
|
+
import { iconPathPropName } from "@aglyn/shared-data-mdi/utils/icon-path-prop-name";
|
|
20
|
+
import { reusablePropValueClass } from "../foundation/definitions/property-kinds.js";
|
|
21
|
+
import { COMPONENT_NODE_ID_PREFIX, COMPONENT_PROP_TOKEN_PREFIX, INSTANCE_CARRIED_NODE_FIELDS, INSTANCE_CARRIED_PROPS, NODE_HIDE_IF_PROP, NODE_HIDE_UNLESS_PROP, REUSABLE_INSTANCE_COMPONENT_ID, REUSABLE_INSTANCE_PROP_VALUES_KEY, STYLE_OVERRIDES_ROOT_KEY } from "./reusable-component-keys.js";
|
|
22
|
+
import { REPEAT_DIRECTIVE_PROPS, REPEAT_SELF_PROP, repeatKey, withoutRepeatDirective } from "./expand-repeatables.js";
|
|
23
|
+
import { mergeNodeSx } from "./merge-node-sx.js";
|
|
24
|
+
import { hasUrlScheme, isSafeNodeUrl, NODE_URL_PROPS } from "./node-url-policy.js";
|
|
25
|
+
import { readInstanceIconValue, readYesNoValue, resolveReusablePropValues } from "./reusable-prop-values.js";
|
|
26
|
+
import { resolveNamedTokens } from "./resolve-named-tokens.js";
|
|
27
|
+
export * from "./reusable-component-keys.js";
|
|
28
|
+
export * from "./reusable-prop-values.js";
|
|
29
|
+
const isStyleRecord = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value) && Object.keys(value).length > 0;
|
|
30
|
+
/**
|
|
31
|
+
* Space-separated class lists joined in order, each name once, or `undefined`
|
|
32
|
+
* when no list holds a name. A value that is not a string contributes nothing.
|
|
33
|
+
*/ function joinClassNames(...lists) {
|
|
34
|
+
const names = lists.filter((list)=>typeof list === 'string').flatMap((list)=>list.split(/\s+/)).filter(Boolean);
|
|
35
|
+
return names.length ? [
|
|
36
|
+
...new Set(names)
|
|
37
|
+
].join(' ') : undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Every per-instance style override an instance node carries, keyed the way
|
|
41
|
+
* it is stored (AGL-1332): {@link STYLE_OVERRIDES_ROOT_KEY} for the
|
|
42
|
+
* component root, and a DEFINITION-internal node id for each overridden
|
|
43
|
+
* leaf. Empty for a node that is not an instance or carries none.
|
|
44
|
+
*
|
|
45
|
+
* Keyed on the definition's own id, never the grafted `cmp__…` id: the
|
|
46
|
+
* graft id is DERIVED from the instance id, so keying on it would break the
|
|
47
|
+
* moment a subtree was duplicated or an instance re-keyed, and two
|
|
48
|
+
* instances of one component could not share the same authoring vocabulary.
|
|
49
|
+
* Entries that are not a non-empty plain object are dropped here rather
|
|
50
|
+
* than at each call site — a `null`, a string, or a cleared `{}` must read
|
|
51
|
+
* as "no override" identically in the graft, in detach and in the panel.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately here rather than in a render surface: this file owns what
|
|
54
|
+
* an instance node looks like, and the graft below is the ONE place the
|
|
55
|
+
* overrides are applied — canvas, Preview and tenant SSR all call
|
|
56
|
+
* {@link composeReusableComponentNodes}, so they cannot disagree about
|
|
57
|
+
* what an override means.
|
|
58
|
+
*/ export function getInstanceStyleOverrides(node) {
|
|
59
|
+
if ((node == null ? void 0 : node.componentId) !== REUSABLE_INSTANCE_COMPONENT_ID) return {};
|
|
60
|
+
const overrides = node == null ? void 0 : node.styleOverrides;
|
|
61
|
+
if (!isStyleRecord(overrides)) return {};
|
|
62
|
+
const clean = {};
|
|
63
|
+
for (const [key, value] of Object.entries(overrides)){
|
|
64
|
+
if (key && isStyleRecord(value)) clean[key] = value;
|
|
65
|
+
}
|
|
66
|
+
return clean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The sx-shaped ROOT style override carried by an instance node, or
|
|
70
|
+
* `undefined` when the node is not an instance or carries none — the
|
|
71
|
+
* AGL-1306 half of {@link getInstanceStyleOverrides}.
|
|
72
|
+
*/ export function getInstanceRootStyleOverride(node) {
|
|
73
|
+
return getInstanceStyleOverrides(node)[STYLE_OVERRIDES_ROOT_KEY];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The `{ sx }` patch one definition node takes from an instance's
|
|
77
|
+
* overrides, or `undefined` when none applies (AGL-1332).
|
|
78
|
+
*
|
|
79
|
+
* Two layers, coarse first: the root slice when this node IS the
|
|
80
|
+
* definition root, then the node's own definition-id slice. Both go
|
|
81
|
+
* through `mergeNodeSx`, so a per-leaf override gets exactly the cascade
|
|
82
|
+
* semantics the root one already had — a `{ md: … }` slice keeps the
|
|
83
|
+
* base's narrower widths, an `@scheme dark` slice merges key-by-key, and
|
|
84
|
+
* a plain property replaces only the leaf it names.
|
|
85
|
+
*
|
|
86
|
+
* A key naming a node the definition no longer has is simply never
|
|
87
|
+
* consulted: this runs per definition node, so a component edited after
|
|
88
|
+
* the override was written degrades to the component's own styling rather
|
|
89
|
+
* than throwing on a page nobody has opened since.
|
|
90
|
+
*
|
|
91
|
+
* Returned as a patch object rather than a value so the caller can spread
|
|
92
|
+
* nothing at all — writing `sx: undefined` onto a node that never had one
|
|
93
|
+
* would materialize the key on every grafted leaf.
|
|
94
|
+
*/ function instanceSxPatch(baseSx, overrides, defId, rootId) {
|
|
95
|
+
// The root is addressed by the constant, so a definition node whose id
|
|
96
|
+
// merely happens to BE `root` without being the root gets nothing from
|
|
97
|
+
// the root slice — the alternative is styling an arbitrary leaf from the
|
|
98
|
+
// panel's root target.
|
|
99
|
+
const rootSlice = defId === rootId ? overrides[STYLE_OVERRIDES_ROOT_KEY] : undefined;
|
|
100
|
+
const leafSlice = defId === STYLE_OVERRIDES_ROOT_KEY ? undefined : overrides[defId];
|
|
101
|
+
if (!rootSlice && !leafSlice) return undefined;
|
|
102
|
+
let sx = baseSx;
|
|
103
|
+
if (rootSlice) sx = mergeNodeSx(sx, rootSlice);
|
|
104
|
+
if (leafSlice) sx = mergeNodeSx(sx, leafSlice);
|
|
105
|
+
return {
|
|
106
|
+
sx
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Props on a grafted definition node that an instance override must never
|
|
111
|
+
* address (AGL-1899).
|
|
112
|
+
*
|
|
113
|
+
* `sx` has its own override layer one field up, and honouring it here would
|
|
114
|
+
* leave two writers racing for one rendered value with no rule to say which
|
|
115
|
+
* wins — the Styles panel would show an instance as clean while the
|
|
116
|
+
* Attributes panel silently repainted it.
|
|
117
|
+
*/ const ATTR_OVERRIDE_REFUSED_PROPS = new Set([
|
|
118
|
+
'sx'
|
|
119
|
+
]);
|
|
120
|
+
/**
|
|
121
|
+
* Every per-instance ATTRIBUTE override an instance node carries, keyed the
|
|
122
|
+
* way {@link getInstanceStyleOverrides} keys styles — `root` for the
|
|
123
|
+
* definition root, a definition-internal node id for anything else
|
|
124
|
+
* (AGL-1899).
|
|
125
|
+
*
|
|
126
|
+
* Refused props are dropped HERE rather than at the write site, so a slice
|
|
127
|
+
* that reached storage before a refusal existed (or by any path that did not
|
|
128
|
+
* go through the panel) still cannot take effect.
|
|
129
|
+
*/ export function getInstanceAttrOverrides(node) {
|
|
130
|
+
if ((node == null ? void 0 : node.componentId) !== REUSABLE_INSTANCE_COMPONENT_ID) return {};
|
|
131
|
+
const overrides = node == null ? void 0 : node.attrOverrides;
|
|
132
|
+
if (!isStyleRecord(overrides)) return {};
|
|
133
|
+
const clean = {};
|
|
134
|
+
for (const [key, value] of Object.entries(overrides)){
|
|
135
|
+
if (!key || !isStyleRecord(value)) continue;
|
|
136
|
+
const slice = {};
|
|
137
|
+
for (const [prop, propValue] of Object.entries(value)){
|
|
138
|
+
if (ATTR_OVERRIDE_REFUSED_PROPS.has(prop)) continue;
|
|
139
|
+
slice[prop] = propValue;
|
|
140
|
+
}
|
|
141
|
+
if (Object.keys(slice).length > 0) clean[key] = slice;
|
|
142
|
+
}
|
|
143
|
+
return clean;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The `{ props }` patch one definition node takes from an instance's
|
|
147
|
+
* attribute overrides, or `undefined` when none applies (AGL-1899).
|
|
148
|
+
*
|
|
149
|
+
* Layered coarse-first exactly like {@link instanceSxPatch} — the root slice
|
|
150
|
+
* when this node IS the definition root, then the node's own id slice — so
|
|
151
|
+
* the two override kinds stay one authoring model rather than two.
|
|
152
|
+
*
|
|
153
|
+
* The merge is one level deep, replacing only the props each slice NAMES.
|
|
154
|
+
* That keeps a component free to add a prop later and still have every
|
|
155
|
+
* existing instance pick up the new default, and it is deliberately not the
|
|
156
|
+
* cascade `mergeNodeSx` performs: an sx object's nested records are
|
|
157
|
+
* selectors (`@scheme dark`, breakpoints) that genuinely compose, while a
|
|
158
|
+
* prop value is one value. Deep-merging two prop objects that merely look
|
|
159
|
+
* alike would hand the renderer a third thing neither the component nor the
|
|
160
|
+
* page asked for.
|
|
161
|
+
*/ function instancePropsPatch(baseProps, overrides, defId, rootId) {
|
|
162
|
+
const rootSlice = defId === rootId ? overrides[STYLE_OVERRIDES_ROOT_KEY] : undefined;
|
|
163
|
+
const leafSlice = defId === STYLE_OVERRIDES_ROOT_KEY ? undefined : overrides[defId];
|
|
164
|
+
if (!rootSlice && !leafSlice) return undefined;
|
|
165
|
+
return {
|
|
166
|
+
props: _extends({}, baseProps != null ? baseProps : {}, rootSlice != null ? rootSlice : {}, leafSlice != null ? leafSlice : {})
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The styleable targets inside one component definition, in tree order
|
|
171
|
+
* (root first, then depth-first through each node's `nodes`) — what the
|
|
172
|
+
* Styles panel offers when a component instance is selected (AGL-1332).
|
|
173
|
+
*
|
|
174
|
+
* Beside the graft on purpose: the panel must write the SAME keys the
|
|
175
|
+
* graft reads, and a second walker that disagreed would offer authors
|
|
176
|
+
* targets no renderer consults. Cycle-safe and unreachable-safe: a node
|
|
177
|
+
* the root cannot reach is not offered, because the graft would never
|
|
178
|
+
* render it either.
|
|
179
|
+
*/ export function listInstanceStyleTargets(definition) {
|
|
180
|
+
const rootId = definition == null ? void 0 : definition.rootId;
|
|
181
|
+
const nodes = definition == null ? void 0 : definition.nodes;
|
|
182
|
+
if (!rootId || !(nodes == null ? void 0 : nodes[rootId])) return [];
|
|
183
|
+
const targets = [];
|
|
184
|
+
const seen = new Set();
|
|
185
|
+
const walk = (id, depth)=>{
|
|
186
|
+
const node = nodes[id];
|
|
187
|
+
// `seen` is what bounds the walk: a definition that referenced an
|
|
188
|
+
// ancestor would otherwise recurse until the stack gave out.
|
|
189
|
+
if (!node || seen.has(id)) return;
|
|
190
|
+
seen.add(id);
|
|
191
|
+
const isRoot = id === rootId;
|
|
192
|
+
targets.push({
|
|
193
|
+
key: isRoot ? STYLE_OVERRIDES_ROOT_KEY : id,
|
|
194
|
+
componentInternalId: id,
|
|
195
|
+
depth,
|
|
196
|
+
componentId: node.componentId,
|
|
197
|
+
name: node.name,
|
|
198
|
+
isRoot
|
|
199
|
+
});
|
|
200
|
+
const children = node.nodes;
|
|
201
|
+
if (!Array.isArray(children)) return;
|
|
202
|
+
for (const childId of children){
|
|
203
|
+
if (typeof childId === 'string') walk(childId, depth + 1);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
walk(rootId, 0);
|
|
207
|
+
return targets;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Definitions may nest instances of other definitions; expansion runs in
|
|
211
|
+
* passes capped here so a self-referencing definition can't recurse forever.
|
|
212
|
+
*/ const MAX_COMPONENT_DEPTH = 5;
|
|
213
|
+
function instancePrefix(instanceId) {
|
|
214
|
+
return `${COMPONENT_NODE_ID_PREFIX}${instanceId}__`;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The declared-prop name a stored value references when it is EXACTLY one
|
|
218
|
+
* `{{prop.<name>}}` token (whitespace inside the braces tolerated, matching
|
|
219
|
+
* `resolveNamedTokens`' grammar), else `null`.
|
|
220
|
+
*
|
|
221
|
+
* Exact-match on purpose: a value that merely CONTAINS a token
|
|
222
|
+
* (`"Hi {{prop.name}}!"`) is only partially prop-fed, so an inline edit of
|
|
223
|
+
* the rendered text could not be decomposed back into a prop value — those
|
|
224
|
+
* leaves stay component-owned (AGL-1304).
|
|
225
|
+
*/ export function matchComponentPropToken(value) {
|
|
226
|
+
if (typeof value !== 'string') return null;
|
|
227
|
+
const match = /^\s*\{\{\s*prop\.([A-Za-z_][A-Za-z0-9_]*)\s*\}\}\s*$/.exec(value);
|
|
228
|
+
return match ? match[1] : null;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Maps a grafted node id back to its component-internal source and the
|
|
232
|
+
* declared prop (if any) feeding one of its content props (AGL-1304).
|
|
233
|
+
*
|
|
234
|
+
* The graft's provenance is its id scheme — `cmp__{instanceId}__{defId}`
|
|
235
|
+
* (see {@link composeReusableComponentNodes}) — and this is the ONE reader
|
|
236
|
+
* of that scheme, deliberately beside the writer: the canvas double-click
|
|
237
|
+
* hit-test uses it today, and AGL-1306 phase 2 (inner-node style overrides)
|
|
238
|
+
* and AGL-1303 phase 3 (in-place focus mode) need the same inverse mapping.
|
|
239
|
+
*
|
|
240
|
+
* Returns `null` when the id was not grafted from THIS instance, or when
|
|
241
|
+
* the internal id is unknown to the definition — which includes leaves of a
|
|
242
|
+
* NESTED instance's graft (prefixes stack per pass), whose props are fed by
|
|
243
|
+
* the outer definition's own instance node, not by this one.
|
|
244
|
+
*
|
|
245
|
+
* `boundProp` is non-null only when the definition node's `contentProp`
|
|
246
|
+
* (default `children`; pass `src` for image leaves) is exactly one
|
|
247
|
+
* `{{prop.*}}` token naming a DECLARED prop — an undeclared token never
|
|
248
|
+
* substitutes, so an override written for it would silently do nothing.
|
|
249
|
+
*
|
|
250
|
+
* Pure: no canvas, no DOM, inputs never mutated.
|
|
251
|
+
*/ export function resolveInstanceLeafBinding(graftedId, instanceId, definition, contentProp = 'children', rootId) {
|
|
252
|
+
var _ref;
|
|
253
|
+
var _definition_nodes, _defNode_props;
|
|
254
|
+
if (!graftedId || !instanceId) return null;
|
|
255
|
+
const prefix = instancePrefix(instanceId);
|
|
256
|
+
// The definition's ROOT carries the instance's own id, not a prefixed one
|
|
257
|
+
// — the two are one element (AGL-2521). Without this the root is the one
|
|
258
|
+
// leaf the double-click cannot reach, so a component whose root IS its text
|
|
259
|
+
// stops being inline-editable through its placements.
|
|
260
|
+
if (graftedId === instanceId) {
|
|
261
|
+
var _ref1;
|
|
262
|
+
const rootInternalId = rootId != null ? rootId : Object.keys((_ref1 = definition == null ? void 0 : definition.nodes) != null ? _ref1 : {}).find((id)=>{
|
|
263
|
+
var _definition_nodes_id, _definition_nodes;
|
|
264
|
+
return !(definition == null ? void 0 : (_definition_nodes = definition.nodes) == null ? void 0 : (_definition_nodes_id = _definition_nodes[id]) == null ? void 0 : _definition_nodes_id.parentId);
|
|
265
|
+
});
|
|
266
|
+
if (!rootInternalId) return null;
|
|
267
|
+
return resolveInstanceLeafBinding(`${prefix}${rootInternalId}`, instanceId, definition, contentProp);
|
|
268
|
+
}
|
|
269
|
+
if (!graftedId.startsWith(prefix)) return null;
|
|
270
|
+
const componentInternalId = graftedId.slice(prefix.length);
|
|
271
|
+
if (!componentInternalId) return null;
|
|
272
|
+
const defNode = definition == null ? void 0 : (_definition_nodes = definition.nodes) == null ? void 0 : _definition_nodes[componentInternalId];
|
|
273
|
+
if (!defNode) return null;
|
|
274
|
+
const raw = (_defNode_props = defNode.props) == null ? void 0 : _defNode_props[contentProp];
|
|
275
|
+
const name = matchComponentPropToken(raw);
|
|
276
|
+
const declared = name != null && ((_ref = definition == null ? void 0 : definition.props) != null ? _ref : []).some((prop)=>(prop == null ? void 0 : prop.name) === name);
|
|
277
|
+
return {
|
|
278
|
+
componentInternalId,
|
|
279
|
+
boundProp: declared ? name : null
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/** An instance's own values, keyed by declared prop name (AGL-1247). */ function instancePropValues(instanceProps) {
|
|
283
|
+
const values = instanceProps == null ? void 0 : instanceProps[REUSABLE_INSTANCE_PROP_VALUES_KEY];
|
|
284
|
+
return values && typeof values === 'object' && !Array.isArray(values) ? values : undefined;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The text an instance currently renders for a declared prop: its override
|
|
288
|
+
* when set, else the prop's `defaultValue`, else `''`. `''` counts as unset,
|
|
289
|
+
* as it does in the graft — clearing an override restores the component's own
|
|
290
|
+
* copy, so the inline editor and the graft agree about what the author is
|
|
291
|
+
* looking at.
|
|
292
|
+
*/ export function getInstanceEffectivePropText(instanceProps, declared, propName) {
|
|
293
|
+
var _resolveReusablePropValues_tokens_;
|
|
294
|
+
return (_resolveReusablePropValues_tokens_ = resolveReusablePropValues(declared, instancePropValues(instanceProps)).tokens[`${COMPONENT_PROP_TOKEN_PREFIX}${propName}`]) != null ? _resolveReusablePropValues_tokens_ : '';
|
|
295
|
+
}
|
|
296
|
+
/** A value a field bound to a property has nothing to receive from. */ function isNothingToGive(value) {
|
|
297
|
+
return value === undefined || value === null || value === '' || Array.isArray(value) && value.length === 0 || matchComponentPropToken(value) != null;
|
|
298
|
+
}
|
|
299
|
+
/** A copy a field can own: a list is copied, so no two fields share one. */ function ownValue(value) {
|
|
300
|
+
return Array.isArray(value) ? [
|
|
301
|
+
...value
|
|
302
|
+
] : value;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* What a field bound to exactly one property token receives, by the value
|
|
306
|
+
* class of that property — or `undefined` to remove the prop.
|
|
307
|
+
*
|
|
308
|
+
* `known` is the property's value when the caller resolved one, and
|
|
309
|
+
* `substituted` the text its token became; a caller that resolved nothing
|
|
310
|
+
* (a component editor drawing raw tokens) is read from the text alone.
|
|
311
|
+
*/ function typedBindingValue(valueClass, known, substituted) {
|
|
312
|
+
const value = known ? known.value : substituted;
|
|
313
|
+
switch(valueClass){
|
|
314
|
+
case 'boolean':
|
|
315
|
+
return readYesNoValue(value) === true;
|
|
316
|
+
case 'number':
|
|
317
|
+
{
|
|
318
|
+
if (isNothingToGive(value)) return undefined;
|
|
319
|
+
if (typeof value === 'number') return value;
|
|
320
|
+
const numeric = Number(value);
|
|
321
|
+
return Number.isFinite(numeric) ? numeric : substituted;
|
|
322
|
+
}
|
|
323
|
+
case 'icon':
|
|
324
|
+
var _ref;
|
|
325
|
+
var _readInstanceIconValue;
|
|
326
|
+
return isNothingToGive(value) ? undefined : (_ref = (_readInstanceIconValue = readInstanceIconValue(value)) == null ? void 0 : _readInstanceIconValue.iconId) != null ? _ref : undefined;
|
|
327
|
+
default:
|
|
328
|
+
return isNothingToGive(value) ? undefined : ownValue(value);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* The declared-prop substitution for a set of nodes, with each binding handed
|
|
333
|
+
* to the element as the value its property's kind holds (AGL-2871, AGL-2893).
|
|
334
|
+
*
|
|
335
|
+
* The substitution itself is textual — every token becomes text and
|
|
336
|
+
* `resolveNamedTokens` splices it into string props. That is right for copy
|
|
337
|
+
* and wrong for the fields that do not hold copy. So a prop whose stored value
|
|
338
|
+
* is EXACTLY one token naming a declared prop is finished by that prop's value
|
|
339
|
+
* class (`reusablePropValueClass`):
|
|
340
|
+
*
|
|
341
|
+
* - `boolean` (Yes / no, a single Checkbox) — a real `true` or `false`, read
|
|
342
|
+
* through {@link readYesNoValue}, because an element reading `lightbox`
|
|
343
|
+
* takes the string `'false'` for a yes. Nothing to read is a no.
|
|
344
|
+
* - `number` (Number, Slider) — a real number when the value is one, because an
|
|
345
|
+
* element passing `size` to MUI turns `'32'` into `font-size: 32`, which no
|
|
346
|
+
* browser applies. Nothing set is removed; text that is not a number is left
|
|
347
|
+
* as it was authored.
|
|
348
|
+
* - `icon` — the picked icon's id, with its path written into the field's
|
|
349
|
+
* companion (`iconId` → `iconPath`, the rule `iconPathPropName` states)
|
|
350
|
+
* from `iconPaths`. The path is what a published page draws, since it never
|
|
351
|
+
* loads the icon catalog; and it is written or removed on every pass,
|
|
352
|
+
* because a path left over from the component's own icon would be drawn in
|
|
353
|
+
* place of the page's. Nothing picked removes both.
|
|
354
|
+
* - `value` (every other kind: a Choice, a Color, a Size, a Date, a list of
|
|
355
|
+
* answers, an entity) — the value exactly as the property holds it, from
|
|
356
|
+
* `values`, so a list stays a list and a theme multiple stays a number.
|
|
357
|
+
* Nothing set is removed, so the element keeps its own default: a
|
|
358
|
+
* dropdown's empty value is not one of its options, and an element handed
|
|
359
|
+
* `variant: ''` draws neither the component's variant nor its own.
|
|
360
|
+
* - `text` (Text, Long text, Image, Link) — the substituted text.
|
|
361
|
+
*
|
|
362
|
+
* "Nothing chosen" includes a binding still holding its token after
|
|
363
|
+
* substitution — a component editor drawing a prop that has no default —
|
|
364
|
+
* which is then drawn exactly as a page that sets nothing renders it.
|
|
365
|
+
*
|
|
366
|
+
* The same finishing reaches a nested placement: a component placed inside
|
|
367
|
+
* this definition, whose own `propValues` hand one of this definition's
|
|
368
|
+
* properties on by its exact token, receives the value typed — a list, a
|
|
369
|
+
* number, an icon with its path — and nothing at all where there is nothing to
|
|
370
|
+
* give, so its own default applies.
|
|
371
|
+
*
|
|
372
|
+
* Exact match only, for the reason {@link matchComponentPropToken} gives: a
|
|
373
|
+
* value that merely contains a token is text with a value inside it, and it
|
|
374
|
+
* stays text. An undeclared name is never typed either — it never substitutes,
|
|
375
|
+
* so there is no value to read.
|
|
376
|
+
*
|
|
377
|
+
* Top-level props only, and never an element's text content (`children`). The
|
|
378
|
+
* binding a panel field offers writes that field's own prop; a token nested in
|
|
379
|
+
* an item list is content the component spelled out, and text is text
|
|
380
|
+
* whatever kind of property fills it — so both keep the textual treatment.
|
|
381
|
+
*
|
|
382
|
+
* An `href` or `src` a token fed is then held to the address rule — see
|
|
383
|
+
* {@link holdPropFedAddresses}.
|
|
384
|
+
*
|
|
385
|
+
* Inputs are never mutated, and a map with no typed binding and no refused
|
|
386
|
+
* address comes back exactly as the substitution left it.
|
|
387
|
+
*/ export function resolveComponentPropTokens(nodes, declared, tokens, iconPaths, values) {
|
|
388
|
+
const substituted = resolveNamedTokens(nodes, tokens);
|
|
389
|
+
const typedProps = new Map();
|
|
390
|
+
for (const prop of declared != null ? declared : []){
|
|
391
|
+
if (!(prop == null ? void 0 : prop.name)) continue;
|
|
392
|
+
const valueClass = reusablePropValueClass(prop);
|
|
393
|
+
if (valueClass !== 'text') typedProps.set(prop.name, valueClass);
|
|
394
|
+
}
|
|
395
|
+
if (!typedProps.size) return holdPropFedAddresses(nodes, substituted);
|
|
396
|
+
const knownValue = (name)=>values ? {
|
|
397
|
+
value: values[name]
|
|
398
|
+
} : undefined;
|
|
399
|
+
let typed;
|
|
400
|
+
for (const [id, node] of Object.entries(nodes != null ? nodes : {})){
|
|
401
|
+
const raw = node == null ? void 0 : node.props;
|
|
402
|
+
if (!raw || typeof raw !== 'object') continue;
|
|
403
|
+
let props;
|
|
404
|
+
const own = ()=>{
|
|
405
|
+
var _substituted_id;
|
|
406
|
+
return props = props != null ? props : _extends({}, (_substituted_id = substituted[id]) == null ? void 0 : _substituted_id.props);
|
|
407
|
+
};
|
|
408
|
+
for (const [key, value] of Object.entries(raw)){
|
|
409
|
+
if (key === 'children') continue;
|
|
410
|
+
const name = matchComponentPropToken(value);
|
|
411
|
+
const valueClass = name ? typedProps.get(name) : undefined;
|
|
412
|
+
if (!name || !valueClass) continue;
|
|
413
|
+
const next = own();
|
|
414
|
+
const finished = typedBindingValue(valueClass, knownValue(name), next[key]);
|
|
415
|
+
if (finished === undefined) delete next[key];
|
|
416
|
+
else next[key] = finished;
|
|
417
|
+
if (valueClass !== 'icon') continue;
|
|
418
|
+
const pathKey = iconPathPropName(key);
|
|
419
|
+
if (pathKey === key) continue;
|
|
420
|
+
const path = finished === undefined ? undefined : iconPaths == null ? void 0 : iconPaths[name];
|
|
421
|
+
if (path) next[pathKey] = path;
|
|
422
|
+
else delete next[pathKey];
|
|
423
|
+
}
|
|
424
|
+
const nested = (node == null ? void 0 : node.componentId) === REUSABLE_INSTANCE_COMPONENT_ID ? instancePropValues(raw) : undefined;
|
|
425
|
+
if (nested) {
|
|
426
|
+
let forwarded;
|
|
427
|
+
for (const [key, value] of Object.entries(nested)){
|
|
428
|
+
const name = matchComponentPropToken(value);
|
|
429
|
+
const valueClass = name ? typedProps.get(name) : undefined;
|
|
430
|
+
if (!name || !valueClass) continue;
|
|
431
|
+
forwarded = forwarded != null ? forwarded : _extends({}, instancePropValues(own()));
|
|
432
|
+
const known = knownValue(name);
|
|
433
|
+
const given = known ? known.value : forwarded[key];
|
|
434
|
+
if (isNothingToGive(given)) {
|
|
435
|
+
delete forwarded[key];
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
if (valueClass === 'icon') {
|
|
439
|
+
const icon = readInstanceIconValue(given);
|
|
440
|
+
const path = iconPaths == null ? void 0 : iconPaths[name];
|
|
441
|
+
forwarded[key] = icon ? _extends({}, icon, path && !icon.iconPath ? {
|
|
442
|
+
iconPath: path
|
|
443
|
+
} : {}) : undefined;
|
|
444
|
+
if (!forwarded[key]) delete forwarded[key];
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
forwarded[key] = typedBindingValue(valueClass, {
|
|
448
|
+
value: given
|
|
449
|
+
}, given);
|
|
450
|
+
}
|
|
451
|
+
if (forwarded) own()[REUSABLE_INSTANCE_PROP_VALUES_KEY] = forwarded;
|
|
452
|
+
}
|
|
453
|
+
if (!props) continue;
|
|
454
|
+
typed = typed != null ? typed : _extends({}, substituted);
|
|
455
|
+
typed[id] = _extends({}, substituted[id], {
|
|
456
|
+
props
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
return holdPropFedAddresses(nodes, typed != null ? typed : substituted);
|
|
460
|
+
}
|
|
461
|
+
/** A `{{prop.*}}` token's opening, escaped for a pattern. */ const PROP_TOKEN_SOURCE = `\\{\\{\\s*${COMPONENT_PROP_TOKEN_PREFIX.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`;
|
|
462
|
+
/** Where a `{{prop.*}}` token opens, anywhere inside a value. */ const PROP_TOKEN_OPENING = new RegExp(PROP_TOKEN_SOURCE);
|
|
463
|
+
/**
|
|
464
|
+
* The bindings that open a value and that a later compose stage resolves — a
|
|
465
|
+
* host token, a site variable — but not a property token, which this stage
|
|
466
|
+
* resolves or never will.
|
|
467
|
+
*/ const LATER_BINDINGS_OPENING = new RegExp(`^(?:\\{\\{(?!${PROP_TOKEN_SOURCE.slice('\\{\\{'.length)})[^{}]*\\}\\}\\s*)+`);
|
|
468
|
+
/**
|
|
469
|
+
* Whether a property-fed value may stay in an address prop once the
|
|
470
|
+
* substitution has made it.
|
|
471
|
+
*
|
|
472
|
+
* The address rule, with the site's own references admitted — a screen or
|
|
473
|
+
* collection link, a media-library pick — since this is the site that resolves
|
|
474
|
+
* them. One exception: a value that opens with a binding a later stage
|
|
475
|
+
* resolves (`{{host.url}}/about`) has no scheme until then, so the binding is
|
|
476
|
+
* left to supply one and what follows it is judged as though the binding came
|
|
477
|
+
* to nothing — which is what an unknown host token does — so a scheme cannot
|
|
478
|
+
* be smuggled in behind it.
|
|
479
|
+
*/ function isRenderableAddress(prop, value) {
|
|
480
|
+
if (typeof value !== 'string') return false;
|
|
481
|
+
const address = value.trim();
|
|
482
|
+
if (isSafeNodeUrl(prop, address, {
|
|
483
|
+
siteReferences: true
|
|
484
|
+
})) return true;
|
|
485
|
+
const opening = LATER_BINDINGS_OPENING.exec(address);
|
|
486
|
+
if (!opening) return false;
|
|
487
|
+
const rest = address.slice(opening[0].length);
|
|
488
|
+
return rest === '' || isSafeNodeUrl(prop, rest, {
|
|
489
|
+
siteReferences: true
|
|
490
|
+
}) || !hasUrlScheme(rest);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* `resolved` with every `href` and `src` that a `{{prop.*}}` token fed held to
|
|
494
|
+
* the address rule, and removed where it fails it (AGL-2933).
|
|
495
|
+
*
|
|
496
|
+
* A published node's own address is held to that rule when it is published,
|
|
497
|
+
* and a property's default when its declaration is — but a property's value
|
|
498
|
+
* is set by whichever page places the component, or screen inside the layout,
|
|
499
|
+
* long after either, and this is where it becomes the prop an element spreads
|
|
500
|
+
* onto the DOM. Canvas, Preview, detach and the tenant all arrive here, so a
|
|
501
|
+
* `javascript:` or `data:` value set on a property reaches none of them.
|
|
502
|
+
*
|
|
503
|
+
* It judges the whole value the substitution made (see
|
|
504
|
+
* {@link isRenderableAddress}), so a token behind a literal scheme
|
|
505
|
+
* (`https://example.com/{{prop.path}}`) stays a path on that site, and two
|
|
506
|
+
* values that spell a scheme between them are refused together. A value still
|
|
507
|
+
* holding its property token — an undeclared name, or the component editor's
|
|
508
|
+
* raw-token view — is no address either, and a linking element reads it as
|
|
509
|
+
* none.
|
|
510
|
+
*
|
|
511
|
+
* Only the prop goes: a button with no address is still a button. `raw` is
|
|
512
|
+
* the map before substitution, which is what says a token fed the value;
|
|
513
|
+
* neither map is mutated.
|
|
514
|
+
*/ function holdPropFedAddresses(raw, resolved) {
|
|
515
|
+
let held;
|
|
516
|
+
for (const [id, node] of Object.entries(raw != null ? raw : {})){
|
|
517
|
+
const authored = node == null ? void 0 : node.props;
|
|
518
|
+
if (!authored || typeof authored !== 'object') continue;
|
|
519
|
+
let props;
|
|
520
|
+
for (const key of NODE_URL_PROPS){
|
|
521
|
+
var _this, _resolved_id, _resolved_id1;
|
|
522
|
+
const source = authored[key];
|
|
523
|
+
if (typeof source !== 'string' || !PROP_TOKEN_OPENING.test(source)) continue;
|
|
524
|
+
const current = (_this = props != null ? props : (_resolved_id = resolved[id]) == null ? void 0 : _resolved_id.props) == null ? void 0 : _this[key];
|
|
525
|
+
if (current === undefined || isRenderableAddress(key, current)) continue;
|
|
526
|
+
props = props != null ? props : _extends({}, (_resolved_id1 = resolved[id]) == null ? void 0 : _resolved_id1.props);
|
|
527
|
+
delete props[key];
|
|
528
|
+
}
|
|
529
|
+
if (!props) continue;
|
|
530
|
+
held = held != null ? held : _extends({}, resolved);
|
|
531
|
+
held[id] = _extends({}, resolved[id], {
|
|
532
|
+
props
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return held != null ? held : resolved;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* A definition's declared props resolved over a set of its nodes for one page,
|
|
539
|
+
* then the parts that page hides pruned (AGL-1314) — the single sequence the
|
|
540
|
+
* component graft, detach and a composed layout all run.
|
|
541
|
+
*
|
|
542
|
+
* `values` is the page's own map, and `rootId` the node the prune never
|
|
543
|
+
* removes. Visibility directives are evaluated on the result, never before:
|
|
544
|
+
* they read `{{prop.*}}` like everything else, so pruning ahead of
|
|
545
|
+
* substitution would see a token instead of the value and hide whatever the
|
|
546
|
+
* definition merely MENTIONED.
|
|
547
|
+
*/ export function applyDeclaredProps(nodes, declared, values, rootId) {
|
|
548
|
+
const resolved = resolveReusablePropValues(declared, values);
|
|
549
|
+
return pruneHiddenNodes(resolveComponentPropTokens(nodes, declared, resolved.tokens, resolved.iconPaths, resolved.values), rootId);
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Whether a node's props ask for it to be dropped (AGL-1314) — see
|
|
553
|
+
* {@link NODE_HIDE_IF_PROP} and {@link NODE_HIDE_UNLESS_PROP}.
|
|
554
|
+
*
|
|
555
|
+
* Evaluated on SUBSTITUTED props, so callers must run this after the
|
|
556
|
+
* declared-prop tokens have resolved; against a raw definition node every
|
|
557
|
+
* directive is still a token and reads as "no opinion" by design, which is
|
|
558
|
+
* what keeps the component editor showing the parts a page will hide.
|
|
559
|
+
*/ export function isNodeHiddenByDirective(props) {
|
|
560
|
+
if (!props || typeof props !== 'object' || Array.isArray(props)) return false;
|
|
561
|
+
const bag = props;
|
|
562
|
+
if (readYesNoValue(bag[NODE_HIDE_IF_PROP]) === true) return true;
|
|
563
|
+
return readYesNoValue(bag[NODE_HIDE_UNLESS_PROP]) === false;
|
|
564
|
+
}
|
|
565
|
+
function hasVisibilityDirective(props) {
|
|
566
|
+
if (!props || typeof props !== 'object' || Array.isArray(props)) return false;
|
|
567
|
+
const bag = props;
|
|
568
|
+
return NODE_HIDE_IF_PROP in bag || NODE_HIDE_UNLESS_PROP in bag;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The node minus its visibility directives — they are compose-time
|
|
572
|
+
* instructions, and `Leaf` spreads whatever survives onto the component,
|
|
573
|
+
* so leaving them would put `hideif="…"` on the DOM of every node that
|
|
574
|
+
* declared one and stayed.
|
|
575
|
+
*/ function withoutVisibilityDirectives(node) {
|
|
576
|
+
if (!hasVisibilityDirective(node == null ? void 0 : node.props)) return node;
|
|
577
|
+
const props = _extends({}, node.props);
|
|
578
|
+
delete props[NODE_HIDE_IF_PROP];
|
|
579
|
+
delete props[NODE_HIDE_UNLESS_PROP];
|
|
580
|
+
return _extends({}, node, {
|
|
581
|
+
props: props
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Drops every node under `rootId` whose props ask to be hidden, along with
|
|
586
|
+
* its whole subtree and its entry in its parent's child list, and strips
|
|
587
|
+
* the directives off everything that survives (AGL-1314).
|
|
588
|
+
*
|
|
589
|
+
* Structural rather than a `display: none`: an instance can already hide a
|
|
590
|
+
* leaf with a per-leaf style override (AGL-1332), but that still ships the
|
|
591
|
+
* markup, still fetches the image, still leaves the grid column, and still
|
|
592
|
+
* leaves the control in the tab order. "This page has no mockup" is a
|
|
593
|
+
* statement about the tree, so it is made in the tree.
|
|
594
|
+
*
|
|
595
|
+
* `rootId` itself is never dropped. The graft below wires the instance
|
|
596
|
+
* node's single child to the definition root by id, so a self-hiding root
|
|
597
|
+
* would leave a dangling reference; a component that should not appear at
|
|
598
|
+
* all is a decision for the page that placed it, not for the definition.
|
|
599
|
+
*
|
|
600
|
+
* Returns the input unchanged when no node carries a directive, so the
|
|
601
|
+
* overwhelmingly common case costs one scan and allocates nothing.
|
|
602
|
+
*/ export function pruneHiddenNodes(nodes, rootId) {
|
|
603
|
+
if (!nodes) return nodes;
|
|
604
|
+
let sawDirective = false;
|
|
605
|
+
for (const node of Object.values(nodes)){
|
|
606
|
+
if (hasVisibilityDirective(node == null ? void 0 : node.props)) {
|
|
607
|
+
sawDirective = true;
|
|
608
|
+
break;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if (!sawDirective) return nodes;
|
|
612
|
+
const hidden = new Set();
|
|
613
|
+
const seen = new Set();
|
|
614
|
+
const walk = (id)=>{
|
|
615
|
+
const node = nodes[id];
|
|
616
|
+
// `seen` bounds the walk: a definition that referenced an ancestor
|
|
617
|
+
// would otherwise recurse until the stack gave out.
|
|
618
|
+
if (!node || seen.has(id)) return;
|
|
619
|
+
seen.add(id);
|
|
620
|
+
const children = Array.isArray(node.nodes) ? node.nodes : [];
|
|
621
|
+
for (const childId of children){
|
|
622
|
+
var _nodes_childId;
|
|
623
|
+
if (typeof childId !== 'string' || !nodes[childId]) continue;
|
|
624
|
+
if (isNodeHiddenByDirective((_nodes_childId = nodes[childId]) == null ? void 0 : _nodes_childId.props)) {
|
|
625
|
+
hidden.add(childId);
|
|
626
|
+
for (const descendant of collectDescendantIds(nodes, childId)){
|
|
627
|
+
hidden.add(descendant);
|
|
628
|
+
}
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
walk(childId);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
walk(rootId);
|
|
635
|
+
const next = {};
|
|
636
|
+
for (const [id, node] of Object.entries(nodes)){
|
|
637
|
+
if (hidden.has(id)) continue;
|
|
638
|
+
const kept = withoutVisibilityDirectives(node);
|
|
639
|
+
const children = Array.isArray(kept == null ? void 0 : kept.nodes) ? kept.nodes : null;
|
|
640
|
+
const survivors = children && children.some((childId)=>hidden.has(childId)) ? children.filter((childId)=>!hidden.has(childId)) : null;
|
|
641
|
+
next[id] = survivors ? _extends({}, kept, {
|
|
642
|
+
nodes: survivors
|
|
643
|
+
}) : kept;
|
|
644
|
+
}
|
|
645
|
+
return next;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Expands reusable-component instance nodes (componentId
|
|
649
|
+
* {@link REUSABLE_INSTANCE_COMPONENT_ID}, `props.refId` → definition id) by
|
|
650
|
+
* grafting the referenced definition's subtree under each instance:
|
|
651
|
+
*
|
|
652
|
+
* - Grafted node ids are namespaced per instance (`cmp__{instanceId}__…`).
|
|
653
|
+
* - The instance node keeps its identity (selection/attributes target) and
|
|
654
|
+
* gains the grafted root as its only child.
|
|
655
|
+
* - Unresolvable refIds leave the instance untouched — a deleted definition
|
|
656
|
+
* must never take a published screen down.
|
|
657
|
+
* - Definitions may contain instances of other definitions; expansion
|
|
658
|
+
* repeats up to {@link MAX_COMPONENT_DEPTH} passes, which also bounds
|
|
659
|
+
* accidental self-reference.
|
|
660
|
+
* - A definition's declared props (AGL-1247) resolve per instance as the
|
|
661
|
+
* subtree is grafted: `{{prop.name}}` tokens take that instance's
|
|
662
|
+
* override, falling back to the prop's default. This is what lets one
|
|
663
|
+
* hero serve eleven pages instead of being copied onto each.
|
|
664
|
+
* - A grafted node asking to be hidden ({@link NODE_HIDE_IF_PROP} /
|
|
665
|
+
* {@link NODE_HIDE_UNLESS_PROP}, AGL-1314) is pruned with its subtree —
|
|
666
|
+
* which is how one hero renders with a mockup on `/product` and without
|
|
667
|
+
* one on `/press`.
|
|
668
|
+
* - Inputs are never mutated.
|
|
669
|
+
*
|
|
670
|
+
* `morePlacements` adds further node kinds that stand for a stored tree — a
|
|
671
|
+
* placed form is the second one ({@link PlacementKind}) — expanded in the same
|
|
672
|
+
* passes as instances, so the two nest inside each other in either order.
|
|
673
|
+
*
|
|
674
|
+
* ⛔ **A placement is expanded only when its tree RESOLVES**, meaning the
|
|
675
|
+
* document is in the map AND carries a `rootId` its `nodes` actually hold. An
|
|
676
|
+
* unresolvable one is left exactly as authored. That is what makes the
|
|
677
|
+
* child-replacing kind safe to introduce on a live site: a form bound to an
|
|
678
|
+
* entity that has never been published still renders the fields drawn on the
|
|
679
|
+
* page, and the graft can only ever swap a page's copy of a form for the
|
|
680
|
+
* entity's own.
|
|
681
|
+
*/ export function composeReusableComponentNodes(nodes, definitionsById, morePlacements) {
|
|
682
|
+
const placements = [
|
|
683
|
+
{
|
|
684
|
+
componentId: REUSABLE_INSTANCE_COMPONENT_ID,
|
|
685
|
+
refProp: 'refId',
|
|
686
|
+
definitionsById
|
|
687
|
+
},
|
|
688
|
+
...morePlacements != null ? morePlacements : []
|
|
689
|
+
].filter((placement)=>placement.definitionsById);
|
|
690
|
+
if (!placements.length) return nodes;
|
|
691
|
+
/**
|
|
692
|
+
* The kind and tree this node stands for, or `undefined` when it stands for
|
|
693
|
+
* nothing resolvable.
|
|
694
|
+
*
|
|
695
|
+
* The `nodes[rootId]` check is the resolution rule stated once: a document
|
|
696
|
+
* whose root is not among its own nodes has no design to graft, and wiring
|
|
697
|
+
* the placement's only child to an id nothing holds would blank it on the
|
|
698
|
+
* page while reading, downstream, as already expanded.
|
|
699
|
+
*/ const resolvePlacement = (node)=>{
|
|
700
|
+
for (const placement of placements){
|
|
701
|
+
var _node_props, _placement_definitionsById, _definition_nodes;
|
|
702
|
+
if ((node == null ? void 0 : node.componentId) !== placement.componentId) continue;
|
|
703
|
+
const refId = (_node_props = node.props) == null ? void 0 : _node_props[placement.refProp];
|
|
704
|
+
if (typeof refId !== 'string' || !refId) continue;
|
|
705
|
+
const definition = (_placement_definitionsById = placement.definitionsById) == null ? void 0 : _placement_definitionsById[refId];
|
|
706
|
+
if (!(definition == null ? void 0 : definition.rootId) || !((_definition_nodes = definition.nodes) == null ? void 0 : _definition_nodes[definition.rootId])) continue;
|
|
707
|
+
return {
|
|
708
|
+
placement,
|
|
709
|
+
definition
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
return undefined;
|
|
713
|
+
};
|
|
714
|
+
/** Expanded by an earlier pass — its children already carry its prefix. */ const alreadyGrafted = (id, node)=>{
|
|
715
|
+
const childIds = Array.isArray(node.nodes) ? node.nodes : [];
|
|
716
|
+
return childIds.some((childId)=>typeof childId === 'string' && childId.startsWith(instancePrefix(id)));
|
|
717
|
+
};
|
|
718
|
+
let composed = nodes;
|
|
719
|
+
/*
|
|
720
|
+
* WHAT A RESOLVED FORM REPLACES, DROPPED BEFORE ANYTHING IS GRAFTED.
|
|
721
|
+
*
|
|
722
|
+
* Ahead of the passes rather than inside them so the drop is decided against
|
|
723
|
+
* the authored tree alone. Inside a pass it would race the expansions
|
|
724
|
+
* running beside it: an inline field that was itself a component instance
|
|
725
|
+
* could be grafted in the same pass that discards it, and its grafted
|
|
726
|
+
* subtree — keyed off ids this walk never sees — would survive its own
|
|
727
|
+
* parent as unreachable nodes on a published page.
|
|
728
|
+
*/ const doomed = new Set();
|
|
729
|
+
const emptied = [];
|
|
730
|
+
for (const [id, node] of Object.entries(nodes)){
|
|
731
|
+
var _resolvePlacement;
|
|
732
|
+
if (!node || !((_resolvePlacement = resolvePlacement(node)) == null ? void 0 : _resolvePlacement.placement.replacesAuthoredChildren)) {
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
735
|
+
if (alreadyGrafted(id, node)) continue;
|
|
736
|
+
const descendants = collectDescendantIds(nodes, id);
|
|
737
|
+
if (!descendants.size) continue;
|
|
738
|
+
for (const descendantId of descendants)doomed.add(descendantId);
|
|
739
|
+
emptied.push(id);
|
|
740
|
+
}
|
|
741
|
+
if (doomed.size) {
|
|
742
|
+
const pruned = {};
|
|
743
|
+
for (const [id, node] of Object.entries(nodes)){
|
|
744
|
+
if (!doomed.has(id)) pruned[id] = node;
|
|
745
|
+
}
|
|
746
|
+
for (const id of emptied){
|
|
747
|
+
// A replaced form nested in another replaced form's authored children is
|
|
748
|
+
// gone with it, so there is nothing left here to empty.
|
|
749
|
+
if (pruned[id]) pruned[id] = _extends({}, pruned[id], {
|
|
750
|
+
nodes: []
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
composed = pruned;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Which definition each graft brought in, keyed by the id prefix its nodes
|
|
757
|
+
* carry — the ancestry a node cannot expand into again.
|
|
758
|
+
*
|
|
759
|
+
* `alreadyGrafted` bounds an instance against ITSELF: once a node's children
|
|
760
|
+
* carry its prefix, that node is done. It cannot see the other shape, where
|
|
761
|
+
* a definition's own subtree contains a FRESH instance naming the same
|
|
762
|
+
* definition. Each pass mints a new instance id, so that node looks new to
|
|
763
|
+
* every check there was, and the graft ran again on its own output until
|
|
764
|
+
* {@link MAX_COMPONENT_DEPTH} stopped it.
|
|
765
|
+
*
|
|
766
|
+
* A depth cap is the right backstop for a reusable component, where
|
|
767
|
+
* self-reference is an authoring mistake. It is the wrong bound for a FORM:
|
|
768
|
+
* `checkFormContract` REQUIRES a form design's tree to contain a `form` node
|
|
769
|
+
* naming that same form, so a placed form does not merely risk grafting into
|
|
770
|
+
* itself — it always does, to the cap, every render. Six nested `<form>`
|
|
771
|
+
* elements is invalid HTML, so the server parser drops the inner ones and
|
|
772
|
+
* the client tree then disagrees with the server tree, which is a hydration
|
|
773
|
+
* failure on a public page.
|
|
774
|
+
*
|
|
775
|
+
* Keyed by prefix because the prefix chain IS the ancestry: a node grafted
|
|
776
|
+
* inside instance X has an id beginning with X's prefix, and one nested two
|
|
777
|
+
* deep begins with both. Testing `startsWith` against a definition already
|
|
778
|
+
* open above therefore asks exactly the right question — "is this the same
|
|
779
|
+
* definition, inside its own expansion?" — while leaving a genuinely
|
|
780
|
+
* different form placed inside a form free to expand.
|
|
781
|
+
*/ const graftedAncestry = [];
|
|
782
|
+
/**
|
|
783
|
+
* The definition id a node points at, and the placement that claims it.
|
|
784
|
+
*
|
|
785
|
+
* Scoped to placements that REPLACE authored children. That is what a form
|
|
786
|
+
* does and what a reusable-component instance does not, and the difference
|
|
787
|
+
* is the whole reason this guard is narrow: for a component, a definition
|
|
788
|
+
* naming itself is an authoring mistake whose documented behaviour is a
|
|
789
|
+
* depth-bounded expansion, and collapsing it here would change a semantic
|
|
790
|
+
* this fix has no business touching. For a placement that replaces children,
|
|
791
|
+
* the instance and the definition's root denote the same thing.
|
|
792
|
+
*/ const replacingRefOf = (node)=>{
|
|
793
|
+
for (const placement of placements){
|
|
794
|
+
var _node_props;
|
|
795
|
+
if (!placement.replacesAuthoredChildren) continue;
|
|
796
|
+
// `componentId` sits on the NODE and the ref on its props, matching
|
|
797
|
+
// `resolvePlacement` exactly — a predicate that drifted from that one
|
|
798
|
+
// would not fail loudly, it would simply never match and leave the guard
|
|
799
|
+
// switched off.
|
|
800
|
+
if ((node == null ? void 0 : node.componentId) !== placement.componentId) continue;
|
|
801
|
+
const refId = (_node_props = node.props) == null ? void 0 : _node_props[placement.refProp];
|
|
802
|
+
if (typeof refId === 'string' && refId) return {
|
|
803
|
+
refId,
|
|
804
|
+
placement
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
return null;
|
|
808
|
+
};
|
|
809
|
+
/** Just the id, for the two call sites that do not need the placement. */ const refIdOf = (node)=>{
|
|
810
|
+
var _ref;
|
|
811
|
+
var _replacingRefOf;
|
|
812
|
+
return (_ref = (_replacingRefOf = replacingRefOf(node)) == null ? void 0 : _replacingRefOf.refId) != null ? _ref : null;
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Is this node an instance of a definition already open above it?
|
|
816
|
+
*
|
|
817
|
+
* Left completely untouched when so — not pruned, not emptied. An unexpanded
|
|
818
|
+
* form node renders its own authored children, which is the same thing an
|
|
819
|
+
* unresolvable ref does, and matches the rule that a missing definition must
|
|
820
|
+
* never take a published page down.
|
|
821
|
+
*/ const withinOwnExpansion = (id, node)=>{
|
|
822
|
+
const refId = refIdOf(node);
|
|
823
|
+
if (!refId) return false;
|
|
824
|
+
return graftedAncestry.some((entry)=>entry.refId === refId && id.startsWith(entry.prefix));
|
|
825
|
+
};
|
|
826
|
+
for(let depth = 0; depth < MAX_COMPONENT_DEPTH; depth++){
|
|
827
|
+
const pending = Object.entries(composed).filter(([id, node])=>Boolean(resolvePlacement(node)) && !alreadyGrafted(id, node) && !withinOwnExpansion(id, node));
|
|
828
|
+
if (!pending.length) break;
|
|
829
|
+
const next = _extends({}, composed);
|
|
830
|
+
for (const [instanceId, instanceNode] of pending){
|
|
831
|
+
const definition = resolvePlacement(instanceNode).definition;
|
|
832
|
+
const prefix = instancePrefix(instanceId);
|
|
833
|
+
// Recorded BEFORE the subtree is written, so the nodes this graft is
|
|
834
|
+
// about to produce are already inside its ancestry when the next pass
|
|
835
|
+
// considers them.
|
|
836
|
+
const grafting = refIdOf(instanceNode);
|
|
837
|
+
if (grafting) graftedAncestry.push({
|
|
838
|
+
prefix,
|
|
839
|
+
refId: grafting
|
|
840
|
+
});
|
|
841
|
+
const prefixId = (id)=>`${prefix}${id}`;
|
|
842
|
+
// Style overrides (AGL-1306 root, AGL-1332 per leaf): merged over
|
|
843
|
+
// each definition node's own sx as this instance's copy is grafted —
|
|
844
|
+
// per-instance scope exists only here, exactly like the declared-prop
|
|
845
|
+
// substitution below. Merging into the graft (rather than a renderer
|
|
846
|
+
// patch) is what gives canvas/Preview/tenant parity for free, and
|
|
847
|
+
// reading the definition's CURRENT nodes each pass is why an override
|
|
848
|
+
// can never pin the instance to an old component version.
|
|
849
|
+
//
|
|
850
|
+
// Per-leaf is not a nicety: a component's text leaves usually set
|
|
851
|
+
// their OWN colour, so a root-level `color` never reaches them and an
|
|
852
|
+
// instance given a white background renders white-on-white (AGL-1318).
|
|
853
|
+
const styleOverrides = getInstanceStyleOverrides(instanceNode);
|
|
854
|
+
// Attribute overrides (AGL-1899) ride the same graft for the same
|
|
855
|
+
// reason: this is the one point where per-instance scope exists, so
|
|
856
|
+
// merging here is what makes canvas, Preview and tenant SSR agree
|
|
857
|
+
// without any of them knowing an override happened.
|
|
858
|
+
//
|
|
859
|
+
// Applied to the props BEFORE `resolveNamedTokens` below, which is
|
|
860
|
+
// what lets an override be written in `{{prop.*}}`/`{{var:id}}` and
|
|
861
|
+
// still resolve, and what makes an override on a bound prop beat the
|
|
862
|
+
// component's own binding — the more specific placement wins.
|
|
863
|
+
const attrOverrides = getInstanceAttrOverrides(instanceNode);
|
|
864
|
+
const grafted = {};
|
|
865
|
+
for (const [defId, defNode] of Object.entries(definition.nodes)){
|
|
866
|
+
var _defNode_$id, _instanceSxPatch, _instancePropsPatch;
|
|
867
|
+
if (!defNode) continue;
|
|
868
|
+
grafted[prefixId(defId)] = _extends({}, defNode, {
|
|
869
|
+
$id: prefixId((_defNode_$id = defNode.$id) != null ? _defNode_$id : defId),
|
|
870
|
+
parentId: defId === definition.rootId ? instanceId : defNode.parentId != null ? prefixId(defNode.parentId) : defNode.parentId
|
|
871
|
+
}, Array.isArray(defNode.nodes) && {
|
|
872
|
+
nodes: defNode.nodes.map((childId)=>typeof childId === 'string' ? prefixId(childId) : childId)
|
|
873
|
+
}, (_instanceSxPatch = instanceSxPatch(defNode.sx, styleOverrides, defId, definition.rootId)) != null ? _instanceSxPatch : {}, (_instancePropsPatch = instancePropsPatch(defNode.props, attrOverrides, defId, definition.rootId)) != null ? _instancePropsPatch : {});
|
|
874
|
+
}
|
|
875
|
+
// Declared props (AGL-1247) substitute HERE, on this instance's copy
|
|
876
|
+
// of the subtree — the only point in the pipeline where per-instance
|
|
877
|
+
// scope exists, since after the merge every grafted node is just
|
|
878
|
+
// another entry in one flat map.
|
|
879
|
+
//
|
|
880
|
+
// The value lands in a real string prop and compose runs graft →
|
|
881
|
+
// repeatables → `resolveNodesBindings`, so a `{{var:id}}` typed into
|
|
882
|
+
// an override still resolves downstream for free. A field bound to a
|
|
883
|
+
// prop that is not text is finished by that prop's kind instead — see
|
|
884
|
+
// `resolveComponentPropTokens` — and the parts this page hides are
|
|
885
|
+
// pruned from the result (`applyDeclaredProps`).
|
|
886
|
+
Object.assign(next, applyDeclaredProps(grafted, definition.props, instancePropValues(instanceNode.props), prefixId(definition.rootId)));
|
|
887
|
+
/*
|
|
888
|
+
* A definition whose ROOT names the definition itself is grafted
|
|
889
|
+
* UNWRAPPED — its root's children attach to the instance, and the
|
|
890
|
+
* duplicate root is dropped.
|
|
891
|
+
*
|
|
892
|
+
* Bounding the recursion above stops the runaway, but one graft of a
|
|
893
|
+
* self-naming design still produces two of the same element nested: the
|
|
894
|
+
* placed node, and the design's root inside it. For a form that is a
|
|
895
|
+
* `<form>` inside a `<form>`, which is invalid HTML — the server parser
|
|
896
|
+
* drops the inner one, the client keeps it, and the two trees disagree.
|
|
897
|
+
* Six of them or two, the page still fails to hydrate.
|
|
898
|
+
*
|
|
899
|
+
* Unwrapping is not a special case bolted on for forms: the instance and
|
|
900
|
+
* the definition's root denote THE SAME THING here, and rendering both
|
|
901
|
+
* was always the duplicate. `checkFormContract` is what makes a form
|
|
902
|
+
* design always take this shape, so for forms this branch is the normal
|
|
903
|
+
* path rather than the exception.
|
|
904
|
+
*
|
|
905
|
+
* The instance keeps its own props: it is the node the page authored,
|
|
906
|
+
* carrying the id everything else resolves against.
|
|
907
|
+
*/ const graftedRootId = prefixId(definition.rootId);
|
|
908
|
+
const definitionRoot = definition.nodes[definition.rootId];
|
|
909
|
+
const rootNamesItself = Boolean(grafting) && refIdOf(definitionRoot) === grafting;
|
|
910
|
+
const graftedRoot = next[graftedRootId];
|
|
911
|
+
if (rootNamesItself && graftedRoot) {
|
|
912
|
+
const adopted = Array.isArray(graftedRoot.nodes) ? graftedRoot.nodes : [];
|
|
913
|
+
for (const childId of adopted){
|
|
914
|
+
if (next[childId]) {
|
|
915
|
+
next[childId] = _extends({}, next[childId], {
|
|
916
|
+
parentId: instanceId
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
delete next[graftedRootId];
|
|
921
|
+
next[instanceId] = _extends({}, instanceNode, {
|
|
922
|
+
nodes: adopted
|
|
923
|
+
});
|
|
924
|
+
} else if (graftedRoot) {
|
|
925
|
+
var _graftedRoot_props, _instanceNode_props;
|
|
926
|
+
/*
|
|
927
|
+
* THE INSTANCE AND THE DEFINITION'S ROOT ARE ONE ELEMENT (AGL-2521).
|
|
928
|
+
*
|
|
929
|
+
* The graft used to keep both — the instance as a container with the
|
|
930
|
+
* definition's root inside it — so every placement published a `div`
|
|
931
|
+
* the author never drew. On `aglyn.com` that was four of them on the
|
|
932
|
+
* home page, one per placement, each sitting between a landmark and
|
|
933
|
+
* its parent and breaking any direct-child selector the layout wrote.
|
|
934
|
+
*
|
|
935
|
+
* So the root TAKES THE INSTANCE'S PLACE: same id, same parent, same
|
|
936
|
+
* slot in the parent's child list. Its own grafted id disappears and
|
|
937
|
+
* its children keep theirs, which is what leaves the `cmp__{instance}
|
|
938
|
+
* __{defId}` scheme — and everything reading it, from per-leaf
|
|
939
|
+
* overrides to {@link resolveInstanceLeafBinding} — untouched.
|
|
940
|
+
*
|
|
941
|
+
* Keeping the INSTANCE'S id rather than the root's is the half that
|
|
942
|
+
* matters: interactions, animations and analytics are all keyed to the
|
|
943
|
+
* node the page authored, and a swap to the prefixed id would silently
|
|
944
|
+
* drop every one of them.
|
|
945
|
+
*
|
|
946
|
+
* What the instance contributed as an element comes with it. Its `sx`
|
|
947
|
+
* merges OVER the root's, because a placement styling its component is
|
|
948
|
+
* the more specific of the two. Its universal directives — hide,
|
|
949
|
+
* animate — move across for the same reason: they were authored
|
|
950
|
+
* against "this placement", which is now this element. What stays
|
|
951
|
+
* behind is the bookkeeping that only ever addressed the wrapper:
|
|
952
|
+
* `refId`, `name`, the declared-prop values and the override slices,
|
|
953
|
+
* all of them already consumed by the graft above.
|
|
954
|
+
*/ /*
|
|
955
|
+
* Interactions come from BOTH nodes, root's first.
|
|
956
|
+
*
|
|
957
|
+
* They are keyed to the element by node id, and after the merge one
|
|
958
|
+
* element answers to two authors: the component, which wrote the
|
|
959
|
+
* choreography its internals rely on, and the placement, which wrote
|
|
960
|
+
* whatever this page wants on top. Keeping only one side silently
|
|
961
|
+
* drops the other's — and because the instance keeps its own id, the
|
|
962
|
+
* side that would go missing is the page's, on the very node whose id
|
|
963
|
+
* it is.
|
|
964
|
+
*
|
|
965
|
+
* Root's run first for the reason the host actions do in
|
|
966
|
+
* `getClientAutomations`: the more general enrolls before the more
|
|
967
|
+
* specific, which is the order a page is read in.
|
|
968
|
+
*
|
|
969
|
+
* `interactions` is declared on `NodeSchema`, one layer above the
|
|
970
|
+
* `AglynNodeSchema` this function is generic over, so both are read
|
|
971
|
+
* off the node rather than through the type.
|
|
972
|
+
*/ const interactionsOf = (node)=>{
|
|
973
|
+
const value = node == null ? void 0 : node.interactions;
|
|
974
|
+
return Array.isArray(value) ? value : [];
|
|
975
|
+
};
|
|
976
|
+
const mergedInteractions = [
|
|
977
|
+
...interactionsOf(graftedRoot),
|
|
978
|
+
...interactionsOf(instanceNode)
|
|
979
|
+
];
|
|
980
|
+
const carried = {};
|
|
981
|
+
for (const key of INSTANCE_CARRIED_PROPS){
|
|
982
|
+
var _instanceNode_props1;
|
|
983
|
+
const value = (_instanceNode_props1 = instanceNode.props) == null ? void 0 : _instanceNode_props1[key];
|
|
984
|
+
if (value !== undefined) carried[key] = value;
|
|
985
|
+
}
|
|
986
|
+
/*
|
|
987
|
+
* A placement's repeat moves across too, and the element repeats
|
|
988
|
+
* ITSELF (AGL-3111).
|
|
989
|
+
*
|
|
990
|
+
* It is the other universal directive authored against "this
|
|
991
|
+
* placement": the page asked for one copy of the component per record.
|
|
992
|
+
* After the merge that component is an element whose children are the
|
|
993
|
+
* component's own, which would read as the item template, so the scope
|
|
994
|
+
* is stated rather than left to the child list. The placement's repeat
|
|
995
|
+
* replaces one on the component's root rather than mixing with it —
|
|
996
|
+
* repeats do not nest, and a filter meant for the root's rows applied
|
|
997
|
+
* to the placement's would be neither author's.
|
|
998
|
+
*/ const repeatsPlacement = repeatKey(instanceNode) !== '';
|
|
999
|
+
if (repeatsPlacement) {
|
|
1000
|
+
for (const key of REPEAT_DIRECTIVE_PROPS){
|
|
1001
|
+
var _instanceNode_props2;
|
|
1002
|
+
const value = (_instanceNode_props2 = instanceNode.props) == null ? void 0 : _instanceNode_props2[key];
|
|
1003
|
+
if (value !== undefined) carried[key] = value;
|
|
1004
|
+
}
|
|
1005
|
+
carried[REPEAT_SELF_PROP] = true;
|
|
1006
|
+
}
|
|
1007
|
+
const rootProps = repeatsPlacement ? withoutRepeatDirective(graftedRoot).props : graftedRoot.props;
|
|
1008
|
+
/*
|
|
1009
|
+
* Classes from BOTH nodes, the component root's first.
|
|
1010
|
+
*
|
|
1011
|
+
* A class names the element for the site's stylesheet and for the
|
|
1012
|
+
* runtime: ⋮ ▸ Start hidden writes `aglyn-hidden` into the placement's
|
|
1013
|
+
* `props.className`, and the show/hide steps toggle that class on the
|
|
1014
|
+
* element answering to the placement's id, which after the merge is
|
|
1015
|
+
* this one. Keeping either list alone drops the other author's names,
|
|
1016
|
+
* so the two are joined, each name once, in `props` and on the node.
|
|
1017
|
+
*/ const propsClassName = joinClassNames((_graftedRoot_props = graftedRoot.props) == null ? void 0 : _graftedRoot_props['className'], (_instanceNode_props = instanceNode.props) == null ? void 0 : _instanceNode_props['className']);
|
|
1018
|
+
if (propsClassName) carried['className'] = propsClassName;
|
|
1019
|
+
const nodeClassName = joinClassNames(graftedRoot.className, instanceNode.className);
|
|
1020
|
+
// The override slices and the reference are DOCUMENT state living on
|
|
1021
|
+
// the node beside `sx`, not props — the renderer never spreads them at
|
|
1022
|
+
// an element — so they ride along rather than being consumed and
|
|
1023
|
+
// dropped. A composed map that is saved back must still carry what the
|
|
1024
|
+
// author set on this placement (AGL-1306/AGL-1899), and a re-compose
|
|
1025
|
+
// is a no-op because the merged node no longer answers to
|
|
1026
|
+
// `reusableInstance`.
|
|
1027
|
+
const documentState = {};
|
|
1028
|
+
for (const key of INSTANCE_CARRIED_NODE_FIELDS){
|
|
1029
|
+
const value = instanceNode[key];
|
|
1030
|
+
if (value !== undefined) documentState[key] = value;
|
|
1031
|
+
}
|
|
1032
|
+
const mergedSx = mergeNodeSx(graftedRoot.sx, instanceNode.sx);
|
|
1033
|
+
const merged = _extends({}, graftedRoot, {
|
|
1034
|
+
$id: instanceId,
|
|
1035
|
+
parentId: instanceNode.parentId
|
|
1036
|
+
}, documentState, mergedSx === undefined ? {} : {
|
|
1037
|
+
sx: mergedSx
|
|
1038
|
+
}, rootProps !== undefined || Object.keys(carried).length ? {
|
|
1039
|
+
props: _extends({}, rootProps, carried)
|
|
1040
|
+
} : {}, nodeClassName ? {
|
|
1041
|
+
className: nodeClassName
|
|
1042
|
+
} : {}, mergedInteractions.length ? {
|
|
1043
|
+
interactions: mergedInteractions
|
|
1044
|
+
} : {}, instanceNode.hidden ? {
|
|
1045
|
+
hidden: true
|
|
1046
|
+
} : {});
|
|
1047
|
+
for (const childId of Array.isArray(merged.nodes) ? merged.nodes : []){
|
|
1048
|
+
if (next[childId]) {
|
|
1049
|
+
next[childId] = _extends({}, next[childId], {
|
|
1050
|
+
parentId: instanceId
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
delete next[graftedRootId];
|
|
1055
|
+
next[instanceId] = merged;
|
|
1056
|
+
} else {
|
|
1057
|
+
/*
|
|
1058
|
+
* The root was pruned by its own visibility directive, so there is
|
|
1059
|
+
* nothing to take the instance's place. The instance stays as an empty
|
|
1060
|
+
* container rather than vanishing: its own hide directive has not been
|
|
1061
|
+
* evaluated yet, and removing a node the later passes still expect to
|
|
1062
|
+
* walk would strand its parent's child list.
|
|
1063
|
+
*/ next[instanceId] = _extends({}, instanceNode, {
|
|
1064
|
+
nodes: []
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
composed = next;
|
|
1069
|
+
}
|
|
1070
|
+
return composed;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Ids of every descendant of `rootId` reachable through `nodes` arrays —
|
|
1074
|
+
* the root itself excluded, unknown and repeated ids skipped, so a cycle
|
|
1075
|
+
* cannot hang the walk.
|
|
1076
|
+
*
|
|
1077
|
+
* Child lists are the only edges followed, never `parentId`. That is the
|
|
1078
|
+
* published renderer's own reach from the document root, which is why
|
|
1079
|
+
* `pageVideoObjects` asks this which Video nodes a page draws (AGL-2957).
|
|
1080
|
+
*/ export function collectDescendantIds(nodes, rootId) {
|
|
1081
|
+
const found = new Set();
|
|
1082
|
+
const root = nodes == null ? void 0 : nodes[rootId];
|
|
1083
|
+
const queue = Array.isArray(root == null ? void 0 : root.nodes) ? [
|
|
1084
|
+
...root.nodes
|
|
1085
|
+
] : [];
|
|
1086
|
+
while(queue.length){
|
|
1087
|
+
var _nodes_id;
|
|
1088
|
+
const id = queue.shift();
|
|
1089
|
+
if (found.has(id) || id === rootId || !nodes[id]) continue;
|
|
1090
|
+
found.add(id);
|
|
1091
|
+
const children = (_nodes_id = nodes[id]) == null ? void 0 : _nodes_id.nodes;
|
|
1092
|
+
if (Array.isArray(children)) queue.push(...children);
|
|
1093
|
+
}
|
|
1094
|
+
return found;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Materializes the instance at `instanceId` into a plain, freely editable
|
|
1098
|
+
* copy of what it was RENDERING (AGL-1314) — what "Detach from component"
|
|
1099
|
+
* does, and the inverse of {@link replaceSubtreeWithInstance}.
|
|
1100
|
+
*
|
|
1101
|
+
* Deliberately here, beside the graft, because "what the instance rendered"
|
|
1102
|
+
* is a question only {@link composeReusableComponentNodes} can answer. The
|
|
1103
|
+
* console used to copy `definition.nodes` verbatim, which is the whole bug:
|
|
1104
|
+
* the definition's leaves hold `{{prop.headline}}` TOKENS, not text, so a
|
|
1105
|
+
* detached hero rendered its own markers and the author's copy was gone.
|
|
1106
|
+
* A second, simpler materializer will always drift from the renderer —
|
|
1107
|
+
* so this one runs the renderer's own steps:
|
|
1108
|
+
*
|
|
1109
|
+
* - Declared props (AGL-1247) resolve through {@link applyDeclaredProps},
|
|
1110
|
+
* exactly as the graft does: the instance's override, else the
|
|
1111
|
+
* definition's default. Every string prop is walked,
|
|
1112
|
+
* so an image's `src` bakes to the bound media for free — the token is
|
|
1113
|
+
* substituted by name, not by which prop happens to hold it.
|
|
1114
|
+
* - The style overrides (AGL-1306 root, AGL-1332 per leaf) merge over the
|
|
1115
|
+
* matching definition node's own sx, so the copy keeps the look the page
|
|
1116
|
+
* was showing rather than snapping back to the component's base styling.
|
|
1117
|
+
* Every node is patched, not just the root: an instance re-coloured to a
|
|
1118
|
+
* white band with black copy must detach as a white band with black copy.
|
|
1119
|
+
* - Ids are FRESH (`createId`), never the `cmp__…` graft namespace: a
|
|
1120
|
+
* detached copy is an ordinary subtree, and leaving graft ids behind
|
|
1121
|
+
* would collide the next time an instance of the same definition
|
|
1122
|
+
* expanded here. Only the root keeps the instance's id, so the parent's
|
|
1123
|
+
* child list, the undo stack and the selection all stay valid.
|
|
1124
|
+
* - Anything hanging under the instance (a pre-grafted layout-chrome
|
|
1125
|
+
* subtree, AGL-1218) is dropped with it; the copy replaces the whole
|
|
1126
|
+
* thing.
|
|
1127
|
+
*
|
|
1128
|
+
* A missing instance, a node that is not an instance, or a definition
|
|
1129
|
+
* without a resolvable root returns `nodes` UNCHANGED — detach must never
|
|
1130
|
+
* be the thing that empties a screen. Inputs are never mutated.
|
|
1131
|
+
*/ export function detachInstanceSubtree(nodes, instanceId, definition, createId) {
|
|
1132
|
+
var _definition_nodes;
|
|
1133
|
+
const instanceNode = nodes == null ? void 0 : nodes[instanceId];
|
|
1134
|
+
if ((instanceNode == null ? void 0 : instanceNode.componentId) !== REUSABLE_INSTANCE_COMPONENT_ID) {
|
|
1135
|
+
return nodes;
|
|
1136
|
+
}
|
|
1137
|
+
const rootId = definition == null ? void 0 : definition.rootId;
|
|
1138
|
+
if (!rootId || !(definition == null ? void 0 : (_definition_nodes = definition.nodes) == null ? void 0 : _definition_nodes[rootId])) return nodes;
|
|
1139
|
+
// Fresh ids for everything but the root, which inherits the instance's.
|
|
1140
|
+
// `createId` is injected so this stays pure (and specs stay readable);
|
|
1141
|
+
// the loop re-rolls rather than trusting uniqueness, because a collision
|
|
1142
|
+
// here would silently overwrite an unrelated node on the page.
|
|
1143
|
+
const taken = new Set(Object.keys(nodes));
|
|
1144
|
+
const idMap = {
|
|
1145
|
+
[rootId]: instanceId
|
|
1146
|
+
};
|
|
1147
|
+
for (const defId of Object.keys(definition.nodes)){
|
|
1148
|
+
if (idMap[defId] != null) continue;
|
|
1149
|
+
let fresh = createId();
|
|
1150
|
+
for(let attempt = 0; (!fresh || taken.has(fresh)) && attempt < 10; attempt++){
|
|
1151
|
+
fresh = createId();
|
|
1152
|
+
}
|
|
1153
|
+
taken.add(fresh);
|
|
1154
|
+
idMap[defId] = fresh;
|
|
1155
|
+
}
|
|
1156
|
+
const styleOverrides = getInstanceStyleOverrides(instanceNode);
|
|
1157
|
+
const attrOverrides = getInstanceAttrOverrides(instanceNode);
|
|
1158
|
+
const copied = {};
|
|
1159
|
+
for (const [defId, defNode] of Object.entries(definition.nodes)){
|
|
1160
|
+
var _instanceNode_parentId, _idMap_defNode_parentId, _defNode_parentId, _instanceSxPatch, _instancePropsPatch;
|
|
1161
|
+
if (!defNode) continue;
|
|
1162
|
+
const newId = idMap[defId];
|
|
1163
|
+
copied[newId] = _extends({}, defNode, {
|
|
1164
|
+
$id: newId,
|
|
1165
|
+
parentId: defId === rootId ? (_instanceNode_parentId = instanceNode.parentId) != null ? _instanceNode_parentId : null : defNode.parentId != null ? (_idMap_defNode_parentId = idMap[defNode.parentId]) != null ? _idMap_defNode_parentId : null : (_defNode_parentId = defNode.parentId) != null ? _defNode_parentId : null
|
|
1166
|
+
}, Array.isArray(defNode.nodes) && {
|
|
1167
|
+
nodes: defNode.nodes.map((childId)=>{
|
|
1168
|
+
var _idMap_childId;
|
|
1169
|
+
return typeof childId === 'string' ? (_idMap_childId = idMap[childId]) != null ? _idMap_childId : childId : childId;
|
|
1170
|
+
})
|
|
1171
|
+
}, (_instanceSxPatch = instanceSxPatch(defNode.sx, styleOverrides, defId, rootId)) != null ? _instanceSxPatch : {}, (_instancePropsPatch = instancePropsPatch(defNode.props, attrOverrides, defId, rootId)) != null ? _instancePropsPatch : {});
|
|
1172
|
+
}
|
|
1173
|
+
const doomed = collectDescendantIds(nodes, instanceId);
|
|
1174
|
+
const next = {};
|
|
1175
|
+
for (const [id, node] of Object.entries(nodes)){
|
|
1176
|
+
if (id === instanceId || doomed.has(id)) continue;
|
|
1177
|
+
next[id] = node;
|
|
1178
|
+
}
|
|
1179
|
+
// Detach must materialize what the instance was RENDERING, so the parts
|
|
1180
|
+
// this page hid (AGL-1314) are absent from the copy too — a detached hero
|
|
1181
|
+
// that grew its mockup back is the same class of bug as one that rendered
|
|
1182
|
+
// `{{prop.headline}}`.
|
|
1183
|
+
return Object.assign(next, applyDeclaredProps(copied, definition.props, instancePropValues(instanceNode.props), instanceId));
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* The definition a subtree becomes when it is promoted (AGL-2908): the
|
|
1187
|
+
* element at `rootId` and everything under it, as a component document's own
|
|
1188
|
+
* `nodes` map.
|
|
1189
|
+
*
|
|
1190
|
+
* The other half of "Save as reusable component", beside
|
|
1191
|
+
* {@link replaceSubtreeWithInstance}: this one says what the new document
|
|
1192
|
+
* holds, that one says what the promoting document keeps. Both are here so
|
|
1193
|
+
* neither can drift from what the graft expects to read back.
|
|
1194
|
+
*
|
|
1195
|
+
* - The promoted root's `parentId` is dropped. In its old document it hung
|
|
1196
|
+
* from a section; in its own it IS the document, and a definition whose
|
|
1197
|
+
* root still points at a parent it no longer has grafts nothing.
|
|
1198
|
+
* - Editor-only fields go: `componentSchema` is the palette's own object and
|
|
1199
|
+
* `resolvedProps` is a render of the props beside them, so storing either
|
|
1200
|
+
* writes a snapshot of the editor into a document the renderer reads.
|
|
1201
|
+
* - Unknown `rootId` gives an empty map, and the input is never mutated.
|
|
1202
|
+
*
|
|
1203
|
+
* Child lists are the only edges followed, so an element the subtree does not
|
|
1204
|
+
* reach is not carried along even if it claims the root as its parent.
|
|
1205
|
+
*/ export function reusableComponentDefinitionFrom(nodes, rootId) {
|
|
1206
|
+
const root = nodes == null ? void 0 : nodes[rootId];
|
|
1207
|
+
if (!root) return {};
|
|
1208
|
+
const definition = {};
|
|
1209
|
+
for (const id of [
|
|
1210
|
+
rootId,
|
|
1211
|
+
...collectDescendantIds(nodes, rootId)
|
|
1212
|
+
]){
|
|
1213
|
+
const node = nodes[id];
|
|
1214
|
+
if (!node) continue;
|
|
1215
|
+
const { componentSchema: _schema, resolvedProps: _resolved } = node, stored = _object_without_properties_loose(node, [
|
|
1216
|
+
"componentSchema",
|
|
1217
|
+
"resolvedProps"
|
|
1218
|
+
]);
|
|
1219
|
+
definition[id] = id === rootId ? _extends({}, stored, {
|
|
1220
|
+
parentId: null
|
|
1221
|
+
}) : stored;
|
|
1222
|
+
}
|
|
1223
|
+
return definition;
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Replaces the subtree rooted at `rootId` with an instance of `definitionId`
|
|
1227
|
+
* (AGL-1193) — what "Save as reusable component" does to the tree it was
|
|
1228
|
+
* promoted from.
|
|
1229
|
+
*
|
|
1230
|
+
* Without this the promoting document keeps an inline *copy*: the one place
|
|
1231
|
+
* guaranteed never to track the component it created, silently. Deliberately
|
|
1232
|
+
* in this file so the swap and {@link composeReusableComponentNodes} cannot
|
|
1233
|
+
* drift about what an instance node looks like.
|
|
1234
|
+
*
|
|
1235
|
+
* - The instance keeps the promoted root's `$id` and `parentId`, so the
|
|
1236
|
+
* parent's child list, the undo stack and the current selection all stay
|
|
1237
|
+
* valid — the mirror of the detach path, which reuses the instance id.
|
|
1238
|
+
* - Every descendant is dropped; its content now lives in the definition.
|
|
1239
|
+
* - `displayName` rides along as a prop purely so the editor placeholder can
|
|
1240
|
+
* name what it stands for (definitions are not grafted into the canvas).
|
|
1241
|
+
* - Unknown `rootId` is a no-op, and the input is never mutated.
|
|
1242
|
+
*/ export function replaceSubtreeWithInstance(nodes, rootId, definitionId, displayName) {
|
|
1243
|
+
var _root_parentId;
|
|
1244
|
+
const root = nodes == null ? void 0 : nodes[rootId];
|
|
1245
|
+
if (!root || !definitionId) return nodes;
|
|
1246
|
+
// Descendants only — the root is replaced, not removed.
|
|
1247
|
+
const doomed = collectDescendantIds(nodes, rootId);
|
|
1248
|
+
const next = {};
|
|
1249
|
+
for (const [id, node] of Object.entries(nodes)){
|
|
1250
|
+
if (!doomed.has(id)) next[id] = node;
|
|
1251
|
+
}
|
|
1252
|
+
next[rootId] = {
|
|
1253
|
+
$id: rootId,
|
|
1254
|
+
parentId: (_root_parentId = root.parentId) != null ? _root_parentId : null,
|
|
1255
|
+
componentId: REUSABLE_INSTANCE_COMPONENT_ID,
|
|
1256
|
+
pluginId: 'mui',
|
|
1257
|
+
props: _extends({
|
|
1258
|
+
refId: definitionId
|
|
1259
|
+
}, displayName && {
|
|
1260
|
+
name: displayName
|
|
1261
|
+
}),
|
|
1262
|
+
nodes: []
|
|
1263
|
+
};
|
|
1264
|
+
return next;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* The icon path an instance node should be drawn with (AGL-1193), or
|
|
1268
|
+
* `undefined` when the node is not an instance, its definition is unknown,
|
|
1269
|
+
* or that definition chose no icon — every one of which means "fall back to
|
|
1270
|
+
* the component schema's own glyph".
|
|
1271
|
+
*
|
|
1272
|
+
* The visual half of `getNodeLabelShort`: an instance stands for one
|
|
1273
|
+
* specific component, so a hierarchy of promoted sections drawn with one
|
|
1274
|
+
* repeated package glyph tells the author nothing. Unlike the label, the
|
|
1275
|
+
* icon is NOT denormalized onto the instance — it is read live off the
|
|
1276
|
+
* definition, so changing a component's icon updates every instance already
|
|
1277
|
+
* placed instead of only the ones inserted afterwards.
|
|
1278
|
+
*
|
|
1279
|
+
* Deliberately here rather than in the canvas manager: this file owns what
|
|
1280
|
+
* an instance node looks like, and a second reader that disagreed would draw
|
|
1281
|
+
* definition icons on nodes the graft does not treat as instances.
|
|
1282
|
+
*
|
|
1283
|
+
* Returns only the stored `iconPath`. Resolving `iconId` would need the
|
|
1284
|
+
* ~2.9 MB icon catalog, which render surfaces never load — and the lookup
|
|
1285
|
+
* that "helpfully" substitutes a default is what made every icon a "help"
|
|
1286
|
+
* glyph in AGL-1212.
|
|
1287
|
+
*/ export function resolveInstanceIconPath(node, definitionsById) {
|
|
1288
|
+
var _node_props, _definitionsById_refId_icon, _definitionsById_refId;
|
|
1289
|
+
if (!node || !definitionsById) return undefined;
|
|
1290
|
+
if (node.componentId !== REUSABLE_INSTANCE_COMPONENT_ID) return undefined;
|
|
1291
|
+
const refId = (_node_props = node.props) == null ? void 0 : _node_props.refId;
|
|
1292
|
+
if (typeof refId !== 'string' || !refId) return undefined;
|
|
1293
|
+
return ((_definitionsById_refId = definitionsById[refId]) == null ? void 0 : (_definitionsById_refId_icon = _definitionsById_refId.icon) == null ? void 0 : _definitionsById_refId_icon.iconPath) || undefined;
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Whether a node map contains an instance of `definitionId` (AGL-703).
|
|
1297
|
+
*
|
|
1298
|
+
* The inverse of the graft above, and deliberately in the same file: a
|
|
1299
|
+
* "Used by" card that disagreed with {@link composeReusableComponentNodes}
|
|
1300
|
+
* about what counts as a reference would report "used nowhere" for
|
|
1301
|
+
* something the renderer does expand, which is an invitation to delete it.
|
|
1302
|
+
*
|
|
1303
|
+
* Scans ONLY direct instances. Callers wanting transitive usage must scan
|
|
1304
|
+
* definitions too — a definition may nest instances of other definitions,
|
|
1305
|
+
* so "used by no screen" does not mean "used by nothing".
|
|
1306
|
+
*/ export function nodesReferenceComponent(nodes, definitionId) {
|
|
1307
|
+
if (!nodes || !definitionId) return false;
|
|
1308
|
+
return Object.values(nodes).some((node)=>{
|
|
1309
|
+
var _node_props;
|
|
1310
|
+
return (node == null ? void 0 : node.componentId) === REUSABLE_INSTANCE_COMPONENT_ID && ((_node_props = node.props) == null ? void 0 : _node_props.refId) === definitionId;
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Every definition id a node map renders, DIRECTLY or through another
|
|
1315
|
+
* definition (AGL-1898).
|
|
1316
|
+
*
|
|
1317
|
+
* {@link nodesReferenceComponent} answers the same question for one id and
|
|
1318
|
+
* scans direct instances only — its own doc says a caller wanting transitive
|
|
1319
|
+
* usage "must scan definitions too". This is that scan, kept beside the
|
|
1320
|
+
* graft for the same reason: a caller that disagreed with
|
|
1321
|
+
* {@link composeReusableComponentNodes} about what a document references
|
|
1322
|
+
* would be wrong about exactly the nested case the canvas draws.
|
|
1323
|
+
*
|
|
1324
|
+
* Why it exists here rather than at a call site. A screen's canvas re-grafts
|
|
1325
|
+
* when the host's definitions map changes, which is the whole of AGL-1898's
|
|
1326
|
+
* phase-2 transport — but that map changes whenever ANY component in the
|
|
1327
|
+
* host is published, most of them not on this page. Deciding whether a
|
|
1328
|
+
* change is this document's business needs the transitive set, because the
|
|
1329
|
+
* usual shared component is reached through a nav or a card rather than
|
|
1330
|
+
* placed on the screen itself.
|
|
1331
|
+
*
|
|
1332
|
+
* - Unresolvable ids are INCLUDED. A screen referencing a definition that is
|
|
1333
|
+
* unpublished, deleted, or simply not in the map yet still references it;
|
|
1334
|
+
* a caller filtering to "what can expand" can intersect with its own map,
|
|
1335
|
+
* whereas an id dropped here cannot be recovered.
|
|
1336
|
+
* - Cycles terminate: an id already collected is never re-walked, which
|
|
1337
|
+
* bounds a self-referencing definition the same way
|
|
1338
|
+
* {@link MAX_COMPONENT_DEPTH} bounds the graft.
|
|
1339
|
+
* - Traversal is over the definition's stored `nodes`, NOT a composed tree,
|
|
1340
|
+
* so it costs nothing and cannot be thrown off by grafted ids.
|
|
1341
|
+
*/ export function collectReferencedComponentIds(nodes, definitionsById) {
|
|
1342
|
+
const found = new Set();
|
|
1343
|
+
const directRefIds = (source)=>{
|
|
1344
|
+
const ids = [];
|
|
1345
|
+
for (const node of Object.values(source != null ? source : {})){
|
|
1346
|
+
var _node_props;
|
|
1347
|
+
if ((node == null ? void 0 : node.componentId) !== REUSABLE_INSTANCE_COMPONENT_ID) continue;
|
|
1348
|
+
const refId = (_node_props = node.props) == null ? void 0 : _node_props.refId;
|
|
1349
|
+
if (typeof refId === 'string' && refId) ids.push(refId);
|
|
1350
|
+
}
|
|
1351
|
+
return ids;
|
|
1352
|
+
};
|
|
1353
|
+
const queue = directRefIds(nodes);
|
|
1354
|
+
while(queue.length){
|
|
1355
|
+
const refId = queue.shift();
|
|
1356
|
+
if (found.has(refId)) continue;
|
|
1357
|
+
found.add(refId);
|
|
1358
|
+
const definition = definitionsById == null ? void 0 : definitionsById[refId];
|
|
1359
|
+
if (!(definition == null ? void 0 : definition.nodes)) continue;
|
|
1360
|
+
queue.push(...directRefIds(definition.nodes));
|
|
1361
|
+
}
|
|
1362
|
+
return found;
|
|
1363
|
+
}
|
|
1364
|
+
export default composeReusableComponentNodes;
|
|
1365
|
+
|
|
1366
|
+
//# sourceMappingURL=compose-reusable-components.js.map
|