@salesforce/lwc-adapters-uiapi 1.129.0 → 1.130.8
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.
- package/dist/main.js +50 -11
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -345,7 +345,7 @@ var FragmentReadResultState;
|
|
|
345
345
|
({
|
|
346
346
|
state: FragmentReadResultState.Missing,
|
|
347
347
|
});
|
|
348
|
-
// engine version: 0.138.
|
|
348
|
+
// engine version: 0.138.7-42a753b0
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
351
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -13350,16 +13350,27 @@ function trimEdges(edges, startOffset, endOffset) {
|
|
|
13350
13350
|
return trimmedEdges;
|
|
13351
13351
|
}
|
|
13352
13352
|
function optimizePagination(metadata, firstArgName, afterArgName, variables) {
|
|
13353
|
-
if (typeof metadata === 'object' && metadata !== null
|
|
13353
|
+
if (typeof metadata === 'object' && metadata !== null) {
|
|
13354
|
+
const requestedAfterCursor = variables[afterArgName];
|
|
13355
|
+
const afterCursorOffset = offsetFromToken(metadata, requestedAfterCursor);
|
|
13354
13356
|
// optimize only if after cursor is unspecified in the request or it's already loaded in metadata
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
const
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13357
|
+
if (afterCursorOffset >= 0) {
|
|
13358
|
+
const requestedItems = variables[firstArgName];
|
|
13359
|
+
const atMostOffset = afterCursorOffset + requestedItems; // The largest offset we care about for this page.
|
|
13360
|
+
const lastTokenAndOffset = tokenForAtMost(metadata, atMostOffset);
|
|
13361
|
+
if (lastTokenAndOffset !== undefined) {
|
|
13362
|
+
const [token, offset] = lastTokenAndOffset;
|
|
13363
|
+
const isSubpage = atMostOffset === offset; // We already have all the cursors we seem to need
|
|
13364
|
+
const isExactPagination = atMostOffset === offset + requestedItems; // Using the last cursor we have to paginate
|
|
13365
|
+
if (!(isSubpage || isExactPagination)) { // If we're asking for more than we have, only request what we're missing.
|
|
13366
|
+
const existingItems = afterCursorOffset === 0 ? offset + 1 : offset - afterCursorOffset;
|
|
13367
|
+
const itemsToRequest = requestedItems - existingItems;
|
|
13368
|
+
variables[firstArgName + '_original'] = requestedItems;
|
|
13369
|
+
variables[firstArgName] = itemsToRequest;
|
|
13370
|
+
variables[afterArgName + '_original'] = requestedAfterCursor;
|
|
13371
|
+
variables[afterArgName] = token;
|
|
13372
|
+
}
|
|
13373
|
+
}
|
|
13363
13374
|
}
|
|
13364
13375
|
}
|
|
13365
13376
|
}
|
|
@@ -44581,7 +44592,13 @@ function ingestPaginationMetadata(astNode, state, key, sink, existingData) {
|
|
|
44581
44592
|
}
|
|
44582
44593
|
const nextOffset = startOffset + edges.length;
|
|
44583
44594
|
const incomingPaginationMetadata = createPaginationMetadata(startOffset, edges);
|
|
44584
|
-
if (
|
|
44595
|
+
if (hasNextPage) {
|
|
44596
|
+
// Cleanup any __END__ cursors that are before than the newly ingested page
|
|
44597
|
+
if (existingPaginationMetadata !== undefined && existingPaginationMetadata.__END__ !== undefined && existingPaginationMetadata.__END__ < nextOffset) {
|
|
44598
|
+
delete existingPaginationMetadata.__END__;
|
|
44599
|
+
}
|
|
44600
|
+
}
|
|
44601
|
+
else {
|
|
44585
44602
|
incomingPaginationMetadata.__END__ = nextOffset;
|
|
44586
44603
|
}
|
|
44587
44604
|
// store the updated pagination metadata
|
|
@@ -50862,6 +50879,25 @@ function selectTypeLink(sel, fieldData, reader, key, sink, variables, fragments,
|
|
|
50862
50879
|
reader.markMissing();
|
|
50863
50880
|
}
|
|
50864
50881
|
}
|
|
50882
|
+
function augmentDefaultVariableValues(variableDefinitions, variables) {
|
|
50883
|
+
variableDefinitions.forEach(({ defaultValue, variable }) => {
|
|
50884
|
+
if (defaultValue !== undefined && variables[variable.name.value] === undefined) {
|
|
50885
|
+
switch (defaultValue.kind) {
|
|
50886
|
+
case ("IntValue"):
|
|
50887
|
+
case ("FloatValue"):
|
|
50888
|
+
variables[variable.name.value] = Number(defaultValue.value);
|
|
50889
|
+
break;
|
|
50890
|
+
case ("NullValue"):
|
|
50891
|
+
variables[variable.name.value] = null;
|
|
50892
|
+
break;
|
|
50893
|
+
case ("BooleanValue"):
|
|
50894
|
+
case ("StringValue"):
|
|
50895
|
+
case ("EnumValue"):
|
|
50896
|
+
variables[variable.name.value] = defaultValue.value;
|
|
50897
|
+
}
|
|
50898
|
+
}
|
|
50899
|
+
});
|
|
50900
|
+
}
|
|
50865
50901
|
function selectTypeLinkWithPagination(resolvedLink, sel, fieldData, reader, key, sink, variables, fragments, selectFn) {
|
|
50866
50902
|
var _a, _b, _c, _d, _e;
|
|
50867
50903
|
const source = resolvedLink.data.data;
|
|
@@ -51035,6 +51071,9 @@ function select$8(luvio, query, variables) {
|
|
|
51035
51071
|
}
|
|
51036
51072
|
function ingestOperationNode(luvio, input, node, state) {
|
|
51037
51073
|
if (node.operation === 'query') {
|
|
51074
|
+
if (node.variableDefinitions !== undefined) {
|
|
51075
|
+
augmentDefaultVariableValues(node.variableDefinitions, state.variables);
|
|
51076
|
+
}
|
|
51038
51077
|
ingest$8(node, {
|
|
51039
51078
|
...state,
|
|
51040
51079
|
path: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lwc-adapters-uiapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.130.8",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "UIAPI adapters with LWC bindings",
|
|
6
6
|
"module": "dist/main.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@salesforce/lds-adapters-uiapi": "*"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@luvio/lwc-luvio": "0.138.
|
|
37
|
+
"@luvio/lwc-luvio": "0.138.7",
|
|
38
38
|
"@salesforce/lds-default-luvio": "*"
|
|
39
39
|
}
|
|
40
40
|
}
|