@frontify/guideline-blocks-settings 0.30.2 → 0.31.0

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,18 @@
1
1
  # @frontify/guideline-blocks-settings
2
2
 
3
+ ## 0.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#698](https://github.com/Frontify/brand-sdk/pull/698) [`1003fea`](https://github.com/Frontify/brand-sdk/commit/1003feab2b08e4cc4db5629306e2f25cda8bae86) Thanks [@ragi96](https://github.com/ragi96)! - feat: move @frontify/app-bridge to peer dependencies
8
+
9
+ ### Patch Changes
10
+
11
+ - [#697](https://github.com/Frontify/brand-sdk/pull/697) [`759188b`](https://github.com/Frontify/brand-sdk/commit/759188b28219e23ef7ce19edbc2d5e3248270ea8) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bumps @frontify/fondue to 12.0.0-beta.396
12
+
13
+ - Updated dependencies [[`759188b`](https://github.com/Frontify/brand-sdk/commit/759188b28219e23ef7ce19edbc2d5e3248270ea8)]:
14
+ - @frontify/sidebar-settings@0.9.1
15
+
3
16
  ## 0.30.2
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -58,3 +58,17 @@ import '@frontify/guideline-blocks-settings/styles';
58
58
  ## Development
59
59
 
60
60
  Run `pnpm build` to make changes directly available to the linked packages.
61
+
62
+ To run the tests, linter, or type checker, first update @frontify/app-bridge. For the latest version, execute:
63
+
64
+ ```
65
+ pnpm add @frontify/app-bridge@workspace:^ --filter {packages/guideline-blocks-settings}
66
+ ```
67
+
68
+ For a specific version, such as 3.0.2, execute:
69
+
70
+ ```
71
+ pnpm add @frontify/app-bridge@3.0.2 --filter {packages/guideline-blocks-settings}
72
+ ```
73
+
74
+ After updating, you can run the following commands as needed. For testing, use `pnpm test`. For linting, use `pnpm lint`. For type checking, use `pnpm typecheck`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontify/guideline-blocks-settings",
3
- "version": "0.30.2",
3
+ "version": "0.31.0",
4
4
  "description": "Provides types and helpers for the guideline block development",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.umd.js",
@@ -56,16 +56,16 @@
56
56
  "@dnd-kit/core": "^6.1.0",
57
57
  "@dnd-kit/modifiers": "^7.0.0",
58
58
  "@dnd-kit/sortable": "^8.0.0",
59
- "@frontify/fondue": "12.0.0-beta.395",
59
+ "@frontify/fondue": "12.0.0-beta.396",
60
60
  "@react-aria/focus": "^3.14.0",
61
61
  "@react-stately/overlays": "^3.6.1",
62
62
  "@udecode/plate": "^21.5.0",
63
63
  "slate": "^0.94.1",
64
64
  "slate-react": "^0.98.3",
65
- "@frontify/app-bridge": "^3.0.2",
66
- "@frontify/sidebar-settings": "^0.9.0"
65
+ "@frontify/sidebar-settings": "^0.9.1"
67
66
  },
68
67
  "peerDependencies": {
68
+ "@frontify/app-bridge": "^3.0.0",
69
69
  "react": "^18",
70
70
  "react-dom": "^18"
71
71
  },
@@ -1,9 +1,10 @@
1
1
  /* (c) Copyright Frontify Ltd., all rights reserved. */
2
2
 
3
- import { AssetDummy, getAppBridgeBlockStub } from '@frontify/app-bridge';
3
+ import { type AppBridgeBlock, AssetDummy, getAppBridgeBlockStub } from '@frontify/app-bridge';
4
4
  import { mount } from 'cypress/react18';
5
5
  import { Attachments as AttachmentsComponent } from './Attachments';
6
6
  import { AttachmentsProps } from './types';
7
+ import { SinonStub } from 'sinon';
7
8
 
8
9
  const FlyoutButtonSelector = '[data-test-id="attachments-flyout-button"]';
9
10
  const AssetInputSelector = '[data-test-id="asset-input-placeholder"]';
@@ -37,6 +38,11 @@ const Attachments = ({
37
38
  );
38
39
  };
39
40
 
41
+ const isPre302Stub = async (appBridge: AppBridgeBlock): Promise<boolean> => {
42
+ const context = appBridge.context();
43
+ return context === undefined;
44
+ };
45
+
40
46
  describe('Attachments', () => {
41
47
  it('renders attachments flyout if it is in edit mode', () => {
42
48
  mount(<Attachments appBridge={getAppBridgeBlockStub({ editorState: true })} />);
@@ -83,11 +89,15 @@ describe('Attachments', () => {
83
89
  cy.get(AttachmentItemSelector).should('have.length', 3);
84
90
  });
85
91
 
86
- it('renders loading circle for attachment item', () => {
92
+ it('renders loading circle for attachment item', async () => {
87
93
  const appBridge = getAppBridgeBlockStub({
88
94
  editorState: true,
89
95
  });
90
96
 
97
+ if (await isPre302Stub(appBridge)) {
98
+ (appBridge.openAssetChooser as SinonStub) = cy.stub().callsArgWith(0, AssetDummy.with(4));
99
+ }
100
+
91
101
  cy.clock();
92
102
  const replaceStub = () =>
93
103
  new Promise<void>((resolve) =>