@overmap-ai/core 1.0.38-component-fields.26 → 1.0.38-component-fields.28

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.
@@ -3268,7 +3268,7 @@ const selectLatestRevisionsFromComponentTypeIds = restructureCreateSelectorWithA
3268
3268
  }
3269
3269
  )
3270
3270
  );
3271
- const selectLatestRevisionsForComponentStage = restructureCreateSelectorWithArgs(
3271
+ const selectComponentStageFormLatestRevision = restructureCreateSelectorWithArgs(
3272
3272
  createSelector(
3273
3273
  [
3274
3274
  selectUserFormMapping,
@@ -3276,13 +3276,27 @@ const selectLatestRevisionsForComponentStage = restructureCreateSelectorWithArgs
3276
3276
  (_state, componentStageId) => componentStageId
3277
3277
  ],
3278
3278
  (userForms, revisions, componentStageId) => {
3279
- const latestRevisions = [];
3279
+ const form = Object.values(userForms).find((userForm) => userForm.component_stage === componentStageId);
3280
+ return form ? _selectLatestFormRevision(revisions, form.offline_id) : void 0;
3281
+ }
3282
+ )
3283
+ );
3284
+ const selectLatestRevisionsFromComponentStageIds = restructureCreateSelectorWithArgs(
3285
+ createSelector(
3286
+ [
3287
+ selectUserFormMapping,
3288
+ selectRevisionMapping,
3289
+ (_state, componentStageIds) => componentStageIds
3290
+ ],
3291
+ (userForms, revisions, componentStageIds) => {
3292
+ const componentStageIdsSet = new Set(componentStageIds);
3293
+ const ret = {};
3280
3294
  for (const form of Object.values(userForms)) {
3281
- if (form.component_stage === componentStageId) {
3282
- latestRevisions.push(_selectLatestFormRevision(revisions, form.offline_id));
3295
+ if (form.component_stage && componentStageIdsSet.has(form.component_stage)) {
3296
+ ret[form.component_stage] = _selectLatestFormRevision(revisions, form.offline_id);
3283
3297
  }
3284
3298
  }
3285
- return latestRevisions;
3299
+ return ret;
3286
3300
  }
3287
3301
  )
3288
3302
  );
@@ -3316,14 +3330,6 @@ const selectNumberOfUserForms = createSelector([selectUserFormMapping], (userFor
3316
3330
  const selectNumberOfGeneralUserForms = createSelector([selectUserFormMapping], (userForms) => {
3317
3331
  return Object.values(userForms).filter((form) => !form.component_type && !form.component_stage).length;
3318
3332
  });
3319
- const selectNumberOfComponentStageFormsForStage = restructureCreateSelectorWithArgs(
3320
- createSelector(
3321
- [selectUserFormMapping, (_state, stageId) => stageId],
3322
- (userForms, stageId) => {
3323
- return Object.values(userForms).filter((form) => form.component_stage === stageId).length;
3324
- }
3325
- )
3326
- );
3327
3333
  const userFormReducer = userFormSlice.reducer;
3328
3334
  const initialState$1 = {
3329
3335
  emailDomains: {}
@@ -12137,6 +12143,7 @@ export {
12137
12143
  selectCompletedStageIdsForComponent,
12138
12144
  selectCompletedStages,
12139
12145
  selectComponent,
12146
+ selectComponentStageFormLatestRevision,
12140
12147
  selectComponentType,
12141
12148
  selectComponentTypeForm,
12142
12149
  selectComponentTypeFromComponent,
@@ -12176,11 +12183,10 @@ export {
12176
12183
  selectLatestFormRevision,
12177
12184
  selectLatestRetryTime,
12178
12185
  selectLatestRevisionByFormId,
12179
- selectLatestRevisionsForComponentStage,
12186
+ selectLatestRevisionsFromComponentStageIds,
12180
12187
  selectLatestRevisionsFromComponentTypeIds,
12181
12188
  selectMainWorkspace,
12182
12189
  selectMapStyle,
12183
- selectNumberOfComponentStageFormsForStage,
12184
12190
  selectNumberOfComponentTypesMatchingCaseInsensitiveName,
12185
12191
  selectNumberOfComponentsOfComponentType,
12186
12192
  selectNumberOfGeneralUserForms,