pi-apexlang 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/README.md +22 -5
  2. package/THIRD_PARTY_NOTICES.md +2 -2
  3. package/UPSTREAM.json +2 -2
  4. package/docs/assets/overview.en.png +0 -0
  5. package/docs/assets/overview.en.svg +89 -0
  6. package/docs/assets/overview.uk.png +0 -0
  7. package/docs/assets/overview.uk.svg +89 -0
  8. package/docs/en/README.md +41 -0
  9. package/docs/en/architecture.md +73 -0
  10. package/docs/en/getting-started.md +77 -0
  11. package/docs/en/maintenance.md +83 -0
  12. package/docs/en/tool-reference.md +85 -0
  13. package/docs/uk/README.md +41 -0
  14. package/docs/uk/architecture.md +73 -0
  15. package/docs/uk/getting-started.md +77 -0
  16. package/docs/uk/maintenance.md +83 -0
  17. package/docs/uk/tool-reference.md +85 -0
  18. package/extensions/apexlang/index.ts +19 -10
  19. package/extensions/lib/apexlang-cli.d.mts +1 -2
  20. package/extensions/lib/apexlang-cli.mjs +18 -13
  21. package/extensions/lib/apexlang-local-validate.mjs +83 -0
  22. package/extensions/lib/apexlang-local-validator.py +116 -0
  23. package/extensions/lib/apexlang-runtime-validate.mjs +76 -0
  24. package/package.json +2 -1
  25. package/skills/apexlang/APEXlang Skills and Workflows.md +325 -0
  26. package/skills/apexlang/README.md +6 -6
  27. package/skills/apexlang/RELEASE-NOTES.md +2 -2
  28. package/skills/apexlang/SKILL.md +24 -19
  29. package/skills/apexlang/agents/openai.yaml +4 -3
  30. package/skills/apexlang/assets/apex-generation/components.registry.json +1001 -16
  31. package/skills/apexlang/assets/apexlang/domains-catalog.json +6 -1
  32. package/skills/apexlang/assets/component-attributes.json +1924 -180
  33. package/skills/apexlang/assets/component-policies.json +19 -10
  34. package/skills/apexlang/assets/contracts/grammar-semantic-rules.json +134 -0
  35. package/skills/apexlang/assets/contracts/package-layers.json +56 -0
  36. package/skills/apexlang/assets/contracts/page-construction-packs.json +154 -0
  37. package/skills/apexlang/assets/contracts/page-patterns.json +119 -0
  38. package/skills/apexlang/assets/grammar/apexlang.ebnf +11743 -0
  39. package/skills/apexlang/assets/indexes/font-apex-icon-index.json +1699 -0
  40. package/skills/apexlang/assets/routing-catalog-main.json +11 -10
  41. package/skills/apexlang/assets/routing-load-policy.json +35 -9
  42. package/skills/apexlang/assets/rules-mapping.json +110 -2
  43. package/skills/apexlang/assets/rules.catalog.json +1298 -0
  44. package/skills/apexlang/assets/validator-fix-recipes.json +372 -17
  45. package/skills/apexlang/assets/workspace-intelligence.json +7 -10
  46. package/skills/apexlang/manifest.json +268 -12
  47. package/skills/apexlang/references/domains/README.md +1 -1
  48. package/skills/apexlang/references/domains/page-components/buttons.md +2 -2
  49. package/skills/apexlang/references/domains/page-components/page-items.md +3 -3
  50. package/skills/apexlang/references/domains/page-components/regions/region-display-selector/workflow-region-display-selector.md +69 -0
  51. package/skills/apexlang/references/domains/page-components/regions.md +1 -0
  52. package/skills/apexlang/references/domains/template-components/comments.md +61 -0
  53. package/skills/apexlang/references/domains/template-components/registry.md +2 -0
  54. package/skills/apexlang/references/domains/template-components/templates.md +47 -0
  55. package/skills/apexlang/references/domains/template-components/timeline.md +51 -0
  56. package/skills/apexlang/references/ops/one-message-router-contract.md +2 -2
  57. package/skills/apexlang/references/ops/runtime-gates/01-direct-sqlcl-import.md +1 -1
  58. package/skills/apexlang/references/ops/runtime-gates/02-direct-sqlcl-validate-gate.md +1 -1
  59. package/skills/apexlang/references/ops/runtime-gates.md +17 -16
  60. package/skills/apexlang/references/ops/sqlcl-agents/00-connection-gate.md +7 -7
  61. package/skills/apexlang/references/ops/sqlcl.md +7 -8
  62. package/skills/apexlang/references/policies/compiler-prop-map.md +6 -4
  63. package/skills/apexlang/references/policies/governance/00-governance.md +2 -2
  64. package/skills/apexlang/references/policies/memory-bank/00-guard/ai.guard.md +126 -922
  65. package/skills/apexlang/references/policies/memory-bank/20-data/apex.logic.md +3 -3
  66. package/skills/apexlang/references/policies/memory-bank/20-data/db.connection.md +9 -11
  67. package/skills/apexlang/references/policies/memory-bank/30-pages/apex.cards-page.md +95 -0
  68. package/skills/apexlang/references/policies/memory-bank/30-pages/apex.page.md +2 -2
  69. package/skills/apexlang/references/policies/memory-bank/30-pages/apex.smart-filter-search.md +145 -74
  70. package/skills/apexlang/references/policies/memory-bank/40-components/apex.region-interactions.md +9 -2
  71. package/skills/apexlang/references/policies/memory-bank/40-components/apex.region-media.md +6 -5
  72. package/skills/apexlang/references/policies/memory-bank/systemPatterns.md +9 -1
  73. package/skills/apexlang/references/workflows/apex-generation/agents/20-agent-draft.md +51 -232
  74. package/skills/apexlang/references/workflows/apex-generation/agents/30-agent-critique.md +49 -449
  75. package/skills/apexlang/references/workflows/apex-generation/agents/40-agent-revision.md +38 -238
  76. package/skills/apexlang/references/workflows/apex-generation/nlu/nlu-routing-test-matrix.md +8 -2
  77. package/skills/apexlang/references/workflows/apex-generation/nlu/nlu-routing-validation-notes.md +19 -3
  78. package/skills/apexlang/references/workflows/apex-generation/registry.md +15 -1
  79. package/skills/apexlang/references/workflows/apex-generation/templates.md +1 -1
  80. package/skills/apexlang/references/workflows/apex-generation.md +1 -1
  81. package/skills/apexlang/references/workflows/apexlang/apexlang-execution-model.md +5 -5
  82. package/skills/apexlang/references/workflows/apexlang/prompt-contracts.md +81 -10
  83. package/skills/apexlang/references/workflows/apexlang/workflow-create-app-from-fr-and-model.md +18 -7
  84. package/skills/apexlang/release-notes.json +156 -0
  85. package/skills/apexlang/runtime/grammar_contract.mjs +1166 -0
  86. package/skills/apexlang/runtime/internal/python/format_apexlang.py +210 -0
  87. package/skills/apexlang/runtime/internal/python/validate_apexlang.py +14142 -5843
  88. package/skills/apexlang/runtime/internal/python/validator_common.py +2 -0
  89. package/skills/apexlang/runtime/lib/catalogs.mjs +1026 -0
  90. package/skills/apexlang/runtime/lib/common.mjs +35 -0
  91. package/skills/apexlang/runtime/runtime.bundle.mjs +457 -57
  92. package/skills/apexlang/templates/items/combobox/combobox.explicit-defaults.md +1 -1
  93. package/skills/apexlang/templates/items/date-picker/date-picker._common.md +1 -1
  94. package/skills/apexlang/templates/items/date-picker/date-picker.explicit-defaults.md +1 -1
  95. package/skills/apexlang/templates/items/file-upload/file-upload._common.md +30 -24
  96. package/skills/apexlang/templates/items/file-upload/file-upload.compact-template.md +6 -0
  97. package/skills/apexlang/templates/items/file-upload/file-upload.explicit-defaults.md +23 -8
  98. package/skills/apexlang/templates/items/file-upload/file-upload.minimal.md +6 -0
  99. package/skills/apexlang/templates/items/hidden-item/hidden-item._common.md +1 -1
  100. package/skills/apexlang/templates/items/hidden-item/hidden-item.explicit-defaults.md +1 -1
  101. package/skills/apexlang/templates/items/items._common.md +3 -2
  102. package/skills/apexlang/templates/items/list-manager/list-manager.explicit-defaults.md +1 -1
  103. package/skills/apexlang/templates/items/markdown-editor/markdown-editor._common.md +1 -1
  104. package/skills/apexlang/templates/items/markdown-editor/markdown-editor.explicit-defaults.md +1 -1
  105. package/skills/apexlang/templates/items/number-field/number-field._common.md +8 -6
  106. package/skills/apexlang/templates/items/number-field/number-field.explicit-defaults.md +12 -2
  107. package/skills/apexlang/templates/items/popup-lov/popup-lov.explicit-defaults.md +1 -1
  108. package/skills/apexlang/templates/items/rich-text-editor/rich-text-editor._common.md +1 -1
  109. package/skills/apexlang/templates/items/rich-text-editor/rich-text-editor.explicit-defaults.md +1 -1
  110. package/skills/apexlang/templates/items/select-many/standard.md +1 -1
  111. package/skills/apexlang/templates/items/shuttle/shuttle.explicit-defaults.md +1 -1
  112. package/skills/apexlang/templates/items/switch/switch._common.md +8 -8
  113. package/skills/apexlang/templates/items/switch/switch.explicit-defaults.md +1 -1
  114. package/skills/apexlang/templates/items/text-area/text-area._common.md +2 -3
  115. package/skills/apexlang/templates/items/text-area/text-area.explicit-defaults.md +1 -1
  116. package/skills/apexlang/templates/items/text-area/text-area.required-length.md +1 -3
  117. package/skills/apexlang/templates/items/text-autocomplete/text-autocomplete.explicit-defaults.md +1 -1
  118. package/skills/apexlang/templates/items/text-autocomplete/text-autocomplete.required-length.md +1 -3
  119. package/skills/apexlang/templates/items/text-field/text-field._common.md +2 -3
  120. package/skills/apexlang/templates/items/text-field/text-field.explicit-defaults.md +1 -1
  121. package/skills/apexlang/templates/items/text-field/text-field.required-length.md +1 -3
  122. package/skills/apexlang/templates/page-examples/faceted-search/faceted-search.example.md +0 -5
  123. package/skills/apexlang/templates/page-examples/form-page/form-page.example.md +0 -9
  124. package/skills/apexlang/templates/page-examples/interactive-report-page/interactive-report-page.example.md +2 -2
  125. package/skills/apexlang/templates/page-examples/login-page/login-page.example.md +0 -8
  126. package/skills/apexlang/templates/page-examples/task-definition-initiated-tasks-page/task-definition-initiated-tasks-page.example.md +7 -17
  127. package/skills/apexlang/templates/page-examples/task-definition-my-tasks-page/task-definition-my-tasks-page.example.md +7 -65
  128. package/skills/apexlang/templates/page-examples/task-definition-task-details/task-definition-task-details.example.md +38 -201
  129. package/skills/apexlang/templates/region-components/calendar/calendar.custom-styling.md +3 -1
  130. package/skills/apexlang/templates/region-components/calendar/calendar.faceted-search.md +3 -2
  131. package/skills/apexlang/templates/region-components/cards/README.md +12 -4
  132. package/skills/apexlang/templates/region-components/cards/cards._common.md +176 -37
  133. package/skills/apexlang/templates/region-components/cards/cards._index.md +2 -1
  134. package/skills/apexlang/templates/region-components/cards/cards.refresh-after-dialog.md +46 -0
  135. package/skills/apexlang/templates/region-components/cards/cards.refresh-on-change.md +58 -0
  136. package/skills/apexlang/templates/region-components/cards/cards.rest-source.md +54 -18
  137. package/skills/apexlang/templates/region-components/cards/cards.standard.md +37 -21
  138. package/skills/apexlang/templates/region-components/chart/chart._series._common.md +1 -4
  139. package/skills/apexlang/templates/region-components/chart/chart.pie.md +6 -2
  140. package/skills/apexlang/templates/region-components/chart/chart.status-meter-gauge.md +1 -1
  141. package/skills/apexlang/templates/region-components/chart/chart.stock.md +2 -0
  142. package/skills/apexlang/templates/region-components/chart/features/chart.feature-chart-links.md +9 -7
  143. package/skills/apexlang/templates/region-components/faceted-search/faceted-search._common.md +1 -14
  144. package/skills/apexlang/templates/region-components/form/form._items._common.md +1 -5
  145. package/skills/apexlang/templates/region-components/interactive-report/interactive-report._columns._common.md +2 -6
  146. package/skills/apexlang/templates/region-components/interactive-report/interactive-report.page-header-actions.md +1 -7
  147. package/skills/apexlang/templates/region-components/list/README.md +1 -1
  148. package/skills/apexlang/templates/region-components/list/list._common.md +1 -1
  149. package/skills/apexlang/templates/region-components/map/map.backgrounds.md +12 -10
  150. package/skills/apexlang/templates/region-components/map/map.layer.extruded-polygons.md +16 -12
  151. package/skills/apexlang/templates/region-components/map/map.layer.heat-map.md +10 -7
  152. package/skills/apexlang/templates/region-components/map/map.layer.lines.md +10 -8
  153. package/skills/apexlang/templates/region-components/map/map.layer.polygons.md +21 -18
  154. package/skills/apexlang/templates/region-components/map/map.region.background-custom.md +25 -19
  155. package/skills/apexlang/templates/region-components/map/map.region.background-shared.md +19 -13
  156. package/skills/apexlang/templates/region-components/map/map.region.bbox-sql.md +13 -13
  157. package/skills/apexlang/templates/region-components/map/map.region.bbox-static.md +2 -2
  158. package/skills/apexlang/templates/region-components/map/map.region.browser-location.md +3 -7
  159. package/skills/apexlang/templates/region-components/map/map.region.init-position-sql.md +7 -7
  160. package/skills/apexlang/templates/region-components/region-display-selector/README.md +5 -2
  161. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector._common.md +60 -7
  162. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector._index.md +4 -1
  163. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector.permutations.md +55 -0
  164. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector.standard.md +91 -5
  165. package/skills/apexlang/templates/region-components/smart-filter-search/README.md +6 -2
  166. package/skills/apexlang/templates/region-components/smart-filter-search/smart-filter-search._common.md +107 -46
  167. package/skills/apexlang/templates/region-components/smart-filter-search/smart-filter-search._index.md +4 -3
  168. package/skills/apexlang/templates/region-components/smart-filter-search/smart-filter-search.standard.md +33 -17
  169. package/skills/apexlang/templates/shared-components/component-settings/component-settings._common.md +1 -0
  170. package/skills/apexlang/templates/shared-components/component-settings.example.md +1 -0
  171. package/skills/apexlang/templates/shared-components/email-templates.example.md +1 -1
  172. package/skills/apexlang/templates/shared-components/rest-data-sources/example_rest_data_source.example.md +40 -46
  173. package/skills/apexlang/templates/shared-components/task-definitions/action-task.example.md +2 -30
  174. package/skills/apexlang/templates/shared-components/task-definitions/approve-request.example.md +3 -31
  175. package/skills/apexlang/templates/template-components/README.md +27 -15
  176. package/skills/apexlang/templates/template-components/avatar/README.md +56 -0
  177. package/skills/apexlang/templates/template-components/avatar/avatar._common.md +149 -0
  178. package/skills/apexlang/templates/template-components/avatar/avatar._index.md +42 -0
  179. package/skills/apexlang/templates/template-components/{avatar._template_options.md → avatar/avatar._template_options.md} +1 -1
  180. package/skills/apexlang/templates/template-components/avatar/avatar.report-icon.md +48 -0
  181. package/skills/apexlang/templates/template-components/avatar/avatar.report-image-url-column.md +62 -0
  182. package/skills/apexlang/templates/template-components/avatar/avatar.report-initials.md +54 -0
  183. package/skills/apexlang/templates/template-components/badge/README.md +38 -0
  184. package/skills/apexlang/templates/template-components/badge/badge._common.md +183 -0
  185. package/skills/apexlang/templates/template-components/badge/badge._index.md +20 -0
  186. package/skills/apexlang/templates/template-components/badge/badge.report-link.md +66 -0
  187. package/skills/apexlang/templates/template-components/badge/badge.report-minimal.md +76 -0
  188. package/skills/apexlang/templates/template-components/comments/README.md +20 -0
  189. package/skills/apexlang/templates/template-components/comments/comments._common.md +43 -0
  190. package/skills/apexlang/templates/template-components/comments/comments._index.md +25 -0
  191. package/skills/apexlang/templates/template-components/{comments._template_options.md → comments/comments._template_options.md} +2 -1
  192. package/skills/apexlang/templates/template-components/comments/comments.apex-task-comments.md +77 -0
  193. package/skills/apexlang/templates/template-components/comments/comments.partial-column.md +120 -0
  194. package/skills/apexlang/templates/template-components/comments/comments.permutations.md +425 -0
  195. package/skills/apexlang/templates/template-components/content-row/README.md +1 -1
  196. package/skills/apexlang/templates/template-components/content-row/content-row._common.md +1 -1
  197. package/skills/apexlang/templates/template-components/content-row/content-row._index.md +1 -1
  198. package/skills/apexlang/templates/template-components/content-row/content-row._template_options.md +1 -1
  199. package/skills/apexlang/templates/template-components/flexbox-container/README.md +9 -0
  200. package/skills/apexlang/templates/template-components/flexbox-container/flexbox-container._index.md +13 -0
  201. package/skills/apexlang/templates/template-components/media-list/README.md +100 -0
  202. package/skills/apexlang/templates/template-components/media-list/media-list._common.md +174 -0
  203. package/skills/apexlang/templates/template-components/media-list/media-list._index.md +50 -0
  204. package/skills/apexlang/templates/template-components/{media-list._template_options.md → media-list/media-list._template_options.md} +8 -2
  205. package/skills/apexlang/templates/template-components/media-list/media-list.partial.md +50 -0
  206. package/skills/apexlang/templates/template-components/media-list/media-list.report-avatar-badge.md +76 -0
  207. package/skills/apexlang/templates/template-components/media-list/media-list.report-base.md +71 -0
  208. package/skills/apexlang/templates/template-components/media-list/media-list.report-grouped.md +40 -0
  209. package/skills/apexlang/templates/template-components/media-list/media-list.report-layouts.md +50 -0
  210. package/skills/apexlang/templates/template-components/media-list/media-list.report-link.md +53 -0
  211. package/skills/apexlang/templates/template-components/metric-card/README.md +19 -4
  212. package/skills/apexlang/templates/template-components/metric-card/metric-card._common.md +122 -29
  213. package/skills/apexlang/templates/template-components/metric-card/metric-card._index.md +6 -0
  214. package/skills/apexlang/templates/template-components/metric-card/metric-card._template_options.md +47 -2
  215. package/skills/apexlang/templates/template-components/metric-card/metric-card.partial-minimal.md +51 -0
  216. package/skills/apexlang/templates/template-components/metric-card/metric-card.permutations.md +56 -0
  217. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-avatar-badge.md +98 -0
  218. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-grouping-selection.md +131 -0
  219. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-link.md +66 -0
  220. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-minimal.md +97 -0
  221. package/skills/apexlang/templates/template-components/template-components.registry.json +90 -1
  222. package/skills/apexlang/templates/template-components/timeline/README.md +19 -0
  223. package/skills/apexlang/templates/template-components/timeline/timeline._common.md +43 -0
  224. package/skills/apexlang/templates/template-components/timeline/timeline._index.md +24 -0
  225. package/skills/apexlang/templates/template-components/{timeline._template_options.md → timeline/timeline._template_options.md} +2 -1
  226. package/skills/apexlang/templates/template-components/timeline/timeline.permutations.md +399 -0
  227. package/skills/apexlang/templates/template-components/timeline/timeline.report-sample-data.md +168 -0
  228. package/skills/apexlang/templates/workspace-components/credentials/credentials-for-open-ai.example.md +1 -1
  229. package/skills/apexlang/templates/workspace-components/generative-ai-services/open-ai.example.md +8 -6
  230. package/skills/apexlang/tools/apexctl.mjs +167 -4
  231. package/skills/apexlang/tools/compiler-truth-audit.mjs +95 -63
  232. package/skills/apexlang/tools/query-valid-props-context.mjs +30 -0
  233. package/skills/apexlang/tools/query-valid-props-normalize.mjs +1 -0
  234. package/skills/apexlang/tools/query-valid-props-runtime.mjs +13 -8
  235. package/skills/apexlang/tools/query-valid-props-semantics.mjs +391 -0
  236. package/skills/apexlang/tools/query-valid-props-template-components.mjs +15 -1
  237. package/skills/apexlang/tools/query-valid-props.mjs +198 -216
  238. /package/skills/apexlang/templates/template-components/{badge._template_options.md → badge/badge._template_options.md} +0 -0
  239. /package/skills/apexlang/templates/template-components/{flexbox-container._template_options.md → flexbox-container/flexbox-container._template_options.md} +0 -0
@@ -15,8 +15,15 @@ Standardize the output shape, variable contracts, metadata lookup anchors, and g
15
15
  2. Keep cards metadata lookup anchored on region type `Cards` and the `column-card` child template.
16
16
  3. When cards display images, use the native cards `media` block with exactly one source-specific value mapping: `blobColumn`, `urlColumn`, or `imageUrl`.
17
17
  4. Emit `blobAttributes` only when `media.source: blobColumn` is selected; use it only for supported companion metadata column aliases.
18
- 5. Emit media presentation properties only for meaningful non-default values: `position: first | background`, `appearance: square | widescreen`, and `sizing: cover`.
19
- 6. When cards need row navigation, emit native Cards `action` blocks with `label`, `layout.sequence`, and declarative `behavior.target`; native Cards actions must not emit `position`.
18
+ 5. Direct-source media must emit `advancedFormatting: false`, `position: first | body | background`, and `sizing: fit | cover`; `appearance: square | widescreen` is optional.
19
+ 6. When cards need row navigation, emit an action `type`, `layout.sequence`, `behavior.type`, and its matching target. Only `type: button` emits a `label` and `layout.position: primary | secondary`. Keep each action's sequence explicit so full-card and decision-button ordering is deterministic.
20
+ 7. Before rendering, freeze a source-to-attribute plan for title, subtitle, body, secondary body, row identity, icon, image, badge, link, and conditional style. Each requested role must resolve to an SQL projection alias or authoritative REST data-profile column.
21
+ 8. Emit `componentAppearance.layout: grid`, `float`, or `horizontal` from explicit layout intent. Emit `gridColumns` only with `layout: grid` for an explicit `2`, `3`, `4`, or `5` column requirement, and use `cssClasses` only for a proven container class.
22
+ 9. When Cards need dynamic refresh, name the trigger and Cards region static ID, use the supported dynamic-action Refresh capability, and submit every page item read by the refreshed source.
23
+ 10. Do not generate Faceted Search, Smart Filters, search items, facets, filter blocks, or filter orchestration as part of the visual-summary Cards pattern.
24
+ 11. Apply the authenticated-page baseline, use an existing region authorization scheme when Cards data is more restricted than the page, escape every untrusted advanced-formatting substitution with `!HTML`, and authorize every navigation target independently.
25
+ 12. For REST-backed Cards, reference a declared shared REST Data Source, HTTPS REST Data Source Server, and Web Credential; never emit credentials or literal endpoints in the Cards region, and require `advanced.validForUrls` to contain the exact resolved server plus source-path prefix.
26
+ 13. Emit exactly one complete Cards source shape. SQL requires `location: localDatabase`, `type: sqlQuery`, and `sqlQuery`; REST requires `location: restSource` and `restSource: @alias` with no SQL source properties.
20
27
 
21
28
  # Variable Contract
22
29
 
@@ -28,40 +35,80 @@ Standardize the output shape, variable contracts, metadata lookup anchors, and g
28
35
  | layout.sequence | yes | number | Region order. |
29
36
  | layout.slot | yes | enum | Page slot. |
30
37
  | appearance.templateOptions | optional | array | Use the accepted values from `cards._template_options.md`, such as `style-a`, `style-b`, or `style-c`. Do not substitute emitted CSS class strings. |
31
- | componentAppearance.gridColumns | optional | enum | Forces a 2-, 3-, 4-, or 5-column cards grid. Emit only when the prompt explicitly specifies a grid column count; otherwise omit the entire `componentAppearance` block. |
38
+ | componentAppearance.layout | yes | enum | Use explicit `grid`, `float`, or `horizontal` intent; `gridColumns` applies only to `grid`. |
39
+ | componentAppearance.gridColumns | optional | enum | Forces a 2-, 3-, 4-, or 5-column cards grid. Omit only this property for automatic responsive sizing. |
40
+ | componentAppearance.cssClasses | optional | array | Classes applied to the Cards container. Use only for a proven class requirement; prefer native layout and template options. |
32
41
  | card.primaryKeyColumn1 | optional | string | Primary-key column used in the card block; maps to the native cards `primaryKeyColumn1` property. |
42
+ | card.primaryKeyColumn2 | optional | string | Second primary-key column when the source has a composite identity; requires `card.primaryKeyColumn1`. |
43
+ | card.cssClasses | optional | array | Conditional per-row card classes. Reference exactly one source-projected alias proven to return only `u-normal`, `u-hot`, `u-info`, `u-success`, `u-warning`, `u-danger`, or `NULL`. |
44
+ | security.authorizationScheme | optional | reference | Existing shared authorization scheme required when Cards data is more restricted than the page. Never invent the alias. |
33
45
  | title.column | conditional | string | Primary card title column when the title uses direct column rendering instead of `htmlExpression`. |
34
- | title.advancedFormatting | conditional | boolean | Required and must be `true` when `title.htmlExpression` is emitted. Omit it when `title.column` is used. |
46
+ | title.advancedFormatting | yes | boolean | Use `false` with `column`; use `true` with `htmlExpression`. |
35
47
  | subtitle.column | conditional | string | Secondary label column when the subtitle uses direct column rendering instead of `htmlExpression`. |
36
- | subtitle.advancedFormatting | conditional | boolean | Required and must be `true` when `subtitle.htmlExpression` is emitted. Omit it when `subtitle.column` is used. |
37
- | body.advancedFormatting | conditional | boolean | Required and must be `true` when `body.htmlExpression` is emitted. Omit it when `body.column` is used. |
38
- | iconAndBadge.iconSource | optional | string | Selects the icon mode: `iconClass`, `iconClassColumn`, or `initials`. |
48
+ | subtitle.advancedFormatting | conditional | boolean | Required when subtitle is emitted: `false` with `column`, `true` with `htmlExpression`. |
49
+ | body.advancedFormatting | conditional | boolean | Required when body is emitted: `false` with `column`, `true` with `htmlExpression`. |
50
+ | iconAndBadge.iconSource | optional | string | `iconClass`, `iconClassColumn`, `initials`, `imageUrl`, or `imageBlobColumn`. |
39
51
  | iconAndBadge.iconColumn | optional | string | Required when `iconSource` is `iconClassColumn` or `initials`; points to the SQL column that supplies the value. |
40
52
  | iconAndBadge.iconCssClasses | optional | string | Optional CSS classes for the icon item. When `iconSource` is `iconClass`, this value is required and must include a Font APEX icon class prefixed with `fa `. |
53
+ | iconAndBadge.imageColumn | conditional | string | Required for `iconSource: imageBlobColumn`. |
54
+ | iconAndBadge.imageUrl | conditional | string | Required for `iconSource: imageUrl`. |
55
+ | iconAndBadge.iconPosition | conditional | enum | Required whenever `iconSource` is set: `top`, `start`, or `end`. |
41
56
  | iconAndBadge.iconDescription | optional | string | Brief description of the icon item. |
42
57
  | iconAndBadge.badgeColumn | optional | string | Required when badge mode is used; points to the SQL column that supplies the badge metric or status. |
43
58
  | iconAndBadge.badgeLabel | optional | string | Optional label shown with the badge. |
44
- | iconAndBadge.badgeCssClasses | optional | string | Optional CSS classes that augment the badge. |
59
+ | iconAndBadge.badgeCssClasses | optional | array | Optional CSS classes that augment the badge. |
45
60
  | title | yes | object | Column-based or htmlExpression title. Emit either `column` or `htmlExpression`, not both. When using `htmlExpression`, emit `advancedFormatting: true`. |
46
61
  | subtitle | optional | object | Column-based or htmlExpression subtitle. Emit either `column` or `htmlExpression`, not both. When using `htmlExpression`, emit `advancedFormatting: true`. |
47
62
  | body | optional | object | Column-based or htmlExpression body. Emit either `column` or `htmlExpression`, not both. When using `htmlExpression`, emit `advancedFormatting: true`. |
48
- | secondaryBody.advancedFormatting | conditional | boolean | Required and must be `true` when `secondaryBody.htmlExpression` is emitted. Omit it when `secondaryBody.column` is used. |
63
+ | secondaryBody.advancedFormatting | conditional | boolean | Required when secondary body is emitted: `false` with `column`, `true` with `htmlExpression`. |
49
64
  | secondaryBody | optional | object | Supplemental content. Emit either `column` or `htmlExpression`, not both. When using `htmlExpression`, emit `advancedFormatting: true`. |
50
65
  | media.source | conditional | enum | Use `blobColumn`, `urlColumn`, or `imageUrl` according to the image source. |
51
66
  | media.blobColumn | conditional | string | Required only when `media.source: blobColumn`; SQL projection alias for the raw BLOB image column. |
52
67
  | media.urlColumn | conditional | string | Required only when `media.source: urlColumn`; SQL projection alias containing image URLs. |
53
- | media.url | conditional | string | Required only when `media.source: imageUrl`; static image URL or APEX substitution such as `&IMAGE_URL_COLUMN.`. |
54
- | media.position | optional | enum | Non-default media position: `first` or `background`. |
68
+ | media.url | conditional | string | Required only when `media.source: imageUrl`; use an application-static relative URL or an evidenced, allowlisted HTTPS source. Reject active-content and protocol-relative schemes. |
69
+ | media.advancedFormatting | conditional | boolean | Required when media is emitted; use `false` for native image sources. |
70
+ | media.position | conditional | enum | Required when media is emitted: `first`, `body`, or `background`. |
55
71
  | media.appearance | optional | enum | Non-default media appearance: `square` or `widescreen`. |
56
- | media.sizing | optional | enum | Non-default media sizing: `cover`. |
72
+ | media.sizing | conditional | enum | Required for a native media source: `fit` or `cover`. |
73
+ | media.imageDescription | optional | string | Accessible image description sourced from trusted text or a projected description alias. |
57
74
  | blobAttributes.mimeTypeColumn | optional | string | SQL projection alias for the image MIME type column; valid only with `media.source: blobColumn`. |
58
75
  | blobAttributes.lastUpdatedColumn | optional | string | SQL projection alias for the image last-updated column; valid only with `media.source: blobColumn`. |
59
- | action.label | conditional | string | Required when a Cards action is emitted. Keep the label concise. |
76
+ | action.type | conditional | enum | Required for an action: `button`, `fullCard`, `title`, `subtitle`, or `media`. |
77
+ | action.label | conditional | string | Required only for `action.type: button`; omit for all other action types. |
60
78
  | action.layout.sequence | conditional | number | Required when a Cards action is emitted. |
79
+ | action.layout.position | conditional | enum | Required only for `action.type: button`: `primary` or `secondary`. |
80
+ | action.behavior.type | conditional | enum | Required for an action; use `redirectThisApp` for same-app Cards navigation. |
61
81
  | action.behavior.target.page | conditional | number | Target page for the row navigation action. |
62
82
  | action.behavior.target.items | conditional | object | Target page item mappings. Derive target page item and source column mappings from the UX contract, form PK metadata, or schema FK/PK evidence. |
83
+ | action.appearance.displayType | optional | enum | Button-only presentation: `text`, `icon`, or `textWithIcon`. `icon` is required for the latter two. |
84
+ | action.appearance.icon | conditional | string | Button icon required when `appearance.displayType` is `icon` or `textWithIcon`. |
85
+ | action.appearance.hot | optional | boolean | Button-only hot presentation flag. |
86
+ | action.appearance.cssClasses | optional | array | Button-only presentation classes; prefer native display options first. |
87
+ | action.advanced.staticId | optional | string | Explicit action static ID. |
88
+ | action.serverSideCondition | optional | object | Compiler-backed server-side condition; use its matching conditional fields and `executeCondition` for all types except `never`. |
89
+ | action.triggerAction.action | conditional | string | Nested supported UI action reference required when `behavior.type: triggerAction`; omit navigation target properties in that behavior. |
63
90
  | columns | not supported | n/a | Do not emit report-style child `column (...)` blocks for cards regions unless a future compiler contract explicitly proves support. |
64
91
 
92
+ # Source-to-Attribute Mapping
93
+
94
+ Create this compact plan before selecting the SQL or REST template:
95
+
96
+ | Requested role | Evidence and mapping rule |
97
+ |---|---|
98
+ | Title | Required. Map one proven alias/profile column to `title.column`; use `htmlExpression` only for required composition. |
99
+ | Subtitle/body/secondary body | Optional. Map only requested roles and omit unmapped blocks. |
100
+ | Primary key | Use a proven stable identity field for navigation and whenever BLOB media requires `card.primaryKeyColumn1`. |
101
+ | Icon | Use a pinned fixed Font APEX icon, a proven icon-class column, or a proven initials column. |
102
+ | Image | Select exactly one BLOB, URL-column, or direct-URL media shape. |
103
+ | Badge | Map a proven status or metric column through `iconAndBadge.badgeColumn`. |
104
+ | Link | Prove the target page, target item, and projected source key before emitting the action. |
105
+ | Conditional style | Project an allowlisted semantic class token and map it to `card.cssClasses` after active-build compiler confirmation. |
106
+
107
+ - For `localDatabase/sqlQuery`, every mapped alias must appear in the SQL projection and every database object/column must have authoritative object evidence.
108
+ - For `restSource`, the shared REST Data Source and complete data profile must already exist or be generated from an authoritative specification/response. Map the profile's actual column names; do not infer JSON paths.
109
+ - If a requested required role remains unresolved, stop with `Missing Inputs`. Omit unresolved optional roles rather than inventing aliases.
110
+ - Prefer direct column mappings with `advancedFormatting: false`. When advanced formatting is necessary, set it to `true`, omit `column`, and use escaped `&COLUMN!HTML.` substitutions for text.
111
+
65
112
  # Output Template – Full
66
113
 
67
114
  ```apexlang
@@ -79,13 +126,21 @@ region {{regionStaticId}} (
79
126
  primaryKeyColumn1: {{card.primaryKeyColumn1}}
80
127
  }
81
128
  media {
129
+ advancedFormatting: false
82
130
  source: {{media.source}}
83
131
  {{media.sourceValueProperty}}: {{media.sourceValue}}
132
+ position: {{media.position}}
133
+ sizing: {{media.sizing}}
84
134
  }
85
135
  blobAttributes {
86
136
  mimeTypeColumn: {{blobAttributes.mimeTypeColumn}}
87
137
  lastUpdatedColumn: {{blobAttributes.lastUpdatedColumn}}
88
138
  }
139
+ componentAppearance {
140
+ layout: {{componentAppearance.layout}}
141
+ gridColumns: {{componentAppearance.gridColumns}}
142
+ cssClasses: {{componentAppearance.cssClasses}}
143
+ }
89
144
  )
90
145
  ```
91
146
 
@@ -103,8 +158,11 @@ Use exactly one of these source-specific shapes when a Cards region needs media:
103
158
 
104
159
  ```apexlang
105
160
  media {
161
+ advancedFormatting: false
106
162
  source: blobColumn
107
163
  blobColumn: <BLOB_COLUMN_ALIAS>
164
+ position: first
165
+ sizing: cover
108
166
  }
109
167
  blobAttributes {
110
168
  mimeTypeColumn: <MIME_TYPE_COLUMN_ALIAS>
@@ -114,23 +172,27 @@ blobAttributes {
114
172
 
115
173
  ```apexlang
116
174
  media {
175
+ advancedFormatting: false
117
176
  source: urlColumn
118
177
  urlColumn: <URL_COLUMN_ALIAS>
178
+ position: first
179
+ sizing: cover
119
180
  }
120
181
  ```
121
182
 
122
183
  ```apexlang
123
184
  media {
185
+ advancedFormatting: false
124
186
  source: imageUrl
125
187
  url: <STATIC_IMAGE_URL_OR_COLUMN_SUBSTITUTION>
188
+ position: first
189
+ sizing: cover
126
190
  }
127
191
  ```
128
192
 
129
- ## Non-Default Media Presentation
130
-
131
- Default media presentation is represented by omission: do not emit any APEXlang-side `position`, `appearance`, or `sizing` property for default Cards media. Emit these properties only when the user or spec explicitly asks for a non-default media presentation. Never emit `position: first`, `appearance: square`, or `sizing: cover` just to mirror APEX defaults.
193
+ ## Media Presentation
132
194
 
133
- When a non-default presentation is required, add only the needed supported properties inside the same `media` block:
195
+ For native media sources, default to `position: first` and `sizing: cover`. Use the other grammar-backed values only when the design calls for them:
134
196
 
135
197
  ```apexlang
136
198
  position: first
@@ -144,11 +206,12 @@ Use this native Cards action shape when each card row should navigate to a targe
144
206
 
145
207
  ```apexlang
146
208
  action action (
147
- label: {{actionLabel}}
209
+ type: fullCard
148
210
  layout {
149
211
  sequence: {{actionSequence}}
150
212
  }
151
213
  behavior {
214
+ type: redirectThisApp
152
215
  target: {
153
216
  page: {{targetPage}}
154
217
  items: {
@@ -160,7 +223,31 @@ action action (
160
223
  )
161
224
  ```
162
225
 
163
- Prefer the declarative `behavior.target` object for Cards row navigation. Use `behavior.targetUrl`, `behavior.type`, or `behavior.linkAttributes` only when direct compiler truth proves the selected runtime supports the required non-declarative behavior. Native Cards actions must not emit `position`; `position` belongs to template-component actions such as Content Row, not native Cards actions.
226
+ Use `fullCard`, `title`, `subtitle`, or `media` for non-button navigation; these types omit `label` and `layout.position`. A button action instead requires both `label` and `layout.position: primary | secondary` and may add a native `appearance` block. `behavior.type: redirectThisApp` requires the declarative `behavior.target` object; `redirectOtherApp` also requires `target`, `redirectUrl` requires `targetUrl`, and `triggerAction` emits neither navigation target property but requires a nested supported UI action reference:
227
+
228
+ ```apexlang
229
+ action action (
230
+ type: button
231
+ label: Approve
232
+ layout {
233
+ position: primary
234
+ sequence: 20
235
+ }
236
+ appearance {
237
+ displayType: textWithIcon
238
+ icon: fa-check
239
+ hot: true
240
+ }
241
+ behavior {
242
+ type: triggerAction
243
+ }
244
+ triggerAction approve-action (
245
+ action: approve
246
+ )
247
+ )
248
+ ```
249
+
250
+ Use `advanced { staticId: ... }` and `serverSideCondition { ... }` only when the corresponding action requirement is evidenced. If full-card and decision-button actions coexist, document precedence and evidence-backed conditions. Do not infer business-condition exclusivity.
164
251
 
165
252
  Derive `{{targetPageItem}}` and `{{sourceColumn}}` from one of these evidence sources before emitting the action:
166
253
 
@@ -168,6 +255,55 @@ Derive `{{targetPageItem}}` and `{{sourceColumn}}` from one of these evidence so
168
255
  - Target form primary-key item metadata.
169
256
  - Schema FK/PK evidence tying the source row to the target page entity.
170
257
 
258
+ # Icon Source Shapes
259
+
260
+ When `iconSource` is present, always emit `iconPosition: top | start | end` and exactly one matching source-value property:
261
+
262
+ | iconSource | Required source-value property |
263
+ |---|---|
264
+ | `iconClass` | `iconCssClasses` |
265
+ | `iconClassColumn` | `iconColumn` |
266
+ | `initials` | `iconColumn` |
267
+ | `imageUrl` | `imageUrl` |
268
+ | `imageBlobColumn` | `imageColumn` |
269
+
270
+ Badge-only cards omit `iconSource`, all icon source-value properties, and `iconPosition`; they may still emit `badgeColumn`, `badgeLabel`, and `badgeCssClasses`.
271
+
272
+ # Conditional Style Shape
273
+
274
+ Conditional styling is source-driven and bounded:
275
+
276
+ 1. Derive the token through trusted SQL `CASE`/literal logic or an authoritative REST profile enum; a raw end-user or service-provided class column is not evidence.
277
+ 2. Permit only `u-normal`, `u-hot`, `u-info`, `u-success`, `u-warning`, `u-danger`, or `NULL`.
278
+ 3. Map the projected alias to `card.cssClasses`, for example `["&CARD_CSS_CLASSES."]`, only after active-build compiler confirmation.
279
+ 4. Keep status text in `badgeColumn` even when a conditional class is also present.
280
+
281
+ Do not accept arbitrary class names from end-user input, invent Universal Theme classes, concatenate CSS in HTML expressions, or render badge HTML when the native badge contract is sufficient. If the active compiler exposes no safe property for the requested conditional style, keep the semantic status visible as text/badge content and stop before inventing a workaround.
282
+
283
+ # Dynamic Refresh Shape
284
+
285
+ - A refresh plan must identify the event source, the Cards region static ID, and any page items read by the Cards source.
286
+ - Use the compiler-supported dynamic-action Refresh capability and target only the Cards region.
287
+ - For SQL that binds page items, emit those items in `source.pageItemsToSubmit` so Ajax refresh sees current browser state.
288
+ - After a modal create/edit flow, refresh Cards on dialog close when the changed row can affect the visible result set.
289
+ - Do not add polling, JavaScript refresh code, or an `autoRefresh` block unless the request explicitly requires polling and compiler truth proves the exact active-build shape.
290
+ - Load and emit the exact Cards-owned `cards.refresh-on-change.md` or `cards.refresh-after-dialog.md` template. Refresh actions emit `execution.sequence` and `fireOnInit: false`; they do not emit action-level `execution.event` or `itemsToSubmit` settings.
291
+
292
+ # Security Shape
293
+
294
+ - Require authenticated access for business-data Cards pages. If the Cards source is more restricted than the page, emit `security { authorizationScheme: @<EXISTING_ALIAS> }` on the region.
295
+ - Authorization is independent at each boundary: Cards visibility, action availability, target page/process, and REST service authorization. A hidden action never replaces target authorization.
296
+ - Advanced HTML expressions use `&COLUMN!HTML.` for every database or REST text value. Reject raw HTML/script/event attributes and unescaped substitutions.
297
+ - Prefer same-app declarative targets. Literal external URLs require HTTPS; reject HTTP, substitutions in external targets, `javascript:`, `data:`, protocol-relative URLs, embedded credentials, path traversal, and unrestricted user-supplied destinations.
298
+ - Prove SQL media URL columns through literal or `CASE` projection results. For REST media URL columns, record `authoritative-profile-url-prefixes: [...]` in `comments.comments`, using exact HTTPS prefixes or `application-static-relative`.
299
+ - REST credentials belong to shared APEX Web Credentials, with `advanced.validForUrls` restricted to the exact resolved server plus source-path prefix. Never emit tokens, passwords, API keys, authorization headers, or secret query parameters in page or region APEXlang.
300
+
301
+ # Responsive Layout Shape
302
+
303
+ - Emit `componentAppearance.layout: grid`, `float`, or `horizontal` from explicit intent. Omit `gridColumns` for `float` and `horizontal`; with `grid`, emit it only for an explicit fixed count of `2`, `3`, `4`, or `5`.
304
+ - Use `componentAppearance.cssClasses` only for a proven container class requirement; prefer native layout and template options.
305
+ - Do not invent breakpoints, row spans, or CSS overrides to force the Cards layout.
306
+
171
307
  # Conditional Rendering Rules
172
308
 
173
309
  - For BLOB-backed Cards images, project the raw BLOB expression in SQL for display only, keep companion image metadata columns projected when available, define `card.primaryKeyColumn1`, and emit `media { source: blobColumn blobColumn: <BLOB_COLUMN_ALIAS> }`.
@@ -175,14 +311,14 @@ Derive `{{targetPageItem}}` and `{{sourceColumn}}` from one of these evidence so
175
311
  - When companion metadata columns are available for a BLOB-backed Cards image, emit `blobAttributes { mimeTypeColumn: <MIME_TYPE_ALIAS> lastUpdatedColumn: <LAST_UPDATED_ALIAS> }` after the `media` block.
176
312
  - Emit `blobAttributes` if and only if `media.source: blobColumn` is present. Do not emit `blobAttributes` for non-BLOB media sources or when the Cards region has no `media` block.
177
313
  - For URL-column Cards images, project the URL column in SQL and emit `media { source: urlColumn urlColumn: <URL_COLUMN_ALIAS> }`.
178
- - For direct image URL Cards images, emit `media { source: imageUrl url: <STATIC_IMAGE_URL_OR_COLUMN_SUBSTITUTION> }`; `url` may be a hard static URL or a substitution such as `&IMAGE_URL_COLUMN.`.
314
+ - For direct image URL Cards images, emit `media { source: imageUrl url: <APPLICATION_STATIC_RELATIVE_URL> }` only after URL policy validation. Use `urlColumn` for a projected URL, and require its SQL expression or authoritative REST profile constraint to prove an application-static relative path or an allowlisted HTTPS origin.
179
315
  - In any Cards `media` block, emit at most one source-specific value property: `blobColumn` with `source: blobColumn`, `urlColumn` with `source: urlColumn`, or `url` with `source: imageUrl`.
180
- - Default media presentation emits no APEXlang-side `position`, `appearance`, or `sizing` property.
181
- - Emit `position`, `appearance`, and `sizing` only for explicit non-default media presentation requirements. Accepted values are `position: first | background`, `appearance: square | widescreen`, and `sizing: cover`.
182
- - Never emit `position: first`, `appearance: square`, or `sizing: cover` just to mirror APEX defaults.
316
+ - Direct-source media emits `advancedFormatting: false`, required `position: first | body | background`, and required `sizing: fit | cover`; default to `first` and `cover`.
183
317
  - Keep BLOB-backed media attributes in the dedicated `media` block. Do not model Cards BLOB images with report-style `column (...)` blocks or report BLOB length expressions.
184
318
  - Use card-level actions only when the owning design requires row navigation.
185
- - Native Cards actions use `label` plus declarative `behavior.target`; do not emit `position`, `slot`, or template-component action placement properties.
319
+ - Native Cards actions use the type-conditional action contract: button actions require `label` and `layout.position`; full-card/title/subtitle/media actions omit both. Button presentation may use `appearance.displayType`, `icon`, `hot`, and `cssClasses`; actions may use `advanced.staticId` and `serverSideCondition`. Declarative same-app `behavior.target` is preferred.
320
+ - `behavior.type: triggerAction` requires a nested `triggerAction` child with `action`, and omits both `target` and `targetUrl`. Redirect behaviors use only their matching target property.
321
+ - If full-card and decision-button interactions compete, document the intended precedence and evidence-backed business conditions in the UX contract; do not infer exclusivity from action declarations alone.
186
322
  - Every source column referenced in a Cards action item mapping such as `&{{sourceColumn}}.` must be projected by the Cards source.
187
323
  - Default card-region display style uses the base cards template with no additional style token in `appearance.templateOptions`.
188
324
  - If the design calls for Style A, add `style-a` to `appearance.templateOptions`.
@@ -195,20 +331,24 @@ Derive `{{targetPageItem}}` and `{{sourceColumn}}` from one of these evidence so
195
331
  - If `iconAndBadge.iconSource` is `iconClass`, then `iconAndBadge.iconCssClasses` is required and must reference a Font APEX icon class prefixed with `fa `.
196
332
  - If `iconAndBadge.iconSource` is `iconClassColumn`, then `iconAndBadge.iconColumn` is required and should point to a SQL column that stores the icon class.
197
333
  - If `iconAndBadge.iconSource` is `initials`, then `iconAndBadge.iconColumn` is required and should point to a SQL column that stores the initials.
334
+ - If `iconAndBadge.iconSource` is `imageUrl`, then `iconAndBadge.imageUrl` is required.
335
+ - If `iconAndBadge.iconSource` is `imageBlobColumn`, then `iconAndBadge.imageColumn` is required.
336
+ - Whenever `iconAndBadge.iconSource` is set, `iconAndBadge.iconPosition: top | start | end` is required.
198
337
  - If badge mode is used, then `iconAndBadge.badgeColumn` is required while `iconAndBadge.badgeLabel` and `iconAndBadge.badgeCssClasses` remain optional.
199
- - If `title.column` is emitted, omit `title.htmlExpression` and omit `title.advancedFormatting`.
338
+ - If `title.column` is emitted, set `title.advancedFormatting: false` and omit `title.htmlExpression`.
200
339
  - If `title.htmlExpression` is emitted, then `title.advancedFormatting` must also be emitted with value `true`, and `title.column` must be omitted.
201
- - If `subtitle.column` is emitted, omit `subtitle.htmlExpression` and omit `subtitle.advancedFormatting`.
340
+ - If `subtitle.column` is emitted, set `subtitle.advancedFormatting: false` and omit `subtitle.htmlExpression`.
202
341
  - If `subtitle.htmlExpression` is emitted, then `subtitle.advancedFormatting` must also be emitted with value `true`, and `subtitle.column` must be omitted.
203
- - If `body.column` is emitted, omit `body.htmlExpression` and omit `body.advancedFormatting`.
342
+ - If `body.column` is emitted, set `body.advancedFormatting: false` and omit `body.htmlExpression`.
204
343
  - If `body.htmlExpression` is emitted, then `body.advancedFormatting` must also be emitted with value `true`, and `body.column` must be omitted.
205
- - If `secondaryBody.column` is emitted, omit `secondaryBody.htmlExpression` and omit `secondaryBody.advancedFormatting`.
344
+ - If `secondaryBody.column` is emitted, set `secondaryBody.advancedFormatting: false` and omit `secondaryBody.htmlExpression`.
206
345
  - If `secondaryBody.htmlExpression` is emitted, then `secondaryBody.advancedFormatting` must also be emitted with value `true`, and `secondaryBody.column` must be omitted.
207
346
  - Inside cards `title.htmlExpression`, `subtitle.htmlExpression`, `body.htmlExpression`, and `secondaryBody.htmlExpression`, use APEX substitution strings in the `&COLUMN.` form, not `#COLUMN#`.
208
347
  - Prefer escaped substitutions such as `&COLUMN!HTML.` when inserting user or database text into cards `htmlExpression`.
209
- - Emit `componentAppearance.gridColumns` only when the prompt explicitly specifies a fixed cards grid width or card column count.
210
- - Otherwise omit the entire `componentAppearance` block and allow cards to auto-determine column count.
211
- - If emitted, `componentAppearance.gridColumns` must be one of `2`, `3`, `4`, or `5`.
348
+ - Emit `componentAppearance.layout: grid`, `float`, or `horizontal` only from explicit layout intent; emit `gridColumns` only for `layout: grid` and an explicit fixed cards grid width or card column count.
349
+ - If emitted, `componentAppearance.gridColumns` must be one of `2`, `3`, `4`, or `5`; omit it for `float` and `horizontal`.
350
+ - When Cards refresh depends on page items, every bind item must appear in `source.pageItemsToSubmit`.
351
+ - Conditional styling must use a projected allowlisted token mapped through compiler-confirmed `card.cssClasses`; otherwise retain semantic badge/text content without the requested style.
212
352
  - Do not add report-style child `column (...)` blocks to cards regions. Cards column mapping is expressed through native cards blocks such as `card`, `title`, `subtitle`, `body`, `secondaryBody`, and `iconAndBadge`.
213
353
  - When a Cards region displays a BLOB image, `media.blobColumn` must reference the raw BLOB projection alias from the region SQL.
214
354
  - When `blobAttributes` is emitted, every referenced metadata alias must be projected by the same SQL source.
@@ -220,17 +360,16 @@ Derive `{{targetPageItem}}` and `{{sourceColumn}}` from one of these evidence so
220
360
  - Use `appearance.template: @/cards-container` for cards regions.
221
361
  - Emit at most one of `style-a`, `style-b`, or `style-c` for any one cards region.
222
362
  - Keep `templateOptions` to exact accepted values. `style-a` is valid when documented; `t-CardsRegion--styleA` is not.
223
- - Do not emit `componentAppearance.gridColumns` with values outside `2`, `3`, `4`, or `5`.
224
363
  - Ensure all referenced columns exist in the selected source.
225
364
  - Do not leave image-bearing source columns unmapped when the requested cards design explicitly calls for images or thumbnails.
226
365
  - Do not emit a generic `image` block for cards regions in this runtime; use the native `media` block instead.
227
366
  - Do not render a cards badge as ad-hoc HTML when the same outcome can be expressed with native `iconAndBadge.badgeColumn`, `badgeLabel`, and `badgeCssClasses`.
228
367
  - Do not emit cards identity or pagination properties unless explicitly confirmed by the active compiler contract.
229
368
  - Do not use report-only cards properties such as `performance.maxRowsToProcess`.
230
- - Do not emit `position` on native Cards actions.
231
- - Do not add media properties beyond `source`, `blobColumn`, `urlColumn`, `url`, `position`, `appearance`, and `sizing`, or `blobAttributes` properties beyond `mimeTypeColumn` and `lastUpdatedColumn`, unless compiler-backed truth proves them for the active runtime.
369
+ - Emit `layout.position` only for `action.type: button`; it is required for buttons and invalid for the other Cards action types. Keep `layout.sequence` numeric and explicit for every Cards action.
370
+ - Do not generate Faceted Search, Smart Filters, search fields, facets, filter blocks, or filter-specific dynamic actions under the visual-summary Cards pattern. If filtering/search is requested, route to that owning page pattern and use Cards only as its results region.
371
+ - Do not implement Cards refresh with ad-hoc JavaScript when the native dynamic-action Refresh capability satisfies the requirement.
372
+ - Keep media properties within the grammar-backed set: `advancedFormatting`, `htmlExpression`, `source`, `blobColumn`, `urlColumn`, `url`, `position`, `appearance`, `sizing`, `cssClasses`, and `imageDescription`; keep `blobAttributes` to `mimeTypeColumn` and `lastUpdatedColumn`.
232
373
  - Keep HTML expressions small and escaped when output includes user data.
233
- - Do not emit `title.htmlExpression` or `subtitle.htmlExpression` without `advancedFormatting: true`.
234
- - Do not emit `body.htmlExpression` or `secondaryBody.htmlExpression` without `advancedFormatting: true`.
235
- - Do not use `#COLUMN#` tokens inside cards `title.htmlExpression`, `subtitle.htmlExpression`, `body.htmlExpression`, or `secondaryBody.htmlExpression`; use `&COLUMN.` substitution strings instead.
374
+ - Never place REST credentials, endpoint literals, or authentication headers in a Cards source. Reference the existing shared REST Data Source alias and validate its Web Credential URL restriction separately.
236
375
  - Metadata export lookup: search for `Cards`, `column-card`, and card attribute names used by the owning region.
@@ -15,4 +15,5 @@ Primary routing entrypoint for `cards` region templates.
15
15
 
16
16
  1. Load this file.
17
17
  2. Load `cards._common.md`.
18
- 3. Load one scenario template in this folder.
18
+ 3. Load one SQL or REST source scenario template in this folder.
19
+ 4. When Cards refresh is requested, additionally load exactly one Cards-owned refresh template matching the trigger.
@@ -0,0 +1,46 @@
1
+ ---
2
+ templateId: region.cards.refresh-after-dialog
3
+ componentType: dynamicAction
4
+ version: 1.0
5
+ imports:
6
+ - cards._common
7
+ description: Refresh one Cards region after a modal dialog closes.
8
+ ---
9
+
10
+ # Purpose
11
+
12
+ Refresh a Cards result set after its modal create/edit flow closes, while keeping the behavior isolated from shared Dynamic Action templates.
13
+
14
+ # Output Template
15
+
16
+ ```apexlang
17
+ dynamicAction {{dynamicActionStaticId}} (
18
+ name: {{name}}
19
+ execution {
20
+ sequence: {{execution.sequence}}
21
+ }
22
+ when {
23
+ event: apexafterclosedialog
24
+ selectionType: region
25
+ region: @{{dialogLaunchRegionStaticId}}
26
+ }
27
+ action {{action.name}} (
28
+ action: refresh
29
+ affectedElements {
30
+ selectionType: region
31
+ region: @{{cardsRegionStaticId}}
32
+ }
33
+ execution {
34
+ sequence: {{action.execution.sequence}}
35
+ fireOnInit: false
36
+ }
37
+ )
38
+ )
39
+ ```
40
+
41
+ # Guardrails
42
+
43
+ - Resolve the dialog-launch region and target Cards region aliases before rendering.
44
+ - Use `apexafterclosedialog` for successful dialog-close refresh. Do not invent event aliases.
45
+ - If the refreshed Cards source reads parent-page items, list them on its `source.pageItemsToSubmit`.
46
+ - Do not emit action-level `execution.event`, Refresh-action `itemsToSubmit`, JavaScript refresh code, or unrelated region targets.
@@ -0,0 +1,58 @@
1
+ ---
2
+ templateId: region.cards.refresh-on-change
3
+ componentType: dynamicAction
4
+ version: 1.0
5
+ imports:
6
+ - cards._common
7
+ description: Refresh one Cards region when one or more page items change.
8
+ ---
9
+
10
+ # Purpose
11
+
12
+ Add a targeted, declarative Refresh dynamic action to a Cards page without changing the shared Dynamic Action templates used by other region families.
13
+
14
+ # Cards Source Companion Shape
15
+
16
+ When the Cards SQL or REST operation reads the trigger items, emit the same exact aliases on the Cards source:
17
+
18
+ ```apexlang
19
+ source {
20
+ pageItemsToSubmit: {{source.pageItemsToSubmit}}
21
+ }
22
+ ```
23
+
24
+ `source.pageItemsToSubmit` is an array. It must include every page-item bind read by the refreshed Cards source.
25
+
26
+ # Output Template
27
+
28
+ ```apexlang
29
+ dynamicAction {{dynamicActionStaticId}} (
30
+ name: {{name}}
31
+ execution {
32
+ sequence: {{execution.sequence}}
33
+ }
34
+ when {
35
+ event: change
36
+ selectionType: items
37
+ items: {{when.items}}
38
+ }
39
+ action {{action.name}} (
40
+ action: refresh
41
+ affectedElements {
42
+ selectionType: region
43
+ region: @{{cardsRegionStaticId}}
44
+ }
45
+ execution {
46
+ sequence: {{action.execution.sequence}}
47
+ fireOnInit: false
48
+ }
49
+ )
50
+ )
51
+ ```
52
+
53
+ # Guardrails
54
+
55
+ - Resolve every trigger item and the Cards region static ID before rendering.
56
+ - Target exactly one Cards region. Use separate actions only when the request explicitly names additional targets.
57
+ - Put page-item submission on the Cards `source.pageItemsToSubmit`; do not emit `itemsToSubmit` settings on the Refresh action.
58
+ - Do not emit action-level `execution.event`, JavaScript refresh code, polling, Faceted Search, or Smart Filters orchestration.
@@ -27,52 +27,88 @@ region {{regionStaticId}} (
27
27
  }
28
28
  card {
29
29
  primaryKeyColumn1: {{card.primaryKeyColumn1}}
30
+ primaryKeyColumn2: {{card.primaryKeyColumn2}}
31
+ cssClasses: {{card.cssClasses}}
30
32
  }
31
33
  title {
32
- column: {{title.column}}
33
- htmlExpression: {{title.htmlExpression}}
34
34
  advancedFormatting: {{title.advancedFormatting}}
35
+ {{title.valueProperty}}: {{title.value}}
35
36
  }
36
37
  subtitle {
37
- column: {{subtitle.column}}
38
- htmlExpression: {{subtitle.htmlExpression}}
39
38
  advancedFormatting: {{subtitle.advancedFormatting}}
39
+ {{subtitle.valueProperty}}: {{subtitle.value}}
40
40
  }
41
41
  body {
42
- column: {{body.column}}
43
- htmlExpression: {{body.htmlExpression}}
44
42
  advancedFormatting: {{body.advancedFormatting}}
43
+ {{body.valueProperty}}: {{body.value}}
45
44
  }
46
45
  secondaryBody {
47
- column: {{secondaryBody.column}}
48
- htmlExpression: {{secondaryBody.htmlExpression}}
49
46
  advancedFormatting: {{secondaryBody.advancedFormatting}}
47
+ {{secondaryBody.valueProperty}}: {{secondaryBody.value}}
50
48
  }
51
49
  media {
50
+ advancedFormatting: false
52
51
  source: {{media.source}}
53
- blobColumn: {{media.blobColumn}}
54
- urlColumn: {{media.urlColumn}}
55
- accessibleDescription: {{media.accessibleDescription}}
52
+ {{media.sourceValueProperty}}: {{media.sourceValue}}
53
+ position: {{media.position}}
54
+ sizing: {{media.sizing}}
55
+ imageDescription: {{media.imageDescription}}
56
+ }
57
+ blobAttributes {
58
+ mimeTypeColumn: {{blobAttributes.mimeTypeColumn}}
59
+ lastUpdatedColumn: {{blobAttributes.lastUpdatedColumn}}
60
+ }
61
+ iconAndBadge {
62
+ iconSource: {{iconAndBadge.iconSource}}
63
+ {{iconAndBadge.sourceValueProperty}}: {{iconAndBadge.sourceValue}}
64
+ iconPosition: {{iconAndBadge.iconPosition}}
65
+ iconDescription: {{iconAndBadge.iconDescription}}
66
+ badgeColumn: {{iconAndBadge.badgeColumn}}
67
+ badgeLabel: {{iconAndBadge.badgeLabel}}
68
+ badgeCssClasses: {{iconAndBadge.badgeCssClasses}}
69
+ }
70
+ messages {
71
+ whenNoDataFound: {{messages.whenNoDataFound}}
72
+ noDataFoundIcon: {{messages.noDataFoundIcon}}
56
73
  }
57
74
  componentAppearance {
75
+ layout: {{componentAppearance.layout}}
58
76
  gridColumns: {{componentAppearance.gridColumns}}
77
+ cssClasses: {{componentAppearance.cssClasses}}
59
78
  }
60
79
  )
61
80
  ```
62
81
 
82
+ The `valueProperty` placeholders are schematic. Content blocks emit `advancedFormatting: false` plus `column`, or `advancedFormatting: true` plus `htmlExpression`. Direct-source media emits `advancedFormatting: false`, required `position`, required `sizing`, and exactly one matching pair: `blobColumn` for `source: blobColumn`, `urlColumn` for `source: urlColumn`, or `url` for `source: imageUrl`. Emit `blobAttributes` only with `blobColumn` media. Append the native Cards action shape from `cards._common.md` only when a proven card target is requested; button presentation may use `appearance`, actions may use `advanced` and `serverSideCondition`, and `triggerAction` uses a nested child while omitting navigation targets.
83
+
63
84
  # Conditional Rendering Rules
64
85
 
65
- - If `title.column` is emitted, omit `title.htmlExpression` and omit `title.advancedFormatting`.
86
+ - Resolve the existing REST Data Source, its REST Data Source Server, Web Credential, and authoritative data profile before rendering. Every title, subtitle, body, secondary-body, identity, icon, media, badge, link, or conditional-style field must use an actual profile column.
87
+ - Omit `card.cssClasses` unless conditional per-row styling is explicitly requested. When used, map exactly one authoritative profile column constrained to `u-normal`, `u-hot`, `u-info`, `u-success`, `u-warning`, `u-danger`, or `NULL`; record that exact finite set in the profile column's `comments.comments` as `authoritative-profile-enum: [...]`. A missing enum marker or free-form service field is not safe class evidence.
88
+ - For a REST media URL column, record `authoritative-profile-url-prefixes: [...]` in that profile column's `comments.comments`. List exact HTTPS prefixes, or use `application-static-relative` only when the service contract guarantees relative application-static paths.
89
+
90
+ - If `title.column` is emitted, set `title.advancedFormatting: false` and omit `title.htmlExpression`.
66
91
  - If `title.htmlExpression` is emitted, `title.advancedFormatting` must also be emitted with value `true`, and `title.column` must be omitted.
67
- - If `subtitle.column` is emitted, omit `subtitle.htmlExpression` and omit `subtitle.advancedFormatting`.
92
+ - If `subtitle.column` is emitted, set `subtitle.advancedFormatting: false` and omit `subtitle.htmlExpression`.
68
93
  - If `subtitle.htmlExpression` is emitted, `subtitle.advancedFormatting` must also be emitted with value `true`, and `subtitle.column` must be omitted.
69
- - If `body.column` is emitted, omit `body.htmlExpression` and omit `body.advancedFormatting`.
94
+ - If `body.column` is emitted, set `body.advancedFormatting: false` and omit `body.htmlExpression`.
70
95
  - If `body.htmlExpression` is emitted, `body.advancedFormatting` must also be emitted with value `true`, and `body.column` must be omitted.
71
- - If `secondaryBody.column` is emitted, omit `secondaryBody.htmlExpression` and omit `secondaryBody.advancedFormatting`.
96
+ - If `secondaryBody.column` is emitted, set `secondaryBody.advancedFormatting: false` and omit `secondaryBody.htmlExpression`.
72
97
  - If `secondaryBody.htmlExpression` is emitted, `secondaryBody.advancedFormatting` must also be emitted with value `true`, and `secondaryBody.column` must be omitted.
73
98
  - Omit the `media` block unless the cards design explicitly includes images or thumbnails.
74
- - When `media` is emitted, use `media.source: blobColumn` for BLOB-backed images and `media.source: urlColumn` for projected image URL columns.
99
+ - When `media` is emitted, set `advancedFormatting: false`, emit required `position` and `sizing`, and use exactly one matching source/value shape: `blobColumn`/`blobColumn`, `urlColumn`/`urlColumn`, or `imageUrl`/`url`.
100
+ - Emit `blobAttributes` only for `media.source: blobColumn` and only with metadata columns present in the REST data profile.
75
101
  - Inside cards `title.htmlExpression`, `subtitle.htmlExpression`, `body.htmlExpression`, and `secondaryBody.htmlExpression`, use `&COLUMN.` substitution strings, not `#COLUMN#`.
76
- - Omit the `componentAppearance` block by default.
77
- - Emit `componentAppearance.gridColumns` only when the prompt explicitly specifies a fixed card column count.
102
+ - Emit `componentAppearance.layout: grid`, `float`, or `horizontal` from explicit layout intent. Emit `gridColumns` only with `layout: grid` and an explicit fixed card column count; otherwise omit it. Use `componentAppearance.cssClasses` only for a proven Cards-container class.
78
103
  - If emitted, `componentAppearance.gridColumns` must be one of `2`, `3`, `4`, or `5`.
104
+ - If full-card and decision-button actions coexist, document interaction precedence and evidence-backed business conditions rather than inferring exclusivity.
105
+ - When refresh depends on page items accepted by the REST operation, emit those items in `source.pageItemsToSubmit` and target the Cards static ID with the native Refresh dynamic-action capability.
106
+ - Do not add filtering/search regions or filter orchestration in this Cards template. Route that composition to its owning Faceted Search or Smart Filters pattern.
107
+
108
+ # REST Security Gate
109
+
110
+ - `source.restSource` must be an existing shared REST Data Source alias with an authoritative data profile; never substitute an endpoint URL.
111
+ - Keep passwords, tokens, API keys, Authorization headers, and secret query parameters in an APEX Web Credential, never in the Cards artifact.
112
+ - Require a declared `restDataSourceServer` with a literal HTTPS `endpointUrl.url`. Require the REST Data Source `authentication.credentials` reference to resolve to a declared `webCredential`, and require its `advanced.validForUrls` to include the exact resolved server plus `source.urlPathPrefix`. Stop with `Missing Inputs` if any link is absent or broader than the required prefix.
113
+ - Treat media URL fields as untrusted. The authoritative profile contract must constrain them to documented HTTPS origins or application-static relative paths and reject `javascript:`, `data:`, protocol-relative, embedded-credential, and user-controlled redirect values.
114
+ - Apply page authentication, an existing Cards region authorization scheme when required, and independent authorization on navigation targets and server-side operations.