@aglyn/aglyn 1.0.0-beta.220 → 1.0.0-beta.222

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.
Files changed (358) hide show
  1. package/package.json +15 -11
  2. package/src/lib/app-utils/agent-openapi.js +1 -1
  3. package/src/lib/app-utils/agent-openapi.js.map +1 -1
  4. package/src/lib/app-utils/analytics-events.d.ts +3 -2
  5. package/src/lib/app-utils/analytics-events.js +3 -2
  6. package/src/lib/app-utils/analytics-events.js.map +1 -1
  7. package/src/lib/app-utils/api-plugins.d.ts +30 -0
  8. package/src/lib/app-utils/api-plugins.js +24 -1
  9. package/src/lib/app-utils/api-plugins.js.map +1 -1
  10. package/src/lib/app-utils/author-html.d.ts +1 -1
  11. package/src/lib/app-utils/author-html.js.map +1 -1
  12. package/src/lib/app-utils/bandwidth-cap.d.ts +12 -1
  13. package/src/lib/app-utils/bandwidth-cap.js +17 -1
  14. package/src/lib/app-utils/bandwidth-cap.js.map +1 -1
  15. package/src/lib/app-utils/compose-reusable-components.d.ts +19 -0
  16. package/src/lib/app-utils/compose-reusable-components.js +116 -26
  17. package/src/lib/app-utils/compose-reusable-components.js.map +1 -1
  18. package/src/lib/app-utils/console-routes.d.ts +4 -0
  19. package/src/lib/app-utils/console-routes.js +3 -0
  20. package/src/lib/app-utils/console-routes.js.map +1 -1
  21. package/src/lib/app-utils/contacts.d.ts +71 -0
  22. package/src/lib/app-utils/contacts.js +55 -0
  23. package/src/lib/app-utils/contacts.js.map +1 -1
  24. package/src/lib/app-utils/contexts.d.ts +1 -0
  25. package/src/lib/app-utils/contexts.js +1 -0
  26. package/src/lib/app-utils/contexts.js.map +1 -1
  27. package/src/lib/app-utils/crm-email-templates.js +21 -4
  28. package/src/lib/app-utils/crm-email-templates.js.map +1 -1
  29. package/src/lib/app-utils/crm-kinds.d.ts +2 -0
  30. package/src/lib/app-utils/crm-kinds.js +1 -0
  31. package/src/lib/app-utils/crm-kinds.js.map +1 -1
  32. package/src/lib/app-utils/crm.d.ts +1199 -67
  33. package/src/lib/app-utils/crm.js +1951 -310
  34. package/src/lib/app-utils/crm.js.map +1 -1
  35. package/src/lib/app-utils/csv-import.d.ts +10 -38
  36. package/src/lib/app-utils/csv-import.js +17 -42
  37. package/src/lib/app-utils/csv-import.js.map +1 -1
  38. package/src/lib/app-utils/csv.d.ts +32 -11
  39. package/src/lib/app-utils/csv.js +43 -5
  40. package/src/lib/app-utils/csv.js.map +1 -1
  41. package/src/lib/app-utils/default-site.d.ts +116 -0
  42. package/src/lib/app-utils/default-site.js +1024 -0
  43. package/src/lib/app-utils/default-site.js.map +1 -0
  44. package/src/lib/app-utils/docs-help.generated.d.ts +23 -23
  45. package/src/lib/app-utils/docs-help.generated.js +47 -10
  46. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  47. package/src/lib/app-utils/docs-index.generated.js +746 -151
  48. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  49. package/src/lib/app-utils/draft-placeholders.d.ts +76 -0
  50. package/src/lib/app-utils/draft-placeholders.js +115 -0
  51. package/src/lib/app-utils/draft-placeholders.js.map +1 -0
  52. package/src/lib/app-utils/entity-picker-context.d.ts +19 -15
  53. package/src/lib/app-utils/entity-picker-context.js +4 -4
  54. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  55. package/src/lib/app-utils/expand-repeatables.d.ts +66 -10
  56. package/src/lib/app-utils/expand-repeatables.js +88 -14
  57. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  58. package/src/lib/app-utils/forms.d.ts +33 -22
  59. package/src/lib/app-utils/forms.js +47 -28
  60. package/src/lib/app-utils/forms.js.map +1 -1
  61. package/src/lib/app-utils/full-use-cost.d.ts +277 -0
  62. package/src/lib/app-utils/full-use-cost.js +421 -0
  63. package/src/lib/app-utils/full-use-cost.js.map +1 -0
  64. package/src/lib/app-utils/health-report.js +33 -0
  65. package/src/lib/app-utils/health-report.js.map +1 -1
  66. package/src/lib/app-utils/leaving-notice.d.ts +96 -0
  67. package/src/lib/app-utils/leaving-notice.js +157 -0
  68. package/src/lib/app-utils/leaving-notice.js.map +1 -0
  69. package/src/lib/app-utils/llms-txt.d.ts +20 -0
  70. package/src/lib/app-utils/llms-txt.js +7 -1
  71. package/src/lib/app-utils/llms-txt.js.map +1 -1
  72. package/src/lib/app-utils/media-asset-facts.d.ts +16 -1
  73. package/src/lib/app-utils/media-asset-facts.js +40 -13
  74. package/src/lib/app-utils/media-asset-facts.js.map +1 -1
  75. package/src/lib/app-utils/media-bandwidth.d.ts +52 -0
  76. package/src/lib/app-utils/media-bandwidth.js +94 -0
  77. package/src/lib/app-utils/media-bandwidth.js.map +1 -0
  78. package/src/lib/app-utils/media-ref.d.ts +241 -33
  79. package/src/lib/app-utils/media-ref.js +324 -43
  80. package/src/lib/app-utils/media-ref.js.map +1 -1
  81. package/src/lib/app-utils/media-src.d.ts +8 -8
  82. package/src/lib/app-utils/media-src.js +27 -11
  83. package/src/lib/app-utils/media-src.js.map +1 -1
  84. package/src/lib/app-utils/media-takedown-reach.d.ts +4 -1
  85. package/src/lib/app-utils/media-takedown-reach.js +6 -3
  86. package/src/lib/app-utils/media-takedown-reach.js.map +1 -1
  87. package/src/lib/app-utils/notifications.d.ts +1 -1
  88. package/src/lib/app-utils/notifications.js +2 -0
  89. package/src/lib/app-utils/notifications.js.map +1 -1
  90. package/src/lib/app-utils/operator-alerts.js +17 -0
  91. package/src/lib/app-utils/operator-alerts.js.map +1 -1
  92. package/src/lib/app-utils/organizations.d.ts +51 -2
  93. package/src/lib/app-utils/organizations.js +56 -3
  94. package/src/lib/app-utils/organizations.js.map +1 -1
  95. package/src/lib/app-utils/page-record-sources.d.ts +87 -0
  96. package/src/lib/app-utils/page-record-sources.js +53 -0
  97. package/src/lib/app-utils/page-record-sources.js.map +1 -0
  98. package/src/lib/app-utils/paid-media-source.d.ts +3 -7
  99. package/src/lib/app-utils/paid-media-source.js +5 -19
  100. package/src/lib/app-utils/paid-media-source.js.map +1 -1
  101. package/src/lib/app-utils/person-erasure.d.ts +5 -2
  102. package/src/lib/app-utils/person-erasure.js.map +1 -1
  103. package/src/lib/app-utils/picklists.d.ts +187 -0
  104. package/src/lib/app-utils/picklists.js +320 -0
  105. package/src/lib/app-utils/picklists.js.map +1 -0
  106. package/src/lib/app-utils/plan-entitlements.d.ts +220 -50
  107. package/src/lib/app-utils/plan-entitlements.js +309 -115
  108. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  109. package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
  110. package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
  111. package/src/lib/app-utils/release-flags.d.ts +1 -1
  112. package/src/lib/app-utils/release-flags.js +11 -0
  113. package/src/lib/app-utils/release-flags.js.map +1 -1
  114. package/src/lib/app-utils/rendered-widths.d.ts +121 -0
  115. package/src/lib/app-utils/rendered-widths.js +211 -0
  116. package/src/lib/app-utils/rendered-widths.js.map +1 -0
  117. package/src/lib/app-utils/repeat-sources.d.ts +2 -1
  118. package/src/lib/app-utils/repeat-sources.js.map +1 -1
  119. package/src/lib/app-utils/screen-link-context-value.d.ts +7 -0
  120. package/src/lib/app-utils/screen-link-context-value.js.map +1 -1
  121. package/src/lib/app-utils/screen-link-context.js +14 -2
  122. package/src/lib/app-utils/screen-link-context.js.map +1 -1
  123. package/src/lib/app-utils/screen-route.d.ts +157 -36
  124. package/src/lib/app-utils/screen-route.js +191 -41
  125. package/src/lib/app-utils/screen-route.js.map +1 -1
  126. package/src/lib/app-utils/seo-audit.d.ts +11 -1
  127. package/src/lib/app-utils/seo-audit.js +33 -13
  128. package/src/lib/app-utils/seo-audit.js.map +1 -1
  129. package/src/lib/app-utils/seo-keywords.d.ts +11 -0
  130. package/src/lib/app-utils/seo-keywords.js +19 -5
  131. package/src/lib/app-utils/seo-keywords.js.map +1 -1
  132. package/src/lib/app-utils/seo-page-facts.d.ts +47 -4
  133. package/src/lib/app-utils/seo-page-facts.js +136 -31
  134. package/src/lib/app-utils/seo-page-facts.js.map +1 -1
  135. package/src/lib/app-utils/seo-site-scan.d.ts +42 -4
  136. package/src/lib/app-utils/seo-site-scan.js +113 -12
  137. package/src/lib/app-utils/seo-site-scan.js.map +1 -1
  138. package/src/lib/app-utils/server.d.ts +5 -4
  139. package/src/lib/app-utils/server.js +14 -5
  140. package/src/lib/app-utils/server.js.map +1 -1
  141. package/src/lib/app-utils/site-icon-set.d.ts +195 -0
  142. package/src/lib/app-utils/site-icon-set.js +351 -0
  143. package/src/lib/app-utils/site-icon-set.js.map +1 -0
  144. package/src/lib/app-utils/site-interactions.d.ts +101 -4
  145. package/src/lib/app-utils/site-interactions.js +120 -4
  146. package/src/lib/app-utils/site-interactions.js.map +1 -1
  147. package/src/lib/app-utils/starter-template-nodes.d.ts +7 -0
  148. package/src/lib/app-utils/starter-template-nodes.js +3 -0
  149. package/src/lib/app-utils/starter-template-nodes.js.map +1 -1
  150. package/src/lib/app-utils/starter-templates.d.ts +5 -19
  151. package/src/lib/app-utils/starter-templates.js +5 -49
  152. package/src/lib/app-utils/starter-templates.js.map +1 -1
  153. package/src/lib/app-utils/transfer-launcher-context.d.ts +136 -0
  154. package/src/lib/app-utils/transfer-launcher-context.js +23 -0
  155. package/src/lib/app-utils/transfer-launcher-context.js.map +1 -0
  156. package/src/lib/app-utils/transfer-resume-import.d.ts +39 -0
  157. package/src/lib/app-utils/transfer-resume-import.js +128 -0
  158. package/src/lib/app-utils/transfer-resume-import.js.map +1 -0
  159. package/src/lib/app-utils/upgrade-proposal.d.ts +66 -0
  160. package/src/lib/app-utils/upgrade-proposal.js +95 -0
  161. package/src/lib/app-utils/upgrade-proposal.js.map +1 -0
  162. package/src/lib/app-utils/utc-month.d.ts +33 -0
  163. package/src/lib/app-utils/utc-month.js +35 -0
  164. package/src/lib/app-utils/utc-month.js.map +1 -0
  165. package/src/lib/app-utils/visitor-record-ceiling.d.ts +4 -4
  166. package/src/lib/app-utils/visitor-record-ceiling.js +4 -4
  167. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
  168. package/src/lib/app-utils/wire-nodes.d.ts +39 -19
  169. package/src/lib/app-utils/wire-nodes.js +120 -34
  170. package/src/lib/app-utils/wire-nodes.js.map +1 -1
  171. package/src/lib/data-transfer/access.d.ts +74 -0
  172. package/src/lib/data-transfer/access.js +93 -0
  173. package/src/lib/data-transfer/access.js.map +1 -0
  174. package/src/lib/data-transfer/derive.d.ts +246 -0
  175. package/src/lib/data-transfer/derive.js +1007 -0
  176. package/src/lib/data-transfer/derive.js.map +1 -0
  177. package/src/lib/data-transfer/export-file.d.ts +46 -0
  178. package/src/lib/data-transfer/export-file.js +146 -0
  179. package/src/lib/data-transfer/export-file.js.map +1 -0
  180. package/src/lib/data-transfer/field-catalog.d.ts +134 -0
  181. package/src/lib/data-transfer/field-catalog.js +278 -0
  182. package/src/lib/data-transfer/field-catalog.js.map +1 -0
  183. package/src/lib/data-transfer/header-match.d.ts +129 -0
  184. package/src/lib/data-transfer/header-match.js +367 -0
  185. package/src/lib/data-transfer/header-match.js.map +1 -0
  186. package/src/lib/data-transfer/index.d.ts +34 -0
  187. package/src/lib/data-transfer/index.js +40 -0
  188. package/src/lib/data-transfer/index.js.map +1 -0
  189. package/src/lib/data-transfer/job.d.ts +190 -0
  190. package/src/lib/data-transfer/job.js +229 -0
  191. package/src/lib/data-transfer/job.js.map +1 -0
  192. package/src/lib/data-transfer/lookup.d.ts +45 -0
  193. package/src/lib/data-transfer/lookup.js +71 -0
  194. package/src/lib/data-transfer/lookup.js.map +1 -0
  195. package/src/lib/data-transfer/match.d.ts +99 -0
  196. package/src/lib/data-transfer/match.js +244 -0
  197. package/src/lib/data-transfer/match.js.map +1 -0
  198. package/src/lib/data-transfer/package-plan.d.ts +205 -0
  199. package/src/lib/data-transfer/package-plan.js +475 -0
  200. package/src/lib/data-transfer/package-plan.js.map +1 -0
  201. package/src/lib/data-transfer/package.d.ts +181 -0
  202. package/src/lib/data-transfer/package.js +426 -0
  203. package/src/lib/data-transfer/package.js.map +1 -0
  204. package/src/lib/data-transfer/picklist-map.d.ts +139 -0
  205. package/src/lib/data-transfer/picklist-map.js +271 -0
  206. package/src/lib/data-transfer/picklist-map.js.map +1 -0
  207. package/src/lib/data-transfer/plan.d.ts +176 -0
  208. package/src/lib/data-transfer/plan.js +451 -0
  209. package/src/lib/data-transfer/plan.js.map +1 -0
  210. package/src/lib/data-transfer/policy.d.ts +170 -0
  211. package/src/lib/data-transfer/policy.js +378 -0
  212. package/src/lib/data-transfer/policy.js.map +1 -0
  213. package/src/lib/data-transfer/resource.d.ts +211 -0
  214. package/src/lib/data-transfer/resource.js +241 -0
  215. package/src/lib/data-transfer/resource.js.map +1 -0
  216. package/src/lib/data-transfer/review.d.ts +70 -0
  217. package/src/lib/data-transfer/review.js +233 -0
  218. package/src/lib/data-transfer/review.js.map +1 -0
  219. package/src/lib/data-transfer/similarity.d.ts +40 -0
  220. package/src/lib/data-transfer/similarity.js +106 -0
  221. package/src/lib/data-transfer/similarity.js.map +1 -0
  222. package/src/lib/data-transfer/site-package.d.ts +365 -0
  223. package/src/lib/data-transfer/site-package.js +1077 -0
  224. package/src/lib/data-transfer/site-package.js.map +1 -0
  225. package/src/lib/data-transfer/source.d.ts +74 -0
  226. package/src/lib/data-transfer/source.js +293 -0
  227. package/src/lib/data-transfer/source.js.map +1 -0
  228. package/src/lib/data-transfer/transfer-api.d.ts +898 -0
  229. package/src/lib/data-transfer/transfer-api.js +107 -0
  230. package/src/lib/data-transfer/transfer-api.js.map +1 -0
  231. package/src/lib/foundation/definitions/org-billing.types.d.ts +31 -0
  232. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  233. package/src/lib/foundation/definitions/organization.types.d.ts +42 -1
  234. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  235. package/src/lib/foundation/definitions/platform.types.d.ts +6 -4
  236. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  237. package/src/lib/foundation/index.d.ts +1 -1
  238. package/src/lib/foundation/index.js.map +1 -1
  239. package/src/lib/plugin-manager/feature-plugins.d.ts +91 -2
  240. package/src/lib/plugin-manager/feature-plugins.js +48 -3
  241. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  242. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +56 -0
  243. package/src/lib/plugin-manager/first-party-plugins.generated.js +1132 -27
  244. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  245. package/src/lib/plugin-manager/index.d.ts +0 -1
  246. package/src/lib/plugin-manager/index.js +0 -1
  247. package/src/lib/plugin-manager/index.js.map +1 -1
  248. package/src/lib/plugin-manager/interaction-recipes.d.ts +142 -0
  249. package/src/lib/plugin-manager/interaction-recipes.js +104 -0
  250. package/src/lib/plugin-manager/interaction-recipes.js.map +1 -0
  251. package/src/lib/plugin-manager/interaction-step-checks.d.ts +66 -0
  252. package/src/lib/plugin-manager/interaction-step-checks.js +86 -0
  253. package/src/lib/plugin-manager/interaction-step-checks.js.map +1 -0
  254. package/src/lib/plugin-manager/plugin-artifact-types.d.ts +235 -0
  255. package/src/lib/plugin-manager/plugin-artifact-types.js +99 -0
  256. package/src/lib/plugin-manager/plugin-artifact-types.js.map +1 -0
  257. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +8 -0
  258. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
  259. package/src/lib/plugin-manager/plugin-conversion-credit.d.ts +216 -0
  260. package/src/lib/plugin-manager/plugin-conversion-credit.js +91 -0
  261. package/src/lib/plugin-manager/plugin-conversion-credit.js.map +1 -0
  262. package/src/lib/plugin-manager/plugin-entity-pickers.d.ts +83 -0
  263. package/src/lib/plugin-manager/plugin-entity-pickers.js +87 -0
  264. package/src/lib/plugin-manager/plugin-entity-pickers.js.map +1 -0
  265. package/src/lib/plugin-manager/plugin-host-resources.d.ts +6 -0
  266. package/src/lib/plugin-manager/plugin-host-resources.js +6 -1
  267. package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -1
  268. package/src/lib/plugin-manager/plugin-intake-gates.d.ts +75 -0
  269. package/src/lib/plugin-manager/plugin-intake-gates.js +49 -0
  270. package/src/lib/plugin-manager/plugin-intake-gates.js.map +1 -0
  271. package/src/lib/plugin-manager/plugin-jobs.d.ts +5 -5
  272. package/src/lib/plugin-manager/plugin-jobs.js +7 -7
  273. package/src/lib/plugin-manager/plugin-jobs.js.map +1 -1
  274. package/src/lib/plugin-manager/plugin-live-paths.d.ts +70 -0
  275. package/src/lib/plugin-manager/plugin-live-paths.js +66 -0
  276. package/src/lib/plugin-manager/plugin-live-paths.js.map +1 -0
  277. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +3 -2
  278. package/src/lib/plugin-manager/plugin-org-erasure.js +30 -5
  279. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
  280. package/src/lib/plugin-manager/plugin-person-erasure.d.ts +68 -9
  281. package/src/lib/plugin-manager/plugin-person-erasure.js +196 -51
  282. package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -1
  283. package/src/lib/plugin-manager/plugin-person-records.d.ts +275 -0
  284. package/src/lib/plugin-manager/plugin-person-records.js +107 -0
  285. package/src/lib/plugin-manager/plugin-person-records.js.map +1 -0
  286. package/src/lib/plugin-manager/plugin-record-counts.d.ts +76 -0
  287. package/src/lib/plugin-manager/plugin-record-counts.js +49 -0
  288. package/src/lib/plugin-manager/plugin-record-counts.js.map +1 -0
  289. package/src/lib/plugin-manager/plugin-record-email-state.d.ts +26 -0
  290. package/src/lib/plugin-manager/plugin-record-email-state.js +16 -0
  291. package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
  292. package/src/lib/plugin-manager/plugin-record-index.d.ts +10 -0
  293. package/src/lib/plugin-manager/plugin-record-index.js.map +1 -1
  294. package/src/lib/plugin-manager/plugin-record-lists.d.ts +86 -6
  295. package/src/lib/plugin-manager/plugin-record-lists.js +42 -5
  296. package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -1
  297. package/src/lib/plugin-manager/plugin-record-origin.d.ts +79 -0
  298. package/src/lib/plugin-manager/plugin-record-origin.js +46 -0
  299. package/src/lib/plugin-manager/plugin-record-origin.js.map +1 -0
  300. package/src/lib/plugin-manager/plugin-record-pages.d.ts +37 -0
  301. package/src/lib/plugin-manager/plugin-record-pages.js +52 -0
  302. package/src/lib/plugin-manager/plugin-record-pages.js.map +1 -0
  303. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +60 -0
  304. package/src/lib/plugin-manager/plugin-record-timeline.js +16 -0
  305. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
  306. package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +5 -5
  307. package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -1
  308. package/src/lib/plugin-manager/plugin-revocations.d.ts +64 -0
  309. package/src/lib/plugin-manager/plugin-revocations.js +47 -0
  310. package/src/lib/plugin-manager/plugin-revocations.js.map +1 -0
  311. package/src/lib/plugin-manager/plugin-send-tallies.d.ts +69 -0
  312. package/src/lib/plugin-manager/plugin-send-tallies.js +45 -0
  313. package/src/lib/plugin-manager/plugin-send-tallies.js.map +1 -0
  314. package/src/lib/plugin-manager/plugin-server-steps.d.ts +170 -0
  315. package/src/lib/plugin-manager/plugin-server-steps.js +116 -0
  316. package/src/lib/plugin-manager/plugin-server-steps.js.map +1 -0
  317. package/src/lib/plugin-manager/plugin-site-bundle.d.ts +40 -0
  318. package/src/lib/plugin-manager/plugin-site-bundle.js +4 -0
  319. package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -1
  320. package/src/lib/plugin-manager/plugin-site-export.d.ts +57 -1
  321. package/src/lib/plugin-manager/plugin-site-export.js +23 -10
  322. package/src/lib/plugin-manager/plugin-site-export.js.map +1 -1
  323. package/src/lib/plugin-manager/plugin-sitemap-readers.d.ts +146 -0
  324. package/src/lib/plugin-manager/plugin-sitemap-readers.js +110 -0
  325. package/src/lib/plugin-manager/plugin-sitemap-readers.js.map +1 -0
  326. package/src/lib/plugin-manager/plugin-transfer-resources.d.ts +714 -0
  327. package/src/lib/plugin-manager/plugin-transfer-resources.js +443 -0
  328. package/src/lib/plugin-manager/plugin-transfer-resources.js.map +1 -0
  329. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +54 -5
  330. package/src/lib/plugin-manager/plugin-usage-axes.js +11 -3
  331. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -1
  332. package/src/lib/plugin-manager/plugin-user-erasure.js +9 -1
  333. package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -1
  334. package/src/lib/plugin-manager/plugin-visitor-doors.d.ts +104 -0
  335. package/src/lib/plugin-manager/plugin-visitor-doors.js +108 -0
  336. package/src/lib/plugin-manager/plugin-visitor-doors.js.map +1 -0
  337. package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
  338. package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
  339. package/src/lib/plugin-manager/repeat-rows.d.ts +5 -6
  340. package/src/lib/plugin-manager/repeat-rows.js.map +1 -1
  341. package/src/lib/app-utils/actions.d.ts +0 -310
  342. package/src/lib/app-utils/actions.js +0 -506
  343. package/src/lib/app-utils/actions.js.map +0 -1
  344. package/src/lib/app-utils/automation-placeholders.d.ts +0 -72
  345. package/src/lib/app-utils/automation-placeholders.js +0 -207
  346. package/src/lib/app-utils/automation-placeholders.js.map +0 -1
  347. package/src/lib/app-utils/dataset-models.d.ts +0 -339
  348. package/src/lib/app-utils/dataset-models.js +0 -722
  349. package/src/lib/app-utils/dataset-models.js.map +0 -1
  350. package/src/lib/app-utils/datasets.d.ts +0 -171
  351. package/src/lib/app-utils/datasets.js +0 -227
  352. package/src/lib/app-utils/datasets.js.map +0 -1
  353. package/src/lib/app-utils/form-abuse-ceiling.d.ts +0 -146
  354. package/src/lib/app-utils/form-abuse-ceiling.js +0 -158
  355. package/src/lib/app-utils/form-abuse-ceiling.js.map +0 -1
  356. package/src/lib/plugin-manager/order-fulfilment.d.ts +0 -142
  357. package/src/lib/plugin-manager/order-fulfilment.js +0 -104
  358. package/src/lib/plugin-manager/order-fulfilment.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/repeat-sources.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AglynAttributeSchema } from '../foundation/definitions/components.types'\nimport type { EntityPickerKind } from './entity-picker-context'\nimport type { RepeatableDataset } from './expand-repeatables'\n\n/**\n * Where a repeat's rows come from, for the editor (AGL-3111).\n *\n * Any element can repeat, and the platform decides what a repeat MEANS — the\n * scope, the copies, the bounds (`expand-repeatables.ts`). What it does not\n * decide is what an element repeats OVER. That belongs to the plugin that owns\n * the rows, which registers a source here from the registration function its\n * loader calls by name. Core names no source.\n *\n * Reached by path, never through a barrel: nothing on a published page asks\n * where rows come from, so nothing here is in a published page's download.\n */\n\n/**\n * What a source answers for one key.\n *\n * - `loading` — no answer yet.\n * - `missing` — the key names nothing this site may use. The published page\n * renders the element once, as written.\n * - `error` — the read failed. Nothing is known about the rows.\n * - `ready` — the rows, read and bounded exactly as the published page's\n * composition reads them.\n */\nexport type RepeatRowsAnswer =\n | { status: 'loading' }\n | { status: 'missing' }\n | { status: 'error' }\n | {\n status: 'ready'\n /** The name authors know the entry by, for the canvas badge. */\n label: string\n /**\n * The rows under every key the expansion looks them up by: the key as\n * the node stores it, the entry's id, and each entry a one-hop reference\n * in the rows reads (`{{item.ref.field}}`).\n */\n rowsByKey: Readonly<Record<string, RepeatableDataset>>\n }\n\n/** One read a source is asked for. */\nexport interface RepeatRowsRequest {\n /** The site the canvas edits. A source answers only what it may show. */\n hostId: string\n /** The key exactly as the node stores it. */\n key: string\n}\n\n/** One kind of thing an element can repeat over. */\nexport interface RepeatSource {\n /** Stable id, e.g. the plugin's name for the kind. */\n id: string\n /** What the Attributes panel calls the kind. */\n label: string\n /**\n * The node prop the chosen key persists under. Persisted in documents, so a\n * source never renames it.\n */\n keyProp: string\n /**\n * The attribute that picks a key, drawn by the Attributes panel as any\n * component attribute is. The panel names the field after `keyProp`.\n */\n keyAttribute: Omit<AglynAttributeSchema, 'name'>\n /**\n * The entity picker kind a key names, when a key is an entity the picker\n * lists. With it, the insert-token menu inside the repeat names the entity\n * through the picker and offers `{{item.<field>}}` for each field the\n * entity declares (`EntityPickerContextValue.entityFields`). Without it the\n * menu offers no item tokens and authors type them.\n */\n entityKind?: EntityPickerKind\n /**\n * Reads one key's rows for the besigner's canvas preview and badge. A React\n * hook: the editor mounts one reader per key and calls it unconditionally,\n * so its identity must not change after registration.\n */\n useRows(request: RepeatRowsRequest): RepeatRowsAnswer\n}\n\nconst sources = new Map<string, RepeatSource>()\nconst listeners = new Set<() => void>()\nlet version = 0\n/**\n * Replaced only when the registered set changes, never rebuilt per call: it is\n * the snapshot `useSyncExternalStore` compares, and a fresh array every time\n * is a render loop rather than a wasted allocation.\n */\nlet snapshot: readonly RepeatSource[] = []\n\nconst notify = () => {\n version += 1\n snapshot = [...sources.values()]\n for (const listener of [...listeners]) listener()\n}\n\n/**\n * Registers a source, replacing any registered under its id. Returns the\n * unregister, which removes the source only if it is still the one registered.\n *\n * Call it from a registration function the plugin loader calls BY NAME, never\n * from a module's top level: a bundler deletes a module imported only for its\n * side effect when its package says it has none (AGL-3025).\n */\nexport function registerRepeatSource(source: RepeatSource): () => void {\n if (sources.get(source.id) !== source) {\n sources.set(source.id, source)\n notify()\n }\n return () => {\n if (sources.get(source.id) !== source) return\n sources.delete(source.id)\n notify()\n }\n}\n\n/**\n * Every registered source, in registration order. The SAME array until the\n * registered set changes, so it can be read as a store snapshot.\n */\nexport function listRepeatSources(): readonly RepeatSource[] {\n return snapshot\n}\n\n/** The source registered under `id`. */\nexport function getRepeatSource(id: string): RepeatSource | undefined {\n return sources.get(id)\n}\n\n/** Called after the registered set changes. Returns the unsubscribe. */\nexport function subscribeRepeatSources(listener: () => void): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n}\n\n/** Moves on every change — the snapshot `useSyncExternalStore` reads. */\nexport function getRepeatSourcesVersion(): number {\n return version\n}\n\n/**\n * The registered source a node repeats over, and the key it names, trimmed.\n * `undefined` for a node that repeats over nothing a registered source owns.\n */\nexport function repeatSourceOf(\n node: unknown,\n): { source: RepeatSource; key: string } | undefined {\n const props = (node as { props?: Record<string, unknown> } | undefined)?.props\n if (!props) return undefined\n for (const source of sources.values()) {\n const value = props[source.keyProp]\n const key = typeof value === 'string' ? value.trim() : ''\n if (key) return { source, key }\n }\n return undefined\n}\n"],"names":["sources","Map","listeners","Set","version","snapshot","notify","values","listener","registerRepeatSource","source","get","id","set","delete","listRepeatSources","getRepeatSource","subscribeRepeatSources","add","getRepeatSourcesVersion","repeatSourceOf","node","props","undefined","value","keyProp","key","trim"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAqFD,MAAMA,UAAU,IAAIC;AACpB,MAAMC,YAAY,IAAIC;AACtB,IAAIC,UAAU;AACd;;;;CAIC,GACD,IAAIC,WAAoC,EAAE;AAE1C,MAAMC,SAAS;IACbF,WAAW;IACXC,WAAW;WAAIL,QAAQO,MAAM;KAAG;IAChC,KAAK,MAAMC,YAAY;WAAIN;KAAU,CAAEM;AACzC;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,qBAAqBC,MAAoB;IACvD,IAAIV,QAAQW,GAAG,CAACD,OAAOE,EAAE,MAAMF,QAAQ;QACrCV,QAAQa,GAAG,CAACH,OAAOE,EAAE,EAAEF;QACvBJ;IACF;IACA,OAAO;QACL,IAAIN,QAAQW,GAAG,CAACD,OAAOE,EAAE,MAAMF,QAAQ;QACvCV,QAAQc,MAAM,CAACJ,OAAOE,EAAE;QACxBN;IACF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASS;IACd,OAAOV;AACT;AAEA,sCAAsC,GACtC,OAAO,SAASW,gBAAgBJ,EAAU;IACxC,OAAOZ,QAAQW,GAAG,CAACC;AACrB;AAEA,sEAAsE,GACtE,OAAO,SAASK,uBAAuBT,QAAoB;IACzDN,UAAUgB,GAAG,CAACV;IACd,OAAO;QACLN,UAAUY,MAAM,CAACN;IACnB;AACF;AAEA,uEAAuE,GACvE,OAAO,SAASW;IACd,OAAOf;AACT;AAEA;;;CAGC,GACD,OAAO,SAASgB,eACdC,IAAa;IAEb,MAAMC,QAASD,wBAAD,AAACA,KAA0DC,KAAK;IAC9E,IAAI,CAACA,OAAO,OAAOC;IACnB,KAAK,MAAMb,UAAUV,QAAQO,MAAM,GAAI;QACrC,MAAMiB,QAAQF,KAAK,CAACZ,OAAOe,OAAO,CAAC;QACnC,MAAMC,MAAM,OAAOF,UAAU,WAAWA,MAAMG,IAAI,KAAK;QACvD,IAAID,KAAK,OAAO;YAAEhB;YAAQgB;QAAI;IAChC;IACA,OAAOH;AACT"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/repeat-sources.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AglynAttributeSchema } from '../foundation/definitions/components.types'\nimport type { EntityPickerKind } from './entity-picker-context'\nimport type { RepeatableDataset } from './expand-repeatables'\n\n/**\n * Where a repeat's rows come from, for the editor (AGL-3111).\n *\n * Any element can repeat, and the platform decides what a repeat MEANS — the\n * scope, the copies, the bounds (`expand-repeatables.ts`). What it does not\n * decide is what an element repeats OVER. That belongs to the plugin that owns\n * the rows, which registers a source here from the registration function its\n * loader calls by name. Core names no source.\n *\n * Reached by path, never through a barrel: nothing on a published page asks\n * where rows come from, so nothing here is in a published page's download.\n */\n\n/**\n * What a source answers for one key.\n *\n * - `loading` — no answer yet.\n * - `missing` — the key names nothing this site may use. The published page\n * renders no copies of the element (AGL-3496); the canvas keeps the\n * template and flags it on the badge.\n * - `error` — the read failed. Nothing is known about the rows.\n * - `ready` — the rows, read and bounded exactly as the published page's\n * composition reads them.\n */\nexport type RepeatRowsAnswer =\n | { status: 'loading' }\n | { status: 'missing' }\n | { status: 'error' }\n | {\n status: 'ready'\n /** The name authors know the entry by, for the canvas badge. */\n label: string\n /**\n * The rows under every key the expansion looks them up by: the key as\n * the node stores it, the entry's id, and each entry a one-hop reference\n * in the rows reads (`{{item.ref.field}}`).\n */\n rowsByKey: Readonly<Record<string, RepeatableDataset>>\n }\n\n/** One read a source is asked for. */\nexport interface RepeatRowsRequest {\n /** The site the canvas edits. A source answers only what it may show. */\n hostId: string\n /** The key exactly as the node stores it. */\n key: string\n}\n\n/** One kind of thing an element can repeat over. */\nexport interface RepeatSource {\n /** Stable id, e.g. the plugin's name for the kind. */\n id: string\n /** What the Attributes panel calls the kind. */\n label: string\n /**\n * The node prop the chosen key persists under. Persisted in documents, so a\n * source never renames it.\n */\n keyProp: string\n /**\n * The attribute that picks a key, drawn by the Attributes panel as any\n * component attribute is. The panel names the field after `keyProp`.\n */\n keyAttribute: Omit<AglynAttributeSchema, 'name'>\n /**\n * The entity picker kind a key names, when a key is an entity the picker\n * lists. With it, the insert-token menu inside the repeat names the entity\n * through the picker and offers `{{item.<field>}}` for each field the\n * entity declares (`EntityPickerContextValue.entityFields`). Without it the\n * menu offers no item tokens and authors type them.\n */\n entityKind?: EntityPickerKind\n /**\n * Reads one key's rows for the besigner's canvas preview and badge. A React\n * hook: the editor mounts one reader per key and calls it unconditionally,\n * so its identity must not change after registration.\n */\n useRows(request: RepeatRowsRequest): RepeatRowsAnswer\n}\n\nconst sources = new Map<string, RepeatSource>()\nconst listeners = new Set<() => void>()\nlet version = 0\n/**\n * Replaced only when the registered set changes, never rebuilt per call: it is\n * the snapshot `useSyncExternalStore` compares, and a fresh array every time\n * is a render loop rather than a wasted allocation.\n */\nlet snapshot: readonly RepeatSource[] = []\n\nconst notify = () => {\n version += 1\n snapshot = [...sources.values()]\n for (const listener of [...listeners]) listener()\n}\n\n/**\n * Registers a source, replacing any registered under its id. Returns the\n * unregister, which removes the source only if it is still the one registered.\n *\n * Call it from a registration function the plugin loader calls BY NAME, never\n * from a module's top level: a bundler deletes a module imported only for its\n * side effect when its package says it has none (AGL-3025).\n */\nexport function registerRepeatSource(source: RepeatSource): () => void {\n if (sources.get(source.id) !== source) {\n sources.set(source.id, source)\n notify()\n }\n return () => {\n if (sources.get(source.id) !== source) return\n sources.delete(source.id)\n notify()\n }\n}\n\n/**\n * Every registered source, in registration order. The SAME array until the\n * registered set changes, so it can be read as a store snapshot.\n */\nexport function listRepeatSources(): readonly RepeatSource[] {\n return snapshot\n}\n\n/** The source registered under `id`. */\nexport function getRepeatSource(id: string): RepeatSource | undefined {\n return sources.get(id)\n}\n\n/** Called after the registered set changes. Returns the unsubscribe. */\nexport function subscribeRepeatSources(listener: () => void): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n}\n\n/** Moves on every change — the snapshot `useSyncExternalStore` reads. */\nexport function getRepeatSourcesVersion(): number {\n return version\n}\n\n/**\n * The registered source a node repeats over, and the key it names, trimmed.\n * `undefined` for a node that repeats over nothing a registered source owns.\n */\nexport function repeatSourceOf(\n node: unknown,\n): { source: RepeatSource; key: string } | undefined {\n const props = (node as { props?: Record<string, unknown> } | undefined)?.props\n if (!props) return undefined\n for (const source of sources.values()) {\n const value = props[source.keyProp]\n const key = typeof value === 'string' ? value.trim() : ''\n if (key) return { source, key }\n }\n return undefined\n}\n"],"names":["sources","Map","listeners","Set","version","snapshot","notify","values","listener","registerRepeatSource","source","get","id","set","delete","listRepeatSources","getRepeatSource","subscribeRepeatSources","add","getRepeatSourcesVersion","repeatSourceOf","node","props","undefined","value","keyProp","key","trim"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAsFD,MAAMA,UAAU,IAAIC;AACpB,MAAMC,YAAY,IAAIC;AACtB,IAAIC,UAAU;AACd;;;;CAIC,GACD,IAAIC,WAAoC,EAAE;AAE1C,MAAMC,SAAS;IACbF,WAAW;IACXC,WAAW;WAAIL,QAAQO,MAAM;KAAG;IAChC,KAAK,MAAMC,YAAY;WAAIN;KAAU,CAAEM;AACzC;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,qBAAqBC,MAAoB;IACvD,IAAIV,QAAQW,GAAG,CAACD,OAAOE,EAAE,MAAMF,QAAQ;QACrCV,QAAQa,GAAG,CAACH,OAAOE,EAAE,EAAEF;QACvBJ;IACF;IACA,OAAO;QACL,IAAIN,QAAQW,GAAG,CAACD,OAAOE,EAAE,MAAMF,QAAQ;QACvCV,QAAQc,MAAM,CAACJ,OAAOE,EAAE;QACxBN;IACF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASS;IACd,OAAOV;AACT;AAEA,sCAAsC,GACtC,OAAO,SAASW,gBAAgBJ,EAAU;IACxC,OAAOZ,QAAQW,GAAG,CAACC;AACrB;AAEA,sEAAsE,GACtE,OAAO,SAASK,uBAAuBT,QAAoB;IACzDN,UAAUgB,GAAG,CAACV;IACd,OAAO;QACLN,UAAUY,MAAM,CAACN;IACnB;AACF;AAEA,uEAAuE,GACvE,OAAO,SAASW;IACd,OAAOf;AACT;AAEA;;;CAGC,GACD,OAAO,SAASgB,eACdC,IAAa;IAEb,MAAMC,QAASD,wBAAD,AAACA,KAA0DC,KAAK;IAC9E,IAAI,CAACA,OAAO,OAAOC;IACnB,KAAK,MAAMb,UAAUV,QAAQO,MAAM,GAAI;QACrC,MAAMiB,QAAQF,KAAK,CAACZ,OAAOe,OAAO,CAAC;QACnC,MAAMC,MAAM,OAAOF,UAAU,WAAWA,MAAMG,IAAI,KAAK;QACvD,IAAID,KAAK,OAAO;YAAEhB;YAAQgB;QAAI;IAChC;IACA,OAAOH;AACT"}
@@ -14,6 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ import type { LeavingNoticeConfig } from './leaving-notice';
17
18
  /**
18
19
  * Host routing map: screen id → routed path in the tenant matcher format
19
20
  * (root is `'/'`, nested paths are slash-joined segments WITHOUT a leading
@@ -45,6 +46,12 @@ export interface ScreenLinkContextValue {
45
46
  localeVariants?: Record<string, string>;
46
47
  /** Locale of the screen being rendered (AGL-164). */
47
48
  currentLocale?: string;
49
+ /**
50
+ * Present only on a published page of a site in its leaving-notice window
51
+ * (AGL-3452): links to other domains resolve to the notice on the site's
52
+ * own host instead. See `leaving-notice.ts`.
53
+ */
54
+ leavingNotice?: LeavingNoticeConfig;
48
55
  }
49
56
  /**
50
57
  * Render-time resolution context for id-based screen links: canvas nodes
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/screen-link-context-value.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The render-time screen-link context, and the shape it carries.\n *\n * Its own module because a published page provides this context and reads\n * nothing else here: the map goes in at the top of the tree and the canvas\n * nodes below resolve their hrefs from it. `screen-link-context.ts` around it\n * is the resolution machinery every editing surface needs — the broken-link\n * verdict and its styling, the unavailable-screen labels, the href resolver,\n * the link-value splitter and the two hooks — and through\n * `screen-link-value.ts` the persisted link grammar as well. A bundler cannot\n * drop that around a single named import.\n *\n * No `'use client'` banner, for the reason `screen-link-context.ts` records:\n * inside this package the directive forks the module graph, and a second\n * copy of the context is a second context — providers on one, consumers on\n * the other, and every link resolving to nothing.\n */\n\nimport { createContext } from 'react'\n\n/**\n * Host routing map: screen id → routed path in the tenant matcher format\n * (root is `'/'`, nested paths are slash-joined segments WITHOUT a leading\n * slash, e.g. `company/about`). This is the `screens` field of the host\n * document — the single source of truth kept current by the publish and\n * hierarchy flows.\n */\nexport type ScreenRouteMap = Record<string, string>\n\nexport interface ScreenLinkContextValue {\n /** Routing map hrefs are resolved against. Absent → nothing resolves. */\n screens?: ScreenRouteMap\n /** Optional display names by screen id, for editor-facing pickers. */\n labels?: Record<string, string>\n /**\n * True inside editing surfaces (besigner canvas, preview): screen links\n * render their content but must not navigate.\n */\n suppressNavigation?: boolean\n /**\n * True ONLY on the static besigner canvas (AGL-830): interactions are\n * inert and command-bus-driven elements (nav menus, drawers) render their\n * editor affordance instead of the live popup. The Preview surface leaves\n * this falsy — it suppresses navigation but runs interactions for real, so\n * a hover-to-open mega menu behaves exactly like the live site. Split out\n * of {@link suppressNavigation}, which now means only \"links don't navigate\".\n */\n editorInert?: boolean\n /** Current screen's translations: locale → screen id (AGL-164). */\n localeVariants?: Record<string, string>\n /** Locale of the screen being rendered (AGL-164). */\n currentLocale?: string\n}\n\n/**\n * Render-time resolution context for id-based screen links: canvas nodes\n * persist a screen id, never a path, so slug renames and re-parenting can't\n * break links. Provided by the tenant page (map from static props, refreshed\n * by ISR) and by the console's besigner/preview surfaces (map from the live\n * host doc subscription, navigation suppressed). Context crosses the canvas\n * shadow DOM because the shadow root renders through a React portal.\n */\nexport const ScreenLinkContext = createContext<ScreenLinkContextValue>({})\nScreenLinkContext.displayName = 'ScreenLinkContext'\n"],"names":["createContext","ScreenLinkContext","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;CAgBC,GAED,SAASA,aAAa,QAAQ,QAAO;AAoCrC;;;;;;;CAOC,GACD,OAAO,MAAMC,oBAAoBD,cAAsC,CAAC,GAAE;AAC1EC,kBAAkBC,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/screen-link-context-value.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The render-time screen-link context, and the shape it carries.\n *\n * Its own module because a published page provides this context and reads\n * nothing else here: the map goes in at the top of the tree and the canvas\n * nodes below resolve their hrefs from it. `screen-link-context.ts` around it\n * is the resolution machinery every editing surface needs — the broken-link\n * verdict and its styling, the unavailable-screen labels, the href resolver,\n * the link-value splitter and the two hooks — and through\n * `screen-link-value.ts` the persisted link grammar as well. A bundler cannot\n * drop that around a single named import.\n *\n * No `'use client'` banner, for the reason `screen-link-context.ts` records:\n * inside this package the directive forks the module graph, and a second\n * copy of the context is a second context — providers on one, consumers on\n * the other, and every link resolving to nothing.\n */\n\nimport { createContext } from 'react'\nimport type { LeavingNoticeConfig } from './leaving-notice'\n\n/**\n * Host routing map: screen id → routed path in the tenant matcher format\n * (root is `'/'`, nested paths are slash-joined segments WITHOUT a leading\n * slash, e.g. `company/about`). This is the `screens` field of the host\n * document — the single source of truth kept current by the publish and\n * hierarchy flows.\n */\nexport type ScreenRouteMap = Record<string, string>\n\nexport interface ScreenLinkContextValue {\n /** Routing map hrefs are resolved against. Absent → nothing resolves. */\n screens?: ScreenRouteMap\n /** Optional display names by screen id, for editor-facing pickers. */\n labels?: Record<string, string>\n /**\n * True inside editing surfaces (besigner canvas, preview): screen links\n * render their content but must not navigate.\n */\n suppressNavigation?: boolean\n /**\n * True ONLY on the static besigner canvas (AGL-830): interactions are\n * inert and command-bus-driven elements (nav menus, drawers) render their\n * editor affordance instead of the live popup. The Preview surface leaves\n * this falsy — it suppresses navigation but runs interactions for real, so\n * a hover-to-open mega menu behaves exactly like the live site. Split out\n * of {@link suppressNavigation}, which now means only \"links don't navigate\".\n */\n editorInert?: boolean\n /** Current screen's translations: locale → screen id (AGL-164). */\n localeVariants?: Record<string, string>\n /** Locale of the screen being rendered (AGL-164). */\n currentLocale?: string\n /**\n * Present only on a published page of a site in its leaving-notice window\n * (AGL-3452): links to other domains resolve to the notice on the site's\n * own host instead. See `leaving-notice.ts`.\n */\n leavingNotice?: LeavingNoticeConfig\n}\n\n/**\n * Render-time resolution context for id-based screen links: canvas nodes\n * persist a screen id, never a path, so slug renames and re-parenting can't\n * break links. Provided by the tenant page (map from static props, refreshed\n * by ISR) and by the console's besigner/preview surfaces (map from the live\n * host doc subscription, navigation suppressed). Context crosses the canvas\n * shadow DOM because the shadow root renders through a React portal.\n */\nexport const ScreenLinkContext = createContext<ScreenLinkContextValue>({})\nScreenLinkContext.displayName = 'ScreenLinkContext'\n"],"names":["createContext","ScreenLinkContext","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;CAgBC,GAED,SAASA,aAAa,QAAQ,QAAO;AA2CrC;;;;;;;CAOC,GACD,OAAO,MAAMC,oBAAoBD,cAAsC,CAAC,GAAE;AAC1EC,kBAAkBC,WAAW,GAAG"}
@@ -20,6 +20,7 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
20
20
  // barrel from the tenant page) makes the bundler duplicate parts of the
21
21
  // module graph — a second canvas/emitter instance renders the site blank.
22
22
  import { useContext, useMemo } from "react";
23
+ import { routeThroughLeavingNotice } from "./leaving-notice.js";
23
24
  import { ScreenLinkContext } from "./screen-link-context-value.js";
24
25
  import { EXTERNAL_HREF_PATTERN, SAFE_HREF_PATTERN, formatCollectionLinkValue, linkTargetKind, parseCollectionLinkValue, parseEntryLinkValue, parseFeedLinkValue, resolveScreenHref, screenRoutesAnswerFor, splitLinkValue } from "./screen-link-value.js";
25
26
  export * from "./screen-link-context-value.js";
@@ -260,12 +261,23 @@ export function unresolvedScreenOption(value, screens) {
260
261
  */ export function useLinkTarget(screenId, href) {
261
262
  const target = splitLinkValue(screenId, href);
262
263
  const resolved = useScreenLink(target.screenId);
264
+ const { leavingNotice } = useContext(ScreenLinkContext);
263
265
  const externalHref = target.href && SAFE_HREF_PATTERN.test(target.href) ? target.href : undefined;
264
266
  const finalHref = target.screenId ? resolved.href : externalHref;
267
+ /*
268
+ * A new free site's links to other domains go through the leaving notice on
269
+ * its own host (AGL-3452). Here rather than in each element so the served
270
+ * HTML already carries the notice's address: it holds without JavaScript,
271
+ * and it is what a hover, a copied link and "Open in new tab" all see.
272
+ *
273
+ * The notice is on the site, so the rewritten link no longer leaves it —
274
+ * and keeping the referrer is what lets the notice's Go back return to the
275
+ * page the visitor came from.
276
+ */ const noticeHref = !target.screenId && !resolved.suppressNavigation ? routeThroughLeavingNotice(externalHref, leavingNotice) : undefined;
265
277
  return _extends({}, resolved, {
266
- href: finalHref,
278
+ href: noticeHref != null ? noticeHref : finalHref,
267
279
  externalHref,
268
- leavesSite: Boolean(!target.screenId && externalHref && EXTERNAL_HREF_PATTERN.test(externalHref))
280
+ leavesSite: Boolean(!noticeHref && !target.screenId && externalHref && EXTERNAL_HREF_PATTERN.test(externalHref))
269
281
  });
270
282
  }
271
283
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/screen-link-context.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Lives in @aglyn/aglyn (not a UI lib) deliberately, WITHOUT a 'use client'\n// banner: every surface that renders canvas nodes already imports this\n// package, and a client boundary here (or importing the shared-ui-jsx\n// barrel from the tenant page) makes the bundler duplicate parts of the\n// module graph — a second canvas/emitter instance renders the site blank.\nimport { useContext, useMemo } from 'react'\nimport {\n ScreenLinkContext,\n type ScreenRouteMap,\n} from './screen-link-context-value'\nimport {\n EXTERNAL_HREF_PATTERN,\n SAFE_HREF_PATTERN,\n formatCollectionLinkValue,\n linkTargetKind,\n parseCollectionLinkValue,\n parseEntryLinkValue,\n parseFeedLinkValue,\n resolveScreenHref,\n screenRoutesAnswerFor,\n splitLinkValue,\n} from './screen-link-value'\n\nexport * from './screen-link-context-value'\n\nexport interface ResolvedScreenLink {\n /** Site-relative href (`/`, `/company/about`), undefined when unresolvable. */\n href?: string\n suppressNavigation: boolean\n /** True only on the static besigner canvas — interactions are inert. */\n editorInert: boolean\n /**\n * A screen id WAS authored and the routing map does not have it — the\n * target is unpublished or deleted (AGL-1893).\n *\n * Distinct from \"no href\": the canvas and the preview withhold hrefs on\n * purpose, and an element with no link at all never had one to lose.\n * Only this flag means the author asked for a link that cannot exist, and\n * only elements reading THIS may say so — see {@link isScreenLinkBroken}\n * for why an absent or empty map is deliberately not \"broken\".\n */\n broken: boolean\n}\n\n/**\n * Whether an authored screen id points at nothing (AGL-1893).\n *\n * Unpublishing or deleting a screen is a normal authoring action, and until\n * this existed nothing anywhere reported what it had just broken: a Tabs\n * link to a retired screen shipped as a live-looking control that silently\n * did nothing on `aglyn.com/changelog` and `/newsroom` for two days.\n *\n * The two \"we cannot tell\" cases are NOT broken, and the distinction is the\n * whole safety of this predicate:\n *\n * - **no map** — a surface that renders canvas nodes without providing\n * `ScreenLinkContext` (an isolated spec, an embed) knows nothing about\n * the host's screens, and must not conclude that every link is dead;\n * - **an empty map** — the same thing one beat earlier: the console's live\n * host subscription starts empty, and a moment of `{}` must not repaint a\n * whole navigation row as broken and then repaint it back.\n *\n * Both failure directions were weighed. Calling a live link broken hides or\n * disables working navigation on a customer's site; calling a dead link fine\n * leaves exactly the defect this issue is about. Only the first is\n * unrecoverable from the visitor's side, so the doubt resolves that way.\n */\nexport function isScreenLinkBroken(\n screens: ScreenRouteMap | undefined,\n screenId: string | null | undefined,\n): boolean {\n if (!screenId) return false\n // Both \"we cannot tell\" cases, asked of the half of the map that holds this\n // target's kind: a collection listing (AGL-2799) is judged against the\n // listings, a screen against the screens — see `screenRoutesAnswerFor`.\n if (!screenRoutesAnswerFor(screens, screenId)) return false\n return resolveScreenHref(screens, screenId) === undefined\n}\n\n/**\n * The extra option a Screen picker needs when its stored value matches none\n * of the host's screens (AGL-1893).\n *\n * The console builds `SCREEN_SELECT` options from the routing map, so a\n * value the map has lost — the retired `/blog` screen, say — matches\n * nothing and the field renders EMPTY. Which reads, to the person looking\n * at it, as \"no link set\". Meanwhile the element still behaves as linked:\n * the strip is still a nav landmark, that tab is still skipped as\n * \"navigates\", and the panel it would have revealed is still suppressed. So\n * the one surface where this is repairable was also the one actively\n * denying there was anything to repair.\n *\n * Returns the stored value UNCHANGED as the option's value: naming a dead\n * target must not rewrite it, or opening the panel and pressing Save would\n * quietly convert a recoverable reference into something else.\n *\n * Three shapes get named, because a Screen picker can legally hold any of\n * them (AGL-1335 / AGL-1894 / AGL-2799): a screen reference whose screen is\n * gone, a collection listing whose collection is gone, and a plain address\n * typed in before the picker existed. The last is not broken — but it is\n * just as invisible, and an author who cannot see it is the reason those\n * links are not rename-safe yet.\n */\nexport function unavailableScreenLabel(\n screenId: string,\n screensKnown: boolean,\n): string {\n // With no map loaded yet nothing is known to be missing, so the id is\n // shown plainly. Flashing \"unavailable\" over every link for the beat\n // before the console's host subscription lands would teach authors to\n // ignore the warning that matters.\n if (!screensKnown) return screenId\n // A listing has no publish state of its own: its collection is either gone\n // or no longer has the slug its address is built from. A feed hangs off the\n // same listing, so it is lost the same two ways (AGL-3118).\n const collectionId = parseCollectionLinkValue(screenId)\n if (collectionId) {\n return `⚠ Unavailable collection listing (${collectionId}) — deleted or has no slug`\n }\n const feedCollectionId = parseFeedLinkValue(screenId)\n if (feedCollectionId) {\n return `⚠ Unavailable RSS feed (${feedCollectionId}) — collection deleted or has no slug`\n }\n const entry = parseEntryLinkValue(screenId)\n return entry\n ? `⚠ Unavailable entry (${entry.entryId}) — unpublished or deleted`\n : `⚠ Unavailable page (${screenId}) — unpublished or deleted`\n}\n\nexport function unresolvedScreenOption(\n value: unknown,\n screens: ScreenRouteMap | undefined,\n): { value: string; label: string } | undefined {\n const raw = typeof value === 'string' ? value.trim() : ''\n if (!raw) return undefined\n const target = splitLinkValue(raw, undefined)\n if (target.screenId) {\n if (resolveScreenHref(screens, target.screenId) !== undefined) {\n return undefined\n }\n return {\n value: raw,\n label: unavailableScreenLabel(\n target.screenId,\n screenRoutesAnswerFor(screens, target.screenId),\n ),\n }\n }\n return target.href\n ? { value: raw, label: `⚠ Plain address (${target.href}) — not a page` }\n : undefined\n}\n\n/** One target a link picker offers — see {@link screenLinkTargetOptions}. */\nexport interface ScreenLinkTargetOption {\n /**\n * The routing-map key: a bare screen id, a collection listing's\n * `collection:<id>`, or its feed's `feed:<id>`. Stored as it is in a screen\n * slot, and through `formatScreenLinkValue` in a `Link`-typed prop.\n */\n value: string\n label: string\n kind: 'screen' | 'collection-listing' | 'feed'\n}\n\n/**\n * What a picker calls one routing-map target, or `undefined` for a key the\n * map does not hold — the label {@link screenLinkTargetOptions} gives it.\n *\n * A listing and a feed are labeled with their collection's name and address,\n * like a screen, and marked as what they are IN the label rather than only by\n * position: a closed picker shows the chosen label and nothing else, and\n * \"Blog (/blog)\" there reads exactly like a screen named Blog. A feed borrows\n * its collection's name, which is the only name it has (AGL-3119).\n *\n * An entry is never named here. A map holds only the entries a page\n * references, under no label, so an entry is named by the search seam\n * (`LinkTargetSearchContext`), which reads the entry itself.\n */\nexport function screenLinkTargetLabel(\n key: string,\n screens: ScreenRouteMap | undefined,\n labels: Record<string, string> | undefined,\n): string | undefined {\n const href = resolveScreenHref(screens, key)\n if (href === undefined) return undefined\n const collectionId = parseCollectionLinkValue(key)\n if (collectionId) {\n return `${labels?.[key] ?? collectionId} (${href}) — collection listing`\n }\n const feedCollectionId = parseFeedLinkValue(key)\n if (feedCollectionId) {\n const name =\n labels?.[key] ??\n labels?.[formatCollectionLinkValue(feedCollectionId)] ??\n feedCollectionId\n return `${name} (${href}) — RSS feed`\n }\n if (parseEntryLinkValue(key)) return undefined\n return `${labels?.[key] ?? key} (${href})`\n}\n\n/**\n * Everything a Screen picker offers, in the order it offers it (AGL-2799):\n * the host's screens, then its content collections' listing pages, then\n * their RSS feeds (AGL-3119).\n *\n * ONE builder for both pickers — the attributes panel's `SCREEN_SELECT` and\n * the `Link`-typed prop picker. Each used to map the routing map into options\n * by itself, so a target added to one list was missing from the other; and\n * neither offered a collection's listing at all, which is how the drawer on\n * aglyn.com came to link its blog as a typed `/blog`.\n *\n * Entries are left out even when the map holds some: they are searched, not\n * listed, because a site's entries are far too many to read into a dropdown\n * — see `LinkTargetSearchContext`.\n *\n * `order` keeps each picker's established screen order — by path in the\n * attributes panel, by name in the prop picker — and the listings and feeds\n * follow the screens in the same order.\n */\nexport function screenLinkTargetOptions(\n screens: ScreenRouteMap | undefined,\n labels: Record<string, string> | undefined,\n order: 'path' | 'label' = 'path',\n): ScreenLinkTargetOption[] {\n type Ranked = ScreenLinkTargetOption & { path: string }\n const pages: Ranked[] = []\n const listings: Ranked[] = []\n const feeds: Ranked[] = []\n for (const [key, path] of Object.entries(screens ?? {})) {\n const kind = linkTargetKind(key)\n if (kind === 'entry') continue\n const label = screenLinkTargetLabel(key, screens, labels) ?? key\n if (kind === 'collection') {\n listings.push({ value: key, label, kind: 'collection-listing', path })\n } else if (kind === 'feed') {\n feeds.push({ value: key, label, kind: 'feed', path })\n } else {\n pages.push({ value: key, label, kind: 'screen', path })\n }\n }\n const compare = (a: Ranked, b: Ranked) =>\n order === 'path'\n ? a.path.localeCompare(b.path)\n : a.label.localeCompare(b.label)\n return [\n ...pages.sort(compare),\n ...listings.sort(compare),\n ...feeds.sort(compare),\n ].map(({ value, label, kind }) => ({ value, label, kind }))\n}\n\n/**\n * Marks the element in the DOM. Present on the live site too, deliberately:\n * a smoke pass can then find every dead control on a page with one selector\n * instead of reading five different components' conditions.\n */\nexport const BROKEN_SCREEN_LINK_ATTR = 'data-aglyn-broken-link'\n\n/** What the AUTHOR is told, on the one surface that can fix it. */\nexport const BROKEN_SCREEN_LINK_MESSAGE =\n 'Broken link: this points at a page or collection listing that is ' +\n 'unpublished or deleted, so it will not work on the published site. Pick ' +\n 'a target again in the attributes panel, or clear the link.'\n\n/**\n * The editor-only outline. A warning ring rather than an error one: the\n * screen may be deliberately unpublished and about to come back, and the\n * page is not broken, one control on it is.\n */\nexport const BROKEN_SCREEN_LINK_SX = {\n outline: '2px dashed',\n outlineColor: 'warning.main',\n outlineOffset: '2px',\n borderRadius: 1,\n}\n\n/**\n * Props that make a dead screen link visible to its author (AGL-1893).\n *\n * The tooltip and the ring are `editorInert` only — that is the static\n * besigner canvas, the one surface where the person who can fix this is\n * looking at it. Preview deliberately does NOT get them: preview exists to\n * show what visitors will see, and an authoring annotation painted into it\n * is a lie of a different kind.\n *\n * The data attribute ships everywhere, canvas and live site alike.\n */\nexport function brokenScreenLinkProps(\n broken: boolean,\n editorInert: boolean,\n): Record<string, unknown> {\n if (!broken) return {}\n return {\n [BROKEN_SCREEN_LINK_ATTR]: '',\n ...(editorInert ? { title: BROKEN_SCREEN_LINK_MESSAGE } : null),\n }\n}\n\n/**\n * Link VALUE parsing AND resolution live in `./screen-link-value` —\n * server-safe, because the where-used scan and the Markdown representation of\n * a page both run on the server, and the `createContext` this module reaches\n * keeps it out of the `@aglyn/aglyn/server` barrel (AGL-703, AGL-2740).\n * Re-exported here so every existing importer, and the spec beside this file,\n * keeps reaching them at the address they have always used.\n */\nexport {\n COLLECTION_LINK_VALUE_PREFIX,\n ENTRY_LINK_VALUE_PREFIX,\n EXTERNAL_HREF_PATTERN,\n FEED_LINK_VALUE_PREFIX,\n SAFE_HREF_PATTERN,\n SCREEN_LINK_VALUE_PREFIX,\n formatCollectionLinkValue,\n formatEntryLinkValue,\n formatFeedLinkValue,\n formatScreenLinkValue,\n linkTargetKind,\n nodesReferenceScreen,\n parseCollectionLinkValue,\n parseEntryLinkValue,\n parseFeedLinkValue,\n parseScreenLinkValue,\n resolveScreenHref,\n screenRoutesAnswerFor,\n splitLinkValue,\n type LinkTargetKind,\n} from './screen-link-value'\n\n/** What a linking element renders — see {@link useLinkTarget}. */\nexport interface ResolvedLinkTarget extends ResolvedScreenLink {\n /** The literal href in play once safety-checked, when no screen resolved. */\n externalHref?: string\n /** True when `href` leaves the site — what \"open in a new tab\" may act on. */\n leavesSite: boolean\n}\n\n/**\n * The single href a linking element should render, from the `screenId` +\n * `href` pair every one of them declares (AGL-1335).\n *\n * Button, Screen Link, Link Box and Image each had the same four lines —\n * resolve the id, safety-check the URL, prefer the id — which is three\n * copies too many now that a `Link`-typed component prop can feed either\n * slot with either shape. Hook-shaped because {@link useScreenLink} is;\n * it is always called, so the hook order never depends on the values.\n */\nexport function useLinkTarget(\n screenId: string | null | undefined,\n href: string | null | undefined,\n): ResolvedLinkTarget {\n const target = splitLinkValue(screenId, href)\n const resolved = useScreenLink(target.screenId)\n const externalHref =\n target.href && SAFE_HREF_PATTERN.test(target.href) ? target.href : undefined\n const finalHref = target.screenId ? resolved.href : externalHref\n return {\n ...resolved,\n href: finalHref,\n externalHref,\n leavesSite: Boolean(\n !target.screenId && externalHref && EXTERNAL_HREF_PATTERN.test(externalHref),\n ),\n }\n}\n\n/**\n * Resolves a screen id to its current href. Memoized on the routing-map\n * identity: a slug rename, parent-slug change, or re-parent produces a new\n * map value, so cached hrefs reset exactly when the map changes. Returns no\n * href for unknown/unpublished ids — callers degrade to plain content\n * instead of rendering a dead link.\n */\nexport function useScreenLink(\n screenId: string | null | undefined,\n): ResolvedScreenLink {\n const { screens, suppressNavigation, editorInert } = useContext(ScreenLinkContext)\n const href = useMemo(() => {\n if (!screenId) return undefined\n const resolved = resolveScreenHref(screens, screenId)\n if (resolved === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `[ScreenLink] screen \"${screenId}\" has no routing-map entry — ` +\n 'it may be unpublished or deleted; rendering without an href.',\n )\n }\n return undefined\n }\n return resolved\n }, [screenId, screens])\n return {\n href,\n suppressNavigation: Boolean(suppressNavigation),\n editorInert: Boolean(editorInert),\n // NOT `!href`: a suppressed surface has no href for links that resolve\n // perfectly well, and the whole point of this flag is to separate the\n // two (AGL-1893).\n broken: isScreenLinkBroken(screens, screenId),\n }\n}\n"],"names":["useContext","useMemo","ScreenLinkContext","EXTERNAL_HREF_PATTERN","SAFE_HREF_PATTERN","formatCollectionLinkValue","linkTargetKind","parseCollectionLinkValue","parseEntryLinkValue","parseFeedLinkValue","resolveScreenHref","screenRoutesAnswerFor","splitLinkValue","isScreenLinkBroken","screens","screenId","undefined","unavailableScreenLabel","screensKnown","collectionId","feedCollectionId","entry","entryId","unresolvedScreenOption","value","raw","trim","target","label","href","screenLinkTargetLabel","key","labels","name","screenLinkTargetOptions","order","pages","listings","feeds","path","Object","entries","kind","push","compare","a","b","localeCompare","sort","map","BROKEN_SCREEN_LINK_ATTR","BROKEN_SCREEN_LINK_MESSAGE","BROKEN_SCREEN_LINK_SX","outline","outlineColor","outlineOffset","borderRadius","brokenScreenLinkProps","broken","editorInert","title","COLLECTION_LINK_VALUE_PREFIX","ENTRY_LINK_VALUE_PREFIX","FEED_LINK_VALUE_PREFIX","SCREEN_LINK_VALUE_PREFIX","formatEntryLinkValue","formatFeedLinkValue","formatScreenLinkValue","nodesReferenceScreen","parseScreenLinkValue","useLinkTarget","resolved","useScreenLink","externalHref","test","finalHref","leavesSite","Boolean","suppressNavigation","process","env","NODE_ENV","console","warn"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GACD,4EAA4E;AAC5E,uEAAuE;AACvE,sEAAsE;AACtE,wEAAwE;AACxE,0EAA0E;AAC1E,SAASA,UAAU,EAAEC,OAAO,QAAQ,QAAO;AAC3C,SACEC,iBAAiB,QAEZ,iCAA6B;AACpC,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,yBAAyB,EACzBC,cAAc,EACdC,wBAAwB,EACxBC,mBAAmB,EACnBC,kBAAkB,EAClBC,iBAAiB,EACjBC,qBAAqB,EACrBC,cAAc,QACT,yBAAqB;AAE5B,cAAc,iCAA6B;AAqB3C;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASC,mBACdC,OAAmC,EACnCC,QAAmC;IAEnC,IAAI,CAACA,UAAU,OAAO;IACtB,4EAA4E;IAC5E,uEAAuE;IACvE,wEAAwE;IACxE,IAAI,CAACJ,sBAAsBG,SAASC,WAAW,OAAO;IACtD,OAAOL,kBAAkBI,SAASC,cAAcC;AAClD;AAEA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,SAASC,uBACdF,QAAgB,EAChBG,YAAqB;IAErB,sEAAsE;IACtE,qEAAqE;IACrE,sEAAsE;IACtE,mCAAmC;IACnC,IAAI,CAACA,cAAc,OAAOH;IAC1B,2EAA2E;IAC3E,4EAA4E;IAC5E,4DAA4D;IAC5D,MAAMI,eAAeZ,yBAAyBQ;IAC9C,IAAII,cAAc;QAChB,OAAO,CAAC,kCAAkC,EAAEA,aAAa,0BAA0B,CAAC;IACtF;IACA,MAAMC,mBAAmBX,mBAAmBM;IAC5C,IAAIK,kBAAkB;QACpB,OAAO,CAAC,wBAAwB,EAAEA,iBAAiB,qCAAqC,CAAC;IAC3F;IACA,MAAMC,QAAQb,oBAAoBO;IAClC,OAAOM,QACH,CAAC,qB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AmC;IAEnC,MAAM,EAAED,OAAO,EAAEgE,kBAAkB,EAAEnB,WAAW,EAAE,GAAG3D,WAAWE;IAChE,MAAM2B,OAAO5B,QAAQ;QACnB,IAAI,CAACc,UAAU,OAAOC;QACtB,MAAMuD,WAAW7D,kBAAkBI,SAASC;QAC5C,IAAIwD,aAAavD,WAAW;YAC1B,IAAI+D,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzCC,QAAQC,IAAI,CACV,CAAC,qBAAqB,EAAEpE,SAAS,6BAA6B,CAAC,GAC7D;YAEN;YACA,OAAOC;QACT;QACA,OAAOuD;IACT,GAAG;QAACxD;QAAUD;KAAQ;IACtB,OAAO;QACLe;QACAiD,oBAAoBD,QAAQC;QAC5BnB,aAAakB,QAAQlB;QACrB,uEAAuE;QACvE,sEAAsE;QACtE,kBAAkB;QAClBD,QAAQ7C,mBAAmBC,SAASC;IACtC;AACF"}
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/screen-link-context.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Lives in @aglyn/aglyn (not a UI lib) deliberately, WITHOUT a 'use client'\n// banner: every surface that renders canvas nodes already imports this\n// package, and a client boundary here (or importing the shared-ui-jsx\n// barrel from the tenant page) makes the bundler duplicate parts of the\n// module graph — a second canvas/emitter instance renders the site blank.\nimport { useContext, useMemo } from 'react'\nimport { routeThroughLeavingNotice } from './leaving-notice'\nimport {\n ScreenLinkContext,\n type ScreenRouteMap,\n} from './screen-link-context-value'\nimport {\n EXTERNAL_HREF_PATTERN,\n SAFE_HREF_PATTERN,\n formatCollectionLinkValue,\n linkTargetKind,\n parseCollectionLinkValue,\n parseEntryLinkValue,\n parseFeedLinkValue,\n resolveScreenHref,\n screenRoutesAnswerFor,\n splitLinkValue,\n} from './screen-link-value'\n\nexport * from './screen-link-context-value'\n\nexport interface ResolvedScreenLink {\n /** Site-relative href (`/`, `/company/about`), undefined when unresolvable. */\n href?: string\n suppressNavigation: boolean\n /** True only on the static besigner canvas — interactions are inert. */\n editorInert: boolean\n /**\n * A screen id WAS authored and the routing map does not have it — the\n * target is unpublished or deleted (AGL-1893).\n *\n * Distinct from \"no href\": the canvas and the preview withhold hrefs on\n * purpose, and an element with no link at all never had one to lose.\n * Only this flag means the author asked for a link that cannot exist, and\n * only elements reading THIS may say so — see {@link isScreenLinkBroken}\n * for why an absent or empty map is deliberately not \"broken\".\n */\n broken: boolean\n}\n\n/**\n * Whether an authored screen id points at nothing (AGL-1893).\n *\n * Unpublishing or deleting a screen is a normal authoring action, and until\n * this existed nothing anywhere reported what it had just broken: a Tabs\n * link to a retired screen shipped as a live-looking control that silently\n * did nothing on `aglyn.com/changelog` and `/newsroom` for two days.\n *\n * The two \"we cannot tell\" cases are NOT broken, and the distinction is the\n * whole safety of this predicate:\n *\n * - **no map** — a surface that renders canvas nodes without providing\n * `ScreenLinkContext` (an isolated spec, an embed) knows nothing about\n * the host's screens, and must not conclude that every link is dead;\n * - **an empty map** — the same thing one beat earlier: the console's live\n * host subscription starts empty, and a moment of `{}` must not repaint a\n * whole navigation row as broken and then repaint it back.\n *\n * Both failure directions were weighed. Calling a live link broken hides or\n * disables working navigation on a customer's site; calling a dead link fine\n * leaves exactly the defect this issue is about. Only the first is\n * unrecoverable from the visitor's side, so the doubt resolves that way.\n */\nexport function isScreenLinkBroken(\n screens: ScreenRouteMap | undefined,\n screenId: string | null | undefined,\n): boolean {\n if (!screenId) return false\n // Both \"we cannot tell\" cases, asked of the half of the map that holds this\n // target's kind: a collection listing (AGL-2799) is judged against the\n // listings, a screen against the screens — see `screenRoutesAnswerFor`.\n if (!screenRoutesAnswerFor(screens, screenId)) return false\n return resolveScreenHref(screens, screenId) === undefined\n}\n\n/**\n * The extra option a Screen picker needs when its stored value matches none\n * of the host's screens (AGL-1893).\n *\n * The console builds `SCREEN_SELECT` options from the routing map, so a\n * value the map has lost — the retired `/blog` screen, say — matches\n * nothing and the field renders EMPTY. Which reads, to the person looking\n * at it, as \"no link set\". Meanwhile the element still behaves as linked:\n * the strip is still a nav landmark, that tab is still skipped as\n * \"navigates\", and the panel it would have revealed is still suppressed. So\n * the one surface where this is repairable was also the one actively\n * denying there was anything to repair.\n *\n * Returns the stored value UNCHANGED as the option's value: naming a dead\n * target must not rewrite it, or opening the panel and pressing Save would\n * quietly convert a recoverable reference into something else.\n *\n * Three shapes get named, because a Screen picker can legally hold any of\n * them (AGL-1335 / AGL-1894 / AGL-2799): a screen reference whose screen is\n * gone, a collection listing whose collection is gone, and a plain address\n * typed in before the picker existed. The last is not broken — but it is\n * just as invisible, and an author who cannot see it is the reason those\n * links are not rename-safe yet.\n */\nexport function unavailableScreenLabel(\n screenId: string,\n screensKnown: boolean,\n): string {\n // With no map loaded yet nothing is known to be missing, so the id is\n // shown plainly. Flashing \"unavailable\" over every link for the beat\n // before the console's host subscription lands would teach authors to\n // ignore the warning that matters.\n if (!screensKnown) return screenId\n // A listing has no publish state of its own: its collection is either gone\n // or no longer has the slug its address is built from. A feed hangs off the\n // same listing, so it is lost the same two ways (AGL-3118).\n const collectionId = parseCollectionLinkValue(screenId)\n if (collectionId) {\n return `⚠ Unavailable collection listing (${collectionId}) — deleted or has no slug`\n }\n const feedCollectionId = parseFeedLinkValue(screenId)\n if (feedCollectionId) {\n return `⚠ Unavailable RSS feed (${feedCollectionId}) — collection deleted or has no slug`\n }\n const entry = parseEntryLinkValue(screenId)\n return entry\n ? `⚠ Unavailable entry (${entry.entryId}) — unpublished or deleted`\n : `⚠ Unavailable page (${screenId}) — unpublished or deleted`\n}\n\nexport function unresolvedScreenOption(\n value: unknown,\n screens: ScreenRouteMap | undefined,\n): { value: string; label: string } | undefined {\n const raw = typeof value === 'string' ? value.trim() : ''\n if (!raw) return undefined\n const target = splitLinkValue(raw, undefined)\n if (target.screenId) {\n if (resolveScreenHref(screens, target.screenId) !== undefined) {\n return undefined\n }\n return {\n value: raw,\n label: unavailableScreenLabel(\n target.screenId,\n screenRoutesAnswerFor(screens, target.screenId),\n ),\n }\n }\n return target.href\n ? { value: raw, label: `⚠ Plain address (${target.href}) — not a page` }\n : undefined\n}\n\n/** One target a link picker offers — see {@link screenLinkTargetOptions}. */\nexport interface ScreenLinkTargetOption {\n /**\n * The routing-map key: a bare screen id, a collection listing's\n * `collection:<id>`, or its feed's `feed:<id>`. Stored as it is in a screen\n * slot, and through `formatScreenLinkValue` in a `Link`-typed prop.\n */\n value: string\n label: string\n kind: 'screen' | 'collection-listing' | 'feed'\n}\n\n/**\n * What a picker calls one routing-map target, or `undefined` for a key the\n * map does not hold — the label {@link screenLinkTargetOptions} gives it.\n *\n * A listing and a feed are labeled with their collection's name and address,\n * like a screen, and marked as what they are IN the label rather than only by\n * position: a closed picker shows the chosen label and nothing else, and\n * \"Blog (/blog)\" there reads exactly like a screen named Blog. A feed borrows\n * its collection's name, which is the only name it has (AGL-3119).\n *\n * An entry is never named here. A map holds only the entries a page\n * references, under no label, so an entry is named by the search seam\n * (`LinkTargetSearchContext`), which reads the entry itself.\n */\nexport function screenLinkTargetLabel(\n key: string,\n screens: ScreenRouteMap | undefined,\n labels: Record<string, string> | undefined,\n): string | undefined {\n const href = resolveScreenHref(screens, key)\n if (href === undefined) return undefined\n const collectionId = parseCollectionLinkValue(key)\n if (collectionId) {\n return `${labels?.[key] ?? collectionId} (${href}) — collection listing`\n }\n const feedCollectionId = parseFeedLinkValue(key)\n if (feedCollectionId) {\n const name =\n labels?.[key] ??\n labels?.[formatCollectionLinkValue(feedCollectionId)] ??\n feedCollectionId\n return `${name} (${href}) — RSS feed`\n }\n if (parseEntryLinkValue(key)) return undefined\n return `${labels?.[key] ?? key} (${href})`\n}\n\n/**\n * Everything a Screen picker offers, in the order it offers it (AGL-2799):\n * the host's screens, then its content collections' listing pages, then\n * their RSS feeds (AGL-3119).\n *\n * ONE builder for both pickers — the attributes panel's `SCREEN_SELECT` and\n * the `Link`-typed prop picker. Each used to map the routing map into options\n * by itself, so a target added to one list was missing from the other; and\n * neither offered a collection's listing at all, which is how the drawer on\n * aglyn.com came to link its blog as a typed `/blog`.\n *\n * Entries are left out even when the map holds some: they are searched, not\n * listed, because a site's entries are far too many to read into a dropdown\n * — see `LinkTargetSearchContext`.\n *\n * `order` keeps each picker's established screen order — by path in the\n * attributes panel, by name in the prop picker — and the listings and feeds\n * follow the screens in the same order.\n */\nexport function screenLinkTargetOptions(\n screens: ScreenRouteMap | undefined,\n labels: Record<string, string> | undefined,\n order: 'path' | 'label' = 'path',\n): ScreenLinkTargetOption[] {\n type Ranked = ScreenLinkTargetOption & { path: string }\n const pages: Ranked[] = []\n const listings: Ranked[] = []\n const feeds: Ranked[] = []\n for (const [key, path] of Object.entries(screens ?? {})) {\n const kind = linkTargetKind(key)\n if (kind === 'entry') continue\n const label = screenLinkTargetLabel(key, screens, labels) ?? key\n if (kind === 'collection') {\n listings.push({ value: key, label, kind: 'collection-listing', path })\n } else if (kind === 'feed') {\n feeds.push({ value: key, label, kind: 'feed', path })\n } else {\n pages.push({ value: key, label, kind: 'screen', path })\n }\n }\n const compare = (a: Ranked, b: Ranked) =>\n order === 'path'\n ? a.path.localeCompare(b.path)\n : a.label.localeCompare(b.label)\n return [\n ...pages.sort(compare),\n ...listings.sort(compare),\n ...feeds.sort(compare),\n ].map(({ value, label, kind }) => ({ value, label, kind }))\n}\n\n/**\n * Marks the element in the DOM. Present on the live site too, deliberately:\n * a smoke pass can then find every dead control on a page with one selector\n * instead of reading five different components' conditions.\n */\nexport const BROKEN_SCREEN_LINK_ATTR = 'data-aglyn-broken-link'\n\n/** What the AUTHOR is told, on the one surface that can fix it. */\nexport const BROKEN_SCREEN_LINK_MESSAGE =\n 'Broken link: this points at a page or collection listing that is ' +\n 'unpublished or deleted, so it will not work on the published site. Pick ' +\n 'a target again in the attributes panel, or clear the link.'\n\n/**\n * The editor-only outline. A warning ring rather than an error one: the\n * screen may be deliberately unpublished and about to come back, and the\n * page is not broken, one control on it is.\n */\nexport const BROKEN_SCREEN_LINK_SX = {\n outline: '2px dashed',\n outlineColor: 'warning.main',\n outlineOffset: '2px',\n borderRadius: 1,\n}\n\n/**\n * Props that make a dead screen link visible to its author (AGL-1893).\n *\n * The tooltip and the ring are `editorInert` only — that is the static\n * besigner canvas, the one surface where the person who can fix this is\n * looking at it. Preview deliberately does NOT get them: preview exists to\n * show what visitors will see, and an authoring annotation painted into it\n * is a lie of a different kind.\n *\n * The data attribute ships everywhere, canvas and live site alike.\n */\nexport function brokenScreenLinkProps(\n broken: boolean,\n editorInert: boolean,\n): Record<string, unknown> {\n if (!broken) return {}\n return {\n [BROKEN_SCREEN_LINK_ATTR]: '',\n ...(editorInert ? { title: BROKEN_SCREEN_LINK_MESSAGE } : null),\n }\n}\n\n/**\n * Link VALUE parsing AND resolution live in `./screen-link-value` —\n * server-safe, because the where-used scan and the Markdown representation of\n * a page both run on the server, and the `createContext` this module reaches\n * keeps it out of the `@aglyn/aglyn/server` barrel (AGL-703, AGL-2740).\n * Re-exported here so every existing importer, and the spec beside this file,\n * keeps reaching them at the address they have always used.\n */\nexport {\n COLLECTION_LINK_VALUE_PREFIX,\n ENTRY_LINK_VALUE_PREFIX,\n EXTERNAL_HREF_PATTERN,\n FEED_LINK_VALUE_PREFIX,\n SAFE_HREF_PATTERN,\n SCREEN_LINK_VALUE_PREFIX,\n formatCollectionLinkValue,\n formatEntryLinkValue,\n formatFeedLinkValue,\n formatScreenLinkValue,\n linkTargetKind,\n nodesReferenceScreen,\n parseCollectionLinkValue,\n parseEntryLinkValue,\n parseFeedLinkValue,\n parseScreenLinkValue,\n resolveScreenHref,\n screenRoutesAnswerFor,\n splitLinkValue,\n type LinkTargetKind,\n} from './screen-link-value'\n\n/** What a linking element renders — see {@link useLinkTarget}. */\nexport interface ResolvedLinkTarget extends ResolvedScreenLink {\n /** The literal href in play once safety-checked, when no screen resolved. */\n externalHref?: string\n /** True when `href` leaves the site — what \"open in a new tab\" may act on. */\n leavesSite: boolean\n}\n\n/**\n * The single href a linking element should render, from the `screenId` +\n * `href` pair every one of them declares (AGL-1335).\n *\n * Button, Screen Link, Link Box and Image each had the same four lines —\n * resolve the id, safety-check the URL, prefer the id — which is three\n * copies too many now that a `Link`-typed component prop can feed either\n * slot with either shape. Hook-shaped because {@link useScreenLink} is;\n * it is always called, so the hook order never depends on the values.\n */\nexport function useLinkTarget(\n screenId: string | null | undefined,\n href: string | null | undefined,\n): ResolvedLinkTarget {\n const target = splitLinkValue(screenId, href)\n const resolved = useScreenLink(target.screenId)\n const { leavingNotice } = useContext(ScreenLinkContext)\n const externalHref =\n target.href && SAFE_HREF_PATTERN.test(target.href) ? target.href : undefined\n const finalHref = target.screenId ? resolved.href : externalHref\n /*\n * A new free site's links to other domains go through the leaving notice on\n * its own host (AGL-3452). Here rather than in each element so the served\n * HTML already carries the notice's address: it holds without JavaScript,\n * and it is what a hover, a copied link and \"Open in new tab\" all see.\n *\n * The notice is on the site, so the rewritten link no longer leaves it —\n * and keeping the referrer is what lets the notice's Go back return to the\n * page the visitor came from.\n */\n const noticeHref =\n !target.screenId && !resolved.suppressNavigation\n ? routeThroughLeavingNotice(externalHref, leavingNotice)\n : undefined\n return {\n ...resolved,\n href: noticeHref ?? finalHref,\n externalHref,\n leavesSite: Boolean(\n !noticeHref &&\n !target.screenId &&\n externalHref &&\n EXTERNAL_HREF_PATTERN.test(externalHref),\n ),\n }\n}\n\n/**\n * Resolves a screen id to its current href. Memoized on the routing-map\n * identity: a slug rename, parent-slug change, or re-parent produces a new\n * map value, so cached hrefs reset exactly when the map changes. Returns no\n * href for unknown/unpublished ids — callers degrade to plain content\n * instead of rendering a dead link.\n */\nexport function useScreenLink(\n screenId: string | null | undefined,\n): ResolvedScreenLink {\n const { screens, suppressNavigation, editorInert } = useContext(ScreenLinkContext)\n const href = useMemo(() => {\n if (!screenId) return undefined\n const resolved = resolveScreenHref(screens, screenId)\n if (resolved === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `[ScreenLink] screen \"${screenId}\" has no routing-map entry — ` +\n 'it may be unpublished or deleted; rendering without an href.',\n )\n }\n return undefined\n }\n return resolved\n }, [screenId, screens])\n return {\n href,\n suppressNavigation: Boolean(suppressNavigation),\n editorInert: Boolean(editorInert),\n // NOT `!href`: a suppressed surface has no href for links that resolve\n // perfectly well, and the whole point of this flag is to separate the\n // two (AGL-1893).\n broken: isScreenLinkBroken(screens, screenId),\n }\n}\n"],"names":["useContext","useMemo","routeThroughLeavingNotice","ScreenLinkContext","EXTERNAL_HREF_PATTERN","SAFE_HREF_PATTERN","formatCollectionLinkValue","linkTargetKind","parseCollectionLinkValue","parseEntryLinkValue","parseFeedLinkValue","resolveScreenHref","screenRoutesAnswerFor","splitLinkValue","isScreenLinkBroken","screens","screenId","undefined","unavailableScreenLabel","screensKnown","collectionId","feedCollectionId","entry","entryId","unresolvedScreenOption","value","raw","trim","target","label","href","screenLinkTargetLabel","key","labels","name","screenLinkTargetOptions","order","pages","listings","feeds","path","Object","entries","kind","push","compare","a","b","localeCompare","sort","map","BROKEN_SCREEN_LINK_ATTR","BROKEN_SCREEN_LINK_MESSAGE","BROKEN_SCREEN_LINK_SX","outline","outlineColor","outlineOffset","borderRadius","brokenScreenLinkProps","broken","editorInert","title","COLLECTION_LINK_VALUE_PREFIX","ENTRY_LINK_VALUE_PREFIX","FEED_LINK_VALUE_PREFIX","SCREEN_LINK_VALUE_PREFIX","formatEntryLinkValue","formatFeedLinkValue","formatScreenLinkValue","nodesReferenceScreen","parseScreenLinkValue","useLinkTarget","resolved","useScreenLink","leavingNotice","externalHref","test","finalHref","noticeHref","suppressNavigation","leavesSite","Bo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EAAEgD,qBAAAA,aAAcD;QACpBF;QACAK,YAAYC,QACV,CAACH,cACC,CAAClD,OAAOZ,QAAQ,IAChB2D,gBACAvE,sBAAsBwE,IAAI,CAACD;;AAGnC;AAEA;;;;;;CAMC,GACD,OAAO,SAASF,cACdzD,QAAmC;IAEnC,MAAM,EAAED,OAAO,EAAEgE,kBAAkB,EAAEnB,WAAW,EAAE,GAAG5D,WAAWG;IAChE,MAAM2B,OAAO7B,QAAQ;QACnB,IAAI,CAACe,UAAU,OAAOC;QACtB,MAAMuD,WAAW7D,kBAAkBI,SAASC;QAC5C,IAAIwD,aAAavD,WAAW;YAC1B,IAAIiE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzCC,QAAQC,IAAI,CACV,CAAC,qBAAqB,EAAEtE,SAAS,6BAA6B,CAAC,GAC7D;YAEN;YACA,OAAOC;QACT;QACA,OAAOuD;IACT,GAAG;QAACxD;QAAUD;KAAQ;IACtB,OAAO;QACLe;QACAiD,oBAAoBE,QAAQF;QAC5BnB,aAAaqB,QAAQrB;QACrB,uEAAuE;QACvE,sEAAsE;QACtE,kBAAkB;QAClBD,QAAQ7C,mBAAmBC,SAASC;IACtC;AACF"}
@@ -69,8 +69,11 @@ export declare function normalizeScreenSlug(input: string | null | undefined): s
69
69
  * would reach the preview page and 404 rather than render a screen. The
70
70
  * bare `/aglyn-preview` would in fact still serve — the preview route's
71
71
  * catch-all is required, not optional — and it is reserved anyway for the
72
- * reason given below about child paths: a child only exists when its
73
- * parent is published, and this rule refuses the parent.
72
+ * reason given below about child paths: a child's path is composed from
73
+ * its parent's slug, and this rule refuses that slug.
74
+ * - `_aglyn` — the platform's own pages on every site, the leaving notice
75
+ * at `/_aglyn/leaving` first (AGL-3452). The middleware rewrites that path
76
+ * to an api route before the catch-all could see it.
74
77
  *
75
78
  * NOT reserved, and deliberately so, because measuring found them fine:
76
79
  * `401`, `403`, `503` (`/401` returns 200 through the catch-all — two of the
@@ -91,10 +94,10 @@ export declare const RESERVED_SCREEN_ROUTE_SEGMENTS: readonly string[];
91
94
  * Reads the FIRST segment only. For `api`/`_next`/`_static` that is exactly
92
95
  * right — the middleware excludes the whole subtree, so `api/docs` is as dead
93
96
  * as `api`. For `404`/`500`/`search` it over-refuses in principle (`/404/why`
94
- * would serve), and that is deliberate: a child path only exists when its
95
- * PARENT screen is published, the parent would sit at `404`, and this same
96
- * rule refuses that. A second list to express a case that cannot arise would
97
- * be a second list to keep correct.
97
+ * would serve), and that is deliberate: a child path is composed from its
98
+ * PARENT's slug, the parent would have to hold `404`, and this same rule
99
+ * refuses that slug wherever one is typed. A second list to express a case
100
+ * that cannot arise would be a second list to keep correct.
98
101
  *
99
102
  * Takes a composed routing-map path (`about`, `company/about`, `'/'`), not a
100
103
  * raw slug field — `'/'` is the home screen and is never reserved.
@@ -142,20 +145,92 @@ export declare function screenSlugHasPathSeparator(input: string | null | undefi
142
145
  * "nest me" and the hierarchy is what actually composes the longer path.
143
146
  */
144
147
  export declare const SCREEN_SLUG_PATH_SEPARATOR_MESSAGE: string;
148
+ /**
149
+ * `kind` of a page GROUP (AGL-3463): a folder in the Pages list that holds
150
+ * pages and is not one.
151
+ *
152
+ * A group has no slug, no versions and no address. It is never routed, never
153
+ * published or scheduled, and it contributes NOTHING to its descendants'
154
+ * paths — a page inside a group composes exactly as if it sat at the group's
155
+ * own level, so moving a page into or out of a group at that level leaves its
156
+ * URL untouched. A group nested in a group behaves the same way.
157
+ *
158
+ * It has to be a declared kind rather than "a parent with no slug", because a
159
+ * slugless parent already means something: an unpublished page, and
160
+ * {@link composeScreenRoutePath} refuses every path beneath one. Pages under
161
+ * a slugless parent keep the addresses they already have, but no page there
162
+ * can be published, which is the opposite of what a folder is for.
163
+ *
164
+ * A group is not a page, so it is in {@link screenClaimsToBeAPage}'s list and
165
+ * spends none of the plan's page allowance. That is safe for the reasons the
166
+ * other non-page kinds are: `kind` is stamped at create by
167
+ * /api/hosts/resources and frozen against the client by the rules, no route
168
+ * converts a group into anything else, and the serve path refuses a non-page
169
+ * claim — so a group can never be laundered into a page it did not pay for,
170
+ * and the flat {@link NON_PAGE_SCREEN_MAX_PER_HOST} bounds how many exist.
171
+ */
172
+ export declare const SCREEN_KIND_GROUP = "group";
145
173
  /** Minimal screen shape the hierarchy helpers need. */
146
174
  export interface ScreenRouteNode {
147
175
  slug?: string;
148
176
  parentId?: ScreenUid;
177
+ /**
178
+ * The screen's `kind`. Read here for ONE value, {@link SCREEN_KIND_GROUP}:
179
+ * a group contributes nothing to a path, where a slugless page breaks it.
180
+ * A caller that leaves this out makes every group look like an unpublished
181
+ * page — build nodes with {@link toScreenRouteNode} so it cannot.
182
+ */
183
+ kind?: string;
149
184
  }
185
+ /**
186
+ * The {@link ScreenRouteNode} of a screen document: the three fields path
187
+ * composition reads, and nothing else. Every surface that composes paths
188
+ * builds its map through this, because a map built from `{ slug, parentId }`
189
+ * alone silently reads a group as an unpublished page and unroutes every page
190
+ * inside it (AGL-3463).
191
+ */
192
+ export declare function toScreenRouteNode(screen: {
193
+ slug?: unknown;
194
+ parentId?: unknown;
195
+ kind?: unknown;
196
+ }): ScreenRouteNode;
197
+ /** Is this screen a page group ({@link SCREEN_KIND_GROUP})? */
198
+ export declare function isScreenGroup(screen: {
199
+ kind?: unknown;
200
+ } | null | undefined): boolean;
150
201
  /**
151
202
  * Composes a screen's routing-map path from its own slug plus its ancestor
152
203
  * chain: parent `company` + own `about` → `company/about`. Root (`'/'`)
153
204
  * segments contribute nothing, so children of the home screen sit at the
154
- * top level. Returns `undefined` when the screen (or any ancestor) has no
155
- * slug, when the screen's own slug is `'/'` while it has a parent, or when
156
- * the chain has a cycle / exceeds {@link MAX_SCREEN_DEPTH}.
205
+ * top level, and GROUP ancestors contribute nothing either (AGL-3463) — they
206
+ * are passed through as if the screen sat at the group's own level.
207
+ *
208
+ * Returns `undefined` when the screen is itself a group, when it (or any
209
+ * non-group ancestor) has no slug, when its own slug is `'/'` while it has a
210
+ * non-group ancestor, or when the chain has a cycle / exceeds
211
+ * {@link MAX_SCREEN_DEPTH}.
157
212
  */
158
213
  export declare function composeScreenRoutePath(screenId: ScreenUid, screensById: Record<ScreenUid, ScreenRouteNode | undefined>): string | undefined;
214
+ /**
215
+ * The nearest ancestor that is NOT a group — the screen whose level a page
216
+ * actually composes its path at — or `undefined` for the top level
217
+ * (AGL-3463). Two placements with the same answer compose the same path,
218
+ * which is what makes moving a page into or out of a group at that level a
219
+ * move that cannot change its URL.
220
+ */
221
+ export declare function screenRouteParentId(screenId: ScreenUid, screensById: Record<ScreenUid, ScreenRouteNode | undefined>): ScreenUid | undefined;
222
+ /**
223
+ * Where each child of a group goes when the group is deleted: one level up,
224
+ * under the group's own parent (AGL-3463). A child id → its next `parentId`
225
+ * (`undefined` for the top level).
226
+ *
227
+ * Only DIRECT children move; grandchildren ride along under them. Because a
228
+ * group contributes nothing to a path, the children's composed paths are the
229
+ * same before and after, so deleting a group never touches the routing map.
230
+ * Answers `{}` for a screen that is not a group — deleting a page is a
231
+ * different act with a different consequence for what sits under it.
232
+ */
233
+ export declare function screenGroupDissolveMoves(groupId: ScreenUid, screensById: Record<ScreenUid, ScreenRouteNode | undefined>): Record<ScreenUid, ScreenUid | undefined>;
159
234
  /**
160
235
  * All screens whose parent chain passes through `screenId` (children,
161
236
  * grandchildren, …). Used to cascade routing-map rewrites when a screen's
@@ -168,41 +243,86 @@ export declare function collectScreenDescendantIds(screenId: ScreenUid, screensB
168
243
  * descendants.
169
244
  */
170
245
  export declare function wouldCreateScreenCycle(screenId: ScreenUid, nextParentId: ScreenUid | undefined, screensById: Record<ScreenUid, ScreenRouteNode | undefined>): boolean;
171
- /** How {@link buildScreenRouteEntries} treats a screen with no entry today. */
246
+ /** What {@link buildScreenRouteEntries} needs besides the candidate tree. */
172
247
  export interface BuildScreenRouteEntriesOptions {
173
248
  /**
174
- * Is this call a PUBLISH, or only a move? (AGL-2571)
249
+ * Is this call a PUBLISH of the screen it names, or only a move? (AGL-2571)
175
250
  *
176
251
  * An entry in the host's `screens` map is the whole of what makes a path
177
- * reachable, so writing one IS publishing — there is no second switch. This
178
- * function is used for both, and until now it could not tell them apart: it
179
- * wrote a path for every screen in the subtree whose slug chain happened to
180
- * resolve, whether or not anyone had asked for that screen to go live.
181
- *
182
- * What that produced on `aglyn-marketing`: assigning a parent to an
183
- * unpublished screen that merely CARRIED a slug registered it in the map,
184
- * and the besigner toolbar — which reads the map — then offered `Unpublish`
185
- * and an enabled `Live` link for a screen nobody had published, with no
186
- * `publishedAt` on the document and a 404 at the address.
252
+ * reachable, so writing one IS publishing — there is no second switch.
253
+ * Assigning a parent to an unpublished screen that merely CARRIED a slug
254
+ * would otherwise register it in the map, and the besigner toolbar, which
255
+ * reads the map, would offer `Unpublish` and a `Live` link for a screen
256
+ * nobody published, with no `publishedAt` and a 404 at the address.
187
257
  *
188
- * `false` therefore restricts the write to entries that ALREADY exist:
189
- * paths are rewritten, broken ones are removed, and nothing new goes live.
190
- * A move is not an activation.
258
+ * `true` lets the NAMED screen take an entry it does not have yet. It never
259
+ * does that for a descendant: publishing a parent is not publishing the
260
+ * drafts beneath it, which would put them live with no `publishedAt` and
261
+ * nobody having asked. `false` restricts the write to entries that already
262
+ * exist, so a move rewrites what is live and puts nothing new there.
191
263
  *
192
264
  * Defaults to `true`, which is what the publish buttons mean.
193
265
  */
194
266
  publish?: boolean;
267
+ /**
268
+ * The screens map as it stands BEFORE this change (AGL-3463).
269
+ *
270
+ * A descendant follows a change to its ancestors only while it is ATTACHED:
271
+ * its routing entry is the path it composes in this tree. One that kept its
272
+ * address when its chain stopped resolving — its parent unpublished with
273
+ * the slug cleared, deleted, or moved under a page with no slug — is
274
+ * DETACHED, and a later publish or rename of that parent must not move it
275
+ * somewhere new. Only the tree before the change can tell the two apart;
276
+ * the candidate tree already composes the new path for both.
277
+ */
278
+ currentById: Record<ScreenUid, ScreenRouteNode | undefined>;
195
279
  }
196
280
  /**
197
- * Routing-map entries for a screen plus all its descendants under a
198
- * candidate screens map: a composed path sets the entry, `null` marks an
199
- * existing entry whose chain no longer resolves for removal. Callers apply
200
- * the result in one write so slug/parent changes cascade atomically.
281
+ * Routing-map entries to SET for a screen plus its descendants under a
282
+ * candidate screens map. Callers apply the result in one write so slug and
283
+ * parent changes cascade atomically.
284
+ *
285
+ * ## It never removes a route (AGL-3463)
286
+ *
287
+ * The answer holds paths only — no removals, ever. The routing map is the
288
+ * whole of what makes a page reachable, so a removal computed here would take
289
+ * a live page off the site as a side effect of a move, a rename or an
290
+ * unpublish of something ABOVE it, with nobody having asked for that page to
291
+ * go. Each of these therefore keeps the route it has:
292
+ *
293
+ * - a live screen whose chain no longer composes — moved under a page with
294
+ * no slug, or its parent's slug cleared — keeps serving where it is;
295
+ * - a DETACHED descendant (see
296
+ * {@link BuildScreenRouteEntriesOptions.currentById}) stays where it is
297
+ * when its ancestors change again;
298
+ * - a group, which never composes a path, is never written.
299
+ *
300
+ * Taking a page off the site is a separate act on that page alone
301
+ * (`unpublishScreenRoute`), so the only page that can stop resolving is the
302
+ * one somebody pointed at.
201
303
  *
202
304
  * See {@link BuildScreenRouteEntriesOptions.publish} for the difference
203
305
  * between publishing a screen and merely moving one.
204
306
  */
205
- export declare function buildScreenRouteEntries(screenId: ScreenUid, screensById: Record<ScreenUid, ScreenRouteNode | undefined>, routingMap: Record<ScreenUid, string> | null | undefined, options?: BuildScreenRouteEntriesOptions): Record<ScreenUid, string | null>;
307
+ export declare function buildScreenRouteEntries(screenId: ScreenUid, screensById: Record<ScreenUid, ScreenRouteNode | undefined>, routingMap: Record<ScreenUid, string> | null | undefined, options: BuildScreenRouteEntriesOptions): Record<ScreenUid, string>;
308
+ /** A page below another that is live at an address of its own. */
309
+ export interface LiveScreenDescendant {
310
+ id: ScreenUid;
311
+ /** Its routing-map path (`company/about`, or `'/'` for the home page). */
312
+ path: string;
313
+ }
314
+ /**
315
+ * Every descendant of `screenId` with a routing entry, ordered by address
316
+ * (AGL-3463) — the pages that STAY LIVE when `screenId` is unpublished or
317
+ * deleted, because neither act ever removes more than the one entry
318
+ * ({@link buildScreenRouteEntries}).
319
+ *
320
+ * The unpublish and delete confirmations list these, so whoever takes a
321
+ * parent down knows which pages below it keep serving and can take them
322
+ * down separately if that is what they meant. Groups are walked through and
323
+ * never listed: a group is not a page.
324
+ */
325
+ export declare function liveScreenDescendants(screenId: ScreenUid, screensById: Record<ScreenUid, ScreenRouteNode | undefined>, routingMap: Record<ScreenUid, unknown> | null | undefined): LiveScreenDescendant[];
206
326
  /**
207
327
  * Looks up which screen currently owns a routing path, for sibling-slug
208
328
  * uniqueness checks before publishing.
@@ -417,13 +537,14 @@ export interface ScreenPageClaim {
417
537
  * document, which has no URL and is rendered only by the campaign sender,
418
538
  * straight off the doc), `kind: 'template'` (a collection entry template,
419
539
  * which composes `/{collection}/{entry}` and has no address of its own —
420
- * AGL-1400) and `kind: 'error'` (a screen assigned to one of the host's four
421
- * error slots, rendered on paths that matched nothing — AGL-2092). All four
422
- * are also the exclusions `countBillableScreens` subtracts before enforcing
423
- * `screensPerHost`, and since AGL-1400 they are the WHOLE of that subtraction:
424
- * the count reads no other collection.
425
- *
426
- * Adding the fourth needed no edit to `billableScreenIds` and no edit to
540
+ * AGL-1400), `kind: 'error'` (a screen assigned to one of the host's four
541
+ * error slots, rendered on paths that matched nothing — AGL-2092) and
542
+ * `kind: 'group'` (a folder of pages with no address, slug or content of its
543
+ * own — AGL-3463). All five are also the exclusions `countBillableScreens`
544
+ * subtracts before enforcing `screensPerHost`, and since AGL-1400 they are the
545
+ * WHOLE of that subtraction: the count reads no other collection.
546
+ *
547
+ * Adding the fourth and fifth needed no edit to `billableScreenIds` and no edit to
427
548
  * `nonPageScreenIds`, which is the property AGL-1439 wrote them for: the
428
549
  * routing-map override applies to a new non-page `kind` by default, and the
429
550
  * flat infrastructure cap is the complement, so there is no second list to