@pega/sdk 0.0.13 → 0.0.15

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 (139) hide show
  1. package/README.md +46 -6
  2. package/dist/index.js +50 -24
  3. package/package.json +42 -3
  4. package/templates/angular-sdk-reference/extra-webpack.config.cjs +23 -0
  5. package/templates/angular-sdk-reference/index.html +12 -0
  6. package/templates/angular-sdk-reference/src/app/pconnect-renderer.component.ts +153 -0
  7. package/templates/angular-sdk-reference/src/components/component-map.ts +90 -0
  8. package/templates/angular-sdk-reference/src/components/fields/auto-complete/auto-complete.component.ts +304 -0
  9. package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts +89 -0
  10. package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts +112 -0
  11. package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts +101 -0
  12. package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts +118 -0
  13. package/templates/angular-sdk-reference/src/components/fields/email/email.component.ts +104 -0
  14. package/templates/angular-sdk-reference/src/components/fields/integer/integer.component.ts +106 -0
  15. package/templates/angular-sdk-reference/src/components/fields/phone/phone.component.ts +104 -0
  16. package/templates/angular-sdk-reference/src/components/fields/radio-buttons/radio-buttons.component.ts +113 -0
  17. package/templates/angular-sdk-reference/src/components/fields/text-area/text-area.component.ts +111 -0
  18. package/templates/angular-sdk-reference/src/components/fields/text-input/text-input.component.ts +110 -0
  19. package/templates/angular-sdk-reference/src/components/fields/url-input/url-input.component.ts +113 -0
  20. package/templates/angular-sdk-reference/src/components/helpers/sdk-helpers.ts +93 -0
  21. package/templates/angular-sdk-reference/src/components/infra/assignment/assignment.component.ts +206 -0
  22. package/templates/angular-sdk-reference/src/components/infra/case-summary/case-summary.component.ts +75 -0
  23. package/templates/angular-sdk-reference/src/components/infra/case-view/case-view.component.ts +126 -0
  24. package/templates/angular-sdk-reference/src/components/infra/flow-container/flow-container.component.ts +411 -0
  25. package/templates/angular-sdk-reference/src/components/infra/reference/reference.component.ts +158 -0
  26. package/templates/angular-sdk-reference/src/components/infra/region/region.component.ts +39 -0
  27. package/templates/angular-sdk-reference/src/components/infra/root-container/root-container.component.ts +199 -0
  28. package/templates/angular-sdk-reference/src/components/infra/stages/stages.component.ts +89 -0
  29. package/templates/angular-sdk-reference/src/components/infra/view/view.component.ts +144 -0
  30. package/templates/angular-sdk-reference/src/components/infra/view-container/view-container.component.ts +191 -0
  31. package/templates/angular-sdk-reference/src/components/templates/default-form/default-form.component.ts +105 -0
  32. package/templates/angular-sdk-reference/src/components/templates/narrow-wide/narrow-wide.component.ts +37 -0
  33. package/templates/angular-sdk-reference/src/components/templates/one-column/one-column.component.ts +37 -0
  34. package/templates/angular-sdk-reference/src/components/templates/two-column/two-column.component.ts +37 -0
  35. package/templates/angular-sdk-reference/src/components/templates/wide-narrow/wide-narrow.component.ts +37 -0
  36. package/templates/angular-sdk-reference/tsconfig.app.json +13 -0
  37. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +75 -34
  38. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +74 -38
  39. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +33 -1
  40. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +57 -22
  41. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +25 -10
  42. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +40 -19
  43. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +62 -1
  44. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +26 -4
  45. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +84 -33
  46. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +46 -26
  47. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +28 -15
  48. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +24 -6
  49. package/templates/react-sdk-reference/.ai-common/prompts/generate-infra-components.md +24 -6
  50. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +24 -6
  51. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +24 -6
  52. package/templates/react-sdk-reference/.ai-common/prompts/identify-components.md +2 -0
  53. package/templates/react-sdk-reference/.ai-common/prompts/replace-design-system.md +44 -17
  54. package/templates/react-sdk-reference/.ai-common/skills/connect-pega-server.md +14 -1
  55. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AssignmentHeader.md +79 -0
  56. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Toast.md +96 -0
  57. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +56 -35
  58. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +29 -3
  59. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +97 -37
  60. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +91 -60
  61. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +88 -30
  62. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +133 -101
  63. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedData.md +385 -0
  64. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedDataMulti.md +506 -0
  65. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +549 -86
  66. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +181 -83
  67. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +13 -1
  68. package/templates/react-sdk-reference/.ai-common/skills/portal-flow/run-and-verify-portal.md +290 -0
  69. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +13 -1
  70. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +125 -153
  71. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +90 -81
  72. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +13 -1
  73. package/templates/react-sdk-reference/assets/icons/trash.svg +3 -0
  74. package/templates/react-sdk-reference/index.html +0 -1
  75. package/templates/react-sdk-reference/package.json +2 -2
  76. package/templates/react-sdk-reference/package.minimal.json +2 -2
  77. package/templates/react-sdk-reference/sdk-config.json +3 -3
  78. package/templates/react-sdk-reference/src/FallbackComponent.tsx +1 -1
  79. package/templates/react-sdk-reference/src/MashupApp.tsx +33 -78
  80. package/templates/react-sdk-reference/src/PortalApp.tsx +23 -100
  81. package/templates/react-sdk-reference/src/components/component-map.ts +15 -1
  82. package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/AssignmentHeader.tsx +15 -0
  83. package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/index.tsx +1 -0
  84. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +1 -1
  85. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  86. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +16 -4
  87. package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/ModalDialog.tsx +26 -0
  88. package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/index.tsx +1 -0
  89. package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/Toast.tsx +35 -0
  90. package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/index.tsx +1 -0
  91. package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +362 -24
  92. package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +1 -1
  93. package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +3 -1
  94. package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +6 -3
  95. package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +2 -1
  96. package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +2 -1
  97. package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +4 -3
  98. package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +2 -0
  99. package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +2 -1
  100. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/EmbeddedDataMulti.tsx +121 -0
  101. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/config-ext.json +7 -0
  102. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/index.tsx +1 -0
  103. package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +2 -1
  104. package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +1 -1
  105. package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +40 -20
  106. package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +554 -49
  107. package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -20
  108. package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +4 -3
  109. package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +2 -1
  110. package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +2 -1
  111. package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +2 -1
  112. package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +2 -1
  113. package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +2 -1
  114. package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +2 -1
  115. package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +1 -1
  116. package/templates/react-sdk-reference/src/components/helpers/field-utils.ts +44 -0
  117. package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +19 -7
  118. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +97 -0
  119. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/index.tsx +1 -0
  120. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +53 -0
  121. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  122. package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +2 -2
  123. package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +3 -1
  124. package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +4 -4
  125. package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +2 -2
  126. package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +1 -1
  127. package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +7 -3
  128. package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +173 -99
  129. package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +63 -56
  130. package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +1 -1
  131. package/templates/react-sdk-reference/vite.config.ts +26 -4
  132. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +0 -47
  133. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +0 -50
  134. package/templates/react-sdk-reference/.ai-common/instructions/infra-component.md +0 -76
  135. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +0 -43
  136. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +0 -45
  137. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +0 -311
  138. package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
  139. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
@@ -0,0 +1,385 @@
1
+ # Skill: EmbeddedData
2
+
3
+ Single embedded record stored directly on the case, presented as a picker that copies a chosen record onto the case.
4
+
5
+ > **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, input contract, display modes, event handling, the shared Condition Encoding contract, and registration patterns common to ALL field components.
6
+
7
+ > **Sibling skill:** [`EmbeddedDataMulti.md`](./EmbeddedDataMulti.md) — the same Pega field type configured to hold a **list** of records. It compiles to a different node type and a different component; see the Node Type Matrix below.
8
+
9
+ ---
10
+
11
+ ## Component Purpose
12
+
13
+ Renders a single record that is **owned by the case** rather than referenced from elsewhere. An embedded record has no data page behind it: the record lives on the case's own page structure. That single fact separates this field type from every reference field, and it removes an entire category of configuration — there is no datasource rule, no parameters, and no search.
14
+
15
+ The configuration surface offers only two choices about the data itself: whether the field holds one record or a list, and which class of record it holds. Everything else is presentation.
16
+
17
+ A single record has **two** presentations, and they are not variants of one component — they are different node types:
18
+
19
+ - An **inline form**, which is a plain view reference and needs no component at all.
20
+ - A **picker**, which is this component. It offers a list of candidate records, and copies the chosen one onto the case.
21
+
22
+ Read the Node Type Matrix before anything else. The presentation is decided by the node's own type, not by a configuration key alone.
23
+
24
+ ## Pega Metadata
25
+
26
+ - **Pega Name:** `EmbeddedData`
27
+ - **Type / Subtype:** `Field` / `EmbeddedData`
28
+ - **Registration key:** `EmbeddedData` (in the project's component map)
29
+ - **Shown in the configuration UI as:** `Embedded Data`, with a subtitle reading "single record" and naming the target class
30
+
31
+ ### Node Type Matrix
32
+
33
+ One Pega field type compiles to three different node types. The type is **not** carried in a configuration key — it is the node's own type.
34
+
35
+ | Options | Display as | Node type | Component |
36
+ | --------------- | ------------------------------------------------ | ------------------- | ------------------------------------------- |
37
+ | Single record | `Form` | `reference` | none — the runtime's generic reference path |
38
+ | Single record | `Combo-box` | `EmbeddedData` | **this component** |
39
+ | List of records | `Table`, `Repeating view`, and the read-only set | `EmbeddedDataMulti` | see the sibling skill |
40
+
41
+ Three consequences follow, and all three are easy to get wrong:
42
+
43
+ 1. **Resolve the node type first, and only then a configuration key.** For a single record the node type already tells you which of two completely different presentations applies. Reading `displayAs` first leads to treating an inline form and a picker as variants of one component, which they are not.
44
+ 2. **The inline form needs no component at all.** It is a plain view reference, resolved by the same machinery that resolves any other view reference. Do not generate a component for it. Its contract is documented below because a generated project must still understand it — not because anything must be built for it.
45
+ 3. **A field type's presentation control does not always map to a configuration key.** Across Pega field types this mechanism varies — some carry the presentation in a `displayAs` key, some in a `componentType` key, and some change the node type itself. Embedded data does **both**: the node type changes _and_ a `displayAs` key is emitted. Never generalise one field type's mechanism to another.
46
+
47
+ ### Distinguishing an embedded record from a data reference
48
+
49
+ A single embedded record in its inline-form presentation and a data reference field both arrive as a node of type `reference` whose configuration declares a view. They are **not** the same thing and must not be rendered the same way. Discriminate on these keys:
50
+
51
+ | Key | Embedded record (inline form) | Data reference |
52
+ | --------------- | -------------------------------- | -------------------------------------- |
53
+ | `context` | a bare property path on the case | a class name carrying the class marker |
54
+ | `authorContext` | absent | present — the property path |
55
+ | `referenceType` | absent | present, naming the kind of reference |
56
+ | `displayAs` | the inline-form value | absent |
57
+
58
+ The reliable test is the pair: a `context` that is a property path, together with the inline-form `displayAs` value. Both must hold.
59
+
60
+ This matters in practice because a single payload commonly contains both kinds side by side — an embedded record's view will itself contain data reference fields, each of which is a `reference` node of the second kind.
61
+
62
+ ### Configuration Surfaces
63
+
64
+ There are **two** separate surfaces, with different lifetimes. Keep them distinct.
65
+
66
+ **Surface 1 — the per-view field dialog.** Settings stored per view, reached from the field within a view. Its control set differs by presentation:
67
+
68
+ | Presentation | Controls offered |
69
+ | ------------ | --------------------------------------------------------------------------------------------------------- |
70
+ | Inline form | Display as, Label, Show label, View, Visibility |
71
+ | Picker | Display as, Label, Combo-box source, Display field, Show details, Required, Disabled, Visibility, Test ID |
72
+
73
+ Note what the inline form does **not** offer: no Edit mode, no Required, no Disabled, no placeholder, no helper text, no Test ID. An inline form has no single scalar value, so most field-level settings are meaningless for it. For the same reason its Visibility control omits the "if not blank" and "if not zero" conveniences, which only exist where a scalar bound value can be tested.
74
+
75
+ **Surface 2 — the field-definition screen.** Settings stored on the field definition, shared by every view that uses the field. It carries the record class and the single-versus-list choice, and nothing render-related for this presentation.
76
+
77
+ ### Config Keys — common to both presentations
78
+
79
+ | Configuration control | Emitted config key(s) | Value shape and notes |
80
+ | ------------------------------------------ | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
+ | (platform-emitted) | `ruleClass` | The class of the embedded record. Read it verbatim; never derive or normalise a class name |
82
+ | Label | `label` + `labelOption` | `labelOption` is the default value when the field's own name is kept, and the label is then **plain text with no marker**; it is the custom value when text is supplied, and the label then carries the localization marker. Always render the resolved label; never branch on `labelOption` |
83
+ | Required / Disabled / Visibility / Test ID | `required` / `disabled` / `visibility` / `testId` | See the shared Condition Encoding contract; `testId` is a plain, non-localized string. The inline form emits only `visibility` |
84
+
85
+ There is **no** `targetObjectType` key. Embedded data has no data-versus-case distinction, so any logic written for reference fields that branches on such a key does not apply.
86
+
87
+ Equally, there is **no** `referenceList` and **no** `parameters`. A component that goes looking for a data page will find none. This is the single biggest structural difference from the reference fields, and the easiest thing to get wrong by pattern-matching against them.
88
+
89
+ ### Config Keys — inline form (no component required)
90
+
91
+ The node carries only these:
92
+
93
+ | Key | Meaning |
94
+ | ---------------- | -------------------------------------------------------------------------------------------------------- |
95
+ | `type` | Declares that this reference resolves to a view |
96
+ | `name` | The **rule name** of the chosen view. The picker displays a friendly label; the stored value is the name |
97
+ | `ruleClass` | The class the referenced view belongs to — the embedded record's class |
98
+ | `context` | The path to the embedded page on the case. Emitted **bare**, with no property marker |
99
+ | `displayAs` | The inline-form value |
100
+ | `inheritedProps` | A list of name/value pairs to be applied to the referenced view — see below |
101
+ | `visibility` | Present only when configured away from its default |
102
+
103
+ **The `inheritedProps` contract.** This is the only place in the field type where settings travel in a list rather than as keys, and it is the single most common source of an unlabelled embedded form.
104
+
105
+ - It carries presentation settings destined for the **referenced view**, not for the reference node. Two are observed: the field's label, and a flag controlling whether that label is shown. The flag is a **positive** show-label flag, not the hide-label flag used elsewhere.
106
+ - Its entries must be **flattened onto the resolved view's configuration as ordinary keys**. Passing the list through unchanged, or looking for a top-level label on the reference node, both produce a form with no label.
107
+ - There is **no** `labelOption` here.
108
+ - Conditions such as visibility are **not** in this list. They stay on the reference node and govern whether the node renders at all. Never merge a condition into the referenced view.
109
+ - The referenced view arrives in **two shapes** depending on when the payload was produced: sometimes with the inherited values already flattened onto it, and sometimes without. The merge must therefore be performed rather than assumed, and it must be safe to apply to a view that already has the values.
110
+
111
+ The referenced view is delivered **eagerly**, as a sibling entry in the same payload keyed by its rule name. No fetch is required to resolve it.
112
+
113
+ ### Config Keys — picker
114
+
115
+ | Key | Meaning |
116
+ | ------------- | --------------------------------------------------------------------------------------------------------------- |
117
+ | `displayAs` | The combo-box value. Note the emitted spelling has no separator, unlike the label shown in the configuration UI |
118
+ | `datasource` | An **object**, not a string — see below |
119
+ | `targetPage` | The path to the embedded page the selected record is copied into |
120
+ | `value` | The bound display value: the target page path followed by the record's label property |
121
+ | `editable` | Boolean |
122
+ | `placeholder` | Prompt text, already resolved |
123
+ | `ruleClass` | The embedded record's class |
124
+ | `children` | One `reference` child naming a details view, present when the show-details setting is configured |
125
+
126
+ **The `datasource` object** has three parts: a source, a field map, and a copy-all flag.
127
+
128
+ - The **source** carries a datasource marker followed by a property path — and that path points at **another embedded data field on the same case**, specifically a list-of-records one. A single embedded record in its picker presentation draws its options from an embedded list elsewhere on the same case. This is a genuine dependency between two field instances on one case; the options never come from anywhere external.
129
+ - The **field map**'s key entry carries the configured display property — the property shown to identify each candidate record.
130
+ - The **copy-all flag** indicates that the whole selected record is copied into the target page, rather than just an identifier being stored.
131
+
132
+ **The details child.** When the show-details setting is configured, the node gains one child: a `reference` node naming a view that describes the referenced record in detail. It is delivered eagerly in the same payload and **must be rendered** — dropping it silently loses the configured detail presentation.
133
+
134
+ **Explicit defaults.** This presentation emits `required` and `visibility` explicitly even when both are at their defaults, while the inline form omits them at identical settings. Another reason never to read intent from key presence.
135
+
136
+ ### Raw and Resolved Configuration
137
+
138
+ The runtime hands the component its inputs after replacing every marker with its current value, and a property-reference marker becomes _the current value of that property_. That is right for text and conditions, and wrong for anything that names a property or a source.
139
+
140
+ - Read from the **resolved inputs**: `label`, `placeholder`, `required`, `disabled`, `visibility`, `readOnly`, `displayMode`, `hideLabel` and `testId`.
141
+ - Read from the **raw configuration**, `getPConnect().getRawMetadata().config`: the `datasource` object with its `source` and `fields`, `targetPage`, `value`, `ruleClass` and `displayAs`. Take a copy and never modify the original.
142
+
143
+ Strip a marker only where this skill says to derive a bare path, and prefer `PCore.getAnnotationUtils().getPropertyName(...)` to trimming it by hand.
144
+
145
+ ### Annotation Prefixes
146
+
147
+ A **property reference** marker points at a property. A **localization** marker precedes user-facing text. A **locale reference** marker identifies the view's localization bundle. A **field label** marker resolves a property's configured label. A **user reference** marker identifies an operator-valued property. An **associated datasource** marker points at an associated list. A **field metadata** marker points at a field's own metadata. An **attachment** marker identifies an attachment-valued property. A **class context** marker names a class. A **datasource** marker names a source of rows. An **expression** marker precedes a computed condition. A **When Rule** marker names a decision rule.
148
+
149
+ Three rules about markers, all of which were observed to break naive assumptions:
150
+
151
+ **Marker use is level-dependent.** Keys consumed directly by this component are emitted bare — notably the embedded page path on the inline form. Keys inside nested nodes, which the runtime resolves as ordinary fields, do carry markers. Never normalise one rule across both levels, and never test for a marker to decide what a value means.
152
+
153
+ **A marked value may be empty.** A localization or field-label marker followed by nothing at all is a real, observed value. Handle it as empty text rather than as the literal marker.
154
+
155
+ **The same setting may be marked in one payload and plain in another.** A label has been observed both as already-resolved plain text and as a field-label marker pointing at the property, with the identical label option in both cases. Take the label from the resolved inputs and make no assumption about which shape produced it.
156
+
157
+ Finally: wherever a configuration picker shows a friendly description — of a view, a decision rule, or a class — the stored value is the underlying **rule name**. The two are unrelated strings. Do not assume a naming convention either: within one payload, one view's stored name matched its displayed label exactly while another's did not.
158
+
159
+ ### Preview Metadata Hazards
160
+
161
+ View metadata captured from the configuration UI is _preview_ metadata and substitutes placeholder values. Two consequences matter here, because tooling that discovers components by walking view metadata will read placeholders as real.
162
+
163
+ **Placeholder property paths are named for a field type, not a field.** Two different fields of the same type therefore share one identical bound path, distinguished only by their labels. Never use a bound path as an identity, a key, or a de-duplication criterion.
164
+
165
+ **A placeholder path is not even stable for one field.** The same property has been observed emitting different placeholder paths depending on how its presentation was configured, with extra deferred-loading keys appearing and disappearing alongside. Changing a configuration can therefore change a bound path without any property having changed.
166
+
167
+ ### Key Lifecycle Rules
168
+
169
+ This field type clears keys inconsistently. Five distinct behaviours have been observed across the field type as a whole, and the same caution applies here:
170
+
171
+ 1. A control that disappears may leave its key behind carrying the old value.
172
+ 2. A control that disappears may instead have its key cleared.
173
+ 3. Both can happen in the same transition, with no way to predict which.
174
+ 4. A key cleared by one change may reappear later carrying a **re-seeded default** rather than the value last configured for it.
175
+ 5. Keys may be re-seeded even for controls that are not visible in the current mode.
176
+
177
+ Switching between the inline form and the picker changes the node type, so most keys do not survive the transition — but the rule still holds: **decide which settings are active from the node type and `displayAs`, never from key presence, and never from a key's value.**
178
+
179
+ ### Generation Rules
180
+
181
+ 1. Establish the node type before anything else. This component handles only the picker node type.
182
+ 2. Do not generate a component for the inline form. Let the runtime's generic reference machinery resolve it.
183
+ 3. When consuming an inline-form node, flatten `inheritedProps` onto the resolved view's configuration, idempotently, and never look for those values as top-level keys on the reference node.
184
+ 4. Classify a `reference` node as an embedded record or a data reference before rendering it; they are different components.
185
+ 5. Never read a data page or parameters for this field type. The picker's options come from an embedded list on the same case, named by the `datasource` object's source entry.
186
+ 6. Copy the **whole** selected record into `targetPage`. The copy-all flag means a record, not an identifier.
187
+ 7. Render this component's children, so a configured details view appears.
188
+ 8. Apply mode precedence: while the field is read-only, ignore configured required, disabled and placeholder settings even when those keys are present.
189
+ 9. Implement the settings listed under Implementation Status rather than reproducing the gaps.
190
+ 10. Confirm every registry dependency exists before relying on it — see Registry Dependency Prerequisite.
191
+
192
+ ## Inputs (component-specific)
193
+
194
+ > Extends the project's field input contract.
195
+
196
+ For every input below, an absent value means the stated default. An empty string means the setting was never given a value and must be treated exactly like an absent one.
197
+
198
+ ### Picker — this component
199
+
200
+ | Input | Type | Default | Description |
201
+ | ------------- | -------------------- | ------- | ----------------------------------------------------------------------------------- |
202
+ | `getPConnect` | `any` | — | The PConnect accessor |
203
+ | `displayAs` | `string` | — | The combo-box value |
204
+ | `datasource` | `object` | — | Source, field map, and copy-all flag — see Config Keys |
205
+ | `targetPage` | `string` | — | Path to the embedded page the selection is copied into |
206
+ | `value` | `string` (optional) | `''` | Bound display value |
207
+ | `editable` | `boolean` (optional) | `false` | |
208
+ | `placeholder` | `string` (optional) | `''` | Already resolved |
209
+ | `ruleClass` | `string` | — | Class of the embedded record |
210
+ | `label` | `string` (optional) | `''` | Already resolved |
211
+ | `labelOption` | `string` (optional) | default | Informational only |
212
+ | `required` | `boolean` (optional) | `false` | Already-resolved boolean; may be emitted explicitly at its default |
213
+ | `disabled` | `boolean` (optional) | `false` | Already-resolved boolean |
214
+ | `readOnly` | `boolean` (optional) | `false` | Supplied by the surrounding view |
215
+ | `visibility` | `boolean` (optional) | `true` | Already-resolved boolean; the component is normally not rendered at all when false |
216
+ | `hideLabel` | `boolean` (optional) | `false` | |
217
+ | `testId` | `string` (optional) | `''` | Test identifier |
218
+ | `displayMode` | `string` (optional) | — | Supplied by the surrounding view; a display-only value forces a read-only rendering |
219
+ | `children` | `any` (optional) | — | A details-view reference, present when show-details is configured; MUST be rendered |
220
+
221
+ ### Inline form — the reference node, for reference only
222
+
223
+ > No component is generated for this. The table documents what the runtime's reference machinery consumes.
224
+
225
+ | Input | Type | Default | Description |
226
+ | ---------------- | -------------------- | ------- | ---------------------------------------------------------------------- |
227
+ | `getPConnect` | `any` | — | The PConnect accessor |
228
+ | `type` | `string` | — | Declares that the reference resolves to a view |
229
+ | `name` | `string` | — | Rule name of the referenced view |
230
+ | `ruleClass` | `string` | — | Class of the referenced view |
231
+ | `context` | `string` | — | Bare path to the embedded page on the case |
232
+ | `displayAs` | `string` | — | The inline-form value |
233
+ | `inheritedProps` | `array` (optional) | — | Name/value pairs to flatten onto the resolved view |
234
+ | `visibility` | `boolean` (optional) | `true` | Already-resolved boolean; the node is normally not rendered when false |
235
+
236
+ ## Implementation Structure
237
+
238
+ An orchestrator. It resolves one presenting picker from the registry, derives a configuration for it, and renders it inside a single full-width container. It draws no control of its own.
239
+
240
+ ### Registry Dependency Prerequisite
241
+
242
+ > **Check this before writing the component.** Because this component only orchestrates another, it cannot work unless its dependency is already generated and registered.
243
+
244
+ Tooling that discovers components by walking a case's view metadata will not find the picker component, because it never appears there as a field — it is a building block reached for at runtime. A discovery-driven generation pass can therefore produce this component while silently omitting what it depends on, and a registry lookup that finds nothing degrades to a blank render rather than raising an error.
245
+
246
+ The registry keys this component reaches for: the search/typeahead component (`AutoComplete`) or the dropdown/select component (`Dropdown`), whichever the project provides for a single-choice picker, and the value-display component (`FieldValueList`) for display-only rendering.
247
+
248
+ The dependency is **transitive** through the details child: the view named by that child contains ordinary field nodes, and every type present in it is also a dependency. Enumerate the types actually present in your metadata and check those too.
249
+
250
+ Before finishing: confirm each required key is registered or was generated earlier in the session; generate and register anything missing from its own skill file; only then wire up the lookups.
251
+
252
+ **Module Setup:** The component depends on the project's component registry and on the platform APIs listed below. Define the input contract as an extension of the project's field input contract, adding every input in the picker table above.
253
+
254
+ **Main Component Logic** — in order:
255
+
256
+ 1. **Registry lookup.** Resolve the presenting picker component. See the prerequisite above.
257
+ 2. **Receive inputs,** each defaulted as documented.
258
+ 3. **Resolve the option source.** Read the raw `datasource` object's source entry and strip its marker to obtain the path of the embedded list that supplies the candidate records.
259
+ 4. **Resolve the display property** from the raw `datasource` field map's key entry.
260
+ 5. **Apply mode precedence.** When the field is read-only or the surrounding view is display-only, render the resolved display value through the value-display component and stop.
261
+ 6. **Render the picker** with the option source, the display property, the placeholder, the label, and the resolved condition states.
262
+ 7. **Render this component's children** so that a configured details view appears.
263
+ 8. Wrap the result in a single full-width container.
264
+
265
+ ## Behavioral Contract
266
+
267
+ ### Selection and commit
268
+
269
+ When the user selects a record, copy the **whole** selected record into the path named by `targetPage`. The copy-all flag on the `datasource` object is what specifies this: the field stores a copy of the record on the case, not a pointer to it. Writing only an identifier leaves the embedded page empty and every downstream field blank.
270
+
271
+ The bound display value is the target page path followed by the record's label property, so once the copy is made the display value resolves without further work.
272
+
273
+ ### The details child
274
+
275
+ The show-details setting produces one child node naming a view that describes the referenced record. It is delivered eagerly in the same payload. Render it — dropping it leaves the configured detail presentation missing with no error reported.
276
+
277
+ ### Inline form — what the runtime does
278
+
279
+ Documented so that a generated project can reason about it, not so that anything is built for it.
280
+
281
+ The reference node is resolved by looking up the view named by `name`. Each entry of `inheritedProps` is flattened onto that view's configuration as an ordinary key, giving the view a label and a show-label flag. The view is then rendered through its own template, which draws the embedded record's fields. Nothing contributes chrome of its own, and there is no `label` key on the reference node — looking for one yields an unlabelled form.
282
+
283
+ ### View references and loading
284
+
285
+ | Mechanism | Referenced view delivered? | Resolution |
286
+ | ------------------------------- | -------------------------- | ------------------------- |
287
+ | The inline form's view | yes | eagerly, from the payload |
288
+ | The picker's details-view child | yes | eagerly, from the payload |
289
+
290
+ Both are present in the payload; neither requires a fetch.
291
+
292
+ ## Worked Traces
293
+
294
+ Two walkthroughs. Each names the active keys and what is handed down.
295
+
296
+ **Inline form.** The node type is `reference`, so this component is not involved at all. Active keys: `type`, `name`, `ruleClass`, `context`, `displayAs`, `inheritedProps`, and `visibility` if configured. Resolve the view named by `name` from the payload. Flatten each entry of `inheritedProps` onto that view's configuration as a flat key, so the view gains a label and a show-label flag. Render the view through its own template. Note there is no `label` key on the node — looking for one yields an unlabelled form. Note also that `context` is a bare property path, which is what distinguishes this node from a data reference.
297
+
298
+ **Picker with a details view.** The node type is `EmbeddedData`. Active keys: `displayAs`, `datasource`, `targetPage`, `value`, `editable`, `placeholder`, `ruleClass`, the label pair, the three conditions, `testId`, and one child. Read the option source from the `datasource` object and strip its marker — it names another embedded list on the same case, not a data page. Read the display property from the field map. Render a picker over that list, showing the display property for each candidate. On selection, copy the whole record into `targetPage`. Render the child so the configured details view appears. Ignore anything resembling a data page name: there is none. Note that `required` and `visibility` may be present at their defaults — their presence says nothing about intent.
299
+
300
+ ## Display Mode Rendering
301
+
302
+ Display mode reaches this component from the surrounding view and is not the same thing as the field's own read-only state. Either forces a read-only rendering, and both must be checked.
303
+
304
+ In a display-only or read-only rendering, show the resolved display value through the project's value-display component rather than a disabled picker. Apply mode precedence at the same time: ignore configured required, disabled and placeholder settings, which may still be present as stale keys from when the field was last editable.
305
+
306
+ ## Visual Specifications
307
+
308
+ This component contributes only a single full-width container holding one child. Everything visible is produced by the presenting component.
309
+
310
+ | Property | Value |
311
+ | ---------- | ------------------------------------------------ |
312
+ | Container | Full width, single column, no padding of its own |
313
+ | Appearance | Entirely delegated to the presenting component |
314
+
315
+ ## Edge Cases & Special Logic
316
+
317
+ - **The node type, not a configuration key, chooses the presentation.** Reading `displayAs` first leads to the wrong component or none.
318
+ - **A `reference` node may be an embedded record or a data reference.** Use the discriminator table; they render completely differently.
319
+ - **`inheritedProps` is a list, and its values belong on the referenced view.** Passing it through unchanged produces an unlabelled form, and the merge must be idempotent because the view arrives in two shapes.
320
+ - **There is no data page.** The picker's options come from an embedded list on the same case. Any logic that looks for a datasource rule or parameters is inapplicable.
321
+ - **The option source is another field on the same case.** If that field is absent or empty, the picker has nothing to offer — report it rather than rendering an empty control with no explanation.
322
+ - **Copying an identifier instead of the record leaves the page empty.** The copy-all flag means the whole record.
323
+ - **Defaults may be emitted explicitly.** This presentation emits `required` and `visibility` at their defaults while the inline form omits them. Key presence never indicates intent.
324
+ - **The details child must be rendered.** Dropping it loses the configured detail presentation silently.
325
+ - **An empty marked string is a real value.** Treat it as empty text.
326
+ - **A missing registry entry degrades silently.** An omitted dependency looks like a styling problem, not an error.
327
+
328
+ ## Implementation Status
329
+
330
+ | Setting or presentation | Reference behaviour | What a generated component should do |
331
+ | ----------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
332
+ | The picker itself | No component is registered under this key at all, so the field resolves to nothing and renders blank | Provide and register it, per the sections above |
333
+ | The details child | Not rendered | Render the child so the configured details view appears |
334
+
335
+ ## Dependencies
336
+
337
+ > Every registry dependency must be generated and registered before this component can render — see Registry Dependency Prerequisite.
338
+
339
+ - The project's component registry, resolving the single-choice picker (`AutoComplete` or `Dropdown`, whichever the project provides), the value-display component (`FieldValueList`), and the type of every field present in the details view.
340
+ - The Pega Platform APIs listed below.
341
+
342
+ ## Pega Platform APIs
343
+
344
+ All of these are reached through the global `PCore` object, which the SDK runtime installs before any component renders. Never import them from a package — read them off `PCore` at the point of use.
345
+
346
+ **`PCore.getAnnotationUtils().getPropertyName(value)`** — takes a marker-prefixed property path and returns the bare property name. Use it to turn the `datasource` object's source entry into the path of the embedded list, and wherever else a stored path must become a property name, instead of trimming a marker yourself.
347
+
348
+ **`PCore.getMetadataUtils().resolveView(viewName)`** — takes a view name and returns that view's metadata, which may be a single view or a list of views for different classes. Used when a referenced view must be resolved by name rather than read from the payload; when a list is returned, select the entry whose class matches the embedded record's class.
349
+
350
+ **`getPConnect().getValue(path)`** — reads the list of candidate records from the resolved option-source path, and reads the current display value.
351
+
352
+ **`getPConnect().getActionsApi()`** — provides the operation that writes the selected record onto the case at `targetPage`.
353
+
354
+ **`getPConnect().createComponent(...)`** — builds the presenting child from a derived configuration.
355
+
356
+ **`getPConnect().getRawMetadata()`** — returns the component's configuration **before** markers are resolved. Required when a bound path is needed as a property name rather than as a resolved value.
357
+
358
+ The context name, the page reference, and the change handler all come from the PConnect accessor rather than from `PCore`.
359
+
360
+ ## Design System Mapping
361
+
362
+ **UI control type:** Embedded record picker — an orchestrator that delegates to a single-choice picker and copies the chosen record onto the case.
363
+
364
+ When implementing in a specific design system, map the following:
365
+
366
+ - **Picker presentation** → the design system's combobox, typeahead, or select, sourced from another embedded list on the same case and showing the configured display property for each candidate
367
+ - **Details presentation** → whatever surface the referenced detail view's own template produces; this component only ensures the child is rendered
368
+ - **Display-only rendering** → the design system's read-only value display
369
+ - **Inline form presentation** → no component; the referenced view's own template provides the layout
370
+ - **Container** → a plain full-width wrapper; add no styling of your own
371
+
372
+ ## Generation Self-Check
373
+
374
+ Before considering the component finished, confirm each of the following.
375
+
376
+ - The node type is established before any presentation logic, and no component was generated for the inline form.
377
+ - A `reference` node is correctly classified as an embedded record or a data reference before rendering.
378
+ - The `inheritedProps` contract is documented and understood, with the merge idempotent and no top-level label read from the reference node.
379
+ - No data page or parameter lookup exists anywhere in the component.
380
+ - The option source is resolved from the `datasource` object's source entry, with its marker stripped, and treated as a path to another field on the same case.
381
+ - The display property is taken from the `datasource` field map rather than assumed.
382
+ - Selection copies the whole record into `targetPage`, not an identifier.
383
+ - The details child is rendered.
384
+ - Mode precedence is applied, so a read-only or display-only rendering ignores required, disabled and placeholder settings.
385
+ - Every registry key the component reaches for is registered, including the types of every field in the details view.