@outbuild-company/schedule-core 1.29.0 → 1.29.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.
package/dist/index.js CHANGED
@@ -930,11 +930,6 @@ function diffSelections(before, after) {
930
930
  return { checked, unchecked };
931
931
  }
932
932
 
933
- // src/internal/selection/is-frozen.ts
934
- function isFrozen(activity) {
935
- return (activity.pendingRequestIds?.length ?? 0) > 0;
936
- }
937
-
938
933
  // src/dispatch/reasons.ts
939
934
  var REJECTION_REASON = {
940
935
  CANNOT_EDIT: "cannot_edit",
@@ -972,10 +967,6 @@ var REJECTION_REASON = {
972
967
  };
973
968
 
974
969
  // src/dispatch/selection.ts
975
- var snapshotIsFrozen = (adapter, id) => {
976
- const snapshot = adapter.getActivity(id);
977
- return snapshot != null && isFrozen(snapshot);
978
- };
979
970
  var buildSelectionChangeSet = (action, adapter, changed2) => {
980
971
  const viewState = [];
981
972
  const emit = (id, nextChecked) => {
@@ -1000,8 +991,8 @@ function dispatchSelectionToggle(action, deps) {
1000
991
  if (!adapter.getActivity(clickedId)) {
1001
992
  return { ok: false, reason: REJECTION_REASON.ACTIVITY_NOT_FOUND };
1002
993
  }
1003
- const frozenSet = action.frozenIds ? new Set(action.frozenIds) : null;
1004
- const isActivityFrozen = frozenSet ? (id) => frozenSet.has(id) : (id) => snapshotIsFrozen(adapter, id);
994
+ const frozenSet = new Set((action.frozenIds ?? []).map(String));
995
+ const isActivityFrozen = (id) => frozenSet.has(id);
1005
996
  const update = computeSelectionUpdate({
1006
997
  clickedId,
1007
998
  isChecked: action.isChecked,
@@ -1025,7 +1016,7 @@ function dispatchSelectionToggle(action, deps) {
1025
1016
  function dispatchSelectionReplace(action, deps) {
1026
1017
  const { adapter } = deps;
1027
1018
  const target = new Set(
1028
- action.activityIds.map(String).filter((id) => adapter.activityExists(id)).filter((id) => !snapshotIsFrozen(adapter, id))
1019
+ action.activityIds.map(String).filter((id) => adapter.activityExists(id))
1029
1020
  );
1030
1021
  const current = new Set(adapter.checkedIds().map(String));
1031
1022
  const changed2 = {
@@ -12472,6 +12463,11 @@ function cloneLink(link) {
12472
12463
  return { ...link };
12473
12464
  }
12474
12465
 
12466
+ // src/internal/selection/is-frozen.ts
12467
+ function isFrozen(activity) {
12468
+ return (activity.pendingRequestIds?.length ?? 0) > 0;
12469
+ }
12470
+
12475
12471
  // src/dispatch/sir-auto-reject.ts
12476
12472
  function detectSirAutoReject(beforeSnap, adapter, touchedIds) {
12477
12473
  const effects = [];