@copart/ops-tool-kit 1.13.0-beta.10 → 1.13.0-beta.11

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.
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
47
47
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
48
48
 
49
49
  const name$1 = "@copart/ops-tool-kit";
50
- const version$3 = "1.13.0-beta.10";
50
+ const version$3 = "1.13.0-beta.11";
51
51
  const main$1 = "dist/ops-tool-kit.js";
52
52
  const style = "dist/ops-tool-kit.css";
53
53
  const files = [
@@ -2862,10 +2862,10 @@ var BreadcrumbsProvider = /*#__PURE__*/function (_React$Component) {
2862
2862
  }(React__namespace.Component);
2863
2863
 
2864
2864
  var _class;
2865
- var _excluded$4 = ["breadcrumbs"];
2865
+ var _excluded$5 = ["breadcrumbs"];
2866
2866
  var getCrumbProps = function getCrumbProps(props) {
2867
2867
  props.breadcrumbs;
2868
- var crumbProps = _objectWithoutProperties(props, _excluded$4);
2868
+ var crumbProps = _objectWithoutProperties(props, _excluded$5);
2869
2869
  return crumbProps;
2870
2870
  };
2871
2871
  var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
@@ -23483,7 +23483,7 @@ var RoleSelector$2 = function RoleSelector(_ref) {
23483
23483
  }));
23484
23484
  };
23485
23485
 
23486
- var _excluded$3 = ["selectedYard", "name", "handleChange", "yardOptions", "label"];
23486
+ var _excluded$4 = ["selectedYard", "name", "handleChange", "yardOptions", "label"];
23487
23487
  var getDescription = function getDescription(yardOptions) {
23488
23488
  return function (code) {
23489
23489
  return yardOptions[code].yard_number;
@@ -23499,7 +23499,7 @@ var YardNumberMenu$2 = function YardNumberMenu(_ref) {
23499
23499
  handleChange = _ref.handleChange,
23500
23500
  yardOptions = _ref.yardOptions,
23501
23501
  label = _ref.label,
23502
- otherProps = _objectWithoutProperties(_ref, _excluded$3);
23502
+ otherProps = _objectWithoutProperties(_ref, _excluded$4);
23503
23503
  return /*#__PURE__*/React__default["default"].createElement("div", {
23504
23504
  className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
23505
23505
  }, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
@@ -24443,14 +24443,14 @@ var HierarchyMenu = function HierarchyMenu(props) {
24443
24443
  });
24444
24444
  };
24445
24445
 
24446
- var _excluded$2 = ["value", "handleChange", "yardOptions", "label", "disabled"];
24446
+ var _excluded$3 = ["value", "handleChange", "yardOptions", "label", "disabled"];
24447
24447
  var YardNumberMenu$1 = function YardNumberMenu(_ref) {
24448
24448
  var value = _ref.value,
24449
24449
  handleChange = _ref.handleChange,
24450
24450
  yardOptions = _ref.yardOptions;
24451
24451
  _ref.label;
24452
24452
  var disabled = _ref.disabled,
24453
- otherProps = _objectWithoutProperties(_ref, _excluded$2);
24453
+ otherProps = _objectWithoutProperties(_ref, _excluded$3);
24454
24454
  return /*#__PURE__*/React__default["default"].createElement("div", {
24455
24455
  className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
24456
24456
  }, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
@@ -25750,7 +25750,7 @@ var useWindowSize = function useWindowSize() {
25750
25750
  return windowSize;
25751
25751
  };
25752
25752
 
25753
- var _excluded$1 = ["count", "current", "showNavButtons", "onLeftButtonClick", "onRightButtonClick", "saveActionComponentState", "ActionComponent", "notificationsTopContainerRef", "mobileNotificationsTopContainerRef", "setNotificationHeightFlag"];
25753
+ var _excluded$2 = ["count", "current", "showNavButtons", "onLeftButtonClick", "onRightButtonClick", "saveActionComponentState", "ActionComponent", "notificationsTopContainerRef", "mobileNotificationsTopContainerRef", "setNotificationHeightFlag"];
25754
25754
  var alertBackgroundColorMapping = {
25755
25755
  alert: '#fab9b9',
25756
25756
  warning: '#f5f5cb',
@@ -25819,7 +25819,7 @@ var Banner = function Banner(props) {
25819
25819
  notificationsTopContainerRef = props.notificationsTopContainerRef,
25820
25820
  mobileNotificationsTopContainerRef = props.mobileNotificationsTopContainerRef,
25821
25821
  setNotificationHeightFlag = props.setNotificationHeightFlag,
25822
- notification = _objectWithoutProperties(props, _excluded$1);
25822
+ notification = _objectWithoutProperties(props, _excluded$2);
25823
25823
  var dismissibleFlag = notification.dismissibleFlag,
25824
25824
  onDismiss = notification.onDismiss,
25825
25825
  startsAt = notification.startsAt,
@@ -64641,7 +64641,7 @@ AppFrame.defaultProps = {
64641
64641
  navItems: []
64642
64642
  };
64643
64643
 
64644
- var _excluded = ["fromPhone", "toPhone", "appCode", "entityType", "lotAttributes"];
64644
+ var _excluded$1 = ["fromPhone", "toPhone", "appCode", "entityType", "lotAttributes"];
64645
64645
  var logOutboundCalls = /*#__PURE__*/function () {
64646
64646
  var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(data) {
64647
64647
  var _storage$getLocalItem;
@@ -64677,7 +64677,7 @@ var CallLogger = React__default["default"].memo(function (_ref2) {
64677
64677
  entityType = _ref2$entityType === void 0 ? '' : _ref2$entityType,
64678
64678
  _ref2$lotAttributes = _ref2.lotAttributes,
64679
64679
  lotAttributes = _ref2$lotAttributes === void 0 ? {} : _ref2$lotAttributes,
64680
- props = _objectWithoutProperties(_ref2, _excluded);
64680
+ props = _objectWithoutProperties(_ref2, _excluded$1);
64681
64681
  var _useState = React.useState({
64682
64682
  error: null,
64683
64683
  success: null
@@ -68102,6 +68102,7 @@ function ContextualHelp(_ref) {
68102
68102
  })));
68103
68103
  }
68104
68104
 
68105
+ var _excluded = ["signal"];
68105
68106
  var pending = new Map();
68106
68107
  function requestId() {
68107
68108
  return "bridge-".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 9));
@@ -68122,7 +68123,8 @@ function handleMessage(event) {
68122
68123
  if (!id || !pending.has(id)) return;
68123
68124
  var _pending$get = pending.get(id),
68124
68125
  resolve = _pending$get.resolve,
68125
- reject = _pending$get.reject;
68126
+ reject = _pending$get.reject,
68127
+ pendingResponseType = _pending$get.responseType;
68126
68128
  pending.delete(id);
68127
68129
  switch (data.eventType) {
68128
68130
  case 'FETCH_RESPONSE':
@@ -68136,6 +68138,25 @@ function handleMessage(event) {
68136
68138
  } : eventProps.error;
68137
68139
  reject(err);
68138
68140
  } else {
68141
+ var _eventProps$result;
68142
+ var resultData = (_eventProps$result = eventProps.result) === null || _eventProps$result === void 0 ? void 0 : _eventProps$result.data;
68143
+ if (pendingResponseType === 'arraybuffer') {
68144
+ if (resultData instanceof ArrayBuffer) {
68145
+ console.log('[iframe-bridge/transport] FETCH_RESPONSE binary OK', {
68146
+ requestId: id,
68147
+ byteLength: resultData.byteLength
68148
+ });
68149
+ } else {
68150
+ // Shell returned non-binary for a request that expected arraybuffer.
68151
+ // This means Step 2 (shell) has not been deployed yet, or the shell
68152
+ // is not forwarding responseType to its own axios call.
68153
+ console.warn('[iframe-bridge/transport] FETCH_RESPONSE expected ArrayBuffer but got non-binary — shell may not support responseType yet', {
68154
+ requestId: id,
68155
+ actualType: _typeof$1(resultData),
68156
+ isNull: resultData == null
68157
+ });
68158
+ }
68159
+ }
68139
68160
  resolve(eventProps.result);
68140
68161
  }
68141
68162
  break;
@@ -68154,13 +68175,57 @@ if (typeof window !== 'undefined') {
68154
68175
  window.addEventListener('message', handleMessage, false);
68155
68176
  }
68156
68177
  function sendFetchRequest(payload) {
68178
+ var signal = payload.signal,
68179
+ restPayload = _objectWithoutProperties(payload, _excluded);
68157
68180
  return new Promise(function (resolve, reject) {
68181
+ // Reject immediately if the signal is already aborted before we even send
68182
+ if (signal !== null && signal !== void 0 && signal.aborted) {
68183
+ console.log('[iframe-bridge/transport] FETCH_REQUEST aborted before send', {
68184
+ url: payload.url
68185
+ });
68186
+ reject(new DOMException('Request aborted', 'AbortError'));
68187
+ return;
68188
+ }
68158
68189
  var id = requestId();
68190
+ // store responseType so the response handler can detect a binary/non-binary mismatch
68159
68191
  pending.set(id, {
68160
68192
  resolve: resolve,
68161
- reject: reject
68193
+ reject: reject,
68194
+ responseType: payload.responseType
68162
68195
  });
68163
- post('FETCH_REQUEST', _objectSpread2(_objectSpread2({}, payload), {}, {
68196
+ if (payload.responseType || payload.timeout != null || payload.withCredentials != null) {
68197
+ console.log('[iframe-bridge/transport] sending FETCH_REQUEST with extended options', {
68198
+ requestId: id,
68199
+ url: payload.url,
68200
+ responseType: payload.responseType,
68201
+ timeout: payload.timeout,
68202
+ withCredentials: payload.withCredentials
68203
+ });
68204
+ }
68205
+
68206
+ // signal cannot be transferred through postMessage — handle abort locally
68207
+ if (signal) {
68208
+ var onAbort = function onAbort() {
68209
+ if (pending.has(id)) {
68210
+ pending.delete(id);
68211
+ console.log('[iframe-bridge/transport] FETCH_REQUEST aborted mid-flight', {
68212
+ requestId: id,
68213
+ url: payload.url
68214
+ });
68215
+ // Notify the shell so it can cancel its own request if wired up
68216
+ post('CANCEL_REQUEST', {
68217
+ requestId: id
68218
+ });
68219
+ reject(new DOMException('Request aborted', 'AbortError'));
68220
+ }
68221
+ };
68222
+ signal.addEventListener('abort', onAbort, {
68223
+ once: true
68224
+ });
68225
+ }
68226
+
68227
+ // signal is intentionally excluded from the message — it's a non-serialisable DOM object
68228
+ post('FETCH_REQUEST', _objectSpread2(_objectSpread2({}, restPayload), {}, {
68164
68229
  requestId: id
68165
68230
  }));
68166
68231
  });
@@ -68662,15 +68727,39 @@ function request(config) {
68662
68727
  params = finalConfig.params,
68663
68728
  data = finalConfig.data,
68664
68729
  _finalConfig$headers = finalConfig.headers,
68665
- headers = _finalConfig$headers === void 0 ? {} : _finalConfig$headers;
68730
+ headers = _finalConfig$headers === void 0 ? {} : _finalConfig$headers,
68731
+ responseType = finalConfig.responseType,
68732
+ timeout = finalConfig.timeout,
68733
+ withCredentials = finalConfig.withCredentials,
68734
+ signal = finalConfig.signal;
68735
+ if (responseType || timeout != null || withCredentials != null || signal) {
68736
+ console.log('[iframe-bridge/fetcher] request with extended options', {
68737
+ url: url,
68738
+ responseType: responseType,
68739
+ timeout: timeout,
68740
+ withCredentials: withCredentials,
68741
+ hasSignal: Boolean(signal)
68742
+ });
68743
+ }
68666
68744
  return sendFetchRequest({
68667
68745
  method: (method || 'get').toLowerCase(),
68668
68746
  url: url,
68669
68747
  params: params,
68670
68748
  data: data,
68671
- headers: headers
68749
+ headers: headers,
68750
+ responseType: responseType,
68751
+ timeout: timeout,
68752
+ withCredentials: withCredentials,
68753
+ signal: signal
68672
68754
  });
68673
68755
  }).then(function (result) {
68756
+ if (result.data instanceof ArrayBuffer) {
68757
+ console.log('[iframe-bridge/fetcher] binary response received', {
68758
+ url: config.url,
68759
+ byteLength: result.data.byteLength,
68760
+ type: 'ArrayBuffer'
68761
+ });
68762
+ }
68674
68763
  return applyResponseInterceptors({
68675
68764
  data: result.data,
68676
68765
  status: result.status,