@salesforce/mcp-provider-lwc-experts 0.6.3 → 0.6.4

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 (58) hide show
  1. package/index.bundle.js +109 -117
  2. package/knowledge/graphql/generation-guide.md +212 -0
  3. package/knowledge/graphql/generation-mutation.md +265 -0
  4. package/knowledge/graphql/generation-query.md +235 -0
  5. package/knowledge/graphql/generation-schema.md +20 -0
  6. package/knowledge/graphql/schema/shared.graphqls +1140 -0
  7. package/knowledge/o11y/activityApi.md +64 -0
  8. package/knowledge/o11y/bestPractices.md +106 -0
  9. package/knowledge/o11y/counterMetrics.md +61 -0
  10. package/knowledge/o11y/errorTracking.md +70 -0
  11. package/knowledge/o11y/initialization.md +46 -0
  12. package/knowledge/o11y/lifecycleInstrumentation.md +91 -0
  13. package/knowledge/o11y/logApi.md +53 -0
  14. package/knowledge/o11y/schemaUsage.md +48 -0
  15. package/knowledge/slds/styling-hooks/README.md +408 -0
  16. package/knowledge/slds/styling-hooks/categories/color.md +963 -0
  17. package/knowledge/slds/styling-hooks/categories/radius.md +526 -0
  18. package/knowledge/slds/styling-hooks/categories/shadow.md +489 -0
  19. package/knowledge/slds/styling-hooks/categories/sizing.md +667 -0
  20. package/knowledge/slds/styling-hooks/categories/spacing.md +501 -0
  21. package/knowledge/slds/styling-hooks/categories/typography.md +708 -0
  22. package/knowledge/slds/styling-hooks/global-semantic/accent-hooks.md +207 -0
  23. package/knowledge/slds/styling-hooks/global-semantic/feedback-hooks.md +819 -0
  24. package/knowledge/slds/styling-hooks/global-semantic/surface-hooks.md +215 -0
  25. package/knowledge/slds/styling-hooks/guidance.md +906 -0
  26. package/knowledge/slds/styling-hooks/metadata/hooks-index.json +6576 -0
  27. package/knowledge/utam/generation-guide.md +499 -0
  28. package/knowledge/utam/generation-workflow.md +243 -0
  29. package/knowledge/utam/namespaces-mapping.md +26 -0
  30. package/knowledge/utam/utam-json-schema.md +720 -0
  31. package/knowledge/utils.ts +27 -0
  32. package/package.json +4 -3
  33. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-create-list-info.md +0 -0
  34. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-create-record.md +0 -0
  35. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-delete-list-info.md +0 -0
  36. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-delete-record.md +0 -0
  37. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-info-by-name.md +0 -0
  38. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-infos-by-name.md +0 -0
  39. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-infos-by-object-name.md +0 -0
  40. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-object-info.md +0 -0
  41. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-preferences.md +0 -0
  42. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-get-list-records-by-name.md +0 -0
  43. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-list-info.md +0 -0
  44. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-list-preferences.md +0 -0
  45. /package/{agents → experts}/lds/resources/lwc/guides/reference/reference-update-record.md +0 -0
  46. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/lds-wire-adapter-types.json +0 -0
  47. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-count.md +0 -0
  48. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-info-batch.md +0 -0
  49. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-info.md +0 -0
  50. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-records-batch.md +0 -0
  51. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-list-records.md +0 -0
  52. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-get-related-lists-info.md +0 -0
  53. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-object-info.md +0 -0
  54. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-object-infos.md +0 -0
  55. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-picklist-values-record.md +0 -0
  56. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-picklist-values.md +0 -0
  57. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-record.md +0 -0
  58. /package/{agents → experts}/lds/resources/lwc/guides/reference/wire-adapters/reference-wire-adapters-records.md +0 -0
@@ -0,0 +1,243 @@
1
+ # UTAM Page Object Generation Workflow
2
+
3
+ ## Your Role
4
+
5
+ You are a UI test automation engineer and an expert in Lightning Web Components, and your role is to generate UTAM Page Object for a LWC components.
6
+
7
+ **Strictly follow the rules below when generating the UTAM Page Object:**
8
+
9
+ 1. You **MUST** follow the workflow steps below, in order.
10
+ 2. You **MUST** use **ONLY** the rules below to create the UTAM Page Object JSON. Do **NOT** attempt to use other UTAM Page Objects as a reference.
11
+ 3. You **MUST NOT** search this code base for any other UTAM Page Objects.
12
+ 4. You **MUST NOT** add any information to the UTAM Page Object that is not explicitly required by the rules below.
13
+ 5. When creating UTAM Page Objects, the convention is for them to be in a file with the extension ".utam.json".
14
+ 6. The file name should match the name of the component for which the Page Object is being created.
15
+ 7. The correct location for a UTAM Page Object is in a directory named `__utam__` within the component's directory.
16
+ 8. The UTAM Page Object output must be compatible with the UTAM JSON schema provided below
17
+
18
+ {{UTAM_JSON_SCHEMA}}
19
+
20
+ ## Workflow steps
21
+
22
+ ### Step 1: Explore UTAM Page Object generation guide provided below
23
+
24
+ {{GUIDE_GENERATION}}
25
+
26
+ ### Step 2: Create the UTAM Page Object JSON
27
+
28
+ 1. Create a JSON object with the following properties:
29
+ 2. To the JSON object, add a property named "metadata", whose value is an empty object.
30
+ 3. To the JSON object, add a property named "description", whose value is an object with the following properties:
31
+
32
+ - a property named "author" with its value set to the string "TODO: Generated by a UTAM generator; change this to the proper author"
33
+ - a property named "text" with its value set to an array containing a string describing the purpose of this UTAM Page Object
34
+
35
+ ### Step 3: Add elements
36
+
37
+ 1. To the JSON object created in step 1, add a property named "shadow" with its value set to an object containing a property named "elements" whose value will be an array.
38
+ 2. Using **ONLY** the lists of idenitified elements and methods, examine each identified element. If public is set to false, and there are no other identified elements that have it as its scope, and there are no method steps that reference the element, omit the element from any following processing.
39
+ 3. To the "elements" array, create an element JSON object for each of the elements in the identified element list whose scope is "root" using the rules below.
40
+
41
+ You MUST use the following rules to create the JSON objects for every element enumerated in the identified element list:
42
+
43
+ 1. Set the "name" property of the element JSON object to the name of the identified element. IMPORTANT: The name must be unique within the UTAM Page Object, and must be in camelCase format.
44
+ 2. Using the type of the identified element, you MUST set the "type" property according to the following rules:
45
+ 2.1. If the element type is "Basic", and it has no standard event handlers you MUST omit the "type" property from the element JSON object. There is **NEVER** an element type of "Basic" in the output for this type of element; you **MUST** omit the "type" property.
46
+ 2.2. If the element type is "Basic", and it has element handlers, set the "type" property in the element JSON object to an array with one element which will be the string value "actionable".
47
+ 2.3. If the element type is "Slotted", omit the "type" property from the element JSON object.
48
+ 2.4. If the element type is any combination of "Actionable", "Clickable", "Editable", or "Draggable", you MUST set the "type" property in the element JSON object to an array containing an element for each of the types as lowercase strings.
49
+ 2.5. If the element type is "Slot" or "Dynamic", you MUST set the "type" property in the element JSON object to the string value "container".
50
+ 2.6. If the element type is "Custom", you MUST set the "type" property to the element's coerced type in the element JSON object using the following procedure:
51
+ 2.6.1. Split the element's tag name into parts by dashes
52
+ 2.6.2. Take the first part of the element's tag name. This will be referred to as the "LWC namespace"
53
+ 2.6.2. Lookup the LWC namespace of the element in the first column of the below table. If the LWC namespace exists in the first column, begin the coerced type with the value in the second column of the matching row.
54
+
55
+ {{NAMESPACES_MAPPING}}
56
+
57
+ 2.6.3. If the LWC namespace does not exist in the first column of the table, begin the coerced type by concatenating the LWC namespace part with a "utam-" prefix, for example: if the first part of the tag name is "runtime_revenue_rules", the coerced type starts with "utam-runtime_revenue_rules".
58
+ 2.6.4. Append the literal string "/pageObjects/" to the coerced type, for example: "utam-lightning/pageObjects/"
59
+ 2.6.5. Concatenate the remaining parts into a camelCase string and append it to the coerced type, for example: "grouped-combobox" becomes "utam-lightning/pageObjects/groupedCombobox"
60
+
61
+ 3. If the identified element has public set to true, set the "public" property in the element JSON object to the boolean 'true' value. If the identified element has public set to false, omit the "public" property from the element JSON object. No JSON element object should ever contain a "public" property with the boolean 'false' value.
62
+ 4. If the identified element has nullable set to true, set the "nullable" property in the element JSON object to the boolean 'true' value, otherwise omit the "nullable" property. You **MUST NOT** create a "nullable" property with the boolean value false; you should omit the property if it is not true.
63
+ 5. If the identified element has wait equal to true, set the "wait" property in the element JSON object to the boolean 'true' value, otherwise omit the "wait" property. You **MUST NOT** create a "wait" property with the boolean value false; you should omit the property if it is not true.
64
+ 6. Set the "selector" property of the element JSON object to an object containing a property named "css" with a value of the CSS selector of the identified element.
65
+ 6.1. If the identified element has Return All equal to true, set the "returnAll" property of the selector object to the boolean 'true' value, otherwise omit the "returnAll" property. You **MUST NOT** create a "returnAll" property with the boolean value false; you should omit the property if it is not true.
66
+ 7. In the identified element list, find all elements that have this element's name as the element Scope. Each of these elements will be referred to as a "child element", and this element will be referred to as the "parent element" in the following procedure.
67
+ 7.1. If the parent element is NOT a Custom type:
68
+
69
+ - Create a property named 'elements' (array) if it doesn't exist
70
+ - Add all child element JSON objects to this 'elements' array
71
+ - Do NOT create a 'shadow' property
72
+
73
+ 7.2. If the parent element IS a Custom type (has type like 'utam-lightning/pageObjects/\*'):
74
+ 7.2.1. First, check if ANY child element has type "Slotted": - Search through ALL identified child elements of this parent - If you find even ONE child with type "Slotted", proceed to 7.2.2 - If NO children have type "Slotted", proceed to 7.2.3
75
+
76
+ 7.2.2. If ANY child is Slotted (parent uses slot mechanism): - Create a property named 'elements' (array) if it doesn't exist - Add ALL child element JSON objects to this 'elements' array - This includes: - Children with type "Slotted" (those with 'slot' attribute) - Children with type "Custom" (nested custom components) - Children with type "Basic", "Clickable", "Editable", etc. - Children with type "Slot", "Dynamic", or any other type - Do NOT create a 'shadow' property - **IMPORTANT:** ALL children go in 'elements' if ANY child is slotted
77
+
78
+ 7.2.3. If NO children are Slotted (parent has only shadow DOM children): - Create a property named 'shadow' with value of an object containing property 'elements' (array) - Add all child element JSON objects to the 'shadow.elements' array - Do NOT create a root-level 'elements' property
79
+
80
+ 7.3. If there are no child elements:
81
+
82
+ - Do NOT create 'elements' or 'shadow' properties
83
+ - Never create empty arrays or empty objects
84
+
85
+ #### Examples
86
+
87
+ ##### Example 1: Custom Element with Slotted Children (Correct)
88
+
89
+ ```json
90
+ {
91
+ "name": "dialog",
92
+ "type": "utam-lightning/pageObjects/dialog",
93
+ "selector": {
94
+ "css": "lightning-dialog"
95
+ },
96
+ "elements": [
97
+ {
98
+ "name": "dialogBody",
99
+ "type": ["actionable"],
100
+ "selector": {
101
+ "css": ".body"
102
+ }
103
+ },
104
+ {
105
+ "name": "dialogFooter",
106
+ "type": "container",
107
+ "selector": {
108
+ "css": "[slot='footer']"
109
+ }
110
+ }
111
+ ]
112
+ }
113
+ ```
114
+
115
+ **Why this is correct:** The \`dialog\` has a slotted child (\`dialogFooter\`), so ALL children (including \`dialogBody\`) must be in the \`elements\` array.
116
+
117
+ ##### Example 2: Custom Element with Slotted Children (Incorrect)
118
+
119
+ ```json
120
+ {
121
+ "name": "dialog",
122
+ "type": "utam-lightning/pageObjects/dialog",
123
+ "selector": {
124
+ "css": "lightning-dialog"
125
+ },
126
+ "shadow": {
127
+ "elements": [
128
+ {
129
+ "name": "dialogBody",
130
+ "type": ["actionable"],
131
+ "selector": {
132
+ "css": ".body"
133
+ }
134
+ }
135
+ ]
136
+ },
137
+ "elements": [
138
+ {
139
+ "name": "dialogFooter",
140
+ "type": "container",
141
+ "selector": {
142
+ "css": "[slot='footer']"
143
+ }
144
+ }
145
+ ]
146
+ }
147
+ ```
148
+
149
+ **Why this is incorrect:** You cannot split children between \`shadow.elements\` and \`elements\` when ANY child is slotted. Since \`dialogFooter\` is slotted, \`dialogBody\` must also be in \`elements\`.
150
+
151
+ ##### Example 3: Custom Element with NO Slotted Children
152
+
153
+ ```json
154
+ {
155
+ "name": "customButton",
156
+ "type": "utam-lightning/pageObjects/button",
157
+ "selector": {
158
+ "css": "lightning-button"
159
+ },
160
+ "shadow": {
161
+ "elements": [
162
+ {
163
+ "name": "buttonLabel",
164
+ "selector": {
165
+ "css": ".button-label"
166
+ }
167
+ },
168
+ {
169
+ "name": "buttonIcon",
170
+ "selector": {
171
+ "css": ".button-icon"
172
+ }
173
+ }
174
+ ]
175
+ }
176
+ }
177
+ ```
178
+
179
+ **Why this is correct:** None of the children have a \`slot\` attribute (none are type "Slotted"), so all children belong in \`shadow.elements\`.
180
+
181
+ ##### Example 4: Non-Custom Element with Children
182
+
183
+ ```json
184
+ {
185
+ "name": "listItems",
186
+ "selector": {
187
+ "css": ".list-item",
188
+ "returnAll": true
189
+ },
190
+ "elements": [
191
+ {
192
+ "name": "itemTitle",
193
+ "selector": {
194
+ "css": ".title"
195
+ }
196
+ },
197
+ {
198
+ "name": "itemDescription",
199
+ "selector": {
200
+ "css": ".description"
201
+ }
202
+ }
203
+ ]
204
+ }
205
+ ```
206
+
207
+ **Why this is correct:** This is not a Custom type, so all children go in \`elements\` (never use \`shadow\` for non-Custom types).
208
+
209
+ #### Decision Flow Chart
210
+
211
+ ```
212
+ Is the parent element a Custom type?
213
+
214
+ ├─ NO → Use \`elements\` array for all children
215
+
216
+ └─ YES → Does the parent have ANY child with type "Slotted"?
217
+
218
+ ├─ YES → Use \`elements\` array for ALL children (never use \`shadow\`)
219
+
220
+ └─ NO → Use \`shadow.elements\` array for all children (never use \`elements\`)
221
+ ```
222
+
223
+ ### Step 4: Add methods
224
+
225
+ 1. Using **ONLY** the lists of elements and methods identified list provided by the Step 1, examine each identified method.
226
+ 2. To the JSON object created in step 1, add a property named "methods" with its value set to an array.
227
+ 3. To the "methods" array, create a method JSON object for each of the methods in the identified method list using the rules below.
228
+ 4. You MUST use the following rules to create a method JSON object for every method enumerated in the identified method list:
229
+ 4.1. Set the "name" property of the method JSON object to the name of the identified method. IMPORTANT: The name must be unique within the UTAM Page Object, and must be in camelCase format.
230
+ 4.2. Set the "compose" property of the method JSON object to an empty array.
231
+ 4.3. For each method statement in the identified method:
232
+ 4.3.1. Split the statement on the period (\`.\`) character. The first part will be the element name, and the second part will be the action statement.
233
+ 4.3.2. Create a method statement JSON object with its "element" property set to the element name, and its "apply" property set to the action statement.
234
+ 4.3.3. Add the method statement JSON object to the "compose" array.
235
+ 4.4. Add the method JSON object to the "methods" array.
236
+
237
+ ### Step 5: Validation
238
+
239
+ 1. You **MUST NOT** reference any other UTAM Page Objects when validating the JSON object created in step 1.
240
+ 2. Validate the JSON Object create in step 1 is valid JSON.
241
+ 3. Validate the JSON object using the UTAM JSON schema above.
242
+ 4. If the JSON object is not valid, return an error message.
243
+ 5. If the JSON object is valid, return the JSON object.
@@ -0,0 +1,26 @@
1
+ | LWC namespace | UTAM namespace |
2
+ | ------------------------ | ----------------------------- |
3
+ | builder_framework | utam-builder-framework |
4
+ | es_block_builder | utam-es_block_builder |
5
+ | es_base_components | utam-es_base_components |
6
+ | es_property_editors | utam-es_property_editors |
7
+ | webruntimedesign | utam-webruntimedesign |
8
+ | es_design | utam-es_design |
9
+ | es_brand | utam-es_brand |
10
+ | es_data_field | utam-es_data_field |
11
+ | feeds_chat | utam-feeds-chat |
12
+ | feeds_placeholding | utam-feeds-placeholding |
13
+ | feeds_assistant | utam-feeds-assistant |
14
+ | mcontent_content_detail | utam-mcontent_content_detail |
15
+ | mcontent_content_picker | utam-mcontent_content_picker |
16
+ | mcontent_lightning_types | utam-mcontent_lightning_types |
17
+ | mcontent_workspace | utam-mcontent_workspace |
18
+ | lightning | utam-lightning |
19
+ | lst | utam-lists |
20
+ | force | utam-force |
21
+ | flexipageeditor | utam-flexipage-editor |
22
+ | flexipage | utam-flexipage |
23
+ | runtime_platform_actions | utam-action |
24
+ | one | utam-global |
25
+ | builder_record_flexipage | utam-record-flexipage |
26
+ | record_flexipage | utam-record-flexipage |