@atlaskit/util-data-test 17.8.30 → 17.8.31

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/util-data-test
2
2
 
3
+ ## 17.8.31
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43229](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43229) [`a9f2e74b27b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a9f2e74b27b) - Add replicated types from @atlaskit/task-decision to fix TS errors in AFM
8
+
3
9
  ## 17.8.30
4
10
 
5
11
  ### Patch Changes
@@ -11,8 +11,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var _utils = require("./utils");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
- // eslint-disable-next-line import/no-extraneous-dependencies
15
-
16
14
  var debouncedTaskStateQuery = null;
17
15
  var debouncedTaskToggle = null;
18
16
  var MockTaskDecisionResource = exports.MockTaskDecisionResource = /*#__PURE__*/function () {
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.toggleTaskState = exports.objectKeyToString = exports.findIndex = void 0;
7
- // eslint-disable-next-line import/no-extraneous-dependencies
8
-
9
7
  // Copy of helper functions from @atlaskit/task-decision
10
8
  // NOTE: if this is changed in the original package, this must also be modified
11
9
  var objectKeyToString = exports.objectKeyToString = function objectKeyToString(objectKey) {
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { findIndex, objectKeyToString, toggleTaskState } from './utils';
3
- // eslint-disable-next-line import/no-extraneous-dependencies
4
-
5
3
  let debouncedTaskStateQuery = null;
6
4
  let debouncedTaskToggle = null;
7
5
  export class MockTaskDecisionResource {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,3 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
-
3
1
  // Copy of helper functions from @atlaskit/task-decision
4
2
  // NOTE: if this is changed in the original package, this must also be modified
5
3
  export const objectKeyToString = objectKey => {
@@ -4,8 +4,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import { findIndex, objectKeyToString, toggleTaskState } from './utils';
7
- // eslint-disable-next-line import/no-extraneous-dependencies
8
-
9
7
  var debouncedTaskStateQuery = null;
10
8
  var debouncedTaskToggle = null;
11
9
  export var MockTaskDecisionResource = /*#__PURE__*/function () {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,3 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
-
3
1
  // Copy of helper functions from @atlaskit/task-decision
4
2
  // NOTE: if this is changed in the original package, this must also be modified
5
3
  export var objectKeyToString = function objectKeyToString(objectKey) {
@@ -1,4 +1,4 @@
1
- import type { BaseItem, DecisionState, Handler, ObjectKey, RecentUpdateContext, RecentUpdatesId, TaskDecisionProvider, TaskState } from '@atlaskit/task-decision';
1
+ import type { BaseItem, DecisionState, Handler, ObjectKey, RecentUpdateContext, RecentUpdatesId, TaskDecisionProvider, TaskState } from './types';
2
2
  export interface MockTaskDecisionResourceConfig {
3
3
  hasMore?: boolean;
4
4
  lag?: number;
@@ -0,0 +1,27 @@
1
+ export type DecisionState = 'DECIDED';
2
+ export type TaskState = 'TODO' | 'DONE';
3
+ export type DecisionType = 'DECISION';
4
+ export type TaskType = 'TASK';
5
+ export interface ObjectKey {
6
+ localId: string;
7
+ containerAri?: string;
8
+ objectAri: string;
9
+ }
10
+ export interface BaseItem<S> extends ObjectKey {
11
+ state: S;
12
+ lastUpdateDate: Date;
13
+ type: DecisionType | TaskType;
14
+ }
15
+ export type Handler = (state: TaskState | DecisionState) => void;
16
+ export type RecentUpdatesId = string;
17
+ export interface RecentUpdateContext {
18
+ objectAri: string;
19
+ localId?: string;
20
+ }
21
+ export interface TaskDecisionProvider {
22
+ unsubscribeRecentUpdates(id: RecentUpdatesId): void;
23
+ notifyRecentUpdates(updateContext: RecentUpdateContext): void;
24
+ toggleTask(objectKey: ObjectKey, state: TaskState): Promise<TaskState>;
25
+ subscribe(objectKey: ObjectKey, handler: Handler, item?: BaseItem<TaskState | DecisionState>): void;
26
+ unsubscribe(objectKey: ObjectKey, handler: Handler): void;
27
+ }
@@ -1,4 +1,4 @@
1
- import type { ObjectKey } from '@atlaskit/task-decision';
1
+ import type { ObjectKey } from './types';
2
2
  export declare const objectKeyToString: (objectKey: ObjectKey) => string;
3
- export declare const toggleTaskState: (state: string) => "DONE" | "TODO";
3
+ export declare const toggleTaskState: (state: string) => "TODO" | "DONE";
4
4
  export declare const findIndex: (array: any[], predicate: (item: any) => boolean) => number;
@@ -1,4 +1,4 @@
1
- import type { BaseItem, DecisionState, Handler, ObjectKey, RecentUpdateContext, RecentUpdatesId, TaskDecisionProvider, TaskState } from '@atlaskit/task-decision';
1
+ import type { BaseItem, DecisionState, Handler, ObjectKey, RecentUpdateContext, RecentUpdatesId, TaskDecisionProvider, TaskState } from './types';
2
2
  export interface MockTaskDecisionResourceConfig {
3
3
  hasMore?: boolean;
4
4
  lag?: number;
@@ -0,0 +1,27 @@
1
+ export type DecisionState = 'DECIDED';
2
+ export type TaskState = 'TODO' | 'DONE';
3
+ export type DecisionType = 'DECISION';
4
+ export type TaskType = 'TASK';
5
+ export interface ObjectKey {
6
+ localId: string;
7
+ containerAri?: string;
8
+ objectAri: string;
9
+ }
10
+ export interface BaseItem<S> extends ObjectKey {
11
+ state: S;
12
+ lastUpdateDate: Date;
13
+ type: DecisionType | TaskType;
14
+ }
15
+ export type Handler = (state: TaskState | DecisionState) => void;
16
+ export type RecentUpdatesId = string;
17
+ export interface RecentUpdateContext {
18
+ objectAri: string;
19
+ localId?: string;
20
+ }
21
+ export interface TaskDecisionProvider {
22
+ unsubscribeRecentUpdates(id: RecentUpdatesId): void;
23
+ notifyRecentUpdates(updateContext: RecentUpdateContext): void;
24
+ toggleTask(objectKey: ObjectKey, state: TaskState): Promise<TaskState>;
25
+ subscribe(objectKey: ObjectKey, handler: Handler, item?: BaseItem<TaskState | DecisionState>): void;
26
+ unsubscribe(objectKey: ObjectKey, handler: Handler): void;
27
+ }
@@ -1,4 +1,4 @@
1
- import type { ObjectKey } from '@atlaskit/task-decision';
1
+ import type { ObjectKey } from './types';
2
2
  export declare const objectKeyToString: (objectKey: ObjectKey) => string;
3
- export declare const toggleTaskState: (state: string) => "DONE" | "TODO";
3
+ export declare const toggleTaskState: (state: string) => "TODO" | "DONE";
4
4
  export declare const findIndex: (array: any[], predicate: (item: any) => boolean) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/util-data-test",
3
- "version": "17.8.30",
3
+ "version": "17.8.31",
4
4
  "description": "Shared test and story data",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"