Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kalamazoo/media-core

stevenselcuk7Apache-2.01.0.2TypeScript support: included

It holds shared code between MediaComponents like models, providers, interfaces and utilities

readme

changelog

@kalamazoo/media-core

31.0.1

Patch Changes

  • [patch]336c1084d9:

    remove media-client dependency to prevent circular dependency between media-core - media-client

31.0.0

Major Changes

  • [major]24b8ea2667:

Removes

  • Context / ContextFactory / ContextConfig
  • MediaItemType / FileItem / FileProcessingStatus / MediaArtifact / Artifacts / FileDetails / FileFetcher / FileFetcherImpl
  • UploadableFile / UploadFileCallbacks / UploadFileResult / UploadController / MediaType / isPreviewableType / TouchFileDescriptor / MediaFileArtifacts
  • isImageRemote
  • FileStatus / FilePreview / PreviewOptions / GetFileOptions / UploadingFileState / ProcessingFileState / ProcessedFileState / ProcessingFailedState / ErrorFileState / isErrorFileState / isImageRepresentationReady / mapMediaFileToFileState / mapMediaItemToFileState
  • getMediaTypeFromMimeType
  • FileState / StreamsCache
  • getFileStreamsCache
  • ImageResizeMode
  • Identifier / FileIdentifier / ExternalImageIdentifier / isFileIdentifier / isExternalImageIdentifier / isDifferentIdentifier
  • remove cacheSize from ContextConfig \ MediaClientConfig: This was used internally only by other media components and doesn't affect integrators

Upgrading

Previously integrators were able to import any of the above interfaces from @kalamazoo/media-core or from @kalamazoo/media-client, now, it's only possible to import them from @kalamazoo/media-client:

before

import {MediaItemType, FileItem, FileProcessingStatus} from '@kalamazoo/media-core'

after

import {MediaItemType, FileItem, FileProcessingStatus} from '@kalamazoo/media-client'

Also, Context, ContextFactory, ContextConfig has been removed completely, in order to make your components work with media now you have to:

before

import {Context, ContextFactory, ContextConfig} from '@kalamazoo/media-core'

const config: ContextConfig = {
  authProvider: () => Promise.resolve({})
}

const context: Context = ContextFactory.create(config)

after

import {MediaClientConfig} from '@kalamazoo/media-core'

const config: MediaClientConfig = {
  authProvider: () => Promise.resolve({})
}

30.0.17

30.0.16

Patch Changes

  • [patch]35d2229b2a:

    Adding missing license to packages and update to Copyright 2019 Atlassian Pty Ltd.

30.0.15

Patch Changes

  • [patch]a2d0043716:

    Updated version of analytics-next to fix potential incompatibilities with TS 3.6

30.0.14

30.0.13

Patch Changes

  • [patch]097b696613:

    Components now depend on TS 3.6 internally, in order to fix an issue with TS resolving non-relative imports as relative imports

30.0.12

Patch Changes

30.0.11

30.0.10

30.0.9

30.0.8

Patch Changes

  • [patch]6742fbf2cc:

    bugfix, fixes missing version.json file

30.0.7

Patch Changes

  • [patch]18dfac7332:

    In this PR, we are:

    • Re-introducing dist build folders
    • Adding back cjs
    • Replacing es5 by cjs and es2015 by esm
    • Creating folders at the root for entry-points
    • Removing the generation of the entry-points at the root Please see this ticket or this page for further details

30.0.6

Patch Changes

  • [patch]e69f28b637:

    add getAuthFromContext field into MediaClientConfig

    Now products can provide auth based on a contextId ARI

    import {MediaClientConfig} from '@kalamazoo/media-core';
    
    const config: MediaClientConfig = {
      authProvider, // already exists
      getAuthFromContext(clientId: string): Promise<Auth> // new optional prop
    }

30.0.5

Patch Changes

  • [patch]6e6d36f3af:

    Add optional 'eventEmitter' into cache. This makes existing event emitter system of context compatible with mediaClient

30.0.4

  • [patch]b0ef06c685:

    • This is just a safety release in case anything strange happened in in the previous one. See Pull Request #5942 for details

30.0.3

30.0.2

  • [patch]af1cbd4ce4:

    • Removing unnecessary deps and dev deps in media-core and media-client

30.0.1

30.0.0

  • [major]7c17b35107:

    • Updates react and react-dom peer dependencies to react@^16.8.0 and react-dom@^16.8.0. To use this package, please ensure you use at least this version of react and react-dom.

29.3.0

  • [minor]a1192ef860:

    • Add event emitter api to context + add first known event 'file-added'

    Integrators can now do:

    import {ContextFactory, FileState} from '@kalamazoo/media-core'
    
    const context = ContextFactory.create();
    
    context.on('file-added', (file: FileState) => {
      console.log(file.id)
    })

    check the FileState for the all the properties included in the payload

29.2.0

  • [minor]e7292ab444:

    • Export new media-store interfaces and methods: ClientAltBasedAuth, MediaClientConfig and authToOwner. Also introduce cache related members related to future migration to media-client: mediaState, CachedMediaState, StateDeferredValue.

29.1.5

29.1.4

29.1.3

  • [patch]30a9a7177e:

    • [MS-1791] Make fileState.representations optional, since media api might not return that value in all cases and we want to prevent a runtime error

29.1.2

29.1.1

  • [patch]d13fad66df:

    • Enable esModuleInterop for typescript, this allows correct use of default exports

29.1.0

  • [minor]c2c36de22b:

    • Fix missing annotated images in recent uploads within media picker

29.0.2

29.0.1

  • [patch]1bcaa1b991:

    • Add npmignore for index.ts to prevent some jest tests from resolving that instead of index.js

29.0.0

  • [major]9d5cc39394:

    • Dropped ES5 distributables from the typescript packages

28.0.0

  • [major]7ab3e93996:

    • Move checkWebpSupport util from media-core to media-store and use it to request webp from backend

27.2.4

  • [patch]ff3f40bc38:

    • Fix remove from cache function, which fixes issue when user is deleting recent image in media picker

27.2.3

27.2.2

  • [patch]9b0f6671ae:

    • ED-6244: Fix Resizable Media to allow images go smaller size than videos

27.2.1

  • [patch]5a01d648a3:

    • Fixing download binary file content in Safari browsers due CORS issue "safari error [Error] Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'."

27.2.0

  • [patch]6bd4c428e2:

    • load image preview as soon representation is present instead of waiting for file status to be processed
  • [minor]4aee5f3cec:

    • added representations to file metadata

27.1.0

27.0.2

27.0.1

  • [patch]a9dc1278c4:

    • add error handling in CollectionFetcher for getItems call

27.0.0

  • [major]69c8d0c19c:

    • Rename fileState.preview.blob to fileState.preview.value and support string + Blob as value

26.2.1

26.2.0

  • [minor]85d5d168fd:

    • Expose new getCurrentState method to context

26.1.0

26.0.0

  • [major]cbb8cb5:

    • Remove redundant fileStreamCache createKey() method and replace the cache key with id everywhere

25.0.0

  • [major]72d37fb:

    • Remove deprecated methods from media-core
    • Use context.collection methods in MediaViewer
    • Remove link support from media-card
    • Remove legacy services + providers from media-core
    • Remove link related methods from media-core
    • Remove axios dependency
    • Make context.getImage cancelable

24.7.2

24.7.1

  • [patch]ca16fa9:

    • Add SSR support to media components

24.7.0

24.6.0

  • [minor]80f765b:

    • Add stretchy-fit resize mode that acts as full-fit but scales up small image in big container

24.5.3

  • [patch]0f42ec1:

    Use /items endpoint in media-core

24.5.2

24.5.1

24.5.0

  • [minor]7e8b4b9:

    • Context.collection.removeFile has been added; occurrenceKey was added to all FileState flavours and filled as part of observable during upload;

24.4.1

  • [patch]705dcf3:

    • pass collectionName to MediaStore in order to use right auth token

24.4.0

  • [minor]2c21466:

    • Allow to inline play video files in media-card

24.3.1

24.3.0

  • [minor] Split Media + Editor cleanup part 1 b1ce691

24.2.2

24.2.1

  • [patch] Fix bug with download binary 71ebe0b

24.2.0

  • [minor] Media-card: allow to download binary when processing failed, add failed-processing to CardStatus; Media-core: add context.file.downloadBinary, add failed-processing to FileStatus; Media-store: add getFileBinaryURL; 2afa60d

24.1.1

  • [patch] Add pagination to recents view in MediaPicker 4b3c1f5

24.1.0

  • [minor] Deprecate context.uploadFile & context.getFile. Instead context.file.upload & context.file.getFileState should be used; media-store's uploadFile function now takes MediaStore as a second argument, not MediaApiConfig 8b2c4d3
  • [minor] Deprecate context.uploadFile & context.getFile. Instead context.file.upload & context.file.getFileState should be used; media-store's uploadFile function now takes MediaStore as a second argument, not MediaApiConfig 3302d51

24.0.3

24.0.2

24.0.1

  • [patch] Support external image identifiers in media-card 82c8bb9

24.0.0

  • [major] Update RXJS dependency to ^5.5.0 927ae63

23.2.1

23.2.0

  • [minor] expose new context.collection methods 6e1d642

23.1.1

23.1.0

  • [minor] Expose upfrontId in MediaPicker 7545979

23.0.2

23.0.1

  • [patch] Removing mutational rxjs imports and replace with explicit operators 353f9db
  • [patch] Removing mutational rxjs imports and replace with explicit operators 56c2df9
  • [none] Updated dependencies 353f9db
  • [none] Updated dependencies 56c2df9

23.0.0

22.2.1

22.2.0

  • [minor] pass mimeType to files in uploads-start event in MediaPicker 3485c00
  • [minor] Updated dependencies 3485c00

22.1.0

22.0.0

21.0.0

20.0.0

19.1.3

19.1.2

19.1.1

19.1.0

19.0.1

19.0.0

18.1.2

18.1.1

18.1.0

  • [minor] media-picker: <All but popup picker>.emitUploadEnd second argument shape has changed from MediaFileData to FileDetails; upload-end event payload body shape changed from MediaFileData to FileDetails; All the media pickers config now have new property useNewUploadService: boolean (false by default); popup media-picker .cancel can't be called with no argument, though types does allow for it; File is removed; --- media-store: MediaStore.createFile now has a required argument of type MediaStoreCreateFileParams; MediaStore.copyFileWithToken new method; uploadFile method result type has changed from just a promise to a UploadFileResult type; --- media-test-helpers: mediaPickerAuthProvider argument has changed from a component instance to just a boolean authEnvironment; 84f6f91
  • [minor] SUMMARY GOES HERE 9041d71
  • [patch] Updated dependencies 84f6f91
  • [minor] Updated dependencies 9041d71

18.0.3

18.0.2

  • [patch] Turn side effects to true due to rxjs operators imports 668f01c

18.0.0

  • [major] FileDetails' id property is now mandatory\nAuth interfaces moves from media-core to media-store, though still exported from media-core\nNew Interfaces (UploadableFile, UploadFileCallbacks) are exported from media-store\nMediaStore calls fixed with collection supplied during auth-provider call d7b5021

17.0.0

  • [major] MediaCollectionProvider now emits errors as next values in observable() f22e2a0

16.0.0

  • [major] Bump to React 16.3. 4251858

15.3.0

  • [minor] use local preview in MediaCard when available b33788b

15.2.0

  • [minor] MSW-531: add cancelable methods to blobService 7f84f67

15.1.0

  • [minor] Release first version of image viewer for Media Viewer Next Generation dd1893a

15.0.1

  • [patch] Add "sideEffects: false" to AKM2 packages to allow consumer's to tree-shake c3b018a

15.0.0

  • [major] icons are now assignable to card actions, which will cause media cards to render upto 2 icon buttons, or a dropdown menu if more than 2 actions are set 649871c

14.1.1

  • [patch] fix(media-test-helpers): configure fetch to send credentials and point calls to correct endpoint 8978f4e

14.1.0

  • [minor] Update styled-components dependency to support versions 1.4.6 - 3 ceccf30

14.0.1

14.0.0

  • [major] Move media provider and state manager to editor-core 0601da7

13.0.0

  • [major] change thumbnail interface according to new MediaPicker one 5c889c4

12.1.0

  • [minor] Add React 16 support. 12ea6e4

12.0.3

  • [patch] Use media-test-helpers instead of hardcoded values f2b92f8

12.0.0

  • [major] Show static images for gifs in small cards e2508f9

  • breaking; Api for DataUriService has changed

  • before:
  • interface fetchImageDataUri( mediaItem: MediaItem, width: number, height: number, mode?: ImageResizeMode, allowAnimated?: boolean): Promise<DataUri>;
  • after:

  • interface FetchImageOptions {
  • width: number;
  • height: number;
  • mode?: ImageResizeMode;
  • allowAnimated?: boolean;
  • interface fetchImageDataUri( mediaItem: MediaItem, options: FetchImageOptions,

  • ): Promise<DataUri>;

11.0.1

  • [patch] Move media-core to mk2 biuld repo 379a8ad

11.0.0 (2017-11-14)

  • breaking; updated the interface of MediaState to reflect the changes on mediapicker (cbee946)
  • breaking; updated the interface of MediaState to reflect the changes on mediapicker (cbee946)

10.2.0 (2017-10-10)

  • feature; updated contextConfig to include userAuthProvider. (3cfb5d0)
  • feature; updated contextConfig to include userAuthProvider. (03f200e)

10.1.0 (2017-09-12)

  • feature; support asap issuer in media-core context (eff2b56)
  • breaking;
  • ContextConfig type has changed. clientId and tokenProvider are replaced with
  • single authProvider. It's a function that takes AuthContext (currently object with collectionName key),
  • and returns a Promise that resolved with Auth object. Auth object can have either clientId + token
  • keys or asapIssuer + token. This also changed MediaApiConfig
  • (type of an object returned from context.apiConfig()) - tokenProvider was replaces with authProvider.
  • See USAGE.md for more details.
  • breaking;
  • Constructor arguments of DataUriService has changed. clientId and tokenProvider replaced with authProvider.
  • breaking;
  • FileProvider.fromMediaApi doesnt take clientId as 4th argument.
  • FileProvider.fromFileService doesnt take clientId as 3rd argument.
  • LinkProvider.fromMediaApi doesnt take clientId as 3rd argument.
  • LinkProvider.fromLinkService doesnt take clientId as 3rd argument.
  • MediaItemProvider.fromMediaApi doesnt take clientId as 5th argument.
  • MediaItemProvider.fromPool doesnt take clientId as 6th argument.
  • MediaUrlPreviewProvider.fromMediaApi doesnt take clientId as 3rd argument.
  • MediaUrlPreviewProvider.fromPool doesnt take clientId as 4th argument.
  • RemoteMediaCollectionProvider.fromMediaAPI doesnt take clientId as 3rd argument.
  • RemoteMediaCollectionProvider.fromPool doesnt take clientId as 4th argument.
  • UrlPreviewProvider.fromMediaAPI doesnt take clientId as 3rd argument.
  • UrlPreviewProvider.fromUrlPreviewService doesnt take clientId as 3rd argument.

9.0.0 (2017-08-07)

  • breaking; removed trello types (ce181b4)
  • breaking; remove trello app types and update to adhere to latest api signatures (ce181b4)

8.4.1 (2017-07-25)

  • fix; use class transform in loose mode in babel to improve load performance in apps (fde719a)

8.4.0 (2017-07-19)

  • feature; add support for smart-card links from the API (ff95bc6)

8.3.0 (2017-07-18)

  • feature; added smart card payload (3f1691e)

8.2.0 (2017-06-28)

  • fix; use full-fit mode instead of crop for /image endpoint (4de7d32)
  • feature; allow to pass imageResizeMode to fetchImageDataUri (379aade)

8.1.0 (2017-06-06)

  • feature; allow createRequest method to prevent preflight requests (3f50ebc)
  • feature; prevent preflight requests in CollectionService & LinkService (25d87da)

8.0.1 (2017-05-29)

  • fix; export media state status from media-core (fb8dcb5)

7.0.0 (2017-05-18)

  • feature; changed CollectionProvider and its pooling behaviour (ce4679c)
  • breaking; changed CollectionProvider and its pooling behaviour
  • ISSUES CLOSED: FIL-4226

6.1.1 (2017-05-11)

  • fix; preventing unsubscribe from modifying array iterator, preventing 'unfinalized' statu (26e42b8)

6.0.2 (2017-05-03)

  • fix; add missing signature on interface (009fe3a)
  • fix; move editor-relate media components into media-core (defaultMediaProvider, mediaStat (c85be66)
  • fix; use common mediaProvider for both renderer and editor-core (7ed6650)
  • feature; add Webp support to requests (1239b33)

6.0.0 (2017-04-27)

  • fix; update legal copy to be more clear. Not all modules include ADG license. (f3a945e)

5.5.2 (2017-04-27)

  • fix; added a refresh() method on the collection controller" (17c6b1f)
  • feature; added a refresh() method on the collection controller (866c778)
  • breaking; The complete callback is no longer called on the CollectionProvider

5.5.0 (2017-04-26)

  • feature; added a refresh() method on the collection controller (87b008b)

5.4.1 (2017-04-26)

  • fix; update legal copy and fix broken links for component README on npm. New contribution and (0b3e454)
  • fix; updated media packages key words and maintainers (01bcbc5)

5.4.0 (2017-04-18)

  • fix; call function isIE() (85a5f07)
  • fix; call utility function (0a7f1c1)
  • fix; fix tests to run in IE (62b4e00)
  • feature; add utility function to detect if we need to specify crossorigin property for img e (5536b7a)

5.3.0 (2017-04-10)

  • feature; expose media collection provider interface (9071b45)

5.2.1 (2017-04-07)

  • fix; fix unhandled promise error and broken test (which isn't actually failing) (b213f0c)

5.2.0 (2017-04-06)

  • fix; change nextInclusiveStartKey on RemoteCollectionItemsResponse to be optional (8ee8039)
  • feature; collection controller can load next page until given predicate (1424c57)

5.1.0 (2017-04-04)

  • feature; export DataUriService (1cd019c)

5.0.3 (2017-03-31)

  • fix; make addLinkItem method send metadata properly (21a0cc1)
  • fix; return an error when the URLPreview endpoint returns an error with a successful stat (a85b1c0)

5.0.1 (2017-03-29)

  • fix; repush stories for broken releases (9032923)

4.0.0 (2017-03-28)

  • fix; bump media packages and fix ts errors (dcc463d)
  • fix; pass missing collectionName to createRequest (5ea22d8)
  • feature; modified Context.getMediaItemProvider to use a MediaItem if provided (a6128cd)
  • breaking; Changed the CollectionService response to be similar to an array of MediaItems. Typed processingStatus.
  • ISSUES CLOSED: FIL-3542

2.0.0 (2017-03-25)

  • expose config on context (256fde2)
  • feature; add collection action and event handler (d6a07a3)
  • feature; add details support in collections service (477ee0f)
  • feature; add occurrence key to media collection item (3705deb)
  • breaking; Context API changed
  • breaking; MediaCollectionItem API changed
  • breaking; CollectionService API changed

1.99.1 (2017-03-24)

  • fix; refactor media-core services to use a common method for doing XHR (80a3576)

1.3.0 (2017-03-23)

  • fix; fixing the build (ba21a9d)
  • feature; added 'super' card component (559579f)
  • breaking; Card API, LinkCard API, FileCard API
  • ISSUES CLOSED: FIL-3919
  • fix; maintainers for all the packages were added (261d00a)
  • feature; media core changes as part of shipit (d13526e)
  • feature; added application links to media-card and restructured (618650e)
  • fix; add addLinkItem interface member to context (b548257)
  • feature; updated linkCard to take either a stored link or url (704f16d)
  • fix; fix TS issues with media-card (6fd3f27)
  • feature; add method 'addLinkItem' to the link service (0b0d9d3)

1.2.2 (2017-03-06)

  • fix; fix processing status (fixes card file caching) (668780e)
  • feature; migrate FilmStrip component + create media-test-helpers (8896543)
  • feature; move MediaKit into Atlaskit (98de4f3)

1.2.1 (2017-03-06)

  • fix; declare axios as dependency (609768c)

1.2.0 (2017-03-02)

  • fix; moved lru-fast to dependencies (85f7f8f)
  • fix; specified lru-fast as a dependency within media-core instead of devDependency (c505959)
  • feature; migrated card from mediakit repo to atlaskit (438a050)

1.1.0 (2017-02-27)

  • empty commit to make components release themselves (5511fbe)
  • feature; move providers, services, and context to Atlaskit (31ca242)

1.0.0 (2017-02-12)