@salesforce/lwc-adapters-uiapi 1.272.0 → 1.273.1

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 (2) hide show
  1. package/dist/main.js +21 -5
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -10250,7 +10250,7 @@ function getTypeCacheKeys$1W(rootKeySet, luvio, input, fullPathFactory) {
10250
10250
  getTypeCacheKeys$1Z(rootKeySet, luvio, input_fields[key], () => rootKey + "__fields" + "__" + key);
10251
10251
  }
10252
10252
  }
10253
- const notifyUpdateAvailableFactory$3 = (luvio) => {
10253
+ const notifyUpdateAvailableFactory$4 = (luvio) => {
10254
10254
  return function notifyRecordUpdateAvailable(configs) {
10255
10255
  if (process.env.NODE_ENV !== 'production') {
10256
10256
  const requiredKeyParams = ['recordId'];
@@ -18975,10 +18975,11 @@ function getNameField(objectInfo, fieldApiName) {
18975
18975
  // ObjectInfoRep.ReferenceToInfoRep[].nameFields[]:
18976
18976
  // 1. If any of the arrays are empty returns `Name`
18977
18977
  // 2. If `Name` is found in any array position then returns it
18978
- // 2. Else returns ObjectInfoRep.ReferenceToInfoRep[0].nameFields[0]
18978
+ // 3. If the field has more than 1 references(polymorphic), return `Name`
18979
+ // 4. Else returns ObjectInfoRep.ReferenceToInfoRep[0].nameFields[0]
18979
18980
  // Rationale for this is unclear and needs clarification.
18980
18981
  const referenceToInfos = objectInfo.fields[fieldApiName].referenceToInfos;
18981
- if (referenceToInfos.length < 1) {
18982
+ if (referenceToInfos.length !== 1) {
18982
18983
  return FIELD_NAME;
18983
18984
  }
18984
18985
  const firstReferenceNameFields = referenceToInfos[0].nameFields;
@@ -19520,9 +19521,24 @@ function getFieldsFromLayoutMap(layoutMap, objectInfo) {
19520
19521
  }
19521
19522
  return dedupe(fields).sort();
19522
19523
  }
19524
+ /**
19525
+ * W-14696113
19526
+ * Merge fields into optionalFields and return the whole list.
19527
+ * @param {string[]} fields
19528
+ * @param {string[]} [optionalFields]
19529
+ */
19530
+ function convertToImplicitFields(fields, optionalFields) {
19531
+ const implicitFields = optionalFields || [];
19532
+ fields.forEach((field) => {
19533
+ if (!(field in implicitFields))
19534
+ implicitFields.push(field);
19535
+ });
19536
+ return implicitFields;
19537
+ }
19523
19538
  function getRecordForLayoutableEntities(luvio, refresh, recordId, layoutMap, objectInfo, configOptionalFields) {
19524
19539
  const fields = getFieldsFromLayoutMap(layoutMap, objectInfo);
19525
- return getRecord$1(luvio, refresh, recordId, fields, configOptionalFields);
19540
+ const implicitFields = convertToImplicitFields(fields, configOptionalFields);
19541
+ return getRecord$1(luvio, refresh, recordId, [], implicitFields);
19526
19542
  }
19527
19543
  function getRecordForNonLayoutableEntities(luvio, adapterContext, refresh, recordId, objectInfo, configOptionalFields, configFields) {
19528
19544
  const fields = keys(configFields ? configFields : {}).map((key) => `${objectInfo.apiName}.${key}`);
@@ -58730,7 +58746,7 @@ withDefaultLuvio((luvio) => {
58730
58746
  let getRecordNotifyChange, refresh, notifyRecordUpdateAvailable;
58731
58747
  withDefaultLuvio((luvio) => {
58732
58748
  getRecordNotifyChange = notifyChangeFactory(luvio);
58733
- notifyRecordUpdateAvailable = notifyUpdateAvailableFactory$3(luvio);
58749
+ notifyRecordUpdateAvailable = notifyUpdateAvailableFactory$4(luvio);
58734
58750
  refresh = bindWireRefresh(luvio);
58735
58751
  });
58736
58752
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.272.0",
3
+ "version": "1.273.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "UIAPI adapters with LWC bindings",
6
6
  "module": "dist/main.js",
@@ -31,10 +31,10 @@
31
31
  "clean": "rm -rf dist src/generated"
32
32
  },
33
33
  "devDependencies": {
34
- "@salesforce/lds-adapters-uiapi": "^1.272.0"
34
+ "@salesforce/lds-adapters-uiapi": "^1.273.1"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.154.9",
38
- "@salesforce/lds-default-luvio": "^1.272.0"
38
+ "@salesforce/lds-default-luvio": "^1.273.1"
39
39
  }
40
40
  }