-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
129 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,46 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [3.5.0](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-20) | ||
|
||
### Features | ||
|
||
- increase the timeout for editor entity store to avoid data loss ([#212](https://github.com/contentful/experience-builder/issues/212)) ([844a1ad](https://github.com/contentful/experience-builder/commit/844a1adf9c0ed33d91c76bd3c9a01680adea906b)) | ||
|
||
## [3.4.4](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-20) | ||
|
||
**Note:** Version bump only for package @contentful/experience-builder | ||
|
||
## [3.4.3](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-20) | ||
|
||
### Bug Fixes | ||
|
||
- switching locale makes design components disappear [SPA-1711] ([#209](https://github.com/contentful/experience-builder/issues/209)) ([84ca724](https://github.com/contentful/experience-builder/commit/84ca7248cbfcbd835a58c979d26ec9d375a02931)) | ||
|
||
## [3.4.2](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-20) | ||
|
||
### Bug Fixes | ||
|
||
- design token logic breaks auto height for empty containers ([#210](https://github.com/contentful/experience-builder/issues/210)) ([901bf67](https://github.com/contentful/experience-builder/commit/901bf67c6f7e3fb1a6b968b7fbb26b27d302f13b)) | ||
|
||
## [3.4.1](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-20) | ||
|
||
### Bug Fixes | ||
|
||
- dont initialise entity store on every render by using state [SPA-1711] ([#208](https://github.com/contentful/experience-builder/issues/208)) ([b04f44b](https://github.com/contentful/experience-builder/commit/b04f44bae930df18ee53c74754f40ddb2bca2fbe)) | ||
|
||
# [3.4.0](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-20) | ||
|
||
### Features | ||
|
||
- improve logs for example using a consistent prefix ([#207](https://github.com/contentful/experience-builder/issues/207)) ([96c306d](https://github.com/contentful/experience-builder/commit/96c306d23ac546c6b7bf6f425b434a9517f99b6f)) | ||
|
||
## [3.3.1](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-19) | ||
|
||
### Bug Fixes | ||
|
||
- resolve breakpoint values correctly so that the ui doesn't crash ([91cc76a](https://github.com/contentful/experience-builder/commit/91cc76a65e45e621f90665118410d7089e6f5a94)) | ||
|
||
# [3.3.0](https://github.com/contentful/experience-builder/compare/@contentful/[email protected]...@contentful/[email protected]) (2023-12-18) | ||
|
||
### Features | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
packages/experience-builder-sdk/src/communication/MouseOverHandler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
packages/experience-builder-sdk/src/utils/isLinkToAsset.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { isLinkToAsset } from './isLinkToAsset'; | ||
|
||
describe('isLinkToAsset', () => { | ||
it('should return false for undefined', () => { | ||
expect(isLinkToAsset(undefined)).toBe(false); | ||
}); | ||
|
||
it('should return false for null', () => { | ||
expect(isLinkToAsset(null)).toBe(false); | ||
}); | ||
|
||
it('should return false for non-object types', () => { | ||
expect(isLinkToAsset('string')).toBe(false); | ||
expect(isLinkToAsset(123)).toBe(false); | ||
expect(isLinkToAsset(true)).toBe(false); | ||
}); | ||
|
||
it('should return false for objects without sys property', () => { | ||
expect(isLinkToAsset({})).toBe(false); | ||
}); | ||
|
||
it('should return false for objects with sys but without linkType', () => { | ||
expect(isLinkToAsset({ sys: {} })).toBe(false); | ||
}); | ||
|
||
it('should return false for objects with sys.linkType not equal to "Asset"', () => { | ||
expect(isLinkToAsset({ sys: { linkType: 'Entry' } })).toBe(false); | ||
}); | ||
|
||
it('should return false for objects with sys.type not equal to "Link"', () => { | ||
expect(isLinkToAsset({ sys: { linkType: 'Asset', type: 'NotLink' } })).toBe(false); | ||
}); | ||
|
||
it('should return false for objects with sys.id not a string or empty', () => { | ||
expect(isLinkToAsset({ sys: { linkType: 'Asset', type: 'Link', id: 123 } })).toBe(false); | ||
expect(isLinkToAsset({ sys: { linkType: 'Asset', type: 'Link', id: '' } })).toBe(false); | ||
}); | ||
|
||
it('should return true for valid Asset link object', () => { | ||
const validAssetLink = { | ||
sys: { | ||
linkType: 'Asset', | ||
type: 'Link', | ||
id: 'validAssetId', | ||
}, | ||
}; | ||
expect(isLinkToAsset(validAssetLink)).toBe(true); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/experience-builder-sdk/src/utils/isLinkToAsset.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Link } from '@contentful/experience-builder-types'; | ||
|
||
export const isLinkToAsset = (variable: any): variable is Link<'Asset'> => { | ||
if (!variable) return false; | ||
if (typeof variable !== 'object') return false; | ||
|
||
return ( | ||
variable.sys?.linkType === 'Asset' && | ||
typeof variable.sys?.id === 'string' && | ||
!!variable.sys?.id && | ||
variable.sys?.type === 'Link' | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters