diff --git a/.changeset/afraid-dingos-wear.md b/.changeset/afraid-dingos-wear.md new file mode 100644 index 000000000..f9d628c64 --- /dev/null +++ b/.changeset/afraid-dingos-wear.md @@ -0,0 +1,9 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove react hooks and related events + +- `useCategorizedDocumentPages` +- `useDocumentPageTargets` +- `useUncategorizedDocumentPages` diff --git a/.changeset/all-parts-shout.md b/.changeset/all-parts-shout.md new file mode 100644 index 000000000..366eb5715 --- /dev/null +++ b/.changeset/all-parts-shout.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove TemplatePageApi type diff --git a/.changeset/angry-hairs-enjoy.md b/.changeset/angry-hairs-enjoy.md new file mode 100644 index 000000000..78c9d7ca4 --- /dev/null +++ b/.changeset/angry-hairs-enjoy.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove AppBridgeCreateAsset, please use `@frontify/app-bridge-app` diff --git a/.changeset/angry-scissors-tap.md b/.changeset/angry-scissors-tap.md new file mode 100644 index 000000000..7c8580ea5 --- /dev/null +++ b/.changeset/angry-scissors-tap.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat(Asset): added the focal point properties diff --git a/.changeset/beige-pots-poke.md b/.changeset/beige-pots-poke.md new file mode 100644 index 000000000..5e7488187 --- /dev/null +++ b/.changeset/beige-pots-poke.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `filterDocumentSectionsWithUnreadableTitles` helper diff --git a/.changeset/better-onions-relate.md b/.changeset/better-onions-relate.md new file mode 100644 index 000000000..77b45f2df --- /dev/null +++ b/.changeset/better-onions-relate.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor(Asset): remove `creatorName` and `projectType` on the `Asset` diff --git a/.changeset/blue-foxes-dance.md b/.changeset/blue-foxes-dance.md new file mode 100644 index 000000000..dd811d8d4 --- /dev/null +++ b/.changeset/blue-foxes-dance.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: update dependencies diff --git a/.changeset/bold-horses-joke.md b/.changeset/bold-horses-joke.md new file mode 100644 index 000000000..323c8cf09 --- /dev/null +++ b/.changeset/bold-horses-joke.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `GetBulkDownloadTokenApi` and `BulkDownloadApi` types diff --git a/.changeset/brave-queens-smile.md b/.changeset/brave-queens-smile.md new file mode 100644 index 000000000..5aa11b4ab --- /dev/null +++ b/.changeset/brave-queens-smile.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: remove appBridgePlatformApp diff --git a/.changeset/brave-queens-work.md b/.changeset/brave-queens-work.md new file mode 100644 index 000000000..c8892e305 --- /dev/null +++ b/.changeset/brave-queens-work.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge main to dev diff --git a/.changeset/breezy-aliens-strive.md b/.changeset/breezy-aliens-strive.md new file mode 100644 index 000000000..871cb00bc --- /dev/null +++ b/.changeset/breezy-aliens-strive.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove color related methods: `getColors`, `getColorPalettesWithColors`, `getColorPalettes`, `getColorsByColorPaletteId` and react hooks: `useColors`, `useColorPalettes` diff --git a/.changeset/bright-insects-wash.md b/.changeset/bright-insects-wash.md new file mode 100644 index 000000000..9b037e4cf --- /dev/null +++ b/.changeset/bright-insects-wash.md @@ -0,0 +1,28 @@ +--- +"@frontify/app-bridge": minor +--- + +feat: add `trackEvent` command + +Use the `trackEvent` command to log custom events within blocks. +The event accepts `TrackActions` and an optional payload. + +If you need more actions, please reach out through the Frontify Friends Slack channel. + +Example usage: + +```typescript +appBridge.dispatch({ + name: "trackEvent", + payload: { + action: "button:clicked", + payload: { buttonId: "path/to/button", label: "Click me" }, + }, +}); + +// or without payload +appBridge.dispatch({ + name: "trackEvent", + payload: { action: "button:clicked", payload: null }, +}); +``` diff --git a/.changeset/calm-candles-wink.md b/.changeset/calm-candles-wink.md new file mode 100644 index 000000000..b22258754 --- /dev/null +++ b/.changeset/calm-candles-wink.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat(AppBridgePlatformApp): only one app bridge per iframe diff --git a/.changeset/calm-rabbits-listen.md b/.changeset/calm-rabbits-listen.md new file mode 100644 index 000000000..dc2b3b8bc --- /dev/null +++ b/.changeset/calm-rabbits-listen.md @@ -0,0 +1,7 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor(useBlockAssets): source state from `Context.assets` + +The hook now seeds and updates `blockAssets` from `appBridge.context('assets')` and no longer fetches via `getBlockAssets()` on mount. It also no longer listens to or emits `AppBridge:BlockAssetsUpdated`; mutation helpers (`addAssetIdsToKey`, `deleteAssetIdsFromKey`, `updateAssetIdsFromKey`) just call the AppBridge API, and the host is responsible for refreshing `context('assets')` after each mutation. diff --git a/.changeset/chubby-planets-shave.md b/.changeset/chubby-planets-shave.md new file mode 100644 index 000000000..879c4739e --- /dev/null +++ b/.changeset/chubby-planets-shave.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `DocumentBlockTemplate` types diff --git a/.changeset/clever-suns-laugh.md b/.changeset/clever-suns-laugh.md new file mode 100644 index 000000000..3cbac03e7 --- /dev/null +++ b/.changeset/clever-suns-laugh.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: rename brand sdk name diff --git a/.changeset/cuddly-pets-hammer.md b/.changeset/cuddly-pets-hammer.md new file mode 100644 index 000000000..b2bab11a7 --- /dev/null +++ b/.changeset/cuddly-pets-hammer.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +fix: document page duplication return type diff --git a/.changeset/early-phones-win.md b/.changeset/early-phones-win.md new file mode 100644 index 000000000..6f1eb8e2d --- /dev/null +++ b/.changeset/early-phones-win.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove already deprecated method `getDocumentCategoriesByDocumentId` diff --git a/.changeset/easy-geckos-repair.md b/.changeset/easy-geckos-repair.md new file mode 100644 index 000000000..11281f055 --- /dev/null +++ b/.changeset/easy-geckos-repair.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove already deprecated `getColorsByIds` diff --git a/.changeset/eleven-times-relate.md b/.changeset/eleven-times-relate.md new file mode 100644 index 000000000..5b49149ae --- /dev/null +++ b/.changeset/eleven-times-relate.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove `useDocumentGroups`, `useGroupedDocuments` and `useUngroupedDocuments` hook and also remove the `DocumentGroupApi` type diff --git a/.changeset/fast-balloons-bow.md b/.changeset/fast-balloons-bow.md new file mode 100644 index 000000000..14343be2f --- /dev/null +++ b/.changeset/fast-balloons-bow.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: cleanup unused types in DocumentCategory diff --git a/.changeset/five-mangos-search.md b/.changeset/five-mangos-search.md new file mode 100644 index 000000000..72a2a5743 --- /dev/null +++ b/.changeset/five-mangos-search.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: merge `main` into `dev` diff --git a/.changeset/four-crabs-bake.md b/.changeset/four-crabs-bake.md new file mode 100644 index 000000000..8e28ee068 --- /dev/null +++ b/.changeset/four-crabs-bake.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: (AppBridgeTheme) update appBridgeThemeStub with context and state diff --git a/.changeset/fuzzy-rabbits-swim.md b/.changeset/fuzzy-rabbits-swim.md new file mode 100644 index 000000000..ab351d50e --- /dev/null +++ b/.changeset/fuzzy-rabbits-swim.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: clean up target api related things diff --git a/.changeset/fuzzy-walls-repeat.md b/.changeset/fuzzy-walls-repeat.md new file mode 100644 index 000000000..3d0f4d81a --- /dev/null +++ b/.changeset/fuzzy-walls-repeat.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: Merge main into dev diff --git a/.changeset/giant-shrimps-dream.md b/.changeset/giant-shrimps-dream.md new file mode 100644 index 000000000..f26a59dcf --- /dev/null +++ b/.changeset/giant-shrimps-dream.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +feat: add open/close search dialog commands to AppBridgeTheme diff --git a/.changeset/good-forks-repair.md b/.changeset/good-forks-repair.md new file mode 100644 index 000000000..c8892e305 --- /dev/null +++ b/.changeset/good-forks-repair.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge main to dev diff --git a/.changeset/goofy-otters-judge.md b/.changeset/goofy-otters-judge.md new file mode 100644 index 000000000..21676fb2d --- /dev/null +++ b/.changeset/goofy-otters-judge.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor(Emitter): remove unused type `EmitterAction` diff --git a/.changeset/gorgeous-seas-search.md b/.changeset/gorgeous-seas-search.md new file mode 100644 index 000000000..44f330623 --- /dev/null +++ b/.changeset/gorgeous-seas-search.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge branch `main` into dev diff --git a/.changeset/green-bottles-walk.md b/.changeset/green-bottles-walk.md new file mode 100644 index 000000000..c1ada6903 --- /dev/null +++ b/.changeset/green-bottles-walk.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove already deprecated method `getDocumentGroups` diff --git a/.changeset/happy-stars-matter.md b/.changeset/happy-stars-matter.md new file mode 100644 index 000000000..f42e6ad01 --- /dev/null +++ b/.changeset/happy-stars-matter.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `getDatasetByElement` and `getDatasetByClassName` diff --git a/.changeset/hip-days-applaud.md b/.changeset/hip-days-applaud.md new file mode 100644 index 000000000..72a2a5743 --- /dev/null +++ b/.changeset/hip-days-applaud.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: merge `main` into `dev` diff --git a/.changeset/hip-foxes-listen.md b/.changeset/hip-foxes-listen.md new file mode 100644 index 000000000..72d239439 --- /dev/null +++ b/.changeset/hip-foxes-listen.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: add documentId to GuidelineDocumentCategory events diff --git a/.changeset/hip-trees-leave.md b/.changeset/hip-trees-leave.md new file mode 100644 index 000000000..737207e2b --- /dev/null +++ b/.changeset/hip-trees-leave.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: update deps diff --git a/.changeset/khaki-dryers-shout.md b/.changeset/khaki-dryers-shout.md new file mode 100644 index 000000000..d6ace4e4f --- /dev/null +++ b/.changeset/khaki-dryers-shout.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": major +--- + +feat: modify `DocumentSection` and `DocumentSectionApi` type to allow `title` to be `null`. diff --git a/.changeset/kind-clubs-sleep.md b/.changeset/kind-clubs-sleep.md new file mode 100644 index 000000000..017d585c7 --- /dev/null +++ b/.changeset/kind-clubs-sleep.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove unused `Topic` type diff --git a/.changeset/kind-fishes-flash.md b/.changeset/kind-fishes-flash.md new file mode 100644 index 000000000..185052be7 --- /dev/null +++ b/.changeset/kind-fishes-flash.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: add context.template to AppBridgeTheme diff --git a/.changeset/legal-dots-smell.md b/.changeset/legal-dots-smell.md new file mode 100644 index 000000000..41206b44e --- /dev/null +++ b/.changeset/legal-dots-smell.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `DocumentPageRequest`, `DocumentPageCreate`, `DocumentPageUpdate` and `DocumentPageDelete` types diff --git a/.changeset/lemon-shrimps-brake.md b/.changeset/lemon-shrimps-brake.md new file mode 100644 index 000000000..2ef61c822 --- /dev/null +++ b/.changeset/lemon-shrimps-brake.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor: remove already deprecated method `getDocumentPagesByDocumentCategoryId` diff --git a/.changeset/light-crews-report.md b/.changeset/light-crews-report.md new file mode 100644 index 000000000..1003ebd33 --- /dev/null +++ b/.changeset/light-crews-report.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Merge main into dev diff --git a/.changeset/lovely-books-hear.md b/.changeset/lovely-books-hear.md new file mode 100644 index 000000000..d272a7449 --- /dev/null +++ b/.changeset/lovely-books-hear.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: switch to platformAppBridge to v4 diff --git a/.changeset/lucky-taxis-kneel.md b/.changeset/lucky-taxis-kneel.md new file mode 100644 index 000000000..79b38c09d --- /dev/null +++ b/.changeset/lucky-taxis-kneel.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: add user state variable diff --git a/.changeset/mighty-brooms-lay.md b/.changeset/mighty-brooms-lay.md new file mode 100644 index 000000000..782101f06 --- /dev/null +++ b/.changeset/mighty-brooms-lay.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge main into dev diff --git a/.changeset/nasty-feet-repair.md b/.changeset/nasty-feet-repair.md new file mode 100644 index 000000000..da4af8aed --- /dev/null +++ b/.changeset/nasty-feet-repair.md @@ -0,0 +1,6 @@ +--- +"@frontify/app-bridge": patch +--- + +fix(useDocumentNavigation): Fixed an issue that prevented debounced callbacks not to be executed +fix(usePortalNavigation): Fixed an issue that prevented debounced callbacks not to be executed diff --git a/.changeset/neat-eagles-open.md b/.changeset/neat-eagles-open.md new file mode 100644 index 000000000..5c21a440e --- /dev/null +++ b/.changeset/neat-eagles-open.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `useDocumentSection` react hooks, along with types and events diff --git a/.changeset/neat-plants-smile.md b/.changeset/neat-plants-smile.md new file mode 100644 index 000000000..1003ebd33 --- /dev/null +++ b/.changeset/neat-plants-smile.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Merge main into dev diff --git a/.changeset/nervous-walls-repair.md b/.changeset/nervous-walls-repair.md new file mode 100644 index 000000000..88164ccee --- /dev/null +++ b/.changeset/nervous-walls-repair.md @@ -0,0 +1,6 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: Adjust PlatformAppContext +refactor: rename from type to surface diff --git a/.changeset/nice-crabs-repeat.md b/.changeset/nice-crabs-repeat.md new file mode 100644 index 000000000..35726d406 --- /dev/null +++ b/.changeset/nice-crabs-repeat.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": major +--- + +refactor: remove `DocumentApiDummy` and `DocumentDummy` testing utils, cleanup types in `Document.ts`, remove `getDocumentsByDocumentGroupId` from AppBridgeBlock diff --git a/.changeset/nine-roses-sleep.md b/.changeset/nine-roses-sleep.md new file mode 100644 index 000000000..ff1af532e --- /dev/null +++ b/.changeset/nine-roses-sleep.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Fix: readd method diff --git a/.changeset/ninety-lions-love.md b/.changeset/ninety-lions-love.md new file mode 100644 index 000000000..e7f4b965e --- /dev/null +++ b/.changeset/ninety-lions-love.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +fix: AssetChooserResult Type as alternative text is prefixed with computed diff --git a/.changeset/odd-geckos-end.md b/.changeset/odd-geckos-end.md new file mode 100644 index 000000000..5a7a253de --- /dev/null +++ b/.changeset/odd-geckos-end.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: rename brandsdk name from secretRequest to secureRequest diff --git a/.changeset/old-badgers-fall.md b/.changeset/old-badgers-fall.md new file mode 100644 index 000000000..90646d64e --- /dev/null +++ b/.changeset/old-badgers-fall.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove UserApi related things diff --git a/.changeset/old-cougars-study.md b/.changeset/old-cougars-study.md new file mode 100644 index 000000000..5acf1ad7b --- /dev/null +++ b/.changeset/old-cougars-study.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +feat(Asset): added the property alternativeText diff --git a/.changeset/orange-jokes-listen.md b/.changeset/orange-jokes-listen.md new file mode 100644 index 000000000..1003ebd33 --- /dev/null +++ b/.changeset/orange-jokes-listen.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Merge main into dev diff --git a/.changeset/pink-bugs-behave.md b/.changeset/pink-bugs-behave.md new file mode 100644 index 000000000..055f62a9d --- /dev/null +++ b/.changeset/pink-bugs-behave.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: adds `setAssetIdsByBlockAssetKey` to AppBridgeBlock diff --git a/.changeset/pink-geckos-change.md b/.changeset/pink-geckos-change.md new file mode 100644 index 000000000..14e14bdc2 --- /dev/null +++ b/.changeset/pink-geckos-change.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat(usePageTemplateSettings): returns also templateThemeSettings diff --git a/.changeset/polite-eels-shake.md b/.changeset/polite-eels-shake.md new file mode 100644 index 000000000..ee9ca6583 --- /dev/null +++ b/.changeset/polite-eels-shake.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: adjust the color type to have a revision diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 000000000..1835dab51 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,107 @@ +{ + "mode": "pre", + "tag": "alpha", + "initialVersions": { + "@frontify/app-bridge": "3.0.0", + "@frontify/frontify-cli": "5.5.3", + "@frontify/guideline-blocks-settings": "0.29.16", + "@frontify/sidebar-settings": "0.8.1", + "@frontify/platform-app": "0.0.5", + "@frontify/app-bridge-theme": "1.0.0-alpha.1", + "@frontify/app-bridge-app": "0.0.5", + "@frontify/guideline-themes": "0.0.0" + }, + "changesets": [ + "afraid-dingos-wear", + "all-parts-shout", + "angry-hairs-enjoy", + "angry-scissors-tap", + "beige-pots-poke", + "better-onions-relate", + "blue-foxes-dance", + "bold-horses-joke", + "brave-queens-smile", + "brave-queens-work", + "breezy-aliens-strive", + "bright-insects-wash", + "calm-candles-wink", + "calm-rabbits-listen", + "chubby-planets-shave", + "clever-suns-laugh", + "cuddly-pets-hammer", + "early-phones-win", + "easy-geckos-repair", + "eleven-times-relate", + "fast-balloons-bow", + "five-mangos-search", + "four-crabs-bake", + "fuzzy-rabbits-swim", + "fuzzy-walls-repeat", + "giant-shrimps-dream", + "good-forks-repair", + "goofy-otters-judge", + "gorgeous-seas-search", + "green-bottles-walk", + "happy-stars-matter", + "hip-days-applaud", + "hip-foxes-listen", + "hip-trees-leave", + "khaki-dryers-shout", + "kind-clubs-sleep", + "kind-fishes-flash", + "legal-dots-smell", + "lemon-shrimps-brake", + "light-crews-report", + "lovely-books-hear", + "lucky-taxis-kneel", + "mighty-brooms-lay", + "nasty-feet-repair", + "neat-eagles-open", + "neat-plants-smile", + "nervous-walls-repair", + "nice-crabs-repeat", + "nine-roses-sleep", + "ninety-lions-love", + "odd-geckos-end", + "old-badgers-fall", + "old-cougars-study", + "orange-jokes-listen", + "pink-bugs-behave", + "pink-geckos-change", + "polite-eels-shake", + "pretty-items-marry", + "purple-flowers-smell", + "quick-mails-dress", + "real-jeans-guess", + "red-islands-report", + "rich-olives-repeat", + "shaggy-moles-divide", + "shaggy-mugs-speak", + "shy-jobs-protect", + "six-ears-wait", + "smart-suns-type", + "smooth-planets-pay", + "spicy-books-shout", + "stale-hairs-wash", + "strong-tools-check", + "swift-koalas-hum", + "tall-apples-turn", + "tame-dodos-fail", + "ten-guests-wash", + "thirty-eggs-judge", + "tidy-mice-notice", + "tiny-feet-unite", + "tough-nails-shout", + "tricky-boats-sip", + "tricky-experts-accept", + "true-bags-poke", + "warm-hounds-refuse", + "wild-bags-judge", + "witty-rivers-smile", + "witty-states-stick", + "witty-tools-check", + "young-lands-hunt", + "yummy-kings-work", + "yummy-spoons-enjoy" + ] +} diff --git a/.changeset/pretty-items-marry.md b/.changeset/pretty-items-marry.md new file mode 100644 index 000000000..d7a034a0f --- /dev/null +++ b/.changeset/pretty-items-marry.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +fix: useGroupedDocuments and useUngroupedDocuments flaky tests diff --git a/.changeset/purple-flowers-smell.md b/.changeset/purple-flowers-smell.md new file mode 100644 index 000000000..9b3004215 --- /dev/null +++ b/.changeset/purple-flowers-smell.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `documentCategoryApi` type diff --git a/.changeset/quick-mails-dress.md b/.changeset/quick-mails-dress.md new file mode 100644 index 000000000..ca801e6e6 --- /dev/null +++ b/.changeset/quick-mails-dress.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": major +--- + +refactor: remove `useDocumentTargets` and `useDocumentCategories` diff --git a/.changeset/real-jeans-guess.md b/.changeset/real-jeans-guess.md new file mode 100644 index 000000000..c8892e305 --- /dev/null +++ b/.changeset/real-jeans-guess.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge main to dev diff --git a/.changeset/red-islands-report.md b/.changeset/red-islands-report.md new file mode 100644 index 000000000..8460e449a --- /dev/null +++ b/.changeset/red-islands-report.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: Method to reflect feature diff --git a/.changeset/rich-olives-repeat.md b/.changeset/rich-olives-repeat.md new file mode 100644 index 000000000..44f330623 --- /dev/null +++ b/.changeset/rich-olives-repeat.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge branch `main` into dev diff --git a/.changeset/shaggy-moles-divide.md b/.changeset/shaggy-moles-divide.md new file mode 100644 index 000000000..762a43786 --- /dev/null +++ b/.changeset/shaggy-moles-divide.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +feat: add back `useColorPalettes` react hook diff --git a/.changeset/shaggy-mugs-speak.md b/.changeset/shaggy-mugs-speak.md new file mode 100644 index 000000000..0bef3f30f --- /dev/null +++ b/.changeset/shaggy-mugs-speak.md @@ -0,0 +1,7 @@ +--- +"@frontify/app-bridge": patch +--- + +- feat(useDocumentSection): Subscribe hook to emitter event listeners. A new emitter type, `AppBridge:GuidelineDocumentSection:Action` has been added. This emitter can be used to add and remove items from the sections saved in the hook state. + +- feat(useDocumentSection): `navigationItems` is now returned from this hook. This array filters out sections with an unreadable title and should be used to create section navigation links. diff --git a/.changeset/shy-jobs-protect.md b/.changeset/shy-jobs-protect.md new file mode 100644 index 000000000..c8892e305 --- /dev/null +++ b/.changeset/shy-jobs-protect.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge main to dev diff --git a/.changeset/six-ears-wait.md b/.changeset/six-ears-wait.md new file mode 100644 index 000000000..040d18602 --- /dev/null +++ b/.changeset/six-ears-wait.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore(deps): bump diff --git a/.changeset/smart-suns-type.md b/.changeset/smart-suns-type.md new file mode 100644 index 000000000..60097a512 --- /dev/null +++ b/.changeset/smart-suns-type.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +feat(AppBridgeBlock): add `isAuthenticated` to `BlockContext` type diff --git a/.changeset/smooth-planets-pay.md b/.changeset/smooth-planets-pay.md new file mode 100644 index 000000000..1003ebd33 --- /dev/null +++ b/.changeset/smooth-planets-pay.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Merge main into dev diff --git a/.changeset/spicy-books-shout.md b/.changeset/spicy-books-shout.md new file mode 100644 index 000000000..28e101143 --- /dev/null +++ b/.changeset/spicy-books-shout.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Feat: adjust secure request response diff --git a/.changeset/stale-hairs-wash.md b/.changeset/stale-hairs-wash.md new file mode 100644 index 000000000..0d8972a0f --- /dev/null +++ b/.changeset/stale-hairs-wash.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": major +--- + +feat: first alpha release, removes all deprecated functions on the AppBridgeBlock diff --git a/.changeset/strong-tools-check.md b/.changeset/strong-tools-check.md new file mode 100644 index 000000000..de01291df --- /dev/null +++ b/.changeset/strong-tools-check.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Fix: add retry to subscription diff --git a/.changeset/swift-koalas-hum.md b/.changeset/swift-koalas-hum.md new file mode 100644 index 000000000..3323a4de3 --- /dev/null +++ b/.changeset/swift-koalas-hum.md @@ -0,0 +1,8 @@ +--- +"@frontify/app-bridge": minor +--- + +feat(AppBridge): expose block assets via `BlockContext` + +- Adds `assets` to `BlockContext`, available synchronously via `appBridge.context('assets').get()`. +- `useBlockAssets` now seeds its initial state from the context instead of fetching via `getBlockAssets()` on mount, so assets are available on the first render. diff --git a/.changeset/tall-apples-turn.md b/.changeset/tall-apples-turn.md new file mode 100644 index 000000000..daef9c2c6 --- /dev/null +++ b/.changeset/tall-apples-turn.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove cover page related things diff --git a/.changeset/tame-dodos-fail.md b/.changeset/tame-dodos-fail.md new file mode 100644 index 000000000..96d372adb --- /dev/null +++ b/.changeset/tame-dodos-fail.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": major +--- + +refactor: remove `createColorPalette`, `updateColorPalette`, `deleteColorPalette` and adjust `useColorPalette` react hook diff --git a/.changeset/ten-guests-wash.md b/.changeset/ten-guests-wash.md new file mode 100644 index 000000000..6febbe912 --- /dev/null +++ b/.changeset/ten-guests-wash.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: adds state listener to allow push from parent diff --git a/.changeset/thirty-eggs-judge.md b/.changeset/thirty-eggs-judge.md new file mode 100644 index 000000000..777c3ba7f --- /dev/null +++ b/.changeset/thirty-eggs-judge.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: Removed `appBridgeTheme` from the `@frontify/app-bridge` package. It is now provided via the `@frontify/app-bridge-theme` package. diff --git a/.changeset/tidy-mice-notice.md b/.changeset/tidy-mice-notice.md new file mode 100644 index 000000000..cca227f7c --- /dev/null +++ b/.changeset/tidy-mice-notice.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +chore(DocumentTargets): remove already deprecated `getDocumentTargets` and `getDocumentPageTargets` diff --git a/.changeset/tiny-feet-unite.md b/.changeset/tiny-feet-unite.md new file mode 100644 index 000000000..7ed3233b5 --- /dev/null +++ b/.changeset/tiny-feet-unite.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove TemplateApiLegacy type and test dummy diff --git a/.changeset/tough-nails-shout.md b/.changeset/tough-nails-shout.md new file mode 100644 index 000000000..c8892e305 --- /dev/null +++ b/.changeset/tough-nails-shout.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +chore: merge main to dev diff --git a/.changeset/tricky-boats-sip.md b/.changeset/tricky-boats-sip.md new file mode 100644 index 000000000..0d5054719 --- /dev/null +++ b/.changeset/tricky-boats-sip.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +feat(AppBridgeBlock): adds `creationFormUri` to the type `template` diff --git a/.changeset/tricky-experts-accept.md b/.changeset/tricky-experts-accept.md new file mode 100644 index 000000000..8de53d91e --- /dev/null +++ b/.changeset/tricky-experts-accept.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `pageTemplateAsset` type diff --git a/.changeset/true-bags-poke.md b/.changeset/true-bags-poke.md new file mode 100644 index 000000000..07ce04989 --- /dev/null +++ b/.changeset/true-bags-poke.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +chore(AppBridge): remove already deprecated `getUncategorizedDocumentPagesByDocumentId` diff --git a/.changeset/warm-hounds-refuse.md b/.changeset/warm-hounds-refuse.md new file mode 100644 index 000000000..1003ebd33 --- /dev/null +++ b/.changeset/warm-hounds-refuse.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Merge main into dev diff --git a/.changeset/wild-bags-judge.md b/.changeset/wild-bags-judge.md new file mode 100644 index 000000000..e01123abd --- /dev/null +++ b/.changeset/wild-bags-judge.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +feat: add navigateToDocumentSection command to AppBridgeTheme diff --git a/.changeset/witty-rivers-smile.md b/.changeset/witty-rivers-smile.md new file mode 100644 index 000000000..834e4e6ef --- /dev/null +++ b/.changeset/witty-rivers-smile.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +Merge `main` into `dev` diff --git a/.changeset/witty-states-stick.md b/.changeset/witty-states-stick.md new file mode 100644 index 000000000..501398db4 --- /dev/null +++ b/.changeset/witty-states-stick.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": minor +--- + +refactor remove already deprecated method `getUngroupedDocuments` diff --git a/.changeset/witty-tools-check.md b/.changeset/witty-tools-check.md new file mode 100644 index 000000000..dca04c628 --- /dev/null +++ b/.changeset/witty-tools-check.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +feat: deprecate react hooks for platform apps diff --git a/.changeset/young-lands-hunt.md b/.changeset/young-lands-hunt.md new file mode 100644 index 000000000..5f25cc637 --- /dev/null +++ b/.changeset/young-lands-hunt.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove Color and ColorPallete api related types and test dummies diff --git a/.changeset/yummy-kings-work.md b/.changeset/yummy-kings-work.md new file mode 100644 index 000000000..ca8ac5863 --- /dev/null +++ b/.changeset/yummy-kings-work.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": major +--- + +refactor: remove deprecated `updateColor`, `createColor`, and `deleteColor` methods from the AppBridge, the `useColors` hook, and related tests diff --git a/.changeset/yummy-spoons-enjoy.md b/.changeset/yummy-spoons-enjoy.md new file mode 100644 index 000000000..49d501889 --- /dev/null +++ b/.changeset/yummy-spoons-enjoy.md @@ -0,0 +1,5 @@ +--- +"@frontify/app-bridge": patch +--- + +refactor: remove `DocumentGroup` type and `DocumentGroupDummy` diff --git a/.github/workflows/continuous-deployment.yaml b/.github/workflows/continuous-deployment.yaml index 7996e541a..33271d9e5 100644 --- a/.github/workflows/continuous-deployment.yaml +++ b/.github/workflows/continuous-deployment.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - dev concurrency: ${{ github.workflow }}-${{ github.ref }} diff --git a/CODEOWNERS b/CODEOWNERS index 04f9f3422..18924de87 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,153 +1,3 @@ -# App Bridge - -packages/app-bridge/src/types @Frontify/frontend-platform - -## App Bridge Errors -packages/app-bridge/src/errors/HttpClientError.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience -packages/app-bridge/src/errors/InitializationError.ts @Frontify/developer-experience -packages/app-bridge/src/errors/NotifyError.ts @Frontify/developer-experience -packages/app-bridge/src/errors/TimeoutReachedError.ts @Frontify/developer-experience -packages/app-bridge/src/errors/ValidationError.ts @Frontify/developer-experience - -## App Bridge Helpers - -packages/app-bridge/src/helpers/ @Frontify/themes-and-navigation - -## React Hooks - -packages/app-bridge/src/react/useAssetBulkDownload.spec.tsx @Frontify/content-and-blocks -packages/app-bridge/src/react/useAssetBulkDownload.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useAssetChooser.spec.tsx @Frontify/content-and-blocks -packages/app-bridge/src/react/useAssetChooser.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useAssetUpload.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useAssetViewer.spec.tsx @Frontify/content-and-blocks -packages/app-bridge/src/react/useAssetViewer.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useBlockAssets.spec.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useBlockAssets.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useBlockSettings.spec.tsx @Frontify/content-and-blocks -packages/app-bridge/src/react/useBlockSettings.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useBlockTemplates.spec.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useBlockTemplates.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useBrandportalLink.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useBrandportalLink.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useCategorizedDocumentPages.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useCategorizedDocumentPages.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useColorPalettes.spec.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useColorPalettes.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useColors.spec.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useColors.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useCoverPage.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useCoverPage.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentCategories.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentCategories.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentGroups.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentGroups.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentPageTargets.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentPageTargets.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentSection.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentTargets.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useDocumentTargets.tsx @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useEditorState.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useFileInput.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useFileUpload.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useGroupedDocuments.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useGroupedDocuments.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useGuidelineActions.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useGuidelineActions.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useLanguage.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useLanguage.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useNavigationManager.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useNavigationManager.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/usePageTemplateSettings.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/usePageTemplateSettings.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/usePlatformAppBridge.spec.ts @Frontify/developer-experience -packages/app-bridge/src/react/usePlatformAppBridge.ts @Frontify/developer-experience -packages/app-bridge/src/react/usePrivacySettings.spec.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/usePrivacySettings.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useReadyForPrint.spec.tsx @Frontify/content-and-blocks -packages/app-bridge/src/react/useReadyForPrint.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useTemplateAssets.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useTemplateAssets.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useTemplateChooser.spec.tsx @Frontify/content-and-blocks -packages/app-bridge/src/react/useTemplateChooser.ts @Frontify/content-and-blocks -packages/app-bridge/src/react/useThemeAssets.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useThemeAssets.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useThemeSettings.spec.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useThemeSettings.ts @Frontify/themes-and-navigation -packages/app-bridge/src/react/useUncategorizedDocumentPages.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useUncategorizedDocumentPages.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useUngroupedDocuments.spec.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/react/useUngroupedDocuments.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation - -### App Bridge registries api - -packages/app-bridge/src/registries/api/CreateAsset.ts @Frontify/developer-experience -packages/app-bridge/src/registries/api/CreateAsset.spec.ts @Frontify/developer-experience -packages/app-bridge/src/registries/api/GetAssetResourceInformation.ts @Frontify/developer-experience -packages/app-bridge/src/registries/api/GetAssetResourceInformation.spec.ts @Frontify/developer-experience -packages/app-bridge/src/registries/api/GetProxyNetworkCall.ts @Frontify/developer-experience -packages/app-bridge/src/registries/api/GetProxyNetworkCall.spec.ts @Frontify/developer-experience -packages/app-bridge/src/registries/api/GetAssetBulkDownloadToken.ts @Frontify/content-and-blocks -packages/app-bridge/src/registries/api/GetCurrentUser.ts @Frontify/content-and-blocks @Frontify/developer-experience @Frontify/themes-and-navigation -packages/app-bridge/src/registries/api/GetCurrentUser.spec.ts @Frontify/content-and-blocks @Frontify/developer-experience @Frontify/themes-and-navigation - -### App Bridge registries commands -packages/app-bridge/src/registries/commands/AssetChooser.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation -packages/app-bridge/src/registries/commands/AssetViewer.ts @Frontify/content-and-blocks -packages/app-bridge/src/registries/commands/Connection.ts @Frontify/developer-experience -packages/app-bridge/src/registries/commands/DownloadAsset.ts @Frontify/content-and-blocks -packages/app-bridge/src/registries/commands/NavigationManager.ts @Frontify/themes-and-navigation -packages/app-bridge/src/registries/commands/NewPublication.ts @Frontify/content-and-blocks -packages/app-bridge/src/registries/commands/TemplateChooser.ts @Frontify/content-and-blocks - -### App Bridge registries events - -packages/app-bridge/src/registries/events/ @Frontify/content-and-blocks @Frontify/themes-and-navigation - -### App Bridge registries verbs - -packages/app-bridge/src/registries/verbs/ @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience - -## App Bridge repositories - -packages/app-bridge/src/repositories/ @Frontify/content-and-blocks - -## App Bridge Tests - -packages/app-bridge/src/tests/AppBridgeBlockStub.ts @Frontify/content-and-blocks -packages/app-bridge/src/tests/AppBridgePlatformAppStub.ts @Frontify/developer-experience -packages/app-bridge/src/tests/AppBridgeThemeStub.ts @Frontify/themes-and-navigation -packages/app-bridge/src/tests/withAppBridgeBlockStubs.tsx @Frontify/content-and-blocks -packages/app-bridge/src/tests/withAppBridgeThemeStubs.tsx @Frontify/themes-and-navigation - -## App Bridge Utilities - -packages/app-bridge/src/utilities/hash.ts @Frontify/developer-experience -packages/app-bridge/src/utilities/httpClient.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience -packages/app-bridge/src/utilities/MessageBus.ts @Frontify/developer-experience -packages/app-bridge/src/utilities/MessageBus.spec.ts @Frontify/developer-experience -packages/app-bridge/src/utilities/notify.ts @Frontify/developer-experience -packages/app-bridge/src/utilities/object.spec.ts @Frontify/content-and-blocks -packages/app-bridge/src/utilities/object.ts @Frontify/content-and-blocks -packages/app-bridge/src/utilities/queryParams.spec.ts @Frontify/developer-experience -packages/app-bridge/src/utilities/queryParams.ts @Frontify/developer-experience -packages/app-bridge/src/utilities/subscribe.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience - -## App Bridge Worker - -packages/app-bridge/src/worker/ @Frontify/content-and-blocks - -## App Bridge Interfaces - -packages/app-bridge/src/AppBridge.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience -packages/app-bridge/src/AppBridgeBlock.ts @Frontify/content-and-blocks -packages/app-bridge/src/AppBridgeCreateAsset.spec.ts @Frontify/developer-experience -packages/app-bridge/src/AppBridgeCreateAsset.ts @Frontify/developer-experience -packages/app-bridge/src/AppBridgePlatformApp.spec.ts @Frontify/developer-experience -packages/app-bridge/src/AppBridgePlatformApp.ts @Frontify/developer-experience -packages/app-bridge/src/AppBridgeTheme.ts @Frontify/themes-and-navigation -packages/app-bridge/src/window.d.ts @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience - # CLI packages/cli/src/commands/ @Frontify/content-and-blocks @Frontify/themes-and-navigation @Frontify/developer-experience @@ -170,6 +20,10 @@ packages/cli/templates/platform-app-css @Frontify/developer-experience packages/cli/templates/platform-app-css-modules @Frontify/developer-experience packages/cli/templates/platform-app-tailwind @Frontify/developer-experience +# Blocks + +packages/app-bridge @Frontify/content-and-blocks + # Platform Apps packages/platform-app @Frontify/developer-experience @@ -191,5 +45,4 @@ packages/app-bridge-theme @Frontify/themes-and-navigation packages/guideline-themes @Frontify/themes-and-navigation - CODEOWNERS @Frontify/architecture diff --git a/package.json b/package.json index 9f4e2e64e..3c707d007 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "npm": "<=0" }, "scripts": { - "build": "pnpm build:app-bridge && pnpm build:app-bridge-theme && pnpm build:sidebar-settings && pnpm build:guideline-blocks-settings && pnpm build:guideline-themes && pnpm build:platform-app && pnpm build:cli && pnpm build:app-bridge-app", + "build": "pnpm build:app-bridge && pnpm build:app-bridge-theme && pnpm build:sidebar-settings && pnpm build:guideline-blocks-settings && pnpm build:guideline-themes && pnpm build:platform-app && pnpm build:cli && pnpm build:app-bridge-app", "build:app-bridge": "pnpm --stream --filter {packages/app-bridge} build", - "build:app-bridge-app": "pnpm --stream --filter {packages/app-bridge-app} build", "build:app-bridge-theme": "pnpm --stream --filter {packages/app-bridge-theme} build", + "build:app-bridge-app": "pnpm --stream --filter {packages/app-bridge-app} build", "build:sidebar-settings": "pnpm --stream --filter {packages/sidebar-settings} build", "build:guideline-blocks-settings": "pnpm --stream --filter {packages/guideline-blocks-settings} build", "build:guideline-themes": "pnpm --stream --filter {packages/guideline-themes} build", diff --git a/packages/app-bridge-app/CHANGELOG.md b/packages/app-bridge-app/CHANGELOG.md index 91996e236..a4698daa3 100644 --- a/packages/app-bridge-app/CHANGELOG.md +++ b/packages/app-bridge-app/CHANGELOG.md @@ -22,198 +22,198 @@ ### Patch Changes -- [#1419](https://github.com/Frontify/brand-sdk/pull/1419) [`ede17a4`](https://github.com/Frontify/brand-sdk/commit/ede17a4a5649debb2fe44a01616f76b61fe89767) Thanks [@julianiff](https://github.com/julianiff)! - feat: add closeApp command and refactor previous command +- [#1419](https://github.com/Frontify/brand-sdk/pull/1419) [`ede17a4`](https://github.com/Frontify/brand-sdk/commit/ede17a4a5649debb2fe44a01616f76b61fe89767) Thanks [@julianiff](https://github.com/julianiff)! - feat: add closeApp command and refactor previous command ## 0.2.1 ### Patch Changes -- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies +- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies ## 0.2.0 ### Minor Changes -- [#1406](https://github.com/Frontify/brand-sdk/pull/1406) [`b646f9c`](https://github.com/Frontify/brand-sdk/commit/b646f9cb95630bd347eeca4a272e12f10a9dbbc8) Thanks [@julianiff](https://github.com/julianiff)! - feat: add command channel communication to brand-sdk +- [#1406](https://github.com/Frontify/brand-sdk/pull/1406) [`b646f9c`](https://github.com/Frontify/brand-sdk/commit/b646f9cb95630bd347eeca4a272e12f10a9dbbc8) Thanks [@julianiff](https://github.com/julianiff)! - feat: add command channel communication to brand-sdk ## 0.1.13 ### Patch Changes -- [#1390](https://github.com/Frontify/brand-sdk/pull/1390) [`51bfe25`](https://github.com/Frontify/brand-sdk/commit/51bfe25cd72dbdb81ed74f2edd01b7e841bac346) Thanks [@julianiff](https://github.com/julianiff)! - feat: add asssetChooser context +- [#1390](https://github.com/Frontify/brand-sdk/pull/1390) [`51bfe25`](https://github.com/Frontify/brand-sdk/commit/51bfe25cd72dbdb81ed74f2edd01b7e841bac346) Thanks [@julianiff](https://github.com/julianiff)! - feat: add asssetChooser context ## 0.1.12 ### Patch Changes -- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies ## 0.1.11 ### Patch Changes -- [#1312](https://github.com/Frontify/brand-sdk/pull/1312) [`1a7e48c`](https://github.com/Frontify/brand-sdk/commit/1a7e48c25435ff169cf80efe7eced4c6ce5ff6e2) Thanks [@julianiff](https://github.com/julianiff)! - feat: rename themeAction to actionToolbar surface +- [#1312](https://github.com/Frontify/brand-sdk/pull/1312) [`1a7e48c`](https://github.com/Frontify/brand-sdk/commit/1a7e48c25435ff169cf80efe7eced4c6ce5ff6e2) Thanks [@julianiff](https://github.com/julianiff)! - feat: rename themeAction to actionToolbar surface ## 0.1.10 ### Patch Changes -- [#1294](https://github.com/Frontify/brand-sdk/pull/1294) [`a828e37`](https://github.com/Frontify/brand-sdk/commit/a828e37e4934d751823b01bdfbbd42e77d732dee) Thanks [@julianiff](https://github.com/julianiff)! - feat: increase timeout of message bus +- [#1294](https://github.com/Frontify/brand-sdk/pull/1294) [`a828e37`](https://github.com/Frontify/brand-sdk/commit/a828e37e4934d751823b01bdfbbd42e77d732dee) Thanks [@julianiff](https://github.com/julianiff)! - feat: increase timeout of message bus ## 0.1.9 ### Patch Changes -- [#1282](https://github.com/Frontify/brand-sdk/pull/1282) [`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1282](https://github.com/Frontify/brand-sdk/pull/1282) [`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies ## 0.1.8 ### Patch Changes -- [#1250](https://github.com/Frontify/brand-sdk/pull/1250) [`9510eba`](https://github.com/Frontify/brand-sdk/commit/9510eba02bd038405bef911579b89f3e23c1216f) Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - feat(app): Enable to pass preview features to the GQL calls +- [#1250](https://github.com/Frontify/brand-sdk/pull/1250) [`9510eba`](https://github.com/Frontify/brand-sdk/commit/9510eba02bd038405bef911579b89f3e23c1216f) Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - feat(app): Enable to pass preview features to the GQL calls ## 0.1.7 ### Patch Changes -- [#1224](https://github.com/Frontify/brand-sdk/pull/1224) [`7658e68`](https://github.com/Frontify/brand-sdk/commit/7658e689bd5169047684cb2c5bb5f14c34b3ed63) Thanks [@julianiff](https://github.com/julianiff)! - feat: adds themeAction to appBridge PlatformApp context +- [#1224](https://github.com/Frontify/brand-sdk/pull/1224) [`7658e68`](https://github.com/Frontify/brand-sdk/commit/7658e689bd5169047684cb2c5bb5f14c34b3ed63) Thanks [@julianiff](https://github.com/julianiff)! - feat: adds themeAction to appBridge PlatformApp context ## 0.1.6 ### Patch Changes -- [#1219](https://github.com/Frontify/brand-sdk/pull/1219) [`bfb23d4`](https://github.com/Frontify/brand-sdk/commit/bfb23d4744fec5bcdefbab30e149e3419de97010) Thanks [@julianiff](https://github.com/julianiff)! - feat: update naming to themeAction and add props +- [#1219](https://github.com/Frontify/brand-sdk/pull/1219) [`bfb23d4`](https://github.com/Frontify/brand-sdk/commit/bfb23d4744fec5bcdefbab30e149e3419de97010) Thanks [@julianiff](https://github.com/julianiff)! - feat: update naming to themeAction and add props ## 0.1.5 ### Patch Changes -- [#1215](https://github.com/Frontify/brand-sdk/pull/1215) [`dd169ee`](https://github.com/Frontify/brand-sdk/commit/dd169ee59253677a8b4500559aa4fec2790202b2) Thanks [@julianiff](https://github.com/julianiff)! - feat: add NavigationAction Context +- [#1215](https://github.com/Frontify/brand-sdk/pull/1215) [`dd169ee`](https://github.com/Frontify/brand-sdk/commit/dd169ee59253677a8b4500559aa4fec2790202b2) Thanks [@julianiff](https://github.com/julianiff)! - feat: add NavigationAction Context ## 0.1.4 ### Patch Changes -- [#1163](https://github.com/Frontify/brand-sdk/pull/1163) [`df6e41a`](https://github.com/Frontify/brand-sdk/commit/df6e41a97a290457cc5f83783c324c2765f2aba2) Thanks [@julianiff](https://github.com/julianiff)! - feat: add context instead of single contexts +- [#1163](https://github.com/Frontify/brand-sdk/pull/1163) [`df6e41a`](https://github.com/Frontify/brand-sdk/commit/df6e41a97a290457cc5f83783c324c2765f2aba2) Thanks [@julianiff](https://github.com/julianiff)! - feat: add context instead of single contexts ## 0.1.3 ### Patch Changes -- [#1147](https://github.com/Frontify/brand-sdk/pull/1147) [`86c0806`](https://github.com/Frontify/brand-sdk/commit/86c080676e3d27375837f29cd37b7957a64fe360) Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - experimental: add `executeSecureRequest` command +- [#1147](https://github.com/Frontify/brand-sdk/pull/1147) [`86c0806`](https://github.com/Frontify/brand-sdk/commit/86c080676e3d27375837f29cd37b7957a64fe360) Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - experimental: add `executeSecureRequest` command ## 0.1.2 ### Patch Changes -- [#1131](https://github.com/Frontify/brand-sdk/pull/1131) [`e3ba1ef`](https://github.com/Frontify/brand-sdk/commit/e3ba1efe1334d8fc5ec7fa4b37c8c09562949e04) Thanks [@julianiff](https://github.com/julianiff)! - feat: remove extensions from context object +- [#1131](https://github.com/Frontify/brand-sdk/pull/1131) [`e3ba1ef`](https://github.com/Frontify/brand-sdk/commit/e3ba1efe1334d8fc5ec7fa4b37c8c09562949e04) Thanks [@julianiff](https://github.com/julianiff)! - feat: remove extensions from context object ## 0.1.1 ### Patch Changes -- [#1129](https://github.com/Frontify/brand-sdk/pull/1129) [`555f9fa`](https://github.com/Frontify/brand-sdk/commit/555f9fa6c0fd15b1d5da0855ed73412f40b8c3de) Thanks [@julianiff](https://github.com/julianiff)! - feat: add BulkActionsContext +- [#1129](https://github.com/Frontify/brand-sdk/pull/1129) [`555f9fa`](https://github.com/Frontify/brand-sdk/commit/555f9fa6c0fd15b1d5da0855ed73412f40b8c3de) Thanks [@julianiff](https://github.com/julianiff)! - feat: add BulkActionsContext ## 0.1.0 ### Minor Changes -- [#1121](https://github.com/Frontify/brand-sdk/pull/1121) [`7888a1a`](https://github.com/Frontify/brand-sdk/commit/7888a1ac221016717527088ea938a4f5089102ce) Thanks [@julianiff](https://github.com/julianiff)! - feat: add assetViewer surface typing +- [#1121](https://github.com/Frontify/brand-sdk/pull/1121) [`7888a1a`](https://github.com/Frontify/brand-sdk/commit/7888a1ac221016717527088ea938a4f5089102ce) Thanks [@julianiff](https://github.com/julianiff)! - feat: add assetViewer surface typing ## 0.0.16 ### Patch Changes -- [#1117](https://github.com/Frontify/brand-sdk/pull/1117) [`9047b9d`](https://github.com/Frontify/brand-sdk/commit/9047b9d4e089e91394ab23ae2ffaed3e9f6807a6) Thanks [@julianiff](https://github.com/julianiff)! - chore: adjust to rootId +- [#1117](https://github.com/Frontify/brand-sdk/pull/1117) [`9047b9d`](https://github.com/Frontify/brand-sdk/commit/9047b9d4e089e91394ab23ae2ffaed3e9f6807a6) Thanks [@julianiff](https://github.com/julianiff)! - chore: adjust to rootId ## 0.0.15 ### Patch Changes -- [#1113](https://github.com/Frontify/brand-sdk/pull/1113) [`084af2f`](https://github.com/Frontify/brand-sdk/commit/084af2f7a7f950766c88bd6c2a6f7481687173a2) Thanks [@julianiff](https://github.com/julianiff)! - feat(platform-app): add nodeId +- [#1113](https://github.com/Frontify/brand-sdk/pull/1113) [`084af2f`](https://github.com/Frontify/brand-sdk/commit/084af2f7a7f950766c88bd6c2a6f7481687173a2) Thanks [@julianiff](https://github.com/julianiff)! - feat(platform-app): add nodeId ## 0.0.14 ### Patch Changes -- [#1096](https://github.com/Frontify/brand-sdk/pull/1096) [`e24fb7a`](https://github.com/Frontify/brand-sdk/commit/e24fb7a7cefa999decc4c8bed3941de5a35b006d) Thanks [@julianiff](https://github.com/julianiff)! - fix: adjust parentId type to no be optional +- [#1096](https://github.com/Frontify/brand-sdk/pull/1096) [`e24fb7a`](https://github.com/Frontify/brand-sdk/commit/e24fb7a7cefa999decc4c8bed3941de5a35b006d) Thanks [@julianiff](https://github.com/julianiff)! - fix: adjust parentId type to no be optional ## 0.0.13 ### Patch Changes -- [#1068](https://github.com/Frontify/brand-sdk/pull/1068) [`7b387ee`](https://github.com/Frontify/brand-sdk/commit/7b387eec0552e861eb71c60af09a0b51eea21dc4) Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - feat: Add option to make beta GraphQL request +- [#1068](https://github.com/Frontify/brand-sdk/pull/1068) [`7b387ee`](https://github.com/Frontify/brand-sdk/commit/7b387eec0552e861eb71c60af09a0b51eea21dc4) Thanks [@olivereisenhut](https://github.com/olivereisenhut)! - feat: Add option to make beta GraphQL request ## 0.0.12 ### Patch Changes -- [#1052](https://github.com/Frontify/brand-sdk/pull/1052) [`723991d`](https://github.com/Frontify/brand-sdk/commit/723991dadfb552dab0afee8267ce4cd3af8c2abf) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Switch from `ApiHandlerParameter` to `PlatformAppHandlerParameter` +- [#1052](https://github.com/Frontify/brand-sdk/pull/1052) [`723991d`](https://github.com/Frontify/brand-sdk/commit/723991dadfb552dab0afee8267ce4cd3af8c2abf) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Switch from `ApiHandlerParameter` to `PlatformAppHandlerParameter` ## 0.0.11 ### Patch Changes -- [#1048](https://github.com/Frontify/brand-sdk/pull/1048) [`c9c4eb2`](https://github.com/Frontify/brand-sdk/commit/c9c4eb26ecbff356c6e384597b153de21073780c) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Expose `PlatformAppApiHandlerParameter` type +- [#1048](https://github.com/Frontify/brand-sdk/pull/1048) [`c9c4eb2`](https://github.com/Frontify/brand-sdk/commit/c9c4eb26ecbff356c6e384597b153de21073780c) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Expose `PlatformAppApiHandlerParameter` type ## 0.0.10 ### Patch Changes -- [#1038](https://github.com/Frontify/brand-sdk/pull/1038) [`d3f1b52`](https://github.com/Frontify/brand-sdk/commit/d3f1b528b361740b5bf820044cd3b54b4fb1a0a0) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Export types from `Api.ts` +- [#1038](https://github.com/Frontify/brand-sdk/pull/1038) [`d3f1b52`](https://github.com/Frontify/brand-sdk/commit/d3f1b528b361740b5bf820044cd3b54b4fb1a0a0) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Export types from `Api.ts` ## 0.0.9 ### Patch Changes -- [#1029](https://github.com/Frontify/brand-sdk/pull/1029) [`03e7a27`](https://github.com/Frontify/brand-sdk/commit/03e7a274b799bc87e1188bb343037a11a26d047f) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Add `PlatformAppApiReturn` type +- [#1029](https://github.com/Frontify/brand-sdk/pull/1029) [`03e7a27`](https://github.com/Frontify/brand-sdk/commit/03e7a274b799bc87e1188bb343037a11a26d047f) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Add `PlatformAppApiReturn` type ## 0.0.8 ### Patch Changes -- [#1027](https://github.com/Frontify/brand-sdk/pull/1027) [`33d3c6a`](https://github.com/Frontify/brand-sdk/commit/33d3c6ac167715cc80d8e9c1149f50c5d7c007a5) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Rename the graphql .api() call to use the `execute` prefix +- [#1027](https://github.com/Frontify/brand-sdk/pull/1027) [`33d3c6a`](https://github.com/Frontify/brand-sdk/commit/33d3c6ac167715cc80d8e9c1149f50c5d7c007a5) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Rename the graphql .api() call to use the `execute` prefix -- [#1026](https://github.com/Frontify/brand-sdk/pull/1026) [`3cad0e2`](https://github.com/Frontify/brand-sdk/commit/3cad0e208460c551b94508d47cbbebd9891869e6) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Add 'graphQl' `.api()` method +- [#1026](https://github.com/Frontify/brand-sdk/pull/1026) [`3cad0e2`](https://github.com/Frontify/brand-sdk/commit/3cad0e208460c551b94508d47cbbebd9891869e6) Thanks [@marguslant0](https://github.com/marguslant0)! - feat: Add 'graphQl' `.api()` method ## 0.0.7 ### Patch Changes -- [#1024](https://github.com/Frontify/brand-sdk/pull/1024) [`1dff29f`](https://github.com/Frontify/brand-sdk/commit/1dff29f978fe2ba591bd9e3b132fed7da3d598a7) Thanks [@julianiff](https://github.com/julianiff)! - feat: add getAccountId to registry +- [#1024](https://github.com/Frontify/brand-sdk/pull/1024) [`1dff29f`](https://github.com/Frontify/brand-sdk/commit/1dff29f978fe2ba591bd9e3b132fed7da3d598a7) Thanks [@julianiff](https://github.com/julianiff)! - feat: add getAccountId to registry ## 0.0.6 ### Patch Changes -- [#1022](https://github.com/Frontify/brand-sdk/pull/1022) [`3f8ecab`](https://github.com/Frontify/brand-sdk/commit/3f8ecab1ac4acdd077d63a000a3ac784d81adf3d) Thanks [@julianiff](https://github.com/julianiff)! - chore: adjust test +- [#1022](https://github.com/Frontify/brand-sdk/pull/1022) [`3f8ecab`](https://github.com/Frontify/brand-sdk/commit/3f8ecab1ac4acdd077d63a000a3ac784d81adf3d) Thanks [@julianiff](https://github.com/julianiff)! - chore: adjust test ## 0.0.5 ### Patch Changes -- [#1005](https://github.com/Frontify/brand-sdk/pull/1005) [`9790524`](https://github.com/Frontify/brand-sdk/commit/979052451ee69cbd9f60c397a30b4e5fd08fa779) Thanks [@julianiff](https://github.com/julianiff)! - chore: update app-bridge-app +- [#1005](https://github.com/Frontify/brand-sdk/pull/1005) [`9790524`](https://github.com/Frontify/brand-sdk/commit/979052451ee69cbd9f60c397a30b4e5fd08fa779) Thanks [@julianiff](https://github.com/julianiff)! - chore: update app-bridge-app ## 0.0.4 ### Patch Changes -- [#1003](https://github.com/Frontify/brand-sdk/pull/1003) [`bca28e1`](https://github.com/Frontify/brand-sdk/commit/bca28e193e59e04618a1b172f7bc14790b24efe2) Thanks [@julianiff](https://github.com/julianiff)! - chore: add exports +- [#1003](https://github.com/Frontify/brand-sdk/pull/1003) [`bca28e1`](https://github.com/Frontify/brand-sdk/commit/bca28e193e59e04618a1b172f7bc14790b24efe2) Thanks [@julianiff](https://github.com/julianiff)! - chore: add exports ## 0.0.3 ### Patch Changes -- [#998](https://github.com/Frontify/brand-sdk/pull/998) [`39b4f32`](https://github.com/Frontify/brand-sdk/commit/39b4f32e6b96bc5a1d39517f268e930995ab960c) Thanks [@julianiff](https://github.com/julianiff)! - feat: Adds utility methods and an updated renderReact method +- [#998](https://github.com/Frontify/brand-sdk/pull/998) [`39b4f32`](https://github.com/Frontify/brand-sdk/commit/39b4f32e6b96bc5a1d39517f268e930995ab960c) Thanks [@julianiff](https://github.com/julianiff)! - feat: Adds utility methods and an updated renderReact method -- [#995](https://github.com/Frontify/brand-sdk/pull/995) [`99b28d3`](https://github.com/Frontify/brand-sdk/commit/99b28d3baec9ff928daf8847514202f85be3e64f) Thanks [@julianiff](https://github.com/julianiff)! - feat: add renderAppReact utility +- [#995](https://github.com/Frontify/brand-sdk/pull/995) [`99b28d3`](https://github.com/Frontify/brand-sdk/commit/99b28d3baec9ff928daf8847514202f85be3e64f) Thanks [@julianiff](https://github.com/julianiff)! - feat: add renderAppReact utility -- [#996](https://github.com/Frontify/brand-sdk/pull/996) [`f1c7360`](https://github.com/Frontify/brand-sdk/commit/f1c7360ea59e49f13170f80d6ce51dad7b30f23e) Thanks [@julianiff](https://github.com/julianiff)! - feat: add typed settings +- [#996](https://github.com/Frontify/brand-sdk/pull/996) [`f1c7360`](https://github.com/Frontify/brand-sdk/commit/f1c7360ea59e49f13170f80d6ce51dad7b30f23e) Thanks [@julianiff](https://github.com/julianiff)! - feat: add typed settings ## 0.0.2 ### Patch Changes -- [#986](https://github.com/Frontify/brand-sdk/pull/986) [`6adb54b`](https://github.com/Frontify/brand-sdk/commit/6adb54bb2a3af14a016b3d979f1c43129953b5f4) Thanks [@julianiff](https://github.com/julianiff)! - feat: copy appBridgePlatformApp to app-bridge-app +- [#986](https://github.com/Frontify/brand-sdk/pull/986) [`6adb54b`](https://github.com/Frontify/brand-sdk/commit/6adb54bb2a3af14a016b3d979f1c43129953b5f4) Thanks [@julianiff](https://github.com/julianiff)! - feat: copy appBridgePlatformApp to app-bridge-app -- [#990](https://github.com/Frontify/brand-sdk/pull/990) [`e1ec08a`](https://github.com/Frontify/brand-sdk/commit/e1ec08a988950997ddc70213300639fd8f3866d9) Thanks [@julianiff](https://github.com/julianiff)! - fix: fix linting and tests +- [#990](https://github.com/Frontify/brand-sdk/pull/990) [`e1ec08a`](https://github.com/Frontify/brand-sdk/commit/e1ec08a988950997ddc70213300639fd8f3866d9) Thanks [@julianiff](https://github.com/julianiff)! - fix: fix linting and tests diff --git a/packages/app-bridge-app/src/registries/command/uploadAssetFromUrl.ts b/packages/app-bridge-app/src/registries/command/uploadAssetFromUrl.ts new file mode 100644 index 000000000..8473aba3c --- /dev/null +++ b/packages/app-bridge-app/src/registries/command/uploadAssetFromUrl.ts @@ -0,0 +1,3 @@ +/* (c) Copyright Frontify Ltd., all rights reserved. */ + +export type UploadAssetFromUrlPayload = { url: string; filename: string }; diff --git a/packages/app-bridge-theme/CHANGELOG.md b/packages/app-bridge-theme/CHANGELOG.md index 3d3502bad..9ca41397b 100644 --- a/packages/app-bridge-theme/CHANGELOG.md +++ b/packages/app-bridge-theme/CHANGELOG.md @@ -16,256 +16,256 @@ ### Patch Changes -- [#1522](https://github.com/Frontify/brand-sdk/pull/1522) [`561c972`](https://github.com/Frontify/brand-sdk/commit/561c972c09bb8700694eef475db54fdbd63f3558) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: allow useDocumentNavigation to use Document and DocumentNavigationItem +- [#1522](https://github.com/Frontify/brand-sdk/pull/1522) [`561c972`](https://github.com/Frontify/brand-sdk/commit/561c972c09bb8700694eef475db54fdbd63f3558) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: allow useDocumentNavigation to use Document and DocumentNavigationItem ## 1.0.5 ### Patch Changes -- [#1521](https://github.com/Frontify/brand-sdk/pull/1521) [`bedc235`](https://github.com/Frontify/brand-sdk/commit/bedc2356ea29a58c25f675daeffacbdb17f2955e) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update some dependencies +- [#1521](https://github.com/Frontify/brand-sdk/pull/1521) [`bedc235`](https://github.com/Frontify/brand-sdk/commit/bedc2356ea29a58c25f675daeffacbdb17f2955e) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update some dependencies ## 1.0.4 ### Patch Changes -- [#1475](https://github.com/Frontify/brand-sdk/pull/1475) [`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update multiple dependencies +- [#1475](https://github.com/Frontify/brand-sdk/pull/1475) [`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update multiple dependencies ## 1.0.3 ### Patch Changes -- [#1412](https://github.com/Frontify/brand-sdk/pull/1412) [`1376a84`](https://github.com/Frontify/brand-sdk/commit/1376a8484fc7082ebf60815450d42615c6238e37) Thanks [@mike85](https://github.com/mike85)! - chore: deprecate closeSearchDialog command - chore: deprecate closeAiBrandAssistantDialog command +- [#1412](https://github.com/Frontify/brand-sdk/pull/1412) [`1376a84`](https://github.com/Frontify/brand-sdk/commit/1376a8484fc7082ebf60815450d42615c6238e37) Thanks [@mike85](https://github.com/mike85)! - chore: deprecate closeSearchDialog command + chore: deprecate closeAiBrandAssistantDialog command ## 1.0.2 ### Patch Changes -- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies +- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies ## 1.0.1 ### Patch Changes -- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies ## 1.0.0 ### Major Changes -- [#1358](https://github.com/Frontify/brand-sdk/pull/1358) [`885f903`](https://github.com/Frontify/brand-sdk/commit/885f9038d5d544572063442b195f629f4d960d62) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: AppBridgeTheme v1 - first stable release +- [#1358](https://github.com/Frontify/brand-sdk/pull/1358) [`885f903`](https://github.com/Frontify/brand-sdk/commit/885f9038d5d544572063442b195f629f4d960d62) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: AppBridgeTheme v1 - first stable release ## 0.0.0-alpha.34 ### Minor Changes -- [#1355](https://github.com/Frontify/brand-sdk/pull/1355) [`1a52c54`](https://github.com/Frontify/brand-sdk/commit/1a52c5482a3dcc195ff78f0ad9cc0ff4385c9bf6) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): remove portalToken from context +- [#1355](https://github.com/Frontify/brand-sdk/pull/1355) [`1a52c54`](https://github.com/Frontify/brand-sdk/commit/1a52c5482a3dcc195ff78f0ad9cc0ff4385c9bf6) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): remove portalToken from context ## 0.0.0-alpha.33 ### Minor Changes -- [#1351](https://github.com/Frontify/brand-sdk/pull/1351) [`e301854`](https://github.com/Frontify/brand-sdk/commit/e3018543cc0bcb80cee5c3baeac298cac13a1d12) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): cleaning context and deprecated command `NavigateToDocumentSection` +- [#1351](https://github.com/Frontify/brand-sdk/pull/1351) [`e301854`](https://github.com/Frontify/brand-sdk/commit/e3018543cc0bcb80cee5c3baeac298cac13a1d12) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): cleaning context and deprecated command `NavigateToDocumentSection` ## 0.0.0-alpha.32 ### Patch Changes -- [#1348](https://github.com/Frontify/brand-sdk/pull/1348) [`df0e30d`](https://github.com/Frontify/brand-sdk/commit/df0e30d668da43d8a23684b8963ad67c26f34b10) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): previousPage, nextPage, and lastModified added to DocumentPage +- [#1348](https://github.com/Frontify/brand-sdk/pull/1348) [`df0e30d`](https://github.com/Frontify/brand-sdk/commit/df0e30d668da43d8a23684b8963ad67c26f34b10) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): previousPage, nextPage, and lastModified added to DocumentPage ## 0.0.0-alpha.31 ### Minor Changes -- [#1335](https://github.com/Frontify/brand-sdk/pull/1335) [`5c1fd8b`](https://github.com/Frontify/brand-sdk/commit/5c1fd8be89f333cda3a15c48a6083ee51be286bf) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): remove platform apps references +- [#1335](https://github.com/Frontify/brand-sdk/pull/1335) [`5c1fd8b`](https://github.com/Frontify/brand-sdk/commit/5c1fd8be89f333cda3a15c48a6083ee51be286bf) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): remove platform apps references ## 0.0.0-alpha.30 ### Minor Changes -- [#1319](https://github.com/Frontify/brand-sdk/pull/1319) [`0da6bbb`](https://github.com/Frontify/brand-sdk/commit/0da6bbb058b8995cc578528098a0b95bebce6cd9) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): page scroll info in context and listener hook +- [#1319](https://github.com/Frontify/brand-sdk/pull/1319) [`0da6bbb`](https://github.com/Frontify/brand-sdk/commit/0da6bbb058b8995cc578528098a0b95bebce6cd9) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): page scroll info in context and listener hook ## 0.0.0-alpha.29 ### Minor Changes -- [#1315](https://github.com/Frontify/brand-sdk/pull/1315) [`ed08f3e`](https://github.com/Frontify/brand-sdk/commit/ed08f3ec44eaa6b9f384d27d160a9dae0da16f6a) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): scroll page to top command +- [#1315](https://github.com/Frontify/brand-sdk/pull/1315) [`ed08f3e`](https://github.com/Frontify/brand-sdk/commit/ed08f3ec44eaa6b9f384d27d160a9dae0da16f6a) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeTheme): scroll page to top command ## 0.0.0-alpha.28 ### Patch Changes -- [#1284](https://github.com/Frontify/brand-sdk/pull/1284) [`8a81ba2`](https://github.com/Frontify/brand-sdk/commit/8a81ba2445f5d13b55a106d2c3845b6316e79c4f) Thanks [@ragi96](https://github.com/ragi96)! - chore: update deps +- [#1284](https://github.com/Frontify/brand-sdk/pull/1284) [`8a81ba2`](https://github.com/Frontify/brand-sdk/commit/8a81ba2445f5d13b55a106d2c3845b6316e79c4f) Thanks [@ragi96](https://github.com/ragi96)! - chore: update deps ## 0.0.0-alpha.27 ### Patch Changes -- [#1238](https://github.com/Frontify/brand-sdk/pull/1238) [`10712c0`](https://github.com/Frontify/brand-sdk/commit/10712c01e2b5b4979b8649525515e490b6c4125b) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor: deprecating navigateToDocumentSection in favor of navigateToSectionHeading. +- [#1238](https://github.com/Frontify/brand-sdk/pull/1238) [`10712c0`](https://github.com/Frontify/brand-sdk/commit/10712c01e2b5b4979b8649525515e490b6c4125b) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor: deprecating navigateToDocumentSection in favor of navigateToSectionHeading. ## 0.0.0-alpha.26 ### Patch Changes -- [#1222](https://github.com/Frontify/brand-sdk/pull/1222) [`22226ab`](https://github.com/Frontify/brand-sdk/commit/22226ab1266c83a8206a36431a419ad215ecbcb6) Thanks [@mike85](https://github.com/mike85)! - feat: export platform apps dialog +- [#1222](https://github.com/Frontify/brand-sdk/pull/1222) [`22226ab`](https://github.com/Frontify/brand-sdk/commit/22226ab1266c83a8206a36431a419ad215ecbcb6) Thanks [@mike85](https://github.com/mike85)! - feat: export platform apps dialog ## 0.0.0-alpha.25 ### Minor Changes -- [#1214](https://github.com/Frontify/brand-sdk/pull/1214) [`242db22`](https://github.com/Frontify/brand-sdk/commit/242db22097bbb8f14187ef5af42d2cd6374a8357) Thanks [@ragi96](https://github.com/ragi96)! - feat: add command to open and close the platform apps dialog +- [#1214](https://github.com/Frontify/brand-sdk/pull/1214) [`242db22`](https://github.com/Frontify/brand-sdk/commit/242db22097bbb8f14187ef5af42d2cd6374a8357) Thanks [@ragi96](https://github.com/ragi96)! - feat: add command to open and close the platform apps dialog ### Patch Changes -- [#1218](https://github.com/Frontify/brand-sdk/pull/1218) [`e8f80db`](https://github.com/Frontify/brand-sdk/commit/e8f80db9ebff09c575acc932f22ce65886c4d7ee) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `isPlatformAppsDialogOpen` to context +- [#1218](https://github.com/Frontify/brand-sdk/pull/1218) [`e8f80db`](https://github.com/Frontify/brand-sdk/commit/e8f80db9ebff09c575acc932f22ce65886c4d7ee) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `isPlatformAppsDialogOpen` to context ## 0.0.0-alpha.24 ### Patch Changes -- [#1210](https://github.com/Frontify/brand-sdk/pull/1210) [`0324ffb`](https://github.com/Frontify/brand-sdk/commit/0324ffb2b108d33a83403cfd796c3445626f230a) Thanks [@Kenny806](https://github.com/Kenny806)! - feat: extend AppBridgeTheme Event types to include State +- [#1210](https://github.com/Frontify/brand-sdk/pull/1210) [`0324ffb`](https://github.com/Frontify/brand-sdk/commit/0324ffb2b108d33a83403cfd796c3445626f230a) Thanks [@Kenny806](https://github.com/Kenny806)! - feat: extend AppBridgeTheme Event types to include State ## 0.0.0-alpha.23 ### Patch Changes -- [#1208](https://github.com/Frontify/brand-sdk/pull/1208) [`b8d3922`](https://github.com/Frontify/brand-sdk/commit/b8d3922f5e10445426e9c9930ab004e41d8c3fb7) Thanks [@Kenny806](https://github.com/Kenny806)! - feat: Introduced a State for AppBridgeTheme +- [#1208](https://github.com/Frontify/brand-sdk/pull/1208) [`b8d3922`](https://github.com/Frontify/brand-sdk/commit/b8d3922f5e10445426e9c9930ab004e41d8c3fb7) Thanks [@Kenny806](https://github.com/Kenny806)! - feat: Introduced a State for AppBridgeTheme ## 0.0.0-alpha.22 ### Patch Changes -- [#1203](https://github.com/Frontify/brand-sdk/pull/1203) [`265c4d4`](https://github.com/Frontify/brand-sdk/commit/265c4d48a76cf5bd6e257123f0d793bd930f91da) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add activeSectionHeadingId to context +- [#1203](https://github.com/Frontify/brand-sdk/pull/1203) [`265c4d4`](https://github.com/Frontify/brand-sdk/commit/265c4d48a76cf5bd6e257123f0d793bd930f91da) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add activeSectionHeadingId to context ## 0.0.0-alpha.21 ### Minor Changes -- [#1182](https://github.com/Frontify/brand-sdk/pull/1182) [`d3f4ac4`](https://github.com/Frontify/brand-sdk/commit/d3f4ac4385770dcfe6672dfd2f256f39d1473563) Thanks [@Kenny806](https://github.com/Kenny806)! - extend DocumentPage interface with isPublished property +- [#1182](https://github.com/Frontify/brand-sdk/pull/1182) [`d3f4ac4`](https://github.com/Frontify/brand-sdk/commit/d3f4ac4385770dcfe6672dfd2f256f39d1473563) Thanks [@Kenny806](https://github.com/Kenny806)! - extend DocumentPage interface with isPublished property ## 0.0.0-alpha.20 ### Patch Changes -- [#1110](https://github.com/Frontify/brand-sdk/pull/1110) [`18560db`](https://github.com/Frontify/brand-sdk/commit/18560dbd1bbfa3a76fdda0db5ed520b670c41979) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add EventRegistry +- [#1110](https://github.com/Frontify/brand-sdk/pull/1110) [`18560db`](https://github.com/Frontify/brand-sdk/commit/18560dbd1bbfa3a76fdda0db5ed520b670c41979) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add EventRegistry ## 0.0.0-alpha.19 ### Patch Changes -- [#1092](https://github.com/Frontify/brand-sdk/pull/1092) [`024b908`](https://github.com/Frontify/brand-sdk/commit/024b9089f68482aa908f08936c6a0c33cdaafb6c) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor(appBridgeThemes): remove utilities folder +- [#1092](https://github.com/Frontify/brand-sdk/pull/1092) [`024b908`](https://github.com/Frontify/brand-sdk/commit/024b9089f68482aa908f08936c6a0c33cdaafb6c) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor(appBridgeThemes): remove utilities folder ## 0.0.0-alpha.18 ### Patch Changes -- [#1095](https://github.com/Frontify/brand-sdk/pull/1095) [`a70a9fe`](https://github.com/Frontify/brand-sdk/commit/a70a9fe0932e1a40c5d4d85e4fdcb3f008947b74) Thanks [@mike85](https://github.com/mike85)! - refactor(AppBridgeTheme): remove EventRegistry +- [#1095](https://github.com/Frontify/brand-sdk/pull/1095) [`a70a9fe`](https://github.com/Frontify/brand-sdk/commit/a70a9fe0932e1a40c5d4d85e4fdcb3f008947b74) Thanks [@mike85](https://github.com/mike85)! - refactor(AppBridgeTheme): remove EventRegistry ## 0.0.0-alpha.17 ### Patch Changes -- [#1084](https://github.com/Frontify/brand-sdk/pull/1084) [`3335235`](https://github.com/Frontify/brand-sdk/commit/3335235dc5f107280cac5c57a5008c4c9e2949e1) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor(themes): add color utilities +- [#1084](https://github.com/Frontify/brand-sdk/pull/1084) [`3335235`](https://github.com/Frontify/brand-sdk/commit/3335235dc5f107280cac5c57a5008c4c9e2949e1) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor(themes): add color utilities ## 0.0.0-alpha.16 ### Patch Changes -- [#1075](https://github.com/Frontify/brand-sdk/pull/1075) [`772ed45`](https://github.com/Frontify/brand-sdk/commit/772ed451a39041e290597230f99de0727cd78b67) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - fix: export useEnabledFeatures hook +- [#1075](https://github.com/Frontify/brand-sdk/pull/1075) [`772ed45`](https://github.com/Frontify/brand-sdk/commit/772ed451a39041e290597230f99de0727cd78b67) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - fix: export useEnabledFeatures hook ## 0.0.0-alpha.15 ### Patch Changes -- [#1073](https://github.com/Frontify/brand-sdk/pull/1073) [`85f33ad`](https://github.com/Frontify/brand-sdk/commit/85f33ad945e8b1b59a289b1eb884f343a952116b) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - feat: add useEnabledFeatures +- [#1073](https://github.com/Frontify/brand-sdk/pull/1073) [`85f33ad`](https://github.com/Frontify/brand-sdk/commit/85f33ad945e8b1b59a289b1eb884f343a952116b) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - feat: add useEnabledFeatures ## 0.0.0-alpha.14 ### Patch Changes -- [#1066](https://github.com/Frontify/brand-sdk/pull/1066) [`efcf755`](https://github.com/Frontify/brand-sdk/commit/efcf755dd1b0b5c2937e989445458f0e4dd992a6) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - feat(AppBridgeTheme): added command to open/close AiBrandAssistant dialog - feat(AppBridgeTheme): added list of enabled features to context +- [#1066](https://github.com/Frontify/brand-sdk/pull/1066) [`efcf755`](https://github.com/Frontify/brand-sdk/commit/efcf755dd1b0b5c2937e989445458f0e4dd992a6) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - feat(AppBridgeTheme): added command to open/close AiBrandAssistant dialog + feat(AppBridgeTheme): added list of enabled features to context ## 0.0.0-alpha.13 ### Patch Changes -- [#1051](https://github.com/Frontify/brand-sdk/pull/1051) [`16ec9d1`](https://github.com/Frontify/brand-sdk/commit/16ec9d1ae5ced64bde74b275004cb632cba462b9) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add context hooks +- [#1051](https://github.com/Frontify/brand-sdk/pull/1051) [`16ec9d1`](https://github.com/Frontify/brand-sdk/commit/16ec9d1ae5ced64bde74b275004cb632cba462b9) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add context hooks ## 0.0.0-alpha.12 ### Patch Changes -- [#1046](https://github.com/Frontify/brand-sdk/pull/1046) [`facc3e6`](https://github.com/Frontify/brand-sdk/commit/facc3e647ce74bec3a8683889ebe493b88038e46) Thanks [@mike85](https://github.com/mike85)! - fix(AppBridgeTheme): update imports +- [#1046](https://github.com/Frontify/brand-sdk/pull/1046) [`facc3e6`](https://github.com/Frontify/brand-sdk/commit/facc3e647ce74bec3a8683889ebe493b88038e46) Thanks [@mike85](https://github.com/mike85)! - fix(AppBridgeTheme): update imports ## 0.0.0-alpha.11 ### Patch Changes -- [#1031](https://github.com/Frontify/brand-sdk/pull/1031) [`54fd9e7`](https://github.com/Frontify/brand-sdk/commit/54fd9e7a4d973d7b47e67d5e7cc1c1309255e0ea) Thanks [@mike85](https://github.com/mike85)! - chore(AppBridgeTheme): add vitest to app bridge theme +- [#1031](https://github.com/Frontify/brand-sdk/pull/1031) [`54fd9e7`](https://github.com/Frontify/brand-sdk/commit/54fd9e7a4d973d7b47e67d5e7cc1c1309255e0ea) Thanks [@mike85](https://github.com/mike85)! - chore(AppBridgeTheme): add vitest to app bridge theme -- [#1032](https://github.com/Frontify/brand-sdk/pull/1032) [`19346b8`](https://github.com/Frontify/brand-sdk/commit/19346b8a27cc1e2efb6cd6c61884496ddd67a34c) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add use language hook +- [#1032](https://github.com/Frontify/brand-sdk/pull/1032) [`19346b8`](https://github.com/Frontify/brand-sdk/commit/19346b8a27cc1e2efb6cd6c61884496ddd67a34c) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add use language hook -- [#1034](https://github.com/Frontify/brand-sdk/pull/1034) [`562990d`](https://github.com/Frontify/brand-sdk/commit/562990de5485cebebcb840ddb5abf74d1abe4357) Thanks [@mike85](https://github.com/mike85)! - feat: add useIsEditing hook +- [#1034](https://github.com/Frontify/brand-sdk/pull/1034) [`562990d`](https://github.com/Frontify/brand-sdk/commit/562990de5485cebebcb840ddb5abf74d1abe4357) Thanks [@mike85](https://github.com/mike85)! - feat: add useIsEditing hook -- [#1040](https://github.com/Frontify/brand-sdk/pull/1040) [`6bcd595`](https://github.com/Frontify/brand-sdk/commit/6bcd595dacebd55520f1cf87bc8fcbf849cc80d2) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: (AppBridgeTheme) documentNavigation in context and command +- [#1040](https://github.com/Frontify/brand-sdk/pull/1040) [`6bcd595`](https://github.com/Frontify/brand-sdk/commit/6bcd595dacebd55520f1cf87bc8fcbf849cc80d2) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: (AppBridgeTheme) documentNavigation in context and command ## 0.0.0-alpha.10 ### Minor Changes -- [#1015](https://github.com/Frontify/brand-sdk/pull/1015) [`77088a8`](https://github.com/Frontify/brand-sdk/commit/77088a85a7c181e5040d7a2738fb9fd7d95dfd1d) Thanks [@bojangles-m](https://github.com/bojangles-m)! - feat(GuidelineSearchResult): added additional prop to `GuidelineSearchResult` +- [#1015](https://github.com/Frontify/brand-sdk/pull/1015) [`77088a8`](https://github.com/Frontify/brand-sdk/commit/77088a85a7c181e5040d7a2738fb9fd7d95dfd1d) Thanks [@bojangles-m](https://github.com/bojangles-m)! - feat(GuidelineSearchResult): added additional prop to `GuidelineSearchResult` ## 0.0.0-alpha.9 ### Patch Changes -- [#983](https://github.com/Frontify/brand-sdk/pull/983) [`57b2f90`](https://github.com/Frontify/brand-sdk/commit/57b2f90c8042e05774e57c1065fc86242f468f48) Thanks [@anxobotana](https://github.com/anxobotana)! - fix: AppBridgeTheme command typing +- [#983](https://github.com/Frontify/brand-sdk/pull/983) [`57b2f90`](https://github.com/Frontify/brand-sdk/commit/57b2f90c8042e05774e57c1065fc86242f468f48) Thanks [@anxobotana](https://github.com/anxobotana)! - fix: AppBridgeTheme command typing ## 0.0.0-alpha.8 ### Patch Changes -- [#981](https://github.com/Frontify/brand-sdk/pull/981) [`02cd695`](https://github.com/Frontify/brand-sdk/commit/02cd695c896847691eae43ed774637614ad3fd32) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: AppBridgeTheme update context keys +- [#981](https://github.com/Frontify/brand-sdk/pull/981) [`02cd695`](https://github.com/Frontify/brand-sdk/commit/02cd695c896847691eae43ed774637614ad3fd32) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: AppBridgeTheme update context keys ## 0.0.0-alpha.7 ### Patch Changes -- [#978](https://github.com/Frontify/brand-sdk/pull/978) [`5eb0306`](https://github.com/Frontify/brand-sdk/commit/5eb030695cc105a3ed514a5b38840b015a8d85ac) Thanks [@Kenny806](https://github.com/Kenny806)! - feat: add a navigate command +- [#978](https://github.com/Frontify/brand-sdk/pull/978) [`5eb0306`](https://github.com/Frontify/brand-sdk/commit/5eb030695cc105a3ed514a5b38840b015a8d85ac) Thanks [@Kenny806](https://github.com/Kenny806)! - feat: add a navigate command ## 0.0.0-alpha.6 ### Patch Changes -- [#974](https://github.com/Frontify/brand-sdk/pull/974) [`508f51e`](https://github.com/Frontify/brand-sdk/commit/508f51e1de4d091f8761f4b7897940574d819eee) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: templateContext and NavigationItem types +- [#974](https://github.com/Frontify/brand-sdk/pull/974) [`508f51e`](https://github.com/Frontify/brand-sdk/commit/508f51e1de4d091f8761f4b7897940574d819eee) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: templateContext and NavigationItem types ## 0.0.0-alpha.5 ### Patch Changes -- [#971](https://github.com/Frontify/brand-sdk/pull/971) [`08b3506`](https://github.com/Frontify/brand-sdk/commit/08b3506f1b8dba87fed1b6eb3f379bf619327d45) Thanks [@Kenny806](https://github.com/Kenny806)! - fix: exports +- [#971](https://github.com/Frontify/brand-sdk/pull/971) [`08b3506`](https://github.com/Frontify/brand-sdk/commit/08b3506f1b8dba87fed1b6eb3f379bf619327d45) Thanks [@Kenny806](https://github.com/Kenny806)! - fix: exports ## 0.0.0-alpha.4 ### Patch Changes -- [#967](https://github.com/Frontify/brand-sdk/pull/967) [`599df4f`](https://github.com/Frontify/brand-sdk/commit/599df4fd1db1ad43a8163538513c36a9ab3e938a) Thanks [@Kenny806](https://github.com/Kenny806)! - fix: extend AppBridgeThemeEvent to include assetsChosen +- [#967](https://github.com/Frontify/brand-sdk/pull/967) [`599df4f`](https://github.com/Frontify/brand-sdk/commit/599df4fd1db1ad43a8163538513c36a9ab3e938a) Thanks [@Kenny806](https://github.com/Kenny806)! - fix: extend AppBridgeThemeEvent to include assetsChosen ## 0.0.0-alpha.3 ### Patch Changes -- [#965](https://github.com/Frontify/brand-sdk/pull/965) [`578e3e4`](https://github.com/Frontify/brand-sdk/commit/578e3e40025b1fbc88959181759257fe0e71d874) Thanks [@Kenny806](https://github.com/Kenny806)! - Added a SubscribeMap type +- [#965](https://github.com/Frontify/brand-sdk/pull/965) [`578e3e4`](https://github.com/Frontify/brand-sdk/commit/578e3e40025b1fbc88959181759257fe0e71d874) Thanks [@Kenny806](https://github.com/Kenny806)! - Added a SubscribeMap type ## 0.0.0-alpha.2 ### Patch Changes -- [#963](https://github.com/Frontify/brand-sdk/pull/963) [`43472d5`](https://github.com/Frontify/brand-sdk/commit/43472d5f7ea4fd6bcdc44dc26103d1c3ce92cf4c) Thanks [@anxobotana](https://github.com/anxobotana)! - fix(AppBridgeThemes): fix build and codeowners +- [#963](https://github.com/Frontify/brand-sdk/pull/963) [`43472d5`](https://github.com/Frontify/brand-sdk/commit/43472d5f7ea4fd6bcdc44dc26103d1c3ce92cf4c) Thanks [@anxobotana](https://github.com/anxobotana)! - fix(AppBridgeThemes): fix build and codeowners ## 0.0.0-alpha.1 ### Patch Changes -- [#960](https://github.com/Frontify/brand-sdk/pull/960) [`7a88fb5`](https://github.com/Frontify/brand-sdk/commit/7a88fb512a8209ab377ef12a70e2c8484d5b6799) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeThemes): initial alpha release of AppBridgeThemes +- [#960](https://github.com/Frontify/brand-sdk/pull/960) [`7a88fb5`](https://github.com/Frontify/brand-sdk/commit/7a88fb512a8209ab377ef12a70e2c8484d5b6799) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(AppBridgeThemes): initial alpha release of AppBridgeThemes diff --git a/packages/app-bridge/CHANGELOG.md b/packages/app-bridge/CHANGELOG.md index 7f6e77258..97f4a071f 100644 --- a/packages/app-bridge/CHANGELOG.md +++ b/packages/app-bridge/CHANGELOG.md @@ -1,5 +1,413 @@ # @frontify/app-bridge +## 4.0.0-alpha.64 + +### Minor Changes + +- [#1570](https://github.com/Frontify/brand-sdk/pull/1570) [`ff26e12`](https://github.com/Frontify/brand-sdk/commit/ff26e126efc9cb7a73392e10c427c711bf1b3023) Thanks [@ragi96](https://github.com/ragi96)! - refactor(useBlockAssets): source state from `Context.assets` + + The hook now seeds and updates `blockAssets` from `appBridge.context('assets')` and no longer fetches via `getBlockAssets()` on mount. It also no longer listens to or emits `AppBridge:BlockAssetsUpdated`; mutation helpers (`addAssetIdsToKey`, `deleteAssetIdsFromKey`, `updateAssetIdsFromKey`) just call the AppBridge API, and the host is responsible for refreshing `context('assets')` after each mutation. + +## 4.0.0-alpha.63 + +### Minor Changes + +- [#1553](https://github.com/Frontify/brand-sdk/pull/1553) [`f7e21d1`](https://github.com/Frontify/brand-sdk/commit/f7e21d121de259650e2ae810e351260a5ae48a66) Thanks [@ragi96](https://github.com/ragi96)! - feat(AppBridge): expose block assets via `BlockContext` + - Adds `assets` to `BlockContext`, available synchronously via `appBridge.context('assets').get()`. + - `useBlockAssets` now seeds its initial state from the context instead of fetching via `getBlockAssets()` on mount, so assets are available on the first render. + +## 4.0.0-alpha.62 + +### Patch Changes + +- [#1523](https://github.com/Frontify/brand-sdk/pull/1523) [`18360b0`](https://github.com/Frontify/brand-sdk/commit/18360b0f04f4a3b06a08dc10842a745e66764ec3) Thanks [@ragi96](https://github.com/ragi96)! - refactor(Asset): remove `creatorName` and `projectType` on the `Asset` + +## 4.0.0-alpha.61 + +### Minor Changes + +- [#1506](https://github.com/Frontify/brand-sdk/pull/1506) [`eac1c51`](https://github.com/Frontify/brand-sdk/commit/eac1c514b74a7fa4de90f47dc7c18dd787081378) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - feat: add back `useColorPalettes` react hook + +## 4.0.0-alpha.60 + +### Minor Changes + +- [#1503](https://github.com/Frontify/brand-sdk/pull/1503) [`a183353`](https://github.com/Frontify/brand-sdk/commit/a183353c21dba983b3334963956973208136660e) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove already deprecated method `getDocumentPagesByDocumentCategoryId` + +## 4.0.0-alpha.59 + +### Patch Changes + +- [#1500](https://github.com/Frontify/brand-sdk/pull/1500) [`a26580a`](https://github.com/Frontify/brand-sdk/commit/a26580a354c3f30970c629c965c1c347fb236e72) Thanks [@ragi96](https://github.com/ragi96)! - refactor(Emitter): remove unused type `EmitterAction` + +- [#1501](https://github.com/Frontify/brand-sdk/pull/1501) [`ec4cb08`](https://github.com/Frontify/brand-sdk/commit/ec4cb0845273b55d69061fecc06e39963da56f68) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `DocumentGroup` type and `DocumentGroupDummy` + +## 4.0.0-alpha.58 + +### Minor Changes + +- [#1494](https://github.com/Frontify/brand-sdk/pull/1494) [`b1d4454`](https://github.com/Frontify/brand-sdk/commit/b1d44547b541cd9ace1bd3907c05f1bedf598fa8) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove already deprecated method `getDocumentCategoriesByDocumentId` + +- [#1490](https://github.com/Frontify/brand-sdk/pull/1490) [`1c377db`](https://github.com/Frontify/brand-sdk/commit/1c377db7721254cc34feee4d284717fe9f12a1c1) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove already deprecated method `getDocumentGroups` + +## 4.0.0-alpha.57 + +### Minor Changes + +- [#1492](https://github.com/Frontify/brand-sdk/pull/1492) [`c137c46`](https://github.com/Frontify/brand-sdk/commit/c137c46a3ea8181e187b6562a1b7aa94be4c5b95) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore(AppBridge): remove already deprecated `getUncategorizedDocumentPagesByDocumentId` + +## 4.0.0-alpha.56 + +### Minor Changes + +- [#1484](https://github.com/Frontify/brand-sdk/pull/1484) [`bfb6128`](https://github.com/Frontify/brand-sdk/commit/bfb6128ef7add1752f7195259f2051ec6478dc10) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove color related methods: `getColors`, `getColorPalettesWithColors`, `getColorPalettes`, `getColorsByColorPaletteId` and react hooks: `useColors`, `useColorPalettes` + +- [#1488](https://github.com/Frontify/brand-sdk/pull/1488) [`83366ff`](https://github.com/Frontify/brand-sdk/commit/83366ffbc1b0887bb929300be82cdb889bad38b4) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore(DocumentTargets): remove already deprecated `getDocumentTargets` and `getDocumentPageTargets` + +## 4.0.0-alpha.55 + +### Minor Changes + +- [#1483](https://github.com/Frontify/brand-sdk/pull/1483) [`66cff04`](https://github.com/Frontify/brand-sdk/commit/66cff04d3e369e363ca685ce3109c250eb3eb9ab) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove already deprecated `getColorsByIds` + +- [#1487](https://github.com/Frontify/brand-sdk/pull/1487) [`5c7f2e8`](https://github.com/Frontify/brand-sdk/commit/5c7f2e87d5d216bacbee44d80fd889347b0c5f9b) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor remove already deprecated method `getUngroupedDocuments` + +## 4.0.0-alpha.54 + +### Major Changes + +- [#1467](https://github.com/Frontify/brand-sdk/pull/1467) [`6a13770`](https://github.com/Frontify/brand-sdk/commit/6a137708698927af8383c9277e6f01e28f3778d7) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `createColorPalette`, `updateColorPalette`, `deleteColorPalette` and adjust `useColorPalette` react hook + +## 4.0.0-alpha.53 + +### Major Changes + +- [#1469](https://github.com/Frontify/brand-sdk/pull/1469) [`721a9af`](https://github.com/Frontify/brand-sdk/commit/721a9afe624eb4801619d54f10cdf9b44588283f) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `useDocumentTargets` and `useDocumentCategories` + +## 4.0.0-alpha.52 + +### Major Changes + +- [#1456](https://github.com/Frontify/brand-sdk/pull/1456) [`f161110`](https://github.com/Frontify/brand-sdk/commit/f16111063ae7dc0c6d2204f54c8ecc081d4ec8cf) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `DocumentApiDummy` and `DocumentDummy` testing utils, cleanup types in `Document.ts`, remove `getDocumentsByDocumentGroupId` from AppBridgeBlock + +## 4.0.0-alpha.51 + +### Minor Changes + +- [#1461](https://github.com/Frontify/brand-sdk/pull/1461) [`e4483dd`](https://github.com/Frontify/brand-sdk/commit/e4483ddf24a1d11ee4f6c6359fff2a9739f0409d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove react hooks and related events + - `useCategorizedDocumentPages` + - `useDocumentPageTargets` + - `useUncategorizedDocumentPages` + +### Patch Changes + +- [#1460](https://github.com/Frontify/brand-sdk/pull/1460) [`a396af9`](https://github.com/Frontify/brand-sdk/commit/a396af977c0ef052012328d8f182cd54422a5573) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `getDatasetByElement` and `getDatasetByClassName` + +- [#1457](https://github.com/Frontify/brand-sdk/pull/1457) [`d5af57b`](https://github.com/Frontify/brand-sdk/commit/d5af57b45bd5e634506ef709e6d4a811a9728bd2) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `documentCategoryApi` type + +## 4.0.0-alpha.50 + +### Major Changes + +- [#1449](https://github.com/Frontify/brand-sdk/pull/1449) [`b811e3f`](https://github.com/Frontify/brand-sdk/commit/b811e3ff45c88a9c28edddd0ca478423542851e9) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove deprecated `updateColor`, `createColor`, and `deleteColor` methods from the AppBridge, the `useColors` hook, and related tests + +## 4.0.0-alpha.49 + +### Patch Changes + +- [#1451](https://github.com/Frontify/brand-sdk/pull/1451) [`20fec73`](https://github.com/Frontify/brand-sdk/commit/20fec7370b99c3a2c264ea7cee8e473642a3ca95) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: cleanup unused types in DocumentCategory + +- [#1450](https://github.com/Frontify/brand-sdk/pull/1450) [`a124e06`](https://github.com/Frontify/brand-sdk/commit/a124e0651cdce785473288a04144e4f54c7f04b8) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `DocumentPageRequest`, `DocumentPageCreate`, `DocumentPageUpdate` and `DocumentPageDelete` types + +- [#1453](https://github.com/Frontify/brand-sdk/pull/1453) [`c4a2c08`](https://github.com/Frontify/brand-sdk/commit/c4a2c08b57c392b11f38dad9dfa9ee78d6019c01) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `useDocumentSection` react hooks, along with types and events + +## 4.0.0-alpha.48 + +### Minor Changes + +- [#1446](https://github.com/Frontify/brand-sdk/pull/1446) [`62812be`](https://github.com/Frontify/brand-sdk/commit/62812be62c7d8817fe16d95786732cc880f5cf40) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `useDocumentGroups`, `useGroupedDocuments` and `useUngroupedDocuments` hook and also remove the `DocumentGroupApi` type + +### Patch Changes + +- [#1438](https://github.com/Frontify/brand-sdk/pull/1438) [`0cfb6bb`](https://github.com/Frontify/brand-sdk/commit/0cfb6bb0769815383541a075103d21a8204b5176) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove TemplatePageApi type + +- [#1442](https://github.com/Frontify/brand-sdk/pull/1442) [`f7d1ede`](https://github.com/Frontify/brand-sdk/commit/f7d1ede454050013a4f890e0bcebac79833ab1ba) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `filterDocumentSectionsWithUnreadableTitles` helper + +- [#1445](https://github.com/Frontify/brand-sdk/pull/1445) [`de6047a`](https://github.com/Frontify/brand-sdk/commit/de6047a1a0d9e1cbe6b357628ebd81d50d3b4064) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `DocumentBlockTemplate` types + +- [#1443](https://github.com/Frontify/brand-sdk/pull/1443) [`a3000f3`](https://github.com/Frontify/brand-sdk/commit/a3000f38774029f81dbd0df1975ec2464d2a3af5) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: clean up target api related things + +- [#1441](https://github.com/Frontify/brand-sdk/pull/1441) [`b80449d`](https://github.com/Frontify/brand-sdk/commit/b80449d852d3edadbc1887e82ecc74eacd53e138) Thanks [@ragi96](https://github.com/ragi96)! - chore(deps): bump + +- [#1440](https://github.com/Frontify/brand-sdk/pull/1440) [`569840a`](https://github.com/Frontify/brand-sdk/commit/569840ab483519b70ecedccb87207be735bf6bfd) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove TemplateApiLegacy type and test dummy + +- [#1444](https://github.com/Frontify/brand-sdk/pull/1444) [`0e28ba2`](https://github.com/Frontify/brand-sdk/commit/0e28ba2dcd55151bfa22e1a788d239fd43e3532b) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `pageTemplateAsset` type + +- [#1435](https://github.com/Frontify/brand-sdk/pull/1435) [`c3aea0d`](https://github.com/Frontify/brand-sdk/commit/c3aea0d5378d094d08c76ab3b574249cf37b5cd4) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove Color and ColorPallete api related types and test dummies + +## 4.0.0-alpha.47 + +### Patch Changes + +- [#1433](https://github.com/Frontify/brand-sdk/pull/1433) [`013ed9a`](https://github.com/Frontify/brand-sdk/commit/013ed9a350b43705e452505e484f58a8e15191ca) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `GetBulkDownloadTokenApi` and `BulkDownloadApi` types + +- [#1432](https://github.com/Frontify/brand-sdk/pull/1432) [`415a73b`](https://github.com/Frontify/brand-sdk/commit/415a73ba7319dc949c0cecab1b852c2035832895) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove unused `Topic` type + +- [#1437](https://github.com/Frontify/brand-sdk/pull/1437) [`f3c2bcc`](https://github.com/Frontify/brand-sdk/commit/f3c2bccb3e3f4b5bceee940f0031e38ec547a218) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove UserApi related things + +- [#1436](https://github.com/Frontify/brand-sdk/pull/1436) [`a2543c2`](https://github.com/Frontify/brand-sdk/commit/a2543c20c11bc7e810ee58aed97619957c4cc6d6) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove cover page related things + +## 4.0.0-alpha.46 + +### Patch Changes + +- [#1414](https://github.com/Frontify/brand-sdk/pull/1414) [`eacc687`](https://github.com/Frontify/brand-sdk/commit/eacc6878b72a59da83ccf7b7df2ae9c9656d6861) Thanks [@ragi96](https://github.com/ragi96)! - chore: update dependencies + +## 4.0.0-alpha.45 + +### Minor Changes + +- [#1311](https://github.com/Frontify/brand-sdk/pull/1311) [`200b840`](https://github.com/Frontify/brand-sdk/commit/200b84037a0e0866b10fb1796f840260fea65034) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `trackEvent` command + + Use the `trackEvent` command to log custom events within blocks. + The event accepts `TrackActions` and an optional payload. + + If you need more actions, please reach out through the Frontify Friends Slack channel. + + Example usage: + + ```typescript + appBridge.dispatch({ + name: 'trackEvent', + payload: { + action: 'button:clicked', + payload: { buttonId: 'path/to/button', label: 'Click me' }, + }, + }); + + // or without payload + appBridge.dispatch({ + name: 'trackEvent', + payload: { action: 'button:clicked', payload: null }, + }); + ``` + +## 4.0.0-alpha.44 + +### Patch Changes + +- [#1284](https://github.com/Frontify/brand-sdk/pull/1284) [`8a81ba2`](https://github.com/Frontify/brand-sdk/commit/8a81ba2445f5d13b55a106d2c3845b6316e79c4f) Thanks [@ragi96](https://github.com/ragi96)! - chore: update deps + +## 4.0.0-alpha.43 + +### Patch Changes + +- [#1268](https://github.com/Frontify/brand-sdk/pull/1268) [`010b72c`](https://github.com/Frontify/brand-sdk/commit/010b72ca227278bcb4e0eadaf70252791f037532) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(Asset): added the focal point properties + +## 4.0.0-alpha.42 + +### Patch Changes + +- [#1237](https://github.com/Frontify/brand-sdk/pull/1237) [`eb6822d`](https://github.com/Frontify/brand-sdk/commit/eb6822d507e6a96a77725cb4aeb16d26846b72ee) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor: Removed `appBridgeTheme` from the `@frontify/app-bridge` package. It is now provided via the `@frontify/app-bridge-theme` package. + +## 4.0.0-alpha.41 + +### Patch Changes + +- [#1235](https://github.com/Frontify/brand-sdk/pull/1235) [`02fd19d`](https://github.com/Frontify/brand-sdk/commit/02fd19d27220470f6ba523a0cae29fc36ab55758) Thanks [@ragi96](https://github.com/ragi96)! - fix: AssetChooserResult Type as alternative text is prefixed with computed + +## 4.0.0-alpha.40 + +### Minor Changes + +- [#1232](https://github.com/Frontify/brand-sdk/pull/1232) [`559f24e`](https://github.com/Frontify/brand-sdk/commit/559f24efe287c913ecfc0755ff18c56fcfe2fa56) Thanks [@ragi96](https://github.com/ragi96)! - feat(Asset): added the property alternativeText + +## 4.0.0-alpha.39 + +### Patch Changes + +- [#1206](https://github.com/Frontify/brand-sdk/pull/1206) [`7abe2d7`](https://github.com/Frontify/brand-sdk/commit/7abe2d7635dd7f319497fd4e6e422873d7075489) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove AppBridgeCreateAsset, please use `@frontify/app-bridge-app` + +## 4.0.0-alpha.38 + +### Patch Changes + +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`cd6ac0b`](https://github.com/Frontify/brand-sdk/commit/cd6ac0b022bca6a3ca663be801f0dbe62d129728) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: merge main into dev + +## 4.0.0-alpha.37 + +### Patch Changes + +- chore: merge main to dev + +## 4.0.0-alpha.54 + +### Major Changes + +- [#1467](https://github.com/Frontify/brand-sdk/pull/1467) [`6a13770`](https://github.com/Frontify/brand-sdk/commit/6a137708698927af8383c9277e6f01e28f3778d7) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `createColorPalette`, `updateColorPalette`, `deleteColorPalette` and adjust `useColorPalette` react hook + +## 4.0.0-alpha.53 + +### Major Changes + +- [#1469](https://github.com/Frontify/brand-sdk/pull/1469) [`721a9af`](https://github.com/Frontify/brand-sdk/commit/721a9afe624eb4801619d54f10cdf9b44588283f) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `useDocumentTargets` and `useDocumentCategories` + +## 4.0.0-alpha.52 + +### Major Changes + +- [#1456](https://github.com/Frontify/brand-sdk/pull/1456) [`f161110`](https://github.com/Frontify/brand-sdk/commit/f16111063ae7dc0c6d2204f54c8ecc081d4ec8cf) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `DocumentApiDummy` and `DocumentDummy` testing utils, cleanup types in `Document.ts`, remove `getDocumentsByDocumentGroupId` from AppBridgeBlock + +## 4.0.0-alpha.51 + +### Minor Changes + +- [#1461](https://github.com/Frontify/brand-sdk/pull/1461) [`e4483dd`](https://github.com/Frontify/brand-sdk/commit/e4483ddf24a1d11ee4f6c6359fff2a9739f0409d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove react hooks and related events + - `useCategorizedDocumentPages` + - `useDocumentPageTargets` + - `useUncategorizedDocumentPages` + +### Patch Changes + +- [#1460](https://github.com/Frontify/brand-sdk/pull/1460) [`a396af9`](https://github.com/Frontify/brand-sdk/commit/a396af977c0ef052012328d8f182cd54422a5573) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `getDatasetByElement` and `getDatasetByClassName` + +- [#1457](https://github.com/Frontify/brand-sdk/pull/1457) [`d5af57b`](https://github.com/Frontify/brand-sdk/commit/d5af57b45bd5e634506ef709e6d4a811a9728bd2) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `documentCategoryApi` type + +## 4.0.0-alpha.50 + +### Major Changes + +- [#1449](https://github.com/Frontify/brand-sdk/pull/1449) [`b811e3f`](https://github.com/Frontify/brand-sdk/commit/b811e3ff45c88a9c28edddd0ca478423542851e9) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove deprecated `updateColor`, `createColor`, and `deleteColor` methods from the AppBridge, the `useColors` hook, and related tests + +## 4.0.0-alpha.49 + +### Patch Changes + +- [#1451](https://github.com/Frontify/brand-sdk/pull/1451) [`20fec73`](https://github.com/Frontify/brand-sdk/commit/20fec7370b99c3a2c264ea7cee8e473642a3ca95) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: cleanup unused types in DocumentCategory + +- [#1450](https://github.com/Frontify/brand-sdk/pull/1450) [`a124e06`](https://github.com/Frontify/brand-sdk/commit/a124e0651cdce785473288a04144e4f54c7f04b8) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `DocumentPageRequest`, `DocumentPageCreate`, `DocumentPageUpdate` and `DocumentPageDelete` types + +- [#1453](https://github.com/Frontify/brand-sdk/pull/1453) [`c4a2c08`](https://github.com/Frontify/brand-sdk/commit/c4a2c08b57c392b11f38dad9dfa9ee78d6019c01) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `useDocumentSection` react hooks, along with types and events + +## 4.0.0-alpha.48 + +### Minor Changes + +- [#1446](https://github.com/Frontify/brand-sdk/pull/1446) [`62812be`](https://github.com/Frontify/brand-sdk/commit/62812be62c7d8817fe16d95786732cc880f5cf40) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `useDocumentGroups`, `useGroupedDocuments` and `useUngroupedDocuments` hook and also remove the `DocumentGroupApi` type + +### Patch Changes + +- [#1438](https://github.com/Frontify/brand-sdk/pull/1438) [`0cfb6bb`](https://github.com/Frontify/brand-sdk/commit/0cfb6bb0769815383541a075103d21a8204b5176) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove TemplatePageApi type + +- [#1442](https://github.com/Frontify/brand-sdk/pull/1442) [`f7d1ede`](https://github.com/Frontify/brand-sdk/commit/f7d1ede454050013a4f890e0bcebac79833ab1ba) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `filterDocumentSectionsWithUnreadableTitles` helper + +- [#1445](https://github.com/Frontify/brand-sdk/pull/1445) [`de6047a`](https://github.com/Frontify/brand-sdk/commit/de6047a1a0d9e1cbe6b357628ebd81d50d3b4064) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `DocumentBlockTemplate` types + +- [#1443](https://github.com/Frontify/brand-sdk/pull/1443) [`a3000f3`](https://github.com/Frontify/brand-sdk/commit/a3000f38774029f81dbd0df1975ec2464d2a3af5) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: clean up target api related things + +- [#1441](https://github.com/Frontify/brand-sdk/pull/1441) [`b80449d`](https://github.com/Frontify/brand-sdk/commit/b80449d852d3edadbc1887e82ecc74eacd53e138) Thanks [@ragi96](https://github.com/ragi96)! - chore(deps): bump + +- [#1440](https://github.com/Frontify/brand-sdk/pull/1440) [`569840a`](https://github.com/Frontify/brand-sdk/commit/569840ab483519b70ecedccb87207be735bf6bfd) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove TemplateApiLegacy type and test dummy + +- [#1444](https://github.com/Frontify/brand-sdk/pull/1444) [`0e28ba2`](https://github.com/Frontify/brand-sdk/commit/0e28ba2dcd55151bfa22e1a788d239fd43e3532b) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove `pageTemplateAsset` type + +- [#1435](https://github.com/Frontify/brand-sdk/pull/1435) [`c3aea0d`](https://github.com/Frontify/brand-sdk/commit/c3aea0d5378d094d08c76ab3b574249cf37b5cd4) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove Color and ColorPallete api related types and test dummies + +## 4.0.0-alpha.47 + +### Patch Changes + +- [#1433](https://github.com/Frontify/brand-sdk/pull/1433) [`013ed9a`](https://github.com/Frontify/brand-sdk/commit/013ed9a350b43705e452505e484f58a8e15191ca) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove `GetBulkDownloadTokenApi` and `BulkDownloadApi` types + +- [#1432](https://github.com/Frontify/brand-sdk/pull/1432) [`415a73b`](https://github.com/Frontify/brand-sdk/commit/415a73ba7319dc949c0cecab1b852c2035832895) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove unused `Topic` type + +- [#1437](https://github.com/Frontify/brand-sdk/pull/1437) [`f3c2bcc`](https://github.com/Frontify/brand-sdk/commit/f3c2bccb3e3f4b5bceee940f0031e38ec547a218) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove UserApi related things + +- [#1436](https://github.com/Frontify/brand-sdk/pull/1436) [`a2543c2`](https://github.com/Frontify/brand-sdk/commit/a2543c20c11bc7e810ee58aed97619957c4cc6d6) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: remove cover page related things + +## 4.0.0-alpha.46 + +### Patch Changes + +- [#1414](https://github.com/Frontify/brand-sdk/pull/1414) [`eacc687`](https://github.com/Frontify/brand-sdk/commit/eacc6878b72a59da83ccf7b7df2ae9c9656d6861) Thanks [@ragi96](https://github.com/ragi96)! - chore: update dependencies + +## 4.0.0-alpha.45 + +### Minor Changes + +- [#1311](https://github.com/Frontify/brand-sdk/pull/1311) [`200b840`](https://github.com/Frontify/brand-sdk/commit/200b84037a0e0866b10fb1796f840260fea65034) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `trackEvent` command + + Use the `trackEvent` command to log custom events within blocks. + The event accepts `TrackActions` and an optional payload. + + If you need more actions, please reach out through the Frontify Friends Slack channel. + + Example usage: + + ```typescript + appBridge.dispatch({ + name: 'trackEvent', + payload: { + action: 'button:clicked', + payload: { buttonId: 'path/to/button', label: 'Click me' }, + }, + }); + + // or without payload + appBridge.dispatch({ + name: 'trackEvent', + payload: { action: 'button:clicked', payload: null }, + }); + ``` + +## 4.0.0-alpha.44 + +### Patch Changes + +- [#1284](https://github.com/Frontify/brand-sdk/pull/1284) [`8a81ba2`](https://github.com/Frontify/brand-sdk/commit/8a81ba2445f5d13b55a106d2c3845b6316e79c4f) Thanks [@ragi96](https://github.com/ragi96)! - chore: update deps + +## 4.0.0-alpha.43 + +### Patch Changes + +- [#1268](https://github.com/Frontify/brand-sdk/pull/1268) [`010b72c`](https://github.com/Frontify/brand-sdk/commit/010b72ca227278bcb4e0eadaf70252791f037532) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(Asset): added the focal point properties + +## 4.0.0-alpha.42 + +### Patch Changes + +- [#1237](https://github.com/Frontify/brand-sdk/pull/1237) [`eb6822d`](https://github.com/Frontify/brand-sdk/commit/eb6822d507e6a96a77725cb4aeb16d26846b72ee) Thanks [@anxobotana](https://github.com/anxobotana)! - refactor: Removed `appBridgeTheme` from the `@frontify/app-bridge` package. It is now provided via the `@frontify/app-bridge-theme` package. + +## 4.0.0-alpha.41 + +### Patch Changes + +- [#1235](https://github.com/Frontify/brand-sdk/pull/1235) [`02fd19d`](https://github.com/Frontify/brand-sdk/commit/02fd19d27220470f6ba523a0cae29fc36ab55758) Thanks [@ragi96](https://github.com/ragi96)! - fix: AssetChooserResult Type as alternative text is prefixed with computed + +## 4.0.0-alpha.40 + +### Minor Changes + +- [#1232](https://github.com/Frontify/brand-sdk/pull/1232) [`559f24e`](https://github.com/Frontify/brand-sdk/commit/559f24efe287c913ecfc0755ff18c56fcfe2fa56) Thanks [@ragi96](https://github.com/ragi96)! - feat(Asset): added the property alternativeText + +## 4.0.0-alpha.39 + +### Patch Changes + +- [#1206](https://github.com/Frontify/brand-sdk/pull/1206) [`7abe2d7`](https://github.com/Frontify/brand-sdk/commit/7abe2d7635dd7f319497fd4e6e422873d7075489) Thanks [@ragi96](https://github.com/ragi96)! - refactor: remove AppBridgeCreateAsset, please use `@frontify/app-bridge-app` + +## 4.0.0-alpha.38 + +### Patch Changes + +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`cd6ac0b`](https://github.com/Frontify/brand-sdk/commit/cd6ac0b022bca6a3ca663be801f0dbe62d129728) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: merge main into dev + +## 4.0.0-alpha.37 + +### Patch Changes + +- chore: merge main to dev + ## 3.12.9 ### Patch Changes @@ -27,7 +435,6 @@ ### Patch Changes - [#1462](https://github.com/Frontify/brand-sdk/pull/1462) [`2fa485a`](https://github.com/Frontify/brand-sdk/commit/2fa485ad84f48d03a3e646e8e16a7326e682189a) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - refactor: mark React hooks as deprecated - - `useCategorizedDocumentPages` - `useDocumentPageTargets` - `useUncategorizedDocumentPages` @@ -82,7 +489,128 @@ - [#1158](https://github.com/Frontify/brand-sdk/pull/1158) [`8937b15`](https://github.com/Frontify/brand-sdk/commit/8937b15b6dfcf17c288f4b22643c991ae74d55a4) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: do not hardcode upload chunk sizes -## 3.11.0 +## 4.0.0-alpha.36 + +### Patch Changes + +- [#1080](https://github.com/Frontify/brand-sdk/pull/1080) [`a78218b`](https://github.com/Frontify/brand-sdk/commit/a78218b302929a05616f2d157968aa007cf36115) Thanks [@julianiff](https://github.com/julianiff)! - Fix: readd method + +## 4.0.0-alpha.35 + +### Patch Changes + +- [#1078](https://github.com/Frontify/brand-sdk/pull/1078) [`78555ee`](https://github.com/Frontify/brand-sdk/commit/78555ee76fbb487cf4a7c0fe3cda419704b35f63) Thanks [@julianiff](https://github.com/julianiff)! - chore: remove appBridgePlatformApp + +## 4.0.0-alpha.34 + +### Patch Changes + +- [#1042](https://github.com/Frontify/brand-sdk/pull/1042) [`e345d27`](https://github.com/Frontify/brand-sdk/commit/e345d2747d00efeadd8130dcde7f0dd1f2c398bf) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add documentId to GuidelineDocumentCategory events + +## 4.0.0-alpha.33 + +### Patch Changes + +- chore: merge main to dev + +## 4.0.0-alpha.32 + +### Patch Changes + +- [#1007](https://github.com/Frontify/brand-sdk/pull/1007) [`2c0ebf2`](https://github.com/Frontify/brand-sdk/commit/2c0ebf209915a11dd018b7453d7932d0f0ee6f3e) Thanks [@ragi96](https://github.com/ragi96)! - chore: merge main to dev + +- [#992](https://github.com/Frontify/brand-sdk/pull/992) [`f60bbf4`](https://github.com/Frontify/brand-sdk/commit/f60bbf42218880ee8042e5830152a2112eef09dc) Thanks [@julianiff](https://github.com/julianiff)! - feat: deprecate react hooks for platform apps + +## 4.0.0-alpha.31 + +### Patch Changes + +- [#956](https://github.com/Frontify/brand-sdk/pull/956) [`2491b6e`](https://github.com/Frontify/brand-sdk/commit/2491b6e88fc41ca8eafff5e41ec181247a968c46) Thanks [@julianiff](https://github.com/julianiff)! - feat: adds state listener to allow push from parent + +## 4.0.0-alpha.30 + +### Patch Changes + +- chore: merge branch `main` into dev + +## 4.0.0-alpha.29 + +### Patch Changes + +- [#941](https://github.com/Frontify/brand-sdk/pull/941) [`4e643ec`](https://github.com/Frontify/brand-sdk/commit/4e643ec9414e5671f877c556b68436a1a06569cb) Thanks [@julianiff](https://github.com/julianiff)! - Feat: adjust secure request response + +## 4.0.0-alpha.28 + +### Patch Changes + +- [#939](https://github.com/Frontify/brand-sdk/pull/939) [`7ea653c`](https://github.com/Frontify/brand-sdk/commit/7ea653ca17f2a16c72e8ee5525580eaee0d6405a) Thanks [@julianiff](https://github.com/julianiff)! - refactor: rename brandsdk name from secretRequest to secureRequest + +## 4.0.0-alpha.27 + +### Patch Changes + +- [#937](https://github.com/Frontify/brand-sdk/pull/937) [`341886e`](https://github.com/Frontify/brand-sdk/commit/341886e9d16184048f9285d692df5177bfd2d0d1) Thanks [@julianiff](https://github.com/julianiff)! - chore: rename brand sdk name + +## 4.0.0-alpha.26 + +### Patch Changes + +- [#929](https://github.com/Frontify/brand-sdk/pull/929) [`414ea40`](https://github.com/Frontify/brand-sdk/commit/414ea4092d5446815df032a87471829801604634) Thanks [@julianiff](https://github.com/julianiff)! - refactor: Method to reflect feature + +## 4.0.0-alpha.25 + +### Patch Changes + +- chore: merge main to dev + +## 4.0.0-alpha.24 + +### Patch Changes + +- chore: merge main to dev + +## 4.0.0-alpha.23 + +### Patch Changes + +- [#918](https://github.com/Frontify/brand-sdk/pull/918) [`1d48008`](https://github.com/Frontify/brand-sdk/commit/1d48008561a2dc3f4b7b4c9fcb7bc44cd7d04bc6) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: Merge main into dev + +## 4.0.0-alpha.22 + +### Patch Changes + +- chore: merge branch `main` into dev + +## 4.0.0-alpha.21 + +### Patch Changes + +- [#910](https://github.com/Frontify/brand-sdk/pull/910) [`0723d89`](https://github.com/Frontify/brand-sdk/commit/0723d89575f47682bc146661e693651f61965c8c) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: (AppBridgeTheme) update appBridgeThemeStub with context and state + +## 4.0.0-alpha.20 + +### Patch Changes + +- [#900](https://github.com/Frontify/brand-sdk/pull/900) [`9294b16`](https://github.com/Frontify/brand-sdk/commit/9294b164ad2b3fc502004e3d8d86ee29737ac822) Thanks [@julianiff](https://github.com/julianiff)! - feat(AppBridgePlatformApp): only one app bridge per iframe + +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`2a5b9cf`](https://github.com/Frontify/brand-sdk/commit/2a5b9cfb1e73331a3a4d39550a3a26de8a7e0c94) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: merge `main` into `dev` + +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`2a5b9cf`](https://github.com/Frontify/brand-sdk/commit/2a5b9cfb1e73331a3a4d39550a3a26de8a7e0c94) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat(AppBridgeTheme): add isSearchDialogOpen to context + +## 4.0.0-alpha.19 + +### Patch Changes + +- [#895](https://github.com/Frontify/brand-sdk/pull/895) [`b31a73d`](https://github.com/Frontify/brand-sdk/commit/b31a73d1756f01374682552a3013173f3c8f5384) Thanks [@julianiff](https://github.com/julianiff)! - feat: add user state variable + +## 4.0.0-alpha.18 + +### Patch Changes + +- [#884](https://github.com/Frontify/brand-sdk/pull/884) [`4fe96c8`](https://github.com/Frontify/brand-sdk/commit/4fe96c8808d1b85541dd6cc5ed2711bc5a47f4eb) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - fix(useDocumentNavigation): Fixed an issue that prevented debounced callbacks not to be executed + fix(usePortalNavigation): Fixed an issue that prevented debounced callbacks not to be executed + +## 4.0.0-alpha.17 ### Minor Changes @@ -182,18 +710,40 @@ - [#871](https://github.com/Frontify/brand-sdk/pull/871) [`cc7532a`](https://github.com/Frontify/brand-sdk/commit/cc7532ae5a3803f12997887e9f1ca9993e9f8e7c) Thanks [@ryancarville](https://github.com/ryancarville)! - feat(AppBridgeBlock): adds `creationFormUri` to the type `template` +## 4.0.0-alpha.16 + +### Patch Changes + +- # [#877](https://github.com/Frontify/brand-sdk/pull/877) [`1dd80ad`](https://github.com/Frontify/brand-sdk/commit/1dd80ad39568e96e97ab73c04feee3a949764ae9) Thanks [@mike85](https://github.com/mike85)! - feat(usePageTemplateSettings): returns also templateThemeSettings + ## 3.5.9 ### Patch Changes - [#875](https://github.com/Frontify/brand-sdk/pull/875) [`d74dc90`](https://github.com/Frontify/brand-sdk/commit/d74dc90501cd0aac39f67a834014fd9c261abfb0) Thanks [@anxobotana](https://github.com/anxobotana)! - feat(usePageTemplateSettings): returns also templateThemeSettings +## 4.0.0-alpha.15 + +### Patch Changes + +- # [#864](https://github.com/Frontify/brand-sdk/pull/864) [`0f17eb8`](https://github.com/Frontify/brand-sdk/commit/0f17eb82afdc30692e02d1cf150d622f38d0913a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: merge `main` into `dev` + ## 3.5.8 ### Patch Changes - [#868](https://github.com/Frontify/brand-sdk/pull/868) [`88fb3c3`](https://github.com/Frontify/brand-sdk/commit/88fb3c3b0235d9fc89c9a352273bacfaf53fdb0e) Thanks [@mike85](https://github.com/mike85)! - feat(AppBridgeTheme): add useDocumentNavigation hook +## 4.0.0-alpha.14 + +### Major Changes + +- [#841](https://github.com/Frontify/brand-sdk/pull/841) [`d88b50d`](https://github.com/Frontify/brand-sdk/commit/d88b50dd6e2235262dbae7250db053f9052228d1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat: modify `DocumentSection` and `DocumentSectionApi` type to allow `title` to be `null`. + +### Patch Changes + +- # [#841](https://github.com/Frontify/brand-sdk/pull/841) [`d88b50d`](https://github.com/Frontify/brand-sdk/commit/d88b50dd6e2235262dbae7250db053f9052228d1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - feat(useDocumentSection): Subscribe hook to emitter event listeners. A new emitter type, `AppBridge:GuidelineDocumentSection:Action` has been added. This emitter can be used to add and remove items from the sections saved in the hook state. - feat(useDocumentSection): `navigationItems` is now returned from this hook. This array filters out sections with an unreadable title and should be used to create section navigation links. + ## 3.5.7 ### Patch Changes @@ -208,12 +758,42 @@ - [#855](https://github.com/Frontify/brand-sdk/pull/855) [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump dependencies -## 3.5.5 +## 4.0.0-alpha.13 ### Patch Changes - [#843](https://github.com/Frontify/brand-sdk/pull/843) [`3109e66`](https://github.com/Frontify/brand-sdk/commit/3109e66248fb9185c312d8170055452dce796bc4) Thanks [@julianiff](https://github.com/julianiff)! - chore: move up to v4 +- [`0d9d0af`](https://github.com/Frontify/brand-sdk/commit/0d9d0afe4fc55b0e0c5b1e397aeaf77e7e8c4a69) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Merge main into dev + +## 4.0.0-alpha.12 + +### Patch Changes + +- [`18c91b1`](https://github.com/Frontify/brand-sdk/commit/18c91b184651f49c490d381054b3ec543f928551) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Merge `main` into `dev` + +## 4.0.0-alpha.11 + +### Minor Changes + +- [#830](https://github.com/Frontify/brand-sdk/pull/830) [`e14ef89`](https://github.com/Frontify/brand-sdk/commit/e14ef895606e72af066e614983b61ca8778c108d) Thanks [@ragi96](https://github.com/ragi96)! - feat(AppBridgeBlock): add `isAuthenticated` to `BlockContext` type + +## 4.0.0-alpha.10 + +### Minor Changes + +- [#808](https://github.com/Frontify/brand-sdk/pull/808) [`4529beb`](https://github.com/Frontify/brand-sdk/commit/4529beb4b9f20ba94c7d6226257b422d6b560d5a) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add navigateToDocumentSection command to AppBridgeTheme + +### Patch Changes + +- [#810](https://github.com/Frontify/brand-sdk/pull/810) [`0ac69ea`](https://github.com/Frontify/brand-sdk/commit/0ac69eaa52ba58a5be06ce75afa63cf5838e958b) Thanks [@anxobotana](https://github.com/anxobotana)! - fix: useGroupedDocuments and useUngroupedDocuments flaky tests + +## 4.0.0-alpha.9 + +### Patch Changes + +- # Merge main into dev + ## 3.5.4 ### Patch Changes @@ -264,6 +844,14 @@ - [`babce0e`](https://github.com/Frontify/brand-sdk/commit/babce0eb251fa78ef9c7b4c2c0ce740c7d66718d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add the dist folder to published packages +## 4.0.0-alpha.8 + +### Patch Changes + +- [#777](https://github.com/Frontify/brand-sdk/pull/777) [`b5d1cb8`](https://github.com/Frontify/brand-sdk/commit/b5d1cb8a376ccada20d0234913584a6bdba0cba9) Thanks [@julianiff](https://github.com/julianiff)! - Fix: add retry to subscription + +- # Merge main into dev + ## 3.4.1 ### Patch Changes @@ -278,18 +866,65 @@ - [#775](https://github.com/Frontify/brand-sdk/pull/775) [`3837782`](https://github.com/Frontify/brand-sdk/commit/383778258e862fb4fef62bf33aa71db71727aca1) Thanks [@mike85](https://github.com/mike85)! - feat: add open/close search dialog commands to AppBridgeTheme +## 4.0.0-alpha.7 + +### Minor Changes + +- [#780](https://github.com/Frontify/brand-sdk/pull/780) [`40b18c4`](https://github.com/Frontify/brand-sdk/commit/40b18c473478750ce04eb18a7ff290e34b65b94f) Thanks [@mike85](https://github.com/mike85)! - feat: add open/close search dialog commands to AppBridgeTheme + +## 4.0.0-alpha.6 + +### Patch Changes + +- [#772](https://github.com/Frontify/brand-sdk/pull/772) [`3e44c59`](https://github.com/Frontify/brand-sdk/commit/3e44c596628abcad11414eb26a954f4cb6eea097) Thanks [@julianiff](https://github.com/julianiff)! - feat: switch to platformAppBridge to v4 + +- [#774](https://github.com/Frontify/brand-sdk/pull/774) [`7a80244`](https://github.com/Frontify/brand-sdk/commit/7a80244b2ebf075f93a492513970b3ee2c92dc80) Thanks [@julianiff](https://github.com/julianiff)! - feat: Adjust PlatformAppContext + refactor: rename from type to surface + +## 4.0.0-alpha.5 + +### Patch Changes + +- [`a4822db`](https://github.com/Frontify/brand-sdk/commit/a4822db8bb86c2516241395963979369e0311a7a) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - fix: document page duplication return type + +- # [`5e4178c`](https://github.com/Frontify/brand-sdk/commit/5e4178c1e1028cec2af73bd34fedf56078f8b42c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Merge main into dev + ## 3.3.2 ### Patch Changes - [#769](https://github.com/Frontify/brand-sdk/pull/769) [`dde3283`](https://github.com/Frontify/brand-sdk/commit/dde328355d240a730ba6a6d465166c0ecc773548) Thanks [@oliverschwendener](https://github.com/oliverschwendener)! - fix: document page duplication return type +## 4.0.0-alpha.4 + +### Patch Changes + +- # Merge main into dev + ## 3.3.1 ### Patch Changes - [#766](https://github.com/Frontify/brand-sdk/pull/766) [`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +## 4.0.0-alpha.3 + +### Patch Changes + +- [#734](https://github.com/Frontify/brand-sdk/pull/734) [`029dd26`](https://github.com/Frontify/brand-sdk/commit/029dd26b26734539e80af86bcaa49d2caf9a7771) Thanks [@ragi96](https://github.com/ragi96)! - feat: adjust the color type to have a revision + +## 4.0.0-alpha.2 + +### Patch Changes + +- [#753](https://github.com/Frontify/brand-sdk/pull/753) [`50937f2`](https://github.com/Frontify/brand-sdk/commit/50937f2170f5ee1eab05726e141fc0e932f71865) Thanks [@ragi96](https://github.com/ragi96)! - feat: adds `setAssetIdsByBlockAssetKey` to AppBridgeBlock + +## 4.0.0-alpha.1 + +### Patch Changes + +- # [#742](https://github.com/Frontify/brand-sdk/pull/742) [`5ea66a7`](https://github.com/Frontify/brand-sdk/commit/5ea66a79bac131f5b34f1a1bf60fbe81add6b17f) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add context.template to AppBridgeTheme + ## 3.3.0 ### Minor Changes @@ -302,6 +937,12 @@ - [#731](https://github.com/Frontify/brand-sdk/pull/731) [`b9c4fc4`](https://github.com/Frontify/brand-sdk/commit/b9c4fc4fddacabb988ceb0cbe125c1793a697e19) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add theme template context to appBridgeThemes context +## 4.0.0-alpha.0 + +### Major Changes + +- # [#705](https://github.com/Frontify/brand-sdk/pull/705) [`a027b87`](https://github.com/Frontify/brand-sdk/commit/a027b87593ae25d18cda62c4989920a16958d28c) Thanks [@ragi96](https://github.com/ragi96)! - feat: first alpha release, removes all deprecated functions on the AppBridgeBlock + ## 3.1.0 ### Minor Changes @@ -354,4 +995,5 @@ ### Minor Changes +- - Add Brandportal link diff --git a/packages/app-bridge/eslint.config.mjs b/packages/app-bridge/eslint.config.mjs index 34456d5d9..38dbdc2ce 100644 --- a/packages/app-bridge/eslint.config.mjs +++ b/packages/app-bridge/eslint.config.mjs @@ -39,16 +39,16 @@ export default defineConfig( }, ], - '@typescript-eslint/no-redundant-type-constituents': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'warn', 'no-prototype-builtins': 'warn', '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-floating-promises': 'warn', '@typescript-eslint/no-misused-promises': 'warn', '@typescript-eslint/no-unsafe-argument': 'warn', '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/no-unsafe-return': 'warn', '@typescript-eslint/await-thenable': 'warn', '@typescript-eslint/no-unsafe-enum-comparison': 'warn', '@typescript-eslint/restrict-plus-operands': 'warn', diff --git a/packages/app-bridge/package.json b/packages/app-bridge/package.json index 92a8004d2..d0b19bf41 100644 --- a/packages/app-bridge/package.json +++ b/packages/app-bridge/package.json @@ -1,7 +1,7 @@ { "name": "@frontify/app-bridge", "type": "module", - "version": "3.12.9", + "version": "4.0.0-alpha.64", "description": "Package to establish communication between Frontify and marketplace apps", "author": "Frontify Developers ", "repository": { @@ -49,10 +49,10 @@ "sinon": "^15 || ^16 || ^17 || ^18 || ^19 || ^20 || ^21" }, "dependencies": { - "immer": "^10.0.4", + "immer": "^11.1.4", "lodash-es": "^4.18.1", "mitt": "^3.0.1", - "type-fest": "^5.4.3" + "type-fest": "^5.4.4" }, "devDependencies": { "@frontify/eslint-config-react": "^1.0.15", diff --git a/packages/app-bridge/src/AppBridge.ts b/packages/app-bridge/src/AppBridge.ts index 2082d0ddf..f58b922cd 100644 --- a/packages/app-bridge/src/AppBridge.ts +++ b/packages/app-bridge/src/AppBridge.ts @@ -182,7 +182,7 @@ export interface AppBridge< * Sends a command to the Frontify platform. * * @returns A promise that resolves to acknowledge the dispatch. - * The event will be triggered at a later stage and can be subscribed to with {@link AppBridgePlatformApp.subscribe}. + * The event will be triggered at a later stage and can be subscribed to */ dispatch( dispatchHandler: DispatchHandlerParameter, @@ -217,7 +217,6 @@ export interface AppBridge< /** * Subscribes to an event with the given name and callback function. - * The event are fired from {@link AppBridgePlatformApp.dispatch}, {@link AppBridgePlatformApp.state} and {@link AppBridgePlatformApp.context}. * * @returns Function that can be used to unsubscribe from an event. * When called, this function will remove the subscription to the event and prevent any further callbacks from being executed. diff --git a/packages/app-bridge/src/AppBridgeBlock.ts b/packages/app-bridge/src/AppBridgeBlock.ts index 90ba7fff0..51a9d70da 100644 --- a/packages/app-bridge/src/AppBridgeBlock.ts +++ b/packages/app-bridge/src/AppBridgeBlock.ts @@ -20,22 +20,12 @@ import { type ApiMethodRegistry } from './registries/api/ApiMethodRegistry'; import { type CommandRegistry } from './registries/commands/CommandRegistry'; import { type EventRegistry } from './registries/events/EventRegistry'; import { + type ColorPalette, type Asset, - type AssetChooserOptions, type BulkDownload, - type Color, - type ColorCreate, - type ColorPalette, - type ColorPaletteCreate, - type ColorPalettePatch, - type ColorPatch, type Document, - type DocumentCategory, - type DocumentGroup, type DocumentPage, - type DocumentPageTargets, type DocumentSection, - type DocumentTargets, type Template, type TemplateLegacy, type User, @@ -56,6 +46,7 @@ export type BlockCommand = CommandNameValidator< | 'openAssetViewer' | 'openTemplateChooser' | 'openNewPublication' + | 'trackEvent' > >; @@ -71,6 +62,7 @@ export type BlockContext = { sectionId?: number; isAuthenticated: boolean; isNewlyInserted: boolean; + assets?: Record; }; export type BlockEvent = EventNameValidator< @@ -105,18 +97,6 @@ export interface AppBridgeBlock< callback: EventCallbackParameter, ): EventUnsubscribeFunction; - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('blockId').get()` instead. - */ - getBlockId(): number; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('sectionId').get()` instead. - */ - getSectionId(): number | undefined; - getBlockAssets(): Promise>; getAssetById(assetId: number): Promise; @@ -125,12 +105,6 @@ export interface AppBridgeBlock< addAssetIdsToBlockAssetKey(key: string, assetIds: number[]): Promise; - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(openAssetViewer(token))` instead. - */ - openAssetViewer(token: string): void; - getBlockTemplates(): Promise>; addTemplateIdsToBlockTemplateKey(key: string, templateIds: number[]): Promise>; @@ -139,88 +113,12 @@ export interface AppBridgeBlock< getTemplateById(templateId: number): Promise; - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - getColorsByIds(colorIds: number[]): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - getColors(): Promise; - - /** - * @deprecated Use `getColors` instead. - */ - getAvailableColors(): Promise; - - /** - * @deprecated Use `getColorPalettes` instead. - */ - getAvailablePalettes(): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There will be a replacement for this method. But there will a new api to grab all colors and palettes. - */ - getColorPalettesWithColors(colorPaletteIds?: number[]): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - createColorPalette(colorPaletteCreate: ColorPaletteCreate): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - updateColorPalette(colorPaletteId: number, colorPalettePatch: ColorPalettePatch): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - deleteColorPalette(colorPaletteId: number): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - createColor(colorCreate: ColorCreate): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - updateColor(colorId: number, colorPatch: ColorPatch): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ - deleteColor(colorId: number): Promise; - downloadColorKit(selectedColorPalettes: number[]): string; getBlockSettings>(): Promise; updateBlockSettings>(newSettings: T): Promise; - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(openTemplateChooser())` instead. - */ - openTemplateChooser(callback: (selectedTemplate: TemplateLegacy) => void): void; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(closeTemplateChooser())` instead. - */ - closeTemplateChooser(): void; - getCurrentLoggedUser(): Promise; getBulkDownloadByToken(token: string): Promise; @@ -229,19 +127,6 @@ export interface AppBridgeBlock< getPrivacySettings(): PrivacySettings; - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(openAssetChooser(options))` to open the asset chooser - * and `appBridge.subscribe('assetsChosen', callback)` to subscribe to the asset chosen event - */ - openAssetChooser(callback: (selectedAssets: Asset[]) => void, options?: AssetChooserOptions): void; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(closeAssetChooser())` instead. - */ - closeAssetChooser(): void; - getProjectId(): number; getEditorState(): boolean; @@ -250,15 +135,9 @@ export interface AppBridgeBlock< /** * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But there will a new api to grab all colors and palettes. - */ - getColorPalettes(): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But there will a new api to grab all colors and palettes. + * There will be a replacement for this method. But there will a new api to grab all colors and palettes. */ - getColorsByColorPaletteId(colorPaletteId: number): Promise; + getColorPalettesWithColors(colorPaletteIds?: number[]): Promise; /** * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` @@ -266,63 +145,15 @@ export interface AppBridgeBlock< */ getAllDocuments(): Promise; - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getUngroupedDocuments(): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getDocumentsByDocumentGroupId(documentGroupId: number): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getDocumentGroups(): Promise; - /** * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. */ getDocumentPagesByDocumentId(documentId: number): Promise; - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getDocumentPagesByDocumentCategoryId(documentCategoryId: number): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getDocumentCategoriesByDocumentId(documentId: number): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getUncategorizedDocumentPagesByDocumentId(documentId: number): Promise; - /** * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. */ getDocumentSectionsByDocumentPageId(documentPageId: number): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getDocumentTargets(documentId: number): Promise; - - /** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. But Link Chooser will be in-sourced and there will be a command to open it. - */ - getDocumentPageTargets(documentPageId: number): Promise; } diff --git a/packages/app-bridge/src/AppBridgeCreateAsset.spec.ts b/packages/app-bridge/src/AppBridgeCreateAsset.spec.ts deleted file mode 100644 index d86aa81b3..000000000 --- a/packages/app-bridge/src/AppBridgeCreateAsset.spec.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { afterEach, beforeAll, describe, expect, it, test, vi } from 'vitest'; - -import { AppBridgeCreateAsset } from './AppBridgeCreateAsset'; -import { Topic } from './types'; -import { generateRandomString } from './utilities/hash'; -import { notify } from './utilities/notify'; -import { subscribe } from './utilities/subscribe'; - -const TOKEN = 'AjY34F87Dsat^J'; -const EXPECTED_RESULT = { test: 'passed' }; - -const DEFAULT_TIMEOUT = 3 * 1000; -const LONG_TIMEOUT = 5 * 60 * 1000; - -describe('AppBridgeCreateAssetTest', () => { - beforeAll(() => { - vi.mock('./utilities/subscribe', () => { - return { - subscribe: vi.fn().mockResolvedValue({ test: 'passed' }), - }; - }); - - vi.mock('./utilities/hash', () => { - return { - generateRandomString: vi.fn().mockReturnValue('AjY34F87Dsat^J'), - }; - }); - - vi.mock('./utilities/notify', () => { - return { - notify: vi.fn(), - }; - }); - - expect(generateRandomString).toHaveBeenCalledTimes(1); - expect(generateRandomString).toHaveReturnedWith('AjY34F87Dsat^J'); - }); - - afterEach(() => { - vi.clearAllMocks(); - }); - - it('should be instantiable', () => { - expect(new AppBridgeCreateAsset()).toBeInstanceOf(AppBridgeCreateAsset); - }); - - test('getAppState', async () => { - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.getAppState(); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.GetAppState, TOKEN); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.GetAppState, TOKEN); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('putAppState', async () => { - const newState = { new: 'state' }; - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.putAppState(newState); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.PutAppState, TOKEN, newState); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.PutAppState, TOKEN); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('deleteAppState', async () => { - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.deleteAppState(); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.DeleteAppState, TOKEN); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.DeleteAppState, TOKEN); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('getAssetById', async () => { - const assetId = 4076; - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.getAssetById(assetId); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.GetAssetById, TOKEN, { assetId }); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.GetAssetById, TOKEN); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('postExternalAssetWithPreview', async () => { - const assets = [ - { - title: 'My external asset', - url: 'https://www.post-external-asset.test', - previewUrl: 'https://www.preview-url.test', - }, - { - title: 'My external asset', - url: 'https://www.post-external-asset.test', - previewUrl: 'https://www.preview-url.test', - }, - ]; - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.postExternalAssets(assets); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.PostExternalAssets, TOKEN, assets); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.PostExternalAssets, TOKEN, { timeout: LONG_TIMEOUT }); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('postExternalAssetWithoutPreview', async () => { - const assets = [ - { - title: 'My external asset', - url: 'https://www.post-external-asset.test', - }, - { - title: 'My external asset', - url: 'https://www.post-external-asset.test', - }, - ]; - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.postExternalAssets(assets); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.PostExternalAssets, TOKEN, assets); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.PostExternalAssets, TOKEN, { timeout: DEFAULT_TIMEOUT }); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('getThirdPartyOauth2Tokens', async () => { - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.getThirdPartyOauth2Tokens(); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.GetThirdPartyOauth2Tokens, TOKEN); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.GetThirdPartyOauth2Tokens, TOKEN, { - timeout: LONG_TIMEOUT, - }); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('getRefreshedThirdpartyOauth2Tokens', async () => { - const refreshToken = '8raSsn0nG5v4'; - const appBridge = new AppBridgeCreateAsset(); - const result = appBridge.getRefreshedThirdpartyOauth2Tokens(refreshToken); - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.GetRefreshedThirdpartyOauth2Token, TOKEN, { refreshToken }); - - expect(subscribe).toHaveBeenCalledTimes(1); - expect(subscribe).toHaveBeenCalledWith(Topic.GetRefreshedThirdpartyOauth2Token, TOKEN); - await expect(result).resolves.toEqual(EXPECTED_RESULT); - }); - - test('closeApp', () => { - const appBridge = new AppBridgeCreateAsset(); - appBridge.closeApp(); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.CloseApp, TOKEN); - }); - - test('openAssetChooser', () => { - const appBridge = new AppBridgeCreateAsset(); - appBridge.openAssetChooser(); - - expect(notify).toHaveBeenCalledTimes(1); - expect(notify).toHaveBeenCalledWith(Topic.OpenAssetChooser, TOKEN); - }); -}); diff --git a/packages/app-bridge/src/AppBridgeCreateAsset.ts b/packages/app-bridge/src/AppBridgeCreateAsset.ts deleted file mode 100644 index b7528deac..000000000 --- a/packages/app-bridge/src/AppBridgeCreateAsset.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { Topic, type AssetApi, type NotifyData, type OauthTokens, type PostExternalAssetParams } from './types'; -import { generateRandomString, notify, subscribe } from './utilities'; - -const PUBSUB_TOKEN = generateRandomString(); -const DEFAULT_TIMEOUT = 3 * 1000; -const LONG_TIMEOUT = 5 * 60 * 1000; - -export class AppBridgeCreateAsset { - getAppState>(): Promise { - notify(Topic.GetAppState, PUBSUB_TOKEN); - return subscribe(Topic.GetAppState, PUBSUB_TOKEN); - } - - async putAppState(newState: NotifyData): Promise { - notify(Topic.PutAppState, PUBSUB_TOKEN, newState); - return subscribe(Topic.PutAppState, PUBSUB_TOKEN); - } - - async deleteAppState(): Promise { - notify(Topic.DeleteAppState, PUBSUB_TOKEN); - return subscribe(Topic.DeleteAppState, PUBSUB_TOKEN); - } - - getAssetById(assetId: number): Promise { - notify(Topic.GetAssetById, PUBSUB_TOKEN, { assetId }); - return subscribe(Topic.GetAssetById, PUBSUB_TOKEN); - } - - async postExternalAssets(assets: PostExternalAssetParams[]): Promise { - const assetsWithPreview = assets.filter((asset) => asset.previewUrl); - const timeout = assetsWithPreview.length > 0 ? LONG_TIMEOUT : DEFAULT_TIMEOUT; - - notify(Topic.PostExternalAssets, PUBSUB_TOKEN, assets); - return subscribe(Topic.PostExternalAssets, PUBSUB_TOKEN, { - timeout, - }); - } - - getThirdPartyOauth2Tokens(): Promise { - notify(Topic.GetThirdPartyOauth2Tokens, PUBSUB_TOKEN); - return subscribe(Topic.GetThirdPartyOauth2Tokens, PUBSUB_TOKEN, { - timeout: LONG_TIMEOUT, - }); - } - - getRefreshedThirdpartyOauth2Tokens(refreshToken: string): Promise { - notify(Topic.GetRefreshedThirdpartyOauth2Token, PUBSUB_TOKEN, { refreshToken }); - return subscribe(Topic.GetRefreshedThirdpartyOauth2Token, PUBSUB_TOKEN); - } - - closeApp(): void { - notify(Topic.CloseApp, PUBSUB_TOKEN); - } - - openAssetChooser(): void { - notify(Topic.OpenAssetChooser, PUBSUB_TOKEN); - } -} diff --git a/packages/app-bridge/src/AppBridgePlatformApp.spec.ts b/packages/app-bridge/src/AppBridgePlatformApp.spec.ts deleted file mode 100644 index 3a6814c42..000000000 --- a/packages/app-bridge/src/AppBridgePlatformApp.spec.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { AppBridgePlatformApp } from './AppBridgePlatformApp'; -import { InitializationError } from './errors'; -import { openConnection } from './registries'; -import { notify } from './utilities'; - -const TOKEN = 'AjY34F87Dsat^J'; - -describe('AppBridgePlatformApp', () => { - vi.mock('./utilities/subscribe', () => ({ - subscribe: vi.fn().mockResolvedValue({ - statePort: { onmessage: vi.fn() }, - apiPort: { onmessage: vi.fn() }, - context: { parentId: 'parentId-test', connected: true }, - state: { settings: 'settings-test' }, - }), - })); - - vi.mock('./utilities/notify', () => ({ - notify: vi.fn(), - })); - - afterEach(() => { - vi.clearAllMocks(); - }); - - it('should be instantiable', () => { - expect(new AppBridgePlatformApp()).toBeInstanceOf(AppBridgePlatformApp); - }); - - it('should not initialize without a token', async () => { - window.location.search = '?token='; - - const platformApp = new AppBridgePlatformApp(); - - await expect(() => platformApp.dispatch(openConnection())).rejects.toThrow(new InitializationError()); - expect(notify).toHaveBeenCalledTimes(0); - }); - - it('should yield true for Context.connected after dispatch', () => { - const connected = true; - window.location.search = `?token=${TOKEN}`; - const platformApp = new AppBridgePlatformApp(); - platformApp.subscribe('Context.connected', () => { - expect(connected).toBe(true); - }); - platformApp.dispatch(openConnection()); - }); - - it.fails('should throw an error when api is not initialized', async () => { - window.location.search = `?token=${TOKEN}`; - - const platformApp = new AppBridgePlatformApp(); - await expect(() => platformApp.api({ name: 'getCurrentUser' })).rejects.toThrow(); - }); - - it('should return empty state when not inititalized', () => { - const platformApp = new AppBridgePlatformApp(); - const state = platformApp.state().get(); - expect(state).toEqual({ settings: {} }); - }); - - it('should return state after app is initialized', () => { - window.location.search = `?token=${TOKEN}`; - const platformApp = new AppBridgePlatformApp(); - platformApp.subscribe('Context.connected', (connected) => { - const state = platformApp.state().get(); - - expect(connected).toBe(true); - expect(state).toEqual({ settings: 'settings-test' }); - }); - platformApp.dispatch(openConnection()); - }); - - it('should yield true for Context.connected after dispatch', () => { - window.location.search = `?token=${TOKEN}`; - const platformApp = new AppBridgePlatformApp(); - platformApp.subscribe('Context.connected', (connected) => { - const context = platformApp.context().get(); - const parentId = platformApp.context('parentId').get(); - - expect(connected).toBe(true); - expect(context).toEqual({ parentId: 'parentId-test', connected: true }); - expect(parentId).toEqual('parentId-test'); - }); - platformApp.dispatch(openConnection()); - }); - - it('should return correct object when subscribing to context', () => { - window.location.search = `?token=${TOKEN}`; - const platformApp = new AppBridgePlatformApp(); - platformApp.context().subscribe((context) => { - expect({ parentId: 'parentId-test', connected: true }).toStrictEqual(context); - }); - platformApp.dispatch(openConnection()); - }); - - it('should return correct object when subscribing to context', () => { - window.location.search = `?token=${TOKEN}`; - const platformApp = new AppBridgePlatformApp(); - platformApp.context().subscribe((context) => { - expect({ parentId: 'parentId-test', connected: true }).toStrictEqual(context); - platformApp.dispatch(openConnection()); - }); - platformApp.dispatch(openConnection()); - }); -}); diff --git a/packages/app-bridge/src/AppBridgePlatformApp.ts b/packages/app-bridge/src/AppBridgePlatformApp.ts deleted file mode 100644 index 67ee33cff..000000000 --- a/packages/app-bridge/src/AppBridgePlatformApp.ts +++ /dev/null @@ -1,275 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { - type ApiHandlerParameter, - type ApiMethodNameValidator, - type ApiReturn, - type AppBridge, - type CommandNameValidator, - type ContextAsEventName, - type ContextReturn, - type DispatchHandlerParameter, - type EventCallbackParameter, - type EventNameParameter, - type EventNameValidator, - type EventUnsubscribeFunction, - type StateAsEventName, - type StateReturn, - type SubscribeMap, -} from './AppBridge'; -import { InitializationError } from './errors'; -import { type ApiMethodRegistry, openConnection } from './registries'; -import { Topic } from './types'; -import { generateRandomString, notify, subscribe } from './utilities'; -import { ErrorMessageBus, type IMessageBus, MessageBus } from './utilities/MessageBus'; -import { getQueryParameters } from './utilities/queryParams'; - -export type PlatformAppApiMethod = ApiMethodNameValidator< - Pick ->; - -export type PlatformAppCommandRegistry = CommandNameValidator<{ - openConnection: void; -}>; - -export type PlatformAppCommand = CommandNameValidator>; - -export type PlatformAppState = { - settings: Record; -}; - -type InitializeEvent = { - apiPort: MessagePort; - statePort: MessagePort; - context: PlatformAppContext; - state: PlatformAppState; -}; - -type AppBaseProps = { - token: string; - marketplaceServiceAppId: string; - connected: boolean; - settings: { [key: string]: string }; - brandId: number; - domain: string; - parentId: string; -}; - -export type AssetActionContext = { - surface: 'assetAction'; - assetId: string; -} & AppBaseProps; - -export type AssetCreationContext = { - surface: 'assetCreation'; -} & AppBaseProps; - -export type PlatformAppContext = AssetActionContext | AssetCreationContext; - -export type PlatformAppEvent = EventNameValidator< - StateAsEventName & - ContextAsEventName ->; - -export class AppBridgePlatformApp implements IAppBridgePlatformApp { - private apiMessageBus: IMessageBus = new ErrorMessageBus(); - private stateMessageBus: IMessageBus = new ErrorMessageBus(); - private initialized: boolean = false; - private localContext?: PlatformAppContext; - private localState: PlatformAppState = { settings: {} }; - private maxRetries: number = 5; - - private readonly subscribeMap: SubscribeMap = { - 'State.*': new Map(), - 'State.settings': new Map(), - 'Context.*': new Map(), - 'Context.marketplaceServiceAppId': new Map(), - 'Context.token': new Map(), - 'Context.assetId': new Map(), - 'Context.brandId': new Map(), - 'Context.parentId': new Map(), - 'Context.domain': new Map(), - 'Context.surface': new Map(), - 'Context.connected': new Map(), - 'Context.settings': new Map(), - }; - - api( - apiHandler: ApiHandlerParameter, - ): ApiReturn { - return this.apiMessageBus.post({ - parameter: apiHandler, - }) as ApiReturn; - } - - private guardForInitialization() { - const initialContext = getQueryParameters(window.location.href); - if (!initialContext.token) { - throw new InitializationError(); - } - return this.initialized; - } - - async dispatch( - dispatchHandler: DispatchHandlerParameter, - ): Promise { - if (dispatchHandler.name === openConnection().name) { - if (this.guardForInitialization()) { - return; - } - - const checksum = generateRandomString(); - - notify(Topic.Init, checksum, { - token: getQueryParameters(window.location.href).token, - appBridgeVersion: 'v4', - }); - - await this.attemptSubscription(1, checksum); - } - } - - private async attemptSubscription(attempt: number, checksum: string): Promise { - try { - const { statePort, apiPort, context, state } = await subscribe(Topic.Init, checksum); - - this.apiMessageBus = new MessageBus(apiPort); - this.stateMessageBus = new MessageBus(statePort); - - this.localContext = context; - this.localState = state; - this.initialized = true; - - this.callSubscribedTopic('Context.connected', [true, false]); - this.callSubscribedTopic('Context.*', [this.localContext, this.localContext]); - this.callSubscribedTopic('State.*', [this.localState, this.localState]); - } catch { - if (attempt < this.maxRetries) { - await this.attemptSubscription(attempt + 1, checksum); - } else { - console.error('Could not connect to the platform.'); - } - } - } - - context(key?: void): ContextReturn; - context(key?: Key): ContextReturn; - context(key?: keyof PlatformAppContext | void): unknown { - if (typeof key === 'undefined') { - return { - get: () => this.localContext, - subscribe: ( - callback: (nextContext: PlatformAppContext, previousContext: PlatformAppContext) => void, - ) => { - return this.subscribe('Context.*', callback); - }, - }; - } - return { - get: () => (this.localContext ? this.localContext[key] : {}), - subscribe: ( - callback: (nextContext: PlatformAppContext[Key], previousContext: PlatformAppContext[Key]) => void, - ) => { - // @ts-expect-error typing is correct, but TS doesn't like it - return this.subscribe(`Context.${key}`, callback); - }, - }; - } - - private async setInternalState(state: Promise): Promise { - const prevState = this.localState; - this.localState = await state; - this.callSubscribedTopic('State.*', [this.localState, prevState]); - } - - state(): StateReturn; - state(key: Key): StateReturn; - state(key?: keyof PlatformAppState | void): unknown { - if (typeof key === 'undefined') { - return { - get: () => this.localState, - set: (nextState: PlatformAppState) => { - const newState = this.stateMessageBus.post({ - parameter: { nextState }, - }) as Promise; - this.setInternalState(newState); - }, - subscribe: (callback: (nextState: PlatformAppState, previousState: PlatformAppState) => void) => { - return this.subscribe('State.*', callback); - }, - }; - } - - return { - get: () => this.localState[key], - set: (nextState: PlatformAppState[Key]) => { - const newState = this.stateMessageBus.post({ - parameter: { nextState }, - }) as Promise; - this.setInternalState(newState); - }, - subscribe: (callback: (nextState: PlatformAppState[Key], previousState: PlatformAppState[Key]) => void) => { - return this.subscribe(`State.${key}`, callback); - }, - }; - } - - subscribe( - eventName: EventNameParameter, - callback: EventCallbackParameter, - ): EventUnsubscribeFunction { - if (!(eventName in this.subscribeMap)) { - this.subscribeMap[eventName] = new Map(); - } - - this.subscribeMap[eventName].set(callback, true); - - return () => { - this.subscribeMap[eventName].delete(callback); - }; - } - - callSubscribedTopic( - eventName: EventNameParameter, - callbackParameters: PlatformAppEvent[EventName], - ) { - const callbackMap = this.subscribeMap[eventName]; - if (callbackMap && callbackMap?.size !== undefined) { - for (const [callback] of callbackMap.entries()) { - // @ts-expect-error if there are multiple parameters, we spread them in the callback call - callback(...(Array.isArray(callbackParameters) ? callbackParameters : [callbackParameters])); - } - } - } -} - -export interface IAppBridgePlatformApp< - State extends PlatformAppState = PlatformAppState, - Context extends PlatformAppContext = PlatformAppContext, - Event extends PlatformAppEvent = PlatformAppEvent, -> extends AppBridge { - api( - apiHandler: ApiHandlerParameter, - ): ApiReturn; - - dispatch( - dispatchHandler: DispatchHandlerParameter, - ): Promise; - - state(): StateReturn; - - state(key: Key): StateReturn; - - state(key?: keyof State | void): unknown; - - context(): ContextReturn; - - context(key: Key): ContextReturn; - - context(key?: keyof Context | void): unknown; - - subscribe( - eventName: EventNameParameter, - callback: EventCallbackParameter, - ): EventUnsubscribeFunction; -} diff --git a/packages/app-bridge/src/AppBridgeTheme.ts b/packages/app-bridge/src/AppBridgeTheme.ts deleted file mode 100644 index d6470c659..000000000 --- a/packages/app-bridge/src/AppBridgeTheme.ts +++ /dev/null @@ -1,357 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { - type ApiHandlerParameter, - type ApiMethodNameValidator, - type ApiReturn, - type AppBridge, - type CommandNameValidator, - type ContextAsEventName, - type ContextReturn, - type DispatchHandlerParameter, - type EventCallbackParameter, - type EventNameParameter, - type EventNameValidator, - type EventUnsubscribeFunction, - type StateAsEventName, - type StateReturn, -} from './AppBridge'; -import { type ApiMethodRegistry } from './registries/api/ApiMethodRegistry'; -import { type CommandRegistry } from './registries/commands/CommandRegistry'; -import { type EventRegistry } from './registries/events/EventRegistry'; -import { - type Asset, - type AssetChooserOptions, - type BrandportalLink, - type Color, - type ColorPalette, - type CoverPage, - type CoverPageCreate, - type CoverPageUpdate, - type CoverPageUpdateLegacy, - type Document, - type DocumentCategory, - type DocumentCategoryCreate, - type DocumentCategoryUpdate, - type DocumentGroup, - type DocumentGroupCreate, - type DocumentGroupUpdate, - type DocumentLibraryCreate, - type DocumentLibraryUpdate, - type DocumentLinkCreate, - type DocumentLinkUpdate, - type DocumentPage, - type DocumentPageCreate, - type DocumentPageTargets, - type DocumentPageUpdate, - type DocumentSection, - type DocumentStandardCreate, - type DocumentStandardUpdate, - type DocumentTargets, - type GuidelineSearchResult, - type Language, - type TargetsUpdate, - type ThemeTemplate, -} from './types'; - -export type ThemeApiMethod = ApiMethodNameValidator< - Pick ->; - -export type ThemeCommand = CommandNameValidator< - Pick< - CommandRegistry, - | 'closeAssetChooser' - | 'openAssetChooser' - | 'openNavigationManager' - | 'openSearchDialog' - | 'closeSearchDialog' - | 'navigateToDocumentSection' - > ->; - -export type TemplateContext = { templateId: string; type: ThemeTemplate } & ( - | { type: 'documentPage'; document: Document; documentPage: DocumentPage } - | { type: 'library'; document: Document } - | { type: 'cover'; coverPage: CoverPage } -); - -export type ThemeState = { - settings: Record; - assets: Record; -}; - -export type ThemeContext = { - brandId: number; - projectId: number; - portalId: number; - portalToken: string | null; - currentLanguage: string; - defaultLanguage: string; - isEditing: boolean; - isPublicLink: boolean; - isAuthenticated: boolean; - isSearchDialogOpen: boolean; - languages: Language[]; - template: TemplateContext | null; -}; - -export type ThemeEvent = EventNameValidator< - Pick & - StateAsEventName & - ContextAsEventName ->; - -export interface AppBridgeTheme< - State extends ThemeState = ThemeState, - Context extends ThemeContext = ThemeContext, - Event extends ThemeEvent = ThemeEvent, -> extends AppBridge { - api( - apiHandler: ApiHandlerParameter, - ): ApiReturn; - - dispatch( - dispatchHandler: DispatchHandlerParameter, - ): Promise; - - state(): StateReturn; - state(key: Key): StateReturn; - state(key?: keyof State | void): unknown; - - context(): ContextReturn; - context(key: Key): ContextReturn; - context(key?: keyof Context | void): unknown; - - subscribe( - eventName: EventNameParameter, - callback: EventCallbackParameter, - ): EventUnsubscribeFunction; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('portalId').get()` instead. - */ - getPortalId(): number; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('brandId').get()` instead. - */ - getBrandId(): number; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(openNavigationManager())` for opening the Navigation Manager. - */ - openNavigationManager(): void; - - getCoverPageTemplateSettings(): Promise; - - updateCoverPageTemplateSettings(settings: Record): Promise; - - getThemeSettings(): Promise; - - updateThemeSettings>(settings: ThemeSettings): Promise; - - getDocumentPageTemplateSettings(documentPageId: number): Promise; - - updateDocumentPageTemplateSettings(documentPageId: number, settings: Record): Promise; - - addAssetIdsToCoverPageTemplateAssetKey(key: string, assetIds: number[]): Promise>; - - getCoverPageTemplateAssets(): Promise>; - - deleteAssetIdsFromCoverPageTemplateAssetKey(key: string, assetIds: number[]): Promise; - - addAssetIdsToThemeAssetKey( - key: string, - assetIds: number[], - template: ThemeTemplate, - ): Promise>; - - getThemeAssets(template: ThemeTemplate): Promise>; - - deleteAssetIdsFromThemeAssetKey(key: string, assetIds: number[], template: ThemeTemplate): Promise; - - addAssetIdsToLibraryPageTemplateAssetKey( - documentId: number, - key: string, - assetIds: number[], - ): Promise>; - - getLibraryPageTemplateAssets(documentId: number): Promise>; - - deleteAssetIdsFromLibraryPageTemplateAssetKey(documentId: number, key: string, assetIds: number[]): Promise; - - addAssetIdsToDocumentPageTemplateAssetKey( - documentPageId: number, - key: string, - assetIds: number[], - ): Promise>; - - getDocumentPageTemplateAssets(documentPageId: number): Promise>; - - deleteAssetIdsFromDocumentPageTemplateAssetKey( - documentPageId: number, - key: string, - assetIds: number[], - ): Promise; - - getLibraryPageTemplateSettings(documentId: number): Promise; - - updateLibraryPageTemplateSettings(documentId: number, settings: Record): Promise; - - createLink(link: DocumentLinkCreate): Promise; - - updateLink(link: DocumentLinkUpdate): Promise; - - deleteLink(documentId: number): Promise; - - createLibrary(library: DocumentLibraryCreate): Promise; - - updateLibrary(library: DocumentLibraryUpdate): Promise; - - deleteLibrary(documentId: number): Promise; - - createStandardDocument(document: DocumentStandardCreate): Promise; - - updateStandardDocument(document: DocumentStandardUpdate): Promise; - - deleteStandardDocument(id: number): Promise; - - moveDocument(documentId: number, position: number, newDocumentGroupId?: number): Promise; - - createDocumentGroup(documentGroup: DocumentGroupCreate): Promise; - - updateDocumentGroup(documentGroup: DocumentGroupUpdate): Promise; - - deleteDocumentGroup(documentGroupId: number): Promise; - - moveDocumentGroup(documentGroupId: number, position: number): Promise; - - createDocumentCategory(category: DocumentCategoryCreate): Promise; - - updateDocumentCategory(category: DocumentCategoryUpdate): Promise; - - deleteDocumentCategory(documentCategoryId: number): Promise; - - moveDocumentCategory(documentCategoryId: number, documentId: number, position: number): Promise; - - createDocumentPage(documentPage: DocumentPageCreate): Promise; - - /** - * A method for page update - * - * @param documentPage - {@link DocumentPageUpdate} object - * @requires id - Indicates page identifier. - * - * - * and at least one of - * - * @property title - Indicates title of a page. - * @property documentId - Indicates to witch document the page belongs to. - * @property categoryId - Indicates to witch category the page belongs to. - * @property visibility - Indicates whether the page is visible only to the editor or everyone. - * @property linkUrl - Indicates whether the page is link or not. - */ - updateDocumentPage(documentPage: DocumentPageUpdate): Promise; - - deleteDocumentPage(documentPageId: number): Promise; - - moveDocumentPage( - documentPageId: number, - documentId: number, - position?: number, - documentCategoryId?: number, - ): Promise; - - duplicateDocumentPage(documentPageId: number): Promise; - - createCoverPage(coverPage: CoverPageCreate): Promise; - - updateCoverPage(coverPage: CoverPageUpdate): Promise; - - /** - * @deprecated legacy method, should be removed once new endpoint is available - */ - updateLegacyCoverPage(coverPage: CoverPageUpdateLegacy): Promise; - - deleteCoverPage(): Promise; - - updateBrandportalLink(brandportalLink: Partial): Promise | null>; - - getCoverPage(): Promise; - - getBrandportalLink(): Promise; - - getUngroupedDocuments(): Promise; - - updateDocumentTargets(targetIds: number[], documentIds: number[]): Promise; - - updateDocumentPageTargets(targetIds: number[], documentPageIds: number[]): Promise; - - /** - * Search in the current Guideline for a given query. - * @param query - The query to search for. - * @param order - The order in which the results should be returned. Defaults to 'relevance'. - */ - searchInGuideline(query: string, order?: 'relevance' | 'newest' | 'oldest'): Promise; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(openAssetChooser(options))` to open the asset chooser - * and `appBridge.subscribe('assetsChosen', callback)` to subscribe to the asset chosen event. - */ - openAssetChooser(callback: (selectedAssets: Asset[]) => void, options?: AssetChooserOptions): void; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.dispatch(closeAssetChooser())` instead. - */ - closeAssetChooser(): void; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('projectId').get()` instead. - */ - getProjectId(): number; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('isEditing').get()` instead. - */ - getEditorState(): boolean; - - /** - * @deprecated This will be removed in version 4.0.0 of `@frontify/app-bridge` - * Use `appBridge.context('language').get()` instead. - */ - getTranslationLanguage(): string; - - getColorPalettes(): Promise; - - getColorsByColorPaletteId(colorPaletteId: number): Promise; - - getAllDocuments(): Promise; - - getUngroupedDocuments(): Promise; - - getDocumentsByDocumentGroupId(documentGroupId: number): Promise; - - getDocumentGroups(): Promise; - - getDocumentPagesByDocumentId(documentId: number): Promise; - - getDocumentPagesByDocumentCategoryId(documentCategoryId: number): Promise; - - getDocumentCategoriesByDocumentId(documentId: number): Promise; - - getUncategorizedDocumentPagesByDocumentId(documentId: number): Promise; - - getDocumentSectionsByDocumentPageId(documentPageId: number): Promise; - - getDocumentTargets(documentId: number): Promise; - - getDocumentPageTargets(documentPageId: number): Promise; -} diff --git a/packages/app-bridge/src/errors/InitializationError.ts b/packages/app-bridge/src/errors/InitializationError.ts deleted file mode 100644 index 2cfbf5bc8..000000000 --- a/packages/app-bridge/src/errors/InitializationError.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export class InitializationError extends Error { - constructor(message?: string) { - super(`Initialization failed. ${message}`); - this.name = 'InitializationError'; - } -} diff --git a/packages/app-bridge/src/errors/NotifyError.ts b/packages/app-bridge/src/errors/NotifyError.ts deleted file mode 100644 index 0057a78fd..000000000 --- a/packages/app-bridge/src/errors/NotifyError.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export class FetchError extends Error { - constructor(topic: string) { - super(`Call with topic ${topic} failed.`); - this.name = 'FetchError'; - } -} diff --git a/packages/app-bridge/src/errors/TimeoutReachedError.ts b/packages/app-bridge/src/errors/TimeoutReachedError.ts deleted file mode 100644 index 0044ca987..000000000 --- a/packages/app-bridge/src/errors/TimeoutReachedError.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export class TimeoutReachedError extends Error { - constructor(topic: string) { - super(`Timeout for call with topic "${topic}" expired. Call was aborted.`); - this.name = 'TimeoutReachedError'; - } -} diff --git a/packages/app-bridge/src/errors/ValidationError.ts b/packages/app-bridge/src/errors/ValidationError.ts deleted file mode 100644 index 3872fcb12..000000000 --- a/packages/app-bridge/src/errors/ValidationError.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export class ValidationError extends Error { - constructor(message?: string) { - super(`Validation failed. ${message}`); - this.name = 'ValidationError'; - } -} diff --git a/packages/app-bridge/src/errors/index.ts b/packages/app-bridge/src/errors/index.ts index d90f172b4..426eb42d8 100644 --- a/packages/app-bridge/src/errors/index.ts +++ b/packages/app-bridge/src/errors/index.ts @@ -1,7 +1,3 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ export * from './HttpClientError'; -export * from './InitializationError'; -export * from './NotifyError'; -export * from './TimeoutReachedError'; -export * from './ValidationError'; diff --git a/packages/app-bridge/src/helpers/index.ts b/packages/app-bridge/src/helpers/index.ts deleted file mode 100644 index 0e51a26f7..000000000 --- a/packages/app-bridge/src/helpers/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export * from './link'; -export * from './navigation'; diff --git a/packages/app-bridge/src/helpers/link.spec.ts b/packages/app-bridge/src/helpers/link.spec.ts deleted file mode 100644 index 30605a1eb..000000000 --- a/packages/app-bridge/src/helpers/link.spec.ts +++ /dev/null @@ -1,272 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { DocumentCategoryDummy, DocumentDummy, DocumentPageDummy } from '../tests'; -import { CoverPageDummy } from '../tests/CoverPageDummy'; - -import { computeCoverPageLink, computeDocumentLink, computeDocumentPageLink } from './link'; - -const PORTAL_ID = 23451; -const PORTAL_TOKEN = 'weisdfjsdf'; -const DOCUMENT_ID = 2937; -const DOCUMENT_CATEGORY_ID = 2314; -const DOCUMENT_PAGE_ID = 9382; - -describe('computeCoverPageLink', () => { - it('should return the correct link when private', () => { - const coverPage = CoverPageDummy.with(PORTAL_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeCoverPageLink({ coverPage, language, portalToken: null }); - - expect(result).toEqual(`/hub/${PORTAL_ID}`); - }); - - it('should return the correct link when private with same language as default', () => { - const coverPage = CoverPageDummy.with(PORTAL_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeCoverPageLink({ coverPage, language, portalToken: null }); - - expect(result).toEqual(`/hub/${PORTAL_ID}`); - }); - - it('should return the correct link when private with different language from default', () => { - const coverPage = { ...CoverPageDummy.with(PORTAL_ID), url: `/hub/${PORTAL_ID}/fr` }; - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeCoverPageLink({ coverPage, language, portalToken: null }); - - expect(result).toEqual(`/hub/${PORTAL_ID}/fr`); - }); - - it('should return the correct link when publicly shared', () => { - const coverPage = CoverPageDummy.with(PORTAL_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeCoverPageLink({ coverPage, language, portalToken: PORTAL_TOKEN }); - - expect(result).toEqual(`/d/${PORTAL_TOKEN}`); - }); - - it('should return the correct link when publicly shared with same language as default', () => { - const coverPage = CoverPageDummy.with(PORTAL_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeCoverPageLink({ coverPage, language, portalToken: PORTAL_TOKEN }); - - expect(result).toEqual(`/d/${PORTAL_TOKEN}`); - }); - - it('should return the correct link when publicly shared with different language from default', () => { - const coverPage = CoverPageDummy.with(PORTAL_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeCoverPageLink({ coverPage, language, portalToken: PORTAL_TOKEN }); - - expect(result).toEqual(`/d/${PORTAL_TOKEN}/fr`); - }); -}); - -describe('computeDocumentLink', () => { - it('should return the correct link when private', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentLink({ document, language, portalToken: null }); - expect(result).toEqual(`/document/${DOCUMENT_ID}`); - }); - - it('should return the correct link when private with same language as default', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentLink({ document, language, portalToken: null }); - expect(result).toEqual(`/document/${DOCUMENT_ID}`); - }); - - it('should return the correct link when private with different language from default', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeDocumentLink({ document, language, portalToken: null }); - expect(result).toEqual(`/document/${DOCUMENT_ID}/fr`); - }); - - it('should return the correct link when publicly shared', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentLink({ document, language, portalToken: PORTAL_TOKEN }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/${document.slug}`); - }); - - it('should return the correct link when publicly shared with same language as default', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentLink({ document, language, portalToken: PORTAL_TOKEN }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/${document.slug}`); - }); - - it('should return the correct link when publicly shared with different language from default', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeDocumentLink({ document, language, portalToken: PORTAL_TOKEN }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/fr/${document.slug}`); - }); -}); - -describe('computeDocumentPageLink', () => { - it('should return the correct link when private (without category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ document, documentPage, language, portalToken: null }); - expect(result).toEqual(`/document/${DOCUMENT_ID}#/-/${documentPage.slug}`); - }); - - it('should return the correct link when private (with category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentCategory = DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ - document, - documentCategory, - documentPage, - language, - portalToken: null, - }); - expect(result).toEqual(`/document/${DOCUMENT_ID}#/${documentCategory.slug}/${documentPage.slug}`); - }); - - it('should return the correct link when private with same language as default (without category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ document, documentPage, language, portalToken: null }); - expect(result).toEqual(`/document/${DOCUMENT_ID}#/-/${documentPage.slug}`); - }); - - it('should return the correct link when private with same language as default (with category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentCategory = DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ - document, - documentCategory, - documentPage, - language, - portalToken: null, - }); - expect(result).toEqual(`/document/${DOCUMENT_ID}#/${documentCategory.slug}/${documentPage.slug}`); - }); - - it('should return the correct link when private with different language from default (without category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ document, documentPage, language, portalToken: null }); - expect(result).toEqual(`/document/${DOCUMENT_ID}/fr#/-/${documentPage.slug}`); - }); - - it('should return the correct link when private with different language from default (with category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentCategory = DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ - document, - documentCategory, - documentPage, - language, - portalToken: null, - }); - expect(result).toEqual(`/document/${DOCUMENT_ID}/fr#/${documentCategory.slug}/${documentPage.slug}`); - }); - - it('should return the correct link when publicly shared (without category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ document, documentPage, language, portalToken: PORTAL_TOKEN }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/${document.slug}#/-/${documentPage.slug}`); - }); - - it('should return the correct link when publicly shared (with category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentCategory = DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ - document, - documentCategory, - documentPage, - language, - portalToken: PORTAL_TOKEN, - }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/${document.slug}#/${documentCategory.slug}/${documentPage.slug}`); - }); - - it('should return the correct link when publicly shared with same language as default (without category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ document, documentPage, language, portalToken: PORTAL_TOKEN }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/${document.slug}#/-/${documentPage.slug}`); - }); - - it('should return the correct link when publicly shared with same language as default (with category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentCategory = DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'en', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ - document, - documentCategory, - documentPage, - language, - portalToken: PORTAL_TOKEN, - }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/${document.slug}#/${documentCategory.slug}/${documentPage.slug}`); - }); - - it('should return the correct link when publicly shared with different language from default (without category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ document, documentPage, language, portalToken: PORTAL_TOKEN }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/fr/${document.slug}#/-/${documentPage.slug}`); - }); - - it('should return the correct link when publicly shared with different language from default (with category)', () => { - const document = DocumentDummy.with(DOCUMENT_ID); - const documentCategory = DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID); - const documentPage = DocumentPageDummy.with(DOCUMENT_PAGE_ID); - const language = { currentLanguage: 'fr', defaultLanguage: 'en' }; - - const result = computeDocumentPageLink({ - document, - documentCategory, - documentPage, - language, - portalToken: PORTAL_TOKEN, - }); - expect(result).toEqual(`/d/${PORTAL_TOKEN}/fr/${document.slug}#/${documentCategory.slug}/${documentPage.slug}`); - }); -}); diff --git a/packages/app-bridge/src/helpers/link.ts b/packages/app-bridge/src/helpers/link.ts deleted file mode 100644 index f66e95d1a..000000000 --- a/packages/app-bridge/src/helpers/link.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CoverPage, type Document, type DocumentCategory, type DocumentPage } from '../types'; - -export const computeCoverPageLink = ({ - coverPage, - language, - portalToken, -}: { - coverPage: CoverPage; - language: { - currentLanguage: string; - defaultLanguage: string; - }; - portalToken: Nullable; -}) => { - const languageUrlPart = language.currentLanguage === language.defaultLanguage ? '' : `/${language.currentLanguage}`; - - if (portalToken) { - return `/d/${portalToken}${languageUrlPart}`; - } - - return coverPage.url; -}; - -export const computeDocumentLink = ({ - document, - language, - portalToken, -}: { - document: Document; - language: { - currentLanguage: string; - defaultLanguage: string; - }; - portalToken: Nullable; -}) => { - const languageUrlPart = language.currentLanguage === language.defaultLanguage ? '' : `/${language.currentLanguage}`; - - if (portalToken) { - return `/d/${portalToken}${languageUrlPart}/${document.slug}`; - } - - return `/document/${document.id}${languageUrlPart}`; -}; - -export const computeDocumentPageLink = ({ - documentPage, - language, - portalToken, - document, - documentCategory, -}: { - documentPage: DocumentPage; - document: Document; - documentCategory?: DocumentCategory; - language: { - currentLanguage: string; - defaultLanguage: string; - }; - portalToken: Nullable; -}) => { - const categoryUrlPart = documentCategory ? `${documentCategory.slug}/` : '-/'; - const languageUrlPart = language.currentLanguage === language.defaultLanguage ? '' : `/${language.currentLanguage}`; - if (portalToken) { - return `/d/${portalToken}${languageUrlPart}/${document.slug}#/${categoryUrlPart}${documentPage.slug}`; - } - - return `/document/${document.id}${languageUrlPart}#/${categoryUrlPart}${documentPage.slug}`; -}; diff --git a/packages/app-bridge/src/helpers/navigation.spec.ts b/packages/app-bridge/src/helpers/navigation.spec.ts deleted file mode 100644 index b5e79f065..000000000 --- a/packages/app-bridge/src/helpers/navigation.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { DocumentSectionDummy } from '../tests/DocumentSectionDummy'; - -import { filterDocumentSectionsWithUnreadableTitles } from './navigation'; - -const documentSections = [ - // @ts-expect-error On purpose to test the function - DocumentSectionDummy.withFields({ id: 464, title: null }), - DocumentSectionDummy.withFields({ id: 356, title: 'New Title' }), - DocumentSectionDummy.withFields({ id: 37675, title: ' ' }), - DocumentSectionDummy.withFields({ id: 37675, title: '' }), -]; - -describe('filterDocumentSectionsWithUnreadableTitles', () => { - it("should filter out document sections that don't have a readable title", () => { - const sections = filterDocumentSectionsWithUnreadableTitles(documentSections); - expect(sections).toEqual([documentSections[1]]); - }); -}); diff --git a/packages/app-bridge/src/helpers/navigation.ts b/packages/app-bridge/src/helpers/navigation.ts deleted file mode 100644 index 9dbdd3781..000000000 --- a/packages/app-bridge/src/helpers/navigation.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentSection } from '../'; - -export const filterDocumentSectionsWithUnreadableTitles = (sections: DocumentSection[]) => - sections.filter((section) => !!section.title?.trim()); diff --git a/packages/app-bridge/src/index.ts b/packages/app-bridge/src/index.ts index d2022f0d7..387a6418f 100644 --- a/packages/app-bridge/src/index.ts +++ b/packages/app-bridge/src/index.ts @@ -6,11 +6,7 @@ enableMapSet(); export * from './AppBridge'; export * from './AppBridgeBlock'; -export * from './AppBridgeCreateAsset'; -export * from './AppBridgePlatformApp'; -export * from './AppBridgeTheme'; export * from './errors'; -export * from './helpers'; export * from './registries'; export * from './react'; export * from './tests'; diff --git a/packages/app-bridge/src/react/index.ts b/packages/app-bridge/src/react/index.ts index 11220d580..2dfb050dc 100644 --- a/packages/app-bridge/src/react/index.ts +++ b/packages/app-bridge/src/react/index.ts @@ -8,32 +8,10 @@ export * from './useAssetViewer'; export * from './useBlockAssets'; export * from './useBlockSettings'; export * from './useBlockTemplates'; -export * from './useBrandportalLink'; -export * from './useCategorizedDocumentPages'; -export * from './useColorPalettes'; -export * from './useColors'; -export * from './useCoverPage'; -export * from './useDocumentCategories'; -export * from './useDocumentGroups'; -export * from './useDocumentPageTargets'; -export * from './useDocumentSection'; -export * from './useDocumentTargets'; export * from './useEditorState'; export * from './useFileInput'; export * from './useFileUpload'; -export * from './useGroupedDocuments'; -export * from './useGuidelineActions'; -export * from './useLanguage'; -export * from './useNavigationManager'; -export * from './usePageTemplateSettings'; -export * from './usePlatformAppBridge'; export * from './usePrivacySettings'; export * from './useReadyForPrint'; -export * from './useTemplateAssets'; export * from './useTemplateChooser'; -export * from './useThemeAssets'; -export * from './useThemeSettings'; -export * from './useUncategorizedDocumentPages'; -export * from './useUngroupedDocuments'; -export * from './usePortalNavigation'; -export * from './useDocumentNavigation'; +export * from './useColorPalettes'; diff --git a/packages/app-bridge/src/react/useBlockAssets.spec.ts b/packages/app-bridge/src/react/useBlockAssets.spec.ts index 1338a1770..4ab11d203 100644 --- a/packages/app-bridge/src/react/useBlockAssets.spec.ts +++ b/packages/app-bridge/src/react/useBlockAssets.spec.ts @@ -1,7 +1,7 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ import { act, cleanup, renderHook, waitFor } from '@testing-library/react'; -import sinon, { type SinonStub } from 'sinon'; +import sinon from 'sinon'; import { type Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { AssetDummy, getAppBridgeBlockStub } from '../tests'; @@ -29,14 +29,34 @@ describe('useBlockAssets hook', () => { return { result, appBridgeStub, asset }; }; + it('should initialize block assets from context without calling getBlockAssets', () => { + const { result, appBridgeStub } = loadUseBlockAssets(); + + expect(result.current.blockAssets.key.map(({ id }) => id)).toEqual([1]); + sinon.assert.notCalled(appBridgeStub.getBlockAssets); + }); + + it('should fall back to empty assets when context does not provide assets', () => { + const appBridgeStub = getAppBridgeBlockStub({ + blockId: 123, + blockAssets: { key: [AssetDummy.with(1)] }, + }); + appBridgeStub.context.withArgs('assets').returns({ get: () => undefined, subscribe: () => () => undefined }); + + const { result } = renderHook(() => useBlockAssets(appBridgeStub)); + + expect(result.current.blockAssets).toStrictEqual({}); + sinon.assert.notCalled(appBridgeStub.getBlockAssets); + }); + it('should delete an asset', async () => { - const { result, appBridgeStub } = await loadUseBlockAssets(); + const { result, appBridgeStub } = loadUseBlockAssets(); await act(async () => { await result.current.deleteAssetIdsFromKey('key', [1]); }); const call = appBridgeStub.deleteAssetIdsFromBlockAssetKey.getCall(0); - waitFor(() => { + await waitFor(() => { expect(call.firstArg).toEqual('key'); expect(call.lastArg).toEqual([1]); expect(result.current.blockAssets).toStrictEqual({ key: [] }); @@ -44,7 +64,7 @@ describe('useBlockAssets hook', () => { }); it('should set assets', async () => { - const { result, appBridgeStub } = await loadUseBlockAssets([AssetDummy.with(1), AssetDummy.with(2)]); + const { result, appBridgeStub } = loadUseBlockAssets([AssetDummy.with(1), AssetDummy.with(2)]); await act(async () => { await result.current.updateAssetIdsFromKey('key', [2, 1]); @@ -60,7 +80,7 @@ describe('useBlockAssets hook', () => { }); it('should not sort assets if api call throws error', async () => { - const { result, appBridgeStub } = await loadUseBlockAssets([AssetDummy.with(1), AssetDummy.with(2)]); + const { result, appBridgeStub } = loadUseBlockAssets([AssetDummy.with(1), AssetDummy.with(2)]); (appBridgeStub.api as unknown as Mock) = vi.fn().mockImplementation(() => { return Promise.reject(new Error('Unsuccessful API call')); }); @@ -76,50 +96,51 @@ describe('useBlockAssets hook', () => { expect(console.error).toHaveBeenCalledOnce(); }); - it('should notify about updated assets on delete', async () => { - const { result, asset } = await loadUseBlockAssets(); - - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - - waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:BlockAssetsUpdated'); - expect(call.lastArg.blockId).toEqual(123); - expect(call.lastArg.prevBlockAssets).toMatchObject({ key: [asset] }); - expect(call.lastArg.blockAssets).toStrictEqual({ key: [] }); - }); - }); - it('should add asset ids', async () => { - const { result, appBridgeStub } = await loadUseBlockAssets(); + const { result, appBridgeStub } = loadUseBlockAssets(); await act(async () => { await result.current.addAssetIdsToKey('key', [2]); }); const call = appBridgeStub.addAssetIdsToBlockAssetKey.getCall(0); - waitFor(() => { + await waitFor(() => { expect(call.firstArg).toEqual('key'); expect(call.lastArg).toEqual([2]); expect(result.current.blockAssets.key.map(({ id }) => id)).toEqual([1, 2]); }); }); - it('should notify about updated assets on add asset ids to key', async () => { - const { result, asset } = await loadUseBlockAssets(); - const assetToAdd = AssetDummy.with(2); + it('does not fetch block assets after a mutation', async () => { + const { result, appBridgeStub } = loadUseBlockAssets(); + + await act(async () => { + await result.current.deleteAssetIdsFromKey('key', [1]); + }); + await act(async () => { + await result.current.addAssetIdsToKey('key', [2]); + }); await act(async () => { - await result.current.addAssetIdsToKey('key', [assetToAdd.id]); + await result.current.updateAssetIdsFromKey('key', [3]); }); - const call = (window.emitter.emit as SinonStub).getCall(0); - waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:BlockAssetsUpdated'); - expect(call.lastArg.blockId).toEqual(123); - expect(call.lastArg.blockAssets).toMatchObject({ key: [asset, assetToAdd] }); - expect(call.lastArg.prevBlockAssets).toMatchObject({ key: [asset] }); + sinon.assert.notCalled(appBridgeStub.getBlockAssets); + }); + + it('unsubscribes from Context.assets on unmount', () => { + const appBridgeStub = getAppBridgeBlockStub({ + blockId: 123, + blockAssets: { key: [AssetDummy.with(1)] }, + }); + const unsubscribe = sinon.spy(); + appBridgeStub.context.withArgs('assets').returns({ + get: () => ({}), + subscribe: () => unsubscribe, }); + + const { unmount } = renderHook(() => useBlockAssets(appBridgeStub)); + sinon.assert.notCalled(unsubscribe); + + unmount(); + sinon.assert.calledOnce(unsubscribe); }); }); diff --git a/packages/app-bridge/src/react/useBlockAssets.ts b/packages/app-bridge/src/react/useBlockAssets.ts index 824fb6219..853f62306 100644 --- a/packages/app-bridge/src/react/useBlockAssets.ts +++ b/packages/app-bridge/src/react/useBlockAssets.ts @@ -4,54 +4,18 @@ import { useEffect, useState } from 'react'; import { type AppBridgeBlock } from '../AppBridgeBlock'; import { type Asset } from '../types'; -import { compareObjects } from '../utilities'; export const useBlockAssets = (appBridge: AppBridgeBlock) => { - const blockId = appBridge.context('blockId').get(); + const [blockAssets, setBlockAssets] = useState>( + () => appBridge.context('assets').get() ?? {}, + ); - const [blockAssets, setBlockAssets] = useState>({}); - - const updateBlockAssetsFromEvent = (event: { - blockId: number; - blockAssets: Record; - prevBlockAssets: Record; - }) => { - if (event.blockId === blockId && !compareObjects(event.blockAssets, event.prevBlockAssets)) { - setBlockAssets(event.blockAssets); - } - }; - - // Fetch the block assets on mount. - // And add listener for block assets updates. useEffect(() => { - let componentMounted = true; - - if (blockId) { - const mountingFetch = async () => { - const allBlockAssets = await appBridge.getBlockAssets(); - if (componentMounted) { - setBlockAssets(allBlockAssets); - } - }; - mountingFetch(); - - window.emitter.on('AppBridge:BlockAssetsUpdated', updateBlockAssetsFromEvent); - } - - return () => { - componentMounted = false; - window.emitter.off('AppBridge:BlockAssetsUpdated', updateBlockAssetsFromEvent); - }; - // eslint-disable-next-line @eslint-react/exhaustive-deps - }, [appBridge]); - - const emitUpdatedBlockAssets = async () => { - window.emitter.emit('AppBridge:BlockAssetsUpdated', { - blockId, - blockAssets: await appBridge.getBlockAssets(), - prevBlockAssets: { ...blockAssets }, + setBlockAssets(appBridge.context('assets').get() ?? {}); + return appBridge.context('assets').subscribe((nextAssets) => { + setBlockAssets(nextAssets ?? {}); }); - }; + }, [appBridge]); const updateAssetIdsFromKey = async (key: string, newAssetIds: number[]) => { try { @@ -59,17 +23,14 @@ export const useBlockAssets = (appBridge: AppBridgeBlock) => { } catch (error) { console.error(error); } - emitUpdatedBlockAssets(); }; const deleteAssetIdsFromKey = async (key: string, assetIds: number[]) => { await appBridge.deleteAssetIdsFromBlockAssetKey(key, assetIds); - emitUpdatedBlockAssets(); }; const addAssetIdsToKey = async (key: string, assetIds: number[]) => { await appBridge.addAssetIdsToBlockAssetKey(key, assetIds); - emitUpdatedBlockAssets(); }; return { diff --git a/packages/app-bridge/src/react/useBrandportalLink.spec.ts b/packages/app-bridge/src/react/useBrandportalLink.spec.ts deleted file mode 100644 index 4912df23a..000000000 --- a/packages/app-bridge/src/react/useBrandportalLink.spec.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, renderHook } from '@testing-library/react'; -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { BrandportalLinkDummy, getAppBridgeThemeStub } from '../tests'; - -import { useBrandportalLink } from './useBrandportalLink'; - -describe('useBrandportalLink', () => { - afterEach(() => { - vi.restoreAllMocks(); - }); - - it('should return the brandportal link from appBridge', async () => { - const appBridge = getAppBridgeThemeStub(); - - const brandportalLink = BrandportalLinkDummy.with(); - appBridge.getBrandportalLink.resolves(brandportalLink); - - const { result } = renderHook(() => useBrandportalLink(appBridge)); - - expect(result.current.brandportalLink).toBe(null); - - await act(async () => { - await appBridge.getBrandportalLink(); - }); - - expect(result.current.brandportalLink).toEqual(brandportalLink); - }); - - it('should update the brandportal link when an event is emitted', () => { - const appBridge = getAppBridgeThemeStub(); - const { result } = renderHook(() => useBrandportalLink(appBridge)); - - const updatedBrandportalLink = BrandportalLinkDummy.with({ - label: 'Updated Brandportal Link', - }); - - act(() => { - window.emitter.emit('AppBridge:GuidelineBrandportalLink:Action', { - action: 'update', - brandportalLink: updatedBrandportalLink, - }); - }); - - expect(result.current.brandportalLink).toEqual(updatedBrandportalLink); - }); - - it('should not update the brandportal link when an event with an invalid action is emitted', () => { - const appBridge = getAppBridgeThemeStub(); - const { result } = renderHook(() => useBrandportalLink(appBridge)); - - result.current.brandportalLink = BrandportalLinkDummy.with(); - - act(() => { - window.emitter.emit('AppBridge:GuidelineBrandportalLink:Action', { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - action: 'invalid' as any, - brandportalLink: { enabled: false, label: '', url: '' }, - }); - }); - - expect(result.current.brandportalLink).toEqual(BrandportalLinkDummy.with()); - }); - - it('should start fetching only when it is enabled', () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getBrandportalLink'); - - let enabled = false; - - const { rerender } = renderHook(() => useBrandportalLink(appBridge, { enabled })); - - expect(spy).not.toBeCalled(); - - enabled = true; - rerender(); - - expect(spy).toBeCalled(); - }); - - it('should unregister when unmounted', () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(window.emitter, 'off'); - - const { unmount } = renderHook(() => useBrandportalLink(appBridge)); - - unmount(); - - expect(spy).toBeCalledWith('AppBridge:GuidelineBrandportalLink:Action', expect.any(Function)); - }); -}); diff --git a/packages/app-bridge/src/react/useBrandportalLink.ts b/packages/app-bridge/src/react/useBrandportalLink.ts deleted file mode 100644 index 296c622be..000000000 --- a/packages/app-bridge/src/react/useBrandportalLink.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type BrandportalLink, type EmitterAction } from '../types'; - -const defaultState: BrandportalLink = { - enabled: false, - label: '', - url: '', -}; - -export type UseBrandportalLinkReturnType = { - brandportalLink: Nullable; - isLoading: boolean; -}; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -export const useBrandportalLink = ( - appBridge: AppBridgeTheme, - options: Options = { enabled: true }, -): UseBrandportalLinkReturnType => { - const [brandportalLink, setBrandportalLink] = useState>(null); - const [isLoading, setIsLoading] = useState(true); - - useEffect(() => { - const fetchBrandportalLink = async () => { - setIsLoading(true); - setBrandportalLink(await appBridge.getBrandportalLink()); - setIsLoading(false); - }; - - if (options.enabled) { - fetchBrandportalLink().catch(console.error); - } - }, [appBridge, options.enabled]); - - useEffect(() => { - const updateBrandportalLinkFromEvent = (event: { - brandportalLink: Partial; - action: Extract; - }) => { - setBrandportalLink((previousState) => { - if (event.action === 'update') { - return { ...defaultState, ...previousState, ...event.brandportalLink }; - } - - return previousState; - }); - }; - - window.emitter.on('AppBridge:GuidelineBrandportalLink:Action', updateBrandportalLinkFromEvent); - - return () => { - window.emitter.off('AppBridge:GuidelineBrandportalLink:Action', updateBrandportalLinkFromEvent); - }; - }, [appBridge]); - - return { brandportalLink, isLoading }; -}; diff --git a/packages/app-bridge/src/react/useCategorizedDocumentPages.spec.ts b/packages/app-bridge/src/react/useCategorizedDocumentPages.spec.ts deleted file mode 100644 index dbad294bb..000000000 --- a/packages/app-bridge/src/react/useCategorizedDocumentPages.spec.ts +++ /dev/null @@ -1,366 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { DocumentPageDummy, getAppBridgeThemeStub } from '../tests'; -import { type DocumentPage } from '../types'; - -import { useCategorizedDocumentPages } from './useCategorizedDocumentPages'; - -const DOCUMENT_CATEGORY_ID = 23455; -const ANOTHER_DOCUMENT_CATEGORY_ID = 4534656; -const DOCUMENT_PAGE_ID_1 = 23442; -const DOCUMENT_PAGE_ID_2 = 235345; -const DOCUMENT_PAGE_ID_3 = 12352; -const DOCUMENT_PAGE_ID_4 = 55221; -const DOCUMENT_PAGE_ID_5 = 34556; - -describe('useCategorizedDocumentPages', () => { - afterEach(() => { - vi.resetAllMocks(); - }); - - it('should fetch document pages on mount', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledTimes(1); - expect(spy).toHaveBeenCalledWith(DOCUMENT_CATEGORY_ID); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.documentPages).toEqual([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID, sort: 1 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID, sort: 2 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID, sort: 3 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID, sort: 4 }), - ]); - }); - }); - - it('should not fetch document pages on mount if not enabled', () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const { result } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID, { enabled: false }), - ); - - expect(result.current.isLoading).toBe(true); - expect(spy).not.toHaveBeenCalled(); - expect(result.current.documentPages).toEqual([]); - }); - - it('should fetch document pages if it gets enabled', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - let enabled = false; - - const { result, rerender } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID, { enabled }), - ); - - expect(result.current.isLoading).toBe(true); - expect(spy).not.toHaveBeenCalled(); - expect(result.current.documentPages).toEqual([]); - - enabled = true; - - rerender(); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalled(); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.documentPages).toEqual([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID, sort: 1 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID, sort: 2 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID, sort: 3 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID, sort: 4 }), - ]); - }); - }); - - it('should update document pages if a page is added in the category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_5, - categoryId: DOCUMENT_CATEGORY_ID, - }); - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Mock the response of the second call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_5, categoryId: DOCUMENT_CATEGORY_ID }), - ]), - ); - - // Trigger a "document page added" event in the specified category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'add', - documentPage: DOCUMENT_PAGE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledTimes(2); - }); - - expect(result.current.documentPages).toEqual([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_5, categoryId: DOCUMENT_CATEGORY_ID }), - ]); - }); - - it('should not update the document pages if a page is added in another category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: ANOTHER_DOCUMENT_CATEGORY_ID, - }); - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document page added" event from another category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'add', - documentPage: DOCUMENT_PAGE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - }); - - it('should update document pages if a page is removed from the category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - categoryId: DOCUMENT_CATEGORY_ID, - }); - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document page deleted" event in the specified category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'delete', - documentPage: { - id: DOCUMENT_PAGE.id, - documentId: DOCUMENT_PAGE.documentId, - categoryId: DOCUMENT_PAGE.categoryId, - }, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentPages).toEqual([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID, sort: 2 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID, sort: 3 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID, sort: 4 }), - ]); - }); - - it('should not update the document pages if a page is removed from another category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_5, - documentId: ANOTHER_DOCUMENT_CATEGORY_ID, - }); - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document page deleted" event from another category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'delete', - documentPage: { - id: DOCUMENT_PAGE.id, - documentId: DOCUMENT_PAGE.documentId, - categoryId: DOCUMENT_PAGE.categoryId, - }, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - - it('should update document pages if a page is updated in the category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const UPDATED_DOCUMENT_PAGE: DocumentPage = { - ...DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID }), - title: 'Updated title', - }; - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Mock the response of the second call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID }), - UPDATED_DOCUMENT_PAGE, - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID }), - ]), - ); - - // Trigger a "document page updated" event in the specified category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'update', - documentPage: UPDATED_DOCUMENT_PAGE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledTimes(2); - }); - - expect(result.current.documentPages).toEqual([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID }), - UPDATED_DOCUMENT_PAGE, - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID }), - ]); - }); - - it('should not update the document pages if a page is updated in another category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const UPDATED_DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_5, - documentId: ANOTHER_DOCUMENT_CATEGORY_ID, - }); - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document page updated" event from another category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'update', - documentPage: UPDATED_DOCUMENT_PAGE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - - it('should update document pages if a page is moved in the category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - - const UPDATED_DOCUMENT_PAGE: DocumentPage = { - ...DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID }), - sort: 4, - }; - - const { result } = renderHook(() => useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Mock the response of the second call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID, sort: 1 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID, sort: 2 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID, sort: 3 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID, sort: 4 }), - ]), - ); - - // Trigger a "document page updated" event in the specified category - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'move', - documentPage: UPDATED_DOCUMENT_PAGE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentPages).toEqual([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID, sort: 1 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID, sort: 3 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID, sort: 4 }), - UPDATED_DOCUMENT_PAGE, - ]); - }); -}); diff --git a/packages/app-bridge/src/react/useCategorizedDocumentPages.ts b/packages/app-bridge/src/react/useCategorizedDocumentPages.ts deleted file mode 100644 index 681b6c5a2..000000000 --- a/packages/app-bridge/src/react/useCategorizedDocumentPages.ts +++ /dev/null @@ -1,175 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type DocumentPage, type EmitterEvents } from '../types'; - -import { type DocumentPageTargetEvent } from './useDocumentPageTargets'; - -type DocumentPagesMoveEvent = EmitterEvents['AppBridge:GuidelineDocumentPage:MoveEvent']; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -const sortDocumentPages = (a: DocumentPage, b: DocumentPage) => (a.sort && b.sort ? a.sort - b.sort : 0); - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useCategorizedDocumentPages = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - documentCategoryId: number, - options: Options = { enabled: true }, -) => { - // eslint-disable-next-line @eslint-react/use-state - const [documentPages, setDocumentPages] = useState>(new Map([])); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setDocumentPages(await fetchDocumentPagesByDocumentCategoryId(appBridge, documentCategoryId)); - setIsLoading(false); - }, [appBridge, documentCategoryId]); - - useEffect(() => { - if (options.enabled) { - refetch(); - } - }, [options.enabled, refetch]); - - useEffect(() => { - const refetchIfPageExistsInMap = (event: DocumentPageTargetEvent) => { - for (const id of event.payload.pageIds) { - if (documentPages.has(id)) { - refetch(); - break; - } - } - }; - - const handleDocumentPageMoveEvent = (event: DocumentPagesMoveEvent) => { - if (!documentPages.has(event.documentPage.id) || !event.categoryId) { - return; - } - - setDocumentPages( - produce((draft) => { - previewDocumentPagesSort(draft, event.documentPage, event.position); - }), - ); - }; - - const handler = ({ action, documentPage }: EmitterEvents['AppBridge:GuidelineDocumentPage:Action']) => { - if ( - (action === 'update' && documentPages.has(documentPage.id)) || - (action === 'add' && documentPage.categoryId === documentCategoryId) - ) { - refetch(); - } else if ((action === 'delete' || action === 'move') && documentPages.has(documentPage.id)) { - setDocumentPages( - produce((draft) => { - if (action === 'move') { - moveDocumentPage(draft, documentPage); - } else if (action === 'delete') { - draft.delete(documentPage.id); - } - }), - ); - } - }; - - window.emitter.on('AppBridge:GuidelineDocumentPage:Action', handler); - window.emitter.on('AppBridge:GuidelineDocumentPageTargets:Action', refetchIfPageExistsInMap); - window.emitter.on('AppBridge:GuidelineDocumentPage:MoveEvent', handleDocumentPageMoveEvent); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentPage:Action', handler); - window.emitter.off('AppBridge:GuidelineDocumentPageTargets:Action', refetchIfPageExistsInMap); - window.emitter.off('AppBridge:GuidelineDocumentPage:MoveEvent', handleDocumentPageMoveEvent); - }; - }, [documentCategoryId, refetch, documentPages]); - - return { documentPages: Array.from(documentPages.values()), refetch, isLoading }; -}; - -const previewDocumentPagesSort = ( - documentPages: Map, - documentPage: DocumentPagesMoveEvent['documentPage'], - newPosition: DocumentPagesMoveEvent['position'], -) => { - if (!documentPage.sort || !newPosition) { - return documentPages; - } - - const previousDocumentPage = documentPages.get(documentPage.id); - const documentPagesAsArray: DocumentPage[] = [...documentPages.values()].sort(sortDocumentPages); - - documentPages.clear(); - - let sort = 1; - let isOnLastPosition = true; - for (const currentDocumentPage of documentPagesAsArray) { - if (currentDocumentPage.id === documentPage.id) { - continue; - } - - if (previousDocumentPage && sort === newPosition) { - documentPages.set(documentPage.id, { ...previousDocumentPage, sort: newPosition }); - isOnLastPosition = false; - } - - documentPages.set(currentDocumentPage.id, { - ...currentDocumentPage, - sort, - }); - - sort++; - } - - if (previousDocumentPage && isOnLastPosition) { - documentPages.set(documentPage.id, { ...previousDocumentPage, sort }); - } - - return documentPages; -}; - -const moveDocumentPage = (draft: Map, documentPage: DocumentPage) => { - const documentPagesAsArray: DocumentPage[] = [...draft.values()]; - let isPageOnLastPosition = true; - - draft.clear(); - - for (const currentDocumentPage of documentPagesAsArray) { - if (currentDocumentPage.id === documentPage.id) { - continue; - } - if (draft.size === documentPage.sort - 1) { - draft.set(documentPage.id, documentPage); - isPageOnLastPosition = false; - } - - draft.set(currentDocumentPage.id, currentDocumentPage); - } - - if (isPageOnLastPosition) { - draft.set(documentPage.id, documentPage); - } - - return draft; -}; - -const fetchDocumentPagesByDocumentCategoryId = async ( - appBridge: AppBridgeBlock | AppBridgeTheme, - documentCategoryId: number, -) => { - const pages = await appBridge.getDocumentPagesByDocumentCategoryId(documentCategoryId); - return new Map([...pages].sort(sortDocumentPages).map((page) => [page.id, page])); -}; diff --git a/packages/app-bridge/src/react/useColorPalettes.ts b/packages/app-bridge/src/react/useColorPalettes.ts index 707379f08..0c41d055d 100644 --- a/packages/app-bridge/src/react/useColorPalettes.ts +++ b/packages/app-bridge/src/react/useColorPalettes.ts @@ -3,14 +3,10 @@ import { useEffect, useState } from 'react'; import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type ColorPalette, type ColorPaletteCreate, type ColorPalettePatch } from '../types'; -import { compareObjects } from '../utilities'; +import { type ColorPalette } from '../types'; export type UseColorPalettesReturnType = { colorPalettes: ColorPalette[]; - createColorPalette: (colorPaletteCreate: ColorPaletteCreate) => void; - updateColorPalette: (colorPaletteId: number, colorPalettePatch: ColorPalettePatch) => void; - deleteColorPalette: (colorPaletteId: number) => void; downloadColorKit: (selectedColorPalettes: number[]) => string; }; @@ -19,16 +15,6 @@ export const useColorPalettes = (appBridge: AppBridgeBlock, colorPaletteIds?: nu const [colorPalettes, setColorPalettes] = useState([]); - const updateColorsPalettesFromEvent = (event: { - blockId: number; - colorPalettes: ColorPalette[]; - prevColorPalettes: ColorPalette[]; - }) => { - if (event.blockId === blockId && !compareObjects(event.colorPalettes, event.prevColorPalettes)) { - setColorPalettes(event.colorPalettes); - } - }; - useEffect(() => { let componentMounted = true; @@ -40,55 +26,20 @@ export const useColorPalettes = (appBridge: AppBridgeBlock, colorPaletteIds?: nu } }; mountingFetch(); - - window.emitter.on('AppBridge:ColorPalettesUpdated', updateColorsPalettesFromEvent); } return () => { componentMounted = false; - window.emitter.off('AppBridge:ColorPalettesUpdated', updateColorsPalettesFromEvent); }; // eslint-disable-next-line @eslint-react/exhaustive-deps }, [appBridge, blockId, colorPaletteIds]); - const emitUpdatedColorPalettes = async () => { - window.emitter.emit('AppBridge:ColorPalettesUpdated', { - blockId, - colorPalettes: await appBridge.getColorPalettesWithColors(colorPaletteIds), - prevColorPalettes: { ...colorPalettes }, - }); - }; - - const createColorPalette = async (colorPaletteCreate: ColorPaletteCreate) => { - await appBridge.createColorPalette(colorPaletteCreate); - - emitUpdatedColorPalettes(); - }; - - const updateColorPalette = async (colorPaletteId: number, colorPalettePatch: ColorPalettePatch) => { - await appBridge.updateColorPalette(colorPaletteId, colorPalettePatch); - - emitUpdatedColorPalettes(); - }; - - const deleteColorPalette = async (colorPaletteId: number) => { - await appBridge.deleteColorPalette(colorPaletteId); - - emitUpdatedColorPalettes(); - }; - const downloadColorKit = (selectedColorPalettes: number[]) => { return appBridge.downloadColorKit(selectedColorPalettes); }; return { colorPalettes, - /** @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` */ - createColorPalette, - /** @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` */ - updateColorPalette, - /** @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` */ - deleteColorPalette, downloadColorKit, }; }; diff --git a/packages/app-bridge/src/react/useColors.spec.ts b/packages/app-bridge/src/react/useColors.spec.ts deleted file mode 100644 index 361ede18c..000000000 --- a/packages/app-bridge/src/react/useColors.spec.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { describe, expect, it, vi } from 'vitest'; - -import { ColorDummy, getAppBridgeBlockStub } from '../tests'; - -import { useColors } from './useColors'; - -const COLOR_PALETTE_ID = 1; - -describe('useColors hook', () => { - const loadUseColors = () => { - const appBridgeStub = getAppBridgeBlockStub(); - const { result } = renderHook(() => useColors(appBridgeStub, COLOR_PALETTE_ID)); - - return { result }; - }; - - it('should get all the colors of a palette', async () => { - const { result } = await loadUseColors(); - - waitFor(() => - expect(result.current.colorsByPaletteId).toEqual([ - ColorDummy.red(9834), - ColorDummy.yellow(9314), - ColorDummy.green(342), - ]), - ); - }); - - it('should not throw createColor', async () => { - const { result } = await loadUseColors(); - - const createColorMock = vi.fn().mockImplementation(result.current.createColor); - - await expect(createColorMock()).resolves.not.toThrow(); - }); - - it('should not throw updateColor', async () => { - const { result } = await loadUseColors(); - - const updateColorMock = vi.fn().mockImplementation(result.current.updateColor); - - await expect(updateColorMock()).resolves.not.toThrow(); - }); - - it('should not throw deleteColor', async () => { - const { result } = await loadUseColors(); - - const deleteColorMock = vi.fn().mockImplementation(result.current.deleteColor); - - await expect(deleteColorMock()).resolves.not.toThrow(); - }); -}); diff --git a/packages/app-bridge/src/react/useColors.ts b/packages/app-bridge/src/react/useColors.ts deleted file mode 100644 index 8fcfff1de..000000000 --- a/packages/app-bridge/src/react/useColors.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type Color, type ColorCreate, type ColorPatch } from '../types'; -import { compareObjects } from '../utilities'; - -export type UseColorsReturnType = { - colorsByPaletteId: Color[]; - createColor: (colorCreate: ColorCreate) => void; - updateColor: (colorId: number, colorPatch: ColorPatch) => void; - deleteColor: (colorId: number) => void; -}; - -export const useColors = (appBridge: AppBridgeBlock, colorPaletteId: number): UseColorsReturnType => { - const blockId = appBridge.context('blockId').get(); - - const [colorsByPaletteId, setColorsByPaletteId] = useState([]); - - useEffect(() => { - let componentMounted = true; - - const updateColorsFromEvent = (event: { blockId: number; colors: Color[]; prevColors: Color[] }) => { - if (event.blockId === blockId && !compareObjects(event.colors, event.prevColors)) { - const sortedColors = [...event.colors].sort((a, b) => a.sort - b.sort); - setColorsByPaletteId(sortedColors); - } - }; - - if (blockId) { - const mountingFetch = async () => { - const allColors = await appBridge.getColorsByColorPaletteId(colorPaletteId); - if (componentMounted) { - const sortedColors = [...allColors].sort((a, b) => a.sort - b.sort); - setColorsByPaletteId(sortedColors); - } - }; - mountingFetch(); - - window.emitter.on('AppBridge:ColorsUpdated', updateColorsFromEvent); - } - - return () => { - componentMounted = false; - window.emitter.off('AppBridge:ColorsUpdated', updateColorsFromEvent); - }; - }, [appBridge, blockId, colorPaletteId]); - - const emitUpdatedColors = async () => { - window.emitter.emit('AppBridge:ColorsUpdated', { - blockId, - colors: await appBridge.getColorsByColorPaletteId(colorPaletteId), - prevColors: { ...colorsByPaletteId }, - }); - }; - - const createColor = async (colorCreate: ColorCreate) => { - await appBridge.createColor(colorCreate); - - emitUpdatedColors(); - }; - - const updateColor = async (colorId: number, colorPatch: ColorPatch) => { - await appBridge.updateColor(colorId, colorPatch); - - emitUpdatedColors(); - }; - - const deleteColor = async (colorId: number) => { - await appBridge.deleteColor(colorId); - - emitUpdatedColors(); - }; - - return { - colorsByPaletteId, - createColor, - updateColor, - deleteColor, - }; -}; diff --git a/packages/app-bridge/src/react/useCoverPage.spec.ts b/packages/app-bridge/src/react/useCoverPage.spec.ts deleted file mode 100644 index 7659e3d3e..000000000 --- a/packages/app-bridge/src/react/useCoverPage.spec.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, renderHook, waitFor } from '@testing-library/react'; -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { CoverPageDummy, getAppBridgeThemeStub } from '../tests'; -import { type CoverPage, type CoverPageUpdate } from '../types'; - -import { useCoverPage } from './useCoverPage'; - -describe('useCoverPage', () => { - afterEach(() => { - vi.restoreAllMocks(); - }); - - it('should return the cover page from appBridge', async () => { - const appBridge = getAppBridgeThemeStub(); - - const coverPage = CoverPageDummy.with(1); - appBridge.getCoverPage.resolves(coverPage); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - const { result } = renderHook(() => useCoverPage(appBridge)); - - expect(result.current.coverPage).toBe(null); - - await act(async () => { - await appBridge.getCoverPage(); - }); - - expect(result.current.coverPage).toEqual(coverPage); - }); - - it('should create the cover page when an event is emitted', async () => { - const appBridge = getAppBridgeThemeStub(); - - const coverPage = CoverPageDummy.with(243); - appBridge.getCoverPage.resolves(coverPage); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - const { result } = renderHook(() => useCoverPage(appBridge)); - - act(() => { - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { - action: 'add', - coverPage, - }); - }); - - await waitFor(() => expect(result.current.coverPage).toEqual(coverPage)); - }); - - it('should update the cover page when an event is emitted', () => { - const appBridge = getAppBridgeThemeStub(); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - const { result } = renderHook(() => useCoverPage(appBridge)); - - const updatedCoverPage: CoverPageUpdate = { id: 1, title: 'Updated Cover Page' }; - - act(() => { - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { - action: 'update', - coverPage: updatedCoverPage as CoverPage, - }); - }); - - expect(result.current.coverPage).toEqual(updatedCoverPage); - }); - - it('should set the cover page to null when an event to delete it is emitted', () => { - const appBridge = getAppBridgeThemeStub(); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - const { result } = renderHook(() => useCoverPage(appBridge)); - - result.current.coverPage = null; - - act(() => { - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { action: 'delete' }); - }); - - expect(result.current.coverPage).toBe(null); - }); - - it('should not update the cover page when an event with an invalid action is emitted', () => { - const appBridge = getAppBridgeThemeStub(); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - const { result } = renderHook(() => useCoverPage(appBridge)); - - result.current.coverPage = CoverPageDummy.with(1); - - act(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { action: 'invalid' as any }); - }); - - expect(result.current.coverPage).toEqual(CoverPageDummy.with(1)); - }); - - it('should start fetching only when it is enabled', () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getCoverPage'); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - let enabled = false; - - const { rerender } = renderHook(() => useCoverPage(appBridge, { enabled })); - - expect(spy).not.toBeCalled(); - - enabled = true; - rerender(); - - expect(spy).toBeCalled(); - }); -}); diff --git a/packages/app-bridge/src/react/useCoverPage.ts b/packages/app-bridge/src/react/useCoverPage.ts deleted file mode 100644 index 61d19f367..000000000 --- a/packages/app-bridge/src/react/useCoverPage.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type CoverPage, type EmitterAction } from '../types'; - -export type UseCoverPageReturnType = { - coverPage: Nullable; - isLoading: boolean; -}; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -export const useCoverPage = ( - appBridge: AppBridgeTheme, - options: Options = { enabled: true }, -): UseCoverPageReturnType => { - const [coverPage, setCoverPage] = useState>(null); - const [isLoading, setIsLoading] = useState(true); - - const fetchCoverPage = useCallback(async () => { - setIsLoading(true); - setCoverPage(await appBridge.getCoverPage()); - setIsLoading(false); - }, [appBridge]); - - useEffect(() => { - if (options.enabled) { - fetchCoverPage().catch(console.error); - } - }, [appBridge, fetchCoverPage, options.enabled]); - - useEffect(() => { - const updateCoverPageFromEvent = (event: { action: EmitterAction; coverPage?: CoverPage }) => { - if (event.action === 'add') { - fetchCoverPage().catch(console.error); - return; - } - - setCoverPage((previousState) => { - if (event.action === 'delete') { - return null; - } - - if (event.action === 'update' && event.coverPage) { - return { ...previousState, ...event.coverPage }; - } - - return previousState; - }); - }; - - window.emitter.on('AppBridge:GuidelineCoverPage:Action', updateCoverPageFromEvent); - - return () => { - window.emitter.off('AppBridge:GuidelineCoverPage:Action', updateCoverPageFromEvent); - }; - }, [appBridge, fetchCoverPage]); - - return { coverPage, isLoading }; -}; diff --git a/packages/app-bridge/src/react/useDocumentCategories.spec.ts b/packages/app-bridge/src/react/useDocumentCategories.spec.ts deleted file mode 100644 index d1086e039..000000000 --- a/packages/app-bridge/src/react/useDocumentCategories.spec.ts +++ /dev/null @@ -1,452 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { DocumentCategoryDummy, getAppBridgeThemeStub } from '../tests'; -import { type DocumentCategory } from '../types'; - -import { useDocumentCategories } from './useDocumentCategories'; - -const DOCUMENT_ID = 345345; -const ANOTHER_DOCUMENT_ID = 76685; -const DOCUMENT_CATEGORY_ID_1 = 147; -const DOCUMENT_CATEGORY_ID_2 = 258; -const DOCUMENT_CATEGORY_ID_3 = 369; -const DOCUMENT_CATEGORY_ID_4 = 3456; -const DOCUMENT_PAGE_ID = 234; - -describe('useDocumentCategories', () => { - afterEach(() => { - vi.resetAllMocks(); - }); - - it('should fetch document categories on mount', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledTimes(1); - expect(spy).toHaveBeenCalledWith(DOCUMENT_ID); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - }); - - it('should not fetch document categories on mount if not enabled', () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID, { enabled: false })); - - expect(result.current.isLoading).toBe(true); - expect(spy).not.toHaveBeenCalled(); - expect(result.current.documentCategories).toEqual([]); - }); - - it('should fetch document categories if it gets enabled', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - let enabled = false; - - const { result, rerender } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID, { enabled })); - - expect(result.current.isLoading).toBe(true); - expect(spy).not.toHaveBeenCalled(); - expect(result.current.documentCategories).toEqual([]); - - enabled = true; - - rerender(); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalled(); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - }); - - it('should update document categories if a category is added', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const DOCUMENT_CATEGORY = DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages( - DOCUMENT_CATEGORY_ID_4, - DOCUMENT_ID, - 5, - ); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Mock the response of the second call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - DOCUMENT_CATEGORY, - ]), - ); - - // Trigger a "document category added" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - action: 'add', - documentCategory: DOCUMENT_CATEGORY, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledTimes(2); - }); - - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - DOCUMENT_CATEGORY, - ]); - }); - - it('should not update document categories if a category is added to another document', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const DOCUMENT_CATEGORY = DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages( - DOCUMENT_CATEGORY_ID_4, - ANOTHER_DOCUMENT_ID, - 5, - ); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document category added" event from another document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - action: 'add', - documentCategory: DOCUMENT_CATEGORY, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - - it('should not update document categories if a category is removed from another document', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const DOCUMENT_CATEGORY_TO_DELETE = DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages( - DOCUMENT_CATEGORY_ID_4, - ANOTHER_DOCUMENT_ID, - 5, - ); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document category delete" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - action: 'delete', - documentCategory: { - id: DOCUMENT_CATEGORY_TO_DELETE.id, - documentId: DOCUMENT_CATEGORY_TO_DELETE.documentId, - }, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - - it('should update document categories if a category is updated', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const DOCUMENT_CATEGORY_TO_UPDATE: DocumentCategory = { - ...DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 5), - title: 'Updated title', - }; - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Mock the response of the second call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DOCUMENT_CATEGORY_TO_UPDATE, - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]), - ); - - // Trigger a "document category update" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - action: 'update', - documentCategory: DOCUMENT_CATEGORY_TO_UPDATE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledTimes(2); - }); - - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DOCUMENT_CATEGORY_TO_UPDATE, - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - - it('should not update document categories if a category is updated from another document', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const DOCUMENT_CATEGORY_TO_UPDATE: DocumentCategory = { - ...DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages( - DOCUMENT_CATEGORY_ID_4, - ANOTHER_DOCUMENT_ID, - 5, - ), - title: 'Updated title', - }; - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - - // Trigger a "document category update" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - action: 'update', - documentCategory: DOCUMENT_CATEGORY_TO_UPDATE, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - - it('should update document categories number if a document page is added to a category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - - // Trigger a "document page add" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - action: 'add', - documentPage: { id: DOCUMENT_PAGE_ID, categoryId: DOCUMENT_CATEGORY_ID_2 }, - }); - - await waitFor(() => { - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 1), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - }); - - it('should not update document categories if a document page is added to another category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - - // Trigger a "document page add" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - action: 'add', - documentPage: { id: DOCUMENT_PAGE_ID, categoryId: DOCUMENT_CATEGORY_ID_4 }, - }); - - await waitFor(() => { - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - }); - - it('should update document categories if a document page is removed from a category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - - // Trigger a "document page delete" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - action: 'delete', - documentPage: { id: DOCUMENT_PAGE_ID, categoryId: DOCUMENT_CATEGORY_ID_3 }, - }); - - await waitFor(() => { - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 1), - ]); - }); - }); - - it('should not update document categories if a document page is removed from another category', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - - // Trigger a "document page delete" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - action: 'delete', - documentPage: { id: DOCUMENT_PAGE_ID, categoryId: DOCUMENT_CATEGORY_ID_4 }, - }); - - await waitFor(() => { - expect(result.current.documentCategories).toEqual([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - ]); - }); - }); - - it('should update document categories sort if a category is moved', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - - const CATEGORY_1 = DocumentCategoryDummy.withFields({ - ...DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, DOCUMENT_ID, 2), - sort: 1, - }); - const CATEGORY_2 = DocumentCategoryDummy.withFields({ - ...DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, DOCUMENT_ID, 2), - sort: 2, - }); - const CATEGORY_3 = DocumentCategoryDummy.withFields({ - ...DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, DOCUMENT_ID, 2), - sort: 3, - }); - const NEW_CATEGORY_3 = DocumentCategoryDummy.withFields({ - ...CATEGORY_3, - sort: 2, - }); - - spy.mockImplementationOnce(() => Promise.resolve([CATEGORY_1, CATEGORY_2, CATEGORY_3])); - - const { result } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - await waitFor(() => expect(result.current.isLoading).toBe(false)); - expect(result.current.documentCategories).toEqual([CATEGORY_1, CATEGORY_2, CATEGORY_3]); - - window.emitter.emit('AppBridge:GuidelineDocumentCategory:MoveEvent', { - action: 'movePreview', - documentCategory: { id: DOCUMENT_CATEGORY_ID_3, documentId: DOCUMENT_ID, sort: 3 }, - documentId: DOCUMENT_ID, - position: 2, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - }); - - expect(result.current.documentCategories).toEqual([CATEGORY_1, NEW_CATEGORY_3, CATEGORY_2]); - }); -}); diff --git a/packages/app-bridge/src/react/useDocumentCategories.ts b/packages/app-bridge/src/react/useDocumentCategories.ts deleted file mode 100644 index 8579cff9b..000000000 --- a/packages/app-bridge/src/react/useDocumentCategories.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type DocumentCategory, type EmitterEvents } from '../types'; - -type DocumentPageEvent = EmitterEvents['AppBridge:GuidelineDocumentCategory:DocumentPageAction']; -type DocumentCategoryMoveEvent = EmitterEvents['AppBridge:GuidelineDocumentCategory:MoveEvent']; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -const sortDocumentCategories = (a: DocumentCategory, b: DocumentCategory) => (a.sort && b.sort ? a.sort - b.sort : 0); - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this hook. - */ -export const useDocumentCategories = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - documentId: number, - options: Options = { enabled: true }, -) => { - // eslint-disable-next-line @eslint-react/use-state - const [documentCategories, setDocumentCategories] = useState>(new Map([])); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setDocumentCategories(await fetchDocumentCategories(appBridge, documentId)); - setIsLoading(false); - }, [appBridge, documentId]); - - useEffect(() => { - if (options.enabled) { - refetch(); - } - }, [refetch, options.enabled]); - - useEffect(() => { - const handleDocumentPageEvent = ( - event: EmitterEvents['AppBridge:GuidelineDocumentCategory:DocumentPageAction'], - ) => { - if (!documentCategories.has(event.documentPage.categoryId)) { - return; - } - - setDocumentCategories( - produce((draft) => { - const action = `${event.action}-page` as const; - const handler = actionHandlers[action] || actionHandlers.default; - return handler(draft, event.documentPage); - }), - ); - }; - - const handleDocumentCategoryMoveEvent = (event: DocumentCategoryMoveEvent) => { - if (!documentCategories.has(event.documentCategory.id)) { - return; - } - - setDocumentCategories( - produce((draft) => { - previewDocumentCategorySort(draft, event.documentCategory, event.position); - }), - ); - }; - - const handler = ({ action, documentCategory }: EmitterEvents['AppBridge:GuidelineDocumentCategory:Action']) => { - if ( - (action === 'update' && documentCategories.has(documentCategory.id)) || - (action === 'add' && documentCategory.documentId === documentId) - ) { - refetch(); - } else if (action === 'delete' && documentCategories.has(documentCategory.id)) { - setDocumentCategories( - produce((draft) => { - draft.delete(documentCategory.id); - }), - ); - } - }; - - window.emitter.on('AppBridge:GuidelineDocumentCategory:Action', handler); - window.emitter.on('AppBridge:GuidelineDocumentCategory:DocumentPageAction', handleDocumentPageEvent); - window.emitter.on('AppBridge:GuidelineDocumentCategory:MoveEvent', handleDocumentCategoryMoveEvent); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentCategory:Action', handler); - window.emitter.off('AppBridge:GuidelineDocumentCategory:DocumentPageAction', handleDocumentPageEvent); - window.emitter.off('AppBridge:GuidelineDocumentCategory:MoveEvent', handleDocumentCategoryMoveEvent); - }; - }, [documentCategories, documentId, refetch]); - - return { documentCategories: Array.from(documentCategories.values()), refetch, isLoading }; -}; - -const previewDocumentCategorySort = ( - documentCategories: Map, - documentCategory: DocumentCategoryMoveEvent['documentCategory'], - newPosition: DocumentCategoryMoveEvent['position'], -) => { - if (!documentCategory.sort || !newPosition) { - return documentCategories; - } - - const previousCategory = documentCategories.get(documentCategory.id); - const documentCategoriesAsArray: DocumentCategory[] = [...documentCategories.values()].sort(sortDocumentCategories); - - documentCategories.clear(); - - let sort = 1; - let isOnLastPosition = true; - for (const currentDocumentCategory of documentCategoriesAsArray) { - if (currentDocumentCategory.id === documentCategory.id) { - continue; - } - - if (previousCategory && sort === newPosition) { - documentCategories.set(documentCategory.id, { ...previousCategory, sort: newPosition }); - isOnLastPosition = false; - } - - documentCategories.set(currentDocumentCategory.id, { - ...currentDocumentCategory, - sort, - }); - - sort++; - } - - if (previousCategory && isOnLastPosition) { - documentCategories.set(documentCategory.id, { ...previousCategory, sort }); - } - - return documentCategories; -}; - -const addDocumentPage = ( - documentCategories: Map, - documentPageToAdd: DocumentPageEvent['documentPage'], -) => { - if (!documentPageToAdd.categoryId) { - return documentCategories; - } - - const documentCategory = documentCategories.get(documentPageToAdd.categoryId); - if (!documentCategory) { - return documentCategories; - } - - const newDocumentCategory = { - ...documentCategory, - numberOfDocumentPages: documentCategory.numberOfDocumentPages + 1, - }; - - return documentCategories.set(documentCategory.id, newDocumentCategory); -}; - -const deleteDocumentPage = ( - documentCategories: Map, - documentPageToDelete: DocumentPageEvent['documentPage'], -) => { - if (!documentPageToDelete.categoryId) { - return documentCategories; - } - - const documentCategory = documentCategories.get(documentPageToDelete.categoryId); - if (!documentCategory) { - return documentCategories; - } - - const newDocumentCategory = { - ...documentCategory, - numberOfDocumentPages: documentCategory.numberOfDocumentPages - 1, - }; - - return documentCategories.set(documentCategory.id, newDocumentCategory); -}; - -const actionHandlers = { - 'add-page': addDocumentPage, - 'delete-page': deleteDocumentPage, - default: (documentCategories: Map) => documentCategories, -}; - -const fetchDocumentCategories = async (appBridge: AppBridgeBlock | AppBridgeTheme, documentId: number) => { - const categories = await appBridge.getDocumentCategoriesByDocumentId(documentId); - return new Map([...categories].sort(sortDocumentCategories).map((category) => [category.id, category])); -}; diff --git a/packages/app-bridge/src/react/useDocumentGroups.ts b/packages/app-bridge/src/react/useDocumentGroups.ts deleted file mode 100644 index f883ecb0b..000000000 --- a/packages/app-bridge/src/react/useDocumentGroups.ts +++ /dev/null @@ -1,224 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type DocumentGroup, type EmitterEvents } from '../types'; - -type DocumentGroupDocumentEvent = EmitterEvents['AppBridge:GuidelineDocumentGroup:DocumentAction']; -type DocumentEvent = EmitterEvents['AppBridge:GuidelineDocument:Action']; -type DocumentMoveEvent = EmitterEvents['AppBridge:GuidelineDocument:MoveEvent']; -type DocumentGroupMoveEvent = EmitterEvents['AppBridge:GuidelineDocumentGroup:MoveEvent']; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -const sortDocumentGroups = (a: DocumentGroup, b: DocumentGroup) => (a.sort && b.sort ? a.sort - b.sort : 0); - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useDocumentGroups = (appBridge: AppBridgeBlock | AppBridgeTheme, options: Options = { enabled: true }) => { - // eslint-disable-next-line @eslint-react/use-state - const [documentGroups, setDocumentGroups] = useState>(new Map([])); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setDocumentGroups(await fetchDocumentGroups(appBridge)); - setIsLoading(false); - }, [appBridge]); - - useEffect(() => { - if (options.enabled) { - refetch(); - } - }, [options.enabled, refetch]); - - useEffect(() => { - const handleDocumentEventUpdates = (event: DocumentGroupDocumentEvent) => { - setDocumentGroups( - produce((draft) => { - const action = `${event.action}-document` as const; - const handler = actionHandlers[action] || actionHandlers.default; - return handler(draft, event.document); - }), - ); - }; - - // handles when a document is moved from/in a document group, refetches for updated positioning - const handlerDocumentMoveEvent = (event: DocumentEvent) => { - if ((event?.action === 'move' || event?.action === 'add') && documentGroups.size > 0) { - refetch(); - } - }; - - const handlerDocumentMoveEventPreview = (event: DocumentMoveEvent) => { - setDocumentGroups( - produce((draft) => previewDocumentSort(draft, event.document, event.position, event.newGroupId)), - ); - }; - - const handleDocumentGroupMoveEventPreview = (event: DocumentGroupMoveEvent) => { - setDocumentGroups( - produce((draft) => previewDocumentGroupsSort(draft, event.documentGroup, event.position)), - ); - }; - - window.emitter.on('AppBridge:GuidelineDocumentGroup:Action', refetch); - window.emitter.on('AppBridge:GuidelineDocumentGroup:DocumentAction', handleDocumentEventUpdates); - window.emitter.on('AppBridge:GuidelineDocument:Action', handlerDocumentMoveEvent); - window.emitter.on('AppBridge:GuidelineDocument:MoveEvent', handlerDocumentMoveEventPreview); - window.emitter.on('AppBridge:GuidelineDocumentGroup:MoveEvent', handleDocumentGroupMoveEventPreview); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentGroup:Action', refetch); - window.emitter.off('AppBridge:GuidelineDocumentGroup:DocumentAction', handleDocumentEventUpdates); - window.emitter.off('AppBridge:GuidelineDocument:Action', handlerDocumentMoveEvent); - window.emitter.off('AppBridge:GuidelineDocument:MoveEvent', handlerDocumentMoveEventPreview); - window.emitter.off('AppBridge:GuidelineDocumentGroup:MoveEvent', handleDocumentGroupMoveEventPreview); - }; - }, [documentGroups.size, refetch]); - - return { documentGroups: Array.from(documentGroups.values()), refetch, isLoading }; -}; - -const previewDocumentSort = ( - documentGroups: Map, - document: DocumentMoveEvent['document'], - newPosition: DocumentMoveEvent['position'], - newGroupId: DocumentMoveEvent['newGroupId'], -) => { - if (newGroupId || !document.sort) { - return documentGroups; - } - - const previousPosition = document.sort; - const documentGroupsAsArray: DocumentGroup[] = [...documentGroups.values()].sort(sortDocumentGroups); - const newDocumentGroups: DocumentGroup[] = []; - - documentGroups.clear(); - - for (const currentDocumentGroup of documentGroupsAsArray) { - const currentPosition = currentDocumentGroup.sort ?? 0; - let positionIncrease = 0; - if (newPosition < currentPosition) { - positionIncrease = previousPosition > currentPosition || previousPosition === 0 ? 1 : 0; - } else { - positionIncrease = previousPosition <= currentPosition ? -1 : 0; - } - - newDocumentGroups.push({ - ...currentDocumentGroup, - sort: currentPosition + positionIncrease, - }); - } - - const sortedNewDocumentGroups = [...newDocumentGroups].sort(sortDocumentGroups); - for (const currentDocumentGroup of sortedNewDocumentGroups) { - documentGroups.set(currentDocumentGroup.id, currentDocumentGroup); - } - - return documentGroups; -}; - -const previewDocumentGroupsSort = ( - documentGroups: Map, - documentGroup: DocumentGroupMoveEvent['documentGroup'], - newPosition: DocumentGroupMoveEvent['position'], -) => { - if (!documentGroup.sort) { - return documentGroups; - } - - const previousPosition = documentGroup.sort; - const documentGroupsAsArray: DocumentGroup[] = [...documentGroups.values()].sort(sortDocumentGroups); - const newDocumentGroups: DocumentGroup[] = []; - - documentGroups.clear(); - - for (const currentDocumentGroup of documentGroupsAsArray) { - if (currentDocumentGroup.id === documentGroup.id) { - newDocumentGroups.push({ ...currentDocumentGroup, sort: newPosition }); - continue; - } - - const currentPosition = currentDocumentGroup.sort ?? 0; - let positionIncrease = 0; - if (newPosition <= currentPosition) { - positionIncrease = previousPosition > currentPosition ? 1 : 0; - } - - newDocumentGroups.push({ - ...currentDocumentGroup, - sort: currentPosition + positionIncrease, - }); - } - - const sortedNewDocumentGroups = [...newDocumentGroups].sort(sortDocumentGroups); - for (const currentDocumentGroup of sortedNewDocumentGroups) { - documentGroups.set(currentDocumentGroup.id, currentDocumentGroup); - } - - return documentGroups; -}; - -const addDocument = ( - documentGroups: Map, - documentToAdd: DocumentGroupDocumentEvent['document'], -) => { - if (!documentToAdd.documentGroupId) { - return documentGroups; - } - - const documentGroup = documentGroups.get(documentToAdd.documentGroupId); - if (!documentGroup) { - return documentGroups; - } - - const newDocumentGroup = { - ...documentGroup, - numberOfDocuments: documentGroup.numberOfDocuments + 1, - }; - - return documentGroups.set(documentGroup.id, newDocumentGroup); -}; - -const deleteDocument = ( - documentGroups: Map, - documentToDelete: DocumentGroupDocumentEvent['document'], -) => { - if (!documentToDelete.documentGroupId) { - return documentGroups; - } - - const documentGroup = documentGroups.get(documentToDelete.documentGroupId); - if (!documentGroup) { - return documentGroups; - } - - const newDocumentGroup = { - ...documentGroup, - numberOfDocuments: documentGroup.numberOfDocuments - 1, - }; - - return documentGroups.set(documentGroup.id, newDocumentGroup); -}; - -const actionHandlers = { - 'add-document': addDocument, - 'delete-document': deleteDocument, - default: (groups: Map) => groups, -}; - -const fetchDocumentGroups = async (appBridge: AppBridgeBlock | AppBridgeTheme) => { - const documentGroups = await appBridge.getDocumentGroups(); - return new Map([...documentGroups].sort(sortDocumentGroups).map((group) => [group.id, group])); -}; diff --git a/packages/app-bridge/src/react/useDocumentNavigation.spec.ts b/packages/app-bridge/src/react/useDocumentNavigation.spec.ts deleted file mode 100644 index a5ccf2bb3..000000000 --- a/packages/app-bridge/src/react/useDocumentNavigation.spec.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { describe, expect, it, vi } from 'vitest'; - -import { type DocumentPage, type DocumentSection, type GuidelineDocument, type DocumentCategory } from 'src/types'; - -import { getAppBridgeThemeStub, DocumentNavigationTreeDummy } from '../tests'; - -import { useDocumentNavigation } from './useDocumentNavigation'; - -describe('useDocumentNavigation', () => { - const testInitialRender = async ({ - expectRefetch, - options, - }: { - expectRefetch: boolean; - options?: { enabled: boolean }; - }) => { - const document = { id: () => 1138 }; - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api').mockResolvedValueOnce(DocumentNavigationTreeDummy.default()); - - const { result } = renderHook(() => useDocumentNavigation(appBridge, document, options)); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(!expectRefetch); - expect(result.current.navigationItems).toEqual(expectRefetch ? DocumentNavigationTreeDummy.default() : []); - }); - - if (expectRefetch) { - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getDocumentNavigation', payload: { document } }); - } - }; - - const testEventHandler = async (emitEvent: () => void) => { - const document = { id: () => 1138 }; - - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api').mockResolvedValue(DocumentNavigationTreeDummy.default()); - - const { result } = renderHook(() => useDocumentNavigation(appBridge, document)); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DocumentNavigationTreeDummy.default()); - }); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getDocumentNavigation', payload: { document } }); - - spy.mockResolvedValueOnce(DocumentNavigationTreeDummy.alternative()); - - emitEvent(); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledTimes(2); - expect(result.current.navigationItems).toEqual(DocumentNavigationTreeDummy.alternative()); - }); - }; - - it('should not refetch on render when enabled is set to false', () => - testInitialRender({ expectRefetch: false, options: { enabled: false } })); - - it('should refetch on render when enabled is set to true', () => - testInitialRender({ expectRefetch: true, options: { enabled: true } })); - - it('should refetch on render when no options are given', () => - testInitialRender({ expectRefetch: true, options: undefined })); - - it('should refetch when the "AppBridge:GuidelineDocumentCategory:Action" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - action: 'add', - documentCategory: {}, - }); - })); - - it('should refetch when the "AppBridge:GuidelineDocumentCategory:DocumentPageAction" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - action: 'add', - documentPage: { categoryId: 0, id: 0 }, - }); - })); - - it('should refetch when the "AppBridge:GuidelineDocumentCategory:MoveEvent" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentCategory:MoveEvent', { - action: 'movePreview', - documentId: 0, - documentCategory: {}, - position: 0, - }); - })); - - it('should refetch when the "AppBridge:GuidelineDocumentPage:Action" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - action: 'add', - documentPage: {}, - }); - })); - - it('should refetch when the "AppBridge:GuidelineDocumentPage:MoveEvent" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentPage:MoveEvent', { - action: 'movePreview', - documentId: 0, - documentPage: {}, - }); - })); - - it('should refetch when the "AppBridge:GuidelineDocumentPageTargets:Action" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentPageTargets:Action', { - action: 'update', - payload: { targets: [], pageIds: [] }, - }); - })); - - it('should refetch when the "AppBridge:GuidelineDocumentSection:Action" event occurs', () => - testEventHandler(() => { - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'add', - payload: { documentPageId: 0, documentSection: {}, previousDocumentSectionId: 0 }, - }); - })); -}); diff --git a/packages/app-bridge/src/react/useDocumentNavigation.ts b/packages/app-bridge/src/react/useDocumentNavigation.ts deleted file mode 100644 index 4cb17ae23..000000000 --- a/packages/app-bridge/src/react/useDocumentNavigation.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import debounce from 'lodash-es/debounce'; -import { useCallback, useEffect, useMemo, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type GuidelineDocument, type DocumentNavigationItem } from '../types/Guideline'; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -export const useDocumentNavigation = ( - appBridge: AppBridgeTheme, - document: GuidelineDocument, - options: Options = { enabled: true }, -) => { - const [navigationItems, setNavigationItems] = useState([]); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setNavigationItems(await appBridge.api({ name: 'getDocumentNavigation', payload: { document } })); - setIsLoading(false); - }, [appBridge, document]); - - useEffect(() => { - if (options.enabled) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - refetch(); - } - }, [options.enabled, refetch]); - - // eslint-disable-next-line @eslint-react/no-unnecessary-use-memo - const debouncedRefetch = useMemo( - () => - debounce(() => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - refetch(); - }, 100), - [refetch], - ); - - useEffect(() => { - window.emitter.on('AppBridge:GuidelineDocumentCategory:Action', debouncedRefetch); - window.emitter.on('AppBridge:GuidelineDocumentCategory:DocumentPageAction', debouncedRefetch); - window.emitter.on('AppBridge:GuidelineDocumentCategory:MoveEvent', debouncedRefetch); - - window.emitter.on('AppBridge:GuidelineDocumentPage:Action', debouncedRefetch); - window.emitter.on('AppBridge:GuidelineDocumentPage:MoveEvent', debouncedRefetch); - window.emitter.on('AppBridge:GuidelineDocumentPageTargets:Action', debouncedRefetch); - - window.emitter.on('AppBridge:GuidelineDocumentSection:Action', debouncedRefetch); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentCategory:Action', debouncedRefetch); - window.emitter.off('AppBridge:GuidelineDocumentCategory:DocumentPageAction', debouncedRefetch); - window.emitter.off('AppBridge:GuidelineDocumentCategory:MoveEvent', debouncedRefetch); - - window.emitter.off('AppBridge:GuidelineDocumentPage:Action', debouncedRefetch); - window.emitter.off('AppBridge:GuidelineDocumentPage:MoveEvent', debouncedRefetch); - window.emitter.off('AppBridge:GuidelineDocumentPageTargets:Action', debouncedRefetch); - - window.emitter.off('AppBridge:GuidelineDocumentSection:Action', debouncedRefetch); - }; - }, [navigationItems, debouncedRefetch]); - - return { navigationItems, refetch, isLoading }; -}; diff --git a/packages/app-bridge/src/react/useDocumentPageTargets.spec.ts b/packages/app-bridge/src/react/useDocumentPageTargets.spec.ts deleted file mode 100644 index 3e9358f08..000000000 --- a/packages/app-bridge/src/react/useDocumentPageTargets.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, renderHook } from '@testing-library/react'; -import mitt from 'mitt'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { DocumentPageTargetsDummy } from '../tests'; - -import { useDocumentPageTargets } from './useDocumentPageTargets'; - -const DOCUMENT_PAGE_ID = 345; - -describe('useDocumentPageTargets', () => { - const appBridge: AppBridgeBlock | AppBridgeTheme = {} as AppBridgeBlock | AppBridgeTheme; - - beforeEach(() => { - window.emitter = mitt(); - }); - - afterEach(() => { - vi.restoreAllMocks(); - }); - - it('should return the document page targets from appBridge', async () => { - const documentPageTargets = DocumentPageTargetsDummy.with(DOCUMENT_PAGE_ID); - - appBridge.getDocumentPageTargets = vi.fn().mockResolvedValue(documentPageTargets); - - const { result } = renderHook(() => useDocumentPageTargets(appBridge, DOCUMENT_PAGE_ID)); - - expect(result.current.documentPageTargets).toBe(null); - - await act(async () => { - await appBridge.getDocumentPageTargets(DOCUMENT_PAGE_ID); - }); - - expect(result.current.documentPageTargets).toEqual(documentPageTargets); - }); -}); diff --git a/packages/app-bridge/src/react/useDocumentPageTargets.ts b/packages/app-bridge/src/react/useDocumentPageTargets.ts deleted file mode 100644 index c3e3c6e25..000000000 --- a/packages/app-bridge/src/react/useDocumentPageTargets.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type DocumentPageTargets } from '../types'; - -export type UseDocumentPageTargetsReturnType = { - documentPageTargets: Nullable; - isLoading: boolean; -}; - -export type DocumentPageTargetEvent = { - action: 'update'; - payload: { - targets: number[]; - pageIds: number[]; - }; -}; - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useDocumentPageTargets = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - id: number, -): UseDocumentPageTargetsReturnType => { - const [documentPageTargets, setDocumentPageTargets] = useState>(null); - const [isLoading, setIsLoading] = useState(true); - - useEffect(() => { - const fetchDocumentPageTargets = async () => { - setIsLoading(true); - setDocumentPageTargets(await appBridge.getDocumentPageTargets(id)); - setIsLoading(false); - }; - - fetchDocumentPageTargets(); - }, [appBridge, id]); - - useEffect(() => { - const handleTargetEventUpdates = (event: DocumentPageTargetEvent) => { - if (event.payload.pageIds.includes(id)) { - setDocumentPageTargets((previousState) => updateTargets(previousState, event.payload.targets)); - } - }; - - window.emitter.on('AppBridge:GuidelineDocumentPageTargets:Action', handleTargetEventUpdates); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentPageTargets:Action', handleTargetEventUpdates); - }; - }, [id]); - - return { documentPageTargets, isLoading }; -}; - -const updateTargets = (prevState: Nullable, targetIds: number[]) => { - if (!prevState) { - return prevState; - } - return { - ...prevState, - hasSelectedTargets: targetIds.length > 0, - targets: prevState.targets.map((target) => ({ - ...target, - target: { ...target.target, checked: targetIds.includes(target.target.id) }, - })), - }; -}; diff --git a/packages/app-bridge/src/react/useDocumentSection.spec.ts b/packages/app-bridge/src/react/useDocumentSection.spec.ts deleted file mode 100644 index e3f29d5d8..000000000 --- a/packages/app-bridge/src/react/useDocumentSection.spec.ts +++ /dev/null @@ -1,335 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import mitt from 'mitt'; -import { type Mock, beforeAll, describe, expect, it, vi } from 'vitest'; - -import { type AppBridgeBlock, type AppBridgeTheme } from '../'; -import { DocumentSectionDummy } from '../tests/DocumentSectionDummy'; - -import { useDocumentSection } from './useDocumentSection'; - -const DOCUMENT_PAGE_ID = 45; - -const documentSections = [ - // @ts-expect-error On purpose to test the function - DocumentSectionDummy.withFields({ id: 464, title: null }), - DocumentSectionDummy.withFields({ id: 356, title: 'New Title' }), - DocumentSectionDummy.withFields({ id: 376, title: ' ' }), - DocumentSectionDummy.withFields({ id: 174, title: '' }), -]; - -describe('useDocumentSection', () => { - const appBridge: AppBridgeBlock | AppBridgeTheme = {} as AppBridgeBlock | AppBridgeTheme; - - beforeAll(() => { - window.emitter = mitt(); - appBridge.getDocumentSectionsByDocumentPageId = vi.fn().mockResolvedValue(documentSections); - }); - - it('should return the document sections from appBridge', async () => { - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - }); - - it('should filter sections with null and unreadable titles from navigation items', async () => { - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual([documentSections[1]]); - }); - }); - - it('should add and remove event listener correctly', () => { - vi.spyOn(window.emitter, 'on'); - vi.spyOn(window.emitter, 'off'); - - const { unmount } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - const handleSectionEvent = (window.emitter.on as Mock).mock.calls[0][1]; - - expect(window.emitter.on).toHaveBeenCalledWith('AppBridge:GuidelineDocumentSection:Action', handleSectionEvent); - - unmount(); - - expect(window.emitter.off).toHaveBeenCalledWith( - 'AppBridge:GuidelineDocumentSection:Action', - handleSectionEvent, - ); - }); - - describe('when a document section is added', () => { - it('should add the document section to the start of the documentSections if previousSectionId is null', async () => { - const NEW_SECTION = DocumentSectionDummy.with(535); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'add', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - documentSection: NEW_SECTION, - previousDocumentSectionId: null, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual([NEW_SECTION, ...documentSections]); - expect(result.current.navigationItems).toEqual([NEW_SECTION, documentSections[1]]); - }); - }); - - it('should add the document section after the section matching previousSectionId', async () => { - const NEW_SECTION = DocumentSectionDummy.with(535); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'add', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - documentSection: NEW_SECTION, - previousDocumentSectionId: documentSections[1].id, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual([ - documentSections[0], - documentSections[1], - NEW_SECTION, - documentSections[2], - documentSections[3], - ]); - expect(result.current.navigationItems).toEqual([documentSections[1], NEW_SECTION]); - }); - }); - - it('should not add the document section to the array if the documentPageId is incorrect', async () => { - const NEW_SECTION = DocumentSectionDummy.with(535); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'add', - payload: { - documentPageId: DOCUMENT_PAGE_ID + 1, - documentSection: NEW_SECTION, - previousDocumentSectionId: documentSections[1].id, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - expect(result.current.navigationItems).toEqual([documentSections[1]]); - }); - }); - - it('should add the document section to the end of the array if no section matches previousSectionId', async () => { - const NEW_SECTION = DocumentSectionDummy.with(535); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'add', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - documentSection: NEW_SECTION, - previousDocumentSectionId: 123, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual([...documentSections, NEW_SECTION]); - expect(result.current.navigationItems).toEqual([documentSections[1], NEW_SECTION]); - }); - }); - }); - - describe('when a document section is updated', () => { - it('should update the document section that matches sectionId', async () => { - const UPDATED_SECTION = DocumentSectionDummy.withFields({ - id: documentSections[1].id, - title: 'Updated Title', - slug: 'updated-slug', - }); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'update', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - id: UPDATED_SECTION.id, - title: UPDATED_SECTION.title, - slug: UPDATED_SECTION.slug, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual([ - documentSections[0], - UPDATED_SECTION, - documentSections[2], - documentSections[3], - ]); - expect(result.current.navigationItems).toEqual([UPDATED_SECTION]); - }); - }); - - it('should remove document section from navigation items if title becomes unreadable', async () => { - const UPDATED_SECTION = DocumentSectionDummy.withFields({ - id: documentSections[1].id, - title: ' ', - slug: 'updated-slug', - }); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'update', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - id: UPDATED_SECTION.id, - title: UPDATED_SECTION.title, - slug: UPDATED_SECTION.slug, - }, - }); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual([]); - }); - }); - - it('should add document section to navigation items if title becomes truthy', async () => { - const UPDATED_SECTION = DocumentSectionDummy.withFields({ - id: documentSections[2].id, - title: 'Updated Title', - slug: 'updated-slug', - }); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'update', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - id: UPDATED_SECTION.id, - title: UPDATED_SECTION.title, - slug: UPDATED_SECTION.slug, - }, - }); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual([documentSections[1], UPDATED_SECTION]); - }); - }); - - it('should not adjust array if documentPageId is incorrect', async () => { - const UPDATED_SECTION = DocumentSectionDummy.withFields({ - id: documentSections[2].id, - title: 'Updated Title', - slug: 'updated-slug', - }); - - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'update', - payload: { - documentPageId: DOCUMENT_PAGE_ID + 1, - id: UPDATED_SECTION.id, - title: UPDATED_SECTION.title, - slug: UPDATED_SECTION.slug, - }, - }); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual([documentSections[1]]); - }); - }); - }); - - describe('when a document section is deleted', () => { - it('should remove the section that matches sectionId', async () => { - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'delete', - payload: { - documentPageId: DOCUMENT_PAGE_ID, - id: documentSections[1].id, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual([ - documentSections[0], - documentSections[2], - documentSections[3], - ]); - expect(result.current.navigationItems).toEqual([]); - }); - }); - - it('should not remove document section if documentPageId is incorrect', async () => { - const { result } = renderHook(() => useDocumentSection(appBridge, DOCUMENT_PAGE_ID)); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - }); - - window.emitter.emit('AppBridge:GuidelineDocumentSection:Action', { - action: 'delete', - payload: { - documentPageId: DOCUMENT_PAGE_ID + 1, - id: documentSections[1].id, - }, - }); - - await waitFor(() => { - expect(result.current.documentSections).toEqual(documentSections); - expect(result.current.navigationItems).toEqual([documentSections[1]]); - }); - }); - }); -}); diff --git a/packages/app-bridge/src/react/useDocumentSection.ts b/packages/app-bridge/src/react/useDocumentSection.ts deleted file mode 100644 index 195ba0a40..000000000 --- a/packages/app-bridge/src/react/useDocumentSection.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useMemo, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { filterDocumentSectionsWithUnreadableTitles } from '../helpers'; -import { type DocumentSection, type EmitterEvents } from '../types'; - -const insertDocumentSectionIntoArray = ( - previousDocumentSections: DocumentSection[], - newDocumentSection: DocumentSection, - previousDocumentSectionId: Nullable, -) => { - if (previousDocumentSectionId === null) { - return [newDocumentSection, ...previousDocumentSections]; - } - const index = previousDocumentSections.findIndex((section) => section.id === previousDocumentSectionId); - if (index >= 0) { - return [ - ...previousDocumentSections.slice(0, index + 1), - newDocumentSection, - ...previousDocumentSections.slice(index + 1), - ]; - } - return [...previousDocumentSections, newDocumentSection]; -}; - -const updateDocumentSectionInArray = ( - previousDocumentSections: DocumentSection[], - documentSectionIdToUpdate: number, - title: string, - slug: string, -) => - previousDocumentSections.map((documentSection) => - documentSection.id === documentSectionIdToUpdate ? { ...documentSection, title, slug } : documentSection, - ); - -const deleteDocumentSectionFromArray = (previousDocumentSections: DocumentSection[], IdToDelete: number) => - previousDocumentSections.filter((documentSection) => documentSection.id !== IdToDelete); - -type UseDocumentSectionReturn = { - /** - * The complete list of document sections that belong to the document page with the given documentPageId. - */ - documentSections: DocumentSection[]; - /** - * A filtered list of document sections which removes any sections that do not have a readable title. - * Use this array for creating a navigation menu for the document page. - */ - navigationItems: DocumentSection[]; -}; - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useDocumentSection = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - documentPageId: number, -): UseDocumentSectionReturn => { - const [documentSections, setDocumentSections] = useState([]); - const navigationItems = useMemo( - () => filterDocumentSectionsWithUnreadableTitles(documentSections), - [documentSections], - ); - - useEffect(() => { - const fetchDocumentSection = async (documentPageId: number) => { - setDocumentSections(await appBridge.getDocumentSectionsByDocumentPageId(documentPageId)); - }; - - fetchDocumentSection(documentPageId); - }, [appBridge, documentPageId]); - - useEffect(() => { - const handleDocumentSectionEvent = ({ - action, - payload, - }: EmitterEvents['AppBridge:GuidelineDocumentSection:Action']) => { - if (payload.documentPageId !== documentPageId) { - return; - } - switch (action) { - case 'add': { - const { documentSection, previousDocumentSectionId } = payload; - setDocumentSections((previousSections) => - insertDocumentSectionIntoArray(previousSections, documentSection, previousDocumentSectionId), - ); - break; - } - case 'update': { - const { id, title, slug } = payload; - setDocumentSections((previousSections) => - updateDocumentSectionInArray(previousSections, id, title, slug), - ); - break; - } - case 'delete': { - const { id } = payload; - setDocumentSections((previousSections) => deleteDocumentSectionFromArray(previousSections, id)); - break; - } - } - }; - - window.emitter.on('AppBridge:GuidelineDocumentSection:Action', handleDocumentSectionEvent); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentSection:Action', handleDocumentSectionEvent); - }; - }, [documentPageId]); - - return { documentSections, navigationItems }; -}; diff --git a/packages/app-bridge/src/react/useDocumentTargets.spec.ts b/packages/app-bridge/src/react/useDocumentTargets.spec.ts deleted file mode 100644 index 375a3e734..000000000 --- a/packages/app-bridge/src/react/useDocumentTargets.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, renderHook } from '@testing-library/react'; -import mitt from 'mitt'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { DocumentTargetsDummy } from '../tests'; - -import { useDocumentTargets } from './useDocumentTargets'; - -const DOCUMENT_ID = 92341; - -describe('useDocumentTargets', () => { - const appBridge: AppBridgeBlock | AppBridgeTheme = {} as AppBridgeBlock | AppBridgeTheme; - - beforeEach(() => { - window.emitter = mitt(); - }); - - afterEach(() => { - vi.restoreAllMocks(); - }); - - it('should return the document targets from appBridge', async () => { - const documentTargets = DocumentTargetsDummy.with(DOCUMENT_ID); - - appBridge.getDocumentTargets = vi.fn().mockResolvedValue(documentTargets); - - const { result } = renderHook(() => useDocumentTargets(appBridge, DOCUMENT_ID)); - - expect(result.current.documentTargets).toBe(null); - - await act(async () => { - await appBridge.getDocumentTargets(DOCUMENT_ID); - }); - - expect(result.current.documentTargets).toEqual(documentTargets); - }); -}); diff --git a/packages/app-bridge/src/react/useDocumentTargets.tsx b/packages/app-bridge/src/react/useDocumentTargets.tsx deleted file mode 100644 index 3622217cc..000000000 --- a/packages/app-bridge/src/react/useDocumentTargets.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type DocumentTargets } from '../types'; - -export type UseDocumentTargetsReturnType = { - documentTargets: Nullable; - isLoading: boolean; -}; - -type DocumentTargetEvent = { - action: 'update'; - payload: { - targets: number[]; - documentIds: number[]; - }; -}; - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this hook. - */ -export const useDocumentTargets = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - id: number, -): UseDocumentTargetsReturnType => { - const [documentTargets, setDocumentTargets] = useState>(null); - const [isLoading, setIsLoading] = useState(true); - - useEffect(() => { - const fetchDocumentTargets = async () => { - setIsLoading(true); - setDocumentTargets(await appBridge.getDocumentTargets(id)); - setIsLoading(false); - }; - - fetchDocumentTargets(); - }, [appBridge, id]); - - useEffect(() => { - const handleTargetEventUpdates = (event: DocumentTargetEvent) => { - if (event.payload.documentIds.includes(id)) { - setDocumentTargets((previousState) => updateTargets(previousState, event.payload.targets)); - } - }; - - window.emitter.on('AppBridge:GuidelineDocumentTargets:Action', handleTargetEventUpdates); - return () => { - window.emitter.off('AppBridge:GuidelineDocumentTargets:Action', handleTargetEventUpdates); - }; - }, [id]); - - return { documentTargets, isLoading }; -}; - -const updateTargets = (prevState: Nullable, targetIds: number[]) => { - if (!prevState) { - return prevState; - } - - return { - ...prevState, - hasSelectedTargets: targetIds.length > 0, - targets: prevState.targets.map((target) => ({ - ...target, - target: { ...target.target, checked: targetIds.includes(target.target.id) }, - })), - }; -}; diff --git a/packages/app-bridge/src/react/useEditorState.ts b/packages/app-bridge/src/react/useEditorState.ts index 6eef6dc02..ce9b28ded 100644 --- a/packages/app-bridge/src/react/useEditorState.ts +++ b/packages/app-bridge/src/react/useEditorState.ts @@ -3,9 +3,8 @@ import { useEffect, useState } from 'react'; import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -export const useEditorState = (appBridge: AppBridgeBlock | AppBridgeTheme): boolean => { +export const useEditorState = (appBridge: AppBridgeBlock): boolean => { const [editorState, setEditorState] = useState(appBridge.getEditorState()); useEffect(() => { diff --git a/packages/app-bridge/src/react/useGroupedDocuments.spec.ts b/packages/app-bridge/src/react/useGroupedDocuments.spec.ts deleted file mode 100644 index 5b6fa0f55..000000000 --- a/packages/app-bridge/src/react/useGroupedDocuments.spec.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { DocumentDummy, getAppBridgeThemeStub } from '../tests'; - -import { useGroupedDocuments } from './useGroupedDocuments'; - -const DOCUMENT_GROUP_ID_1 = 5332; -const GROUPED_DOCUMENT_ID_1 = 2434; -const GROUPED_DOCUMENT_ID_2 = 552; -const GROUPED_DOCUMENT_ID_3 = 1145; -const GROUPED_DOCUMENT_ID_4 = 32345; -const DOCUMENT_PAGE_ID = 68445; -const DOCUMENT_CATEGORY_ID = 123; - -describe('useGroupedDocument', () => { - afterEach(() => { - vi.resetAllMocks(); - }); - - it('should fetch grouped documents on mount', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1)); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - ]); - }); - - it('should not fetch grouped documents on mount if not enabled', () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled: false })); - - expect(result.current.isLoading).toBe(true); - expect(spy).not.toHaveBeenCalled(); - expect(result.current.documents).toEqual([]); - }); - - it('should fetch grouped documents if it gets enabled', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - let enabled = false; - - const { result, rerender } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled })); - - expect(result.current.isLoading).toBe(true); - expect(spy).not.toHaveBeenCalled(); - expect(result.current.documents).toEqual([]); - - enabled = true; - - rerender(); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - ]); - }); - - it('should update document if a page is added', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const OLD_DOCUMENT = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - numberOfUncategorizedDocumentPages: 0, - }); - const NEW_DOCUMENT = DocumentDummy.withFields({ - ...OLD_DOCUMENT, - numberOfUncategorizedDocumentPages: 1, - }); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled: true })); - - expect(result.current.isLoading).toBe(true); - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - OLD_DOCUMENT, - ]); - - // Trigger a "document page added" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocument:DocumentPageAction', { - action: 'add', - documentPage: { id: DOCUMENT_PAGE_ID, documentId: GROUPED_DOCUMENT_ID_4 }, - }); - - await waitFor(() => { - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - NEW_DOCUMENT, - ]); - }); - }); - - it('should update document if a page is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const OLD_DOCUMENT = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - numberOfUncategorizedDocumentPages: 1, - }); - const NEW_DOCUMENT = DocumentDummy.withFields({ - ...OLD_DOCUMENT, - numberOfUncategorizedDocumentPages: 0, - }); - - // Mock the response of the first call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - OLD_DOCUMENT, - ]), - ); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled: true })); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - // Trigger a "document page added" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocument:DocumentPageAction', { - action: 'delete', - documentPage: { id: DOCUMENT_PAGE_ID, documentId: GROUPED_DOCUMENT_ID_4 }, - }); - - await waitFor(() => { - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - NEW_DOCUMENT, - ]); - }); - }); - - it('should update document if a category is added', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const OLD_DOCUMENT = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - numberOfDocumentPageCategories: 0, - }); - const NEW_DOCUMENT = DocumentDummy.withFields({ - ...OLD_DOCUMENT, - numberOfDocumentPageCategories: 1, - }); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled: true })); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - OLD_DOCUMENT, - ]); - - // Trigger a "document category added" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocument:DocumentCategoryAction', { - action: 'add', - documentCategory: { id: DOCUMENT_CATEGORY_ID, documentId: GROUPED_DOCUMENT_ID_4 }, - }); - - await waitFor(() => { - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - NEW_DOCUMENT, - ]); - }); - }); - - it('should update document if a category is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const OLD_DOCUMENT = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - numberOfDocumentPageCategories: 1, - }); - const NEW_DOCUMENT = DocumentDummy.withFields({ - ...OLD_DOCUMENT, - numberOfDocumentPageCategories: 0, - }); - - // Mock the response of the first call - spy.mockImplementationOnce(() => - Promise.resolve([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - OLD_DOCUMENT, - ]), - ); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled: true })); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - // Trigger a "document category added" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocument:DocumentCategoryAction', { - action: 'delete', - documentCategory: { id: DOCUMENT_CATEGORY_ID, documentId: GROUPED_DOCUMENT_ID_4 }, - }); - - await waitFor(() => { - expect(result.current.documents).toEqual([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - NEW_DOCUMENT, - ]); - }); - }); - - it('should update document sorting if a document is moved', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - - const DOCUMENT_1 = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - sort: 1, - }); - const DOCUMENT_2 = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - sort: 2, - }); - const DOCUMENT_3 = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - sort: 3, - }); - const DOCUMENT_4 = DocumentDummy.withFields({ - ...DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - sort: 4, - }); - const NEW_DOCUMENT_4 = DocumentDummy.withFields({ - ...DOCUMENT_4, - sort: 2, - }); - - spy.mockImplementationOnce(() => Promise.resolve([DOCUMENT_1, DOCUMENT_4, DOCUMENT_2, DOCUMENT_3])); - - const { result } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1, { enabled: true })); - - expect(result.current.isLoading).toBe(true); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(spy).toHaveBeenCalledOnce(); - }); - - expect(result.current.documents).toEqual([DOCUMENT_1, DOCUMENT_2, DOCUMENT_3, DOCUMENT_4]); - - // Trigger a "document category added" event in the specified document - window.emitter.emit('AppBridge:GuidelineDocument:MoveEvent', { - action: 'movePreview', - document: { id: GROUPED_DOCUMENT_ID_4, documentGroupId: DOCUMENT_GROUP_ID_1, sort: 4 }, - position: 2, - newGroupId: DOCUMENT_GROUP_ID_1, - }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - }); - - expect(result.current.documents).toEqual([DOCUMENT_1, NEW_DOCUMENT_4, DOCUMENT_2, DOCUMENT_3]); - }); -}); diff --git a/packages/app-bridge/src/react/useGroupedDocuments.ts b/packages/app-bridge/src/react/useGroupedDocuments.ts deleted file mode 100644 index 8cd1952c4..000000000 --- a/packages/app-bridge/src/react/useGroupedDocuments.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type Document, type EmitterEvents } from '../types'; - -type DocumentPageEvent = EmitterEvents['AppBridge:GuidelineDocument:DocumentPageAction']; -type DocumentCategoryEvent = EmitterEvents['AppBridge:GuidelineDocument:DocumentCategoryAction']; -type DocumentMoveEvent = EmitterEvents['AppBridge:GuidelineDocument:MoveEvent']; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -const sortDocuments = (a: Document, b: Document) => (a.sort && b.sort ? a.sort - b.sort : 0); - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useGroupedDocuments = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - documentGroupId: number, - options: Options = { enabled: true }, -) => { - // eslint-disable-next-line @eslint-react/use-state - const [documents, setDocuments] = useState>(new Map([])); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setDocuments(await fetchGroupedDocuments(appBridge, documentGroupId)); - setIsLoading(false); - }, [appBridge, documentGroupId]); - - useEffect(() => { - if (options.enabled) { - refetch(); - } - }, [options.enabled, refetch]); - - useEffect(() => { - const handleDocumentPageEvent = (event: DocumentPageEvent) => { - if (!documents.has(event.documentPage.documentId)) { - return; - } - - setDocuments( - produce((draft) => { - const action = `${event.action}-page` as const; - const handler = actionHandlers[action] || actionHandlers.default; - return handler(draft, event.documentPage); - }), - ); - }; - - const handleDocumentCategoryEvent = (event: DocumentCategoryEvent) => { - if (!documents.has(event.documentCategory.documentId)) { - return; - } - - setDocuments( - produce((draft) => { - const action = `${event.action}-category` as const; - const handler = actionHandlers[action] || actionHandlers.default; - return handler(draft, event.documentCategory); - }), - ); - }; - - const handlerDocumentMoveEventPreview = (event: DocumentMoveEvent) => { - if (!documents.has(event.document.id) || event.newGroupId !== documentGroupId) { - return; - } - - setDocuments( - produce((draft) => previewDocumentSort(draft, event.document, event.position, event.newGroupId)), - ); - }; - - const handler = ({ action, document }: EmitterEvents['AppBridge:GuidelineDocument:Action']) => { - if ( - ((action === 'update' || action === 'move') && documents.has(document.id)) || - (action === 'add' && document.documentGroupId === documentGroupId) - ) { - refetch(); - } else if (action === 'delete' && documents.has(document.id)) { - setDocuments( - produce((draft) => { - if (action === 'delete') { - draft.delete(document.id); - } - }), - ); - } - }; - - window.emitter.on('AppBridge:GuidelineDocument:Action', handler); - window.emitter.on('AppBridge:GuidelineDocumentTargets:Action', refetch); - window.emitter.on('AppBridge:GuidelineDocument:DocumentPageAction', handleDocumentPageEvent); - window.emitter.on('AppBridge:GuidelineDocument:DocumentCategoryAction', handleDocumentCategoryEvent); - window.emitter.on('AppBridge:GuidelineDocument:MoveEvent', handlerDocumentMoveEventPreview); - - return () => { - window.emitter.off('AppBridge:GuidelineDocument:Action', handler); - window.emitter.off('AppBridge:GuidelineDocumentTargets:Action', refetch); - window.emitter.off('AppBridge:GuidelineDocument:DocumentPageAction', handleDocumentPageEvent); - window.emitter.off('AppBridge:GuidelineDocument:DocumentCategoryAction', handleDocumentCategoryEvent); - window.emitter.off('AppBridge:GuidelineDocument:MoveEvent', handlerDocumentMoveEventPreview); - }; - }, [documentGroupId, documents, options.enabled, refetch]); - - return { documents: Array.from(documents.values()), refetch, isLoading }; -}; - -const previewDocumentSort = ( - documents: Map, - document: DocumentMoveEvent['document'], - newPosition: DocumentMoveEvent['position'], - newGroupId: DocumentMoveEvent['newGroupId'], -) => { - if (!document.sort) { - return documents; - } - - const previousDocument = documents.get(document.id); - const documentsAsArray: Document[] = [...documents.values()].sort(sortDocuments); - - documents.clear(); - - let sort = 1; - let isOnLastPosition = true; - for (const currentDocument of documentsAsArray) { - if (currentDocument.id === document.id || currentDocument.documentGroupId !== newGroupId) { - continue; - } - - if (previousDocument && sort === newPosition) { - documents.set(document.id, { ...previousDocument, sort: newPosition }); - isOnLastPosition = false; - } - - documents.set(currentDocument.id, { - ...currentDocument, - sort, - }); - - sort++; - } - - if (previousDocument && isOnLastPosition) { - documents.set(document.id, { ...previousDocument, sort }); - } - - return documents; -}; - -const addDocumentPage = (documents: Map, documentPageToAdd: DocumentPageEvent['documentPage']) => { - const document = documents.get(documentPageToAdd.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfUncategorizedDocumentPages: document.numberOfUncategorizedDocumentPages + 1, - }; - - return documents.set(document.id, newDocument); -}; - -const deleteDocumentPage = ( - documents: Map, - documentPageToDelete: DocumentPageEvent['documentPage'], -) => { - const document = documents.get(documentPageToDelete.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfUncategorizedDocumentPages: document.numberOfUncategorizedDocumentPages - 1, - }; - - return documents.set(document.id, newDocument); -}; - -const addDocumentCategory = ( - documents: Map, - documentCategoryToAdd: DocumentCategoryEvent['documentCategory'], -) => { - const document = documents.get(documentCategoryToAdd.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfDocumentPageCategories: document.numberOfDocumentPageCategories + 1, - }; - - return documents.set(document.id, newDocument); -}; - -const deleteDocumentCategory = ( - documents: Map, - documentCategoryToDelete: DocumentCategoryEvent['documentCategory'], -) => { - const document = documents.get(documentCategoryToDelete.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfDocumentPageCategories: document.numberOfDocumentPageCategories - 1, - }; - - return documents.set(document.id, newDocument); -}; - -const actionHandlers = { - 'add-page': addDocumentPage, - 'delete-page': deleteDocumentPage, - 'add-category': addDocumentCategory, - 'delete-category': deleteDocumentCategory, - default: (documents: Map) => documents, -}; - -const fetchGroupedDocuments = async (appBridge: AppBridgeBlock | AppBridgeTheme, documentGroupId: number) => { - const documents = await appBridge.getDocumentsByDocumentGroupId(documentGroupId); - return new Map([...documents].sort(sortDocuments).map((document) => [document.id, document])); -}; diff --git a/packages/app-bridge/src/react/useGuidelineActions.spec.ts b/packages/app-bridge/src/react/useGuidelineActions.spec.ts deleted file mode 100644 index 64d6a136e..000000000 --- a/packages/app-bridge/src/react/useGuidelineActions.spec.ts +++ /dev/null @@ -1,2178 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, renderHook, waitFor } from '@testing-library/react'; -import mitt from 'mitt'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { - BrandportalLinkDummy, - CoverPageDummy, - DocumentCategoryDummy, - DocumentDummy, - DocumentGroupDummy, - DocumentPageDummy, - getAppBridgeThemeStub, -} from '../tests'; -import { - type BrandportalLink, - type CoverPage, - type CoverPageCreate, - type CoverPageUpdate, - type DocumentCategoryCreate, - type DocumentCategoryUpdate, - type DocumentGroupCreate, - type DocumentGroupUpdate, - type DocumentLibraryCreate, - type DocumentLibraryUpdate, - type DocumentLinkCreate, - type DocumentLinkUpdate, - type DocumentPageCreate, - type DocumentPageUpdate, - type DocumentStandardCreate, - type DocumentStandardUpdate, -} from '../types'; - -import { useCategorizedDocumentPages } from './useCategorizedDocumentPages'; -import { useDocumentCategories } from './useDocumentCategories'; -import { useDocumentGroups } from './useDocumentGroups'; -import { useGroupedDocuments } from './useGroupedDocuments'; -import { useGuidelineActions } from './useGuidelineActions'; -import { useUncategorizedDocumentPages } from './useUncategorizedDocumentPages'; -import { useUngroupedDocuments } from './useUngroupedDocuments'; - -const DOCUMENT_ID_1 = 6456; -const DOCUMENT_ID_2 = 34532; -const DOCUMENT_ID_3 = 2414; -const DOCUMENT_ID_4 = 2342; -const DOCUMENT_ID_5 = 2343445; -const DOCUMENT_PAGE_ID_1 = 23442; -const DOCUMENT_PAGE_ID_2 = 235345; -const DOCUMENT_PAGE_ID_3 = 12352; -const DOCUMENT_PAGE_ID_4 = 55221; -const DOCUMENT_PAGE_ID_5 = 98324; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_1 = 24324; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_2 = 3532; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_3 = 98954; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_4 = 34563; -const DOCUMENT_CATEGORY_ID_1 = 147; -const DOCUMENT_CATEGORY_ID_2 = 258; -const DOCUMENT_CATEGORY_ID_3 = 678; -const DOCUMENT_GROUP_ID_1 = 345; -const DOCUMENT_GROUP_ID_2 = 95694; -const DOCUMENT_GROUP_ID_3 = 345882; - -describe('useGuidelineActions hook', () => { - let useGuidelineActionsStub: ReturnType; - let emitSpy: ReturnType | null = null; - let appBridgeStub: ReturnType; - - beforeEach(() => { - appBridgeStub = getAppBridgeThemeStub(); - const { result } = renderHook(() => useGuidelineActions(appBridgeStub)); - - useGuidelineActionsStub = result.current; - window.emitter = mitt(); - emitSpy = vi.spyOn(window.emitter, 'emit'); - }); - - afterEach(() => { - vi.resetAllMocks(); - emitSpy = null; - }); - - it('should not throw createDocument', async () => { - const createDocumentMock = vi.fn(useGuidelineActionsStub.createDocument); - - await expect(createDocumentMock({ title: 'testDocument' })).resolves.not.toThrow(); - }); - - it('should not throw createDocumentGroup', async () => { - const createDocumentGroupMock = vi.fn(useGuidelineActionsStub.createDocumentGroup); - - await expect(createDocumentGroupMock({ name: 'testDocumentGroup' })).resolves.not.toThrow(); - }); - - it('should not throw createLibrary', async () => { - const createLibraryMock = vi.fn(useGuidelineActionsStub.createLibrary); - - await expect( - createLibraryMock({ title: 'testLibrary', settings: { project: 4 }, mode: 'DOCUMENTLIBRARY' }), - ).resolves.not.toThrow(); - }); - - it('should not throw createLink', async () => { - const createLinkMock = vi.fn(useGuidelineActionsStub.createLink); - - await expect( - createLinkMock({ title: 'testLink', linkUrl: '/test/url', linkSettings: { newTab: true } }), - ).resolves.not.toThrow(); - }); - - it('should not throw createDocumentCategory', async () => { - const createDocumentCategoryMock = vi.fn(useGuidelineActionsStub.createDocumentCategory); - - await expect(createDocumentCategoryMock({ title: 'testCategory', documentId: 4 })).resolves.not.toThrow(); - }); - - it('should not throw createDocumentPage', async () => { - const createDocumentPageMock = vi.fn(useGuidelineActionsStub.createDocumentPage); - - await expect(createDocumentPageMock({ title: 'testPage', documentId: 5 })).resolves.not.toThrow(); - }); - - it('should not throw createCoverPage', async () => { - const createCoverPageMock = vi.fn(useGuidelineActionsStub.createCoverPage); - - await expect(createCoverPageMock({ documentId: '5', template: 'cover' })).resolves.not.toThrow(); - }); - - it('should not throw updateDocument', async () => { - const updateDocumentMock = vi.fn(useGuidelineActionsStub.updateDocument); - - await expect(updateDocumentMock({ id: 1, title: 'updateDocumentTest' })).resolves.not.toThrow(); - }); - - it('should not throw updateDocumentGroup', async () => { - const updateDocumentGroupMock = vi.fn(useGuidelineActionsStub.updateDocumentGroup); - - await expect(updateDocumentGroupMock({ id: 1, name: 'updateDocumentGroupTest' })).resolves.not.toThrow(); - }); - - it('should not throw updateLibrary', async () => { - const updateLibraryMock = vi.fn(useGuidelineActionsStub.updateLibrary); - - await expect(updateLibraryMock({ id: 1, title: 'updateTitleTest' })).resolves.not.toThrow(); - }); - - it('should not throw updateLink', async () => { - const updateLinkMock = vi.fn(useGuidelineActionsStub.updateLink); - - await expect(updateLinkMock({ id: 1, title: 'updateLinkTest' })).resolves.not.toThrow(); - }); - - it('should not throw updateDocumentCategory', async () => { - const updateDocumentCategoryMock = vi.fn(useGuidelineActionsStub.updateDocumentCategory); - - await expect( - updateDocumentCategoryMock({ id: 1, title: 'updateDocumentCategoryTest', documentId: 20 }), - ).resolves.not.toThrow(); - }); - - it('should not throw updateDocumentPage', async () => { - const updateDocumentPageMock = vi.fn(useGuidelineActionsStub.updateDocumentPage); - - await expect( - updateDocumentPageMock({ id: 1, title: 'updateDocumentPageTest', documentId: 20 }), - ).resolves.not.toThrow(); - }); - - it('should not throw updateLegacyCoverPage', async () => { - const updateLegacyCoverPageMock = vi.fn(useGuidelineActionsStub.updateLegacyCoverPage); - - await expect(updateLegacyCoverPageMock({})).resolves.not.toThrow(); - }); - - it('should not throw updateCoverPage', async () => { - const updateCoverPageMock = vi.fn(useGuidelineActionsStub.updateCoverPage); - - await expect(updateCoverPageMock({ id: 1 })).resolves.not.toThrow(); - }); - - it('should not throw updateBrandportalLink', async () => { - const updateBrandportalLinkMock = vi.fn(useGuidelineActionsStub.updateBrandportalLink); - - await expect(updateBrandportalLinkMock({})).resolves.not.toThrow(); - }); - - it('should not throw deleteDocument', async () => { - const deleteDocumentMock = vi.fn(useGuidelineActionsStub.deleteDocument); - - await expect(deleteDocumentMock({ id: 1 })).resolves.not.toThrow(); - }); - - it('should not throw deleteLibrary', async () => { - const deleteLibraryMock = vi.fn(useGuidelineActionsStub.deleteLibrary); - - await expect(deleteLibraryMock({ id: 1 })).resolves.not.toThrow(); - }); - - it('should not throw deleteLink', async () => { - const deleteLinkMock = vi.fn(useGuidelineActionsStub.deleteLink); - - await expect(deleteLinkMock({ id: 1 })).resolves.not.toThrow(); - }); - - it('should not throw deleteDocumentPage', async () => { - const deleteDocumentPageMock = vi.fn(useGuidelineActionsStub.deleteDocumentPage); - - await expect(deleteDocumentPageMock({ id: 1, documentId: 10, categoryId: null })).resolves.not.toThrow(); - }); - - it('should not throw deleteDocumentGroup', async () => { - const deleteDocumentGroupMock = vi.fn(useGuidelineActionsStub.deleteDocumentGroup); - - await expect(deleteDocumentGroupMock({ id: 1 })).resolves.not.toThrow(); - }); - - it('should not throw deleteDocumentCategory', async () => { - const deleteDocumentCategoryMock = vi.fn(useGuidelineActionsStub.deleteDocumentCategory); - - await expect(deleteDocumentCategoryMock({ id: 1, documentId: 10 })).resolves.not.toThrow(); - }); - - it('should not throw deleteCoverPage', async () => { - const deleteCoverPageMock = vi.fn(useGuidelineActionsStub.deleteCoverPage); - - await expect(deleteCoverPageMock()).resolves.not.toThrow(); - }); - - it('should not throw duplicateDocumentPage', async () => { - const duplicateDocumentPageMock = vi.fn(useGuidelineActionsStub.duplicateDocumentPage); - - await expect(duplicateDocumentPageMock({ id: 1, documentId: 5 })).resolves.not.toThrow(); - }); - - it('should not throw updateDocumentTargets', async () => { - const updateDocumentTargetsMock = vi.fn(useGuidelineActionsStub.updateDocumentTargets); - - await expect(updateDocumentTargetsMock([1, 2, 3], [203])).resolves.not.toThrow(); - }); - - it('should not throw updateDocumentPageTargets', async () => { - const updateDocumentPageTargetsMock = vi.fn(useGuidelineActionsStub.updateDocumentPageTargets); - - await expect(updateDocumentPageTargetsMock([1, 2, 3], [203])).resolves.not.toThrow(); - }); - - it('should create a link and emit an event', async () => { - const createLink = vi.spyOn(useGuidelineActionsStub, 'createLink'); - - const link: DocumentLinkCreate = { - title: 'Test Link', - documentGroupId: 1, - linkUrl: 'test/url', - linkSettings: { newTab: false }, - }; - - act(() => { - useGuidelineActionsStub.createLink(link); - }); - - await waitFor(() => { - expect(createLink).toHaveBeenCalledWith(link); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { ...DocumentDummy.with(1), documentGroupId: link.documentGroupId }, - action: 'add', - }); - }); - }); - - it('should update a link and emit an event', async () => { - const updateLink = vi.spyOn(useGuidelineActionsStub, 'updateLink'); - - const link: DocumentLinkUpdate = { - id: 1, - title: 'Updated Link', - documentGroupId: 1, - }; - - act(() => { - useGuidelineActionsStub.updateLink(link); - }); - - await waitFor(() => { - expect(updateLink).toHaveBeenCalledWith(link); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { ...DocumentDummy.with(1), documentGroupId: link.documentGroupId }, - action: 'update', - }); - }); - }); - - it('should delete a link and emit an event', async () => { - const deleteLink = vi.spyOn(useGuidelineActionsStub, 'deleteLink'); - - const documentId = 1; - - act(() => { - useGuidelineActionsStub.deleteLink({ id: documentId }); - }); - - await waitFor(() => { - expect(deleteLink).toHaveBeenCalledWith({ id: documentId }); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { id: documentId }, - action: 'delete', - }); - }); - }); - - it('should create a library and emit an event', async () => { - const createLibrary = vi.spyOn(useGuidelineActionsStub, 'createLibrary'); - - const library: DocumentLibraryCreate = { - title: 'Test Library', - documentGroupId: 1, - mode: 'DOCUMENTLIBRARY', - settings: { - project: 1, - }, - }; - - act(() => { - useGuidelineActionsStub.createLibrary(library); - }); - - await waitFor(() => { - expect(createLibrary).toHaveBeenCalledWith(library); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { ...DocumentDummy.with(1), documentGroupId: library.documentGroupId }, - action: 'add', - }); - }); - }); - - it('should update a library and emit an event', async () => { - const updateLibrary = vi.spyOn(useGuidelineActionsStub, 'updateLibrary'); - - const library: DocumentLibraryUpdate = { - id: 1, - title: 'Updated Library', - documentGroupId: 1, - }; - - act(() => { - useGuidelineActionsStub.updateLibrary(library); - }); - - await waitFor(() => { - expect(updateLibrary).toHaveBeenCalledWith(library); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { ...DocumentDummy.with(1), documentGroupId: library.documentGroupId }, - action: 'update', - }); - }); - }); - - it('should delete a library and emit an event', async () => { - const deleteLibrary = vi.spyOn(useGuidelineActionsStub, 'deleteLibrary'); - - const documentId = 1; - - act(() => { - useGuidelineActionsStub.deleteLibrary({ id: documentId }); - }); - - await waitFor(() => { - expect(deleteLibrary).toHaveBeenCalledWith({ id: documentId }); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { id: documentId }, - action: 'delete', - }); - }); - }); - - it('should create a standard document and emit an event', async () => { - const createStandardDocument = vi.spyOn(useGuidelineActionsStub, 'createDocument'); - - const documentCreationParameters: DocumentStandardCreate = { - title: 'Test Standard Document', - documentGroupId: 1, - }; - - act(() => { - useGuidelineActionsStub.createDocument(documentCreationParameters); - }); - - await waitFor(() => { - expect(createStandardDocument).toHaveBeenCalledWith(documentCreationParameters); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { ...DocumentDummy.with(1), documentGroupId: documentCreationParameters.documentGroupId }, - action: 'add', - }); - }); - }); - - it('should update a standard document and emit an event', async () => { - const updateStandardDocument = vi.spyOn(useGuidelineActionsStub, 'updateDocument'); - - const document: DocumentStandardUpdate = { - id: 1, - title: 'Updated Standard Document', - documentGroupId: 1, - }; - - act(() => { - useGuidelineActionsStub.updateDocument(document); - }); - - await waitFor(() => { - expect(updateStandardDocument).toHaveBeenCalledWith(document); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { ...DocumentDummy.with(1), documentGroupId: document.documentGroupId }, - action: 'update', - }); - }); - }); - - it('should delete a standard document and emit an event', async () => { - const deleteStandardDocument = vi.spyOn(useGuidelineActionsStub, 'deleteDocument'); - - const documentId = 1; - - act(() => { - useGuidelineActionsStub.deleteDocument({ id: documentId }); - }); - - await waitFor(() => { - expect(deleteStandardDocument).toHaveBeenCalledWith({ id: documentId }); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocument:Action', { - document: { id: documentId }, - action: 'delete', - }); - }); - }); - - it('should create a cover page and emit an event', async () => { - const createCoverPage = vi.spyOn(useGuidelineActionsStub, 'createCoverPage'); - - const coverPage: CoverPageCreate = { - template: 'blank', - documentId: '1', - }; - - act(() => { - useGuidelineActionsStub.createCoverPage(coverPage); - }); - - await waitFor(() => { - expect(createCoverPage).toHaveBeenCalledWith(coverPage); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineCoverPage:Action', { - coverPage: CoverPageDummy.with(1), - action: 'add', - }); - }); - }); - - it('should update a cover page and emit an event', async () => { - const updateCoverPage = vi.spyOn(useGuidelineActionsStub, 'updateCoverPage'); - - const coverPage: CoverPageUpdate = { - id: 1, - draft: false, - enabled: true, - }; - - act(() => { - useGuidelineActionsStub.updateCoverPage(coverPage); - }); - - await waitFor(() => { - expect(updateCoverPage).toHaveBeenCalledWith(coverPage); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineCoverPage:Action', { - coverPage: CoverPageDummy.with(1), - action: 'update', - }); - }); - }); - - it('should update a legacy cover page and emit an event', async () => { - const updateLegacyCoverPage = vi.spyOn(useGuidelineActionsStub, 'updateLegacyCoverPage'); - - const legacyCoverPage: Partial = { - draft: false, - enabled: true, - title: 'Legacy Cover Page', - }; - - act(() => { - useGuidelineActionsStub.updateLegacyCoverPage(legacyCoverPage); - }); - - await waitFor(() => { - expect(updateLegacyCoverPage).toHaveBeenCalledWith(legacyCoverPage); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineCoverPage:Action', { - coverPage: legacyCoverPage, - action: 'update', - }); - }); - }); - - it('should delete a cover page and emit an event', async () => { - const deleteCoverPage = vi.spyOn(useGuidelineActionsStub, 'deleteCoverPage'); - - act(() => { - useGuidelineActionsStub.deleteCoverPage(); - }); - - await waitFor(() => { - expect(deleteCoverPage).toHaveBeenCalled(); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineCoverPage:Action', { - action: 'delete', - }); - }); - }); - - it('should update a brandportal link and emit an event', async () => { - const updateBrandportalLink = vi.spyOn(useGuidelineActionsStub, 'updateBrandportalLink'); - - const brandportalLink: BrandportalLink = { - label: 'Updated BrandportalLink', - url: 'https://www.example.com', - enabled: true, - }; - - act(() => { - useGuidelineActionsStub.updateBrandportalLink(brandportalLink); - }); - - await waitFor(() => { - expect(updateBrandportalLink).toHaveBeenCalledWith(brandportalLink); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineBrandportalLink:Action', { - brandportalLink: BrandportalLinkDummy.with(), - action: 'update', - }); - }); - }); - - it('should create a document group and emit an event', async () => { - const createDocumentGroup = vi.spyOn(useGuidelineActionsStub, 'createDocumentGroup'); - - const group: DocumentGroupCreate = { - name: 'Test Document Group', - }; - - act(() => { - useGuidelineActionsStub.createDocumentGroup(group); - }); - - await waitFor(() => { - expect(createDocumentGroup).toHaveBeenCalledWith(group); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup: DocumentGroupDummy.with(1), - action: 'add', - }); - }); - }); - - it('should update a document group and emit an event', async () => { - const updateDocumentGroup = vi.spyOn(useGuidelineActionsStub, 'updateDocumentGroup'); - - const documentGroupUpdate: DocumentGroupUpdate = { - id: 1, - name: 'Updated Document Group', - }; - - const documentGroup = DocumentGroupDummy.with(1); - - act(() => { - useGuidelineActionsStub.updateDocumentGroup(documentGroupUpdate); - }); - - await waitFor(() => { - expect(updateDocumentGroup).toHaveBeenCalledWith(documentGroupUpdate); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup, - action: 'update', - }); - }); - }); - - it('should delete a document group and emit an event', async () => { - const deleteDocumentGroup = vi.spyOn(useGuidelineActionsStub, 'deleteDocumentGroup'); - - const id = 1; - - act(() => { - useGuidelineActionsStub.deleteDocumentGroup({ id }); - }); - - await waitFor(() => { - expect(deleteDocumentGroup).toHaveBeenCalledWith({ id }); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup: { id }, - action: 'delete', - }); - }); - }); - - it('should create a document category and emit an event', async () => { - const createDocumentCategory = vi.spyOn(useGuidelineActionsStub, 'createDocumentCategory'); - - const documentCategoryCreationParameters: DocumentCategoryCreate = { - title: 'Test Document Category', - documentId: 1, - }; - - act(() => { - useGuidelineActionsStub.createDocumentCategory(documentCategoryCreationParameters); - }); - - await waitFor(() => { - expect(createDocumentCategory).toHaveBeenCalledWith(documentCategoryCreationParameters); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory: DocumentCategoryDummy.with(1), - action: 'add', - }); - }); - }); - - it('should update a document category and emit an event', async () => { - const updateDocumentCategory = vi.spyOn(useGuidelineActionsStub, 'updateDocumentCategory'); - - const updatedDocumentCategory: DocumentCategoryUpdate = { - id: 1, - title: 'Updated Document Category', - documentId: 15, - }; - - const documentCategory = DocumentCategoryDummy.with(1); - - act(() => { - useGuidelineActionsStub.updateDocumentCategory(updatedDocumentCategory); - }); - - await waitFor(() => { - expect(updateDocumentCategory).toHaveBeenCalledWith(updatedDocumentCategory); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory, - action: 'update', - }); - }); - }); - - it('should delete a document category and emit an event', async () => { - const deleteDocumentCategory = vi.spyOn(useGuidelineActionsStub, 'deleteDocumentCategory'); - - const documentCategory = { id: 1, documentId: 16 }; - - act(() => { - useGuidelineActionsStub.deleteDocumentCategory(documentCategory); - }); - - await waitFor(() => { - expect(deleteDocumentCategory).toHaveBeenCalledWith(documentCategory); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory: { id: documentCategory.id, documentId: 16 }, - action: 'delete', - }); - }); - }); - - it('should create a page and emit an event', async () => { - const createDocumentPage = vi.spyOn(useGuidelineActionsStub, 'createDocumentPage'); - - const page: DocumentPageCreate = { - title: 'Test Page', - documentId: 1, - }; - - act(() => { - useGuidelineActionsStub.createDocumentPage(page); - }); - - await waitFor(() => { - expect(createDocumentPage).toHaveBeenCalledWith(page); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentPage:Action', { - documentPage: DocumentPageDummy.with(1), - action: 'add', - }); - }); - }); - - it('should update a page and emit an event', async () => { - const documentPage = DocumentPageDummy.with(1); - const updateDocumentPage = vi.spyOn(useGuidelineActionsStub, 'updateDocumentPage'); - - const page: DocumentPageUpdate = { - id: 1, - title: 'Updated Page', - documentId: 25, - }; - - act(() => { - useGuidelineActionsStub.updateDocumentPage(page); - }); - - await waitFor(() => { - expect(updateDocumentPage).toHaveBeenCalledWith(page); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentPage:Action', { - action: 'update', - documentPage, - }); - }); - }); - - it('should delete a page and emit an event', async () => { - const deleteDocumentPage = vi.spyOn(useGuidelineActionsStub, 'deleteDocumentPage'); - - const page = { id: 1, documentId: 22 }; - - act(() => { - useGuidelineActionsStub.deleteDocumentPage(page); - }); - - await waitFor(() => { - expect(deleteDocumentPage).toHaveBeenCalledWith(page); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentPage:Action', { - documentPage: { id: page.id, documentId: 22, categoryId: null }, - action: 'delete', - }); - }); - }); - - it('should duplicate a page and emit an event', async () => { - const duplicateDocumentPage = vi.spyOn(useGuidelineActionsStub, 'duplicateDocumentPage'); - - const originalDocumentPage = { - id: 2341, - documentId: 10, - categoryId: 1138, - }; - - act(() => { - useGuidelineActionsStub.duplicateDocumentPage(originalDocumentPage); - }); - - await waitFor(() => { - expect(duplicateDocumentPage).toHaveBeenCalledWith(originalDocumentPage); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentPage:Action', { - documentPage: { - ...DocumentPageDummy.with(originalDocumentPage.id), - documentId: originalDocumentPage.documentId, - categoryId: originalDocumentPage.categoryId, - }, - action: 'add', - }); - }); - }); - - it('should update document targets and emit all events', async () => { - const updateDocumentTargets = vi.spyOn(useGuidelineActionsStub, 'updateDocumentTargets'); - - const targets = [1, 2, 3]; - const documentIds = [204]; - - act(() => { - useGuidelineActionsStub.updateDocumentTargets(targets, documentIds); - }); - - await waitFor(() => { - expect(updateDocumentTargets).toHaveBeenCalledWith(targets, documentIds); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentTargets:Action', { - payload: { - targets, - documentIds, - }, - action: 'update', - }); - }); - }); - - it('should update document page targets and emit all events', async () => { - const updateDocumentPageTargets = vi.spyOn(useGuidelineActionsStub, 'updateDocumentPageTargets'); - - const targets = [1, 2, 3]; - const documentPageIds = [204]; - - act(() => { - useGuidelineActionsStub.updateDocumentPageTargets(targets, documentPageIds); - }); - - await waitFor(() => { - expect(updateDocumentPageTargets).toHaveBeenCalledWith(targets, documentPageIds); - expect(emitSpy).toHaveBeenCalledWith('AppBridge:GuidelineDocumentPageTargets:Action', { - payload: { targets, pageIds: documentPageIds }, - action: 'update', - }); - }); - }); - - it('should move an uncategorized document page within the same document', async () => { - const DOCUMENT_PAGE_1 = DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: null, - }); - - const appBridge = getAppBridgeThemeStub(); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - const moveDocumentPageSpy = vi - .spyOn(appBridge, 'moveDocumentPage') - .mockResolvedValueOnce({ ...DOCUMENT_PAGE_1, sort: 2 }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - const { result: uncategorizedDocumentPages } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_1), - ); - - await waitFor(() => { - expect(uncategorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_1.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - - guidelineActions.current.moveDocumentPage(DOCUMENT_PAGE_1, DOCUMENT_ID_1, 2); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...DOCUMENT_PAGE_1, - sort: 1, - categoryId: null, - }, - categoryId: null, - documentId: DOCUMENT_ID_1, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 2 }, action: 'move' }, - ], - ['AppBridge:GuidelineDocument:DocumentPageAction', { documentPage: DOCUMENT_PAGE_1, action: 'delete' }], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 2 }, action: 'add' }, - ], - ]); - - expect(uncategorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_1.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - }); - - it('should move a categorized document page within the same document category', async () => { - const DOCUMENT_PAGE_1 = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }); - - const appBridge = getAppBridgeThemeStub(); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - const moveDocumentPageSpy = vi - .spyOn(appBridge, 'moveDocumentPage') - .mockResolvedValueOnce({ ...DOCUMENT_PAGE_1, sort: 3 }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - const { result: categorizedDocumentPages } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_1), - ); - - await waitFor(() => { - expect(categorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_1.id, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - - guidelineActions.current.moveDocumentPage(DOCUMENT_PAGE_1, DOCUMENT_ID_1, 3, DOCUMENT_CATEGORY_ID_1); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...DOCUMENT_PAGE_1, - sort: 1, - }, - categoryId: DOCUMENT_CATEGORY_ID_1, - documentId: DOCUMENT_ID_1, - position: 3, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 3 }, action: 'move' }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { documentPage: DOCUMENT_PAGE_1, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 3 }, action: 'add' }, - ], - ]); - - expect(categorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_1.id, - DOCUMENT_PAGE_ID_4, - ]); - }); - }); - - it('should move a categorized document page to uncategorized within the same document', async () => { - const DOCUMENT_PAGE_1 = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchUncategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getUncategorizedDocumentPagesByDocumentId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentPageSpy = vi - .spyOn(appBridge, 'moveDocumentPage') - .mockResolvedValueOnce({ ...DOCUMENT_PAGE_1, sort: 3, categoryId: null }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - const { result: categorizedDocumentPages } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_1), - ); - const { result: uncategorizedDocumentPages } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_1), - ); - - await waitFor(() => { - expect(categorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_1.id, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - - expect(uncategorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - - // Mock the response of the add in uncategorized hook call - fetchUncategorizedDocumentPagesSpy.mockResolvedValue([ - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 2, - }), - { ...DOCUMENT_PAGE_1, sort: 3, categoryId: null }, - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 4, - }), - ]); - - guidelineActions.current.moveDocumentPage(DOCUMENT_PAGE_1, DOCUMENT_ID_1, 2, null); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - expect(fetchUncategorizedDocumentPagesSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...DOCUMENT_PAGE_1, - sort: 1, - }, - categoryId: null, - documentId: DOCUMENT_ID_1, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 1 }, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 3, categoryId: null }, action: 'add' }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { documentPage: DOCUMENT_PAGE_1, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { documentPage: { ...DOCUMENT_PAGE_1, sort: 3, categoryId: null }, action: 'add' }, - ], - ]); - - expect(categorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - - expect(uncategorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_1.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - }); - - it('should move an uncategorized document page to a document category within the same document', async () => { - const UNCATEGORIZED_DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: null, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchCategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentPageSpy = vi - .spyOn(appBridge, 'moveDocumentPage') - .mockResolvedValueOnce({ ...UNCATEGORIZED_DOCUMENT_PAGE, sort: 2, categoryId: DOCUMENT_CATEGORY_ID_1 }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - const { result: categorizedDocumentPages } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_1), - ); - const { result: uncategorizedDocumentPages } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_1), - ); - - await waitFor(() => { - expect(uncategorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - - expect(categorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - - // Mock the response of the add in uncategorized hook call - fetchCategorizedDocumentPagesSpy.mockResolvedValue([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: DOCUMENT_CATEGORY_ID_1, sort: 1 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: DOCUMENT_CATEGORY_ID_1, sort: 2 }), - { ...UNCATEGORIZED_DOCUMENT_PAGE, sort: 3, categoryId: DOCUMENT_CATEGORY_ID_1 }, - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: DOCUMENT_CATEGORY_ID_1, sort: 4 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: DOCUMENT_CATEGORY_ID_1, sort: 5 }), - ]); - - guidelineActions.current.moveDocumentPage( - UNCATEGORIZED_DOCUMENT_PAGE, - DOCUMENT_ID_1, - 2, - DOCUMENT_CATEGORY_ID_1, - ); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - expect(fetchCategorizedDocumentPagesSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 1, - documentId: DOCUMENT_ID_1, - categoryId: null, - }, - categoryId: DOCUMENT_CATEGORY_ID_1, - documentId: DOCUMENT_ID_1, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { documentPage: { ...UNCATEGORIZED_DOCUMENT_PAGE, sort: 1, categoryId: null }, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { ...UNCATEGORIZED_DOCUMENT_PAGE, sort: 2, categoryId: DOCUMENT_CATEGORY_ID_1 }, - action: 'add', - }, - ], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { documentPage: UNCATEGORIZED_DOCUMENT_PAGE, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { - documentPage: { ...UNCATEGORIZED_DOCUMENT_PAGE, sort: 2, categoryId: DOCUMENT_CATEGORY_ID_1 }, - action: 'add', - }, - ], - ]); - - expect(uncategorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - - expect(categorizedDocumentPages.current.documentPages.map((documentPage) => documentPage.id)).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE.id, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - }); - - it('should move an uncategorized document page to another document as uncategorized', async () => { - const UNCATEGORIZED_DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_4, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 1, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchUncategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getUncategorizedDocumentPagesByDocumentId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentPageSpy = vi.spyOn(appBridge, 'moveDocumentPage').mockResolvedValueOnce({ - ...UNCATEGORIZED_DOCUMENT_PAGE, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 2, - }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - // Mock the response to add an extra category to the document - fetchUncategorizedDocumentPagesSpy.mockResolvedValueOnce([ - UNCATEGORIZED_DOCUMENT_PAGE, - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 2, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 3, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 4, - }), - ]); - - const { result: uncategorizedDocumentPagesInDocumentId1 } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_1), - ); - - await waitFor(() => { - expect( - uncategorizedDocumentPagesInDocumentId1.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - - const { result: uncategorizedDocumentPagesInDocumentId2 } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_2), - ); - - await waitFor(() => { - expect( - uncategorizedDocumentPagesInDocumentId2.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - - // Mock the response of the add in uncategorized hook call - fetchUncategorizedDocumentPagesSpy.mockResolvedValueOnce([ - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 2, - }), - { ...UNCATEGORIZED_DOCUMENT_PAGE, documentId: DOCUMENT_ID_2, categoryId: null, sort: 3 }, - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 4, - }), - ]); - - guidelineActions.current.moveDocumentPage(UNCATEGORIZED_DOCUMENT_PAGE, DOCUMENT_ID_2, 2, null); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - expect(fetchUncategorizedDocumentPagesSpy).toHaveBeenCalledTimes(2); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 1, - documentId: DOCUMENT_ID_1, - categoryId: null, - }, - categoryId: null, - documentId: DOCUMENT_ID_2, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 1, - documentId: DOCUMENT_ID_1, - categoryId: null, - }, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: null, - }, - action: 'add', - }, - ], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { documentPage: { ...UNCATEGORIZED_DOCUMENT_PAGE, documentId: DOCUMENT_ID_1 }, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: null, - }, - action: 'add', - }, - ], - ]); - - expect( - uncategorizedDocumentPagesInDocumentId1.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - - expect( - uncategorizedDocumentPagesInDocumentId2.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - }); - - it('should move a categorized document page to another document as uncategorized', async () => { - const DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_5, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 5, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchCategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - const fetchUncategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getUncategorizedDocumentPagesByDocumentId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentPageSpy = vi.spyOn(appBridge, 'moveDocumentPage').mockResolvedValueOnce({ - ...DOCUMENT_PAGE, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 2, - }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - // Mock the response to add an extra category to the document category - fetchCategorizedDocumentPagesSpy.mockResolvedValueOnce([ - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 2, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 3, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_4, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 4, - }), - DOCUMENT_PAGE, - ]); - - const { result: categorizedDocumentPagesInDocumentCategoryId1 } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_1), - ); - - await waitFor(() => { - expect( - categorizedDocumentPagesInDocumentCategoryId1.current.documentPages.map( - (documentPage) => documentPage.id, - ), - ).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - DOCUMENT_PAGE.id, - ]); - }); - - const { result: uncategorizedDocumentPagesInDocumentId2 } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_2), - ); - - await waitFor(() => { - expect( - uncategorizedDocumentPagesInDocumentId2.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - - // Mock the response of the add in uncategorized hook call - fetchUncategorizedDocumentPagesSpy.mockResolvedValueOnce([ - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 2, - }), - { ...DOCUMENT_PAGE, documentId: DOCUMENT_ID_2, categoryId: null, sort: 3 }, - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 4, - }), - ]); - - guidelineActions.current.moveDocumentPage(DOCUMENT_PAGE, DOCUMENT_ID_2, 2, null); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - expect(fetchUncategorizedDocumentPagesSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 5, - documentId: DOCUMENT_ID_1, - }, - categoryId: null, - documentId: DOCUMENT_ID_2, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 5, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: null, - }, - action: 'add', - }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { - documentPage: { - ...DOCUMENT_PAGE, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: null, - }, - action: 'add', - }, - ], - ]); - - expect( - categorizedDocumentPagesInDocumentCategoryId1.current.documentPages.map( - (documentPage) => documentPage.id, - ), - ).toEqual([DOCUMENT_PAGE_ID_1, DOCUMENT_PAGE_ID_2, DOCUMENT_PAGE_ID_3, DOCUMENT_PAGE_ID_4]); - - expect( - uncategorizedDocumentPagesInDocumentId2.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - }); - - it('should move an uncategorized document page to another document as categorized', async () => { - const UNCATEGORIZED_DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_5, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 1, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchUncategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getUncategorizedDocumentPagesByDocumentId'); - const fetchCategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentPageSpy = vi.spyOn(appBridge, 'moveDocumentPage').mockResolvedValueOnce({ - ...UNCATEGORIZED_DOCUMENT_PAGE, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 2, - }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - // Mock the response to add an extra category to the document - fetchUncategorizedDocumentPagesSpy.mockResolvedValueOnce([ - UNCATEGORIZED_DOCUMENT_PAGE, - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 2, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 3, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_1, - categoryId: null, - sort: 4, - }), - ]); - - const { result: uncategorizedDocumentPagesInDocumentId1 } = renderHook(() => - useUncategorizedDocumentPages(appBridge, DOCUMENT_ID_1), - ); - - await waitFor(() => { - expect( - uncategorizedDocumentPagesInDocumentId1.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE.id, - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - }); - - const { result: categorizedDocumentPagesInDocumentId2 } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_1), - ); - - await waitFor(() => { - expect( - categorizedDocumentPagesInDocumentId2.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([DOCUMENT_PAGE_ID_1, DOCUMENT_PAGE_ID_2, DOCUMENT_PAGE_ID_3, DOCUMENT_PAGE_ID_4]); - }); - - // Mock the response of the add in uncategorized hook call - fetchCategorizedDocumentPagesSpy.mockResolvedValueOnce([ - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 2, - }), - { ...UNCATEGORIZED_DOCUMENT_PAGE, documentId: DOCUMENT_ID_2, categoryId: null, sort: 3 }, - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 4, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_4, - documentId: DOCUMENT_ID_2, - categoryId: null, - sort: 5, - }), - ]); - - guidelineActions.current.moveDocumentPage( - UNCATEGORIZED_DOCUMENT_PAGE, - DOCUMENT_ID_2, - 2, - DOCUMENT_CATEGORY_ID_1, - ); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - expect(fetchUncategorizedDocumentPagesSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 1, - documentId: DOCUMENT_ID_1, - }, - categoryId: DOCUMENT_CATEGORY_ID_1, - documentId: DOCUMENT_ID_2, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 1, - documentId: DOCUMENT_ID_1, - categoryId: null, - }, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - action: 'add', - }, - ], - [ - 'AppBridge:GuidelineDocument:DocumentPageAction', - { documentPage: { ...UNCATEGORIZED_DOCUMENT_PAGE, documentId: DOCUMENT_ID_1 }, action: 'delete' }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { - documentPage: { - ...UNCATEGORIZED_DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - action: 'add', - }, - ], - ]); - - expect( - uncategorizedDocumentPagesInDocumentId1.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - ]); - - expect( - categorizedDocumentPagesInDocumentId2.current.documentPages.map((documentPage) => documentPage.id), - ).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - UNCATEGORIZED_DOCUMENT_PAGE.id, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - }); - - it('should move a categorized document page to another document as categorized', async () => { - const DOCUMENT_PAGE = DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_5, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 5, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchCategorizedDocumentPagesSpy = vi.spyOn(appBridge, 'getDocumentPagesByDocumentCategoryId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentPageSpy = vi.spyOn(appBridge, 'moveDocumentPage').mockResolvedValueOnce({ - ...DOCUMENT_PAGE, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - sort: 2, - }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - // Mock the response to add an extra category to the document category - fetchCategorizedDocumentPagesSpy.mockResolvedValueOnce([ - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 2, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 3, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_4, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - sort: 4, - }), - DOCUMENT_PAGE, - ]); - - const { result: categorizedDocumentPagesInDocumentCategoryId1 } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_1), - ); - - await waitFor(() => { - expect( - categorizedDocumentPagesInDocumentCategoryId1.current.documentPages.map( - (documentPage) => documentPage.id, - ), - ).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - DOCUMENT_PAGE.id, - ]); - }); - - const { result: categorizedDocumentPagesInDocumentCategoryId2 } = renderHook(() => - useCategorizedDocumentPages(appBridge, DOCUMENT_CATEGORY_ID_2), - ); - - await waitFor(() => { - expect( - categorizedDocumentPagesInDocumentCategoryId2.current.documentPages.map( - (documentPage) => documentPage.id, - ), - ).toEqual([DOCUMENT_PAGE_ID_1, DOCUMENT_PAGE_ID_2, DOCUMENT_PAGE_ID_3, DOCUMENT_PAGE_ID_4]); - }); - - // Mock the response of the add in uncategorized hook call - fetchCategorizedDocumentPagesSpy.mockResolvedValueOnce([ - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_1, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_2, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - sort: 2, - }), - { ...DOCUMENT_PAGE, documentId: DOCUMENT_ID_2, categoryId: DOCUMENT_CATEGORY_ID_2, sort: 3 }, - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_3, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - sort: 4, - }), - DocumentPageDummy.withFields({ - id: DOCUMENT_PAGE_ID_4, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - sort: 4, - }), - ]); - - guidelineActions.current.moveDocumentPage(DOCUMENT_PAGE, DOCUMENT_ID_2, 2, null); - - expect(moveDocumentPageSpy).toHaveBeenCalledOnce(); - expect(fetchCategorizedDocumentPagesSpy).toHaveBeenCalledTimes(2); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentPage:MoveEvent', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 5, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - categoryId: null, - documentId: DOCUMENT_ID_2, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 5, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocumentPage:Action', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - }, - action: 'add', - }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { - documentPage: { - ...DOCUMENT_PAGE, - documentId: DOCUMENT_ID_1, - categoryId: DOCUMENT_CATEGORY_ID_1, - }, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction', - { - documentPage: { - ...DOCUMENT_PAGE, - sort: 2, - documentId: DOCUMENT_ID_2, - categoryId: DOCUMENT_CATEGORY_ID_2, - }, - action: 'add', - }, - ], - ]); - - expect( - categorizedDocumentPagesInDocumentCategoryId1.current.documentPages.map( - (documentPage) => documentPage.id, - ), - ).toEqual([DOCUMENT_PAGE_ID_1, DOCUMENT_PAGE_ID_2, DOCUMENT_PAGE_ID_3, DOCUMENT_PAGE_ID_4]); - - expect( - categorizedDocumentPagesInDocumentCategoryId2.current.documentPages.map( - (documentPage) => documentPage.id, - ), - ).toEqual([ - DOCUMENT_PAGE_ID_1, - DOCUMENT_PAGE_ID_2, - DOCUMENT_PAGE.id, - DOCUMENT_PAGE_ID_3, - DOCUMENT_PAGE_ID_4, - ]); - }); - }); - - it('should move an ungrouped document and emit 2 events', async () => { - const DOCUMENT = DocumentDummy.withFields({ ...DocumentDummy.with(DOCUMENT_ID_5), sort: 5 }); - - const appBridge = getAppBridgeThemeStub(); - const fetchDocumentsSpy = vi.spyOn(appBridge, 'getUngroupedDocuments'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentSpy = vi.spyOn(appBridge, 'moveDocument').mockResolvedValueOnce({ - ...DOCUMENT, - sort: 2, - }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - // Mock the response to add an extra category to the document category - fetchDocumentsSpy.mockResolvedValueOnce([ - DocumentDummy.withFields({ ...DocumentDummy.with(DOCUMENT_ID_1), sort: 1 }), - DocumentDummy.withFields({ ...DocumentDummy.with(DOCUMENT_ID_2), sort: 2 }), - DocumentDummy.withFields({ ...DocumentDummy.with(DOCUMENT_ID_3), sort: 3 }), - DocumentDummy.withFields({ ...DocumentDummy.with(DOCUMENT_ID_4), sort: 4 }), - DOCUMENT, - ]); - - const { result: ungroupedDocuments } = renderHook(() => useUngroupedDocuments(appBridge)); - - await waitFor(() => { - expect(ungroupedDocuments.current.documents.map((document) => document.id)).toEqual([ - DOCUMENT_ID_1, - DOCUMENT_ID_2, - DOCUMENT_ID_3, - DOCUMENT_ID_4, - DOCUMENT_ID_5, - ]); - }); - - guidelineActions.current.moveDocument(DOCUMENT, 2); - - expect(moveDocumentSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocument:MoveEvent', - { - document: { - ...DOCUMENT, - sort: 5, - }, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocument:Action', - { - document: { - ...DOCUMENT, - sort: 2, - }, - action: 'move', - }, - ], - ]); - }); - }); - - it('should move a document into a group and emit 3 events', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentsByDocumentGroupId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - const DOCUMENT_1 = DocumentDummy.withFields({ - ...DocumentDummy.with(DOCUMENT_ID_1), - sort: 1, - }); - const DOCUMENT_2 = DocumentDummy.withFields({ - ...DocumentDummy.with(DOCUMENT_ID_2), - sort: 2, - }); - const DOCUMENT_3 = DocumentDummy.withFields({ - ...DocumentDummy.with(DOCUMENT_ID_3), - sort: 3, - }); - const DOCUMENT_4 = DocumentDummy.withFields({ - ...DocumentDummy.with(DOCUMENT_ID_4), - sort: 4, - }); - - const moveGroupSpy = spy.mockResolvedValueOnce([DOCUMENT_1, DOCUMENT_2, DOCUMENT_3, DOCUMENT_4]); - const moveGroupSpyAfter = spy.mockResolvedValueOnce([DOCUMENT_2, DOCUMENT_3, DOCUMENT_4]); - - const { result: groupedDocuments } = renderHook(() => useGroupedDocuments(appBridge, DOCUMENT_GROUP_ID_1)); - - expect(moveGroupSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(groupedDocuments.current.documents.map((document) => document.id)).toEqual([ - DOCUMENT_ID_1, - DOCUMENT_ID_2, - DOCUMENT_ID_3, - DOCUMENT_ID_4, - ]); - }); - - guidelineActions.current.moveDocument(DOCUMENT_1, 5, DOCUMENT_GROUP_ID_2); - - expect(moveGroupSpyAfter).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocument:MoveEvent', - { - document: DOCUMENT_1, - position: 5, - newGroupId: DOCUMENT_GROUP_ID_2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocument:Action', - { - document: DOCUMENT_1, - action: 'delete', - }, - ], - [ - 'AppBridge:GuidelineDocument:Action', - { - document: { - ...DOCUMENT_1, - sort: 5, - }, - action: 'add', - }, - ], - ]); - }); - }); - - it('should move a document group and emit 2 events', async () => { - const DOCUMENT_GROUP_1 = DocumentGroupDummy.withFields({ - ...DocumentGroupDummy.with(DOCUMENT_GROUP_ID_1), - sort: 1, - }); - - const appBridge = getAppBridgeThemeStub(); - const fetchDocumentGroupsSpy = vi.spyOn(appBridge, 'getDocumentGroups'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const moveDocumentGroupSpy = vi.spyOn(appBridge, 'moveDocumentGroup').mockResolvedValueOnce({ - ...DOCUMENT_GROUP_1, - sort: 2, - }); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - fetchDocumentGroupsSpy.mockResolvedValueOnce([ - DOCUMENT_GROUP_1, - DocumentGroupDummy.withFields({ ...DocumentGroupDummy.with(DOCUMENT_GROUP_ID_2), sort: 2 }), - DocumentGroupDummy.withFields({ ...DocumentGroupDummy.with(DOCUMENT_GROUP_ID_3), sort: 3 }), - ]); - - const { result: documentGroups } = renderHook(() => useDocumentGroups(appBridge)); - - await waitFor(() => { - expect(documentGroups.current.documentGroups.map((documentGroup) => documentGroup.id)).toEqual([ - DOCUMENT_GROUP_ID_1, - DOCUMENT_GROUP_ID_2, - DOCUMENT_GROUP_ID_3, - ]); - }); - - guidelineActions.current.moveDocumentGroup(DOCUMENT_GROUP_1, 2); - - expect(moveDocumentGroupSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentGroup:MoveEvent', - { - documentGroup: DOCUMENT_GROUP_1, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentGroup:Action', - { - documentGroup: { - ...DOCUMENT_GROUP_1, - sort: 2, - }, - action: 'update', - }, - ], - ]); - }); - }); - - it('should move a document category and emit 2 events', async () => { - const CATEGORY_1 = DocumentCategoryDummy.withFields({ - ...DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID_1), - sort: 1, - }); - const CATEGORY_2 = DocumentCategoryDummy.withFields({ - ...DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID_2), - sort: 2, - }); - const CATEGORY_3 = DocumentCategoryDummy.withFields({ - ...DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID_3), - sort: 3, - }); - - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'getDocumentCategoriesByDocumentId'); - const emitSpy = vi.spyOn(window.emitter, 'emit'); - - const { result: guidelineActions } = renderHook(() => useGuidelineActions(appBridge)); - - const categoriesSpy = spy.mockResolvedValueOnce([CATEGORY_1, CATEGORY_2, CATEGORY_3]); - - const { result: documentCategories } = renderHook(() => useDocumentCategories(appBridge, DOCUMENT_ID_1)); - - expect(categoriesSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect( - documentCategories.current.documentCategories.map((documentCategory) => documentCategory.id), - ).toEqual([DOCUMENT_CATEGORY_ID_1, DOCUMENT_CATEGORY_ID_2, DOCUMENT_CATEGORY_ID_3]); - }); - - guidelineActions.current.moveDocumentCategory(CATEGORY_1, DOCUMENT_ID_1, 2); - expect(categoriesSpy).toHaveBeenCalledOnce(); - - await waitFor(() => { - expect(emitSpy.mock.calls).toEqual([ - [ - 'AppBridge:GuidelineDocumentCategory:MoveEvent', - { - documentCategory: CATEGORY_1, - documentId: DOCUMENT_ID_1, - position: 2, - action: 'movePreview', - }, - ], - [ - 'AppBridge:GuidelineDocumentCategory:Action', - { - documentCategory: { - ...CATEGORY_1, - documentId: DOCUMENT_ID_1, - sort: 2, - }, - action: 'update', - }, - ], - ]); - }); - }); -}); diff --git a/packages/app-bridge/src/react/useGuidelineActions.ts b/packages/app-bridge/src/react/useGuidelineActions.ts deleted file mode 100644 index 43aeb604d..000000000 --- a/packages/app-bridge/src/react/useGuidelineActions.ts +++ /dev/null @@ -1,671 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useCallback } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { - type BrandportalLink, - type CoverPage, - type CoverPageCreate, - type CoverPageUpdate, - type CoverPageUpdateLegacy, - type DocumentCategory, - type DocumentCategoryCreate, - type DocumentCategoryDelete, - type DocumentCategoryUpdate, - type DocumentGroup, - type DocumentGroupCreate, - type DocumentGroupDelete, - type DocumentGroupUpdate, - type DocumentLibraryCreate, - type DocumentLibraryDelete, - type DocumentLibraryUpdate, - type DocumentLinkCreate, - type DocumentLinkDelete, - type DocumentLinkUpdate, - type DocumentPage, - type DocumentPageCreate, - type DocumentPageDelete, - type DocumentPageUpdate, - type DocumentStandardCreate, - type DocumentStandardDelete, - type DocumentStandardUpdate, - type EmitterEvents, -} from '../types'; - -export const useGuidelineActions = (appBridge: AppBridgeTheme) => { - const createLink = useCallback( - async (link: DocumentLinkCreate) => { - const result = await appBridge.createLink(link); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { ...result, ...(link.documentGroupId && { documentGroupId: link.documentGroupId }) }, - action: 'add', - }); - - if (link.documentGroupId) { - window.emitter.emit('AppBridge:GuidelineDocumentGroup:DocumentAction', { - document: { id: result.id, documentGroupId: link.documentGroupId }, - action: 'add', - }); - } - - return result; - }, - [appBridge], - ); - - const updateLink = useCallback( - async (link: DocumentLinkUpdate) => { - const result = await appBridge.updateLink(link); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { ...result, ...(link.documentGroupId && { documentGroupId: link.documentGroupId }) }, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - const deleteLink = useCallback( - async (link: DocumentLinkDelete) => { - await appBridge.deleteLink(link.id); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: link, - action: 'delete', - }); - - if (link.documentGroupId) { - window.emitter.emit('AppBridge:GuidelineDocumentGroup:DocumentAction', { - document: { ...link, documentGroupId: link.documentGroupId }, - action: 'delete', - }); - } - }, - [appBridge], - ); - - const createLibrary = useCallback( - async (library: DocumentLibraryCreate) => { - const result = await appBridge.createLibrary(library); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { - ...result, - ...(library.documentGroupId && { documentGroupId: library.documentGroupId }), - }, - action: 'add', - }); - - if (library.documentGroupId) { - window.emitter.emit('AppBridge:GuidelineDocumentGroup:DocumentAction', { - document: { id: result.id, documentGroupId: library.documentGroupId }, - action: 'add', - }); - } - - return result; - }, - [appBridge], - ); - - const updateLibrary = useCallback( - async (library: DocumentLibraryUpdate) => { - const result = await appBridge.updateLibrary(library); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { - ...result, - ...(library.documentGroupId && { documentGroupId: library.documentGroupId }), - }, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - const deleteLibrary = useCallback( - async (library: DocumentLibraryDelete) => { - await appBridge.deleteLibrary(library.id); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: library, - action: 'delete', - }); - - if (library.documentGroupId) { - window.emitter.emit('AppBridge:GuidelineDocumentGroup:DocumentAction', { - document: { ...library, documentGroupId: library.documentGroupId }, - action: 'delete', - }); - } - }, - [appBridge], - ); - - const createStandardDocument = useCallback( - async (document: DocumentStandardCreate) => { - const result = await appBridge.createStandardDocument(document); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { - ...result, - ...(document.documentGroupId && { documentGroupId: document.documentGroupId }), - }, - action: 'add', - }); - - if (document.documentGroupId) { - window.emitter.emit('AppBridge:GuidelineDocumentGroup:DocumentAction', { - document: { id: result.id, documentGroupId: document.documentGroupId }, - action: 'add', - }); - } - - return result; - }, - [appBridge], - ); - - const updateStandardDocument = useCallback( - async (document: DocumentStandardUpdate) => { - const result = await appBridge.updateStandardDocument(document); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { - ...result, - ...(document.documentGroupId && { documentGroupId: document.documentGroupId }), - }, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - const deleteStandardDocument = useCallback( - async (document: DocumentStandardDelete) => { - await appBridge.deleteStandardDocument(document.id); - - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document, - action: 'delete', - }); - - if (document.documentGroupId) { - window.emitter.emit('AppBridge:GuidelineDocumentGroup:DocumentAction', { - document: { ...document, documentGroupId: document.documentGroupId }, - action: 'delete', - }); - } - }, - [appBridge], - ); - - const createDocumentGroup = useCallback( - async (documentGroup: DocumentGroupCreate) => { - const result = await appBridge.createDocumentGroup(documentGroup); - - window.emitter.emit('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup: result, - action: 'add', - }); - - return result; - }, - [appBridge], - ); - - const updateDocumentGroup = useCallback( - async (documentGroupUpdate: DocumentGroupUpdate) => { - const documentGroup = await appBridge.updateDocumentGroup(documentGroupUpdate); - - window.emitter.emit('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup, - action: 'update', - }); - }, - [appBridge], - ); - - const deleteDocumentGroup = useCallback( - async (documentGroup: DocumentGroupDelete) => { - await appBridge.deleteDocumentGroup(documentGroup.id); - - window.emitter.emit('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup, - action: 'delete', - }); - }, - [appBridge], - ); - - const createDocumentPage = useCallback( - async (documentPage: DocumentPageCreate) => { - const result = await appBridge.createDocumentPage(documentPage); - - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - documentPage: result, - action: 'add', - }); - - if (documentPage.categoryId) { - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - documentPage: { - id: result.id, - categoryId: documentPage.categoryId, - }, - action: 'add', - }); - } - - return result; - }, - [appBridge], - ); - - /** - * A method for page update - * - * @param documentPage - {@link DocumentPageUpdate} object - * @requires id - Indicates page identifier. - * - * - * and at least one of - * - * @property title - Indicates title of a page. - * @property documentId - Indicates to witch document the page belongs to. - * @property categoryId - Indicates to witch category the page belongs to. - * @property visibility - Indicates whether the page is visible only to the editor or everyone. - * @property linkUrl - Indicates whether the page is link or not. - */ - const updateDocumentPage = useCallback( - async (documentPage: DocumentPageUpdate) => { - const result = await appBridge.updateDocumentPage(documentPage); - - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - documentPage: result, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - const deleteDocumentPage = useCallback( - async (documentPage: DocumentPageDelete) => { - await appBridge.deleteDocumentPage(documentPage.id); - - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - documentPage: { ...documentPage, categoryId: documentPage.categoryId ?? null }, - action: 'delete', - }); - - if (documentPage.categoryId) { - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - documentPage: { ...documentPage, categoryId: documentPage.categoryId }, - action: 'delete', - }); - } else { - window.emitter.emit('AppBridge:GuidelineDocument:DocumentPageAction', { - documentPage, - action: 'delete', - }); - } - }, - [appBridge], - ); - - const duplicateDocumentPage = useCallback( - async ({ id, documentId, categoryId }: { id: number; documentId: number; categoryId?: number }) => { - const duplicatedDocumentPage = await appBridge.duplicateDocumentPage(id); - - window.emitter.emit('AppBridge:GuidelineDocumentPage:Action', { - documentPage: { ...duplicatedDocumentPage, documentId, categoryId } as unknown as DocumentPage, - action: 'add', - }); - - if (categoryId) { - window.emitter.emit('AppBridge:GuidelineDocumentCategory:DocumentPageAction', { - documentPage: { id: duplicatedDocumentPage.id, categoryId }, - action: 'add', - }); - } - - return duplicatedDocumentPage; - }, - [appBridge], - ); - - const createDocumentCategory = useCallback( - async (category: DocumentCategoryCreate) => { - const result = await appBridge.createDocumentCategory(category); - - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory: result, - action: 'add', - }); - - window.emitter.emit('AppBridge:GuidelineDocument:DocumentCategoryAction', { - documentCategory: result, - action: 'add', - }); - - return result; - }, - [appBridge], - ); - - const updateDocumentCategory = useCallback( - async (category: DocumentCategoryUpdate) => { - const documentCategory = await appBridge.updateDocumentCategory(category); - - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory, - action: 'update', - }); - }, - [appBridge], - ); - - const deleteDocumentCategory = useCallback( - async (documentCategory: DocumentCategoryDelete) => { - await appBridge.deleteDocumentCategory(documentCategory.id); - - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory, - action: 'delete', - }); - - window.emitter.emit('AppBridge:GuidelineDocument:DocumentCategoryAction', { - documentCategory, - action: 'delete', - }); - }, - [appBridge], - ); - - const createCoverPage = useCallback( - async (coverPage: CoverPageCreate) => { - const result = await appBridge.createCoverPage(coverPage); - - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { - coverPage: result, - action: 'add', - }); - - return result; - }, - [appBridge], - ); - - const updateCoverPage = useCallback( - async (coverPage: CoverPageUpdate) => { - const result = await appBridge.updateCoverPage(coverPage); - - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { - coverPage: result, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - /** - * @deprecated legacy method, should be removed once new endpoint is available - */ - const updateLegacyCoverPage = useCallback( - async (coverPage: Partial) => { - const legacyCoverPage: CoverPageUpdateLegacy = { - ...(coverPage.title && { brandhome_title: coverPage.title }), - ...(coverPage.draft !== undefined && { brandhome_draft: coverPage.draft }), - ...(coverPage.hideInNav !== undefined && { brandhome_hide_in_nav: coverPage.hideInNav }), - }; - - const result = await appBridge.updateLegacyCoverPage(legacyCoverPage); - - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { - coverPage: coverPage as CoverPage, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - const deleteCoverPage = useCallback(async () => { - await appBridge.deleteCoverPage(); - - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { - action: 'delete', - }); - }, [appBridge]); - - const updateBrandportalLink = useCallback( - async (brandportalLink: Partial) => { - const result = await appBridge.updateBrandportalLink(brandportalLink); - - if (result) { - window.emitter.emit('AppBridge:GuidelineBrandportalLink:Action', { - brandportalLink: result as BrandportalLink, - action: 'update', - }); - } - - return result; - }, - [appBridge], - ); - - const moveDocument = useCallback( - async ( - document: { id: number; sort?: Nullable; documentGroupId?: Nullable }, - position: number, - newGroupId?: number, - ) => { - const previewUpdateChannel: keyof EmitterEvents = 'AppBridge:GuidelineDocument:MoveEvent'; - window.emitter.emit(previewUpdateChannel, { - document, - position, - newGroupId, - action: 'movePreview', - }); - - const result = await appBridge.moveDocument(document.id, position, newGroupId); - - const channel: keyof EmitterEvents = 'AppBridge:GuidelineDocument:Action'; - - // Emits in `useDocumentGroups` hook - if (document.documentGroupId === newGroupId) { - window.emitter.emit(channel, { - document: { ...result, sort: position }, - action: 'move', - }); - } else { - window.emitter.emit(channel, { - document, - action: 'delete', - }); - - window.emitter.emit(channel, { - document: result, - action: 'add', - }); - } - }, - [appBridge], - ); - - const moveDocumentGroup = useCallback( - async (documentGroup: { id: number; sort?: Nullable }, position: number) => { - const previewUpdateChannel: keyof EmitterEvents = 'AppBridge:GuidelineDocumentGroup:MoveEvent'; - window.emitter.emit(previewUpdateChannel, { - documentGroup, - position, - action: 'movePreview', - }); - - await appBridge.moveDocumentGroup(documentGroup.id, position); - - window.emitter.emit('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup: { ...documentGroup, sort: position } as DocumentGroup, - action: 'update', - }); - }, - [appBridge], - ); - - const moveDocumentCategory = useCallback( - async (documentCategory: { id: number; sort?: Nullable }, documentId: number, position: number) => { - const previewUpdateChannel: keyof EmitterEvents = 'AppBridge:GuidelineDocumentCategory:MoveEvent'; - window.emitter.emit(previewUpdateChannel, { - documentCategory, - documentId, - position, - action: 'movePreview', - }); - - await appBridge.moveDocumentCategory(documentCategory.id, documentId, position); - - window.emitter.emit('AppBridge:GuidelineDocumentCategory:Action', { - documentCategory: { ...documentCategory, documentId, sort: position } as DocumentCategory, - action: 'update', - }); - }, - [appBridge], - ); - - const moveDocumentPage = useCallback( - async ( - documentPage: { - id: number; - documentId: number; - sort?: Nullable; - categoryId?: Nullable; - }, - documentId: number, - position?: number, - categoryId: Nullable = null, - ) => { - const previewUpdateChannel: keyof EmitterEvents = 'AppBridge:GuidelineDocumentPage:MoveEvent'; - window.emitter.emit(previewUpdateChannel, { - documentPage, - documentId, - position, - categoryId, - action: 'movePreview', - }); - - const result = await appBridge.moveDocumentPage( - documentPage.id, - documentId, - position, - categoryId ?? undefined, - ); - - const channel: keyof EmitterEvents = 'AppBridge:GuidelineDocumentPage:Action'; - - // Emits in `useCategorizedDocumentPages` and `useUncategorizedDocumentPages` hooks - if (documentPage.categoryId === categoryId && documentPage.documentId === documentId) { - window.emitter.emit(channel, { - documentPage: { ...result, sort: position ?? result.sort }, - action: 'move', - }); - } else { - window.emitter.emit(channel, { - documentPage: { ...documentPage, categoryId: documentPage.categoryId ?? null }, - action: 'delete', - }); - - window.emitter.emit(channel, { - documentPage: result, - action: 'add', - }); - } - - // Emits in `useDocumentCategories` and `useDocuments` hook - const deleteChannel = documentPage.categoryId - ? 'AppBridge:GuidelineDocumentCategory:DocumentPageAction' - : 'AppBridge:GuidelineDocument:DocumentPageAction'; - - const addChannel = result.categoryId - ? 'AppBridge:GuidelineDocumentCategory:DocumentPageAction' - : 'AppBridge:GuidelineDocument:DocumentPageAction'; - - window.emitter.emit(deleteChannel, { documentPage, action: 'delete' }); - window.emitter.emit(addChannel, { documentPage: result, action: 'add' }); - }, - [appBridge], - ); - - const updateDocumentPageTargets = useCallback( - async (targets: number[], documentPageIds: number[]) => { - const result = await appBridge.updateDocumentPageTargets(targets, documentPageIds); - - window.emitter.emit('AppBridge:GuidelineDocumentPageTargets:Action', { - payload: { targets, pageIds: documentPageIds }, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - const updateDocumentTargets = useCallback( - async (targets: number[], documentIds: number[]) => { - const result = await appBridge.updateDocumentTargets(targets, documentIds); - - window.emitter.emit('AppBridge:GuidelineDocumentTargets:Action', { - payload: { targets, documentIds }, - action: 'update', - }); - - return result; - }, - [appBridge], - ); - - return { - createLink, - updateLink, - deleteLink, - createDocumentPage, - updateDocumentPage, - deleteDocumentPage, - duplicateDocumentPage, - moveDocumentPage, - createLibrary, - updateLibrary, - deleteLibrary, - createDocumentCategory, - updateDocumentCategory, - deleteDocumentCategory, - moveDocumentCategory, - createCoverPage, - updateCoverPage, - deleteCoverPage, - updateLegacyCoverPage, - moveDocumentGroup, - createDocumentGroup, - updateDocumentGroup, - deleteDocumentGroup, - updateBrandportalLink, - createDocument: createStandardDocument, - updateDocument: updateStandardDocument, - deleteDocument: deleteStandardDocument, - moveDocument, - updateDocumentPageTargets, - updateDocumentTargets, - }; -}; diff --git a/packages/app-bridge/src/react/useLanguage.spec.ts b/packages/app-bridge/src/react/useLanguage.spec.ts deleted file mode 100644 index 5545b11cc..000000000 --- a/packages/app-bridge/src/react/useLanguage.spec.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, renderHook } from '@testing-library/react'; -import { describe, expect, it, vi } from 'vitest'; - -import { getAppBridgeThemeStub } from '../tests/AppBridgeThemeStub'; - -import { useLanguage } from './useLanguage'; - -describe('useLanguage', () => { - it('should return default language initially', () => { - const appBridge = getAppBridgeThemeStub(); - appBridge.context.withArgs('currentLanguage').returns({ get: () => 'fr', subscribe: () => vi.fn() }); - appBridge.context.withArgs('defaultLanguage').returns({ get: () => 'en', subscribe: () => vi.fn() }); - - const { result } = renderHook(() => useLanguage(appBridge)); - - expect(result.current.currentLanguage).toEqual('fr'); - expect(result.current.defaultLanguage).toEqual('en'); - }); - - it('should update language on context change', () => { - const appBridge = getAppBridgeThemeStub(); - appBridge.context.withArgs('currentLanguage').returns({ - get: () => 'fr', - subscribe: vi.fn(), - }); - appBridge.context.withArgs('defaultLanguage').returns({ - get: () => 'en', - subscribe: vi.fn(), - }); - - const { result } = renderHook(() => useLanguage(appBridge)); - - expect(result.current.currentLanguage).toEqual('fr'); - expect(result.current.defaultLanguage).toEqual('en'); - - act(() => { - const subscribeFn = appBridge.context('currentLanguage').subscribe; - if (vi.isMockFunction(subscribeFn)) { - subscribeFn.mock.calls[0][0]('de'); - } - }); - - expect(result.current.currentLanguage).toEqual('de'); - expect(result.current.defaultLanguage).toEqual('en'); - }); - - it('should unsubscribe on unmount', () => { - const appBridge = getAppBridgeThemeStub(); - const mockUnsubscribeCurrentLanguage = vi.fn(); - const mockUnsubscribeDefaultLanguage = vi.fn(); - - appBridge.context - .withArgs('currentLanguage') - .returns({ get: () => 'fr', subscribe: () => mockUnsubscribeCurrentLanguage }); - appBridge.context - .withArgs('defaultLanguage') - .returns({ get: () => 'en', subscribe: () => mockUnsubscribeDefaultLanguage }); - - const { unmount } = renderHook(() => useLanguage(appBridge)); - - unmount(); - - expect(mockUnsubscribeCurrentLanguage).toHaveBeenCalledTimes(1); - expect(mockUnsubscribeDefaultLanguage).toHaveBeenCalledTimes(1); - }); -}); diff --git a/packages/app-bridge/src/react/useLanguage.ts b/packages/app-bridge/src/react/useLanguage.ts deleted file mode 100644 index d0aee479e..000000000 --- a/packages/app-bridge/src/react/useLanguage.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; - -type UseLanguageReturn = { - currentLanguage: string; - defaultLanguage: string; -}; - -export const useLanguage = (appBridge: AppBridgeTheme): UseLanguageReturn => { - const [currentLanguage, setCurrentLanguage] = useState(appBridge.context('currentLanguage').get()); - const [defaultLanguage, setDefaultLanguage] = useState(appBridge.context('defaultLanguage').get()); - - useEffect(() => { - const unsubscribeCurrentLanguageObserver = appBridge.context('currentLanguage').subscribe(setCurrentLanguage); - const unsubscribeDefaultLanguageObserver = appBridge.context('defaultLanguage').subscribe(setDefaultLanguage); - - return () => { - unsubscribeCurrentLanguageObserver(); - unsubscribeDefaultLanguageObserver(); - }; - }, [appBridge]); - - return { currentLanguage, defaultLanguage }; -}; diff --git a/packages/app-bridge/src/react/useNavigationManager.spec.ts b/packages/app-bridge/src/react/useNavigationManager.spec.ts deleted file mode 100644 index 04f47446b..000000000 --- a/packages/app-bridge/src/react/useNavigationManager.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook } from '@testing-library/react'; -import { beforeAll, describe, expect, it, vi } from 'vitest'; - -import { getAppBridgeThemeStub } from '../tests'; - -import { useNavigationManager } from './useNavigationManager'; - -describe('useNavigationManager hook', () => { - let useNavigationManagerStub: ReturnType; - - beforeAll(() => { - const appBridgeStub = getAppBridgeThemeStub(); - const { result } = renderHook(() => useNavigationManager(appBridgeStub)); - - useNavigationManagerStub = result.current; - }); - - it('should call openNavigationManager', () => { - const spy = vi.spyOn(useNavigationManagerStub, 'openNavigationManager').mockImplementation(() => undefined); - - useNavigationManagerStub.openNavigationManager(); - - expect(spy).toBeCalled(); - }); -}); diff --git a/packages/app-bridge/src/react/useNavigationManager.ts b/packages/app-bridge/src/react/useNavigationManager.ts deleted file mode 100644 index 38961153c..000000000 --- a/packages/app-bridge/src/react/useNavigationManager.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type AppBridgeTheme } from '../AppBridgeTheme'; - -// eslint-disable-next-line @eslint-react/no-unnecessary-use-prefix -export const useNavigationManager = (appBridge: AppBridgeTheme) => { - const { openNavigationManager } = appBridge; - - return { - openNavigationManager: () => openNavigationManager(), - }; -}; diff --git a/packages/app-bridge/src/react/usePageTemplateSettings.spec.ts b/packages/app-bridge/src/react/usePageTemplateSettings.spec.ts deleted file mode 100644 index 5c0c6a00f..000000000 --- a/packages/app-bridge/src/react/usePageTemplateSettings.spec.ts +++ /dev/null @@ -1,337 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { cleanup, renderHook, waitFor } from '@testing-library/react'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { getAppBridgeThemeStub } from '../tests'; -import { type ThemeTemplate } from '../types'; - -import { usePageTemplateSettings } from './usePageTemplateSettings'; - -const DOCUMENT_ID = 3462; -const THEME_SETTINGS = { - documentPage: { - customThemeSetting: 123, - themeExclusiveSetting: 234, - }, - cover: {}, - library: {}, -}; -const PAGE_SETTINGS = { - myCustomSetting: 123, -}; - -const PAGE_SETTINGS_WITH_OVERRIDES = { - ...PAGE_SETTINGS, - customThemeSetting: 321, -}; - -const PAGE_SETTINGS_WITH_NULL_OVERRIDES = { - ...PAGE_SETTINGS, - customThemeSetting: null, -}; - -describe('usePageTemplateSettings', () => { - beforeEach(() => { - vi.spyOn(console, 'error').mockImplementation(() => {}); - }); - - afterEach(() => { - vi.restoreAllMocks(); - cleanup(); - }); - - const loadUsePageTemplateSettings = ( - pageTemplateSettings: Record, - template: Parameters[1], - documentId?: Parameters[2], - themeSettings?: Record>, - ) => { - const appBridgeStub = getAppBridgeThemeStub({ - pageTemplateSettings, - themeSettings, - }); - - const { result } = renderHook(() => usePageTemplateSettings(appBridgeStub, template, documentId)); - return { result, appBridgeStub }; - }; - - it('returns the page settings for cover page', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'cover'); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - }); - }); - - it('updates the page settings for cover page', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'cover'); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - }); - - await result.current.updatePageTemplateSettings({ myCustomSetting: 456 }); - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ ...PAGE_SETTINGS, myCustomSetting: 456 }); - }); - - // Reset the object to avoid mutation in other tests - await result.current.updatePageTemplateSettings({ myCustomSetting: 123 }); - }); - - it('returns the page settings for document page', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'documentPage', DOCUMENT_ID); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - }); - }); - - it('returns `null` for document page if no document page id passed', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'documentPage'); - - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(null); - }); - - expect(console.error).toHaveBeenCalledOnce(); - }); - - it('updates the page settings for document page', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'documentPage', DOCUMENT_ID); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - }); - - await result.current.updatePageTemplateSettings({ myCustomSetting: 456 }); - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ ...PAGE_SETTINGS, myCustomSetting: 456 }); - }); - - // Reset the object to avoid mutation in other tests - await result.current.updatePageTemplateSettings({ myCustomSetting: 123 }); - }); - - it('returns the page settings for library page', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'library', DOCUMENT_ID); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - }); - }); - - it('returns `null` for library page if no document id passed', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'library'); - - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(null); - }); - - expect(console.error).toHaveBeenCalledOnce(); - }); - - it('updates the page settings for library page', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'library', DOCUMENT_ID); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - }); - - await result.current.updatePageTemplateSettings({ myCustomSetting: 456 }); - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ ...PAGE_SETTINGS, myCustomSetting: 456 }); - }); - - // Reset the object to avoid mutation in other tests - await result.current.updatePageTemplateSettings({ library: { myCustomSetting: 123 } }); - }); - - it('logs an error when trying to update document or library page without a documentId', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'library'); - - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.pageTemplateSettings).toEqual(null); - }); - - await result.current.updatePageTemplateSettings({ library: { muCystomSetting: 456 } }); - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(null); - }); - - expect(console.error).toHaveBeenCalledTimes(2); - }); - - describe('Theme and Page template overrides', () => { - it('returns the page template settings merged with theme settings and the list of custom overrides', async () => { - const { result } = loadUsePageTemplateSettings( - PAGE_SETTINGS_WITH_OVERRIDES, - 'documentPage', - DOCUMENT_ID, - THEME_SETTINGS, - ); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ - ...THEME_SETTINGS.documentPage, - ...PAGE_SETTINGS_WITH_OVERRIDES, - }); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual(['customThemeSetting']); - expect(result.current.templateThemeSettings).toEqual(THEME_SETTINGS.documentPage); - }); - }); - - it('returns the page template settings merged with theme settings and no overrides', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'cover', undefined, THEME_SETTINGS); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ - ...PAGE_SETTINGS, - ...THEME_SETTINGS.cover, - }); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual([]); - }); - }); - - it('returns an empty object if no theme settins and no page template settings', async () => { - const { result } = loadUsePageTemplateSettings({}, 'cover', undefined, { - documentPage: {}, - cover: {}, - library: {}, - }); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({}); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual([]); - }); - }); - - it('returns only the theme settings if no page template settings', async () => { - const { result } = loadUsePageTemplateSettings({}, 'cover', undefined, THEME_SETTINGS); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(THEME_SETTINGS.cover); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual([]); - }); - }); - - it('returns only the page template settings if no theme settings', async () => { - const { result } = loadUsePageTemplateSettings(PAGE_SETTINGS, 'cover', undefined, { - documentPage: {}, - cover: {}, - library: {}, - }); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual(PAGE_SETTINGS); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual([]); - }); - }); - - it('returns theme setting value if page template override is null', async () => { - const { result } = loadUsePageTemplateSettings( - PAGE_SETTINGS_WITH_NULL_OVERRIDES, - 'documentPage', - DOCUMENT_ID, - THEME_SETTINGS, - ); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ - ...PAGE_SETTINGS, - ...THEME_SETTINGS.documentPage, - }); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual([]); - }); - }); - - it('returns the theme setting if the override is deleted (reset) from page template settings', async () => { - const { result } = loadUsePageTemplateSettings( - PAGE_SETTINGS_WITH_OVERRIDES, - 'documentPage', - DOCUMENT_ID, - THEME_SETTINGS, - ); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ - ...THEME_SETTINGS.documentPage, - ...PAGE_SETTINGS_WITH_OVERRIDES, - }); - }); - - await result.current.updatePageTemplateSettings({ customThemeSetting: null }); - expect(result.current.isLoading).toEqual(false); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.pageTemplateSettings).toEqual({ - ...PAGE_SETTINGS, - ...THEME_SETTINGS.documentPage, - }); - expect(result.current.customizedPageTemplateSettingsKeys).toEqual([]); - }); - - // Reset the object to avoid mutation in other tests - await result.current.updatePageTemplateSettings({ customThemeSetting: 321 }); - }); - }); -}); diff --git a/packages/app-bridge/src/react/usePageTemplateSettings.ts b/packages/app-bridge/src/react/usePageTemplateSettings.ts deleted file mode 100644 index f72ca9012..000000000 --- a/packages/app-bridge/src/react/usePageTemplateSettings.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type EmitterEvents, type ThemeTemplate } from '../types'; - -import { useThemeSettings } from './'; - -export const usePageTemplateSettings = >( - appBridge: AppBridgeTheme, - template: ThemeTemplate, - documentOrDocumentPageId?: number, -) => { - const { themeSettings } = useThemeSettings(appBridge); - const templateThemeSettings = themeSettings?.[template] ?? {}; - const [pageTemplateSettings, setPageTemplateSettings] = useState>(null); - const [isLoading, setIsLoading] = useState(false); - const [customizedPageTemplateSettingsKeys, setCustomizedPageTemplateSettingsKeys] = useState([]); - const [mergedThemeAndPageTemplateSettings, setMergedThemeAndPageTemplateSettings] = - useState>>(null); - - useEffect(() => { - const updateBlockSettingsFromEvent = (event: EmitterEvents['AppBridge:PageTemplateSettingsUpdated']) => { - setPageTemplateSettings({ ...event.pageTemplateSettings } as TPageTemplateSettings); - }; - - const getInitialPageTemplateSettings = async () => { - setIsLoading(true); - let loadedSettings: Nullable = null; - - if (template === 'cover') { - loadedSettings = await appBridge.getCoverPageTemplateSettings(); - } else if (documentOrDocumentPageId === undefined) { - console.error(`Document ID is required for ${template} template settings`); - setMergedThemeAndPageTemplateSettings(null); - setIsLoading(false); - return; - } else if (template === 'documentPage') { - loadedSettings = - await appBridge.getDocumentPageTemplateSettings(documentOrDocumentPageId); - } else if (template === 'library') { - loadedSettings = - await appBridge.getLibraryPageTemplateSettings(documentOrDocumentPageId); - } - - setIsLoading(false); - setPageTemplateSettings(loadedSettings); - }; - - getInitialPageTemplateSettings(); - - window.emitter.on('AppBridge:PageTemplateSettingsUpdated', updateBlockSettingsFromEvent); - - return () => { - window.emitter.off('AppBridge:PageTemplateSettingsUpdated', updateBlockSettingsFromEvent); - }; - }, [appBridge, documentOrDocumentPageId, template]); - - useEffect(() => { - if (!templateThemeSettings || !pageTemplateSettings) { - return; - } - - const overrides = []; - const mergedSettings: Record & TPageTemplateSettings = { ...pageTemplateSettings }; - - for (const field of Object.keys(templateThemeSettings)) { - if ( - (pageTemplateSettings as Record)[field] !== null && - (pageTemplateSettings as Record)[field] !== undefined - ) { - overrides.push(field); - } else { - (mergedSettings as Record)[field] = templateThemeSettings[field]; - } - } - - // eslint-disable-next-line @eslint-react/set-state-in-effect - setCustomizedPageTemplateSettingsKeys(overrides); - setMergedThemeAndPageTemplateSettings(mergedSettings); - // eslint-disable-next-line @eslint-react/exhaustive-deps - }, [themeSettings, pageTemplateSettings]); - - const updatePageTemplateSettings = async (pageTemplateSettingsUpdate: Partial) => { - try { - if (template === 'cover') { - await appBridge.updateCoverPageTemplateSettings(pageTemplateSettingsUpdate); - } else if (documentOrDocumentPageId === undefined) { - console.error(`Document ID is required for ${template} template settings`); - setIsLoading(false); - return; - } else if (template === 'documentPage') { - await appBridge.updateDocumentPageTemplateSettings( - documentOrDocumentPageId, - pageTemplateSettingsUpdate, - ); - } else if (template === 'library') { - await appBridge.updateLibraryPageTemplateSettings(documentOrDocumentPageId, pageTemplateSettingsUpdate); - } - - window.emitter.emit('AppBridge:PageTemplateSettingsUpdated', { - pageTemplateSettings: { - ...pageTemplateSettings, - ...pageTemplateSettingsUpdate, - }, - }); - } catch (error) { - console.error(error); - } - }; - - return { - pageTemplateSettings: mergedThemeAndPageTemplateSettings, - templateThemeSettings, - customizedPageTemplateSettingsKeys, - updatePageTemplateSettings, - isLoading, - }; -}; diff --git a/packages/app-bridge/src/react/usePlatformAppBridge.spec.ts b/packages/app-bridge/src/react/usePlatformAppBridge.spec.ts deleted file mode 100644 index 1ca75a50c..000000000 --- a/packages/app-bridge/src/react/usePlatformAppBridge.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { afterEach, describe, expect, it, vi } from 'vitest'; - -import { usePlatformAppBridge } from './usePlatformAppBridge'; - -describe('usePlatformAppBridge', () => { - const TOKEN = 'AjY34F87Dsat^J'; - - window.location.search = `?token=${TOKEN}`; - vi.mock('../utilities/subscribe', () => ({ - subscribe: vi.fn().mockResolvedValue({ - statePort: { onmessage: vi.fn() }, - apiPort: { onmessage: vi.fn() }, - context: { parentId: 'parentId-test', connected: true }, - state: { settings: 'settings-test' }, - }), - })); - - vi.mock('../utilities/notify', () => ({ - notify: vi.fn(), - })); - - afterEach(() => { - vi.clearAllMocks(); - }); - - it('should return undefined platformApp if not initiated', () => { - const { result } = renderHook(() => usePlatformAppBridge()); - expect(result.current).toBeUndefined(); - }); - - it('should return platformApp after initiation and waiting', async () => { - const { result } = renderHook(() => usePlatformAppBridge()); - await waitFor(() => { - expect(result.current).toBeDefined(); - }); - }); -}); diff --git a/packages/app-bridge/src/react/usePlatformAppBridge.ts b/packages/app-bridge/src/react/usePlatformAppBridge.ts deleted file mode 100644 index c79dc7b8a..000000000 --- a/packages/app-bridge/src/react/usePlatformAppBridge.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { AppBridgePlatformApp } from '../AppBridgePlatformApp'; - -export const usePlatformAppBridge = () => { - const [platformAppBridge, setPlatformAppBridge] = useState(); - - useEffect(() => { - (() => { - const appBridge = new AppBridgePlatformApp(); - appBridge.subscribe('Context.connected', () => { - setPlatformAppBridge(appBridge); - }); - appBridge.dispatch({ name: 'openConnection' }); - })(); - }, []); - return platformAppBridge; -}; diff --git a/packages/app-bridge/src/react/usePortalNavigation.spec.ts b/packages/app-bridge/src/react/usePortalNavigation.spec.ts deleted file mode 100644 index 6ea5974cc..000000000 --- a/packages/app-bridge/src/react/usePortalNavigation.spec.ts +++ /dev/null @@ -1,312 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { renderHook, waitFor } from '@testing-library/react'; -import { describe, expect, it, vi } from 'vitest'; - -import { PortalNavigationTreeDummy, getAppBridgeThemeStub } from '../tests'; - -import { usePortalNavigation } from './usePortalNavigation'; - -const DEFAULT_NAVIGATION_TREE = PortalNavigationTreeDummy.default(); - -describe('usePortalNavigation', () => { - it('should return the preview and refetch when the cover page is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - - const coverPageIndex = DEFAULT_NAVIGATION_TREE.findIndex((item) => item.type === 'cover-page'); - const updatedNavigationTree = [...DEFAULT_NAVIGATION_TREE]; - updatedNavigationTree.splice(coverPageIndex, 1); - - spy.mockResolvedValueOnce(updatedNavigationTree); - - // Trigger a "cover page deleted" event - window.emitter.emit('AppBridge:GuidelineCoverPage:Action', { action: 'delete' }); - - await waitFor(() => { - expect(spy).toHaveBeenCalledTimes(2); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - expect(result.current.navigationItems).toEqual(updatedNavigationTree); - }); - }); - - it('should return the preview and refetch when a document group is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - - const groupIndex = DEFAULT_NAVIGATION_TREE.findIndex((item) => item.id() === 200); - const updatedNavigationTree = [...DEFAULT_NAVIGATION_TREE]; - updatedNavigationTree.splice(groupIndex, 1); - - spy.mockResolvedValueOnce(updatedNavigationTree); - - // Trigger a "document group deleted" event - window.emitter.emit('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup: { id: 200 }, - action: 'delete', - }); - - await waitFor(() => { - expect(spy).toHaveBeenCalledTimes(2); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - expect(result.current.navigationItems).toEqual(updatedNavigationTree); - }); - }); - - it('should return the previous tree and refetch when an incorrect document group id is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValue(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - - // Trigger a "document group deleted" event - window.emitter.emit('AppBridge:GuidelineDocumentGroup:Action', { - documentGroup: { id: 2000 }, - action: 'delete', - }); - - await waitFor(() => { - expect(spy).toHaveBeenCalledTimes(2); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - }); - }); - - it('should return the preview and refetch when a document at root level is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - - const documentIndex = DEFAULT_NAVIGATION_TREE.findIndex((item) => item.id() === 101); - const updatedNavigationTree = [...DEFAULT_NAVIGATION_TREE]; - updatedNavigationTree.splice(documentIndex, 1); - - spy.mockResolvedValueOnce(updatedNavigationTree); - - // Trigger a "document deleted" event - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { id: 101 }, - action: 'delete', - }); - - await waitFor(() => { - expect(spy).toHaveBeenCalledTimes(2); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - expect(result.current.navigationItems).toEqual(updatedNavigationTree); - }); - }); - - it('should return the same tree and refetch when a document within a group is deleted', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValue(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - - // Trigger a "document deleted" event - window.emitter.emit('AppBridge:GuidelineDocument:Action', { - document: { id: 201, documentGroupId: 200 }, - action: 'delete', - }); - - await waitFor(() => { - expect(spy).toHaveBeenCalledTimes(2); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - }); - - it('should fetch the navigation tree on mount', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(result.current.isLoading).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - }); - - it('should refetch if targets in documents change', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValue(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - }); - - // Trigger a "document targets changed" event - window.emitter.emit('AppBridge:GuidelineDocumentTargets:Action', { - payload: { targets: [], documentIds: [] }, - action: 'update', - }); - - await waitFor(() => { - expect(spy).toHaveBeenCalledTimes(2); - expect(result.current.isLoading).toBe(false); - }); - }); - - it('should show document group in new position and refetch when a document group is moved', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - }); - - const NEW_POSITION = 1; - const groupIndex = DEFAULT_NAVIGATION_TREE.findIndex((item) => item.id() === 200); - const updatedNavigationTree = [...DEFAULT_NAVIGATION_TREE]; - const movedGroup = updatedNavigationTree.splice(groupIndex, 1); - updatedNavigationTree.splice(NEW_POSITION, 0, ...movedGroup); - - spy.mockResolvedValueOnce(updatedNavigationTree); - - // Trigger a "document group is moved" event - window.emitter.emit('AppBridge:GuidelineDocumentGroup:MoveEvent', { - action: 'movePreview', - position: NEW_POSITION, - documentGroup: { id: 200, sort: 3 }, - }); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual(updatedNavigationTree); - }); - }); - - it('should show document in new position when a document is moved at root level', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - }); - - const NEW_POSITION = 2; - const documentIndex = DEFAULT_NAVIGATION_TREE.findIndex((item) => item.id() === 121); - const updatedNavigationTree = [...DEFAULT_NAVIGATION_TREE]; - const movedDocument = updatedNavigationTree.splice(documentIndex, 1); - updatedNavigationTree.splice(NEW_POSITION, 0, ...movedDocument); - - // Trigger a "document is moved" event - window.emitter.emit('AppBridge:GuidelineDocument:MoveEvent', { - action: 'movePreview', - position: NEW_POSITION, - document: { id: 121, sort: 5 }, - }); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual(updatedNavigationTree); - }); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - }); - - it('should return the same tree when a document is moved within/in/out a group', async () => { - const appBridge = getAppBridgeThemeStub(); - const spy = vi.spyOn(appBridge, 'api'); - - spy.mockResolvedValueOnce(DEFAULT_NAVIGATION_TREE); - - const { result } = renderHook(() => usePortalNavigation(appBridge)); - - await waitFor(() => { - expect(result.current.isLoading).toBe(false); - }); - - const NEW_POSITION = 2; - - // Trigger a "document is moved" event - window.emitter.emit('AppBridge:GuidelineDocument:MoveEvent', { - action: 'movePreview', - position: NEW_POSITION, - document: { id: 201, sort: 2, documentGroupId: 200 }, - newGroupId: undefined, - }); - - await waitFor(() => { - expect(result.current.navigationItems).toEqual(DEFAULT_NAVIGATION_TREE); - }); - - expect(spy).toHaveBeenCalledOnce(); - expect(spy).toHaveBeenCalledWith({ name: 'getPortalNavigation' }); - }); -}); diff --git a/packages/app-bridge/src/react/usePortalNavigation.ts b/packages/app-bridge/src/react/usePortalNavigation.ts deleted file mode 100644 index 8d0fabd64..000000000 --- a/packages/app-bridge/src/react/usePortalNavigation.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import debounce from 'lodash-es/debounce'; -import { useCallback, useEffect, useMemo, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type EmitterEvents } from '../types/Emitter'; -import { type PortalNavigationItem } from '../types/Guideline'; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -export const usePortalNavigation = (appBridge: AppBridgeTheme, options: Options = { enabled: true }) => { - const [navigationItems, setNavigationItems] = useState([]); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setNavigationItems(await appBridge.api({ name: 'getPortalNavigation' })); - setIsLoading(false); - }, [appBridge]); - - // eslint-disable-next-line @eslint-react/no-unnecessary-use-memo - const debouncedRefetch = useMemo( - () => - debounce(() => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - refetch(); - }, 100), - [refetch], - ); - - useEffect(() => { - if (options.enabled) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - refetch(); - } - }, [options.enabled, refetch]); - - useEffect(() => { - const handleCoverPageAction = (event: EmitterEvents['AppBridge:GuidelineCoverPage:Action']) => { - if (event.action === 'delete') { - setNavigationItems( - produce((draft) => { - return deleteItem(draft, 'cover-page', null); - }), - ); - } - - debouncedRefetch(); - }; - - const handleDocumentGroupAction = (event: EmitterEvents['AppBridge:GuidelineDocumentGroup:Action']) => { - if (event.action === 'delete') { - setNavigationItems( - produce((draft) => { - return deleteItem(draft, 'document-group', event.documentGroup.id); - }), - ); - } - - debouncedRefetch(); - }; - - const handleDocumentAction = (event: EmitterEvents['AppBridge:GuidelineDocument:Action']) => { - if (event.action === 'delete') { - setNavigationItems( - produce((draft) => { - if (!event.document.documentGroupId) { - return deleteItem(draft, 'document', event.document.id); - } - return draft; - }), - ); - } - - debouncedRefetch(); - }; - - const handleDocumentGroupMoveEventPreview = ( - event: EmitterEvents['AppBridge:GuidelineDocumentGroup:MoveEvent'], - ) => { - setNavigationItems( - produce((draft) => previewItemPosition(draft, event.documentGroup, event.position, ['document-group'])), - ); - }; - - const handleDocumentMoveEventPreview = (event: EmitterEvents['AppBridge:GuidelineDocument:MoveEvent']) => { - if (!event.document.documentGroupId && !event.newGroupId) { - setNavigationItems( - produce((draft) => - previewItemPosition(draft, event.document, event.position, [ - 'document', - 'document-library', - 'document-link', - ]), - ), - ); - } - }; - - window.emitter.on('AppBridge:GuidelineCoverPage:Action', handleCoverPageAction); - - window.emitter.on('AppBridge:GuidelineDocumentGroup:Action', handleDocumentGroupAction); - window.emitter.on('AppBridge:GuidelineDocumentGroup:MoveEvent', handleDocumentGroupMoveEventPreview); - - window.emitter.on('AppBridge:GuidelineDocument:Action', handleDocumentAction); - window.emitter.on('AppBridge:GuidelineDocument:MoveEvent', handleDocumentMoveEventPreview); - window.emitter.on('AppBridge:GuidelineDocumentTargets:Action', debouncedRefetch); - - return () => { - window.emitter.off('AppBridge:GuidelineCoverPage:Action', handleCoverPageAction); - - window.emitter.off('AppBridge:GuidelineDocumentGroup:Action', handleDocumentGroupAction); - window.emitter.off('AppBridge:GuidelineDocumentGroup:MoveEvent', handleDocumentGroupMoveEventPreview); - - window.emitter.off('AppBridge:GuidelineDocument:Action', handleDocumentAction); - window.emitter.off('AppBridge:GuidelineDocument:MoveEvent', handleDocumentMoveEventPreview); - window.emitter.off('AppBridge:GuidelineDocumentTargets:Action', debouncedRefetch); - }; - }, [navigationItems, debouncedRefetch]); - - return { navigationItems, refetch, isLoading }; -}; - -const deleteItem = (draft: PortalNavigationItem[], type: PortalNavigationItem['type'], itemId: Nullable) => { - const itemDraftIndex = draft.findIndex((item) => - !itemId ? item.type === type : item.type === type && item.id() === itemId, - ); - - if (itemDraftIndex !== -1) { - draft.splice(itemDraftIndex, 1); - } - - return draft; -}; - -const previewItemPosition = ( - draft: PortalNavigationItem[], - itemMoved: - | EmitterEvents['AppBridge:GuidelineDocument:MoveEvent']['document'] - | EmitterEvents['AppBridge:GuidelineDocumentGroup:MoveEvent']['documentGroup'], - newPosition: number, - allowedTypes: PortalNavigationItem['type'][], -) => { - const itemDraftIndex = draft.findIndex((item) => allowedTypes.includes(item.type) && item.id() === itemMoved.id); - - if (itemDraftIndex !== -1) { - const itemToMove = draft.splice(itemDraftIndex, 1); - draft.splice(newPosition, 0, ...itemToMove); - } - - return draft; -}; diff --git a/packages/app-bridge/src/react/useTemplateAssets.spec.ts b/packages/app-bridge/src/react/useTemplateAssets.spec.ts deleted file mode 100644 index d5bc19c4b..000000000 --- a/packages/app-bridge/src/react/useTemplateAssets.spec.ts +++ /dev/null @@ -1,445 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, cleanup, renderHook, waitFor } from '@testing-library/react'; -import { type SinonStub } from 'sinon'; -import { type Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { type ThemeTemplate } from '..'; -import { AssetDummy, getAppBridgeThemeStub } from '../tests'; - -import { useTemplateAssets } from './useTemplateAssets'; - -const DOCUMENT_ID = 16; -const DOCUMENT_PAGE_ID = 568; - -const THEME_ASSETS = { - key: [AssetDummy.with(3)], -}; - -const THEME_ASSETS_WITH_CUSTOM_KEY = { - customKey: [AssetDummy.with(2)], -}; - -const TEMPLATE_ASSETS = { - key: [AssetDummy.with(1)], -}; - -describe('useTemplateAssets hook', () => { - beforeEach(() => { - vi.spyOn(console, 'error').mockImplementation(() => {}); - }); - - afterEach(() => { - vi.restoreAllMocks(); - cleanup(); - }); - - const loadUseTemplateAssets = async ( - template: ThemeTemplate, - existingTemplateAssets = [AssetDummy.with(1)], - existingThemeAssets = {}, - returnEmptyTemplateAssets = false, - ) => { - const asset = AssetDummy.with(1); - const appBridgeStub = getAppBridgeThemeStub({ - pageTemplateAssets: returnEmptyTemplateAssets ? {} : { key: existingTemplateAssets }, - themeAssets: existingThemeAssets, - }); - - const { result, rerender } = renderHook(() => - useTemplateAssets(appBridgeStub, template, DOCUMENT_ID, DOCUMENT_PAGE_ID), - ); - - // for some reason necessary - // eslint-disable-next-line @typescript-eslint/require-await - await act(async () => { - rerender(); - }); - - return { result, appBridgeStub, asset }; - }; - - describe('documentPage template context', () => { - it('should delete an asset', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('documentPage', []); - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = appBridgeStub.deleteAssetIdsFromDocumentPageTemplateAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual(DOCUMENT_PAGE_ID); - expect(call.args[1]).toEqual('key'); - expect(call.lastArg).toEqual([1]); - expect(result.current.templateAssets).toStrictEqual({ key: [] }); - }); - }); - - it('should sort assets', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('documentPage', [ - AssetDummy.with(1), - AssetDummy.with(2), - ]); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - const deleteCall = appBridgeStub.deleteAssetIdsFromDocumentPageTemplateAssetKey.getCall(0); - const addCall = appBridgeStub.addAssetIdsToDocumentPageTemplateAssetKey.getCall(0); - - await waitFor(() => { - expect(deleteCall.firstArg).toEqual(DOCUMENT_PAGE_ID); - expect(deleteCall.args[1]).toEqual('key'); - expect(deleteCall.lastArg).toEqual([1, 2]); - expect(addCall.firstArg).toEqual(DOCUMENT_PAGE_ID); - expect(addCall.args[1]).toEqual('key'); - expect(addCall.lastArg).toEqual([2, 1]); - expect(result.current.templateAssets.key.map((asset) => asset.id)).toEqual([2, 1]); - }); - }); - - it('should not sort assets if api call throws error', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('documentPage', [ - AssetDummy.with(1), - AssetDummy.with(2), - ]); - (appBridgeStub.deleteAssetIdsFromDocumentPageTemplateAssetKey as unknown as Mock) = vi - .fn() - .mockRejectedValue('Unsuccessful API call'); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - await waitFor(() => { - expect(result.current.templateAssets.key.map((asset) => asset.id)).toEqual([1, 2]); - }); - - expect(console.error).toHaveBeenCalledOnce(); - }); - - it('should notify about updated assets on delete', async () => { - const { result, asset } = await loadUseTemplateAssets('documentPage'); - - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:TemplateAssetsUpdated'); - expect(call.lastArg.template).toEqual('documentPage'); - expect(call.lastArg.documentId).toEqual(DOCUMENT_ID); - expect(call.lastArg.documentPageId).toEqual(DOCUMENT_PAGE_ID); - expect(call.lastArg.templateAssets).toStrictEqual({ key: [] }); - expect(call.lastArg.prevTemplateAssets).toMatchObject({ key: [asset] }); - }); - }); - - it('should add asset ids', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('documentPage'); - await act(async () => { - await result.current.addAssetIdsToKey('key', [2]); - }); - - const call = appBridgeStub.addAssetIdsToDocumentPageTemplateAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual(DOCUMENT_PAGE_ID); - expect(call.args[1]).toEqual('key'); - expect(call.lastArg).toEqual([2]); - expect(result.current.templateAssets.key.map(({ id }) => id)).toEqual([1, 2]); - }); - }); - - it('should notify about updated assets on add asset ids to key', async () => { - const { result, asset } = await loadUseTemplateAssets('documentPage'); - const assetToAdd = AssetDummy.with(2); - await act(async () => { - await result.current.addAssetIdsToKey('key', [assetToAdd.id]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:TemplateAssetsUpdated'); - expect(call.lastArg.template).toEqual('documentPage'); - expect(call.lastArg.documentId).toEqual(DOCUMENT_ID); - expect(call.lastArg.documentPageId).toEqual(DOCUMENT_PAGE_ID); - expect(call.lastArg.templateAssets).toMatchObject({ key: [asset, assetToAdd] }); - expect(call.lastArg.prevTemplateAssets).toMatchObject({ key: [asset] }); - }); - }); - }); - - describe('library template context', () => { - it('should delete an asset', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('library', []); - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = appBridgeStub.deleteAssetIdsFromLibraryPageTemplateAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual(DOCUMENT_ID); - expect(call.args[1]).toEqual('key'); - expect(call.lastArg).toEqual([1]); - expect(result.current.templateAssets).toStrictEqual({ key: [] }); - }); - }); - - it('should sort assets', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('library', [ - AssetDummy.with(1), - AssetDummy.with(2), - ]); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - const deleteCall = appBridgeStub.deleteAssetIdsFromLibraryPageTemplateAssetKey.getCall(0); - const addCall = appBridgeStub.addAssetIdsToLibraryPageTemplateAssetKey.getCall(0); - - await waitFor(() => { - expect(deleteCall.firstArg).toEqual(DOCUMENT_ID); - expect(deleteCall.args[1]).toEqual('key'); - expect(deleteCall.lastArg).toEqual([1, 2]); - expect(addCall.firstArg).toEqual(DOCUMENT_ID); - expect(addCall.args[1]).toEqual('key'); - expect(addCall.lastArg).toEqual([2, 1]); - expect(result.current.templateAssets.key.map((asset) => asset.id)).toEqual([2, 1]); - }); - }); - - it('should not sort assets if api call throws error', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('library', [ - AssetDummy.with(1), - AssetDummy.with(2), - ]); - (appBridgeStub.deleteAssetIdsFromLibraryPageTemplateAssetKey as unknown as Mock) = vi - .fn() - .mockRejectedValue('Unsuccessful API call'); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - await waitFor(() => { - expect(result.current.templateAssets.key.map((asset) => asset.id)).toEqual([1, 2]); - }); - - expect(console.error).toHaveBeenCalledOnce(); - }); - - it('should notify about updated assets on delete', async () => { - const { result, asset } = await loadUseTemplateAssets('library'); - - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:TemplateAssetsUpdated'); - expect(call.lastArg.template).toEqual('library'); - expect(call.lastArg.documentId).toEqual(DOCUMENT_ID); - expect(call.lastArg.documentPageId).toEqual(DOCUMENT_PAGE_ID); - expect(call.lastArg.templateAssets).toStrictEqual({ key: [] }); - expect(call.lastArg.prevTemplateAssets).toMatchObject({ key: [asset] }); - }); - }); - - it('should add asset ids', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('library'); - await act(async () => { - await result.current.addAssetIdsToKey('key', [2]); - }); - - const call = appBridgeStub.addAssetIdsToLibraryPageTemplateAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual(DOCUMENT_ID); - expect(call.args[1]).toEqual('key'); - expect(call.lastArg).toEqual([2]); - expect(result.current.templateAssets.key.map(({ id }) => id)).toEqual([1, 2]); - }); - }); - - it('should notify about updated assets on add asset ids to key', async () => { - const { result, asset } = await loadUseTemplateAssets('library'); - const assetToAdd = AssetDummy.with(2); - await act(async () => { - await result.current.addAssetIdsToKey('key', [assetToAdd.id]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:TemplateAssetsUpdated'); - expect(call.lastArg.template).toEqual('library'); - expect(call.lastArg.documentId).toEqual(DOCUMENT_ID); - expect(call.lastArg.documentPageId).toEqual(DOCUMENT_PAGE_ID); - expect(call.lastArg.templateAssets).toMatchObject({ key: [asset, assetToAdd] }); - expect(call.lastArg.prevTemplateAssets).toMatchObject({ key: [asset] }); - }); - }); - }); - - describe('cover template context', () => { - it('should delete an asset', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('cover', []); - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = appBridgeStub.deleteAssetIdsFromCoverPageTemplateAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('key'); - expect(call.lastArg).toEqual([1]); - expect(result.current.templateAssets).toStrictEqual({ key: [] }); - }); - }); - - it('should sort assets', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('cover', [ - AssetDummy.with(1), - AssetDummy.with(2), - ]); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - const deleteCall = appBridgeStub.deleteAssetIdsFromCoverPageTemplateAssetKey.getCall(0); - const addCall = appBridgeStub.addAssetIdsToCoverPageTemplateAssetKey.getCall(0); - - await waitFor(() => { - expect(deleteCall.firstArg).toEqual('key'); - expect(deleteCall.lastArg).toEqual([1, 2]); - expect(addCall.firstArg).toEqual('key'); - expect(addCall.lastArg).toEqual([2, 1]); - expect(result.current.templateAssets.key.map((asset) => asset.id)).toEqual([2, 1]); - }); - }); - - it('should not sort assets if api call throws error', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('cover', [ - AssetDummy.with(1), - AssetDummy.with(2), - ]); - (appBridgeStub.deleteAssetIdsFromCoverPageTemplateAssetKey as unknown as Mock) = vi - .fn() - .mockRejectedValue('Unsuccessful API call'); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - await waitFor(() => expect(result.current.templateAssets.key.map((asset) => asset.id)).toEqual([1, 2])); - - expect(console.error).toHaveBeenCalledOnce(); - }); - - it('should notify about updated assets on delete', async () => { - const { result, asset } = await loadUseTemplateAssets('cover'); - - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:TemplateAssetsUpdated'); - expect(call.lastArg.template).toEqual('cover'); - expect(call.lastArg.documentId).toEqual(DOCUMENT_ID); - expect(call.lastArg.documentPageId).toEqual(DOCUMENT_PAGE_ID); - expect(call.lastArg.templateAssets).toStrictEqual({ key: [] }); - expect(call.lastArg.prevTemplateAssets).toMatchObject({ key: [asset] }); - }); - }); - - it('should add asset ids', async () => { - const { result, appBridgeStub } = await loadUseTemplateAssets('cover'); - await act(async () => { - await result.current.addAssetIdsToKey('key', [2]); - }); - - const call = appBridgeStub.addAssetIdsToCoverPageTemplateAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('key'); - expect(call.lastArg).toEqual([2]); - expect(result.current.templateAssets.key.map(({ id }) => id)).toEqual([1, 2]); - }); - }); - - it('should notify about updated assets on add asset ids to key', async () => { - const { result, asset } = await loadUseTemplateAssets('cover'); - const assetToAdd = AssetDummy.with(2); - await act(async () => { - await result.current.addAssetIdsToKey('key', [assetToAdd.id]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:TemplateAssetsUpdated'); - expect(call.lastArg.template).toEqual('cover'); - expect(call.lastArg.documentId).toEqual(DOCUMENT_ID); - expect(call.lastArg.documentPageId).toEqual(DOCUMENT_PAGE_ID); - expect(call.lastArg.templateAssets).toMatchObject({ key: [asset, assetToAdd] }); - expect(call.lastArg.prevTemplateAssets).toMatchObject({ key: [asset] }); - }); - }); - }); - - describe('Theme and Template assets overrides', () => { - it('returns the template assets merged with theme assets and the list of custom overrides', async () => { - const { result } = await loadUseTemplateAssets('cover', [AssetDummy.with(1)], THEME_ASSETS); - await waitFor(() => { - expect(result.current.templateAssets).toEqual({ - ...TEMPLATE_ASSETS, - }); - expect(result.current.customizedTemplateAssetsKeys).toEqual(['key']); - }); - }); - - it('returns the template assets merged with theme assets and no overrides', async () => { - const { result } = await loadUseTemplateAssets('cover', [AssetDummy.with(1)], THEME_ASSETS_WITH_CUSTOM_KEY); - await waitFor(() => { - expect(result.current.templateAssets).toEqual({ - ...THEME_ASSETS_WITH_CUSTOM_KEY, - ...TEMPLATE_ASSETS, - }); - expect(result.current.customizedTemplateAssetsKeys).toEqual([]); - }); - }); - - it('returns an empty object if no theme assets and no template assets', async () => { - const { result } = await loadUseTemplateAssets('cover', [], {}, true); - await waitFor(() => { - expect(result.current.templateAssets).toEqual({}); - expect(result.current.customizedTemplateAssetsKeys).toEqual([]); - }); - }); - - it('returns only the theme assets if no template assets', async () => { - const { result } = await loadUseTemplateAssets('cover', [], THEME_ASSETS, true); - await waitFor(() => { - expect(result.current.templateAssets).toEqual({ - ...THEME_ASSETS, - }); - expect(result.current.customizedTemplateAssetsKeys).toEqual([]); - }); - }); - - it('returns only the template assets if no theme assets', async () => { - const { result } = await loadUseTemplateAssets('cover', [AssetDummy.with(1)], {}, false); - await waitFor(() => { - expect(result.current.templateAssets).toEqual({ - ...TEMPLATE_ASSETS, - }); - expect(result.current.customizedTemplateAssetsKeys).toEqual([]); - }); - }); - }); -}); diff --git a/packages/app-bridge/src/react/useTemplateAssets.ts b/packages/app-bridge/src/react/useTemplateAssets.ts deleted file mode 100644 index 0977d719f..000000000 --- a/packages/app-bridge/src/react/useTemplateAssets.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type Asset, type ThemeTemplate } from '../types'; -import { compareObjects } from '../utilities'; - -import { useThemeAssets } from './'; - -type HookArgs = { - appBridge: AppBridgeTheme; - template?: ThemeTemplate; - documentId?: number; - documentPageId?: number; -}; - -const getTemplateAssets = async ({ - appBridge, - template, - documentId, - documentPageId, -}: HookArgs): Promise> => { - if (template === 'cover') { - return await appBridge.getCoverPageTemplateAssets(); - } else if (template === 'documentPage' && documentPageId) { - return await appBridge.getDocumentPageTemplateAssets(documentPageId); - } else if (template === 'library' && documentId) { - return await appBridge.getLibraryPageTemplateAssets(documentId); - } - - return {}; -}; - -const addAssetIdsToTemplateAssetKey = async ( - key: string, - assetIds: number[], - { appBridge, template, documentId, documentPageId }: HookArgs, -): Promise => { - if (template === 'cover') { - await appBridge.addAssetIdsToCoverPageTemplateAssetKey(key, assetIds); - } else if (template === 'documentPage' && documentPageId) { - await appBridge.addAssetIdsToDocumentPageTemplateAssetKey(documentPageId, key, assetIds); - } else if (template === 'library' && documentId) { - await appBridge.addAssetIdsToLibraryPageTemplateAssetKey(documentId, key, assetIds); - } -}; - -const deleteAssetIdsFromTemplateAssetKey = async ( - key: string, - assetIds: number[], - { appBridge, template, documentId, documentPageId }: HookArgs, -): Promise => { - if (template === 'cover') { - await appBridge.deleteAssetIdsFromCoverPageTemplateAssetKey(key, assetIds); - } else if (template === 'documentPage' && documentPageId) { - await appBridge.deleteAssetIdsFromDocumentPageTemplateAssetKey(documentPageId, key, assetIds); - } else if (template === 'library' && documentId) { - await appBridge.deleteAssetIdsFromLibraryPageTemplateAssetKey(documentId, key, assetIds); - } -}; - -export const useTemplateAssets = ( - appBridge: AppBridgeTheme, - template: ThemeTemplate, - documentId?: number, - documentPageId?: number, -) => { - const [templateAssets, setTemplateAssets] = useState>({}); - const { themeAssets } = useThemeAssets(appBridge, template); - const [customizedTemplateAssetsKeys, setCustomizedTemplateAssetsKeys] = useState([]); - const [mergedThemeAndTemplateAssets, setMergedThemeAndTemplateAssets] = useState>({}); - - // Fetch the template assets on mount. - // And add listener for template assets updates. - useEffect(() => { - let componentMounted = true; - - const updateTemplateAssetsFromEvent = (event: { - template: ThemeTemplate; - documentId?: number; - documentPageId?: number; - templateAssets: Record; - prevTemplateAssets: Record; - }) => { - if ( - event.template === template && - event.documentId === documentId && - event.documentPageId === documentPageId && - !compareObjects(event.templateAssets, event.prevTemplateAssets) - ) { - setTemplateAssets(event.templateAssets); - } - }; - - if (template) { - const mountingFetch = async () => { - const allTemplateAssets = await getTemplateAssets({ - appBridge, - template, - documentId, - documentPageId, - }); - - if (componentMounted) { - setTemplateAssets(allTemplateAssets); - } - }; - mountingFetch(); - - window.emitter.on('AppBridge:TemplateAssetsUpdated', updateTemplateAssetsFromEvent); - } - - return () => { - componentMounted = false; - window.emitter.off('AppBridge:TemplateAssetsUpdated', updateTemplateAssetsFromEvent); - }; - }, [appBridge, documentId, documentPageId, template]); - - useEffect(() => { - const overrides = []; - const mergedAssets = { ...templateAssets }; - - for (const field in themeAssets) { - if (templateAssets[field] !== null && templateAssets[field] !== undefined) { - overrides.push(field); - } else if (themeAssets[field].length > 0) { - mergedAssets[field] = themeAssets[field]; - } - } - - // eslint-disable-next-line @eslint-react/set-state-in-effect - setCustomizedTemplateAssetsKeys(overrides); - setMergedThemeAndTemplateAssets(mergedAssets); - }, [themeAssets, templateAssets]); - - const emitUpdatedTemplateAssets = async () => { - window.emitter.emit('AppBridge:TemplateAssetsUpdated', { - template, - documentId, - documentPageId, - templateAssets: await getTemplateAssets({ - appBridge, - template, - documentId, - documentPageId, - }), - prevTemplateAssets: { ...templateAssets }, - }); - }; - - const updateAssetIdsFromKey = async (key: string, newAssetIds: number[]) => { - const currentTemplateAssets = await getTemplateAssets({ - appBridge, - template, - documentId, - documentPageId, - }); - const oldAssetIds = currentTemplateAssets[key]?.map((asset) => asset.id) ?? []; - - try { - await deleteAssetIdsFromTemplateAssetKey(key, oldAssetIds, { - appBridge, - template, - documentId, - documentPageId, - }); - await addAssetIdsToTemplateAssetKey(key, newAssetIds, { - appBridge, - template, - documentId, - documentPageId, - }); - } catch (error) { - console.error(error); - } - - emitUpdatedTemplateAssets(); - }; - - const deleteAssetIdsFromKey = async (key: string, assetIds: number[]) => { - await deleteAssetIdsFromTemplateAssetKey(key, assetIds, { - appBridge, - template, - documentId, - documentPageId, - }); - emitUpdatedTemplateAssets(); - }; - - const addAssetIdsToKey = async (key: string, assetIds: number[]) => { - await addAssetIdsToTemplateAssetKey(key, assetIds, { - appBridge, - template, - documentId, - documentPageId, - }); - emitUpdatedTemplateAssets(); - }; - - return { - templateAssets: mergedThemeAndTemplateAssets, - themeAssets, - customizedTemplateAssetsKeys, - addAssetIdsToKey, - deleteAssetIdsFromKey, - updateAssetIdsFromKey, - }; -}; diff --git a/packages/app-bridge/src/react/useThemeAssets.spec.ts b/packages/app-bridge/src/react/useThemeAssets.spec.ts deleted file mode 100644 index 2c5ef7e15..000000000 --- a/packages/app-bridge/src/react/useThemeAssets.spec.ts +++ /dev/null @@ -1,163 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { act, cleanup, renderHook, waitFor } from '@testing-library/react'; -import { type SinonStub } from 'sinon'; -import { type Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { type Asset, type ThemeTemplate } from '..'; -import { AssetDummy, getAppBridgeThemeStub } from '../tests'; - -import { useThemeAssets } from './useThemeAssets'; - -const DOCUMENT_PAGE_TEMPLATE = 'documentPage'; - -describe('useThemeAssets hook', () => { - beforeEach(() => { - vi.spyOn(console, 'error').mockImplementation(() => {}); - }); - - afterEach(() => { - vi.restoreAllMocks(); - cleanup(); - }); - - const loadUseThemeAssets = async (existingAssets: Asset[], template: ThemeTemplate, keyName: string) => { - const asset = AssetDummy.with(1); - const appBridgeStub = getAppBridgeThemeStub({ - themeAssets: { [keyName]: existingAssets }, - }); - - const { result, rerender } = renderHook(() => useThemeAssets(appBridgeStub, template)); - - // eslint-disable-next-line @typescript-eslint/require-await - await act(async () => { - rerender(); - }); - - return { result, appBridgeStub, asset }; - }; - - it('should delete an asset', async () => { - const { result, appBridgeStub } = await loadUseThemeAssets([], DOCUMENT_PAGE_TEMPLATE, 'key'); - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = appBridgeStub.deleteAssetIdsFromThemeAssetKey.getCall(0); - - await waitFor(() => { - expect(call.firstArg).toEqual('key'); - expect(call.args[1]).toEqual([1]); - expect(call.lastArg).toEqual(DOCUMENT_PAGE_TEMPLATE); - expect(result.current.themeAssets).toStrictEqual({ key: [] }); - }); - }); - - it('should sort assets', async () => { - const { result, appBridgeStub } = await loadUseThemeAssets( - [AssetDummy.with(1), AssetDummy.with(2)], - DOCUMENT_PAGE_TEMPLATE, - 'key', - ); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - const deleteCall = appBridgeStub.deleteAssetIdsFromThemeAssetKey.getCall(0); - const addCall = appBridgeStub.addAssetIdsToThemeAssetKey.getCall(0); - - await waitFor(() => { - expect(deleteCall.firstArg).toEqual('key'); - expect(deleteCall.args[1]).toEqual([1, 2]); - expect(addCall.firstArg).toEqual('key'); - expect(addCall.args[1]).toEqual([2, 1]); - expect(result.current.themeAssets.key.map((asset) => asset.id)).toEqual([2, 1]); - }); - }); - - it('should delete nothing if key does not exist', async () => { - const { result, appBridgeStub } = await loadUseThemeAssets( - [AssetDummy.with(1), AssetDummy.with(2)], - DOCUMENT_PAGE_TEMPLATE, - 'non-existing-key', - ); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - const deleteCall = appBridgeStub.deleteAssetIdsFromThemeAssetKey.getCall(0); - - await waitFor(() => { - expect(deleteCall.firstArg).toEqual('key'); - expect(deleteCall.args[1]).toEqual([]); - }); - }); - - it('should not sort assets if api call throws error', async () => { - const { result, appBridgeStub } = await loadUseThemeAssets( - [AssetDummy.with(1), AssetDummy.with(2)], - DOCUMENT_PAGE_TEMPLATE, - 'key', - ); - (appBridgeStub.deleteAssetIdsFromThemeAssetKey as unknown as Mock) = vi - .fn() - .mockRejectedValue('Unsuccessful API call'); - - await act(async () => { - await result.current.updateAssetIdsFromKey('key', [2, 1]); - }); - - await waitFor(() => { - expect(result.current.themeAssets.key.map((asset) => asset.id)).toEqual([1, 2]); - }); - - expect(console.error).toHaveBeenCalledOnce(); - }); - - it('should notify about updated assets on delete', async () => { - const { result, asset } = await loadUseThemeAssets([AssetDummy.with(1)], DOCUMENT_PAGE_TEMPLATE, 'key'); - - await act(async () => { - await result.current.deleteAssetIdsFromKey('key', [1]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:ThemeAssetsUpdated'); - expect(call.lastArg.themeAssets).toStrictEqual({ key: [] }); - expect(call.lastArg.prevThemeAssets).toMatchObject({ key: [asset] }); - }); - }); - - it('should add asset ids', async () => { - const { result, appBridgeStub } = await loadUseThemeAssets([AssetDummy.with(1)], DOCUMENT_PAGE_TEMPLATE, 'key'); - await act(async () => { - await result.current.addAssetIdsToKey('key', [2]); - }); - - const call = appBridgeStub.addAssetIdsToThemeAssetKey.getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('key'); - expect(call.args[1]).toEqual([2]); - expect(result.current.themeAssets.key.map(({ id }) => id)).toEqual([1, 2]); - }); - }); - - it('should notify about updated assets on add asset ids to key', async () => { - const { result, asset } = await loadUseThemeAssets([AssetDummy.with(1)], DOCUMENT_PAGE_TEMPLATE, 'key'); - const assetToAdd = AssetDummy.with(2); - await act(async () => { - await result.current.addAssetIdsToKey('key', [assetToAdd.id]); - }); - - const call = (window.emitter.emit as SinonStub).getCall(0); - await waitFor(() => { - expect(call.firstArg).toEqual('AppBridge:ThemeAssetsUpdated'); - expect(call.lastArg.themeAssets).toMatchObject({ key: [asset, assetToAdd] }); - expect(call.lastArg.prevThemeAssets).toMatchObject({ key: [asset] }); - }); - }); -}); diff --git a/packages/app-bridge/src/react/useThemeAssets.ts b/packages/app-bridge/src/react/useThemeAssets.ts deleted file mode 100644 index ac39f94c0..000000000 --- a/packages/app-bridge/src/react/useThemeAssets.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type Asset, type ThemeTemplate } from '../types'; -import { compareObjects } from '../utilities'; - -export const useThemeAssets = (appBridge: AppBridgeTheme, template?: ThemeTemplate) => { - const portalId = appBridge.getPortalId(); - - const [themeAssets, setThemeAssets] = useState>({}); - - const updateThemeAssetsFromEvent = (event: { - template?: ThemeTemplate; - portalId: number; - themeAssets: Record; - prevThemeAssets: Record; - }) => { - if ( - template && - event.template === template && - event.portalId === portalId && - !compareObjects(event.themeAssets, event.prevThemeAssets) - ) { - setThemeAssets(event.themeAssets); - } - }; - - const getThemeAssets = async (): Promise> => { - return template ? await appBridge.getThemeAssets(template) : Promise.resolve({}); - }; - - const addAssetIdsToThemeAssetKey = async (key: string, assetIds: number[]): Promise => { - if (template) { - await appBridge.addAssetIdsToThemeAssetKey(key, assetIds, template); - } - }; - - const deleteAssetIdsFromThemeAssetKey = async (key: string, assetIds: number[]): Promise => { - if (template) { - await appBridge.deleteAssetIdsFromThemeAssetKey(key, assetIds, template); - } - }; - - // Fetch the theme assets on mount. - // And add listener for theme assets updates. - useEffect(() => { - let componentMounted = true; - - if (portalId) { - const mountingFetch = async () => { - const allThemeAssets = template ? await getThemeAssets() : {}; - - if (componentMounted && template) { - setThemeAssets(allThemeAssets); - } - }; - mountingFetch(); - - window.emitter.on('AppBridge:ThemeAssetsUpdated', updateThemeAssetsFromEvent); - } - - return () => { - componentMounted = false; - window.emitter.off('AppBridge:ThemeAssetsUpdated', updateThemeAssetsFromEvent); - }; - // eslint-disable-next-line @eslint-react/exhaustive-deps - }, [appBridge]); - - const emitUpdatedThemeAssets = async () => { - if (template) { - window.emitter.emit('AppBridge:ThemeAssetsUpdated', { - portalId, - themeAssets: await getThemeAssets(), - prevThemeAssets: { ...themeAssets }, - template, - }); - } - }; - - const updateAssetIdsFromKey = async (key: string, newAssetIds: number[]) => { - const currentThemeAssets = await getThemeAssets(); - const oldAssetIds = currentThemeAssets[key]?.map((asset) => asset.id) ?? []; - - try { - await deleteAssetIdsFromThemeAssetKey(key, oldAssetIds); - await addAssetIdsToThemeAssetKey(key, newAssetIds); - } catch (error) { - console.error(error); - } - - emitUpdatedThemeAssets(); - }; - - const deleteAssetIdsFromKey = async (key: string, assetIds: number[]) => { - await deleteAssetIdsFromThemeAssetKey(key, assetIds); - emitUpdatedThemeAssets(); - }; - - const addAssetIdsToKey = async (key: string, assetIds: number[]) => { - await addAssetIdsToThemeAssetKey(key, assetIds); - emitUpdatedThemeAssets(); - }; - - return { - themeAssets, - addAssetIdsToKey, - deleteAssetIdsFromKey, - updateAssetIdsFromKey, - }; -}; diff --git a/packages/app-bridge/src/react/useThemeSettings.spec.ts b/packages/app-bridge/src/react/useThemeSettings.spec.ts deleted file mode 100644 index e45179c7d..000000000 --- a/packages/app-bridge/src/react/useThemeSettings.spec.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { cleanup, renderHook, waitFor } from '@testing-library/react'; -import { type SinonStub } from 'sinon'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -import { getAppBridgeThemeStub } from '../tests'; -import { type ThemeTemplate } from '../types'; - -import { useThemeSettings } from './useThemeSettings'; - -const THEME_SETTINGS = { - cover: { - coverSettingOne: 'value one', - coverSettingTwo: 'value two', - }, - documentPage: {}, - library: {}, -}; - -describe('useThemeSettings', () => { - beforeEach(() => { - vi.spyOn(console, 'error').mockImplementation(() => {}); - }); - - afterEach(() => { - vi.restoreAllMocks(); - cleanup(); - }); - - const loadUseThemeSettings = (themeSettings: Record>) => { - const appBridgeStub = getAppBridgeThemeStub({ - themeSettings, - }); - - const { result } = renderHook(() => useThemeSettings(appBridgeStub)); - return { result, appBridgeStub }; - }; - - it('returns the theme settings', async () => { - const { result } = await loadUseThemeSettings(THEME_SETTINGS); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.themeSettings).toEqual(THEME_SETTINGS); - }); - }); - - it('updates the theme settings', async () => { - const { result } = await loadUseThemeSettings(THEME_SETTINGS); - - expect(result.current.isLoading).toEqual(true); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.themeSettings).toEqual(THEME_SETTINGS); - }); - - await result.current.updateThemeSettings({ - cover: { coverSettingTwo: 'value two - updated' }, - }); - expect(result.current.isLoading).toEqual(false); - - const emitCall = (window.emitter.emit as SinonStub).getCall(0); - - await waitFor(() => { - expect(result.current.isLoading).toEqual(false); - expect(result.current.themeSettings).toEqual({ - cover: { coverSettingOne: 'value one', coverSettingTwo: 'value two - updated' }, - documentPage: {}, - library: {}, - }); - expect(emitCall.firstArg).toEqual('AppBridge:ThemeSettingsUpdated'); - expect(emitCall.lastArg.themeSettings).toStrictEqual({ - cover: { coverSettingOne: 'value one', coverSettingTwo: 'value two - updated' }, - documentPage: {}, - library: {}, - }); - }); - }); -}); diff --git a/packages/app-bridge/src/react/useThemeSettings.ts b/packages/app-bridge/src/react/useThemeSettings.ts deleted file mode 100644 index 3aa6b76c4..000000000 --- a/packages/app-bridge/src/react/useThemeSettings.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { useEffect, useState } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type EmitterEvents, type ThemeTemplate } from '../types'; - -export const useThemeSettings = >>( - appBridge: AppBridgeTheme, -) => { - const [themeSettings, setThemeSettings] = useState>(null); - const [isLoading, setIsLoading] = useState(true); - - useEffect(() => { - const updateThemeSettingsFromEvent = (event: EmitterEvents['AppBridge:ThemeSettingsUpdated']) => { - setThemeSettings({ ...event.themeSettings } as T); - }; - - const getInitialThemeSettings = async () => { - setIsLoading(true); - - const themeSettings = await appBridge.getThemeSettings(); - setThemeSettings(themeSettings); - - setIsLoading(false); - }; - - getInitialThemeSettings(); - - window.emitter.on('AppBridge:ThemeSettingsUpdated', updateThemeSettingsFromEvent); - - return () => { - window.emitter.off('AppBridge:ThemeSettingsUpdated', updateThemeSettingsFromEvent); - }; - }, [appBridge]); - - const updateThemeSettings = async (themeSettingsUpdate: Partial) => { - try { - await appBridge.updateThemeSettings(themeSettingsUpdate); - - window.emitter.emit('AppBridge:ThemeSettingsUpdated', { - themeSettings: { - cover: { ...themeSettings?.cover, ...themeSettingsUpdate.cover }, - library: { ...themeSettings?.library, ...themeSettingsUpdate.library }, - documentPage: { ...themeSettings?.documentPage, ...themeSettingsUpdate.documentPage }, - }, - }); - } catch (error) { - console.error(error); - } - }; - - return { themeSettings, updateThemeSettings, isLoading }; -}; diff --git a/packages/app-bridge/src/react/useUncategorizedDocumentPages.ts b/packages/app-bridge/src/react/useUncategorizedDocumentPages.ts deleted file mode 100644 index 12aeb13a0..000000000 --- a/packages/app-bridge/src/react/useUncategorizedDocumentPages.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type DocumentPage, type EmitterEvents } from '../types'; - -import { type DocumentPageTargetEvent } from './useDocumentPageTargets'; - -type DocumentPagesMoveEvent = EmitterEvents['AppBridge:GuidelineDocumentPage:MoveEvent']; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -const sortDocumentPages = (a: DocumentPage, b: DocumentPage) => (a.sort && b.sort ? a.sort - b.sort : 0); - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useUncategorizedDocumentPages = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - documentId: number, - options: Options = { enabled: true }, -) => { - // eslint-disable-next-line @eslint-react/use-state - const [documentPages, setDocumentPages] = useState>(new Map([])); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setDocumentPages(await fetchDocumentPagesByDocumentId(appBridge, documentId)); - setIsLoading(false); - }, [appBridge, documentId]); - - useEffect(() => { - if (options.enabled) { - refetch(); - } - }, [options.enabled, refetch]); - - useEffect(() => { - const refetchIfPageExistsInMap = (event: DocumentPageTargetEvent) => { - for (const id of event.payload.pageIds) { - if (documentPages.has(id)) { - refetch(); - break; - } - } - }; - - const handleDocumentPageMoveEvent = (event: DocumentPagesMoveEvent) => { - if (!documentPages.has(event.documentPage.id) || event.categoryId) { - return; - } - - setDocumentPages( - produce((draft) => { - previewDocumentPagesSort(draft, event.documentPage, event.position); - }), - ); - }; - - const handler = ({ action, documentPage }: EmitterEvents['AppBridge:GuidelineDocumentPage:Action']) => { - if ( - (action === 'update' && documentPages.has(documentPage.id)) || - (action === 'add' && documentPage.documentId === documentId && !documentPage.categoryId) - ) { - refetch(); - } else if ((action === 'delete' || action === 'move') && documentPages.has(documentPage.id)) { - setDocumentPages( - produce((draft) => { - if (action === 'move') { - moveDocumentPage(draft, documentPage); - } else if (action === 'delete') { - draft.delete(documentPage.id); - } - }), - ); - } - }; - - window.emitter.on('AppBridge:GuidelineDocumentPage:Action', handler); - window.emitter.on('AppBridge:GuidelineDocumentPageTargets:Action', refetchIfPageExistsInMap); - window.emitter.on('AppBridge:GuidelineDocumentPage:MoveEvent', handleDocumentPageMoveEvent); - - return () => { - window.emitter.off('AppBridge:GuidelineDocumentPage:Action', handler); - window.emitter.off('AppBridge:GuidelineDocumentPageTargets:Action', refetchIfPageExistsInMap); - window.emitter.off('AppBridge:GuidelineDocumentPage:MoveEvent', handleDocumentPageMoveEvent); - }; - }, [documentId, refetch, documentPages]); - - return { documentPages: Array.from(documentPages.values()), refetch, isLoading }; -}; - -const previewDocumentPagesSort = ( - documentPages: Map, - documentPage: DocumentPagesMoveEvent['documentPage'], - newPosition: DocumentPagesMoveEvent['position'], -) => { - if (!documentPage.sort || !newPosition) { - return documentPages; - } - - const previousDocumentPage = documentPages.get(documentPage.id); - const documentPagesAsArray: DocumentPage[] = [...documentPages.values()].sort(sortDocumentPages); - - documentPages.clear(); - - let sort = 1; - let isOnLastPosition = true; - for (const currentDocumentPage of documentPagesAsArray) { - if (currentDocumentPage.id === documentPage.id) { - continue; - } - - if (previousDocumentPage && sort === newPosition) { - documentPages.set(documentPage.id, { ...previousDocumentPage, sort: newPosition }); - isOnLastPosition = false; - } - - documentPages.set(currentDocumentPage.id, { - ...currentDocumentPage, - sort, - }); - - sort++; - } - - if (previousDocumentPage && isOnLastPosition) { - documentPages.set(documentPage.id, { ...previousDocumentPage, sort }); - } - - return documentPages; -}; - -const moveDocumentPage = (draft: Map, documentPage: DocumentPage) => { - const documentPagesAsArray: DocumentPage[] = [...draft.values()]; - let isPageOnLastPosition = true; - - draft.clear(); - - for (const currentDocumentPage of documentPagesAsArray) { - if (currentDocumentPage.id === documentPage.id) { - continue; - } - - if (draft.size === documentPage.sort - 1) { - draft.set(documentPage.id, documentPage); - isPageOnLastPosition = false; - } - - draft.set(currentDocumentPage.id, currentDocumentPage); - } - - if (isPageOnLastPosition) { - draft.set(documentPage.id, documentPage); - } - - return draft; -}; - -const fetchDocumentPagesByDocumentId = async (appBridge: AppBridgeBlock | AppBridgeTheme, documentId: number) => { - const pages = await appBridge.getUncategorizedDocumentPagesByDocumentId(documentId); - return new Map([...pages].sort(sortDocumentPages).map((page) => [page.id, page])); -}; diff --git a/packages/app-bridge/src/react/useUngroupedDocuments.ts b/packages/app-bridge/src/react/useUngroupedDocuments.ts deleted file mode 100644 index f59251fbc..000000000 --- a/packages/app-bridge/src/react/useUngroupedDocuments.ts +++ /dev/null @@ -1,283 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { produce } from 'immer'; -import { useCallback, useEffect, useState } from 'react'; - -import { type AppBridgeBlock } from '../AppBridgeBlock'; -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type Document, type EmitterEvents } from '../types'; - -type DocumentPageEvent = EmitterEvents['AppBridge:GuidelineDocument:DocumentPageAction']; -type DocumentCategoryEvent = EmitterEvents['AppBridge:GuidelineDocument:DocumentCategoryAction']; -type DocumentEvent = EmitterEvents['AppBridge:GuidelineDocumentGroup:Action']; -type DocumentMoveEvent = EmitterEvents['AppBridge:GuidelineDocument:MoveEvent']; -type DocumentGroupMoveEvent = EmitterEvents['AppBridge:GuidelineDocumentGroup:MoveEvent']; - -type Options = { - /** - * Whether it should fetch on mount. - */ - enabled?: boolean; -}; - -const sortDocuments = (a: Document, b: Document) => (a.sort && b.sort ? a.sort - b.sort : 0); - -/** - * @deprecated will be removed in version 4.0.0 of `@frontify/app-bridge` - * There won't be a replacement for this method. - */ -export const useUngroupedDocuments = ( - appBridge: AppBridgeBlock | AppBridgeTheme, - options: Options = { enabled: true }, -) => { - // eslint-disable-next-line @eslint-react/use-state - const [documents, setDocuments] = useState>(new Map([])); - const [isLoading, setIsLoading] = useState(true); - - const refetch = useCallback(async () => { - setIsLoading(true); - setDocuments(await fetchUngroupedDocuments(appBridge)); - setIsLoading(false); - }, [appBridge]); - - useEffect(() => { - if (options.enabled) { - refetch(); - } - }, [options.enabled, refetch]); - - useEffect(() => { - const handleDocumentPageEvent = (event: DocumentPageEvent) => { - if (!documents.has(event.documentPage.documentId)) { - return; - } - - setDocuments( - produce((draft) => { - const action = `${event.action}-page` as const; - const handler = actionHandlers[action] || actionHandlers.default; - return handler(draft, event.documentPage); - }), - ); - }; - - const handleDocumentCategoryEvent = (event: DocumentCategoryEvent) => { - if (!documents.has(event.documentCategory.documentId)) { - return; - } - - setDocuments( - produce((draft) => { - const action = `${event.action}-category` as const; - const handler = actionHandlers[action] || actionHandlers.default; - return handler(draft, event.documentCategory); - }), - ); - }; - - // handles when a document group is moved, refetches for updated positioning - const handleDocumentGroupUpdateEvent = (event: DocumentEvent) => { - if (event?.action === 'update' && documents.size > 0) { - refetch(); - } - }; - - const handlerDocumentMoveEventPreview = (event: DocumentMoveEvent) => { - if (!documents.has(event.document.id) || event.newGroupId || event.document.documentGroupId) { - return; - } - - setDocuments(produce((draft) => previewDocumentSort(draft, event.document, event.position))); - }; - - const handleDocumentGroupMoveEventPreview = (event: DocumentGroupMoveEvent) => { - setDocuments(produce((draft) => previewDocumentGroupSort(draft, event?.documentGroup, event.position))); - }; - - const handler = ({ action, document }: EmitterEvents['AppBridge:GuidelineDocument:Action']) => { - if ( - ((action === 'update' || action === 'move') && documents.has(document.id)) || - (action === 'add' && !document.documentGroupId) - ) { - refetch(); - } else if (action === 'delete' && documents.has(document.id)) { - setDocuments( - produce((draft) => { - if (action === 'delete') { - draft.delete(document.id); - } - }), - ); - } - }; - - window.emitter.on('AppBridge:GuidelineDocument:Action', handler); - window.emitter.on('AppBridge:GuidelineDocumentTargets:Action', refetch); - window.emitter.on('AppBridge:GuidelineDocument:DocumentPageAction', handleDocumentPageEvent); - window.emitter.on('AppBridge:GuidelineDocument:DocumentCategoryAction', handleDocumentCategoryEvent); - window.emitter.on('AppBridge:GuidelineDocumentGroup:Action', handleDocumentGroupUpdateEvent); - window.emitter.on('AppBridge:GuidelineDocument:MoveEvent', handlerDocumentMoveEventPreview); - window.emitter.on('AppBridge:GuidelineDocumentGroup:MoveEvent', handleDocumentGroupMoveEventPreview); - - return () => { - window.emitter.off('AppBridge:GuidelineDocument:Action', handler); - window.emitter.off('AppBridge:GuidelineDocumentTargets:Action', refetch); - window.emitter.off('AppBridge:GuidelineDocument:DocumentPageAction', handleDocumentPageEvent); - window.emitter.off('AppBridge:GuidelineDocument:DocumentCategoryAction', handleDocumentCategoryEvent); - window.emitter.off('AppBridge:GuidelineDocumentGroup:Action', handleDocumentGroupUpdateEvent); - window.emitter.off('AppBridge:GuidelineDocument:MoveEvent', handlerDocumentMoveEventPreview); - window.emitter.off('AppBridge:GuidelineDocumentGroup:MoveEvent', handleDocumentGroupMoveEventPreview); - }; - }, [documents, options.enabled, refetch]); - - return { documents: Array.from(documents.values()), refetch, isLoading }; -}; - -const previewDocumentSort = ( - documents: Map, - document: DocumentMoveEvent['document'], - newPosition: DocumentMoveEvent['position'], -) => { - if (!document.sort || !newPosition) { - return documents; - } - - const previousPosition = document.sort; - const documentsAsArray: Document[] = [...documents.values()].sort(sortDocuments); - const newDocuments: Document[] = []; - - documents.clear(); - - for (const currentDocument of documentsAsArray) { - if (currentDocument.id === document.id) { - newDocuments.push({ ...currentDocument, sort: newPosition }); - continue; - } - - const currentPosition = currentDocument.sort ?? 0; - let positionIncrease = 0; - if (newPosition <= currentPosition) { - positionIncrease = previousPosition > currentPosition || previousPosition === 0 ? 1 : 0; - } - - newDocuments.push({ ...currentDocument, sort: currentPosition + positionIncrease }); - } - - const sortedNewDocuments = [...newDocuments].sort(sortDocuments); - for (const currentDocument of sortedNewDocuments) { - documents.set(currentDocument.id, currentDocument); - } - - return documents; -}; - -const previewDocumentGroupSort = ( - documents: Map, - documentGroup: DocumentGroupMoveEvent['documentGroup'], - newPosition: DocumentGroupMoveEvent['position'], -) => { - if (!documentGroup.sort) { - return documents; - } - - const previousPosition = documentGroup.sort; - const documentsAsArray: Document[] = [...documents.values()].sort(sortDocuments); - const newDocuments: Document[] = []; - - documents.clear(); - - for (const currentDocument of documentsAsArray) { - const currentPosition = currentDocument.sort ?? 0; - let positionIncrease = 0; - if (newPosition <= currentPosition) { - positionIncrease = previousPosition > currentPosition ? 1 : 0; - } - - newDocuments.push({ ...currentDocument, sort: currentPosition + positionIncrease }); - } - - const sortedNewDocuments = [...newDocuments].sort(sortDocuments); - for (const currentDocument of sortedNewDocuments) { - documents.set(currentDocument.id, currentDocument); - } - - return documents; -}; - -const addDocumentPage = (documents: Map, documentPageToAdd: DocumentPageEvent['documentPage']) => { - const document = documents.get(documentPageToAdd.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfUncategorizedDocumentPages: document.numberOfUncategorizedDocumentPages + 1, - }; - - return documents.set(document.id, newDocument); -}; - -const deleteDocumentPage = ( - documents: Map, - documentPageToDelete: DocumentPageEvent['documentPage'], -) => { - const document = documents.get(documentPageToDelete.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfUncategorizedDocumentPages: document.numberOfUncategorizedDocumentPages - 1, - }; - - return documents.set(document.id, newDocument); -}; - -const addDocumentCategory = ( - documents: Map, - documentCategoryToAdd: DocumentCategoryEvent['documentCategory'], -) => { - const document = documents.get(documentCategoryToAdd.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfDocumentPageCategories: document.numberOfDocumentPageCategories + 1, - }; - - return documents.set(document.id, newDocument); -}; - -const deleteDocumentCategory = ( - documents: Map, - documentCategoryToDelete: DocumentCategoryEvent['documentCategory'], -) => { - const document = documents.get(documentCategoryToDelete.documentId); - if (!document) { - return documents; - } - - const newDocument = { - ...document, - numberOfDocumentPageCategories: document.numberOfDocumentPageCategories - 1, - }; - - return documents.set(document.id, newDocument); -}; - -const actionHandlers = { - 'add-page': addDocumentPage, - 'delete-page': deleteDocumentPage, - 'add-category': addDocumentCategory, - 'delete-category': deleteDocumentCategory, - default: (documents: Map) => documents, -}; - -const fetchUngroupedDocuments = async (appBridge: AppBridgeBlock | AppBridgeTheme) => { - const documents = await appBridge.getUngroupedDocuments(); - return new Map([...documents].sort(sortDocuments).map((document) => [document.id, document])); -}; diff --git a/packages/app-bridge/src/registries/api/ApiMethodRegistry.ts b/packages/app-bridge/src/registries/api/ApiMethodRegistry.ts index 8cab26265..acc95fb7d 100644 --- a/packages/app-bridge/src/registries/api/ApiMethodRegistry.ts +++ b/packages/app-bridge/src/registries/api/ApiMethodRegistry.ts @@ -2,40 +2,24 @@ import { type ApiMethodNameValidator } from '../../AppBridge'; -import { type CreateAssetPayload, type CreateAssetResponse } from './CreateAsset'; import { type GetAssetBulkDownloadTokenPayload, type GetAssetBulkDownloadTokenResponse, } from './GetAssetBulkDownloadToken'; -import { - type GetAssetResourceInformationPayload, - type GetAssetResourceInformationResponse, -} from './GetAssetResourceInformation'; -import { type GetCurrentUserPayload, type GetCurrentUserResponse } from './GetCurrentUser'; -import { type GetDocumentNavigationPayload, type GetDocumentNavigationResponse } from './GetDocumentNavigation'; -import { type GetPortalNavigationResponse } from './GetPortalNavigation'; -import { type GetProxyNetworkCallPayload, type GetProxyNetworkCallResponse } from './GetProxyNetworkCall'; +import { type GetCurrentUserPayload, type GetCurrentUserResponse } from './GetCurrentUser.ts'; import { type SetAssetIdsByBlockAssetKeyPayload, type SetAssetIdsByBlockAssetKeyResponse, } from './SetAssetIdsByBlockAssetKey'; export type ApiMethodRegistry = ApiMethodNameValidator<{ + getCurrentUser: { payload: GetCurrentUserPayload; response: GetCurrentUserResponse }; getAssetBulkDownloadToken: { payload: GetAssetBulkDownloadTokenPayload; response: GetAssetBulkDownloadTokenResponse; }; - getCurrentUser: { payload: GetCurrentUserPayload; response: GetCurrentUserResponse }; - createAsset: { payload: CreateAssetPayload; response: CreateAssetResponse }; - getAssetResourceInformation: { - payload: GetAssetResourceInformationPayload; - response: GetAssetResourceInformationResponse; - }; setAssetIdsByBlockAssetKey: { payload: SetAssetIdsByBlockAssetKeyPayload; response: SetAssetIdsByBlockAssetKeyResponse; }; - getProxyNetworkCall: { payload: GetProxyNetworkCallPayload; response: GetProxyNetworkCallResponse }; - getDocumentNavigation: { payload: GetDocumentNavigationPayload; response: GetDocumentNavigationResponse }; - getPortalNavigation: { payload: void; response: GetPortalNavigationResponse }; }>; diff --git a/packages/app-bridge/src/registries/api/CreateAsset.spec.ts b/packages/app-bridge/src/registries/api/CreateAsset.spec.ts deleted file mode 100644 index c3c26abe6..000000000 --- a/packages/app-bridge/src/registries/api/CreateAsset.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { createAsset } from './CreateAsset'; - -describe('CreateAsset', () => { - it('should return correct method name and payload', () => { - const TEST_DATA = 'test'; - const payload = { - data: TEST_DATA, - filename: TEST_DATA, - parentId: TEST_DATA, - description: TEST_DATA, - externalId: TEST_DATA, - tags: [{ value: TEST_DATA }], - }; - const currentUser = createAsset(payload); - expect(currentUser.name).toBe('createAsset'); - expect(currentUser.payload).toBe(payload); - }); -}); diff --git a/packages/app-bridge/src/registries/api/CreateAsset.ts b/packages/app-bridge/src/registries/api/CreateAsset.ts deleted file mode 100644 index 9bfb8a445..000000000 --- a/packages/app-bridge/src/registries/api/CreateAsset.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type CreateAssetPayload = { - data: File | Blob | string; - filename: string; - parentId?: string; - description?: string; - externalId?: string; - tags?: { value: string }[]; -}; - -export type CreateAssetResponse = { - assetId: string; -}; - -export const createAsset = (payload: CreateAssetPayload): { name: 'createAsset'; payload: CreateAssetPayload } => ({ - name: 'createAsset', - payload, -}); diff --git a/packages/app-bridge/src/registries/api/GetAssetResourceInformation.spec.ts b/packages/app-bridge/src/registries/api/GetAssetResourceInformation.spec.ts deleted file mode 100644 index 3e2788fae..000000000 --- a/packages/app-bridge/src/registries/api/GetAssetResourceInformation.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { getAssetResourceInformation } from './GetAssetResourceInformation'; - -describe('GetAssetResourceInformation', () => { - it('should return correct method name', () => { - const TEST_ID = 'test-123'; - const assetResourceInformation = getAssetResourceInformation({ - assetId: TEST_ID, - }); - expect(assetResourceInformation.name).toBe('getAssetResourceInformation'); - expect(assetResourceInformation.payload).toStrictEqual({ - assetId: TEST_ID, - }); - }); -}); diff --git a/packages/app-bridge/src/registries/api/GetAssetResourceInformation.ts b/packages/app-bridge/src/registries/api/GetAssetResourceInformation.ts deleted file mode 100644 index ecfa5e9bb..000000000 --- a/packages/app-bridge/src/registries/api/GetAssetResourceInformation.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type GetAssetResourceInformationPayload = { - assetId: string; -}; - -export type GetAssetResourceInformationResponse = { - type: string; - id: string; - title?: string; - previewUrl?: string; - downloadUrl?: string; - filename?: string | null; - sourceUrl?: string; - html?: string; -}; - -export const getAssetResourceInformation = ( - payload: GetAssetResourceInformationPayload, -): { name: 'getAssetResourceInformation'; payload: GetAssetResourceInformationPayload } => ({ - name: 'getAssetResourceInformation', - payload, -}); diff --git a/packages/app-bridge/src/registries/api/GetDocumentNavigation.spec.ts b/packages/app-bridge/src/registries/api/GetDocumentNavigation.spec.ts deleted file mode 100644 index be862a687..000000000 --- a/packages/app-bridge/src/registries/api/GetDocumentNavigation.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { GuidelineDocumentClass, GuidelineDocumentClassDummy } from '../../tests'; - -import { getDocumentNavigation } from './GetDocumentNavigation'; - -describe('GetDocumentNavigation', () => { - it('should return correct method name', () => { - const document = GuidelineDocumentClassDummy.with(101, 'document-101'); - - const documentNavigationCall = getDocumentNavigation({ document }); - expect(documentNavigationCall.name).toBe('getDocumentNavigation'); - }); - - it('should return correct payload', () => { - const document = GuidelineDocumentClassDummy.with(101, 'document-101'); - - const documentNavigationCall = getDocumentNavigation({ document }); - expect(documentNavigationCall.payload.document).toBeInstanceOf(GuidelineDocumentClass); - }); -}); diff --git a/packages/app-bridge/src/registries/api/GetDocumentNavigation.ts b/packages/app-bridge/src/registries/api/GetDocumentNavigation.ts deleted file mode 100644 index fbaa8465f..000000000 --- a/packages/app-bridge/src/registries/api/GetDocumentNavigation.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentNavigationItem, type GuidelineDocument } from '../../types/Guideline'; - -export type GetDocumentNavigationPayload = { - document: GuidelineDocument; -}; - -export type GetDocumentNavigationResponse = DocumentNavigationItem[]; - -export const getDocumentNavigation = ( - payload: GetDocumentNavigationPayload, -): { name: 'getDocumentNavigation'; payload: GetDocumentNavigationPayload } => ({ - name: 'getDocumentNavigation', - payload, -}); diff --git a/packages/app-bridge/src/registries/api/GetPortalNavigation.spec.ts b/packages/app-bridge/src/registries/api/GetPortalNavigation.spec.ts deleted file mode 100644 index 77bf9df8b..000000000 --- a/packages/app-bridge/src/registries/api/GetPortalNavigation.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { getPortalNavigation } from './GetPortalNavigation'; - -describe('GetPortalNavigation', () => { - it('should return correct method name', () => { - const portalNavigationCall = getPortalNavigation(); - expect(portalNavigationCall.name).toBe('getPortalNavigation'); - }); -}); diff --git a/packages/app-bridge/src/registries/api/GetPortalNavigation.ts b/packages/app-bridge/src/registries/api/GetPortalNavigation.ts deleted file mode 100644 index a8ae0b80a..000000000 --- a/packages/app-bridge/src/registries/api/GetPortalNavigation.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type PortalNavigationItem } from '../../types/Guideline'; - -export type GetPortalNavigationResponse = PortalNavigationItem[]; - -export const getPortalNavigation = () => ({ name: 'getPortalNavigation' }); diff --git a/packages/app-bridge/src/registries/api/GetProxyNetworkCall.spec.ts b/packages/app-bridge/src/registries/api/GetProxyNetworkCall.spec.ts deleted file mode 100644 index 1d6ce37d0..000000000 --- a/packages/app-bridge/src/registries/api/GetProxyNetworkCall.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { getProxyNetworkCall } from './GetProxyNetworkCall'; - -describe('GetProxyNetworkCall', () => { - it('should return correct method name', () => { - const TEST_ID = 'user-api'; - const proxyNetworkCall = getProxyNetworkCall({ id: TEST_ID, props: 'data' }); - expect(proxyNetworkCall.name).toBe('getProxyNetworkCall'); - expect(proxyNetworkCall.payload).toStrictEqual({ - id: TEST_ID, - props: 'data', - }); - }); -}); diff --git a/packages/app-bridge/src/registries/api/GetProxyNetworkCall.ts b/packages/app-bridge/src/registries/api/GetProxyNetworkCall.ts deleted file mode 100644 index c0e800190..000000000 --- a/packages/app-bridge/src/registries/api/GetProxyNetworkCall.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type GetProxyNetworkCallPayload = { - id: string; - props: unknown; -}; - -export type GetProxyNetworkCallResponse = { - data: unknown; -}; - -export const getProxyNetworkCall = (payload: GetProxyNetworkCallPayload) => ({ name: 'getProxyNetworkCall', payload }); diff --git a/packages/app-bridge/src/registries/api/index.ts b/packages/app-bridge/src/registries/api/index.ts index 4ed17f00d..cb8368d33 100644 --- a/packages/app-bridge/src/registries/api/index.ts +++ b/packages/app-bridge/src/registries/api/index.ts @@ -2,10 +2,5 @@ export * from './ApiMethodRegistry'; export * from './GetAssetBulkDownloadToken'; -export * from './CreateAsset'; -export * from './GetAssetResourceInformation'; -export * from './GetCurrentUser'; export * from './SetAssetIdsByBlockAssetKey'; -export * from './GetProxyNetworkCall'; -export * from './GetDocumentNavigation'; -export * from './GetPortalNavigation'; +export * from './GetCurrentUser'; diff --git a/packages/app-bridge/src/registries/commands/CommandRegistry.ts b/packages/app-bridge/src/registries/commands/CommandRegistry.ts index d3e1443a3..63aa9aaa8 100644 --- a/packages/app-bridge/src/registries/commands/CommandRegistry.ts +++ b/packages/app-bridge/src/registries/commands/CommandRegistry.ts @@ -6,6 +6,7 @@ import { type Asset, type AssetChooserOptions, type OpenNewPublicationPayload, + type TrackPayload, } from '../../types'; type OpenAssetChooserPayload = AssetChooserOptions; @@ -13,11 +14,9 @@ type CloseAssetChooserPayload = void; type OpenAssetViewerPayload = AssetViewerOptions; type OpenTemplateChooser = void; type CloseTemplateChooser = void; -type OpenNavigationManager = void; type DownloadAsset = Asset; type OpenSearchDialog = void; type CloseSearchDialog = void; -type NavigateToDocumentSection = number | string; export type CommandRegistry = CommandNameValidator<{ openAssetChooser?: OpenAssetChooserPayload; @@ -26,9 +25,8 @@ export type CommandRegistry = CommandNameValidator<{ openTemplateChooser: OpenTemplateChooser; closeTemplateChooser: CloseTemplateChooser; downloadAsset: DownloadAsset; - openNavigationManager: OpenNavigationManager; openNewPublication: OpenNewPublicationPayload; openSearchDialog: OpenSearchDialog; closeSearchDialog: CloseSearchDialog; - navigateToDocumentSection: NavigateToDocumentSection; + trackEvent: TrackPayload; }>; diff --git a/packages/app-bridge/src/registries/commands/Connection.ts b/packages/app-bridge/src/registries/commands/Connection.ts deleted file mode 100644 index 89919daa8..000000000 --- a/packages/app-bridge/src/registries/commands/Connection.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export const openConnection = (): { name: 'openConnection' } => ({ name: 'openConnection' }); diff --git a/packages/app-bridge/src/registries/commands/NavigateToDocumentSection.ts b/packages/app-bridge/src/registries/commands/NavigateToDocumentSection.ts deleted file mode 100644 index d75f6f62c..000000000 --- a/packages/app-bridge/src/registries/commands/NavigateToDocumentSection.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DispatchHandlerParameter } from '../../AppBridge'; - -import { type CommandRegistry } from './CommandRegistry'; - -export const navigateToDocumentSection = ( - sectionId: CommandRegistry['navigateToDocumentSection'], -): DispatchHandlerParameter<'navigateToDocumentSection', CommandRegistry> => ({ - name: 'navigateToDocumentSection', - payload: sectionId, -}); diff --git a/packages/app-bridge/src/registries/commands/NavigationManager.ts b/packages/app-bridge/src/registries/commands/TrackEvent.ts similarity index 51% rename from packages/app-bridge/src/registries/commands/NavigationManager.ts rename to packages/app-bridge/src/registries/commands/TrackEvent.ts index efe190276..efda4d793 100644 --- a/packages/app-bridge/src/registries/commands/NavigationManager.ts +++ b/packages/app-bridge/src/registries/commands/TrackEvent.ts @@ -4,6 +4,9 @@ import { type DispatchHandlerParameter } from '../../AppBridge'; import { type CommandRegistry } from './CommandRegistry'; -export const openNavigationManager = (): DispatchHandlerParameter<'openNavigationManager', CommandRegistry> => ({ - name: 'openNavigationManager', +export const trackEvent = ( + payload: CommandRegistry['trackEvent'], +): DispatchHandlerParameter<'trackEvent', CommandRegistry> => ({ + name: 'trackEvent', + payload, }); diff --git a/packages/app-bridge/src/registries/commands/index.ts b/packages/app-bridge/src/registries/commands/index.ts index d1e78f8e6..39c750cea 100644 --- a/packages/app-bridge/src/registries/commands/index.ts +++ b/packages/app-bridge/src/registries/commands/index.ts @@ -3,10 +3,8 @@ export * from './AssetChooser'; export * from './AssetViewer'; export * from './CommandRegistry'; -export * from './Connection'; export * from './DownloadAsset'; -export * from './NavigationManager'; export * from './NewPublication'; export * from './SearchDialog'; export * from './TemplateChooser'; -export * from './NavigateToDocumentSection'; +export * from './TrackEvent'; diff --git a/packages/app-bridge/src/registries/verbs/Verbs.ts b/packages/app-bridge/src/registries/verbs/Verbs.ts index a18d6e7b8..9f1b2ceff 100644 --- a/packages/app-bridge/src/registries/verbs/Verbs.ts +++ b/packages/app-bridge/src/registries/verbs/Verbs.ts @@ -1,5 +1,5 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ export type ApiVerb = 'get' | 'create' | 'update' | 'delete' | 'add' | 'remove' | 'set'; -export type CommandVerb = 'open' | 'close' | 'navigate' | 'download'; +export type CommandVerb = 'open' | 'close' | 'download' | 'track'; export type EventVerb = 'chosen'; diff --git a/packages/app-bridge/src/repositories/AssetRepository.ts b/packages/app-bridge/src/repositories/AssetRepository.ts index f1f16ad03..0a01e4cf1 100644 --- a/packages/app-bridge/src/repositories/AssetRepository.ts +++ b/packages/app-bridge/src/repositories/AssetRepository.ts @@ -16,9 +16,9 @@ export const createAssetByFileId = async (fileId: string, projectId: number, set export const mapAssetApiToAsset = (asset: AssetApi): Asset => { return { id: asset.id, + alternativeText: asset.alternative_text, objectType: asset.object_type, extension: asset.ext, - creatorName: asset.creator_name, externalUrl: asset.external_url, genericUrl: asset.generic_url, previewUrl: asset.preview_url, @@ -33,9 +33,10 @@ export const mapAssetApiToAsset = (asset: AssetApi): Asset => { title: asset.title, fileId: asset.file_id, token: asset.token, - projectType: asset.project_type, revisionId: asset.revision_id, backgroundColor: asset.background_color, isDownloadProtected: asset.is_download_protected, + focalPointX: asset.focal_point_x, + focalPointY: asset.focal_point_y, }; }; diff --git a/packages/app-bridge/src/tests/AppBridgeBlockStub.ts b/packages/app-bridge/src/tests/AppBridgeBlockStub.ts index 911aa5e15..c4b75a376 100644 --- a/packages/app-bridge/src/tests/AppBridgeBlockStub.ts +++ b/packages/app-bridge/src/tests/AppBridgeBlockStub.ts @@ -12,7 +12,6 @@ import { type PrivacySettings } from '../types/PrivacySettings'; import { AssetDummy } from './AssetDummy'; import { BulkDownloadDummy } from './BulkDownloadDummy'; -import { ColorDummy } from './ColorDummy'; import { ColorPaletteDummy } from './ColorPaletteDummy'; import { DocumentSectionApiDummy } from './DocumentSectionApiDummy'; import { TemplateDummy } from './TemplateDummy'; @@ -28,8 +27,6 @@ export type getAppBridgeBlockStubProps = { blockSettings?: Record; blockAssets?: Record; editorState?: boolean; - openAssetChooser?: (callback: Parameters[0]) => void; - closeAssetChooser?: () => void; blockId?: number; sectionId?: number; projectId?: number; @@ -46,8 +43,6 @@ export const getAppBridgeBlockStub = ({ blockSettings = {}, blockAssets = {}, editorState = false, - openAssetChooser = () => null, - closeAssetChooser = () => null, blockId = BLOCK_ID, sectionId = SECTION_ID, projectId = PROJECT_ID, @@ -72,45 +67,30 @@ export const getAppBridgeBlockStub = ({ const deletedTemplateIds: Record = {}; const addedTemplateIds: Record = {}; + const contextAssetsSubscribers: Set<(nextAssets: Record) => void> = new Set(); + + const computeBlockAssets = (): Record => + Object.entries(blockAssets).reduce>((assetsDiff, [key, assets]) => { + const addedAssetIdsList = addedAssetIds[key] ?? []; + const deletedAssetIdsList = deletedAssetIds[key] ?? []; + assetsDiff[key] = [ + ...assets.filter((asset) => !deletedAssetIdsList.includes(asset.id)), + ...addedAssetIdsList.map((id) => AssetDummy.with(id)), + ]; + return assetsDiff; + }, {}); + + const notifyContextAssetsSubscribers = () => { + const next = computeBlockAssets(); + for (const subscriber of contextAssetsSubscribers) { + subscriber(next); + } + }; + return { - getBlockId: stub>().returns(blockId), - getSectionId: stub>().returns(sectionId), getProjectId: stub>().returns(projectId), getEditorState: stub>().returns(editorState), getBlockSettings: stub>().resolves(window.blockSettings), - getAvailablePalettes: stub>().resolves([ - ColorPaletteDummy.with(678, 'Palette 1'), - ColorPaletteDummy.with(427, 'Palette 2'), - ColorPaletteDummy.with(679, 'Palette 3'), - ]), - getColorPalettes: stub>().resolves([ - ColorPaletteDummy.with(678, 'Palette 1'), - ColorPaletteDummy.with(427, 'Palette 2'), - ColorPaletteDummy.with(679, 'Palette 3'), - ]), - createColorPalette: stub>().resolves( - ColorPaletteDummy.with(678), - ), - updateColorPalette: stub>().resolves( - ColorPaletteDummy.with(678), - ), - getColorsByIds: stub>().resolves([ - ColorDummy.red(9834), - ColorDummy.green(342), - ColorDummy.yellow(9314), - ]), - getColorsByColorPaletteId: stub>().resolves([ - ColorDummy.red(9834), - ColorDummy.green(342), - ColorDummy.yellow(9314), - ]), - getColorPalettesWithColors: stub>().resolves([ - ColorPaletteDummy.with(678, 'Palette 1'), - ColorPaletteDummy.with(427, 'Palette 2'), - ColorPaletteDummy.with(679, 'Palette 3'), - ]), - deleteColorPalette: stub>().resolves(), - getAvailableColors: stub>().resolves([]), getCurrentLoggedUser: stub>().resolves(user), downloadColorKit: stub>().returns( `/api/color/export/${PROJECT_ID}/zip/500`, @@ -118,32 +98,18 @@ export const getAppBridgeBlockStub = ({ getAssetById: stub>().callsFake((assetId) => Promise.resolve(AssetDummy.with(assetId)), ), - closeAssetChooser: stub>().callsFake(() => { - closeAssetChooser(); - }), - openAssetChooser: stub>().callsFake((callback) => { - openAssetChooser(callback); - }), - getBlockAssets: stub>().callsFake(() => { - return Object.entries(blockAssets).reduce>((assetsDiff, [key, assets]) => { - const addedAssetIdsList = addedAssetIds[key] ?? []; - const deletedAssetIdsList = deletedAssetIds[key] ?? []; - assetsDiff[key] = [ - ...assets.filter((asset) => !deletedAssetIdsList.includes(asset.id)), - ...addedAssetIdsList.map((id) => AssetDummy.with(id)), - ]; - return assetsDiff; - }, {}); - }), + getBlockAssets: stub>().callsFake(() => computeBlockAssets()), addAssetIdsToBlockAssetKey: stub>().callsFake( (key, assetsIds) => { addedAssetIds[key] = [...(addedAssetIds[key] ?? []), ...assetsIds]; + notifyContextAssetsSubscribers(); }, ), deleteAssetIdsFromBlockAssetKey: stub< Parameters >().callsFake((key, assetIds) => { deletedAssetIds[key] = [...(deletedAssetIds[key] ?? []), ...assetIds]; + notifyContextAssetsSubscribers(); }), getBlockTemplates: stub>().callsFake(() => { return Object.entries(blockTemplates).reduce>( @@ -170,14 +136,6 @@ export const getAppBridgeBlockStub = ({ deletedTemplateIds[key] = [...(deletedTemplateIds[key] ?? []), ...templateIds]; }), getTranslationLanguage: stub>().returns(language), - getColors: stub>().resolves([ - ColorDummy.red(9834), - ColorDummy.green(342), - ColorDummy.yellow(9314), - ]), - updateColor: stub>().callsFake((colorId) => - Promise.resolve(ColorDummy.red(colorId)), - ), getBulkDownloadBySignature: stub>().resolves( BulkDownloadDummy.default(), ), @@ -192,6 +150,7 @@ export const getAppBridgeBlockStub = ({ } case 'setAssetIdsByBlockAssetKey': { blockAssets[args.payload.key] = args.payload.assetIds.map((id) => AssetDummy.with(id)); + notifyContextAssetsSubscribers(); return Promise.resolve(); } } @@ -223,6 +182,16 @@ export const getAppBridgeBlockStub = ({ return { get: () => isNewlyInserted, }; + case 'assets': + return { + get: () => blockAssets, + subscribe: (callback: (nextAssets: Record) => void) => { + contextAssetsSubscribers.add(callback); + return () => { + contextAssetsSubscribers.delete(callback); + }; + }, + }; default: return { get: () => { @@ -247,33 +216,22 @@ export const getAppBridgeBlockStub = ({ getDocumentSectionsByDocumentPageId: stub< Parameters >().resolves([ - DocumentSectionApiDummy.withFields({ id: 1, title: 'Title 1' }), - DocumentSectionApiDummy.withFields({ id: 2, title: 'Title 2' }), + DocumentSectionApiDummy.withFields({ id: 1, title: null }), + DocumentSectionApiDummy.withFields({ id: 2, title: 'Title' }), DocumentSectionApiDummy.withFields({ id: 3, title: ' ' }), DocumentSectionApiDummy.withFields({ id: 4, title: '' }), ]), + getColorPalettesWithColors: stub>().resolves([ + ColorPaletteDummy.with(678, 'Palette 1'), + ColorPaletteDummy.with(427, 'Palette 2'), + ColorPaletteDummy.with(679, 'Palette 3'), + ]), // TODO: Stub the following methods - closeTemplateChooser: stub>(), - openTemplateChooser: stub>(), - createColor: stub>().resolves(ColorDummy.red()), - deleteColor: stub>().resolves(), getTemplateById: stub>().resolves({} as TemplateLegacy), - openAssetViewer: stub>(), updateBlockSettings: stub>().resolves(), getAllDocuments: stub>().resolves(), - getUngroupedDocuments: stub>().resolves(), - getDocumentsByDocumentGroupId: stub>().resolves(), - getDocumentGroups: stub>().resolves(), getDocumentPagesByDocumentId: stub>().resolves(), - getDocumentPagesByDocumentCategoryId: - stub>().resolves(), - getDocumentCategoriesByDocumentId: - stub>().resolves(), - getUncategorizedDocumentPagesByDocumentId: - stub>().resolves(), - getDocumentTargets: stub>().resolves(), - getDocumentPageTargets: stub>().resolves(), state: stub>().resolves(), dispatch: stub>().resolves(), }; diff --git a/packages/app-bridge/src/tests/AppBridgePlatformAppStub.ts b/packages/app-bridge/src/tests/AppBridgePlatformAppStub.ts deleted file mode 100644 index 848545bf4..000000000 --- a/packages/app-bridge/src/tests/AppBridgePlatformAppStub.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type SinonStubbedInstance, stub } from 'sinon'; - -import { type IAppBridgePlatformApp } from '../AppBridgePlatformApp'; - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export type getAppBridgePlatformAppStubProps = { - // -}; - -export const getAppBridgePlatformAppStub = (): SinonStubbedInstance => { - return { - api: stub>().resolves(), - state: stub>().resolves(), - context: stub>().resolves(), - subscribe: stub>().resolves(), - dispatch: stub>().resolves(), - }; -}; diff --git a/packages/app-bridge/src/tests/AppBridgeThemeStub.ts b/packages/app-bridge/src/tests/AppBridgeThemeStub.ts deleted file mode 100644 index 2611f9be8..000000000 --- a/packages/app-bridge/src/tests/AppBridgeThemeStub.ts +++ /dev/null @@ -1,387 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import mitt, { type Emitter } from 'mitt'; -import { type SinonStubbedInstance, spy, stub } from 'sinon'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; -import { type Asset, type ThemeTemplate } from '../types'; -import { type EmitterEvents } from '../types/Emitter'; -import { mergeDeep } from '../utilities'; - -import { GuidelineSearchResultDummy } from './GuidelineSearchResultDummy'; - -import { - AssetDummy, - BrandportalLinkDummy, - ColorDummy, - ColorPaletteDummy, - CoverPageDummy, - DocumentCategoryDummy, - DocumentDummy, - DocumentGroupDummy, - DocumentPageDummy, - DocumentPageTargetsDummy, - DocumentSectionDummy, - DocumentTargetsDummy, - UpdateTargetsDummy, -} from '.'; - -const BRAND_ID = 234551; -const PROJECT_ID = 3452; -const PORTAL_ID = 7777; -const DOCUMENT_GROUP_ID_1 = 5332; -const DOCUMENT_GROUP_ID_2 = 95694; -const DOCUMENT_GROUP_ID_3 = 345882; -const DOCUMENT_ID_1 = 6456; -const DOCUMENT_ID_2 = 34532; -const DOCUMENT_ID_3 = 3455345; -const DOCUMENT_ID_4 = 2342; -const DOCUMENT_ID_5 = 2343445; -const GROUPED_DOCUMENT_ID_1 = 2434; -const GROUPED_DOCUMENT_ID_2 = 552; -const GROUPED_DOCUMENT_ID_3 = 1145; -const GROUPED_DOCUMENT_ID_4 = 32345; -const DOCUMENT_CATEGORY_ID_1 = 147; -const DOCUMENT_CATEGORY_ID_2 = 258; -const DOCUMENT_CATEGORY_ID_3 = 369; -const DOCUMENT_PAGE_ID_1 = 23442; -const DOCUMENT_PAGE_ID_2 = 235345; -const DOCUMENT_PAGE_ID_3 = 12352; -const DOCUMENT_PAGE_ID_4 = 55221; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_1 = 24324; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_2 = 3532; -const UNCATEGORIZED_DOCUMENT_PAGE_ID_3 = 98954; -const DOCUMENT_SECTION_ID_1 = 3421; -const DOCUMENT_SECTION_ID_2 = 65725; -const DOCUMENT_SECTION_ID_3 = 95934; -const DOCUMENT_PAGE_DUPLICATE_ID_1 = 2341; -const TARGET_ID_1 = 653543; -const TARGET_ID_2 = 23411; -const TARGET_ID_3 = 56657; - -export type getAppBridgeThemeStubProps = { - editorState?: boolean; - brandId?: number; - portalId?: number; - projectId?: number; - pageTemplateSettings?: Record; - pageTemplateAssets?: Record; - themeSettings?: Record>; - themeAssets?: Record; - language?: string; - openAssetChooser?: (callback: Parameters[0]) => void; - closeAssetChooser?: () => void; -}; - -export const getAppBridgeThemeStub = ({ - editorState = false, - brandId = BRAND_ID, - portalId = PORTAL_ID, - projectId = PROJECT_ID, - pageTemplateSettings = {}, - pageTemplateAssets = {}, - themeSettings = { cover: {}, documentPage: {}, library: {} }, - themeAssets = {}, - language = 'en', - openAssetChooser = () => null, - closeAssetChooser = () => null, -}: getAppBridgeThemeStubProps = {}): SinonStubbedInstance => { - window.emitter = spy(mitt()) as unknown as Emitter; - - let localPageTemplateSettings = pageTemplateSettings; - let localThemeSettings = themeSettings; - - const deletedAssetIds: Record = {}; - const addedAssetIds: Record = {}; - - const getAssets = (themeOrTemplateAssets: Record) => { - return Object.entries(themeOrTemplateAssets).reduce>((assetsDiff, [key, assets]) => { - const addedAssetIdsList = addedAssetIds[key] ?? []; - const deletedAssetIdsList = deletedAssetIds[key] ?? []; - assetsDiff[key] = [ - ...assets.filter((asset) => !deletedAssetIdsList.includes(asset.id)), - ...addedAssetIdsList.map((id) => AssetDummy.with(id)), - ]; - return assetsDiff; - }, {}); - }; - - const getTemplateAssets = () => getAssets(pageTemplateAssets); - - const getThemeAssets = () => getAssets(themeAssets); - - return { - getPortalId: stub>().returns(portalId), - getProjectId: stub>().returns(projectId), - getEditorState: stub>().returns(editorState), - getCoverPage: stub>().resolves(CoverPageDummy.with(PORTAL_ID)), - getAllDocuments: stub>().resolves([ - DocumentDummy.with(DOCUMENT_ID_1), - DocumentDummy.with(DOCUMENT_ID_2), - DocumentDummy.with(DOCUMENT_ID_3), - DocumentDummy.with(DOCUMENT_ID_4), - DocumentDummy.with(DOCUMENT_ID_5), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - ]), - getUngroupedDocuments: stub>().resolves([ - DocumentDummy.with(DOCUMENT_ID_1), - DocumentDummy.with(DOCUMENT_ID_2), - DocumentDummy.with(DOCUMENT_ID_3), - DocumentDummy.with(DOCUMENT_ID_4), - DocumentDummy.with(DOCUMENT_ID_5), - ]), - getDocumentsByDocumentGroupId: stub>().resolves([ - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_1, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_2, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_3, DOCUMENT_GROUP_ID_1), - DocumentDummy.withDocumentGroupId(GROUPED_DOCUMENT_ID_4, DOCUMENT_GROUP_ID_1), - ]), - getDocumentGroups: stub>().resolves([ - DocumentGroupDummy.with(DOCUMENT_GROUP_ID_1, 3), - DocumentGroupDummy.with(DOCUMENT_GROUP_ID_2, 0), - DocumentGroupDummy.with(DOCUMENT_GROUP_ID_3, 2), - ]), - getDocumentPagesByDocumentId: stub>().resolves([ - DocumentPageDummy.with(DOCUMENT_PAGE_ID_1), - DocumentPageDummy.with(DOCUMENT_PAGE_ID_2), - DocumentPageDummy.with(UNCATEGORIZED_DOCUMENT_PAGE_ID_1), - DocumentPageDummy.with(DOCUMENT_PAGE_ID_3), - DocumentPageDummy.with(UNCATEGORIZED_DOCUMENT_PAGE_ID_2), - DocumentPageDummy.with(DOCUMENT_PAGE_ID_4), - DocumentPageDummy.with(UNCATEGORIZED_DOCUMENT_PAGE_ID_3), - ]), - getDocumentPagesByDocumentCategoryId: stub< - Parameters - >().callsFake((documentCategoryId) => - Promise.resolve([ - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_1, categoryId: documentCategoryId, sort: 1 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_2, categoryId: documentCategoryId, sort: 2 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_3, categoryId: documentCategoryId, sort: 3 }), - DocumentPageDummy.withFields({ id: DOCUMENT_PAGE_ID_4, categoryId: documentCategoryId, sort: 4 }), - ]), - ), - getDocumentCategoriesByDocumentId: stub< - Parameters - >().callsFake((documentId) => - Promise.resolve([ - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_1, documentId, 2), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_2, documentId, 0), - DocumentCategoryDummy.withDocumentIdAndNumberOfDocumentPages(DOCUMENT_CATEGORY_ID_3, documentId, 2), - ]), - ), - getUncategorizedDocumentPagesByDocumentId: stub< - Parameters - >().callsFake((documentId) => - Promise.resolve([ - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_1, - documentId, - categoryId: null, - sort: 1, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_2, - documentId, - categoryId: null, - sort: 2, - }), - DocumentPageDummy.withFields({ - id: UNCATEGORIZED_DOCUMENT_PAGE_ID_3, - documentId, - categoryId: null, - sort: 3, - }), - ]), - ), - getDocumentSectionsByDocumentPageId: stub< - Parameters - >().resolves([ - DocumentSectionDummy.with(DOCUMENT_SECTION_ID_1), - DocumentSectionDummy.with(DOCUMENT_SECTION_ID_2), - DocumentSectionDummy.with(DOCUMENT_SECTION_ID_3), - ]), - getColorPalettes: stub>().resolves([ - ColorPaletteDummy.with(678, 'Palette 1'), - ColorPaletteDummy.with(427, 'Palette 2'), - ColorPaletteDummy.with(679, 'Palette 3'), - ]), - getColorsByColorPaletteId: stub>().resolves([ - ColorDummy.red(9834), - ColorDummy.green(342), - ColorDummy.yellow(9314), - ]), - duplicateDocumentPage: stub>().resolves( - DocumentPageDummy.with(DOCUMENT_PAGE_DUPLICATE_ID_1), - ), - getDocumentTargets: stub>().resolves( - DocumentTargetsDummy.with(DOCUMENT_ID_1), - ), - getDocumentPageTargets: stub>().resolves( - DocumentPageTargetsDummy.with(DOCUMENT_PAGE_ID_1), - ), - addAssetIdsToCoverPageTemplateAssetKey: stub< - Parameters - >().callsFake((key: string, assetsIds: number[]) => { - addedAssetIds[key] = [...(addedAssetIds[key] ?? []), ...assetsIds]; - return pageTemplateAssets; - }), - addAssetIdsToThemeAssetKey: stub>().callsFake( - (key: string, assetsIds: number[]) => { - addedAssetIds[key] = [...(addedAssetIds[key] ?? []), ...assetsIds]; - return pageTemplateAssets; - }, - ), - addAssetIdsToLibraryPageTemplateAssetKey: stub< - Parameters - >().callsFake((_documentId: number, key: string, assetsIds: number[]) => { - addedAssetIds[key] = [...(addedAssetIds[key] ?? []), ...assetsIds]; - return pageTemplateAssets; - }), - addAssetIdsToDocumentPageTemplateAssetKey: stub< - Parameters - >().callsFake((_documentPageId: number, key: string, assetsIds: number[]) => { - addedAssetIds[key] = [...(addedAssetIds[key] ?? []), ...assetsIds]; - return pageTemplateAssets; - }), - getCoverPageTemplateAssets: - stub>().callsFake(getTemplateAssets), - getThemeAssets: stub>().callsFake(getThemeAssets), - getLibraryPageTemplateAssets: - stub>().callsFake(getTemplateAssets), - getDocumentPageTemplateAssets: - stub>().callsFake(getTemplateAssets), - deleteAssetIdsFromCoverPageTemplateAssetKey: stub< - Parameters - >().callsFake((key, assetIds) => { - deletedAssetIds[key] = [...(deletedAssetIds[key] ?? []), ...assetIds]; - }), - deleteAssetIdsFromThemeAssetKey: stub< - Parameters - >().callsFake((key, assetIds) => { - deletedAssetIds[key] = [...(deletedAssetIds[key] ?? []), ...assetIds]; - }), - deleteAssetIdsFromLibraryPageTemplateAssetKey: stub< - Parameters - >().callsFake((_documentId: number, key, assetIds) => { - deletedAssetIds[key] = [...(deletedAssetIds[key] ?? []), ...assetIds]; - }), - deleteAssetIdsFromDocumentPageTemplateAssetKey: stub< - Parameters - >().callsFake((_documentPageId: number, key, assetIds) => { - deletedAssetIds[key] = [...(deletedAssetIds[key] ?? []), ...assetIds]; - }), - getCoverPageTemplateSettings: - stub>().resolves(localPageTemplateSettings), - getDocumentPageTemplateSettings: - stub>().resolves(localPageTemplateSettings), - getLibraryPageTemplateSettings: - stub>().resolves(localPageTemplateSettings), - getThemeSettings: stub>().resolves(localThemeSettings), - createLink: stub>().resolves(DocumentDummy.with(1)), - createLibrary: stub>().resolves(DocumentDummy.with(1)), - createStandardDocument: stub>().resolves( - DocumentDummy.with(1), - ), - createDocumentPage: stub>().resolves( - DocumentPageDummy.with(1), - ), - createDocumentGroup: stub>().resolves( - DocumentGroupDummy.with(1, 0), - ), - createDocumentCategory: stub>().resolves( - DocumentCategoryDummy.with(1), - ), - createCoverPage: stub>().resolves(CoverPageDummy.with(1)), - updateLink: stub>().resolves(DocumentDummy.with(1)), - updateLibrary: stub>().resolves(DocumentDummy.with(1)), - updateStandardDocument: stub>().resolves( - DocumentDummy.with(1), - ), - updateDocumentPage: stub>().resolves( - DocumentPageDummy.with(1), - ), - updateDocumentGroup: stub>().resolves( - DocumentGroupDummy.with(1, 0), - ), - updateDocumentCategory: stub>().resolves( - DocumentCategoryDummy.with(1), - ), - updateCoverPage: stub>().resolves(CoverPageDummy.with(1)), - updateLegacyCoverPage: stub>().resolves( - CoverPageDummy.withLegacy(1), - ), - updateBrandportalLink: stub>().resolves( - BrandportalLinkDummy.with(), - ), - updateCoverPageTemplateSettings: stub< - Parameters - >().callsFake((pageTemplateSettingsUpdate) => { - localPageTemplateSettings = mergeDeep(localPageTemplateSettings, pageTemplateSettingsUpdate); - }), - updateDocumentPageTemplateSettings: stub< - Parameters - >().callsFake((pageTemplateSettingsUpdate) => { - localPageTemplateSettings = mergeDeep(localPageTemplateSettings, pageTemplateSettingsUpdate); - }), - updateLibraryPageTemplateSettings: stub< - Parameters - >().callsFake((pageTemplateSettingsUpdate) => { - localPageTemplateSettings = mergeDeep(localPageTemplateSettings, pageTemplateSettingsUpdate); - }), - updateThemeSettings: stub>().callsFake( - (themeSettingsUpdate) => { - localThemeSettings = mergeDeep(localThemeSettings, themeSettingsUpdate); - }, - ), - deleteCoverPage: stub>().resolves(), - deleteDocumentCategory: stub>().resolves(), - deleteDocumentGroup: stub>().resolves(), - deleteDocumentPage: stub>().resolves(), - deleteLibrary: stub>().resolves(), - deleteLink: stub>().resolves(), - deleteStandardDocument: stub>().resolves(), - getBrandId: stub>().returns(brandId), - getBrandportalLink: stub>().resolves( - BrandportalLinkDummy.with(), - ), - getTranslationLanguage: stub>().returns(language), - moveDocument: stub>().resolves(DocumentDummy.with(DOCUMENT_ID_1)), - moveDocumentCategory: stub>().resolves( - DocumentCategoryDummy.with(DOCUMENT_CATEGORY_ID_1), - ), - moveDocumentGroup: stub>().resolves( - DocumentGroupDummy.with(DOCUMENT_CATEGORY_ID_1, 0), - ), - moveDocumentPage: stub>().resolves( - DocumentPageDummy.with(DOCUMENT_PAGE_ID_1), - ), - openNavigationManager: stub>(), - updateDocumentPageTargets: stub>().resolves( - UpdateTargetsDummy.with([TARGET_ID_1, TARGET_ID_2, TARGET_ID_3]), - ), - updateDocumentTargets: stub>().resolves( - UpdateTargetsDummy.with([TARGET_ID_1, TARGET_ID_2, TARGET_ID_3]), - ), - searchInGuideline: stub>().callsFake((query) => { - return Promise.resolve([ - GuidelineSearchResultDummy.with(`${query}-1`), - GuidelineSearchResultDummy.with(`${query}-1`), - GuidelineSearchResultDummy.with(`${query}-3`), - ]); - }), - closeAssetChooser: stub>().callsFake(() => { - closeAssetChooser(); - }), - openAssetChooser: stub>().callsFake((callback) => { - openAssetChooser(callback); - }), - api: stub>().resolves(), - state: stub>().resolves(), - context: stub>().resolves(), - subscribe: stub>().resolves(), - dispatch: stub>().resolves(), - }; -}; diff --git a/packages/app-bridge/src/tests/AssetApiDummy.ts b/packages/app-bridge/src/tests/AssetApiDummy.ts index b4f37197a..315fcc665 100644 --- a/packages/app-bridge/src/tests/AssetApiDummy.ts +++ b/packages/app-bridge/src/tests/AssetApiDummy.ts @@ -6,7 +6,7 @@ export class AssetApiDummy { static with(id: number): AssetApi { return { id, - creator_name: 'Creator Name', + alternative_text: 'Alternative Text', ext: 'png', external_url: null, file_id: 'x1x1x1x1x1x1', @@ -17,8 +17,6 @@ export class AssetApiDummy { file_origin_url: 'https://origin.url', preview_url: 'https://preview.url', project_id: 23, - project_name: null, - project_type: 'STYLEGUIDE', file_size: 256, file_size_formatted: '123.45 MB', status: 'FINISHED', @@ -28,6 +26,8 @@ export class AssetApiDummy { revision_id: 1, background_color: 'rgba(115, 210, 210, 255)', is_download_protected: false, + focal_point_x: 0.5, + focal_point_y: 0.5, }; } } diff --git a/packages/app-bridge/src/tests/AssetChooserResultDummy.ts b/packages/app-bridge/src/tests/AssetChooserResultDummy.ts index 3df361c64..cd2ab73ef 100644 --- a/packages/app-bridge/src/tests/AssetChooserResultDummy.ts +++ b/packages/app-bridge/src/tests/AssetChooserResultDummy.ts @@ -6,7 +6,7 @@ export class AssetChooserResultDummy { static with(id: number): AssetChooserResult { return { id, - creator_name: 'Creator Name', + computed_alternative_text: 'Alternative Text', ext: 'png', external_url: null, file_id: 'x1x1x1x1x1x1', @@ -17,8 +17,6 @@ export class AssetChooserResultDummy { file_origin_url: 'https://origin.url', preview_url: 'https://preview.url', project: 23, - project_name: null, - project_type: 'STYLEGUIDE', filesize: 256, file_size_formatted: '123.45 MB', status: 'FINISHED', @@ -28,6 +26,8 @@ export class AssetChooserResultDummy { revision_id: 1, background_color: 'rgba(115, 210, 210, 255)', is_download_protected: false, + focal_point_x: 0.5, + focal_point_y: 0.5, }; } } diff --git a/packages/app-bridge/src/tests/AssetDummy.ts b/packages/app-bridge/src/tests/AssetDummy.ts index e7e55ad0c..0cdc89008 100644 --- a/packages/app-bridge/src/tests/AssetDummy.ts +++ b/packages/app-bridge/src/tests/AssetDummy.ts @@ -6,7 +6,7 @@ export class AssetDummy { static with(id: number): Asset { return { id, - creatorName: 'Creator Name', + alternativeText: 'Alternative Text', extension: 'png', externalUrl: null, fileName: 'fileName.png', @@ -23,10 +23,11 @@ export class AssetDummy { fileSizeHumanReadable: '123.45 MB', fileId: 'x1x1x1x1x1x1', token: '--token--', - projectType: 'STYLEGUIDE', revisionId: 1, backgroundColor: 'rgba(115, 210, 210, 255)', isDownloadProtected: false, + focalPointX: 0.5, + focalPointY: 0.5, }; } } diff --git a/packages/app-bridge/src/tests/BrandportalLinkApiDummy.ts b/packages/app-bridge/src/tests/BrandportalLinkApiDummy.ts deleted file mode 100644 index 77079584a..000000000 --- a/packages/app-bridge/src/tests/BrandportalLinkApiDummy.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type BrandportalLinkApi } from '../types'; - -export class BrandportalLinkApiDummy { - static get(): BrandportalLinkApi { - return { - brand_portal: { - enabled: true, - label: 'Brandportal Link', - url: '/url', - }, - }; - } -} diff --git a/packages/app-bridge/src/tests/BrandportalLinkDummy.ts b/packages/app-bridge/src/tests/BrandportalLinkDummy.ts deleted file mode 100644 index adf7bcc2b..000000000 --- a/packages/app-bridge/src/tests/BrandportalLinkDummy.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type BrandportalLink } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { BrandportalLinkApiDummy } from './BrandportalLinkApiDummy'; - -export class BrandportalLinkDummy { - static with(fields?: Partial): BrandportalLink { - return { ...convertObjectCase(BrandportalLinkApiDummy.get().brand_portal, 'camel'), ...fields }; - } -} diff --git a/packages/app-bridge/src/tests/ColorApiDummy.ts b/packages/app-bridge/src/tests/ColorApiDummy.ts deleted file mode 100644 index 254744c85..000000000 --- a/packages/app-bridge/src/tests/ColorApiDummy.ts +++ /dev/null @@ -1,280 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type ColorApi, type ColorApiCreate, type ColorApiPatch } from '../types'; - -export class ColorApiDummy { - static red(id = 767): ColorApi { - return { - id, - creator: 1, - created: '2022-06-10T12:35:52.000+00:00', - modifier: null, - modified: null, - valid_from: null, - valid_to: null, - project: 1, - reference_color: null, - group: null, - palette: null, - type: null, - name: 'Red', - name_css: 'red', - sort: 1, - r: 255, - g: 0, - b: 0, - hex: 'ff0000', - alpha: 255, - hue: 361, - saturation: 100, - lightness: 46, - gradient_direction: null, - gradient_color_one: null, - gradient_color_two: null, - gradient_type: null, - usage: 'USAGE', - priority: null, - c: 0, - m: 100, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantone_coated: null, - pantone_uncoated: null, - cmyk_coated: null, - cmyk_uncoated: null, - cmyk_newspaper: null, - ncs: null, - pantone_cp: null, - pantone_plastics: null, - pantone_textile: null, - hks: null, - three_m: null, - lab: null, - opacity: null, - opacity_css: null, - css_value: null, - }; - } - - static yellow(id = 768): ColorApi { - return { - id, - creator: 1, - created: '2022-06-10T12:35:52.000+00:00', - modifier: null, - modified: null, - valid_from: null, - valid_to: null, - project: 1, - reference_color: null, - group: null, - palette: null, - type: null, - name: 'Yellow', - name_css: 'yellow', - sort: 2, - hex: 'ffff00', - r: 255, - g: 255, - b: 0, - alpha: 255, - hue: 361, - saturation: 100, - lightness: 46, - gradient_direction: null, - gradient_color_one: null, - gradient_color_two: null, - gradient_type: null, - usage: 'USAGE', - priority: null, - c: 0, - m: 0, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantone_coated: null, - pantone_uncoated: null, - cmyk_coated: null, - cmyk_uncoated: null, - cmyk_newspaper: null, - ncs: null, - pantone_cp: null, - pantone_plastics: null, - pantone_textile: null, - hks: null, - three_m: null, - lab: null, - opacity: null, - opacity_css: null, - css_value: null, - }; - } - - static green(id = 769): ColorApi { - return { - id, - creator: 1, - created: '2022-06-10T12:35:52.000+00:00', - modifier: null, - modified: null, - valid_from: null, - valid_to: null, - project: 1, - reference_color: null, - group: null, - palette: null, - type: null, - name: 'Green', - name_css: 'green', - sort: 3, - hex: '00ff00', - r: 0, - g: 255, - b: 0, - alpha: 255, - hue: 361, - saturation: 100, - lightness: 46, - gradient_direction: null, - gradient_color_one: null, - gradient_color_two: null, - gradient_type: null, - usage: 'USAGE', - priority: null, - c: 100, - m: 0, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantone_coated: null, - pantone_uncoated: null, - cmyk_coated: null, - cmyk_uncoated: null, - cmyk_newspaper: null, - ncs: null, - pantone_cp: null, - pantone_plastics: null, - pantone_textile: null, - hks: null, - three_m: null, - lab: null, - opacity: null, - opacity_css: null, - css_value: null, - }; - } -} - -export class ColorApiCreateDummy { - static red(): ColorApiCreate { - return { - project_color_palette_id: 23, - red: 255, - green: 0, - blue: 0, - alpha: 255, - }; - } -} - -export class ColorApiPatchDummy { - static red(): ColorApiPatch { - return { - name: 'Red', - sort: 1, - name_css: 'red', - red: 255, - green: 0, - blue: 0, - alpha: 255, - c: 0, - m: 100, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantone_coated: null, - pantone_uncoated: null, - cmyk_coated: null, - cmyk_uncoated: null, - cmyk_newspaper: null, - ncs: null, - pantone_cp: null, - pantone_plastics: null, - pantone_textile: null, - hks: null, - three_m: null, - lab: null, - }; - } - - static yellow(): ColorApiPatch { - return { - name: 'Yellow', - sort: 2, - name_css: 'yellow', - red: 255, - green: 255, - blue: 0, - alpha: 255, - c: 0, - m: 0, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantone_coated: null, - pantone_uncoated: null, - cmyk_coated: null, - cmyk_uncoated: null, - cmyk_newspaper: null, - ncs: null, - pantone_cp: null, - pantone_plastics: null, - pantone_textile: null, - hks: null, - three_m: null, - lab: null, - }; - } - - static green(): ColorApiPatch { - return { - name: 'Green', - sort: 3, - name_css: 'green', - red: 0, - green: 255, - blue: 0, - alpha: 255, - c: 100, - m: 0, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantone_coated: null, - pantone_uncoated: null, - cmyk_coated: null, - cmyk_uncoated: null, - cmyk_newspaper: null, - ncs: null, - pantone_cp: null, - pantone_plastics: null, - pantone_textile: null, - hks: null, - three_m: null, - lab: null, - }; - } -} diff --git a/packages/app-bridge/src/tests/ColorDummy.ts b/packages/app-bridge/src/tests/ColorDummy.ts index 095feb433..b2ec5a0c2 100644 --- a/packages/app-bridge/src/tests/ColorDummy.ts +++ b/packages/app-bridge/src/tests/ColorDummy.ts @@ -1,158 +1,132 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type Color, type ColorCreate, type ColorPatch } from '../types/Color'; +import { type Color } from '../types/Color'; export class ColorDummy { static red(id = 767): Color { return { id, - name: 'Red', sort: 1, - nameCss: 'red', - hex: 'ff0000', - red: 255, - green: 0, - blue: 0, - alpha: 255, - hue: 361, - saturation: 100, - lightness: 46, - c: 0, - m: 100, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantoneCoated: null, - pantoneUncoated: null, - cmykCoated: null, - cmykUncoated: null, - cmykNewspaper: null, - ncs: null, - pantoneCp: null, - pantonePlastics: null, - pantoneTextile: null, - hks: null, - threeM: null, - lab: null, + title: 'Red', + revision: { + nameCss: 'red', + hex: 'ff0000', + hue: 361, + saturation: 100, + lightness: 46, + rgba: { red: 255, green: 0, blue: 0, alpha: 255 }, + cmyk: { + cyan: 0, + magenta: 100, + yellow: 100, + black: 0, + coated: null, + uncoated: null, + newspaper: null, + }, + pantone: { + code: null, + coated: null, + uncoated: null, + cp: null, + plastics: null, + textile: null, + }, + ral: null, + oracal: null, + ncs: null, + hks: null, + threeM: null, + lab: null, + }, }; } static yellow(id = 768): Color { return { id, - name: 'Yellow', sort: 2, - nameCss: 'yellow', - red: 255, - green: 255, - blue: 0, - hex: 'ffff00', - alpha: 255, - hue: 361, - saturation: 100, - lightness: 46, - c: 0, - m: 0, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantoneCoated: null, - pantoneUncoated: null, - cmykCoated: null, - cmykUncoated: null, - cmykNewspaper: null, - ncs: null, - pantoneCp: null, - pantonePlastics: null, - pantoneTextile: null, - hks: null, - threeM: null, - lab: null, + title: 'Yellow', + revision: { + nameCss: 'yellow', + hex: 'ffff00', + hue: 361, + saturation: 100, + lightness: 46, + ral: null, + oracal: null, + ncs: null, + hks: null, + threeM: null, + lab: null, + rgba: { + red: 255, + green: 255, + blue: 0, + alpha: 255, + }, + cmyk: { + cyan: 0, + magenta: 0, + yellow: 100, + black: 0, + coated: null, + uncoated: null, + newspaper: null, + }, + pantone: { + code: null, + coated: null, + uncoated: null, + cp: null, + plastics: null, + textile: null, + }, + }, }; } static green(id = 769): Color { return { id, - name: 'Green', sort: 3, - nameCss: 'green', - red: 0, - green: 255, - blue: 0, - hex: '00ff00', - alpha: 255, - hue: 361, - saturation: 100, - lightness: 46, - c: 100, - m: 0, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantoneCoated: null, - pantoneUncoated: null, - cmykCoated: null, - cmykUncoated: null, - cmykNewspaper: null, - ncs: null, - pantoneCp: null, - pantonePlastics: null, - pantoneTextile: null, - hks: null, - threeM: null, - lab: null, - }; - } -} - -export class ColorCreateDummy { - static red(): ColorCreate { - return { - colorPaletteId: 23, - red: 255, - green: 0, - blue: 0, - alpha: 255, - }; - } -} - -export class ColorPatchDummy { - static red(): ColorPatch { - return { - name: 'Red', - sort: 1, - nameCss: 'red', - red: 255, - green: 0, - blue: 0, - alpha: 255, - c: 0, - m: 100, - y: 100, - k: 0, - pantone: null, - ral: null, - oracal: null, - pantoneCoated: null, - pantoneUncoated: null, - cmykCoated: null, - cmykUncoated: null, - cmykNewspaper: null, - ncs: null, - pantoneCp: null, - pantonePlastics: null, - pantoneTextile: null, - hks: null, - threeM: null, - lab: null, + title: 'Green', + revision: { + nameCss: 'green', + hex: '00ff00', + ral: null, + oracal: null, + ncs: null, + hks: null, + threeM: null, + lab: null, + hue: 361, + saturation: 100, + lightness: 46, + rgba: { + red: 0, + green: 255, + blue: 0, + alpha: 255, + }, + cmyk: { + cyan: 100, + magenta: 0, + yellow: 100, + black: 0, + coated: null, + uncoated: null, + newspaper: null, + }, + pantone: { + code: null, + coated: null, + uncoated: null, + cp: null, + plastics: null, + textile: null, + }, + }, }; } } diff --git a/packages/app-bridge/src/tests/ColorPaletteApiDummy.ts b/packages/app-bridge/src/tests/ColorPaletteApiDummy.ts deleted file mode 100644 index fd3dd418c..000000000 --- a/packages/app-bridge/src/tests/ColorPaletteApiDummy.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type ColorPaletteApi, type ColorPaletteApiCreate, type ColorPaletteApiPatch } from '../types'; - -import { ColorApiDummy } from './ColorApiDummy'; - -export class ColorPaletteApiDummy { - static with(id: number, name = 'Color Palette Name'): ColorPaletteApi { - return { - id, - name, - description: 'Color Palette Description', - colors: [ColorApiDummy.red(), ColorApiDummy.yellow(), ColorApiDummy.green()], - }; - } -} - -export class ColorPaletteApiCreateDummy { - static with(projectId = 322): ColorPaletteApiCreate { - return { - project_id: projectId, - name: 'New Color Palette Name', - description: 'New Color Palette Description', - }; - } -} - -export class ColorPaletteApiPatchDummy { - static with(): ColorPaletteApiPatch { - return { - name: 'Updated Color Palette Name', - description: 'Updated Color Palette Description', - }; - } -} diff --git a/packages/app-bridge/src/tests/ColorPaletteDummy.ts b/packages/app-bridge/src/tests/ColorPaletteDummy.ts index 203be8370..3d39ef3e6 100644 --- a/packages/app-bridge/src/tests/ColorPaletteDummy.ts +++ b/packages/app-bridge/src/tests/ColorPaletteDummy.ts @@ -1,6 +1,6 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type ColorPalette, type ColorPaletteCreate, type ColorPalettePatch } from '../types/ColorPalette'; +import { type ColorPalette } from '../types/ColorPalette'; import { ColorDummy } from './ColorDummy'; @@ -14,21 +14,3 @@ export class ColorPaletteDummy { }; } } - -export class ColorPaletteCreateDummy { - static with(name = 'New Color Palette Name', description = 'New Color Palette Description'): ColorPaletteCreate { - return { - name, - description, - }; - } -} - -export class ColorPalettePatchDummy { - static with(): ColorPalettePatch { - return { - name: 'Updated Color Palette Name', - description: 'Updated Color Palette Description', - }; - } -} diff --git a/packages/app-bridge/src/tests/CoverPageApiDummy.ts b/packages/app-bridge/src/tests/CoverPageApiDummy.ts deleted file mode 100644 index 17cdd13ff..000000000 --- a/packages/app-bridge/src/tests/CoverPageApiDummy.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CoverPageApi } from '../types'; - -export class CoverPageApiDummy { - static with(id: number, title = 'Cover Page Name'): CoverPageApi { - return { - template: 'hub', - document_id: '1', - brandhome: { - id, - title, - active: true, - draft: 1, - enabled: 1, - url: `/hub/${id}`, - hide_in_nav: false, - }, - }; - } -} diff --git a/packages/app-bridge/src/tests/CoverPageDummy.ts b/packages/app-bridge/src/tests/CoverPageDummy.ts deleted file mode 100644 index a6d608638..000000000 --- a/packages/app-bridge/src/tests/CoverPageDummy.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CoverPage, type CoverPageUpdateLegacy } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { CoverPageApiDummy } from './CoverPageApiDummy'; - -export class CoverPageDummy { - static with(id: number, title = 'Cover Page Name'): CoverPage { - const coverPageApi = CoverPageApiDummy.with(id, title); - - return { - ...convertObjectCase(coverPageApi.brandhome, 'camel'), - template: coverPageApi.template, - documentId: coverPageApi.document_id, - draft: Boolean(coverPageApi.brandhome.draft), - enabled: Boolean(coverPageApi.brandhome.enabled), - }; - } - - static withLegacy(_id: number, title = 'Legacy Cover Page'): CoverPageUpdateLegacy { - return { - brandhome_draft: true, - brandhome_title: title, - brandhome_hide_in_nav: false, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentApiDummy.ts b/packages/app-bridge/src/tests/DocumentApiDummy.ts deleted file mode 100644 index cbcbfbe55..000000000 --- a/packages/app-bridge/src/tests/DocumentApiDummy.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentApi, LinkType } from '../types'; - -export class DocumentApiDummy { - static with(id: number): DocumentApi { - return { - id, - creator: 9, - created: '2022-03-03t15:41:33.000+00:00', - modifier: null, - modified: null, - project_id: 345, - valid_from: '2022-03-03t15:41:33.000+00:00', - valid_to: null, - visibility: 'private', - portal_id: 3495, - title: `Document ${id}`, - slug: `document-${id}`, - heading: 'Document Dummy heading', - subheading: 'Document Dummy subHeading', - description: null, - logo: null, - sort: 5, - lazy: true, - link_type: LinkType.Internal, - link_url: null, - link_settings: null, - view_count: 0, - mode: 'DEFAULT', - appearance: null, - settings: {}, - logo_file_id: null, - logo_settings: [], - background_file_id: null, - background_settings: [], - targets: [], - token: 'a-dummy-token', - permanent_link: `/r/document-${id}`, - number_of_document_page_categories: 0, - number_of_uncategorized_document_pages: 0, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentCategoryApiDummy.ts b/packages/app-bridge/src/tests/DocumentCategoryApiDummy.ts deleted file mode 100644 index 9ab1a49c6..000000000 --- a/packages/app-bridge/src/tests/DocumentCategoryApiDummy.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentCategoryApi } from '../types'; - -export class DocumentCategoryApiDummy { - static with(id: number, document_pages: number[] = []): DocumentCategoryApi { - return { - id, - creator: 9, - created: '2022-08-15T11:47:47.000+00:00', - modifier: null, - modified: null, - document_id: 456, - valid_from: '2022-08-15T11:47:47.000+00:00', - valid_to: null, - title: `Document Category Dummy ${id}`, - slug: `document-category-dummy-${id}`, - sort: 1, - number_of_document_pages: document_pages.length, - }; - } - - static withDocumentIdAndNumberOfDocumentPages( - id: number, - documentId: number, - numberOfDocumentPages: number, - ): DocumentCategoryApi { - return { - ...DocumentCategoryApiDummy.with(id), - document_id: documentId, - number_of_document_pages: numberOfDocumentPages, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentCategoryDummy.ts b/packages/app-bridge/src/tests/DocumentCategoryDummy.ts deleted file mode 100644 index 58fa5984f..000000000 --- a/packages/app-bridge/src/tests/DocumentCategoryDummy.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentCategory } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { DocumentCategoryApiDummy } from './DocumentCategoryApiDummy'; - -export class DocumentCategoryDummy { - static with(id: number): DocumentCategory { - return convertObjectCase(DocumentCategoryApiDummy.with(id), 'camel'); - } - - static withDocumentIdAndNumberOfDocumentPages( - id: number, - documentId: number, - numberOfDocumentPages: number, - ): DocumentCategory { - return convertObjectCase( - DocumentCategoryApiDummy.withDocumentIdAndNumberOfDocumentPages(id, documentId, numberOfDocumentPages), - 'camel', - ); - } - - static withFields(fields: DocumentCategory): DocumentCategory { - return { - ...fields, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentDummy.ts b/packages/app-bridge/src/tests/DocumentDummy.ts deleted file mode 100644 index a14b65ce9..000000000 --- a/packages/app-bridge/src/tests/DocumentDummy.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type Document } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { DocumentApiDummy } from './DocumentApiDummy'; - -export class DocumentDummy { - static with(id: number): Document { - return convertObjectCase(DocumentApiDummy.with(id), 'camel'); - } - - static withDocumentGroupId(id: number, documentGroupId: number): Document { - return { ...convertObjectCase(DocumentApiDummy.with(id), 'camel'), documentGroupId }; - } - - static withFields(fields: Document): Document { - return { - ...fields, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentGroupApiDummy.ts b/packages/app-bridge/src/tests/DocumentGroupApiDummy.ts deleted file mode 100644 index 8b72403f8..000000000 --- a/packages/app-bridge/src/tests/DocumentGroupApiDummy.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentGroupApi } from '../types'; - -export class DocumentGroupApiDummy { - static with(id: number, numberOfDocuments = 0): DocumentGroupApi { - return { - id, - creator: 9, - created: '2022-07-11 14:00:49', - modified: '2022-08-15 07:59:28', - modifier: 9, - valid_to: null, - project_id: 113, - portal_id: 175, - name: `Document Group Dummy ${id}`, - sort: 1, - number_of_documents: numberOfDocuments, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentGroupDummy.ts b/packages/app-bridge/src/tests/DocumentGroupDummy.ts deleted file mode 100644 index 700ebc187..000000000 --- a/packages/app-bridge/src/tests/DocumentGroupDummy.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentGroup } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { DocumentGroupApiDummy } from './DocumentGroupApiDummy'; - -export class DocumentGroupDummy { - static with(id: number, numberOfDocuments = 0): DocumentGroup { - return convertObjectCase(DocumentGroupApiDummy.with(id, numberOfDocuments), 'camel'); - } - - static withFields(fields: DocumentGroup): DocumentGroup { - return { - ...fields, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentNavigationTreeDummy.ts b/packages/app-bridge/src/tests/DocumentNavigationTreeDummy.ts deleted file mode 100644 index e976c928c..000000000 --- a/packages/app-bridge/src/tests/DocumentNavigationTreeDummy.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { - type DocumentNavigationItem, - type GuidelineDocumentPageHeading, - type GuidelineDocumentPage, - type GuidelineDocumentPageLink, - type GuidelinePageCategory, -} from '../types'; - -class DocumentPageCategoryDummy implements GuidelinePageCategory { - readonly type = 'page-category' as const; - - readonly #id: number; - readonly #children: (GuidelineDocumentPage | GuidelineDocumentPageLink)[]; - - constructor(id: number, children?: (GuidelineDocumentPage | GuidelineDocumentPageLink)[]) { - this.#id = id; - this.#children = children ?? []; - } - - id(): number { - return this.#id; - } - - title(): string { - return 'Dummy title'; - } - - slug(): string { - return 'dummy slug'; - } - - children(): (GuidelineDocumentPage | GuidelineDocumentPageLink)[] { - return this.#children; - } -} - -class DocumentPageDummy implements GuidelineDocumentPage { - readonly type = 'document-page' as const; - - readonly #id: number; - readonly #headings: GuidelineDocumentPageHeading[]; - - constructor(id: number, headings?: GuidelineDocumentPageHeading[]) { - this.#id = id ?? 1234; - this.#headings = headings ?? []; - } - - id(): number { - return this.#id; - } - - title(): string { - return 'Dummy title'; - } - - slug(): string { - return 'dummy slug'; - } - - url(): string { - return 'dummy url'; - } - - headings(): GuidelineDocumentPageHeading[] { - return this.#headings; - } -} - -class DocumentPageLinkDummy implements GuidelineDocumentPageLink { - readonly type = 'document-page-link' as const; - - readonly #id: number; - - constructor(id: number) { - this.#id = id; - } - - id(): number { - return this.#id; - } - - title(): string { - return 'Dummy title'; - } - - url(): string { - return 'dummy url'; - } -} - -class DocumentPageHeadingDummy implements GuidelineDocumentPageHeading { - readonly type = 'document-page-heading' as const; - - readonly #id; - - constructor(id: number) { - this.#id = id; - } - - id(): number { - return this.#id; - } - - title(): string { - return 'Dummy title'; - } - - slug(): string { - return 'dummy slug'; - } -} - -export class DocumentNavigationTreeDummy { - static default(): DocumentNavigationItem[] { - return [ - new DocumentPageCategoryDummy(1, [ - new DocumentPageDummy(1, [ - new DocumentPageHeadingDummy(1), - new DocumentPageHeadingDummy(2), - new DocumentPageHeadingDummy(3), - ]), - new DocumentPageLinkDummy(2), - ]), - new DocumentPageDummy(3), - ]; - } - - static alternative(): DocumentNavigationItem[] { - return [ - new DocumentPageCategoryDummy(1, [ - new DocumentPageDummy(1, [new DocumentPageHeadingDummy(2), new DocumentPageHeadingDummy(3)]), - new DocumentPageLinkDummy(2), - ]), - new DocumentPageDummy(2, [new DocumentPageHeadingDummy(1)]), - new DocumentPageLinkDummy(6), - ]; - } -} diff --git a/packages/app-bridge/src/tests/DocumentPageApiDummy.ts b/packages/app-bridge/src/tests/DocumentPageApiDummy.ts deleted file mode 100644 index 7c3dbc301..000000000 --- a/packages/app-bridge/src/tests/DocumentPageApiDummy.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentPageApi, DocumentPageVisibility } from '../types'; - -export class DocumentPageApiDummy { - static with(id: number): DocumentPageApi { - return { - id, - creator: 9, - created: '2022-08-15T11:47:57.000+00:00', - modifier: null, - modified: null, - document_id: 145, - category_id: 29, - parent_id: null, - valid_from: '2022-08-15T11:47:57.000+00:00', - valid_to: null, - title: `Document Page Dummy ${id}`, - slug: `document-page-dummy-${id}`, - sort: 1, - link_type: 'INTERNAL', - link_url: null, - view_count: 0, - visibility: DocumentPageVisibility.Everyone, - targets: null, - permanent_link: `/r/document-page-${id}`, - }; - } - - static withFields(fields: Partial & { id: number }): DocumentPageApi { - return { - ...DocumentPageApiDummy.with(fields.id), - ...fields, - } as DocumentPageApi; - } -} - -export class DocumentPageDuplicateApiDummy { - static with(id: number): DocumentPageDuplicateApiDummy { - return { - page: { - id, - link_type: 'INTERNAL', - name: 'Document page duplicate dummy', - sections: [], - url: `document-page-duplicate-dummy-${id}`, - visibility: 'EVERYONE', - }, - }; - } -} diff --git a/packages/app-bridge/src/tests/DocumentPageDummy.ts b/packages/app-bridge/src/tests/DocumentPageDummy.ts deleted file mode 100644 index cbb7c943f..000000000 --- a/packages/app-bridge/src/tests/DocumentPageDummy.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type DocumentPage } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { DocumentPageApiDummy } from './DocumentPageApiDummy'; - -export class DocumentPageDummy { - static with(id: number): DocumentPage { - return convertObjectCase(DocumentPageApiDummy.with(id), 'camel'); - } - - static withFields(fields: Partial & { id: number }): DocumentPage { - return { - ...DocumentPageDummy.with(fields.id), - ...fields, - } as DocumentPage; - } -} diff --git a/packages/app-bridge/src/tests/GuidelineSearchResultApiDummy.ts b/packages/app-bridge/src/tests/GuidelineSearchResultApiDummy.ts deleted file mode 100644 index b22f5085f..000000000 --- a/packages/app-bridge/src/tests/GuidelineSearchResultApiDummy.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type GuidelineSearchResultApi } from '../types'; - -export class GuidelineSearchResultApiDummy { - static with(query: string): GuidelineSearchResultApi { - return { - highlights: [query], - type: 'BLOCK', - object_id: 1, - page_id: 1, - page_slug: 'page-slug', - page_title: 'Page Title', - page_category_slug: 'page-category-slug', - block_id: 1, - document_id: 1, - document_slug: 'document-slug', - document_title: 'Document Title', - guideline_title: 'Guideline Title', - portal_id: 1, - portal_token: 'portal-token', - section_id: null, - section_slug: null, - section_title: null, - color_hex: undefined, - project_color_id: undefined, - }; - } -} diff --git a/packages/app-bridge/src/tests/GuidelineSearchResultDummy.ts b/packages/app-bridge/src/tests/GuidelineSearchResultDummy.ts deleted file mode 100644 index 822c8b9a4..000000000 --- a/packages/app-bridge/src/tests/GuidelineSearchResultDummy.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type GuidelineSearchResult } from '../types'; -import { convertObjectCase } from '../utilities'; - -import { GuidelineSearchResultApiDummy } from './GuidelineSearchResultApiDummy'; - -export class GuidelineSearchResultDummy { - static with(query: string): GuidelineSearchResult { - return convertObjectCase(GuidelineSearchResultApiDummy.with(query), 'camel'); - } -} diff --git a/packages/app-bridge/src/tests/PortalNavigationTreeDummy.ts b/packages/app-bridge/src/tests/PortalNavigationTreeDummy.ts deleted file mode 100644 index d414ea0f7..000000000 --- a/packages/app-bridge/src/tests/PortalNavigationTreeDummy.ts +++ /dev/null @@ -1,234 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { - type GuidelineDocument, - type GuidelineDocumentGroup, - type GuidelineDocumentLibrary, - type GuidelineDocumentLink, - LinkSettingsDisplay, - LinkSettingsIconPosition, - type GuidelineCoverPage, - type PortalNavigationItem, -} from '../types'; - -class GuidelineCoverPageClass implements GuidelineCoverPage { - readonly type = 'cover-page' as const; - readonly #id: number; - readonly #title: string; - readonly #isPublished: boolean = false; - readonly #isHiddenFromNavigation: boolean = false; - - constructor(id: number, title: string, published: boolean, hiddenFromNavigation: boolean) { - this.#id = id; - this.#title = title; - this.#isPublished = published; - this.#isHiddenFromNavigation = hiddenFromNavigation; - } - - id() { - return this.#id; - } - title(language?: string) { - return `${this.#title} - ${language ?? 'default'}`; - } - isPublished() { - return this.#isPublished ?? false; - } - isHiddenInNavigation() { - return this.#isHiddenFromNavigation ?? false; - } - url(language?: string) { - return `http://domain.com/hub/${language ?? 'default'}/${this.#id}`; - } -} - -class GuidelineDocumentGroupClass implements GuidelineDocumentGroup { - readonly type = 'document-group' as const; - readonly #id: number; - readonly #title: string; - readonly #children: (GuidelineDocument | GuidelineDocumentLibrary | GuidelineDocumentLink)[] = []; - - constructor( - id: number, - title: string, - children: (GuidelineDocument | GuidelineDocumentLibrary | GuidelineDocumentLink)[], - ) { - this.#id = id; - this.#title = title; - this.#children = children; - } - - id() { - return this.#id; - } - title(language?: string) { - return `${this.#title} - ${language ?? 'default'}`; - } - children() { - return this.#children ?? []; - } -} - -export class GuidelineDocumentClass implements GuidelineDocument { - readonly type = 'document' as const; - readonly #id: number; - readonly #title: string; - readonly #parent: Nullable; - - constructor(id: number, title: string, parent: Nullable = null) { - this.#id = id; - this.#title = title; - this.#parent = parent; - } - - id() { - return this.#id; - } - title(language?: string) { - return `${this.#title} - ${language ?? 'default'}`; - } - slug(language?: string) { - return `${this.#title.toLowerCase().replace(' ', '-')}-${language ?? 'default'}`; - } - url(language?: string) { - return `http://domain.com/document/${this.#id}/${language ?? 'default'}/`; - } - parentId() { - return this.#parent; - } -} - -class GuidelineDocumentLibraryClass implements GuidelineDocumentLibrary { - readonly type = 'document-library' as const; - readonly #id: number; - readonly #title: string; - readonly #parent: Nullable; - - constructor(id: number, title: string, parent: Nullable = null) { - this.#id = id; - this.#title = title; - this.#parent = parent; - } - - id() { - return this.#id; - } - title(language?: string) { - return `${this.#title} - ${language ?? 'default'}`; - } - slug(language?: string) { - return `${this.#title.toLowerCase().replace(' ', '-')}-${language ?? 'default'}`; - } - url(language?: string) { - return `http://domain.com/document/${this.#id}/${language ?? 'default'}/`; - } - parentId() { - return this.#parent; - } -} - -class GuidelineDocumentLinkClass implements GuidelineDocumentLink { - readonly type = 'document-link' as const; - readonly #id: number; - readonly #title: string; - readonly #displayMode: LinkSettingsDisplay = LinkSettingsDisplay.TextOnly; - readonly #icoPosition: LinkSettingsIconPosition = LinkSettingsIconPosition.Left; - readonly #openNewTab: boolean = true; - readonly #parent: Nullable; - - constructor(id: number, title: string, parent: Nullable = null) { - this.#id = id; - this.#title = title; - this.#parent = parent; - } - - id() { - return this.#id; - } - title(language?: string) { - return `${this.#title} - ${language ?? 'default'}`; - } - url() { - return 'http://some-external-domain.com/page'; - } - - displayMode() { - return this.#displayMode; - } - iconPosition() { - return this.#icoPosition; - } - customIconUrl() { - return null; - } - shouldOpenInNewTab() { - return this.#openNewTab; - } - parentId() { - return this.#parent; - } -} - -class GuidelineCoverPageClassDummy { - static with( - id: number, - title = 'Cover Page Name', - published = false, - hiddenFromNavigation = false, - ): GuidelineCoverPageClass { - return new GuidelineCoverPageClass(id, title, published, hiddenFromNavigation); - } -} - -class GuidelineDocumentGroupClassDummy { - static with( - id: number, - title = 'guideline document group', - children: (GuidelineDocumentClass | GuidelineDocumentLibraryClass | GuidelineDocumentLinkClass)[] = [], - ): GuidelineDocumentGroupClass { - return new GuidelineDocumentGroupClass(id, title, children); - } -} - -export class GuidelineDocumentClassDummy { - static with(id: number, title = 'guideline document', parentId: Nullable = null): GuidelineDocumentClass { - return new GuidelineDocumentClass(id, title, parentId); - } -} - -class GuidelineDocumentLibraryClassDummy { - static with( - id: number, - title = 'guideline document library', - parentId: Nullable = null, - ): GuidelineDocumentLibraryClass { - return new GuidelineDocumentLibraryClass(id, title, parentId); - } -} - -class GuidelineDocumentLinkClassDummy { - static with( - id: number, - title = 'guideline document library', - parentId: Nullable = null, - ): GuidelineDocumentLinkClass { - return new GuidelineDocumentLinkClass(id, title, parentId); - } -} - -export class PortalNavigationTreeDummy { - static default(): PortalNavigationItem[] { - return [ - GuidelineCoverPageClassDummy.with(5, 'the Cover Page', true, false), - GuidelineDocumentClassDummy.with(101, 'document-101'), - GuidelineDocumentClassDummy.with(102, 'document-102'), - GuidelineDocumentGroupClassDummy.with(200, 'document-group-200', [ - GuidelineDocumentClassDummy.with(201, 'document-201', 200), - GuidelineDocumentClassDummy.with(202, 'document-203', 200), - GuidelineDocumentClassDummy.with(204, 'document-204', 200), - ]), - GuidelineDocumentLinkClassDummy.with(111, 'document-link-111'), - GuidelineDocumentLibraryClassDummy.with(121, 'document-library-121'), - ]; - } -} diff --git a/packages/app-bridge/src/tests/TargetsApiDummy.ts b/packages/app-bridge/src/tests/TargetsApiDummy.ts index 8d87389c5..52eae7ea1 100644 --- a/packages/app-bridge/src/tests/TargetsApiDummy.ts +++ b/packages/app-bridge/src/tests/TargetsApiDummy.ts @@ -2,7 +2,7 @@ import { type DocumentPageTargetsApi, type DocumentTargetsApi, type SingleTargetApi } from '../types'; -export class SingleTargetApiDummy { +class SingleTargetApiDummy { static target(value: number): SingleTargetApi { return { checked: false, @@ -61,16 +61,6 @@ export class DocumentTargetsApiDummy { } } -export class UpdateTargetsApiDummy { - static with(targetIds: number[]) { - return { - success: true, - data: true, - targets: targetIds, - }; - } -} - export class DocumentPageTargetsApiDummy { static with(id: number): DocumentPageTargetsApi { return { diff --git a/packages/app-bridge/src/tests/TargetsDummy.ts b/packages/app-bridge/src/tests/TargetsDummy.ts index 7a55a23d7..8c9f8721d 100644 --- a/packages/app-bridge/src/tests/TargetsDummy.ts +++ b/packages/app-bridge/src/tests/TargetsDummy.ts @@ -16,13 +16,3 @@ export class DocumentPageTargetsDummy { return convertObjectCase(DocumentPageTargetsApiDummy.with(id), 'camel'); } } - -export class UpdateTargetsDummy { - static with(targetIds: number[]) { - return { - success: true, - data: true, - targets: targetIds, - }; - } -} diff --git a/packages/app-bridge/src/tests/TemplateApiLegacyDummy.ts b/packages/app-bridge/src/tests/TemplateApiLegacyDummy.ts deleted file mode 100644 index 061785561..000000000 --- a/packages/app-bridge/src/tests/TemplateApiLegacyDummy.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type TemplateApiLegacy } from '../types'; - -export class TemplateApiLegacyDummy { - static with(id: number): TemplateApiLegacy { - return { - asset_created: '2022-04-06', - asset_modified: '2022-04-06', - categories: [], - description: 'A description', - height: 480, - id, - name: 'A template', - preview: 'https://preview.url', - project: 23, - project_name: 'A project', - project_type: 'A project type', - published: 1, - screen_id: 1, - width: 640, - }; - } -} diff --git a/packages/app-bridge/src/tests/UserApiDummy.ts b/packages/app-bridge/src/tests/UserApiDummy.ts deleted file mode 100644 index 5af8b40b4..000000000 --- a/packages/app-bridge/src/tests/UserApiDummy.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type UserApi } from '../types'; - -export class UserApiDummy { - static with(id: number): UserApi { - return { - id, - name: 'Frontify Dummy User', - email: 'test@frontify.test', - created: '2020-01-01T00:00:00.000Z', - image: { - image: 'https://dummy.frontify.test/image.png', - original: 'https://dummy.frontify.test/original_image.png', - x: '10', - y: '20', - width: '30', - height: '40', - }, - organization: 'Frontify', - role: 'user', - timezone: 'UTC', - language: 'en', - }; - } -} diff --git a/packages/app-bridge/src/tests/index.ts b/packages/app-bridge/src/tests/index.ts index d3a1233ac..d6265563d 100644 --- a/packages/app-bridge/src/tests/index.ts +++ b/packages/app-bridge/src/tests/index.ts @@ -1,42 +1,18 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ export * from './AppBridgeBlockStub'; -export * from './AppBridgePlatformAppStub'; -export * from './AppBridgeThemeStub'; export * from './AssetApiDummy'; export * from './AssetChooserOptionsDummy'; export * from './AssetChooserResultDummy'; export * from './AssetDummy'; -export * from './BrandportalLinkApiDummy'; -export * from './BrandportalLinkDummy'; export * from './BulkDownloadDummy'; -export * from './ColorApiDummy'; export * from './ColorDummy'; -export * from './ColorPaletteApiDummy'; export * from './ColorPaletteDummy'; -export * from './CoverPageApiDummy'; -export * from './CoverPageDummy'; -export * from './DocumentApiDummy'; -export * from './DocumentCategoryApiDummy'; -export * from './DocumentCategoryDummy'; -export * from './DocumentDummy'; -export * from './DocumentGroupApiDummy'; -export * from './DocumentGroupDummy'; -export * from './DocumentPageApiDummy'; -export * from './DocumentPageDummy'; export * from './DocumentSectionApiDummy'; export * from './DocumentSectionDummy'; -export * from './GuidelineSearchResultApiDummy'; -export * from './GuidelineSearchResultDummy'; export * from './HttpUtilResponseDummy'; -export * from './TargetsApiDummy'; export * from './TargetsDummy'; -export * from './TemplateApiLegacyDummy'; export * from './TemplateLegacyDummy'; export * from './TemplateDummy'; -export * from './UserApiDummy'; export * from './UserDummy'; export * from './withAppBridgeBlockStubs'; -export * from './withAppBridgeThemeStubs'; -export * from './PortalNavigationTreeDummy'; -export * from './DocumentNavigationTreeDummy'; diff --git a/packages/app-bridge/src/tests/withAppBridgeThemeStubs.tsx b/packages/app-bridge/src/tests/withAppBridgeThemeStubs.tsx deleted file mode 100644 index 5dc2e2b21..000000000 --- a/packages/app-bridge/src/tests/withAppBridgeThemeStubs.tsx +++ /dev/null @@ -1,24 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type ComponentType } from 'react'; - -import { type AppBridgeTheme } from '../AppBridgeTheme'; - -import { getAppBridgeThemeStub, type getAppBridgeThemeStubProps } from './AppBridgeThemeStub'; - -type withAppBridgeThemeStubsProps = { appBridge: AppBridgeTheme }; - -export function withAppBridgeThemeStubs( - WrappedComponent: ComponentType, - appBridgeProps?: getAppBridgeThemeStubProps, -): [ComponentType>, ReturnType] { - const appBridge = getAppBridgeThemeStub(appBridgeProps ?? {}); - const ComponentWithAppBridgeStubs = (props: Omit) => { - return ; - }; - - const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; - ComponentWithAppBridgeStubs.displayName = `withAppBridgeThemeStubs(${displayName})`; - - return [ComponentWithAppBridgeStubs, appBridge]; -} diff --git a/packages/app-bridge/src/types/Asset.ts b/packages/app-bridge/src/types/Asset.ts index 2c4e5bcf8..9d78e7935 100644 --- a/packages/app-bridge/src/types/Asset.ts +++ b/packages/app-bridge/src/types/Asset.ts @@ -2,7 +2,7 @@ export type AssetApi = { id: number; - creator_name: string; + alternative_text: Nullable; ext: string; external_url: Nullable; file_name: string; @@ -18,17 +18,17 @@ export type AssetApi = { file_size: number; file_size_formatted: string; file_id: string; - project_name: Nullable; - project_type: Nullable; token: string; revision_id: Nullable; background_color: Nullable; is_download_protected: boolean; + focal_point_x: Nullable; + focal_point_y: Nullable; }; export type Asset = { id: number; - creatorName: string; + alternativeText: Nullable; extension: string; externalUrl: Nullable; fileName: string; @@ -45,8 +45,9 @@ export type Asset = { fileSizeHumanReadable: string; fileId: string; token: string; - projectType: Nullable; revisionId: Nullable; backgroundColor: Nullable; isDownloadProtected: boolean; + focalPointX: Nullable; + focalPointY: Nullable; }; diff --git a/packages/app-bridge/src/types/BrandportalLink.ts b/packages/app-bridge/src/types/BrandportalLink.ts deleted file mode 100644 index 286d4d28e..000000000 --- a/packages/app-bridge/src/types/BrandportalLink.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type BrandportalLinkApi = { - brand_portal: { - enabled: boolean; - label: string; - url: string; - }; -}; - -export type BrandportalLink = BrandportalLinkApi['brand_portal']; diff --git a/packages/app-bridge/src/types/BulkDownload.ts b/packages/app-bridge/src/types/BulkDownload.ts index d0a1f32a9..122bd90b9 100644 --- a/packages/app-bridge/src/types/BulkDownload.ts +++ b/packages/app-bridge/src/types/BulkDownload.ts @@ -1,18 +1,12 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type CamelCasedPropertiesDeep } from 'type-fest'; - -export type GetBulkDownloadTokenApi = { - asset_ids: number[]; - set_ids: number[]; +export type GetBulkDownloadToken = { + assetIds: number[]; + setIds: number[]; language: string; }; -export type GetBulkDownloadToken = CamelCasedPropertiesDeep; - -export type BulkDownloadApi = { - download_url: string; +export type BulkDownload = { + downloadUrl: string; signature: string; }; - -export type BulkDownload = CamelCasedPropertiesDeep; diff --git a/packages/app-bridge/src/types/Color.ts b/packages/app-bridge/src/types/Color.ts index 8bb3f210a..303ea8423 100644 --- a/packages/app-bridge/src/types/Color.ts +++ b/packages/app-bridge/src/types/Color.ts @@ -1,137 +1,55 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -export type ColorApi = { +export type Color = { id: number; - creator: number; - created: string; - modifier: Nullable; - modified: Nullable; - valid_from: Nullable; - valid_to: Nullable; - project: number; - reference_color: Nullable; - group: Nullable; - palette: Nullable; - type: Nullable; - name: Nullable; - name_css: Nullable; sort: number; +} & ColorAsset; + +// This type should be evolved to Asset in the long run +export type ColorAsset = { + title: Nullable; + revision: ColorRevision; +}; + +export type ColorRevision = { + nameCss: Nullable; hex: Nullable; - r: Nullable; - g: Nullable; - b: Nullable; - alpha: Nullable; hue: number; saturation: number; lightness: Nullable; - gradient_direction: Nullable; - gradient_color_one: Nullable; - gradient_color_two: Nullable; - gradient_type: Nullable; - usage: string; - priority: Nullable; - c: Nullable; - m: Nullable; - y: Nullable; - k: Nullable; - pantone: Nullable; ral: Nullable; oracal: Nullable; - pantone_coated: Nullable; - pantone_uncoated: Nullable; - cmyk_coated: Nullable; - cmyk_uncoated: Nullable; - cmyk_newspaper: Nullable; ncs: Nullable; - pantone_cp: Nullable; - pantone_plastics: Nullable; - pantone_textile: Nullable; hks: Nullable; - three_m: Nullable; + threeM: Nullable; lab: Nullable; - opacity: Nullable; - opacity_css: Nullable; - css_value: Nullable; -}; - -export type ColorApiCreate = { - project_color_palette_id: number; - red: number; - green: number; - blue: number; - alpha: number; + cmyk: CmykColor; + rgba: RgbaColor; + pantone: PantoneColor; }; -export type ColorApiPatch = Partial<{ - language: Nullable; - name: Nullable; - name_css: Nullable; - sort: Nullable; - red: Nullable; - green: Nullable; - blue: Nullable; - alpha: Nullable; - c: Nullable; - m: Nullable; - y: Nullable; - k: Nullable; - pantone: Nullable; - ral: Nullable; - oracal: Nullable; - pantone_coated: Nullable; - pantone_uncoated: Nullable; - cmyk_coated: Nullable; - cmyk_uncoated: Nullable; - cmyk_newspaper: Nullable; - ncs: Nullable; - pantone_cp: Nullable; - pantone_plastics: Nullable; - pantone_textile: Nullable; - hks: Nullable; - three_m: Nullable; - lab: Nullable; -}>; - -export type Color = { - id: number; - name: Nullable; - sort: number; - nameCss: Nullable; - hex: Nullable; +type RgbaColor = { red: Nullable; green: Nullable; blue: Nullable; alpha: Nullable; - hue: number; - saturation: number; - lightness: Nullable; - c: Nullable; - m: Nullable; - y: Nullable; - k: Nullable; - pantone: Nullable; - ral: Nullable; - oracal: Nullable; - pantoneCoated: Nullable; - pantoneUncoated: Nullable; - cmykCoated: Nullable; - cmykUncoated: Nullable; - cmykNewspaper: Nullable; - ncs: Nullable; - pantoneCp: Nullable; - pantonePlastics: Nullable; - pantoneTextile: Nullable; - hks: Nullable; - threeM: Nullable; - lab: Nullable; }; -export type ColorCreate = { - colorPaletteId: number; - red: number; - green: number; - blue: number; - alpha: number; +type CmykColor = { + cyan: Nullable; + magenta: Nullable; + yellow: Nullable; + black: Nullable; + coated: Nullable; + uncoated: Nullable; + newspaper: Nullable; }; -export type ColorPatch = Partial>; +type PantoneColor = { + code: Nullable; + coated: Nullable; + uncoated: Nullable; + cp: Nullable; + plastics: Nullable; + textile: Nullable; +}; diff --git a/packages/app-bridge/src/types/ColorPalette.ts b/packages/app-bridge/src/types/ColorPalette.ts index 84a3f404b..443355857 100644 --- a/packages/app-bridge/src/types/ColorPalette.ts +++ b/packages/app-bridge/src/types/ColorPalette.ts @@ -1,21 +1,6 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type Color, type ColorApi } from './Color'; - -export type ColorPaletteApi = { - id: number; - name: string; - description: string; - colors?: Nullable; -}; - -export type ColorPaletteApiCreate = { - project_id: number; - name: string; - description?: string; -}; - -export type ColorPaletteApiPatch = Partial & { language: string }>; +import { type Color } from './Color'; export type ColorPalette = { id: number; @@ -23,10 +8,3 @@ export type ColorPalette = { description: string; colors: Color[]; }; - -export type ColorPaletteCreate = { - name: string; - description?: string; -}; - -export type ColorPalettePatch = Partial>; diff --git a/packages/app-bridge/src/types/CoverPage.ts b/packages/app-bridge/src/types/CoverPage.ts deleted file mode 100644 index 9660b1458..000000000 --- a/packages/app-bridge/src/types/CoverPage.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CamelCasedPropertiesDeep, type Merge, type Simplify, type ValueOf } from 'type-fest'; - -export type CoverPageTemplate = 'hub' | 'explorer' | 'story' | 'cover' | 'blank'; - -export type CoverPageApi = { - brandhome: { - id: number; - url: string; - draft: 0 | 1; - title: string; - enabled: 0 | 1; - active: boolean; - hide_in_nav: boolean; - }; - items?: unknown; - brand_portal?: unknown; - document_groups?: unknown; - navigation_mode?: unknown; - template: CoverPageTemplate; - document_id: string; -}; - -export type CoverPage = Merge< - CamelCasedPropertiesDeep< - Simplify & Pick> - >, - { - draft: boolean; - enabled: boolean; - } ->; - -export type CoverPageCreate = PickRequired, 'id'>, 'documentId' | 'template'>; -export type CoverPageUpdate = RequireOnlyOne; - -export type CoverPageUpdateLegacy = { - brandhome_draft?: boolean; - brandhome_title?: string; - brandhome_hide_in_nav?: boolean; -}; diff --git a/packages/app-bridge/src/types/CrossDocumentMessage.ts b/packages/app-bridge/src/types/CrossDocumentMessage.ts deleted file mode 100644 index 431189471..000000000 --- a/packages/app-bridge/src/types/CrossDocumentMessage.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type Topic } from './Topic'; - -export type CrossDocumentMessage> = { - topic: Topic; - token: string; - data?: T; -}; diff --git a/packages/app-bridge/src/types/CrossDocumentMessageResponse.ts b/packages/app-bridge/src/types/CrossDocumentMessageResponse.ts deleted file mode 100644 index 0b171d6b0..000000000 --- a/packages/app-bridge/src/types/CrossDocumentMessageResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type Topic } from './Topic'; - -export type CrossDocumentMessageResponse = { - success: boolean; - topic: Topic; - token: string; - data?: T; -}; diff --git a/packages/app-bridge/src/types/DispatchHandler.ts b/packages/app-bridge/src/types/DispatchHandler.ts index 87f968352..90328eee0 100644 --- a/packages/app-bridge/src/types/DispatchHandler.ts +++ b/packages/app-bridge/src/types/DispatchHandler.ts @@ -8,7 +8,6 @@ export type DispatchPayload = { openAssetViewer: { token: string }; openTemplateChooser: void; closeTemplateChooser: void; - openNavigationManager: void; openNewPublication: OpenNewPublicationPayload; }; diff --git a/packages/app-bridge/src/types/Document.ts b/packages/app-bridge/src/types/Document.ts index 1dc311e51..7a66b7341 100644 --- a/packages/app-bridge/src/types/Document.ts +++ b/packages/app-bridge/src/types/Document.ts @@ -1,10 +1,10 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type CamelCasedPropertiesDeep, type RequireAtLeastOne, type SetOptional, type Simplify } from 'type-fest'; +import { type Simplify, type CamelCasedPropertiesDeep } from 'type-fest'; import { type SingleTargetApi } from './Targets'; -export type DocumentLibraryMode = +type DocumentLibraryMode = | 'MEDIALIBRARY' | 'ICONLIBRARY' | 'LOGOLIBRARY' @@ -13,49 +13,42 @@ export type DocumentLibraryMode = | 'TEXTLIBRARY' | 'BRANDUPDATELIBRARY'; -export type DocumentMode = Simplify<'DEFAULT' | DocumentLibraryMode>; +type DocumentMode = Simplify<'DEFAULT' | DocumentLibraryMode>; -export enum LinkType { - External = 'EXTERNAL', - Internal = 'INTERNAL', -} - -type DocumentApiAsLink = { - link_type: 'EXTERNAL'; - link_url: string; +type DocumentAsLink = { + linkType: 'EXTERNAL'; + linkUrl: string; }; -type DocumentApiAsNoneLink = { - link_type: 'INTERNAL'; - link_url: Nullable; +type DocumentAsNoneLink = { + linkType: 'INTERNAL'; + linkUrl: Nullable; }; -export type DocumentLinkSettingsApi = { - new_tab: boolean; - display?: LinkSettingsDisplay; - icon_position?: LinkSettingsIconPosition; - file_id?: string; - screen_id?: number; - icon_url?: string; - icon_file_name?: string; -}; +enum LinkSettingsDisplay { + TextAndIcon = 'ICON_TEXT', + IconOnly = 'ICON', + TextOnly = 'TEXT', +} -type DocumentAsLink = CamelCasedPropertiesDeep; -type DocumentAsNoneLink = CamelCasedPropertiesDeep; +enum LinkSettingsIconPosition { + Right = 'RIGHT', + Left = 'LEFT', +} -export type DocumentApi = Simplify< +export type Document = Simplify< { id: number; creator: number; created: string; modifier: Nullable; modified: Nullable; - project_id: number; - document_group_id?: Nullable; - valid_from: string; - valid_to: Nullable; + projectId: number; + documentGroupId?: Nullable; + validFrom: string; + validTo: Nullable; visibility: Nullable; - portal_id: Nullable; + portalId: Nullable; title: string; slug: Nullable; heading: Nullable; @@ -64,93 +57,33 @@ export type DocumentApi = Simplify< logo: Nullable; sort: number; lazy: Nullable; - link_settings: Nullable; - view_count: Nullable; + linkSettings: Nullable<{ + newTab: boolean; + display?: LinkSettingsDisplay; + iconPosition?: LinkSettingsIconPosition; + fileId?: string; + screenId?: number; + iconUrl?: string; + iconFileName?: string; + }>; + viewCount: Nullable; mode: DocumentMode; settings: { project?: number; - project_slug?: string; - facettes?: any[]; + projectSlug?: string; + facettes?: unknown[]; }; - appearance: Nullable>; - logo_file_id: Nullable; - logo_settings: Nullable; - background_file_id: Nullable; - background_settings: Nullable; - targets: Nullable; + appearance: Nullable>; + logoFileId: Nullable; + logoSettings: Nullable; + backgroundFileId: Nullable; + backgroundSettings: Nullable; + targets: Nullable>; token: Nullable; - permanent_link: string; + permanentLink: string; // Enriched fields - number_of_document_page_categories: number; - number_of_uncategorized_document_pages: number; - } & (DocumentApiAsLink | DocumentApiAsNoneLink) ->; - -export type Document = CamelCasedPropertiesDeep; - -export type DocumentLink = Simplify; - -export type DocumentLibrary = Simplify< - Document & DocumentAsNoneLink & { settings?: { project: number }; mode: DocumentLibraryMode } ->; - -export type DocumentStandard = Simplify; - -export type DocumentLinkSettings = CamelCasedPropertiesDeep; - -export enum LinkSettingsDisplay { - TextAndIcon = 'ICON_TEXT', - IconOnly = 'ICON', - TextOnly = 'TEXT', -} - -export enum LinkSettingsIconPosition { - Right = 'RIGHT', - Left = 'LEFT', -} - -type DocumentLinkRequest = { - id: number; - title: string; - linkUrl: string; - linkSettings: DocumentLinkSettings; - documentGroupId?: Nullable; -}; - -type DocumentLibraryRequest = { - id: number; - mode: DocumentLibraryMode; - settings: { project: number }; - title: string; - heading?: string; - subheading?: string; - documentGroupId?: Nullable; -}; - -type DocumentStandardRequest = { - id: number; - title: string; - documentGroupId?: Nullable; -}; - -export type DocumentStandardCreate = Omit; -export type DocumentStandardUpdate = RequireAtLeastOne; -export type DocumentStandardDelete = Pick; - -export type DocumentLibraryCreate = SetOptional< - Omit, - 'heading' | 'subheading' | 'settings' ->; -export type DocumentLibraryUpdate = RequireAtLeastOne< - DocumentLibraryRequest, - 'documentGroupId' | 'heading' | 'mode' | 'settings' | 'subheading' | 'title' ->; -export type DocumentLibraryDelete = Pick; - -export type DocumentLinkCreate = Omit; -export type DocumentLinkUpdate = RequireAtLeastOne< - DocumentLinkRequest, - 'title' | 'linkUrl' | 'linkSettings' | 'documentGroupId' + numberOfDocumentPageCategories: number; + numberOfUncategorizedDocumentPages: number; + } & (DocumentAsLink | DocumentAsNoneLink) >; -export type DocumentLinkDelete = Pick; diff --git a/packages/app-bridge/src/types/DocumentBlockTemplate.ts b/packages/app-bridge/src/types/DocumentBlockTemplate.ts deleted file mode 100644 index 76e39e949..000000000 --- a/packages/app-bridge/src/types/DocumentBlockTemplate.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type SnakeCasedPropertiesDeep } from 'type-fest'; - -import { type Template } from './Template'; - -export type DocumentBlockTemplateApi = Omit, 'template'> & { - template: Template; -}; - -export type DocumentBlockTemplate = { - id: number; - creator: number; - created: string; - modifier: number; - modified: string; - validTo: Nullable; - documentBlockId: number; - settingId: string; - templateId: number; - - // Enriched - template: Template; -}; diff --git a/packages/app-bridge/src/types/DocumentCategory.ts b/packages/app-bridge/src/types/DocumentCategory.ts deleted file mode 100644 index 8f7500277..000000000 --- a/packages/app-bridge/src/types/DocumentCategory.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CamelCasedPropertiesDeep, type RequireAtLeastOne } from 'type-fest'; - -export type DocumentCategoryApi = { - id: number; - document_id: number; - slug: string; - title: string; - sort: number; - creator: number; - created: string; - modifier: Nullable; - modified: Nullable; - valid_from: string; - valid_to: Nullable; - number_of_document_pages: number; -}; - -type DocumentPageRequestFields = 'title' | 'documentId' | 'id'; - -export type DocumentCategory = CamelCasedPropertiesDeep; - -export type DocumentCategoryCreate = Pick; - -export type DocumentCategoryUpdate = RequireAtLeastOne, 'title'>; - -export type DocumentCategoryDelete = Pick; diff --git a/packages/app-bridge/src/types/DocumentGroup.ts b/packages/app-bridge/src/types/DocumentGroup.ts deleted file mode 100644 index ca5856b53..000000000 --- a/packages/app-bridge/src/types/DocumentGroup.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CamelCasedPropertiesDeep } from 'type-fest'; - -export type DocumentGroupApi = { - id: number; - name: string; - sort: Nullable; - creator: number; - created: string; - modified: Nullable; - modifier: Nullable; - valid_to: Nullable; - project_id: number; - portal_id: number; - number_of_documents: number; -}; - -export type DocumentGroup = CamelCasedPropertiesDeep; - -export type DocumentGroupCreate = Pick; -export type DocumentGroupUpdate = Pick; -export type DocumentGroupDelete = Pick; diff --git a/packages/app-bridge/src/types/DocumentPage.ts b/packages/app-bridge/src/types/DocumentPage.ts index d850a8627..377b0ed82 100644 --- a/packages/app-bridge/src/types/DocumentPage.ts +++ b/packages/app-bridge/src/types/DocumentPage.ts @@ -1,6 +1,6 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type CamelCasedPropertiesDeep, type RequireAtLeastOne, type SetRequired } from 'type-fest'; +import { type CamelCasedPropertiesDeep } from 'type-fest'; import { type SingleTargetApi } from './Targets'; @@ -44,21 +44,3 @@ export type DocumentPageApi = { } & (DocumentPageApiAsLink | DocumentPageApiAsNoneLink); export type DocumentPage = CamelCasedPropertiesDeep; - -type DocumentPageRequest = { - id: number; - title: Nullable; - documentId: number; - linkUrl?: Nullable; - categoryId?: Nullable; - visibility?: DocumentPageVisibility; -}; - -export type DocumentPageCreate = Omit, 'id'>; - -export type DocumentPageUpdate = RequireAtLeastOne< - DocumentPageRequest, - 'documentId' | 'categoryId' | 'linkUrl' | 'title' | 'visibility' ->; - -export type DocumentPageDelete = Pick; diff --git a/packages/app-bridge/src/types/DocumentSection.ts b/packages/app-bridge/src/types/DocumentSection.ts index 84b54b24e..55cbd70ec 100644 --- a/packages/app-bridge/src/types/DocumentSection.ts +++ b/packages/app-bridge/src/types/DocumentSection.ts @@ -6,7 +6,7 @@ export type DocumentSectionApi = { page_id: number; slug: string; sort: number; - title: string; + title: Nullable; creator: number; created: string; modifier: Nullable; @@ -17,26 +17,8 @@ export type DocumentSectionApi = { export type DocumentSection = { id: number; - title: string; + title: Nullable; slug: string; sort: number; permanentLink: string; }; - -export type AddDocumentSectionPayload = { - documentSection: DocumentSection; - previousDocumentSectionId: Nullable; - documentPageId: number; -}; - -export type UpdateDocumentSectionPayload = { - id: number; - title: string; - slug: string; - documentPageId: number; -}; - -export type DeleteDocumentSectionPayload = { - id: number; - documentPageId: number; -}; diff --git a/packages/app-bridge/src/types/Emitter.ts b/packages/app-bridge/src/types/Emitter.ts index 4e7c000c2..1e496ba15 100644 --- a/packages/app-bridge/src/types/Emitter.ts +++ b/packages/app-bridge/src/types/Emitter.ts @@ -3,29 +3,11 @@ import { type BlockSettingsUpdateEvent } from '../react/useBlockSettings'; import { type Asset } from './Asset'; -import { type BrandportalLink } from './BrandportalLink'; -import { type Color } from './Color'; -import { type ColorPalette } from './ColorPalette'; -import { type CoverPage } from './CoverPage'; -import { type Document } from './Document'; -import { type DocumentCategory } from './DocumentCategory'; -import { type DocumentGroup } from './DocumentGroup'; -import { type DocumentPage } from './DocumentPage'; -import { - type AddDocumentSectionPayload, - type DeleteDocumentSectionPayload, - type UpdateDocumentSectionPayload, -} from './DocumentSection'; import { type PrivacySettings } from './PrivacySettings'; import { type Template } from './Template'; import { type AssetViewerOptions } from './Terrific'; -import { type ThemeTemplate } from './ThemeTemplate'; - -export type EmitterAction = 'add' | 'update' | 'delete'; export type EmitterEvents = { - 'AppBridge:PageTemplateSettingsUpdated': { pageTemplateSettings: Record }; - 'AppBridge:ThemeSettingsUpdated': { themeSettings: Record> }; 'AppBridge:BlockSettingsUpdated': BlockSettingsUpdateEvent; 'AppBridge:BlockAssetsUpdated': { @@ -34,176 +16,15 @@ export type EmitterEvents = { prevBlockAssets: Record; }; - 'AppBridge:TemplateAssetsUpdated': { - template: ThemeTemplate; - documentId?: number; - documentPageId?: number; - templateAssets: Record; - prevTemplateAssets: Record; - }; - - 'AppBridge:ThemeAssetsUpdated': { - portalId: number; - themeAssets: Record; - prevThemeAssets: Record; - template: ThemeTemplate; - }; - 'AppBridge:BlockTemplatesUpdated': { blockId: number; blockTemplates: Record; prevBlockTemplates: Record; }; - 'AppBridge:ColorsUpdated': { - blockId: number; - colors: Color[]; - prevColors: Color[]; - }; - - 'AppBridge:ColorPalettesUpdated': { - blockId: number; - colorPalettes: ColorPalette[]; - prevColorPalettes: ColorPalette[]; - }; - - 'AppBridge:GuidelineDocument:Action': - | { - document: Document; - action: 'add' | 'update' | 'move'; - } - | { - document: { id: number; documentGroupId?: Nullable }; - action: 'delete'; - }; - - 'AppBridge:GuidelineDocumentGroup:Action': - | { - documentGroup: DocumentGroup; - action: 'add' | 'update'; - } - | { - documentGroup: { id: number }; - action: 'delete'; - }; - - 'AppBridge:GuidelineCoverPage:Action': - | { - coverPage: CoverPage; - action: 'add' | 'update'; - } - | { - action: 'delete'; - }; - - 'AppBridge:GuidelineBrandportalLink:Action': { - brandportalLink: BrandportalLink; - action: 'update'; - }; - 'AppBridge:PrivacySettingsChanged': PrivacySettings; 'AppBridge:OpenNavigationManager': void; - 'AppBridge:OpenSearchDialog': void; - 'AppBridge:CloseSearchDialog': void; - - 'AppBridge:GuidelineDocumentPage:Action': - | { - documentPage: DocumentPage; - action: 'add' | 'update' | 'move'; - } - | { - documentPage: { id: number; documentId: number; categoryId?: Nullable }; - action: 'delete'; - }; - 'AppBridge:GuidelineDocumentSection:Action': - | { - action: 'add'; - payload: AddDocumentSectionPayload; - } - | { - action: 'update'; - payload: UpdateDocumentSectionPayload; - } - | { - action: 'delete'; - payload: DeleteDocumentSectionPayload; - }; - - 'AppBridge:GuidelineDocumentCategory:Action': - | { - documentCategory: DocumentCategory; - action: 'add' | 'update'; - } - | { - documentCategory: { id: number; documentId: number }; - action: 'delete'; - }; - - 'AppBridge:GuidelineDocumentCategory:DocumentPageAction': { - documentPage: { id: number; categoryId: number }; - action: 'add' | 'delete'; - }; - - 'AppBridge:GuidelineDocument:DocumentPageAction': { - documentPage: { id: number; documentId: number }; - action: 'add' | 'delete'; - }; - - 'AppBridge:GuidelineDocument:DocumentCategoryAction': { - documentCategory: { id: number; documentId: number }; - action: 'add' | 'delete'; - }; - - 'AppBridge:GuidelineDocumentGroup:DocumentAction': { - document: { id: number; documentGroupId: number }; - action: 'add' | 'delete'; - }; - - 'AppBridge:GuidelineDocumentPageTargets:Action': { - action: 'update'; - payload: { - targets: number[]; - pageIds: number[]; - }; - }; - - 'AppBridge:GuidelineDocumentTargets:Action': { - payload: { - targets: number[]; - documentIds: number[]; - }; - action: 'update'; - }; - 'AppBridge:ViewerOpened': AssetViewerOptions; - - 'AppBridge:GuidelineDocumentPage:MoveEvent': { - documentPage: DocumentPage | { id: number; sort?: Nullable }; - documentId: number; - categoryId?: Nullable; - position?: number; - action: 'movePreview'; - }; - - 'AppBridge:GuidelineDocumentCategory:MoveEvent': { - documentCategory: DocumentCategory | { id: number; sort?: Nullable }; - documentId: number; - position: number; - action: 'movePreview'; - }; - - 'AppBridge:GuidelineDocument:MoveEvent': { - document: Document | { id: number; sort?: Nullable; documentGroupId?: Nullable }; - position: number; - newGroupId?: Nullable; - action: 'movePreview'; - }; - - 'AppBridge:GuidelineDocumentGroup:MoveEvent': { - documentGroup: DocumentGroup | { id: number; sort?: Nullable }; - position: number; - action: 'movePreview'; - }; }; diff --git a/packages/app-bridge/src/types/Guideline.ts b/packages/app-bridge/src/types/Guideline.ts deleted file mode 100644 index 26c09120f..000000000 --- a/packages/app-bridge/src/types/Guideline.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type LinkSettingsDisplay, type LinkSettingsIconPosition } from './Document.ts'; - -export interface GuidelineCoverPage { - id(): number; - title(language?: string): string; - isPublished(): boolean; - isHiddenInNavigation(): boolean; - url(language?: string): string; - type: 'cover-page'; -} - -export interface GuidelineDocumentGroup { - id(): number; - title(language?: string): string; - children(): (GuidelineDocument | GuidelineDocumentLibrary | GuidelineDocumentLink)[]; - type: 'document-group'; -} - -export interface GuidelineDocument { - id(): number; - title(language?: string): string; - slug(language?: string): string; - url(language?: string): string; - parentId(): Nullable; - type: 'document'; -} - -export interface GuidelineDocumentLibrary { - id(): number; - title(language?: string): string; - slug(language?: string): string; - url(language?: string): string; - parentId(): Nullable; - type: 'document-library'; -} - -export interface GuidelineDocumentLink { - id(): number; - title(language?: string): string; - url(): string; - displayMode(): LinkSettingsDisplay; - iconPosition(): LinkSettingsIconPosition; - customIconUrl(): Nullable; - shouldOpenInNewTab(): boolean; - parentId(): Nullable; - type: 'document-link'; -} - -export interface GuidelinePageCategory { - id(): number; - title(language?: string): string; - slug(language?: string): string; - children(): (GuidelineDocumentPage | GuidelineDocumentPageLink)[]; - type: 'page-category'; -} - -export interface GuidelineDocumentPage { - id(): number; - title(language?: string): string; - slug(language?: string): string; - url(language?: string): string; - headings(): GuidelineDocumentPageHeading[]; - type: 'document-page'; -} - -export interface GuidelineDocumentPageLink { - id(): number; - title(language?: string): string; - url(): string; - type: 'document-page-link'; -} - -export interface GuidelineDocumentPageHeading { - id(): number; - title(language?: string): string; - slug(language?: string): string; - type: 'document-page-heading'; -} - -export type PortalNavigationItem = - | GuidelineCoverPage - | GuidelineDocumentGroup - | GuidelineDocument - | GuidelineDocumentLibrary - | GuidelineDocumentLink; - -export type DocumentNavigationItem = - | GuidelinePageCategory - | GuidelineDocumentPage - | GuidelineDocumentPageLink - | GuidelineDocumentPageHeading; diff --git a/packages/app-bridge/src/types/GuidelineSearchResult.ts b/packages/app-bridge/src/types/GuidelineSearchResult.ts deleted file mode 100644 index 3b39d72e9..000000000 --- a/packages/app-bridge/src/types/GuidelineSearchResult.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CamelCasedPropertiesDeep } from 'type-fest'; - -export const GuidelineSearchResultTypeMap = { - block: 'BLOCK', - section: 'SECTION', - page: 'PAGE', - color: 'COLOR', -} as const; -type GuidelineSearchResultType = (typeof GuidelineSearchResultTypeMap)[keyof typeof GuidelineSearchResultTypeMap]; - -export type GuidelineSearchResultApi = { - highlights: string[]; - type: GuidelineSearchResultType; - object_id: number; - page_id: number; - page_slug: string; - page_title: string; - page_category_slug: string | null; - block_id: number; - document_id: number; - document_slug: string; - document_title: string; - guideline_title: string; - portal_id: number; - portal_token: string | null; - section_id: string | null; - section_slug: string | null; - section_title: string | null; - color_hex?: string; - project_color_id?: string; -}; - -export type GuidelineSearchResult = CamelCasedPropertiesDeep; diff --git a/packages/app-bridge/src/types/Language.ts b/packages/app-bridge/src/types/Language.ts deleted file mode 100644 index ea2838728..000000000 --- a/packages/app-bridge/src/types/Language.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type Language = { - /** - * The language code in ISO 639-1 format. - */ - isoCode: string; - - /** - * The name of the language. - */ - name: string; - - /** - * Indicates whether the language is the default language. - */ - isDefault: boolean; - - /** - * Indicates whether the language is in draft state. - */ - isDraft: boolean; -}; diff --git a/packages/app-bridge/src/types/Notify.ts b/packages/app-bridge/src/types/Notify.ts deleted file mode 100644 index 0b619a4f0..000000000 --- a/packages/app-bridge/src/types/Notify.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type NotifyOptions = { - origin?: string; -}; - -export type NotifyData> = T; diff --git a/packages/app-bridge/src/types/OauthTokens.ts b/packages/app-bridge/src/types/OauthTokens.ts deleted file mode 100644 index 93c3baa1f..000000000 --- a/packages/app-bridge/src/types/OauthTokens.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type OauthTokens = { - access_token: string; - refresh_token: string; - expires_in: number; - name: string; - token_type: 'Bearer'; -}; diff --git a/packages/app-bridge/src/types/PageTemplateAsset.ts b/packages/app-bridge/src/types/PageTemplateAsset.ts deleted file mode 100644 index ce144f5bf..000000000 --- a/packages/app-bridge/src/types/PageTemplateAsset.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type SnakeCasedPropertiesDeep } from 'type-fest'; - -import { type Asset, type AssetApi } from './Asset'; - -export type PageTemplateAssetApi = Omit, 'asset'> & { asset: AssetApi }; - -export type PageTemplateAsset = { - id: number; - creator: number; - created: string; - modifier: Nullable; - modified: Nullable; - validTo: Nullable; - settingId: string; - assetId: number; - - // Enriched - asset: Asset; -}; diff --git a/packages/app-bridge/src/types/PostExternalAssetParams.ts b/packages/app-bridge/src/types/PostExternalAssetParams.ts deleted file mode 100644 index 13af5588d..000000000 --- a/packages/app-bridge/src/types/PostExternalAssetParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type PostExternalAssetParams = { - title: string; - url: string; - previewUrl?: string; - data?: Record; -}; diff --git a/packages/app-bridge/src/types/Project.ts b/packages/app-bridge/src/types/Project.ts deleted file mode 100644 index 6a65d7aff..000000000 --- a/packages/app-bridge/src/types/Project.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type CamelCasedPropertiesDeep } from 'type-fest'; - -import { type DocumentLibraryMode } from './Document'; - -export type ProjectApi = { - id: number; - created: string; - creator: number; - name: string; - slug: string; - account: number; - token: string; - email_notification: number; - user_count: number; - brand_id: number; - project_type: string; - auto_tagging_enabled: Nullable; - date_begin: Nullable; - date_end: Nullable; - is_template: number; - download_sizes: string; - zoom_level: string; - success: boolean; - project: { - id: number; - url: string; - slug: string; - creator: number; - creator_name: string; - creator_initials: string; - name: string; - description: Nullable; - account: number; - }; -}; - -export type ProjectCreateApi = { - name: string; - brand: number; - styleguide: number; - project_type: DocumentLibraryMode; -}; - -export type Project = CamelCasedPropertiesDeep; - -export type ProjectCreate = CamelCasedPropertiesDeep; diff --git a/packages/app-bridge/src/types/Targets.ts b/packages/app-bridge/src/types/Targets.ts index 11c9a6b9d..a5f2f7552 100644 --- a/packages/app-bridge/src/types/Targets.ts +++ b/packages/app-bridge/src/types/Targets.ts @@ -60,11 +60,3 @@ export type DocumentPageTargetsApi = { export type DocumentTargets = CamelCasedPropertiesDeep; export type DocumentPageTargets = CamelCasedPropertiesDeep; - -export type TargetsUpdateApi = { - data: boolean; - success: boolean; - targets: number[]; -}; - -export type TargetsUpdate = CamelCasedPropertiesDeep; diff --git a/packages/app-bridge/src/types/Template.ts b/packages/app-bridge/src/types/Template.ts index 9f22c42e8..73217d03c 100644 --- a/packages/app-bridge/src/types/Template.ts +++ b/packages/app-bridge/src/types/Template.ts @@ -1,7 +1,5 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type CamelCasedPropertiesDeep } from 'type-fest'; - export type Template = { id: number; name: string; @@ -12,10 +10,8 @@ export type Template = { pages: TemplatePage[]; }; -export type TemplatePageApi = { - preview_url: string; +type TemplatePage = { + previewUrl: string; width: number; height: number; }; - -export type TemplatePage = CamelCasedPropertiesDeep; diff --git a/packages/app-bridge/src/types/TemplateLegacy.ts b/packages/app-bridge/src/types/TemplateLegacy.ts index 9dac393f3..41fb6b6a3 100644 --- a/packages/app-bridge/src/types/TemplateLegacy.ts +++ b/packages/app-bridge/src/types/TemplateLegacy.ts @@ -1,22 +1,5 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -export type TemplateApiLegacy = { - asset_created: string; - asset_modified: string; - categories: unknown[]; - description: string; - height: number; - id: number; - name: string; - preview: string; - project: number; - project_name: string; - project_type: string; - published: number; - screen_id: number; - width: number; -}; - export type TemplateLegacy = { id: number; title: string; diff --git a/packages/app-bridge/src/types/Terrific.ts b/packages/app-bridge/src/types/Terrific.ts index b7528203c..4a4340229 100644 --- a/packages/app-bridge/src/types/Terrific.ts +++ b/packages/app-bridge/src/types/Terrific.ts @@ -3,7 +3,6 @@ import { type AssetApi } from './Asset'; import { type FileExtension } from './FileExtension'; import { type Template } from './Template'; -import { type TemplateApiLegacy } from './TemplateLegacy'; export enum TerrificEvent { OpenModal = 'onOpenModal', @@ -17,8 +16,27 @@ export type TerrificComponent = { }; }; -export type AssetChooserResult = Omit & { project: number; filesize: number }; -export type TemplateChooserResult = TemplateApiLegacy; +export type AssetChooserResult = Omit & { + project: number; + filesize: number; + computed_alternative_text: Nullable; +}; +export type TemplateChooserResult = { + asset_created: string; + asset_modified: string; + categories: unknown[]; + description: string; + height: number; + id: number; + name: string; + preview: string; + project: number; + project_name: string; + project_type: string; + published: number; + screen_id: number; + width: number; +}; export type AssetChooserAssetChosenCallback = (selectedAsset: { screenData: AssetChooserResult[] }) => void; export type TemplateChooserTemplateChosenCallback = (selectedTemplate: { template: TemplateChooserResult }) => void; diff --git a/packages/app-bridge/src/types/ThemeTemplate.ts b/packages/app-bridge/src/types/ThemeTemplate.ts deleted file mode 100644 index 1b3df14e9..000000000 --- a/packages/app-bridge/src/types/ThemeTemplate.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export type ThemeTemplate = 'documentPage' | 'cover' | 'library'; diff --git a/packages/app-bridge/src/types/Topic.ts b/packages/app-bridge/src/types/Topic.ts deleted file mode 100644 index 4f0bf54f6..000000000 --- a/packages/app-bridge/src/types/Topic.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export enum Topic { - CloseApp = 'closeApp', - DeleteAppState = 'deleteAppState', - GetAppState = 'getAppState', - GetAssetById = 'getAssetById', - GetProjectId = 'getProjectId', - GetRefreshedThirdpartyOauth2Token = 'getRefreshedThirdpartyOauth2Token', - GetThirdPartyOauth2Tokens = 'getThirdPartyOauth2Tokens', - OpenAssetChooser = 'openAssetChooser', - PostExternalAssets = 'postExternalAssets', - PutAppState = 'putAppState', - Init = 'Init', -} diff --git a/packages/app-bridge/src/types/Track.ts b/packages/app-bridge/src/types/Track.ts new file mode 100644 index 000000000..05a57f2ee --- /dev/null +++ b/packages/app-bridge/src/types/Track.ts @@ -0,0 +1,8 @@ +/* (c) Copyright Frontify Ltd., all rights reserved. */ + +export type TrackActions = 'button:clicked'; + +export type TrackPayload = { + action: TrackActions; + payload: Nullable>; +}; diff --git a/packages/app-bridge/src/types/User.ts b/packages/app-bridge/src/types/User.ts index 7b4a150a0..2dfbe740b 100644 --- a/packages/app-bridge/src/types/User.ts +++ b/packages/app-bridge/src/types/User.ts @@ -1,9 +1,5 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { type SnakeCasedPropertiesDeep } from 'type-fest'; - -export type UserApi = SnakeCasedPropertiesDeep; - export type User = { id: number; name: string; diff --git a/packages/app-bridge/src/types/index.ts b/packages/app-bridge/src/types/index.ts index 6085cd036..62dfad76e 100644 --- a/packages/app-bridge/src/types/index.ts +++ b/packages/app-bridge/src/types/index.ts @@ -1,18 +1,11 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ export * from './Asset'; -export * from './BrandportalLink'; export * from './BulkDownload'; export * from './Color'; export * from './ColorPalette'; -export * from './CoverPage'; -export * from './CrossDocumentMessage'; -export * from './CrossDocumentMessageResponse'; export * from './DispatchHandler'; export * from './Document'; -export * from './DocumentBlockTemplate'; -export * from './DocumentCategory'; -export * from './DocumentGroup'; export * from './DocumentPage'; export * from './DocumentSection'; export * from './Emitter'; @@ -20,20 +13,11 @@ export * from './File'; export * from './FileExtension'; export * from './FileExtensionSets'; export * from './FileType'; -export * from './Guideline'; -export * from './GuidelineSearchResult'; -export * from './Language'; -export * from './Notify'; -export * from './OauthTokens'; -export * from './PageTemplateAsset'; export * from './PrivacySettings'; -export * from './PostExternalAssetParams'; -export * from './Project'; export * from './SubscriptionHandler'; export * from './Targets'; export * from './TemplateLegacy'; export * from './Template'; export * from './Terrific'; -export * from './ThemeTemplate'; -export * from './Topic'; +export * from './Track'; export * from './User'; diff --git a/packages/app-bridge/src/utilities/MessageBus.spec.ts b/packages/app-bridge/src/utilities/MessageBus.spec.ts deleted file mode 100644 index b98448fcf..000000000 --- a/packages/app-bridge/src/utilities/MessageBus.spec.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it, vi } from 'vitest'; - -import { MessageBus } from './MessageBus'; - -describe('MessageBus', () => { - it('should be instantiable', () => { - const { port1 } = new MessageChannel(); - - const messageBus = new MessageBus(port1); - expect(messageBus).toBeInstanceOf(MessageBus); - }); - - it('should call postMessage from the MessageChannel on post', () => { - const postMessageMock = vi.fn(); - - class PortMock { - postMessage = postMessageMock; - onmessage = vi.fn(); - onmessageerror = vi.fn(); - } - - const messageBus = new MessageBus(new PortMock() as unknown as MessagePort); - messageBus.post({ operation: 'test' }); - expect(postMessageMock).toHaveBeenCalledTimes(1); - }); - - it('should return message from port2', async () => { - const channel = new MessageChannel(); - - const messageBus = new MessageBus(channel.port1); - - const testResponse = 'test-message'; - channel.port2.onmessage = (event) => { - const { token } = event.data; - channel.port2.postMessage({ message: testResponse, token }); - }; - const result = await messageBus.post({ operation: 'test' }); - - expect(result).toEqual(testResponse); - }); - - it('should trigger onmessage error on message sending error', async () => { - const channel = new MessageChannel(); - const messageBus = new MessageBus(channel.port1); - - channel.port1.postMessage = () => { - throw new Error('Simulated message sending error'); - }; - - await expect(() => messageBus.post({ operation: 'test' })).rejects.toThrow(); - }); - - it('should send a token with the channel', () => { - const channel = new MessageChannel(); - const messageBus = new MessageBus(channel.port1); - - channel.port2.onmessage = (event) => { - expect(event.data.token).toBeDefined(); - }; - - messageBus.post({ operation: 'test' }); - }); - - it('should return a message with a token', async () => { - const channel = new MessageChannel(); - const messageBus = new MessageBus(channel.port1); - - channel.port2.onmessage = (event) => { - const { token } = event.data; - channel.port2.postMessage({ message: 'test-message', token }); - }; - - const response = await messageBus.post({ operation: 'test' }); - expect(response).toBe('test-message'); - }); - - it('should handle multiple messages with their tokens and return correct message', async () => { - const channel = new MessageChannel(); - const messageBus = new MessageBus(channel.port1); - - const message1 = 'test-message-1'; - const message2 = 'test-message-2'; - const message3 = 'test-message-3'; - - channel.port2.onmessage = (event) => { - const { token, message } = event.data; - if (message.operation === 'message1') { - setTimeout(() => { - channel.port2.postMessage({ message: message1, token }); - }, 1); - } else if (message.operation === 'message2') { - setTimeout(() => { - channel.port2.postMessage({ message: message2, token }); - }, 2); - } else if (message.operation === 'message3') { - channel.port2.postMessage({ message: message3, token }); - } - }; - - const response2 = await messageBus.post({ operation: 'message2' }); - const response1 = await messageBus.post({ operation: 'message1' }); - const response3 = await messageBus.post({ operation: 'message3' }); - - const allPromises = await Promise.all([ - messageBus.post({ operation: 'message3' }), - messageBus.post({ operation: 'message1' }), - messageBus.post({ operation: 'message2' }), - ]); - - expect(response1).toBe(message1); - expect(response2).toBe(message2); - expect(response3).toBe(message3); - - expect(allPromises.includes(message1)).toBe(true); - expect(allPromises.includes(message2)).toBe(true); - expect(allPromises.includes(message3)).toBe(true); - }); -}); diff --git a/packages/app-bridge/src/utilities/MessageBus.ts b/packages/app-bridge/src/utilities/MessageBus.ts deleted file mode 100644 index cf7f35265..000000000 --- a/packages/app-bridge/src/utilities/MessageBus.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { InitializationError, TimeoutReachedError } from '../errors'; - -import { generateRandomString } from './hash'; -import { SUBSCRIBE_TIMEOUT } from './subscribe'; - -export interface IMessageBus { - post(message: { parameter: unknown }): unknown; -} - -export class MessageBus implements IMessageBus { - private messageBucket: { - message: unknown; - token: string; - resolve: (value: unknown) => void; - }[] = []; - - constructor(private port: MessagePort) { - this.port.onmessage = (event) => { - const { token } = event.data; - const messageIndex = this.messageBucket.findIndex((item) => item.token === token); - if (messageIndex > -1) { - const message = this.messageBucket.splice(messageIndex, 1)[0]; - message.resolve(event.data.message); - } - }; - } - - public post(message: unknown) { - return new Promise((resolve, reject) => { - const token = generateRandomString(); - - this.messageBucket.push({ message, resolve, token }); - this.port.postMessage({ message, token }); - - setTimeout(() => { - reject(new TimeoutReachedError('operation')); - }, SUBSCRIBE_TIMEOUT * 10); - }); - } -} - -export class ErrorMessageBus implements IMessageBus { - post() { - throw new InitializationError('First use await platformApp.dispatch({ name: "openConnection" })'); - } -} diff --git a/packages/app-bridge/src/utilities/dom.spec.ts b/packages/app-bridge/src/utilities/dom.spec.ts deleted file mode 100644 index 991e711da..000000000 --- a/packages/app-bridge/src/utilities/dom.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { afterEach, describe, expect, test, vi } from 'vitest'; - -import { getDatasetByClassName } from './dom'; - -const createElementWithClass = (className: string) => { - const domElement = document.createElement('div'); - domElement.classList.add(className); - document.body.appendChild(domElement); - - return domElement; -}; - -const createElementWithClassAndAttribute = (className: string, attributeName: string, attributeValue: string) => { - const domElement = createElementWithClass(className); - domElement.setAttribute(attributeName, attributeValue); - - return domElement; -}; - -describe('getDatasetByClassName', () => { - afterEach(() => { - document.body.innerHTML = ''; - vi.clearAllMocks(); - }); - - test('should return error if no element found', () => { - expect(() => getDatasetByClassName('nonexistentClassName')).toThrow( - 'Could not find the DOM node via class name', - ); - }); - - test('should return list of dataset elements', () => { - const className = 'className'; - createElementWithClassAndAttribute(className, 'data-attribute', 'value'); - - const dataset = { attribute: 'value' }; - expect(getDatasetByClassName(className)).toEqual(dataset); - }); - - test('should return list of jquery dataset elements', () => { - const className = 'className'; - const dataset = { attribute: 'value' }; - const domElement = createElementWithClass(className); - - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - domElement.jQuery12345678 = dataset; - - expect(getDatasetByClassName(className)).toEqual(dataset); - }); - - test('should return list of jquery dataset and normal DOM dataset elements', () => { - const className = 'className'; - const domElement = createElementWithClassAndAttribute(className, 'data-dom-attribute', 'value'); - - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - domElement.jQuery12345678 = { jQueryAttribute: 'value' }; - - const dataset = { jQueryAttribute: 'value', domAttribute: 'value' }; - expect(getDatasetByClassName(className)).toEqual(dataset); - }); -}); diff --git a/packages/app-bridge/src/utilities/dom.ts b/packages/app-bridge/src/utilities/dom.ts deleted file mode 100644 index 759bf0fa3..000000000 --- a/packages/app-bridge/src/utilities/dom.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export const getDatasetByElement = >(element: HTMLElement): T => { - const jqueryDataset = Object.keys(element) - .filter((property) => property.startsWith('jQuery')) - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - .reduce((stack, key) => ({ ...stack, ...element[key] }), {}); - return { ...element.dataset, ...jqueryDataset } as T; -}; - -export const getDatasetByClassName = >(className: string): T => { - const element = document.getElementsByClassName(className)[0] as HTMLElement; - if (!element) { - throw new Error('Could not find the DOM node via class name'); - } - - return getDatasetByElement(element); -}; diff --git a/packages/app-bridge/src/utilities/file.ts b/packages/app-bridge/src/utilities/file.ts index a296c8fed..c318db5b1 100644 --- a/packages/app-bridge/src/utilities/file.ts +++ b/packages/app-bridge/src/utilities/file.ts @@ -2,6 +2,11 @@ import { FileExtension } from '../types/FileExtension'; +export const getMimeType = (filetypes: string[]): string[] => { + return filetypes + .map((filetype) => mimeTypes[filetype as keyof typeof mimeTypes]) + .filter((mimeType) => mimeType !== undefined); +}; export const mimeTypes: Record = { [FileExtension.Aac]: 'audio/aac', [FileExtension.Ac3]: 'audio/ac3', @@ -211,9 +216,3 @@ export const mimeTypes: Record = { [FileExtension.Xyz]: 'chemical/x-xyz', [FileExtension.Zip]: 'application/zip', }; - -export const getMimeType = (filetypes: string[]): string[] => { - return filetypes - .map((filetype) => mimeTypes[filetype as keyof typeof mimeTypes]) - .filter((mimeType) => mimeType !== undefined); -}; diff --git a/packages/app-bridge/src/utilities/hash.ts b/packages/app-bridge/src/utilities/hash.ts deleted file mode 100644 index bcbceb84a..000000000 --- a/packages/app-bridge/src/utilities/hash.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -export const generateRandomString = (length = 6): string => { - return Math.random().toString(20).substr(2, length); -}; diff --git a/packages/app-bridge/src/utilities/index.ts b/packages/app-bridge/src/utilities/index.ts index d63b7c1ae..235f36b69 100644 --- a/packages/app-bridge/src/utilities/index.ts +++ b/packages/app-bridge/src/utilities/index.ts @@ -1,10 +1,6 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ export * from './color'; -export * from './dom'; export * from './file'; -export * from './hash'; export * from './httpClient'; -export * from './notify'; export * from './object'; -export * from './subscribe'; diff --git a/packages/app-bridge/src/utilities/notify.ts b/packages/app-bridge/src/utilities/notify.ts deleted file mode 100644 index 7a08cdb4f..000000000 --- a/packages/app-bridge/src/utilities/notify.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type NotifyData, type NotifyOptions } from '../types'; - -export function notify(topic: string, token: string, data?: NotifyData, options?: NotifyOptions): void { - const parentWindow = window.top; - parentWindow?.postMessage( - { - topic, - token, - data, - }, - options?.origin || '*', - ); -} diff --git a/packages/app-bridge/src/utilities/queryParams.spec.ts b/packages/app-bridge/src/utilities/queryParams.spec.ts deleted file mode 100644 index 2052bc938..000000000 --- a/packages/app-bridge/src/utilities/queryParams.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { describe, expect, it } from 'vitest'; - -import { getQueryParameters } from './queryParams'; - -describe('queryParams', () => { - it('should return correct queryParams from url', () => { - expect(getQueryParameters('https://www.frontify.com?foo=bar&baz=qux')).toEqual({ foo: 'bar', baz: 'qux' }); - }); - - it('should return empty object if no queryParams are present', () => { - expect(getQueryParameters('https://www.frontify.com')).toEqual({}); - }); - - it('should return empty object if url is empty', () => { - expect(() => getQueryParameters('')).toThrowError('Validation failed. "" is not a valid url'); - }); - - it('should return empty object if url is undefined', () => { - expect(() => getQueryParameters(undefined as unknown as string)).toThrowError( - 'Validation failed. "undefined" is not a valid url', - ); - }); - - it('should return empty object if url is null', () => { - expect(() => getQueryParameters(null as unknown as string)).toThrowError( - 'Validation failed. "null" is not a valid url', - ); - }); - - it('should return objects of well formed query parameters', () => { - expect(getQueryParameters('https://www.frontify.com?foo=bar&baz')).toEqual({ foo: 'bar', baz: '' }); - }); -}); diff --git a/packages/app-bridge/src/utilities/queryParams.ts b/packages/app-bridge/src/utilities/queryParams.ts deleted file mode 100644 index dbf3936b4..000000000 --- a/packages/app-bridge/src/utilities/queryParams.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { ValidationError } from '../errors/ValidationError'; - -export type QueryParams = { [key: string]: string }; - -export const getQueryParameters = (url: string): QueryParams => { - const paramsToObject = (entries: IterableIterator<[string, string]>) => { - const result: QueryParams = {}; - - for (const [key, value] of entries) { - result[key] = value; - } - - return result; - }; - - try { - const urlObject = new URL(url); - return paramsToObject(urlObject.searchParams.entries()); - } catch { - throw new ValidationError(`"${url}" is not a valid url`); - } -}; diff --git a/packages/app-bridge/src/utilities/subscribe.ts b/packages/app-bridge/src/utilities/subscribe.ts deleted file mode 100644 index 902e37812..000000000 --- a/packages/app-bridge/src/utilities/subscribe.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { FetchError } from '../errors/NotifyError'; -import { TimeoutReachedError } from '../errors/TimeoutReachedError'; -import { type CrossDocumentMessageResponse, type Topic } from '../types'; - -export type SubscribeOptions = { - timeout?: number; -}; - -export const SUBSCRIBE_TIMEOUT = 3 * 1000; - -export function subscribe(topic: Topic, token: string, options?: SubscribeOptions): Promise { - return new Promise((resolve, reject) => { - const subscribeResponseCallback = (event: MessageEvent) => { - const response: CrossDocumentMessageResponse = event.data; - - if (response.token === token && response.topic === topic && response.success) { - resolve((response.data || true)); - } else { - reject(new FetchError(topic)); - } - - window.removeEventListener('message', subscribeResponseCallback); - }; - - window.addEventListener('message', subscribeResponseCallback); - - setTimeout(() => { - reject(new TimeoutReachedError(topic)); - }, options?.timeout || SUBSCRIBE_TIMEOUT); - }); -} diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 9dde357f9..4ab3ede21 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -84,7 +84,7 @@ ### Patch Changes -- [#1549](https://github.com/Frontify/brand-sdk/pull/1549) [`2317a2a`](https://github.com/Frontify/brand-sdk/commit/2317a2a91baede088328d7f9cad2e8a941df86b8) Thanks [@ragi96](https://github.com/ragi96)! - fix(cli): default `appType` to `content-block` in deploy command +- [#1549](https://github.com/Frontify/brand-sdk/pull/1549) [`2317a2a`](https://github.com/Frontify/brand-sdk/commit/2317a2a91baede088328d7f9cad2e8a941df86b8) Thanks [@ragi96](https://github.com/ragi96)! - fix(cli): default `appType` to `content-block` in deploy command When neither the `--app-type` CLI option nor the `manifest.json` `appType` field is set, the deploy command now falls back to `'content-block'` instead of remaining `undefined`. This prevents deployment failures for projects that omit the `appType` from their manifest. @@ -92,26 +92,25 @@ ### Major Changes -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: support React 19 +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: support React 19 The CLI now supports React 19 to stay up-to-date with the React ecosystem and provide better performance and modern features. Consumers can from now on update their block / theme to React 19. -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - chore: update required node to 22 +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - chore: update required node to 22 The minimum required Node.js version has been bumped from 18 to 22. Node.js 18 is reaching its end-of-life. Node 22 is the current Active LTS release. Consumers must update their local development environments and CI/CD pipelines to use Node.js version 22 or higher. -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: remove deprecated `block` and `theme` subcommands +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: remove deprecated `block` and `theme` subcommands The following deprecated commands have been removed: + - `block serve` / `theme serve` → use `serve` instead + - `block deploy` / `theme deploy` → use `deploy` instead + - `block create` / `theme create` → use `create` instead - - `block serve` / `theme serve` → use `serve` instead - - `block deploy` / `theme deploy` → use `deploy` instead - - `block create` / `theme create` → use `create` instead - -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: build blocks / themes as ESM packages +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: build blocks / themes as ESM packages Custom blocks and themes are now compiled and output as ECMAScript Modules (ESM) instead of relying on global window variables. ESM is the modern standard for JavaScript, offering better interoperability, tree-shaking and compatibility with modern bundlers. @@ -119,7 +118,7 @@ ### Minor Changes -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `publish` command for publishing apps to the Frontify Marketplace +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `publish` command for publishing apps to the Frontify Marketplace Publish your app directly from the CLI using `frontify-cli publish`. @@ -138,68 +137,64 @@ ### Patch Changes -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - fix: resolve all ESLint warnings across the CLI package - - - Add typed interfaces (`LoginOptions`, `ServeOptions`, `DeployOptions`) for CLI action callbacks to eliminate unsafe `any` access on command options - - Cast `prompts()` return values to proper types instead of implicit `any` destructuring - - Handle floating promises in `login.ts` and `platformAppDevelopmentServer.ts` with `.catch()` instead of fire-and-forget - - Replace `@ts-expect-error` workarounds in `promiseExec.ts` with proper `String()` coercion - - Refactor `reactiveJson.ts` to use typed `JSON.parse`, `Record`-based proxy handler, and `instanceof`/`in` checks instead of `as any` casts - - Replace `as any` casts in `vitePlugins.ts` with `Record` for rolldownOptions access - - Add local `Archive` interface in `zip.ts` to properly type the untyped `archiver` module - - Use `keyof typeof` cast in `gitignoreTemplate.ts` for safe object indexing - - Type dynamic `import()` results and `JSON.parse` calls in test files - - Remove unused `eslint-disable` directives - -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - fix: CLI bug fixes and cleanup - - - Fix typo `sucess` → `success` in HTTP error response type - - Fix hardcoded port in OAuth redirect URI (now uses the configured `--port` value) - - Fix missing `/` separator in deploy build file ignore glob pattern - - Remove `node-fetch` dependency in favor of native `fetch` (Node >=22) - - Handle full 2xx status range in HTTP client instead of only `200` - - Eliminate duplicated deploy command branches in CLI entry point - - Reduce cognitive complexity in deploy command by extracting helper functions +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - fix: resolve all ESLint warnings across the CLI package + - Add typed interfaces (`LoginOptions`, `ServeOptions`, `DeployOptions`) for CLI action callbacks to eliminate unsafe `any` access on command options + - Cast `prompts()` return values to proper types instead of implicit `any` destructuring + - Handle floating promises in `login.ts` and `platformAppDevelopmentServer.ts` with `.catch()` instead of fire-and-forget + - Replace `@ts-expect-error` workarounds in `promiseExec.ts` with proper `String()` coercion + - Refactor `reactiveJson.ts` to use typed `JSON.parse`, `Record`-based proxy handler, and `instanceof`/`in` checks instead of `as any` casts + - Replace `as any` casts in `vitePlugins.ts` with `Record` for rolldownOptions access + - Add local `Archive` interface in `zip.ts` to properly type the untyped `archiver` module + - Use `keyof typeof` cast in `gitignoreTemplate.ts` for safe object indexing + - Type dynamic `import()` results and `JSON.parse` calls in test files + - Remove unused `eslint-disable` directives -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - chore: updated the block templates +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - fix: CLI bug fixes and cleanup + - Fix typo `sucess` → `success` in HTTP error response type + - Fix hardcoded port in OAuth redirect URI (now uses the configured `--port` value) + - Fix missing `/` separator in deploy build file ignore glob pattern + - Remove `node-fetch` dependency in favor of native `fetch` (Node >=22) + - Handle full 2xx status range in HTTP client instead of only `200` + - Eliminate duplicated deploy command branches in CLI entry point + - Reduce cognitive complexity in deploy command by extracting helper functions -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - chore: remove nock dependency, use vitest mocks instead +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - chore: updated the block templates -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - core(Deps): Bump `esbuild` and `vite` dependencies +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - chore: remove nock dependency, use vitest mocks instead -- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - fix: add missing CSS and JS minification to platform-app compiler +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - core(Deps): Bump `esbuild` and `vite` dependencies - - Add `cssFileName: 'style'` to the settings lib build - - Add `minify: 'terser'` for JS minification - - Set explicit `mode: 'production'` on both builds +- [#1546](https://github.com/Frontify/brand-sdk/pull/1546) [`dec69a9`](https://github.com/Frontify/brand-sdk/commit/dec69a9829016cb0a0c87bfd9e7ac239cca9dfeb) Thanks [@ragi96](https://github.com/ragi96)! - fix: add missing CSS and JS minification to platform-app compiler + - Add `cssFileName: 'style'` to the settings lib build + - Add `minify: 'terser'` for JS minification + - Set explicit `mode: 'production'` on both builds ## 6.0.0-alpha.3 ### Patch Changes -- [#1544](https://github.com/Frontify/brand-sdk/pull/1544) [`0eb64be`](https://github.com/Frontify/brand-sdk/commit/0eb64bee22875daca3177ee80c1498550bddef86) Thanks [@ragi96](https://github.com/ragi96)! - chore: updated the block templates +- [#1544](https://github.com/Frontify/brand-sdk/pull/1544) [`0eb64be`](https://github.com/Frontify/brand-sdk/commit/0eb64bee22875daca3177ee80c1498550bddef86) Thanks [@ragi96](https://github.com/ragi96)! - chore: updated the block templates ## 6.0.0-alpha.2 ### Patch Changes -- [#1540](https://github.com/Frontify/brand-sdk/pull/1540) [`1c41dbf`](https://github.com/Frontify/brand-sdk/commit/1c41dbf212f1128e306358df67e2e793ce3d9daf) Thanks [@ragi96](https://github.com/ragi96)! - chore: remove nock dependency, use vitest mocks instead +- [#1540](https://github.com/Frontify/brand-sdk/pull/1540) [`1c41dbf`](https://github.com/Frontify/brand-sdk/commit/1c41dbf212f1128e306358df67e2e793ce3d9daf) Thanks [@ragi96](https://github.com/ragi96)! - chore: remove nock dependency, use vitest mocks instead ## 6.0.0-alpha.1 ### Major Changes -- [#1534](https://github.com/Frontify/brand-sdk/pull/1534) [`dce1f51`](https://github.com/Frontify/brand-sdk/commit/dce1f51e9cb71c2760b8b8b4e6117ef879dd8336) Thanks [@ragi96](https://github.com/ragi96)! - feat: remove deprecated `block` and `theme` subcommands +- [#1534](https://github.com/Frontify/brand-sdk/pull/1534) [`dce1f51`](https://github.com/Frontify/brand-sdk/commit/dce1f51e9cb71c2760b8b8b4e6117ef879dd8336) Thanks [@ragi96](https://github.com/ragi96)! - feat: remove deprecated `block` and `theme` subcommands The following deprecated commands have been removed: - - - `block serve` / `theme serve` → use `serve` instead - - `block deploy` / `theme deploy` → use `deploy` instead - - `block create` / `theme create` → use `create` instead + - `block serve` / `theme serve` → use `serve` instead + - `block deploy` / `theme deploy` → use `deploy` instead + - `block create` / `theme create` → use `create` instead ### Minor Changes -- [#1526](https://github.com/Frontify/brand-sdk/pull/1526) [`406291f`](https://github.com/Frontify/brand-sdk/commit/406291f61a96e8c754da8d07358d8308678b48ac) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `publish` command for publishing apps to the Frontify Marketplace +- [#1526](https://github.com/Frontify/brand-sdk/pull/1526) [`406291f`](https://github.com/Frontify/brand-sdk/commit/406291f61a96e8c754da8d07358d8308678b48ac) Thanks [@ragi96](https://github.com/ragi96)! - feat: add `publish` command for publishing apps to the Frontify Marketplace Publish your app directly from the CLI using `frontify-cli publish`. @@ -218,53 +213,50 @@ ### Patch Changes -- [#1527](https://github.com/Frontify/brand-sdk/pull/1527) [`d070293`](https://github.com/Frontify/brand-sdk/commit/d0702939e4f15cd0f872475f5f5694e3054783a4) Thanks [@ragi96](https://github.com/ragi96)! - fix: resolve all ESLint warnings across the CLI package - - - Add typed interfaces (`LoginOptions`, `ServeOptions`, `DeployOptions`) for CLI action callbacks to eliminate unsafe `any` access on command options - - Cast `prompts()` return values to proper types instead of implicit `any` destructuring - - Handle floating promises in `login.ts` and `platformAppDevelopmentServer.ts` with `.catch()` instead of fire-and-forget - - Replace `@ts-expect-error` workarounds in `promiseExec.ts` with proper `String()` coercion - - Refactor `reactiveJson.ts` to use typed `JSON.parse`, `Record`-based proxy handler, and `instanceof`/`in` checks instead of `as any` casts - - Replace `as any` casts in `vitePlugins.ts` with `Record` for rolldownOptions access - - Add local `Archive` interface in `zip.ts` to properly type the untyped `archiver` module - - Use `keyof typeof` cast in `gitignoreTemplate.ts` for safe object indexing - - Type dynamic `import()` results and `JSON.parse` calls in test files - - Remove unused `eslint-disable` directives - -- [#1529](https://github.com/Frontify/brand-sdk/pull/1529) [`6152ca5`](https://github.com/Frontify/brand-sdk/commit/6152ca58166f7128df78a14b8f6dc6f66cc71f7d) Thanks [@ragi96](https://github.com/ragi96)! - fix: CLI bug fixes and cleanup - - - Fix typo `sucess` → `success` in HTTP error response type - - Fix hardcoded port in OAuth redirect URI (now uses the configured `--port` value) - - Fix missing `/` separator in deploy build file ignore glob pattern - - Remove `node-fetch` dependency in favor of native `fetch` (Node >=22) - - Handle full 2xx status range in HTTP client instead of only `200` - - Eliminate duplicated deploy command branches in CLI entry point - - Reduce cognitive complexity in deploy command by extracting helper functions +- [#1527](https://github.com/Frontify/brand-sdk/pull/1527) [`d070293`](https://github.com/Frontify/brand-sdk/commit/d0702939e4f15cd0f872475f5f5694e3054783a4) Thanks [@ragi96](https://github.com/ragi96)! - fix: resolve all ESLint warnings across the CLI package + - Add typed interfaces (`LoginOptions`, `ServeOptions`, `DeployOptions`) for CLI action callbacks to eliminate unsafe `any` access on command options + - Cast `prompts()` return values to proper types instead of implicit `any` destructuring + - Handle floating promises in `login.ts` and `platformAppDevelopmentServer.ts` with `.catch()` instead of fire-and-forget + - Replace `@ts-expect-error` workarounds in `promiseExec.ts` with proper `String()` coercion + - Refactor `reactiveJson.ts` to use typed `JSON.parse`, `Record`-based proxy handler, and `instanceof`/`in` checks instead of `as any` casts + - Replace `as any` casts in `vitePlugins.ts` with `Record` for rolldownOptions access + - Add local `Archive` interface in `zip.ts` to properly type the untyped `archiver` module + - Use `keyof typeof` cast in `gitignoreTemplate.ts` for safe object indexing + - Type dynamic `import()` results and `JSON.parse` calls in test files + - Remove unused `eslint-disable` directives -- [#1535](https://github.com/Frontify/brand-sdk/pull/1535) [`2a4d33c`](https://github.com/Frontify/brand-sdk/commit/2a4d33ca2807bfa3c2c0dea30eaecb3153d181fb) Thanks [@ragi96](https://github.com/ragi96)! - core(Deps): Bump `esbuild` and `vite` dependencies +- [#1529](https://github.com/Frontify/brand-sdk/pull/1529) [`6152ca5`](https://github.com/Frontify/brand-sdk/commit/6152ca58166f7128df78a14b8f6dc6f66cc71f7d) Thanks [@ragi96](https://github.com/ragi96)! - fix: CLI bug fixes and cleanup + - Fix typo `sucess` → `success` in HTTP error response type + - Fix hardcoded port in OAuth redirect URI (now uses the configured `--port` value) + - Fix missing `/` separator in deploy build file ignore glob pattern + - Remove `node-fetch` dependency in favor of native `fetch` (Node >=22) + - Handle full 2xx status range in HTTP client instead of only `200` + - Eliminate duplicated deploy command branches in CLI entry point + - Reduce cognitive complexity in deploy command by extracting helper functions -- [#1536](https://github.com/Frontify/brand-sdk/pull/1536) [`d5d2237`](https://github.com/Frontify/brand-sdk/commit/d5d22370de2f2da44e6fd5326ddb0ccf572d4ed4) Thanks [@ragi96](https://github.com/ragi96)! - fix: add missing CSS and JS minification to platform-app compiler +- [#1535](https://github.com/Frontify/brand-sdk/pull/1535) [`2a4d33c`](https://github.com/Frontify/brand-sdk/commit/2a4d33ca2807bfa3c2c0dea30eaecb3153d181fb) Thanks [@ragi96](https://github.com/ragi96)! - core(Deps): Bump `esbuild` and `vite` dependencies - - Add `cssFileName: 'style'` to the settings lib build - - Add `minify: 'terser'` for JS minification - - Set explicit `mode: 'production'` on both builds +- [#1536](https://github.com/Frontify/brand-sdk/pull/1536) [`d5d2237`](https://github.com/Frontify/brand-sdk/commit/d5d22370de2f2da44e6fd5326ddb0ccf572d4ed4) Thanks [@ragi96](https://github.com/ragi96)! - fix: add missing CSS and JS minification to platform-app compiler + - Add `cssFileName: 'style'` to the settings lib build + - Add `minify: 'terser'` for JS minification + - Set explicit `mode: 'production'` on both builds ## 6.0.0-alpha.0 ### Major Changes -- [#1482](https://github.com/Frontify/brand-sdk/pull/1482) [`db8c298`](https://github.com/Frontify/brand-sdk/commit/db8c298546a1b2429df799ed1ee7599efb3bf357) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: support React 19 +- [#1482](https://github.com/Frontify/brand-sdk/pull/1482) [`db8c298`](https://github.com/Frontify/brand-sdk/commit/db8c298546a1b2429df799ed1ee7599efb3bf357) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: support React 19 The CLI now supports React 19 to stay up-to-date with the React ecosystem and provide better performance and modern features. Consumers can from now on update their block / theme to React 19. -- [#1482](https://github.com/Frontify/brand-sdk/pull/1482) [`db8c298`](https://github.com/Frontify/brand-sdk/commit/db8c298546a1b2429df799ed1ee7599efb3bf357) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update required node to 22 +- [#1482](https://github.com/Frontify/brand-sdk/pull/1482) [`db8c298`](https://github.com/Frontify/brand-sdk/commit/db8c298546a1b2429df799ed1ee7599efb3bf357) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update required node to 22 The minimum required Node.js version has been bumped from 18 to 22. Node.js 18 is reaching its end-of-life. Node 22 is the current Active LTS release. Consumers must update their local development environments and CI/CD pipelines to use Node.js version 22 or higher. -- [#1482](https://github.com/Frontify/brand-sdk/pull/1482) [`db8c298`](https://github.com/Frontify/brand-sdk/commit/db8c298546a1b2429df799ed1ee7599efb3bf357) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: build blocks / themes as ESM packages +- [#1482](https://github.com/Frontify/brand-sdk/pull/1482) [`db8c298`](https://github.com/Frontify/brand-sdk/commit/db8c298546a1b2429df799ed1ee7599efb3bf357) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: build blocks / themes as ESM packages Custom blocks and themes are now compiled and output as ECMAScript Modules (ESM) instead of relying on global window variables. ESM is the modern standard for JavaScript, offering better interoperability, tree-shaking and compatibility with modern bundlers. @@ -274,582 +266,582 @@ ### Patch Changes -- # [#1521](https://github.com/Frontify/brand-sdk/pull/1521) [`bedc235`](https://github.com/Frontify/brand-sdk/commit/bedc2356ea29a58c25f675daeffacbdb17f2955e) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update some dependencies -- [#1521](https://github.com/Frontify/brand-sdk/pull/1521) [`bedc235`](https://github.com/Frontify/brand-sdk/commit/bedc2356ea29a58c25f675daeffacbdb17f2955e) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update some dependencies +- # [#1521](https://github.com/Frontify/brand-sdk/pull/1521) [`bedc235`](https://github.com/Frontify/brand-sdk/commit/bedc2356ea29a58c25f675daeffacbdb17f2955e) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update some dependencies +- [#1521](https://github.com/Frontify/brand-sdk/pull/1521) [`bedc235`](https://github.com/Frontify/brand-sdk/commit/bedc2356ea29a58c25f675daeffacbdb17f2955e) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update some dependencies ## 5.10.2 ### Patch Changes -- [#1475](https://github.com/Frontify/brand-sdk/pull/1475) [`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update multiple dependencies +- [#1475](https://github.com/Frontify/brand-sdk/pull/1475) [`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update multiple dependencies ## 5.10.1 ### Patch Changes -- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies +- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies ## 5.10.0 ### Minor Changes -- [#1401](https://github.com/Frontify/brand-sdk/pull/1401) [`316b1f7`](https://github.com/Frontify/brand-sdk/commit/316b1f78bdb24b2061d2ead99e9dfc63414f68e8) Thanks [@michael-georgiadis](https://github.com/michael-georgiadis)! - fix: to make the OAuth login functionality to work. No action needed. +- [#1401](https://github.com/Frontify/brand-sdk/pull/1401) [`316b1f7`](https://github.com/Frontify/brand-sdk/commit/316b1f78bdb24b2061d2ead99e9dfc63414f68e8) Thanks [@michael-georgiadis](https://github.com/michael-georgiadis)! - fix: to make the OAuth login functionality to work. No action needed. ## 5.9.5 ### Patch Changes -- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies ## 5.9.4 ### Patch Changes -- [#1312](https://github.com/Frontify/brand-sdk/pull/1312) [`1a7e48c`](https://github.com/Frontify/brand-sdk/commit/1a7e48c25435ff169cf80efe7eced4c6ce5ff6e2) Thanks [@julianiff](https://github.com/julianiff)! - feat: rename themeAction to actionToolbar surface +- [#1312](https://github.com/Frontify/brand-sdk/pull/1312) [`1a7e48c`](https://github.com/Frontify/brand-sdk/commit/1a7e48c25435ff169cf80efe7eced4c6ce5ff6e2) Thanks [@julianiff](https://github.com/julianiff)! - feat: rename themeAction to actionToolbar surface ## 5.9.3 ### Patch Changes -- [#1301](https://github.com/Frontify/brand-sdk/pull/1301) [`89db03c`](https://github.com/Frontify/brand-sdk/commit/89db03cc96f037641fa7f430b7b03e4a5a56752b) Thanks [@julianiff](https://github.com/julianiff)! - fix: remove projectId and portalID from verifier +- [#1301](https://github.com/Frontify/brand-sdk/pull/1301) [`89db03c`](https://github.com/Frontify/brand-sdk/commit/89db03cc96f037641fa7f430b7b03e4a5a56752b) Thanks [@julianiff](https://github.com/julianiff)! - fix: remove projectId and portalID from verifier ## 5.9.2 ### Patch Changes -- [#1290](https://github.com/Frontify/brand-sdk/pull/1290) [`0858b44`](https://github.com/Frontify/brand-sdk/commit/0858b444e76cb04d0cb12c999c83eab77de7d71d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - chore: bump `@frontify/fondue` to `12.12.3` +- [#1290](https://github.com/Frontify/brand-sdk/pull/1290) [`0858b44`](https://github.com/Frontify/brand-sdk/commit/0858b444e76cb04d0cb12c999c83eab77de7d71d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - chore: bump `@frontify/fondue` to `12.12.3` ## 5.9.1 ### Patch Changes -- [#1282](https://github.com/Frontify/brand-sdk/pull/1282) [`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1282](https://github.com/Frontify/brand-sdk/pull/1282) [`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies ## 5.9.0 ### Minor Changes -- [#1257](https://github.com/Frontify/brand-sdk/pull/1257) [`cae6a20`](https://github.com/Frontify/brand-sdk/commit/cae6a20a75e18f6b1e1e2e0e49edeebb211557ef) Thanks [@imoutaharik](https://github.com/imoutaharik)! - Add optional experimental flag to the manifest +- [#1257](https://github.com/Frontify/brand-sdk/pull/1257) [`cae6a20`](https://github.com/Frontify/brand-sdk/commit/cae6a20a75e18f6b1e1e2e0e49edeebb211557ef) Thanks [@imoutaharik](https://github.com/imoutaharik)! - Add optional experimental flag to the manifest ## 5.8.9 ### Patch Changes -- [#1255](https://github.com/Frontify/brand-sdk/pull/1255) [`75880c6`](https://github.com/Frontify/brand-sdk/commit/75880c6748cc195bda797863c20b23ddb7e1efdb) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: improve error message on deployment fail +- [#1255](https://github.com/Frontify/brand-sdk/pull/1255) [`75880c6`](https://github.com/Frontify/brand-sdk/commit/75880c6748cc195bda797863c20b23ddb7e1efdb) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: improve error message on deployment fail ## 5.8.8 ### Patch Changes -- [#1225](https://github.com/Frontify/brand-sdk/pull/1225) [`60f5874`](https://github.com/Frontify/brand-sdk/commit/60f5874024d798951caf474695e5d197726b4200) Thanks [@julianiff](https://github.com/julianiff)! - feat: adjust parser to check for themeAction +- [#1225](https://github.com/Frontify/brand-sdk/pull/1225) [`60f5874`](https://github.com/Frontify/brand-sdk/commit/60f5874024d798951caf474695e5d197726b4200) Thanks [@julianiff](https://github.com/julianiff)! - feat: adjust parser to check for themeAction ## 5.8.7 ### Patch Changes -- [#1186](https://github.com/Frontify/brand-sdk/pull/1186) [`38d23da`](https://github.com/Frontify/brand-sdk/commit/38d23da894b2635008368351b19ffb81dc13caa5) Thanks [@julianiff](https://github.com/julianiff)! - chore: remove uuid and url params +- [#1186](https://github.com/Frontify/brand-sdk/pull/1186) [`38d23da`](https://github.com/Frontify/brand-sdk/commit/38d23da894b2635008368351b19ffb81dc13caa5) Thanks [@julianiff](https://github.com/julianiff)! - chore: remove uuid and url params ## 5.8.6 ### Patch Changes -- [#1184](https://github.com/Frontify/brand-sdk/pull/1184) [`c04731a`](https://github.com/Frontify/brand-sdk/commit/c04731a9ca6be05773cd2c662d05d785b0ef56e0) Thanks [@julianiff](https://github.com/julianiff)! - chore: update zod +- [#1184](https://github.com/Frontify/brand-sdk/pull/1184) [`c04731a`](https://github.com/Frontify/brand-sdk/commit/c04731a9ca6be05773cd2c662d05d785b0ef56e0) Thanks [@julianiff](https://github.com/julianiff)! - chore: update zod ## 5.8.5 ### Patch Changes -- [#1175](https://github.com/Frontify/brand-sdk/pull/1175) [`c0d2426`](https://github.com/Frontify/brand-sdk/commit/c0d24263857b030e4b79b4222c18d5a37f727bd8) Thanks [@julianiff](https://github.com/julianiff)! - fix: add explicit cors +- [#1175](https://github.com/Frontify/brand-sdk/pull/1175) [`c0d2426`](https://github.com/Frontify/brand-sdk/commit/c0d24263857b030e4b79b4222c18d5a37f727bd8) Thanks [@julianiff](https://github.com/julianiff)! - fix: add explicit cors ## 5.8.4 ### Patch Changes -- [#1161](https://github.com/Frontify/brand-sdk/pull/1161) [`aa17750`](https://github.com/Frontify/brand-sdk/commit/aa17750efa88b1e362ff05598bd761246fcb98b2) Thanks [@julianiff](https://github.com/julianiff)! - chore: update to latest app-bridge versions +- [#1161](https://github.com/Frontify/brand-sdk/pull/1161) [`aa17750`](https://github.com/Frontify/brand-sdk/commit/aa17750efa88b1e362ff05598bd761246fcb98b2) Thanks [@julianiff](https://github.com/julianiff)! - chore: update to latest app-bridge versions ## 5.8.3 ### Patch Changes -- [#1157](https://github.com/Frontify/brand-sdk/pull/1157) [`17eb433`](https://github.com/Frontify/brand-sdk/commit/17eb433a13247c217a048a05a7a0935e4fc77b1f) Thanks [@imoutaharik](https://github.com/imoutaharik)! - Small improvements generating gitignore files +- [#1157](https://github.com/Frontify/brand-sdk/pull/1157) [`17eb433`](https://github.com/Frontify/brand-sdk/commit/17eb433a13247c217a048a05a7a0935e4fc77b1f) Thanks [@imoutaharik](https://github.com/imoutaharik)! - Small improvements generating gitignore files ## 5.8.2 ### Patch Changes -- [#1151](https://github.com/Frontify/brand-sdk/pull/1151) [`3686e43`](https://github.com/Frontify/brand-sdk/commit/3686e438acebb661846bf3637cfefcf9c14bb5f1) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(templates): add zustand as peerdependency +- [#1151](https://github.com/Frontify/brand-sdk/pull/1151) [`3686e43`](https://github.com/Frontify/brand-sdk/commit/3686e438acebb661846bf3637cfefcf9c14bb5f1) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(templates): add zustand as peerdependency ## 5.8.1 ### Patch Changes -- [#1149](https://github.com/Frontify/brand-sdk/pull/1149) [`dab919f`](https://github.com/Frontify/brand-sdk/commit/dab919f9fb4e70255b097f69c22c8896d356c000) Thanks [@imoutaharik](https://github.com/imoutaharik)! - fix: gitignore file generated on every folder level +- [#1149](https://github.com/Frontify/brand-sdk/pull/1149) [`dab919f`](https://github.com/Frontify/brand-sdk/commit/dab919f9fb4e70255b097f69c22c8896d356c000) Thanks [@imoutaharik](https://github.com/imoutaharik)! - fix: gitignore file generated on every folder level ## 5.8.0 ### Minor Changes -- [#1139](https://github.com/Frontify/brand-sdk/pull/1139) [`17de2c8`](https://github.com/Frontify/brand-sdk/commit/17de2c8a6365ddd00c67072e336e8710a8d305d3) Thanks [@julianiff](https://github.com/julianiff)! - chore: remove experimental flag from create command +- [#1139](https://github.com/Frontify/brand-sdk/pull/1139) [`17de2c8`](https://github.com/Frontify/brand-sdk/commit/17de2c8a6365ddd00c67072e336e8710a8d305d3) Thanks [@julianiff](https://github.com/julianiff)! - chore: remove experimental flag from create command ### Patch Changes -- [#1141](https://github.com/Frontify/brand-sdk/pull/1141) [`9d3e830`](https://github.com/Frontify/brand-sdk/commit/9d3e830f9a35058c2507aa6587106ecb4ac72a5d) Thanks [@julianiff](https://github.com/julianiff)! - fix: update to be able to use strings +- [#1141](https://github.com/Frontify/brand-sdk/pull/1141) [`9d3e830`](https://github.com/Frontify/brand-sdk/commit/9d3e830f9a35058c2507aa6587106ecb4ac72a5d) Thanks [@julianiff](https://github.com/julianiff)! - fix: update to be able to use strings ## 5.7.11 ### Patch Changes -- [#1137](https://github.com/Frontify/brand-sdk/pull/1137) [`8823fcb`](https://github.com/Frontify/brand-sdk/commit/8823fcb84f658bcecbba89944173e4dae1963048) Thanks [@imoutaharik](https://github.com/imoutaharik)! - Add .gitignore file while creating an extension +- [#1137](https://github.com/Frontify/brand-sdk/pull/1137) [`8823fcb`](https://github.com/Frontify/brand-sdk/commit/8823fcb84f658bcecbba89944173e4dae1963048) Thanks [@imoutaharik](https://github.com/imoutaharik)! - Add .gitignore file while creating an extension ## 5.7.10 ### Patch Changes -- [#1134](https://github.com/Frontify/brand-sdk/pull/1134) [`d40385a`](https://github.com/Frontify/brand-sdk/commit/d40385a70168b566a4d41651b62c34b70bd16b79) Thanks [@julianiff](https://github.com/julianiff)! - feat: add assetBulkActions to manifest +- [#1134](https://github.com/Frontify/brand-sdk/pull/1134) [`d40385a`](https://github.com/Frontify/brand-sdk/commit/d40385a70168b566a4d41651b62c34b70bd16b79) Thanks [@julianiff](https://github.com/julianiff)! - feat: add assetBulkActions to manifest ## 5.7.9 ### Patch Changes -- [#1122](https://github.com/Frontify/brand-sdk/pull/1122) [`972ee33`](https://github.com/Frontify/brand-sdk/commit/972ee334da15cfe98c04d0ce8de87ea872b70408) Thanks [@julianiff](https://github.com/julianiff)! - feat: add guideline to verifier +- [#1122](https://github.com/Frontify/brand-sdk/pull/1122) [`972ee33`](https://github.com/Frontify/brand-sdk/commit/972ee334da15cfe98c04d0ce8de87ea872b70408) Thanks [@julianiff](https://github.com/julianiff)! - feat: add guideline to verifier -- [#1119](https://github.com/Frontify/brand-sdk/pull/1119) [`699aec3`](https://github.com/Frontify/brand-sdk/commit/699aec3fa7de03b5d0aa781e9ed09e61b79d7806) Thanks [@julianiff](https://github.com/julianiff)! - chore: update templates +- [#1119](https://github.com/Frontify/brand-sdk/pull/1119) [`699aec3`](https://github.com/Frontify/brand-sdk/commit/699aec3fa7de03b5d0aa781e9ed09e61b79d7806) Thanks [@julianiff](https://github.com/julianiff)! - chore: update templates ## 5.7.8 ### Patch Changes -- [#1112](https://github.com/Frontify/brand-sdk/pull/1112) [`e8a4286`](https://github.com/Frontify/brand-sdk/commit/e8a4286f09cd054e1bdfdc43ded09fe505c77cb4) Thanks [@julianiff](https://github.com/julianiff)! - chore(platform-apps): adjust CLI templates +- [#1112](https://github.com/Frontify/brand-sdk/pull/1112) [`e8a4286`](https://github.com/Frontify/brand-sdk/commit/e8a4286f09cd054e1bdfdc43ded09fe505c77cb4) Thanks [@julianiff](https://github.com/julianiff)! - chore(platform-apps): adjust CLI templates ## 5.7.7 ### Patch Changes -- [#1108](https://github.com/Frontify/brand-sdk/pull/1108) [`40ed6e8`](https://github.com/Frontify/brand-sdk/commit/40ed6e8e89a7cce7ced862ed9c53cf5576546bf8) Thanks [@julianiff](https://github.com/julianiff)! - feat: add scopes validator +- [#1108](https://github.com/Frontify/brand-sdk/pull/1108) [`40ed6e8`](https://github.com/Frontify/brand-sdk/commit/40ed6e8e89a7cce7ced862ed9c53cf5576546bf8) Thanks [@julianiff](https://github.com/julianiff)! - feat: add scopes validator ## 5.7.6 ### Patch Changes -- [#1101](https://github.com/Frontify/brand-sdk/pull/1101) [`db195d8`](https://github.com/Frontify/brand-sdk/commit/db195d840df78067d2be008b6686a22546fcbfb4) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.2.6` +- [#1101](https://github.com/Frontify/brand-sdk/pull/1101) [`db195d8`](https://github.com/Frontify/brand-sdk/commit/db195d840df78067d2be008b6686a22546fcbfb4) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.2.6` -- [#1100](https://github.com/Frontify/brand-sdk/pull/1100) [`e6a9db1`](https://github.com/Frontify/brand-sdk/commit/e6a9db1969b91f520521b83a61317515948bfa5e) Thanks [@julianiff](https://github.com/julianiff)! - chore: update templates +- [#1100](https://github.com/Frontify/brand-sdk/pull/1100) [`e6a9db1`](https://github.com/Frontify/brand-sdk/commit/e6a9db1969b91f520521b83a61317515948bfa5e) Thanks [@julianiff](https://github.com/julianiff)! - chore: update templates ## 5.7.5 ### Patch Changes -- [#1088](https://github.com/Frontify/brand-sdk/pull/1088) [`220e38e`](https://github.com/Frontify/brand-sdk/commit/220e38ee70a75284ded46dda81285e00df8e68f3) Thanks [@julianiff](https://github.com/julianiff)! - feat(PlatformApp): adjust build to be a folder +- [#1088](https://github.com/Frontify/brand-sdk/pull/1088) [`220e38e`](https://github.com/Frontify/brand-sdk/commit/220e38ee70a75284ded46dda81285e00df8e68f3) Thanks [@julianiff](https://github.com/julianiff)! - feat(PlatformApp): adjust build to be a folder ## 5.7.4 ### Patch Changes -- [#1002](https://github.com/Frontify/brand-sdk/pull/1002) [`1893f2f`](https://github.com/Frontify/brand-sdk/commit/1893f2fb6123d381c273ae774cd64d5c19eefed9) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add appBridgeTheme support +- [#1002](https://github.com/Frontify/brand-sdk/pull/1002) [`1893f2f`](https://github.com/Frontify/brand-sdk/commit/1893f2fb6123d381c273ae774cd64d5c19eefed9) Thanks [@anxobotana](https://github.com/anxobotana)! - feat: add appBridgeTheme support ## 5.7.3 ### Patch Changes -- [#1010](https://github.com/Frontify/brand-sdk/pull/1010) [`47883ea`](https://github.com/Frontify/brand-sdk/commit/47883ea7eb04599d91403ec32af58dff973942cb) Thanks [@julianiff](https://github.com/julianiff)! - chore: update platform app templates +- [#1010](https://github.com/Frontify/brand-sdk/pull/1010) [`47883ea`](https://github.com/Frontify/brand-sdk/commit/47883ea7eb04599d91403ec32af58dff973942cb) Thanks [@julianiff](https://github.com/julianiff)! - chore: update platform app templates ## 5.7.2 ### Patch Changes -- [#989](https://github.com/Frontify/brand-sdk/pull/989) [`9155ed9`](https://github.com/Frontify/brand-sdk/commit/9155ed91c27c1aa6830600d8cf8003be46fddd20) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(templates): add tailwind preset to template +- [#989](https://github.com/Frontify/brand-sdk/pull/989) [`9155ed9`](https://github.com/Frontify/brand-sdk/commit/9155ed91c27c1aa6830600d8cf8003be46fddd20) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(templates): add tailwind preset to template ## 5.7.1 ### Patch Changes -- [#968](https://github.com/Frontify/brand-sdk/pull/968) [`6d0c3dd`](https://github.com/Frontify/brand-sdk/commit/6d0c3dd22ffdf15d2c04b8fb6a57cef65e3f0001) Thanks [@julianiff](https://github.com/julianiff)! - chore: update templates +- [#968](https://github.com/Frontify/brand-sdk/pull/968) [`6d0c3dd`](https://github.com/Frontify/brand-sdk/commit/6d0c3dd22ffdf15d2c04b8fb6a57cef65e3f0001) Thanks [@julianiff](https://github.com/julianiff)! - chore: update templates ## 5.7.0 ### Minor Changes -- [#955](https://github.com/Frontify/brand-sdk/pull/955) [`739a7a5`](https://github.com/Frontify/brand-sdk/commit/739a7a51515b78f2732d486673c824166369fcfc) Thanks [@julianiff](https://github.com/julianiff)! - feat: add additional build step for platform Apps to also serve settings while in development mode +- [#955](https://github.com/Frontify/brand-sdk/pull/955) [`739a7a5`](https://github.com/Frontify/brand-sdk/commit/739a7a51515b78f2732d486673c824166369fcfc) Thanks [@julianiff](https://github.com/julianiff)! - feat: add additional build step for platform Apps to also serve settings while in development mode ## 5.6.19 ### Patch Changes -- [#945](https://github.com/Frontify/brand-sdk/pull/945) [`c095277`](https://github.com/Frontify/brand-sdk/commit/c0952770c001fb1ea4dc20996ff3c90ec2499d73) Thanks [@julianiff](https://github.com/julianiff)! - feat: add new property allowedHosts to manifest +- [#945](https://github.com/Frontify/brand-sdk/pull/945) [`c095277`](https://github.com/Frontify/brand-sdk/commit/c0952770c001fb1ea4dc20996ff3c90ec2499d73) Thanks [@julianiff](https://github.com/julianiff)! - feat: add new property allowedHosts to manifest -- [#943](https://github.com/Frontify/brand-sdk/pull/943) [`0814fc2`](https://github.com/Frontify/brand-sdk/commit/0814fc2aefbb69074a119a59ae3f16c1d8f8afd0) Thanks [@julianiff](https://github.com/julianiff)! - chore: bump dependency `@frontify/frontify-cli` to `^5.6.19`, `@frontify/fondue` to `^12.1.2`and `@frontify/app-bridge` to `4.0.0-alpha.29` for the templates . +- [#943](https://github.com/Frontify/brand-sdk/pull/943) [`0814fc2`](https://github.com/Frontify/brand-sdk/commit/0814fc2aefbb69074a119a59ae3f16c1d8f8afd0) Thanks [@julianiff](https://github.com/julianiff)! - chore: bump dependency `@frontify/frontify-cli` to `^5.6.19`, `@frontify/fondue` to `^12.1.2`and `@frontify/app-bridge` to `4.0.0-alpha.29` for the templates . ## 5.6.18 ### Patch Changes -- [#931](https://github.com/Frontify/brand-sdk/pull/931) [`a005421`](https://github.com/Frontify/brand-sdk/commit/a00542163dce5b4034af362bbc6aeb8e2ba86474) Thanks [@julianiff](https://github.com/julianiff)! - fix: change regex to be more restrictive +- [#931](https://github.com/Frontify/brand-sdk/pull/931) [`a005421`](https://github.com/Frontify/brand-sdk/commit/a00542163dce5b4034af362bbc6aeb8e2ba86474) Thanks [@julianiff](https://github.com/julianiff)! - fix: change regex to be more restrictive -- [#935](https://github.com/Frontify/brand-sdk/pull/935) [`3ca09bb`](https://github.com/Frontify/brand-sdk/commit/3ca09bb3b248a0ce27f49e8548821626ff609410) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: add `@type/node` in the platform app templates +- [#935](https://github.com/Frontify/brand-sdk/pull/935) [`3ca09bb`](https://github.com/Frontify/brand-sdk/commit/3ca09bb3b248a0ce27f49e8548821626ff609410) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: add `@type/node` in the platform app templates -- [#936](https://github.com/Frontify/brand-sdk/pull/936) [`b90ad75`](https://github.com/Frontify/brand-sdk/commit/b90ad75b7f196456358476f17a35e0c0959a788d) Thanks [@julianiff](https://github.com/julianiff)! - chore: Limit secret length +- [#936](https://github.com/Frontify/brand-sdk/pull/936) [`b90ad75`](https://github.com/Frontify/brand-sdk/commit/b90ad75b7f196456358476f17a35e0c0959a788d) Thanks [@julianiff](https://github.com/julianiff)! - chore: Limit secret length ## 5.6.17 ### Patch Changes -- [#907](https://github.com/Frontify/brand-sdk/pull/907) [`f824d37`](https://github.com/Frontify/brand-sdk/commit/f824d371ed6fb8f46a22ca39d2a8e211a9fb4ca8) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump `@frontify/fondue` to `12.0.10` +- [#907](https://github.com/Frontify/brand-sdk/pull/907) [`f824d37`](https://github.com/Frontify/brand-sdk/commit/f824d371ed6fb8f46a22ca39d2a8e211a9fb4ca8) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump `@frontify/fondue` to `12.0.10` ## 5.6.16 ### Patch Changes -- [#892](https://github.com/Frontify/brand-sdk/pull/892) [`fe3323c`](https://github.com/Frontify/brand-sdk/commit/fe3323ccb4c6b9c18bc5eee9564b3468e645fa4d) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `vite` to `5.2.10` +- [#892](https://github.com/Frontify/brand-sdk/pull/892) [`fe3323c`](https://github.com/Frontify/brand-sdk/commit/fe3323ccb4c6b9c18bc5eee9564b3468e645fa4d) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `vite` to `5.2.10` ## 5.6.15 ### Patch Changes -- [#890](https://github.com/Frontify/brand-sdk/pull/890) [`c7712e8`](https://github.com/Frontify/brand-sdk/commit/c7712e84ec90b6db1b23a23c56db63ed90d812bc) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.7` +- [#890](https://github.com/Frontify/brand-sdk/pull/890) [`c7712e8`](https://github.com/Frontify/brand-sdk/commit/c7712e84ec90b6db1b23a23c56db63ed90d812bc) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.7` ## 5.6.14 ### Patch Changes -- [#862](https://github.com/Frontify/brand-sdk/pull/862) [`d6f716d`](https://github.com/Frontify/brand-sdk/commit/d6f716d759841e9fa5f0cc08526f65fb210f557e) Thanks [@julianiff](https://github.com/julianiff)! - feat: add secret and endpoint restrictions +- [#862](https://github.com/Frontify/brand-sdk/pull/862) [`d6f716d`](https://github.com/Frontify/brand-sdk/commit/d6f716d759841e9fa5f0cc08526f65fb210f557e) Thanks [@julianiff](https://github.com/julianiff)! - feat: add secret and endpoint restrictions ## 5.6.13 ### Patch Changes -- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies in CLI and templates +- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies in CLI and templates -- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update eslint and lint fix all files +- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update eslint and lint fix all files -- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: add `type: module` for ESM +- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - feat: add `type: module` for ESM -- [#857](https://github.com/Frontify/brand-sdk/pull/857) [`7d818d8`](https://github.com/Frontify/brand-sdk/commit/7d818d88eb5b18da2015c3a9f823350e507be3be) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.0-beta.427` +- [#857](https://github.com/Frontify/brand-sdk/pull/857) [`7d818d8`](https://github.com/Frontify/brand-sdk/commit/7d818d88eb5b18da2015c3a9f823350e507be3be) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.0-beta.427` -- [#855](https://github.com/Frontify/brand-sdk/pull/855) [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump dependencies +- [#855](https://github.com/Frontify/brand-sdk/pull/855) [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump dependencies ## 5.6.12 ### Patch Changes -- [#846](https://github.com/Frontify/brand-sdk/pull/846) [`137605b`](https://github.com/Frontify/brand-sdk/commit/137605b4600bf2b8dbb1cc3921cef8f948936704) Thanks [@julianiff](https://github.com/julianiff)! - fix: update naming to fit network endpoints naming +- [#846](https://github.com/Frontify/brand-sdk/pull/846) [`137605b`](https://github.com/Frontify/brand-sdk/commit/137605b4600bf2b8dbb1cc3921cef8f948936704) Thanks [@julianiff](https://github.com/julianiff)! - fix: update naming to fit network endpoints naming ## 5.6.11 ### Patch Changes -- [#827](https://github.com/Frontify/brand-sdk/pull/827) [`f3a7dc2`](https://github.com/Frontify/brand-sdk/commit/f3a7dc24090fec27ee2d5a780131bc1a2feb2d24) Thanks [@ragi96](https://github.com/ragi96)! - feat: adds validator for the proxyNetworkCall +- [#827](https://github.com/Frontify/brand-sdk/pull/827) [`f3a7dc2`](https://github.com/Frontify/brand-sdk/commit/f3a7dc24090fec27ee2d5a780131bc1a2feb2d24) Thanks [@ragi96](https://github.com/ragi96)! - feat: adds validator for the proxyNetworkCall ## 5.6.10 ### Patch Changes -- [#812](https://github.com/Frontify/brand-sdk/pull/812) [`67b5ca1`](https://github.com/Frontify/brand-sdk/commit/67b5ca134b86ccddd0d2ab8a36b5b08261a4d9b3) Thanks [@julianiff](https://github.com/julianiff)! - feat: add manifest secret key validator +- [#812](https://github.com/Frontify/brand-sdk/pull/812) [`67b5ca1`](https://github.com/Frontify/brand-sdk/commit/67b5ca134b86ccddd0d2ab8a36b5b08261a4d9b3) Thanks [@julianiff](https://github.com/julianiff)! - feat: add manifest secret key validator -- [#815](https://github.com/Frontify/brand-sdk/pull/815) [`17491e9`](https://github.com/Frontify/brand-sdk/commit/17491e923d9b66d158ee03003b3ac47899e6423f) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to 12.0.0-beta.415 +- [#815](https://github.com/Frontify/brand-sdk/pull/815) [`17491e9`](https://github.com/Frontify/brand-sdk/commit/17491e923d9b66d158ee03003b3ac47899e6423f) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to 12.0.0-beta.415 ## 5.6.9 ### Patch Changes -- [#803](https://github.com/Frontify/brand-sdk/pull/803) [`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to ^12.0.0-beta.411 +- [#803](https://github.com/Frontify/brand-sdk/pull/803) [`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to ^12.0.0-beta.411 ## 5.6.8 ### Patch Changes -- [#800](https://github.com/Frontify/brand-sdk/pull/800) [`7e83e75`](https://github.com/Frontify/brand-sdk/commit/7e83e75243fdbfc5379be3bdf15c210039c4459c) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to 12.0.0-beta.410 +- [#800](https://github.com/Frontify/brand-sdk/pull/800) [`7e83e75`](https://github.com/Frontify/brand-sdk/commit/7e83e75243fdbfc5379be3bdf15c210039c4459c) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to 12.0.0-beta.410 ## 5.6.7 ### Patch Changes -- [#796](https://github.com/Frontify/brand-sdk/pull/796) [`d24dcf3`](https://github.com/Frontify/brand-sdk/commit/d24dcf3fd78a871229e64b82690084ccfbd521ce) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue +- [#796](https://github.com/Frontify/brand-sdk/pull/796) [`d24dcf3`](https://github.com/Frontify/brand-sdk/commit/d24dcf3fd78a871229e64b82690084ccfbd521ce) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue ## 5.6.6 ### Patch Changes -- [#750](https://github.com/Frontify/brand-sdk/pull/750) [`8b4ded2`](https://github.com/Frontify/brand-sdk/commit/8b4ded214bd781c5aa3c917121bc013f4262da32) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue +- [#750](https://github.com/Frontify/brand-sdk/pull/750) [`8b4ded2`](https://github.com/Frontify/brand-sdk/commit/8b4ded214bd781c5aa3c917121bc013f4262da32) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue ## 5.6.5 ### Patch Changes -- [`de53c69`](https://github.com/Frontify/brand-sdk/commit/de53c69b43e3f0a9b245cc2b193d6edef390dc00) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix broken build produced in `dev` branch +- [`de53c69`](https://github.com/Frontify/brand-sdk/commit/de53c69b43e3f0a9b245cc2b193d6edef390dc00) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix broken build produced in `dev` branch ## 5.6.4 ### Patch Changes -- [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [#788](https://github.com/Frontify/brand-sdk/pull/788) [`db5151e`](https://github.com/Frontify/brand-sdk/commit/db5151eccbee139fc086ad7d34b7ef832095bb2f) Thanks [@ragi96](https://github.com/ragi96)! - Fix: adjust templates +- [#788](https://github.com/Frontify/brand-sdk/pull/788) [`db5151e`](https://github.com/Frontify/brand-sdk/commit/db5151eccbee139fc086ad7d34b7ef832095bb2f) Thanks [@ragi96](https://github.com/ragi96)! - Fix: adjust templates ## 5.6.3 ### Patch Changes -- [#766](https://github.com/Frontify/brand-sdk/pull/766) [`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [#766](https://github.com/Frontify/brand-sdk/pull/766) [`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.6.2 ### Patch Changes -- [#760](https://github.com/Frontify/brand-sdk/pull/760) [`6493f06`](https://github.com/Frontify/brand-sdk/commit/6493f06b934f2ea815fadda3aaf74a7ee76ec60c) Thanks [@julianiff](https://github.com/julianiff)! - chore: update sample apps +- [#760](https://github.com/Frontify/brand-sdk/pull/760) [`6493f06`](https://github.com/Frontify/brand-sdk/commit/6493f06b934f2ea815fadda3aaf74a7ee76ec60c) Thanks [@julianiff](https://github.com/julianiff)! - chore: update sample apps ## 5.6.1 ### Patch Changes -- [#732](https://github.com/Frontify/brand-sdk/pull/732) [`8395479`](https://github.com/Frontify/brand-sdk/commit/83954793533e63a67ee02cb94f24095cd4119e36) Thanks [@julianiff](https://github.com/julianiff)! - feat: adjust serve and compile command +- [#732](https://github.com/Frontify/brand-sdk/pull/732) [`8395479`](https://github.com/Frontify/brand-sdk/commit/83954793533e63a67ee02cb94f24095cd4119e36) Thanks [@julianiff](https://github.com/julianiff)! - feat: adjust serve and compile command ## 5.6.0 ### Minor Changes -- [#724](https://github.com/Frontify/brand-sdk/pull/724) [`b6c65ba`](https://github.com/Frontify/brand-sdk/commit/b6c65bafa134d8de07fbf990f27462f3005ea744) Thanks [@floriangaechter](https://github.com/floriangaechter)! - feat: add the option to deploy with token - - `-i, --instance `: url of the Frontify instance - - `-t, --token `: the access token to authenticate with the Frontify instance +- [#724](https://github.com/Frontify/brand-sdk/pull/724) [`b6c65ba`](https://github.com/Frontify/brand-sdk/commit/b6c65bafa134d8de07fbf990f27462f3005ea744) Thanks [@floriangaechter](https://github.com/floriangaechter)! - feat: add the option to deploy with token + - `-i, --instance `: url of the Frontify instance + - `-t, --token `: the access token to authenticate with the Frontify instance ### Patch Changes -- [#719](https://github.com/Frontify/brand-sdk/pull/719) [`4a676dc`](https://github.com/Frontify/brand-sdk/commit/4a676dcccc90dd56ba63cc75b97eea03b534177e) Thanks [@floriangaechter](https://github.com/floriangaechter)! - fix: Path handling on windows +- [#719](https://github.com/Frontify/brand-sdk/pull/719) [`4a676dc`](https://github.com/Frontify/brand-sdk/commit/4a676dcccc90dd56ba63cc75b97eea03b534177e) Thanks [@floriangaechter](https://github.com/floriangaechter)! - fix: Path handling on windows -- [#726](https://github.com/Frontify/brand-sdk/pull/726) [`935c591`](https://github.com/Frontify/brand-sdk/commit/935c591b83865e3a4eaa5bab472861d6a5656a4d) Thanks [@ragi96](https://github.com/ragi96)! - fix: nested template literals and also some typos +- [#726](https://github.com/Frontify/brand-sdk/pull/726) [`935c591`](https://github.com/Frontify/brand-sdk/commit/935c591b83865e3a4eaa5bab472861d6a5656a4d) Thanks [@ragi96](https://github.com/ragi96)! - fix: nested template literals and also some typos ## 5.5.9 ### Patch Changes -- [#701](https://github.com/Frontify/brand-sdk/pull/701) [`a84f65c`](https://github.com/Frontify/brand-sdk/commit/a84f65c16678bf8fae07416971e0262aadd230dc) Thanks [@julianiff](https://github.com/julianiff)! - feat: add title to manifest.json of platform Apps +- [#701](https://github.com/Frontify/brand-sdk/pull/701) [`a84f65c`](https://github.com/Frontify/brand-sdk/commit/a84f65c16678bf8fae07416971e0262aadd230dc) Thanks [@julianiff](https://github.com/julianiff)! - feat: add title to manifest.json of platform Apps ## 5.5.8 ### Patch Changes -- [#676](https://github.com/Frontify/brand-sdk/pull/676) [`e6e2abd`](https://github.com/Frontify/brand-sdk/commit/e6e2abd0050c81ebff79e282e23c1fcf45ee4aea) Thanks [@julianiff](https://github.com/julianiff)! - chore: update cli version of templates +- [#676](https://github.com/Frontify/brand-sdk/pull/676) [`e6e2abd`](https://github.com/Frontify/brand-sdk/commit/e6e2abd0050c81ebff79e282e23c1fcf45ee4aea) Thanks [@julianiff](https://github.com/julianiff)! - chore: update cli version of templates ## 5.5.7 ### Patch Changes -- [#674](https://github.com/Frontify/brand-sdk/pull/674) [`d7385ea`](https://github.com/Frontify/brand-sdk/commit/d7385ea6ff2c034e47b5d9727eae73600522bb2f) Thanks [@julianiff](https://github.com/julianiff)! - chore: update manifest +- [#674](https://github.com/Frontify/brand-sdk/pull/674) [`d7385ea`](https://github.com/Frontify/brand-sdk/commit/d7385ea6ff2c034e47b5d9727eae73600522bb2f) Thanks [@julianiff](https://github.com/julianiff)! - chore: update manifest -- [#670](https://github.com/Frontify/brand-sdk/pull/670) [`f28dd67`](https://github.com/Frontify/brand-sdk/commit/f28dd67dd2d5058a10e8420252ba213a1d3d62cd) Thanks [@julianiff](https://github.com/julianiff)! - chore: add optional to assetAction +- [#670](https://github.com/Frontify/brand-sdk/pull/670) [`f28dd67`](https://github.com/Frontify/brand-sdk/commit/f28dd67dd2d5058a10e8420252ba213a1d3d62cd) Thanks [@julianiff](https://github.com/julianiff)! - chore: add optional to assetAction -- [#673](https://github.com/Frontify/brand-sdk/pull/673) [`1bd6524`](https://github.com/Frontify/brand-sdk/commit/1bd6524a9b7b9021d1173c16f984c7944a628867) Thanks [@julianiff](https://github.com/julianiff)! - chore: change naming to workspace +- [#673](https://github.com/Frontify/brand-sdk/pull/673) [`1bd6524`](https://github.com/Frontify/brand-sdk/commit/1bd6524a9b7b9021d1173c16f984c7944a628867) Thanks [@julianiff](https://github.com/julianiff)! - chore: change naming to workspace ## 5.5.6 ### Patch Changes -- [#668](https://github.com/Frontify/brand-sdk/pull/668) [`e8bf308`](https://github.com/Frontify/brand-sdk/commit/e8bf308262124356a0d13b8bf251fb208de7f19f) Thanks [@julianiff](https://github.com/julianiff)! - chore: fix css and js filename exchanged +- [#668](https://github.com/Frontify/brand-sdk/pull/668) [`e8bf308`](https://github.com/Frontify/brand-sdk/commit/e8bf308262124356a0d13b8bf251fb208de7f19f) Thanks [@julianiff](https://github.com/julianiff)! - chore: fix css and js filename exchanged ## 5.5.5 ### Patch Changes -- [#664](https://github.com/Frontify/brand-sdk/pull/664) [`5cf77ee`](https://github.com/Frontify/brand-sdk/commit/5cf77eefad4fceea1baed23cd5750c4d95fd91cc) Thanks [@julianiff](https://github.com/julianiff)! - fix: platform app compiler +- [#664](https://github.com/Frontify/brand-sdk/pull/664) [`5cf77ee`](https://github.com/Frontify/brand-sdk/commit/5cf77eefad4fceea1baed23cd5750c4d95fd91cc) Thanks [@julianiff](https://github.com/julianiff)! - fix: platform app compiler ## 5.5.4 ### Patch Changes -- [#645](https://github.com/Frontify/brand-sdk/pull/645) [`0e34987`](https://github.com/Frontify/brand-sdk/commit/0e349871c67c8c5260c6456af1af2aec58ab6e2e) Thanks [@julianiff](https://github.com/julianiff)! - feat: add manifest verification step +- [#645](https://github.com/Frontify/brand-sdk/pull/645) [`0e34987`](https://github.com/Frontify/brand-sdk/commit/0e349871c67c8c5260c6456af1af2aec58ab6e2e) Thanks [@julianiff](https://github.com/julianiff)! - feat: add manifest verification step ## 5.5.3 ### Patch Changes -- [#642](https://github.com/Frontify/brand-sdk/pull/642) [`913e697`](https://github.com/Frontify/brand-sdk/commit/913e697be0e37e734cf098cca41803ee86307cbf) Thanks [@julianiff](https://github.com/julianiff)! - chore: move into common create folder +- [#642](https://github.com/Frontify/brand-sdk/pull/642) [`913e697`](https://github.com/Frontify/brand-sdk/commit/913e697be0e37e734cf098cca41803ee86307cbf) Thanks [@julianiff](https://github.com/julianiff)! - chore: move into common create folder ## 5.5.2 ### Patch Changes -- [#621](https://github.com/Frontify/brand-sdk/pull/621) [`e86676e`](https://github.com/Frontify/brand-sdk/commit/e86676e98cb8e1f35205804069b2a9a8ac1f69aa) Thanks [@ragi96](https://github.com/ragi96)! - chore: templates using stable version of app-bridge +- [#621](https://github.com/Frontify/brand-sdk/pull/621) [`e86676e`](https://github.com/Frontify/brand-sdk/commit/e86676e98cb8e1f35205804069b2a9a8ac1f69aa) Thanks [@ragi96](https://github.com/ragi96)! - chore: templates using stable version of app-bridge -- [#636](https://github.com/Frontify/brand-sdk/pull/636) [`1dbc48e`](https://github.com/Frontify/brand-sdk/commit/1dbc48e9b8421a893d0b2da8f17ac201abc2b113) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [#636](https://github.com/Frontify/brand-sdk/pull/636) [`1dbc48e`](https://github.com/Frontify/brand-sdk/commit/1dbc48e9b8421a893d0b2da8f17ac201abc2b113) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.5.1 ### Patch Changes -- [#630](https://github.com/Frontify/brand-sdk/pull/630) [`d5635c2`](https://github.com/Frontify/brand-sdk/commit/d5635c2fa24a39d09e62708674888de27dade290) Thanks [@floriangaechter](https://github.com/floriangaechter)! - Show more information when login fails +- [#630](https://github.com/Frontify/brand-sdk/pull/630) [`d5635c2`](https://github.com/Frontify/brand-sdk/commit/d5635c2fa24a39d09e62708674888de27dade290) Thanks [@floriangaechter](https://github.com/floriangaechter)! - Show more information when login fails ## 5.5.0 ### Minor Changes -- [#623](https://github.com/Frontify/brand-sdk/pull/623) [`22b7a0b`](https://github.com/Frontify/brand-sdk/commit/22b7a0b007981fac0c1b3d838a644232acc21e85) Thanks [@ragi96](https://github.com/ragi96)! - feat: adds the appBridge version to the block bundle +- [#623](https://github.com/Frontify/brand-sdk/pull/623) [`22b7a0b`](https://github.com/Frontify/brand-sdk/commit/22b7a0b007981fac0c1b3d838a644232acc21e85) Thanks [@ragi96](https://github.com/ragi96)! - feat: adds the appBridge version to the block bundle ## 5.4.1 ### Patch Changes -- [#607](https://github.com/Frontify/brand-sdk/pull/607) [`e3ea35d`](https://github.com/Frontify/brand-sdk/commit/e3ea35dc3c3433b5d09712463534b681eef718f9) Thanks [@julianiff](https://github.com/julianiff)! - chore: update app-bridge version +- [#607](https://github.com/Frontify/brand-sdk/pull/607) [`e3ea35d`](https://github.com/Frontify/brand-sdk/commit/e3ea35dc3c3433b5d09712463534b681eef718f9) Thanks [@julianiff](https://github.com/julianiff)! - chore: update app-bridge version -- [#610](https://github.com/Frontify/brand-sdk/pull/610) [`49958e4`](https://github.com/Frontify/brand-sdk/commit/49958e4c1fb7caef2ea2394fef0966625f6e4804) Thanks [@ragi96](https://github.com/ragi96)! - fix: never ignore manifest.json on deploy" +- [#610](https://github.com/Frontify/brand-sdk/pull/610) [`49958e4`](https://github.com/Frontify/brand-sdk/commit/49958e4c1fb7caef2ea2394fef0966625f6e4804) Thanks [@ragi96](https://github.com/ragi96)! - fix: never ignore manifest.json on deploy" -- [#608](https://github.com/Frontify/brand-sdk/pull/608) [`6659cbf`](https://github.com/Frontify/brand-sdk/commit/6659cbff1e6d84809cb6637e08b2960ad7d4d315) Thanks [@julianiff](https://github.com/julianiff)! - chore: update frontify-cli in templates +- [#608](https://github.com/Frontify/brand-sdk/pull/608) [`6659cbf`](https://github.com/Frontify/brand-sdk/commit/6659cbff1e6d84809cb6637e08b2960ad7d4d315) Thanks [@julianiff](https://github.com/julianiff)! - chore: update frontify-cli in templates -- [#614](https://github.com/Frontify/brand-sdk/pull/614) [`b571cbf`](https://github.com/Frontify/brand-sdk/commit/b571cbf86a0d0ebc47aead17bb51edc407dd3196) Thanks [@floriangaechter](https://github.com/floriangaechter)! - Fix: move eslint ignore information to .eslintrc and fix a typo +- [#614](https://github.com/Frontify/brand-sdk/pull/614) [`b571cbf`](https://github.com/Frontify/brand-sdk/commit/b571cbf86a0d0ebc47aead17bb51edc407dd3196) Thanks [@floriangaechter](https://github.com/floriangaechter)! - Fix: move eslint ignore information to .eslintrc and fix a typo -- [#615](https://github.com/Frontify/brand-sdk/pull/615) [`d68cabc`](https://github.com/Frontify/brand-sdk/commit/d68cabcc7a6b95ad5194ae374779d1ef10dcc130) Thanks [@julianiff](https://github.com/julianiff)! - chore: change from dev to serve +- [#615](https://github.com/Frontify/brand-sdk/pull/615) [`d68cabc`](https://github.com/Frontify/brand-sdk/commit/d68cabcc7a6b95ad5194ae374779d1ef10dcc130) Thanks [@julianiff](https://github.com/julianiff)! - chore: change from dev to serve ## 5.4.0 ### Minor Changes -- [#600](https://github.com/Frontify/brand-sdk/pull/600) [`4599249`](https://github.com/Frontify/brand-sdk/commit/45992493e16789688e3447fe0cf1d2feb9f3fcea) Thanks [@julianiff](https://github.com/julianiff)! - feat: add platform App cli deploy command +- [#600](https://github.com/Frontify/brand-sdk/pull/600) [`4599249`](https://github.com/Frontify/brand-sdk/commit/45992493e16789688e3447fe0cf1d2feb9f3fcea) Thanks [@julianiff](https://github.com/julianiff)! - feat: add platform App cli deploy command -- [#596](https://github.com/Frontify/brand-sdk/pull/596) [`e3a7a94`](https://github.com/Frontify/brand-sdk/commit/e3a7a942a5c77e57525c7f232156811b9115cbf4) Thanks [@julianiff](https://github.com/julianiff)! - feat: add platform app to CLI and add a sample-app +- [#596](https://github.com/Frontify/brand-sdk/pull/596) [`e3a7a94`](https://github.com/Frontify/brand-sdk/commit/e3a7a942a5c77e57525c7f232156811b9115cbf4) Thanks [@julianiff](https://github.com/julianiff)! - feat: add platform app to CLI and add a sample-app ### Patch Changes -- [#604](https://github.com/Frontify/brand-sdk/pull/604) [`bec5207`](https://github.com/Frontify/brand-sdk/commit/bec52077c52a9c03648274e5ea3caf2eac5f7c45) Thanks [@floriangaechter](https://github.com/floriangaechter)! - Fix deprecated dropdown types in templates +- [#604](https://github.com/Frontify/brand-sdk/pull/604) [`bec5207`](https://github.com/Frontify/brand-sdk/commit/bec52077c52a9c03648274e5ea3caf2eac5f7c45) Thanks [@floriangaechter](https://github.com/floriangaechter)! - Fix deprecated dropdown types in templates -- [#599](https://github.com/Frontify/brand-sdk/pull/599) [`6332d4e`](https://github.com/Frontify/brand-sdk/commit/6332d4e64cd30ac1dbb38c24cf14cebfc5e62820) Thanks [@julianiff](https://github.com/julianiff)! - feat: add flag to run serve as a platformApp +- [#599](https://github.com/Frontify/brand-sdk/pull/599) [`6332d4e`](https://github.com/Frontify/brand-sdk/commit/6332d4e64cd30ac1dbb38c24cf14cebfc5e62820) Thanks [@julianiff](https://github.com/julianiff)! - feat: add flag to run serve as a platformApp ## 5.3.17 ### Patch Changes -- [`3c1e752`](https://github.com/Frontify/brand-sdk/commit/3c1e7520967c5055c944a0f1afe6b41e046dcdd8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`3c1e752`](https://github.com/Frontify/brand-sdk/commit/3c1e7520967c5055c944a0f1afe6b41e046dcdd8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.16 ### Patch Changes -- [`22684e3`](https://github.com/Frontify/brand-sdk/commit/22684e358fd2b073790a0959606c6a5d44e35c4e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`22684e3`](https://github.com/Frontify/brand-sdk/commit/22684e358fd2b073790a0959606c6a5d44e35c4e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.15 ### Patch Changes -- [`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.14 ### Patch Changes -- [`af7d797`](https://github.com/Frontify/brand-sdk/commit/af7d797e12d66c8af60df70c8bf9505f3459cd1f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`af7d797`](https://github.com/Frontify/brand-sdk/commit/af7d797e12d66c8af60df70c8bf9505f3459cd1f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [#467](https://github.com/Frontify/brand-sdk/pull/467) [`7f4717f`](https://github.com/Frontify/brand-sdk/commit/7f4717f62cbb3a0904dfd91fcf809bb14e1e8b20) Thanks [@floriangaechter](https://github.com/floriangaechter)! - feat: add info message in case browser window couldn't be opened automatically +- [#467](https://github.com/Frontify/brand-sdk/pull/467) [`7f4717f`](https://github.com/Frontify/brand-sdk/commit/7f4717f62cbb3a0904dfd91fcf809bb14e1e8b20) Thanks [@floriangaechter](https://github.com/floriangaechter)! - feat: add info message in case browser window couldn't be opened automatically ## 5.3.13 ### Patch Changes -- [`4b9ea6a`](https://github.com/Frontify/brand-sdk/commit/4b9ea6a27b787d0282eb11dc70cece1c597f8b65) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update templates dependencies +- [`4b9ea6a`](https://github.com/Frontify/brand-sdk/commit/4b9ea6a27b787d0282eb11dc70cece1c597f8b65) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update templates dependencies ## 5.3.12 ### Patch Changes -- [`caecf03`](https://github.com/Frontify/brand-sdk/commit/caecf03ffd52a07cd1c846f4a99f9736fef76b76) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`caecf03`](https://github.com/Frontify/brand-sdk/commit/caecf03ffd52a07cd1c846f4a99f9736fef76b76) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`4c88c23`](https://github.com/Frontify/brand-sdk/commit/4c88c23a261e3cd1837cdd70d9e96062ce1a5a4b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies in templates +- [`4c88c23`](https://github.com/Frontify/brand-sdk/commit/4c88c23a261e3cd1837cdd70d9e96062ce1a5a4b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies in templates -- [`2179c95`](https://github.com/Frontify/brand-sdk/commit/2179c95e787d89d1e75671d394b4dde61673638d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update App Bridge +- [`2179c95`](https://github.com/Frontify/brand-sdk/commit/2179c95e787d89d1e75671d394b4dde61673638d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update App Bridge ## 5.3.11 ### Patch Changes -- [`57228f5`](https://github.com/Frontify/brand-sdk/commit/57228f557c20f2a2a291ecabc560a8e7c1bb0e41) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update deps +- [`57228f5`](https://github.com/Frontify/brand-sdk/commit/57228f557c20f2a2a291ecabc560a8e7c1bb0e41) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update deps ## 5.3.10 ### Patch Changes -- [`c38bfa8`](https://github.com/Frontify/brand-sdk/commit/c38bfa8fa65170ea56d078abcfecbadc2167b39b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update deps template and remove lock file +- [`c38bfa8`](https://github.com/Frontify/brand-sdk/commit/c38bfa8fa65170ea56d078abcfecbadc2167b39b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update deps template and remove lock file -- [`c38bfa8`](https://github.com/Frontify/brand-sdk/commit/c38bfa8fa65170ea56d078abcfecbadc2167b39b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix use correct package name +- [`c38bfa8`](https://github.com/Frontify/brand-sdk/commit/c38bfa8fa65170ea56d078abcfecbadc2167b39b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix use correct package name -- [`440e463`](https://github.com/Frontify/brand-sdk/commit/440e463326fb55dabc28dba346e1ec2e6ee03450) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`440e463`](https://github.com/Frontify/brand-sdk/commit/440e463326fb55dabc28dba346e1ec2e6ee03450) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.9 ### Patch Changes -- [`f6fcc6e`](https://github.com/Frontify/brand-sdk/commit/f6fcc6ec3a4bd56ae8c43718079d5d78dc755a9f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`f6fcc6e`](https://github.com/Frontify/brand-sdk/commit/f6fcc6ec3a4bd56ae8c43718079d5d78dc755a9f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`bc9c16c`](https://github.com/Frontify/brand-sdk/commit/bc9c16c69ca26eb8c87edd6eeb559fc050d52a31) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Typos in errors +- [`bc9c16c`](https://github.com/Frontify/brand-sdk/commit/bc9c16c69ca26eb8c87edd6eeb559fc050d52a31) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Typos in errors -- [`f0efea8`](https://github.com/Frontify/brand-sdk/commit/f0efea87d161f9e6cda668399d4bd7420303fe5a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Error message when deploying and not logged in +- [`f0efea8`](https://github.com/Frontify/brand-sdk/commit/f0efea87d161f9e6cda668399d4bd7420303fe5a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Error message when deploying and not logged in ## 5.3.8 ### Patch Changes -- [`b334c60`](https://github.com/Frontify/brand-sdk/commit/b334c60c33900a65739686d5c581c36fbcfe8498) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`b334c60`](https://github.com/Frontify/brand-sdk/commit/b334c60c33900a65739686d5c581c36fbcfe8498) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.7 ### Patch Changes -- [`787f147`](https://github.com/Frontify/brand-sdk/commit/787f147fa56ad16c53da68061632936d6756276e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update `vite-plugin-externals` because of broken exports +- [`787f147`](https://github.com/Frontify/brand-sdk/commit/787f147fa56ad16c53da68061632936d6756276e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update `vite-plugin-externals` because of broken exports -- [#335](https://github.com/Frontify/brand-sdk/pull/335) [`8d692d1`](https://github.com/Frontify/brand-sdk/commit/8d692d16594f4c2fcd2c5db6dd71c2b6946eecb7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix path issue on Windows when deploying the app +- [#335](https://github.com/Frontify/brand-sdk/pull/335) [`8d692d1`](https://github.com/Frontify/brand-sdk/commit/8d692d16594f4c2fcd2c5db6dd71c2b6946eecb7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix path issue on Windows when deploying the app -- [`10b2d28`](https://github.com/Frontify/brand-sdk/commit/10b2d2875170c57c5f8bdc155a1589ef4e1a57fd) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Improve Http Client error handling +- [`10b2d28`](https://github.com/Frontify/brand-sdk/commit/10b2d2875170c57c5f8bdc155a1589ef4e1a57fd) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Improve Http Client error handling -- [`528f81b`](https://github.com/Frontify/brand-sdk/commit/528f81bc02c36157c7e77971102f68e31f27714b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Remove extra css module file in tailwind template +- [`528f81b`](https://github.com/Frontify/brand-sdk/commit/528f81bc02c36157c7e77971102f68e31f27714b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Remove extra css module file in tailwind template -- [`c1275a6`](https://github.com/Frontify/brand-sdk/commit/c1275a6c094cb0ca3567d7fd7e3d01e258f2b09f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update errors messages +- [`c1275a6`](https://github.com/Frontify/brand-sdk/commit/c1275a6c094cb0ca3567d7fd7e3d01e258f2b09f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update errors messages -- [`60627d5`](https://github.com/Frontify/brand-sdk/commit/60627d51ce04645b3df72d8b0dff281675bd6508) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Use module resolution `node16` +- [`60627d5`](https://github.com/Frontify/brand-sdk/commit/60627d51ce04645b3df72d8b0dff281675bd6508) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Use module resolution `node16` -- [`0198626`](https://github.com/Frontify/brand-sdk/commit/0198626b9d8e49f31d861a05e15ca6e59d349b59) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`0198626`](https://github.com/Frontify/brand-sdk/commit/0198626b9d8e49f31d861a05e15ca6e59d349b59) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.6 ### Patch Changes -- [`b9a3f51`](https://github.com/Frontify/brand-sdk/commit/b9a3f513c957a0fd604d926d87fe221af2337681) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`b9a3f51`](https://github.com/Frontify/brand-sdk/commit/b9a3f513c957a0fd604d926d87fe221af2337681) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`45653fa`](https://github.com/Frontify/brand-sdk/commit/45653faaf4168517ccbb3a9775bbf88871149692) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`45653fa`](https://github.com/Frontify/brand-sdk/commit/45653faaf4168517ccbb3a9775bbf88871149692) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.5 ### Patch Changes -- [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.4 ### Patch Changes -- [#299](https://github.com/Frontify/brand-sdk/pull/299) [`187466a`](https://github.com/Frontify/brand-sdk/commit/187466ae50c08f4abf5d0b257951ccf083d6344d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update to Vite 4 and TS 4.9 +- [#299](https://github.com/Frontify/brand-sdk/pull/299) [`187466a`](https://github.com/Frontify/brand-sdk/commit/187466ae50c08f4abf5d0b257951ccf083d6344d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update to Vite 4 and TS 4.9 -- [`e47c574`](https://github.com/Frontify/brand-sdk/commit/e47c5747ab1041a62dc880fa92436b8ab464bfef) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`e47c574`](https://github.com/Frontify/brand-sdk/commit/e47c5747ab1041a62dc880fa92436b8ab464bfef) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.3 ### Patch Changes -- [`4063217`](https://github.com/Frontify/brand-sdk/commit/4063217a946f0896f7dd3aacbc0b21f4c355b21c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`4063217`](https://github.com/Frontify/brand-sdk/commit/4063217a946f0896f7dd3aacbc0b21f4c355b21c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies ## 5.3.2 ### Patch Changes -- [`6637b3d`](https://github.com/Frontify/brand-sdk/commit/6637b3d8ca27680007d8078095c72ae3b83660ae) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix `block create` command +- [`6637b3d`](https://github.com/Frontify/brand-sdk/commit/6637b3d8ca27680007d8078095c72ae3b83660ae) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix `block create` command -- [`a03d515`](https://github.com/Frontify/brand-sdk/commit/a03d515bef69d2f7aff64bc56bcdc89f3e90fcd9) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update templates dependencies +- [`a03d515`](https://github.com/Frontify/brand-sdk/commit/a03d515bef69d2f7aff64bc56bcdc89f3e90fcd9) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update templates dependencies ## 5.3.1 ### Patch Changes -- [`b3ded3b`](https://github.com/Frontify/brand-sdk/commit/b3ded3b5c3d9ea036008fb09bca96e89fdc94598) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Aligned templates to the same example +- [`b3ded3b`](https://github.com/Frontify/brand-sdk/commit/b3ded3b5c3d9ea036008fb09bca96e89fdc94598) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Aligned templates to the same example -- [`40e4285`](https://github.com/Frontify/brand-sdk/commit/40e428512b5eecd82a6d31adf40f5f53c0025994) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update templates package json +- [`40e4285`](https://github.com/Frontify/brand-sdk/commit/40e428512b5eecd82a6d31adf40f5f53c0025994) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update templates package json ## 5.3.0 ### Minor Changes - -- [#274](https://github.com/Frontify/frontify-cli/pull/274) [`c0095fc`](https://github.com/Frontify/frontify-cli/commit/c0095fc46d5dd95e7fd91779be586756f3a7dc0e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add template to CLI creation +- [#274](https://github.com/Frontify/frontify-cli/pull/274) [`c0095fc`](https://github.com/Frontify/frontify-cli/commit/c0095fc46d5dd95e7fd91779be586756f3a7dc0e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add template to CLI creation diff --git a/packages/guideline-blocks-settings/CHANGELOG.md b/packages/guideline-blocks-settings/CHANGELOG.md index af16c34fa..7d9c097d1 100644 --- a/packages/guideline-blocks-settings/CHANGELOG.md +++ b/packages/guideline-blocks-settings/CHANGELOG.md @@ -75,253 +75,252 @@ ### Patch Changes -- [#1476](https://github.com/Frontify/brand-sdk/pull/1476) [`1176b1b`](https://github.com/Frontify/brand-sdk/commit/1176b1b12be10d41e6d22b55675252d65115a3b7) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): bumped to latest `@frontify/fondue`, `@react-aria/focus` and `@react-stately/overlays` +- [#1476](https://github.com/Frontify/brand-sdk/pull/1476) [`1176b1b`](https://github.com/Frontify/brand-sdk/commit/1176b1b12be10d41e6d22b55675252d65115a3b7) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): bumped to latest `@frontify/fondue`, `@react-aria/focus` and `@react-stately/overlays` -- [#1475](https://github.com/Frontify/brand-sdk/pull/1475) [`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update multiple dependencies +- [#1475](https://github.com/Frontify/brand-sdk/pull/1475) [`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168) Thanks [@ragi96](https://github.com/ragi96)! - chore(Deps): update multiple dependencies -- Updated dependencies [[`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168)]: - - @frontify/sidebar-settings@0.10.10 +- Updated dependencies [[`7c6ad89`](https://github.com/Frontify/brand-sdk/commit/7c6ad8965800917f983688510734997055c44168)]: + - @frontify/sidebar-settings@0.10.10 ## 2.1.0 ### Minor Changes -- [#1464](https://github.com/Frontify/brand-sdk/pull/1464) [`cac3a23`](https://github.com/Frontify/brand-sdk/commit/cac3a23fd3b0e5e2426d67875b00905723a4729b) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RichTextEditor): add list plugins +- [#1464](https://github.com/Frontify/brand-sdk/pull/1464) [`cac3a23`](https://github.com/Frontify/brand-sdk/commit/cac3a23fd3b0e5e2426d67875b00905723a4729b) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RichTextEditor): add list plugins ## 2.0.4 ### Patch Changes -- [#1427](https://github.com/Frontify/brand-sdk/pull/1427) [`e97fe7d`](https://github.com/Frontify/brand-sdk/commit/e97fe7d0310075ea3d3af02596c12a1f7eb2b541) Thanks [@ragi96](https://github.com/ragi96)! - fix(Tokens): migrate to new fondue ones" +- [#1427](https://github.com/Frontify/brand-sdk/pull/1427) [`e97fe7d`](https://github.com/Frontify/brand-sdk/commit/e97fe7d0310075ea3d3af02596c12a1f7eb2b541) Thanks [@ragi96](https://github.com/ragi96)! - fix(Tokens): migrate to new fondue ones" -- [#1429](https://github.com/Frontify/brand-sdk/pull/1429) [`a64198e`](https://github.com/Frontify/brand-sdk/commit/a64198e9c8b7801a372213b1305df2f74cc34b29) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to latest version +- [#1429](https://github.com/Frontify/brand-sdk/pull/1429) [`a64198e`](https://github.com/Frontify/brand-sdk/commit/a64198e9c8b7801a372213b1305df2f74cc34b29) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to latest version -- [#1431](https://github.com/Frontify/brand-sdk/pull/1431) [`5921589`](https://github.com/Frontify/brand-sdk/commit/59215895b5085f391e928bdde50ce0dd4a7eead5) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump deps +- [#1431](https://github.com/Frontify/brand-sdk/pull/1431) [`5921589`](https://github.com/Frontify/brand-sdk/commit/59215895b5085f391e928bdde50ce0dd4a7eead5) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump deps ## 2.0.3 ### Patch Changes -- [#1425](https://github.com/Frontify/brand-sdk/pull/1425) [`a31c8b3`](https://github.com/Frontify/brand-sdk/commit/a31c8b339254932e8a3599a996bf13467d4e7c8f) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(LinkSelector): Remove event listeners that prevent scroll area to work properly +- [#1425](https://github.com/Frontify/brand-sdk/pull/1425) [`a31c8b3`](https://github.com/Frontify/brand-sdk/commit/a31c8b339254932e8a3599a996bf13467d4e7c8f) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(LinkSelector): Remove event listeners that prevent scroll area to work properly ## 2.0.2 ### Patch Changes -- [#1416](https://github.com/Frontify/brand-sdk/pull/1416) [`e4a8f2f`](https://github.com/Frontify/brand-sdk/commit/e4a8f2f53ed79ac87f1d7301ce885947724d8ad5) Thanks [@ragi96](https://github.com/ragi96)! - chore(build): adjust css filename +- [#1416](https://github.com/Frontify/brand-sdk/pull/1416) [`e4a8f2f`](https://github.com/Frontify/brand-sdk/commit/e4a8f2f53ed79ac87f1d7301ce885947724d8ad5) Thanks [@ragi96](https://github.com/ragi96)! - chore(build): adjust css filename ## 2.0.1 ### Patch Changes -- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies +- [#1410](https://github.com/Frontify/brand-sdk/pull/1410) [`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: updating dependencies -- Updated dependencies [[`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13)]: - - @frontify/sidebar-settings@0.10.9 +- Updated dependencies [[`245e6b0`](https://github.com/Frontify/brand-sdk/commit/245e6b0aca3a654f508d87611b4f617f1e6f1f13)]: + - @frontify/sidebar-settings@0.10.9 ## 2.0.0 ### Major Changes -- [#1409](https://github.com/Frontify/brand-sdk/pull/1409) [`c06f65b`](https://github.com/Frontify/brand-sdk/commit/c06f65b205d7cf2308d380671cc038f4e274fd2f) Thanks [@ragi96](https://github.com/ragi96)! - feat: breaking change to bump the package to the latest fondue v13 +- [#1409](https://github.com/Frontify/brand-sdk/pull/1409) [`c06f65b`](https://github.com/Frontify/brand-sdk/commit/c06f65b205d7cf2308d380671cc038f4e274fd2f) Thanks [@ragi96](https://github.com/ragi96)! - feat: breaking change to bump the package to the latest fondue v13 ## 1.0.13-alpha.11 ### Patch Changes -- [#1404](https://github.com/Frontify/brand-sdk/pull/1404) [`ed81f77`](https://github.com/Frontify/brand-sdk/commit/ed81f77db57a0856a2db54b22eb30dfcfe7de488) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `13.0.0-rc.16` +- [#1404](https://github.com/Frontify/brand-sdk/pull/1404) [`ed81f77`](https://github.com/Frontify/brand-sdk/commit/ed81f77db57a0856a2db54b22eb30dfcfe7de488) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `13.0.0-rc.16` ## 1.0.13-alpha.10 ### Patch Changes -- [#1398](https://github.com/Frontify/brand-sdk/pull/1398) [`d071278`](https://github.com/Frontify/brand-sdk/commit/d071278e8a08f48eda4adc271615ccbd3b9962d5) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to rc.15 +- [#1398](https://github.com/Frontify/brand-sdk/pull/1398) [`d071278`](https://github.com/Frontify/brand-sdk/commit/d071278e8a08f48eda4adc271615ccbd3b9962d5) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to rc.15 ## 1.0.13-alpha.9 ### Patch Changes -- [#1394](https://github.com/Frontify/brand-sdk/pull/1394) [`3f4bef3`](https://github.com/Frontify/brand-sdk/commit/3f4bef3741d5a640d38f48f6248692a6bf3ed11d) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `13.0.0-rc.14`, `@react-aria/focus` to `3.21.3` and `@react-stately/overlays` to `3.6.21` +- [#1394](https://github.com/Frontify/brand-sdk/pull/1394) [`3f4bef3`](https://github.com/Frontify/brand-sdk/commit/3f4bef3741d5a640d38f48f6248692a6bf3ed11d) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `13.0.0-rc.14`, `@react-aria/focus` to `3.21.3` and `@react-stately/overlays` to `3.6.21` ## 1.0.13-alpha.8 ### Patch Changes -- [#1391](https://github.com/Frontify/brand-sdk/pull/1391) [`c677f7e`](https://github.com/Frontify/brand-sdk/commit/c677f7eeddb65b084394f6b20d050ba1d98bc78e) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump to v13 fondue +- [#1391](https://github.com/Frontify/brand-sdk/pull/1391) [`c677f7e`](https://github.com/Frontify/brand-sdk/commit/c677f7eeddb65b084394f6b20d050ba1d98bc78e) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump to v13 fondue ## 1.0.13-alpha.7 ### Patch Changes -- [#1383](https://github.com/Frontify/brand-sdk/pull/1383) [`b3f4429`](https://github.com/Frontify/brand-sdk/commit/b3f4429b241dc2bf7d763fbc844f9a126f318095) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to latest rc +- [#1383](https://github.com/Frontify/brand-sdk/pull/1383) [`b3f4429`](https://github.com/Frontify/brand-sdk/commit/b3f4429b241dc2bf7d763fbc844f9a126f318095) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to latest rc ## 1.0.13-alpha.6 ### Patch Changes -- [#1381](https://github.com/Frontify/brand-sdk/pull/1381) [`86c9205`](https://github.com/Frontify/brand-sdk/commit/86c920570694a04908e408abfa8721bb3f8a2fc3) Thanks [@ragi96](https://github.com/ragi96)! - refactor(Icons): replace all legacy icons +- [#1381](https://github.com/Frontify/brand-sdk/pull/1381) [`86c9205`](https://github.com/Frontify/brand-sdk/commit/86c920570694a04908e408abfa8721bb3f8a2fc3) Thanks [@ragi96](https://github.com/ragi96)! - refactor(Icons): replace all legacy icons ## 1.0.13-alpha.5 ### Patch Changes -- [#1377](https://github.com/Frontify/brand-sdk/pull/1377) [`1075016`](https://github.com/Frontify/brand-sdk/commit/1075016e8e18a03eaa6b68f49d1b54e036a064c3) Thanks [@ragi96](https://github.com/ragi96)! - fix(LinkSelector): fix scrollarea +- [#1377](https://github.com/Frontify/brand-sdk/pull/1377) [`1075016`](https://github.com/Frontify/brand-sdk/commit/1075016e8e18a03eaa6b68f49d1b54e036a064c3) Thanks [@ragi96](https://github.com/ragi96)! - fix(LinkSelector): fix scrollarea ## 1.0.13-alpha.4 ### Patch Changes -- [#1375](https://github.com/Frontify/brand-sdk/pull/1375) [`3927db2`](https://github.com/Frontify/brand-sdk/commit/3927db2136eb75e124b90ce16d7bafbc806697ea) Thanks [@ragi96](https://github.com/ragi96)! - fix: build now also has the styles that were missed before +- [#1375](https://github.com/Frontify/brand-sdk/pull/1375) [`3927db2`](https://github.com/Frontify/brand-sdk/commit/3927db2136eb75e124b90ce16d7bafbc806697ea) Thanks [@ragi96](https://github.com/ragi96)! - fix: build now also has the styles that were missed before ## 1.0.13-alpha.3 ### Patch Changes -- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`33c1ebc`](https://github.com/Frontify/brand-sdk/commit/33c1ebc171ba93641374ca44161a7707dffd3e39) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: add plugin for external deps +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`33c1ebc`](https://github.com/Frontify/brand-sdk/commit/33c1ebc171ba93641374ca44161a7707dffd3e39) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: add plugin for external deps ## 1.0.13-alpha.2 ### Patch Changes -- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`0d4a546`](https://github.com/Frontify/brand-sdk/commit/0d4a546ab82da661f14a50e58b5a77afe1c3c311) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: add RTE styles +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`0d4a546`](https://github.com/Frontify/brand-sdk/commit/0d4a546ab82da661f14a50e58b5a77afe1c3c311) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: add RTE styles ## 1.0.13-alpha.1 ### Patch Changes -- [#1368](https://github.com/Frontify/brand-sdk/pull/1368) [`b46e848`](https://github.com/Frontify/brand-sdk/commit/b46e848638adc6a03c94edac147ba42f1cde26ef) Thanks [@ragi96](https://github.com/ragi96)! - chore(deps): bump fondue to latest rc +- [#1368](https://github.com/Frontify/brand-sdk/pull/1368) [`b46e848`](https://github.com/Frontify/brand-sdk/commit/b46e848638adc6a03c94edac147ba42f1cde26ef) Thanks [@ragi96](https://github.com/ragi96)! - chore(deps): bump fondue to latest rc ## 1.0.13-alpha.0 ### Patch Changes -- [#1363](https://github.com/Frontify/brand-sdk/pull/1363) [`2be13ae`](https://github.com/Frontify/brand-sdk/commit/2be13ae3eec70d2d1684ebb6f58a8b662421c7e0) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump to latest rc of fondue +- [#1363](https://github.com/Frontify/brand-sdk/pull/1363) [`2be13ae`](https://github.com/Frontify/brand-sdk/commit/2be13ae3eec70d2d1684ebb6f58a8b662421c7e0) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump to latest rc of fondue ## 1.0.8-alpha.3 ### Patch Changes -- [#1336](https://github.com/Frontify/brand-sdk/pull/1336) [`fa50848`](https://github.com/Frontify/brand-sdk/commit/fa50848a67f4fecfec61e55e7d2783b1adaa82e6) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to 13.rc5 +- [#1336](https://github.com/Frontify/brand-sdk/pull/1336) [`fa50848`](https://github.com/Frontify/brand-sdk/commit/fa50848a67f4fecfec61e55e7d2783b1adaa82e6) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to 13.rc5 ## 1.0.8-alpha.2 ### Patch Changes -- [#1333](https://github.com/Frontify/brand-sdk/pull/1333) [`627704a`](https://github.com/Frontify/brand-sdk/commit/627704af5756b7fe850a9bfd4c6d152a3feebc6e) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `13.0.0-rc.2` +- [#1333](https://github.com/Frontify/brand-sdk/pull/1333) [`627704a`](https://github.com/Frontify/brand-sdk/commit/627704af5756b7fe850a9bfd4c6d152a3feebc6e) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `13.0.0-rc.2` ## 1.0.8-alpha.1 ### Patch Changes -- [#1330](https://github.com/Frontify/brand-sdk/pull/1330) [`b85e121`](https://github.com/Frontify/brand-sdk/commit/b85e12116af0ec3bb6488448e9fa2f3e12b29b90) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to rc.1 +- [#1330](https://github.com/Frontify/brand-sdk/pull/1330) [`b85e121`](https://github.com/Frontify/brand-sdk/commit/b85e12116af0ec3bb6488448e9fa2f3e12b29b90) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to rc.1 ## 1.0.8-alpha.0 ### Patch Changes -- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`3cb0845`](https://github.com/Frontify/brand-sdk/commit/3cb0845f9fdf445f2fb680be4428980ac14524e5) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump `@frontify/fondue` to `13.0.0-beta.9` +- [#864](https://github.com/Frontify/brand-sdk/pull/864) [`3cb0845`](https://github.com/Frontify/brand-sdk/commit/3cb0845f9fdf445f2fb680be4428980ac14524e5) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump `@frontify/fondue` to `13.0.0-beta.9` -- [#1307](https://github.com/Frontify/brand-sdk/pull/1307) [`9a78b2c`](https://github.com/Frontify/brand-sdk/commit/9a78b2cd2062ace4dc46bfa8d75cc54e04e34c80) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump to latest fondue beta +- [#1307](https://github.com/Frontify/brand-sdk/pull/1307) [`9a78b2c`](https://github.com/Frontify/brand-sdk/commit/9a78b2cd2062ace4dc46bfa8d75cc54e04e34c80) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump to latest fondue beta ## 1.0.5-alpha.0 ### Patch Changes -- [#1286](https://github.com/Frontify/brand-sdk/pull/1286) [`8ed6d57`](https://github.com/Frontify/brand-sdk/commit/8ed6d57ad71cf81d73798e4f639103960be8dc93) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to v13 +- [#1286](https://github.com/Frontify/brand-sdk/pull/1286) [`8ed6d57`](https://github.com/Frontify/brand-sdk/commit/8ed6d57ad71cf81d73798e4f639103960be8dc93) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to v13 ## 1.0.13 ### Patch Changes -- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1370](https://github.com/Frontify/brand-sdk/pull/1370) [`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies -- Updated dependencies [[`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe)]: - - @frontify/sidebar-settings@0.10.8 +- Updated dependencies [[`d5f78a6`](https://github.com/Frontify/brand-sdk/commit/d5f78a6e9632bf245e8390a8dd02295b9978b0fe)]: + - @frontify/sidebar-settings@0.10.8 ## 1.0.12 ### Patch Changes -- [#1344](https://github.com/Frontify/brand-sdk/pull/1344) [`24bf5f2`](https://github.com/Frontify/brand-sdk/commit/24bf5f273f17cd8f0c03f1fd9f6194f10379f751) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - refactor(LinkSelector): improve blur handling +- [#1344](https://github.com/Frontify/brand-sdk/pull/1344) [`24bf5f2`](https://github.com/Frontify/brand-sdk/commit/24bf5f273f17cd8f0c03f1fd9f6194f10379f751) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - refactor(LinkSelector): improve blur handling ## 1.0.11 ### Patch Changes -- [#1342](https://github.com/Frontify/brand-sdk/pull/1342) [`4268d60`](https://github.com/Frontify/brand-sdk/commit/4268d6019b039a08af099107cb0f547b26223598) Thanks [@ragi96](https://github.com/ragi96)! - fix(FlyoutToolbarButton): add missing body +- [#1342](https://github.com/Frontify/brand-sdk/pull/1342) [`4268d60`](https://github.com/Frontify/brand-sdk/commit/4268d6019b039a08af099107cb0f547b26223598) Thanks [@ragi96](https://github.com/ragi96)! - fix(FlyoutToolbarButton): add missing body ## 1.0.10 ### Patch Changes -- [#1340](https://github.com/Frontify/brand-sdk/pull/1340) [`167faba`](https://github.com/Frontify/brand-sdk/commit/167fabaab9e340cb3027531e906373b4c4de3039) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to latest `12.4.3` +- [#1340](https://github.com/Frontify/brand-sdk/pull/1340) [`167faba`](https://github.com/Frontify/brand-sdk/commit/167fabaab9e340cb3027531e906373b4c4de3039) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to latest `12.4.3` ## 1.0.9 ### Patch Changes -- [#1338](https://github.com/Frontify/brand-sdk/pull/1338) [`a1e43c2`](https://github.com/Frontify/brand-sdk/commit/a1e43c2a4d6ed998dc202a4d9518f7bc7f8a4a8b) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(FlyoutToolbarButton): add missing padding option +- [#1338](https://github.com/Frontify/brand-sdk/pull/1338) [`a1e43c2`](https://github.com/Frontify/brand-sdk/commit/a1e43c2a4d6ed998dc202a4d9518f7bc7f8a4a8b) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(FlyoutToolbarButton): add missing padding option ## 1.0.8 ### Patch Changes -- Updated dependencies [[`2d086dc`](https://github.com/Frontify/brand-sdk/commit/2d086dc0a457137cff90032e65408871515907a0)]: - - @frontify/sidebar-settings@0.10.7 +- Updated dependencies [[`2d086dc`](https://github.com/Frontify/brand-sdk/commit/2d086dc0a457137cff90032e65408871515907a0)]: + - @frontify/sidebar-settings@0.10.7 ## 1.0.7 ### Patch Changes -- Updated dependencies [[`4197764`](https://github.com/Frontify/brand-sdk/commit/419776400bc3f470546841241015f80ddc032fe8)]: - - @frontify/sidebar-settings@0.10.6 +- Updated dependencies [[`4197764`](https://github.com/Frontify/brand-sdk/commit/419776400bc3f470546841241015f80ddc032fe8)]: + - @frontify/sidebar-settings@0.10.6 ## 1.0.6 ### Patch Changes -- [#1296](https://github.com/Frontify/brand-sdk/pull/1296) [`51c21aa`](https://github.com/Frontify/brand-sdk/commit/51c21aa0f560cd952b7fc8c4f733ccb1505bc170) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(LinkSelector): add scroll to dialog +- [#1296](https://github.com/Frontify/brand-sdk/pull/1296) [`51c21aa`](https://github.com/Frontify/brand-sdk/commit/51c21aa0f560cd952b7fc8c4f733ccb1505bc170) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(LinkSelector): add scroll to dialog ## 1.0.5 ### Patch Changes -- [#1290](https://github.com/Frontify/brand-sdk/pull/1290) [`0858b44`](https://github.com/Frontify/brand-sdk/commit/0858b444e76cb04d0cb12c999c83eab77de7d71d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - chore: bump `@frontify/fondue` to `12.12.3` +- [#1290](https://github.com/Frontify/brand-sdk/pull/1290) [`0858b44`](https://github.com/Frontify/brand-sdk/commit/0858b444e76cb04d0cb12c999c83eab77de7d71d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - chore: bump `@frontify/fondue` to `12.12.3` -- Updated dependencies [[`0858b44`](https://github.com/Frontify/brand-sdk/commit/0858b444e76cb04d0cb12c999c83eab77de7d71d)]: - - @frontify/sidebar-settings@0.10.5 +- Updated dependencies [[`0858b44`](https://github.com/Frontify/brand-sdk/commit/0858b444e76cb04d0cb12c999c83eab77de7d71d)]: + - @frontify/sidebar-settings@0.10.5 ## 1.0.4 ### Patch Changes -- [#1282](https://github.com/Frontify/brand-sdk/pull/1282) [`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies +- [#1282](https://github.com/Frontify/brand-sdk/pull/1282) [`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update dependencies -- [#1279](https://github.com/Frontify/brand-sdk/pull/1279) [`ed797bb`](https://github.com/Frontify/brand-sdk/commit/ed797bb8a78248544034a914e451375a873895d1) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(LinkInput): remove TooltipPosition +- [#1279](https://github.com/Frontify/brand-sdk/pull/1279) [`ed797bb`](https://github.com/Frontify/brand-sdk/commit/ed797bb8a78248544034a914e451375a873895d1) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(LinkInput): remove TooltipPosition -- Updated dependencies [[`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382)]: - - @frontify/sidebar-settings@0.10.4 +- Updated dependencies [[`7363adb`](https://github.com/Frontify/brand-sdk/commit/7363adbb2d32b0bca189e439956609a355483382)]: + - @frontify/sidebar-settings@0.10.4 ## 1.0.3 ### Patch Changes -- [#1275](https://github.com/Frontify/brand-sdk/pull/1275) [`8626669`](https://github.com/Frontify/brand-sdk/commit/86266696ffb21f6222ede90e5e6516fcb9d8e695) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(useAttachments): create new context without asset call +- [#1275](https://github.com/Frontify/brand-sdk/pull/1275) [`8626669`](https://github.com/Frontify/brand-sdk/commit/86266696ffb21f6222ede90e5e6516fcb9d8e695) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(useAttachments): create new context without asset call ## 1.0.2 ### Patch Changes -- [#1272](https://github.com/Frontify/brand-sdk/pull/1272) [`a306bf6`](https://github.com/Frontify/brand-sdk/commit/a306bf62e691569439e2dc28878949edbfa58f15) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: update documentation links +- [#1272](https://github.com/Frontify/brand-sdk/pull/1272) [`a306bf6`](https://github.com/Frontify/brand-sdk/commit/a306bf62e691569439e2dc28878949edbfa58f15) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: update documentation links -- [#1274](https://github.com/Frontify/brand-sdk/pull/1274) [`ccb6492`](https://github.com/Frontify/brand-sdk/commit/ccb6492fac3479a40cef9721b4b1c109d2725990) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(useAttachments): create new hook without asset call +- [#1274](https://github.com/Frontify/brand-sdk/pull/1274) [`ccb6492`](https://github.com/Frontify/brand-sdk/commit/ccb6492fac3479a40cef9721b4b1c109d2725990) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(useAttachments): create new hook without asset call ### Migration No changes required for consumers of `useAttachments`. - - - **Keep using `useAttachments(appBridge, key)`** → works exactly as before. - - **Optional (advanced use)**: To avoid multiple asset calls, use the new hook directly: + - **Keep using `useAttachments(appBridge, key)`** → works exactly as before. + - **Optional (advanced use)**: To avoid multiple asset calls, use the new hook directly: ```ts import { Attachments, useAttachmentOperations } from '@frontify/guideline-blocks-settings'; @@ -337,20 +336,18 @@ ### Patch Changes -- Updated dependencies [[`cb6bd32`](https://github.com/Frontify/brand-sdk/commit/cb6bd32e570e0c6825cd25c2b4f0baab464d5cc7)]: - - @frontify/sidebar-settings@0.10.3 +- Updated dependencies [[`cb6bd32`](https://github.com/Frontify/brand-sdk/commit/cb6bd32e570e0c6825cd25c2b4f0baab464d5cc7)]: + - @frontify/sidebar-settings@0.10.3 ## 1.0.0 ### Major Changes -- [#1267](https://github.com/Frontify/brand-sdk/pull/1267) [`3b34bfb`](https://github.com/Frontify/brand-sdk/commit/3b34bfb597cd73e82c4016913f8268d17665745b) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - refactor(\*): replace deprecated fondue components +- [#1267](https://github.com/Frontify/brand-sdk/pull/1267) [`3b34bfb`](https://github.com/Frontify/brand-sdk/commit/3b34bfb597cd73e82c4016913f8268d17665745b) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - refactor(\*): replace deprecated fondue components ### Breaking Changes - - - **`AttachmentsProps`** - - - `triggerComponent` type changed from: + - **`AttachmentsProps`** + - `triggerComponent` type changed from: ```ts triggerComponent?: (props: AttachmentsTriggerProps) => ReactElement; ``` @@ -361,431 +358,428 @@ >; ``` - - **`AttachmentTriggerProps`** - - - Removed: + - **`AttachmentTriggerProps`** + - Removed: ```ts triggerProps: HTMLAttributes; triggerRef: MutableRefObject; ``` - - **`LinkInput`** - - - Removed props: + - **`LinkInput`** + - Removed props: ```ts openInNewTab?: boolean; clearable?: boolean; ``` - - Changed: + - Changed: ```ts buttonSize?: 'small' | 'medium' | 'large'; // was: buttonSize?: ButtonSize; newTab?: boolean; // was: newTab?: CheckboxState; ``` - - **`LinkSelector`** - - - Changed: + - **`LinkSelector`** + - Changed: ```ts buttonSize?: 'small' | 'medium' | 'large'; // was: buttonSize?: ButtonSize; ``` - - **`InsertModalDispatchType` & `InsertModalStateProps`** - - Changed: + - **`InsertModalDispatchType` & `InsertModalStateProps`** + - Changed: ```ts newTab?: boolean; // was: newTab?: CheckboxState; ``` ### Patch Changes -- [#1258](https://github.com/Frontify/brand-sdk/pull/1258) [`a82646f`](https://github.com/Frontify/brand-sdk/commit/a82646f71f9cb23eb7718062c5ab35c117e18f61) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.11.0` +- [#1258](https://github.com/Frontify/brand-sdk/pull/1258) [`a82646f`](https://github.com/Frontify/brand-sdk/commit/a82646f71f9cb23eb7718062c5ab35c117e18f61) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.11.0` -- Updated dependencies [[`a82646f`](https://github.com/Frontify/brand-sdk/commit/a82646f71f9cb23eb7718062c5ab35c117e18f61)]: - - @frontify/sidebar-settings@0.10.2 +- Updated dependencies [[`a82646f`](https://github.com/Frontify/brand-sdk/commit/a82646f71f9cb23eb7718062c5ab35c117e18f61)]: + - @frontify/sidebar-settings@0.10.2 ## 0.38.1 ### Patch Changes -- [#1253](https://github.com/Frontify/brand-sdk/pull/1253) [`c5fc272`](https://github.com/Frontify/brand-sdk/commit/c5fc272bf297fa259d9c7c388c88a352eb14944e) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(RTE): remove loading placeholder for serialized text +- [#1253](https://github.com/Frontify/brand-sdk/pull/1253) [`c5fc272`](https://github.com/Frontify/brand-sdk/commit/c5fc272bf297fa259d9c7c388c88a352eb14944e) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(RTE): remove loading placeholder for serialized text ## 0.38.0 ### Minor Changes -- [#1245](https://github.com/Frontify/brand-sdk/pull/1245) [`3f192f7`](https://github.com/Frontify/brand-sdk/commit/3f192f795f94026fd8d3d8d10c4f4367323f1635) Thanks [@ragi96](https://github.com/ragi96)! - feat(DownloadButton): Add `ariaLabel` prop to allow accessibility label customization +- [#1245](https://github.com/Frontify/brand-sdk/pull/1245) [`3f192f7`](https://github.com/Frontify/brand-sdk/commit/3f192f795f94026fd8d3d8d10c4f4367323f1635) Thanks [@ragi96](https://github.com/ragi96)! - feat(DownloadButton): Add `ariaLabel` prop to allow accessibility label customization ## 0.37.7 ### Patch Changes -- [#1243](https://github.com/Frontify/brand-sdk/pull/1243) [`1e87e3b`](https://github.com/Frontify/brand-sdk/commit/1e87e3b424476f81dc641843d5d32525ac8a44fa) Thanks [@ragi96](https://github.com/ragi96)! - refactor(RTE): deprecated id prop, `useId` for unique editor ID +- [#1243](https://github.com/Frontify/brand-sdk/pull/1243) [`1e87e3b`](https://github.com/Frontify/brand-sdk/commit/1e87e3b424476f81dc641843d5d32525ac8a44fa) Thanks [@ragi96](https://github.com/ragi96)! - refactor(RTE): deprecated id prop, `useId` for unique editor ID ## 0.37.6 ### Patch Changes -- [#1241](https://github.com/Frontify/brand-sdk/pull/1241) [`f32ed03`](https://github.com/Frontify/brand-sdk/commit/f32ed03a46cbb8d432b036ebff884377b3b8d22e) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - min value rule for border input +- [#1241](https://github.com/Frontify/brand-sdk/pull/1241) [`f32ed03`](https://github.com/Frontify/brand-sdk/commit/f32ed03a46cbb8d432b036ebff884377b3b8d22e) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - min value rule for border input ## 0.37.5 ### Patch Changes -- [#1230](https://github.com/Frontify/brand-sdk/pull/1230) [`4fcde8f`](https://github.com/Frontify/brand-sdk/commit/4fcde8f964e3438bd63e1b2a908a1237b7cc544e) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(FloatingLinks): populate text field with url +- [#1230](https://github.com/Frontify/brand-sdk/pull/1230) [`4fcde8f`](https://github.com/Frontify/brand-sdk/commit/4fcde8f964e3438bd63e1b2a908a1237b7cc544e) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(FloatingLinks): populate text field with url ## 0.37.4 ### Patch Changes -- [#1201](https://github.com/Frontify/brand-sdk/pull/1201) [`b5525e1`](https://github.com/Frontify/brand-sdk/commit/b5525e1e45360d1f18ede33d134ebf638af6d4e3) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): break text into new lines in link modal +- [#1201](https://github.com/Frontify/brand-sdk/pull/1201) [`b5525e1`](https://github.com/Frontify/brand-sdk/commit/b5525e1e45360d1f18ede33d134ebf638af6d4e3) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): break text into new lines in link modal ## 0.37.3 ### Patch Changes -- Updated dependencies [[`d204da8`](https://github.com/Frontify/brand-sdk/commit/d204da8770befc87095f4e9de16c58ad0d1c697e)]: - - @frontify/sidebar-settings@0.10.1 +- Updated dependencies [[`d204da8`](https://github.com/Frontify/brand-sdk/commit/d204da8770befc87095f4e9de16c58ad0d1c697e)]: + - @frontify/sidebar-settings@0.10.1 ## 0.37.2 ### Patch Changes -- [#1195](https://github.com/Frontify/brand-sdk/pull/1195) [`0105292`](https://github.com/Frontify/brand-sdk/commit/0105292939f29b8cc6c969c1c4c973250748cf06) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(DownloadButton): remove nested buttons +- [#1195](https://github.com/Frontify/brand-sdk/pull/1195) [`0105292`](https://github.com/Frontify/brand-sdk/commit/0105292939f29b8cc6c969c1c4c973250748cf06) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(DownloadButton): remove nested buttons ## 0.37.1 ### Patch Changes -- [`2c30afb`](https://github.com/Frontify/brand-sdk/commit/2c30afb8a9bf66e4140605cd582b6fe62c3d9461) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump ci +- [`2c30afb`](https://github.com/Frontify/brand-sdk/commit/2c30afb8a9bf66e4140605cd582b6fe62c3d9461) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump ci ## 0.37.0 ### Minor Changes -- [#1188](https://github.com/Frontify/brand-sdk/pull/1188) [`e2978c3`](https://github.com/Frontify/brand-sdk/commit/e2978c33b0d732f7e95963459926914005908794) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(guideline-blocks-settings): add a new property to RTE to fix contrast issues for placeholders +- [#1188](https://github.com/Frontify/brand-sdk/pull/1188) [`e2978c3`](https://github.com/Frontify/brand-sdk/commit/e2978c33b0d732f7e95963459926914005908794) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(guideline-blocks-settings): add a new property to RTE to fix contrast issues for placeholders ## 0.36.14 ### Patch Changes -- [#1178](https://github.com/Frontify/brand-sdk/pull/1178) [`cfd68bd`](https://github.com/Frontify/brand-sdk/commit/cfd68bd94f2ce033d848c9877770b590eef9f24d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(BlockItemWrapper): adjust default value of the `outlineOffset` prop to `0` +- [#1178](https://github.com/Frontify/brand-sdk/pull/1178) [`cfd68bd`](https://github.com/Frontify/brand-sdk/commit/cfd68bd94f2ce033d848c9877770b590eef9f24d) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - fix(BlockItemWrapper): adjust default value of the `outlineOffset` prop to `0` ## 0.36.13 ### Patch Changes -- [#1173](https://github.com/Frontify/brand-sdk/pull/1173) [`9b3e98f`](https://github.com/Frontify/brand-sdk/commit/9b3e98f45fcbe920bed7e638c7422803696e2907) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - feat(RTE): prevent text overflow from button +- [#1173](https://github.com/Frontify/brand-sdk/pull/1173) [`9b3e98f`](https://github.com/Frontify/brand-sdk/commit/9b3e98f45fcbe920bed7e638c7422803696e2907) Thanks [@peter-tudosa](https://github.com/peter-tudosa)! - feat(RTE): prevent text overflow from button ## 0.36.12 ### Patch Changes -- [#1165](https://github.com/Frontify/brand-sdk/pull/1165) [`2f39217`](https://github.com/Frontify/brand-sdk/commit/2f3921736da65404438b990702d33229f16ca2b8) Thanks [@ragi96](https://github.com/ragi96)! - fix: add tailwind base for `*`, `::before` and `::after` +- [#1165](https://github.com/Frontify/brand-sdk/pull/1165) [`2f39217`](https://github.com/Frontify/brand-sdk/commit/2f3921736da65404438b990702d33229f16ca2b8) Thanks [@ragi96](https://github.com/ragi96)! - fix: add tailwind base for `*`, `::before` and `::after` -- [#1168](https://github.com/Frontify/brand-sdk/pull/1168) [`2b6bd9a`](https://github.com/Frontify/brand-sdk/commit/2b6bd9a1d56a3d03533ed3b38366d843cbcd0f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@dnd-kt` bump to latest +- [#1168](https://github.com/Frontify/brand-sdk/pull/1168) [`2b6bd9a`](https://github.com/Frontify/brand-sdk/commit/2b6bd9a1d56a3d03533ed3b38366d843cbcd0f13) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@dnd-kt` bump to latest ## 0.36.11 ### Patch Changes -- Updated dependencies [[`6bafe6c`](https://github.com/Frontify/brand-sdk/commit/6bafe6c0aadc0dcba8a8b3c7bb283e219c47b5ef)]: - - @frontify/sidebar-settings@0.10.0 +- Updated dependencies [[`6bafe6c`](https://github.com/Frontify/brand-sdk/commit/6bafe6c0aadc0dcba8a8b3c7bb283e219c47b5ef)]: + - @frontify/sidebar-settings@0.10.0 ## 0.36.10 ### Patch Changes -- [#1130](https://github.com/Frontify/brand-sdk/pull/1130) [`08b7e0a`](https://github.com/Frontify/brand-sdk/commit/08b7e0a13009d59560a65dffa4c60eec6a336686) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump `@frontify/fondue` to `12.2.13` +- [#1130](https://github.com/Frontify/brand-sdk/pull/1130) [`08b7e0a`](https://github.com/Frontify/brand-sdk/commit/08b7e0a13009d59560a65dffa4c60eec6a336686) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump `@frontify/fondue` to `12.2.13` -- Updated dependencies [[`d90e2fb`](https://github.com/Frontify/brand-sdk/commit/d90e2fb5129fb6c267c0bed3dad54ec45d387574), [`08b7e0a`](https://github.com/Frontify/brand-sdk/commit/08b7e0a13009d59560a65dffa4c60eec6a336686)]: - - @frontify/sidebar-settings@0.9.23 +- Updated dependencies [[`d90e2fb`](https://github.com/Frontify/brand-sdk/commit/d90e2fb5129fb6c267c0bed3dad54ec45d387574), [`08b7e0a`](https://github.com/Frontify/brand-sdk/commit/08b7e0a13009d59560a65dffa4c60eec6a336686)]: + - @frontify/sidebar-settings@0.9.23 ## 0.36.9 ### Patch Changes -- [#1126](https://github.com/Frontify/brand-sdk/pull/1126) [`8050d68`](https://github.com/Frontify/brand-sdk/commit/8050d6813202738d299f0f4cc8f9acdc4175ff4c) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): add fondue component style css +- [#1126](https://github.com/Frontify/brand-sdk/pull/1126) [`8050d68`](https://github.com/Frontify/brand-sdk/commit/8050d6813202738d299f0f4cc8f9acdc4175ff4c) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): add fondue component style css -- [#1124](https://github.com/Frontify/brand-sdk/pull/1124) [`ec7b4c2`](https://github.com/Frontify/brand-sdk/commit/ec7b4c21c22f5f5ff663193fdce2c5a34604caef) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(\*): scroll events are hijacked by dnd-kit +- [#1124](https://github.com/Frontify/brand-sdk/pull/1124) [`ec7b4c2`](https://github.com/Frontify/brand-sdk/commit/ec7b4c21c22f5f5ff663193fdce2c5a34604caef) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(\*): scroll events are hijacked by dnd-kit ## 0.36.8 ### Patch Changes -- Updated dependencies [[`e708d79`](https://github.com/Frontify/brand-sdk/commit/e708d79d0c89ffa59d7ce5cc7314aba2426aa833)]: - - @frontify/sidebar-settings@0.9.22 +- Updated dependencies [[`e708d79`](https://github.com/Frontify/brand-sdk/commit/e708d79d0c89ffa59d7ce5cc7314aba2426aa833)]: + - @frontify/sidebar-settings@0.9.22 ## 0.36.7 ### Patch Changes -- [#1101](https://github.com/Frontify/brand-sdk/pull/1101) [`db195d8`](https://github.com/Frontify/brand-sdk/commit/db195d840df78067d2be008b6686a22546fcbfb4) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.2.6` +- [#1101](https://github.com/Frontify/brand-sdk/pull/1101) [`db195d8`](https://github.com/Frontify/brand-sdk/commit/db195d840df78067d2be008b6686a22546fcbfb4) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.2.6` -- Updated dependencies [[`db195d8`](https://github.com/Frontify/brand-sdk/commit/db195d840df78067d2be008b6686a22546fcbfb4)]: - - @frontify/sidebar-settings@0.9.21 +- Updated dependencies [[`db195d8`](https://github.com/Frontify/brand-sdk/commit/db195d840df78067d2be008b6686a22546fcbfb4)]: + - @frontify/sidebar-settings@0.9.21 ## 0.36.6 ### Patch Changes -- [#1083](https://github.com/Frontify/brand-sdk/pull/1083) [`65f732d`](https://github.com/Frontify/brand-sdk/commit/65f732d100f1e68d10bad51982ea5d34e12f69bf) Thanks [@ragi96](https://github.com/ragi96)! - fix: tooltip not positioned correctly also replaced the legacy tooltip with the new one +- [#1083](https://github.com/Frontify/brand-sdk/pull/1083) [`65f732d`](https://github.com/Frontify/brand-sdk/commit/65f732d100f1e68d10bad51982ea5d34e12f69bf) Thanks [@ragi96](https://github.com/ragi96)! - fix: tooltip not positioned correctly also replaced the legacy tooltip with the new one ## 0.36.5 ### Patch Changes -- Updated dependencies [[`7ec70a5`](https://github.com/Frontify/brand-sdk/commit/7ec70a547155b3bbabdd333113168102565a0cfd)]: - - @frontify/sidebar-settings@0.9.20 +- Updated dependencies [[`7ec70a5`](https://github.com/Frontify/brand-sdk/commit/7ec70a547155b3bbabdd333113168102565a0cfd)]: + - @frontify/sidebar-settings@0.9.20 ## 0.36.4 ### Patch Changes -- [#1057](https://github.com/Frontify/brand-sdk/pull/1057) [`c45a175`](https://github.com/Frontify/brand-sdk/commit/c45a1752384fdd04e529b1729cc274a8a44fc6c8) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to 12.1.14 +- [#1057](https://github.com/Frontify/brand-sdk/pull/1057) [`c45a175`](https://github.com/Frontify/brand-sdk/commit/c45a1752384fdd04e529b1729cc274a8a44fc6c8) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to 12.1.14 -- Updated dependencies [[`84a979b`](https://github.com/Frontify/brand-sdk/commit/84a979b282f3f37766c77718a752df5567df12df), [`c45a175`](https://github.com/Frontify/brand-sdk/commit/c45a1752384fdd04e529b1729cc274a8a44fc6c8)]: - - @frontify/sidebar-settings@0.9.19 +- Updated dependencies [[`84a979b`](https://github.com/Frontify/brand-sdk/commit/84a979b282f3f37766c77718a752df5567df12df), [`c45a175`](https://github.com/Frontify/brand-sdk/commit/c45a1752384fdd04e529b1729cc274a8a44fc6c8)]: + - @frontify/sidebar-settings@0.9.19 ## 0.36.3 ### Patch Changes -- [#1055](https://github.com/Frontify/brand-sdk/pull/1055) [`a9e0fef`](https://github.com/Frontify/brand-sdk/commit/a9e0fefd1dc5e4c49f39592e533acf2177854cd5) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockInjectButton): menu is opening in top left +- [#1055](https://github.com/Frontify/brand-sdk/pull/1055) [`a9e0fef`](https://github.com/Frontify/brand-sdk/commit/a9e0fefd1dc5e4c49f39592e533acf2177854cd5) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockInjectButton): menu is opening in top left ## 0.36.2 ### Patch Changes -- [#1045](https://github.com/Frontify/brand-sdk/pull/1045) [`304d24f`](https://github.com/Frontify/brand-sdk/commit/304d24f60a623239e72b79b028db69e73fb41968) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RTE): make link clickable in edit modal +- [#1045](https://github.com/Frontify/brand-sdk/pull/1045) [`304d24f`](https://github.com/Frontify/brand-sdk/commit/304d24f60a623239e72b79b028db69e73fb41968) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RTE): make link clickable in edit modal -- [#1041](https://github.com/Frontify/brand-sdk/pull/1041) [`6300d3c`](https://github.com/Frontify/brand-sdk/commit/6300d3c131efb75d787461a289631b77032453a2) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): floating modals are hidden behind higher z index siblings +- [#1041](https://github.com/Frontify/brand-sdk/pull/1041) [`6300d3c`](https://github.com/Frontify/brand-sdk/commit/6300d3c131efb75d787461a289631b77032453a2) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): floating modals are hidden behind higher z index siblings ## 0.36.1 ### Patch Changes -- [#1012](https://github.com/Frontify/brand-sdk/pull/1012) [`04a2dd0`](https://github.com/Frontify/brand-sdk/commit/04a2dd098764fee6ca38f7aee027742e237db812) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): avoid column breaks when wrapping +- [#1012](https://github.com/Frontify/brand-sdk/pull/1012) [`04a2dd0`](https://github.com/Frontify/brand-sdk/commit/04a2dd098764fee6ca38f7aee027742e237db812) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): avoid column breaks when wrapping ## 0.36.0 ### Minor Changes -- [#984](https://github.com/Frontify/brand-sdk/pull/984) [`81319fd`](https://github.com/Frontify/brand-sdk/commit/81319fd5cd9aaad649c1d7ce41915c1706f3c769) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RTE): add custom column break plugin - Use simply as: `new BreakAfterPlugin({ columns, gap })`, and the plugin will take care of responsivity using container queries. Don't forget to also supply columns and gap to the `RichTextEditor` component. +- [#984](https://github.com/Frontify/brand-sdk/pull/984) [`81319fd`](https://github.com/Frontify/brand-sdk/commit/81319fd5cd9aaad649c1d7ce41915c1706f3c769) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RTE): add custom column break plugin + Use simply as: `new BreakAfterPlugin({ columns, gap })`, and the plugin will take care of responsivity using container queries. Don't forget to also supply columns and gap to the `RichTextEditor` component. ### Patch Changes -- [#976](https://github.com/Frontify/brand-sdk/pull/976) [`be18559`](https://github.com/Frontify/brand-sdk/commit/be18559f7e31e2ad738fd4c875d119f8c839fa4d) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue dependency to 12.1.8 +- [#976](https://github.com/Frontify/brand-sdk/pull/976) [`be18559`](https://github.com/Frontify/brand-sdk/commit/be18559f7e31e2ad738fd4c875d119f8c839fa4d) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue dependency to 12.1.8 -- Updated dependencies [[`be18559`](https://github.com/Frontify/brand-sdk/commit/be18559f7e31e2ad738fd4c875d119f8c839fa4d)]: - - @frontify/sidebar-settings@0.9.18 +- Updated dependencies [[`be18559`](https://github.com/Frontify/brand-sdk/commit/be18559f7e31e2ad738fd4c875d119f8c839fa4d)]: + - @frontify/sidebar-settings@0.9.18 ## 0.35.1 ### Patch Changes -- [#952](https://github.com/Frontify/brand-sdk/pull/952) [`a0f07c9`](https://github.com/Frontify/brand-sdk/commit/a0f07c9077f7d1c766b6b78df1e7a5ce1babca82) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(\*): move `@tailwindcss/container-queries` to a public dependency +- [#952](https://github.com/Frontify/brand-sdk/pull/952) [`a0f07c9`](https://github.com/Frontify/brand-sdk/commit/a0f07c9077f7d1c766b6b78df1e7a5ce1babca82) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(\*): move `@tailwindcss/container-queries` to a public dependency ## 0.35.0 ### Minor Changes -- [#949](https://github.com/Frontify/brand-sdk/pull/949) [`1d67cc1`](https://github.com/Frontify/brand-sdk/commit/1d67cc1f8e0cd5387b914d61d944e9756542a6e6) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(tailwind): introduce container queries - `@frontify/guideline-block-settings/tailwind` can now be used as a tailwind preset in your tailwind.config.ts file to enable container queries. On how to use them refer to tailwind documentation: https://github.com/tailwindlabs/tailwindcss-container-queries +- [#949](https://github.com/Frontify/brand-sdk/pull/949) [`1d67cc1`](https://github.com/Frontify/brand-sdk/commit/1d67cc1f8e0cd5387b914d61d944e9756542a6e6) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(tailwind): introduce container queries + `@frontify/guideline-block-settings/tailwind` can now be used as a tailwind preset in your tailwind.config.ts file to enable container queries. On how to use them refer to tailwind documentation: https://github.com/tailwindlabs/tailwindcss-container-queries ### Patch Changes -- [#948](https://github.com/Frontify/brand-sdk/pull/948) [`cc7f942`](https://github.com/Frontify/brand-sdk/commit/cc7f9427df1a3d8d621850adff4c3d59f2f8e308) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): on safari the first click is not recognized +- [#948](https://github.com/Frontify/brand-sdk/pull/948) [`cc7f942`](https://github.com/Frontify/brand-sdk/commit/cc7f9427df1a3d8d621850adff4c3d59f2f8e308) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): on safari the first click is not recognized -- Updated dependencies [[`7baceff`](https://github.com/Frontify/brand-sdk/commit/7baceffc87773e9f6a1e169aa45151b92c614cbc)]: - - @frontify/sidebar-settings@0.9.17 +- Updated dependencies [[`7baceff`](https://github.com/Frontify/brand-sdk/commit/7baceffc87773e9f6a1e169aa45151b92c614cbc)]: + - @frontify/sidebar-settings@0.9.17 ## 0.34.15 ### Patch Changes -- [#907](https://github.com/Frontify/brand-sdk/pull/907) [`f824d37`](https://github.com/Frontify/brand-sdk/commit/f824d371ed6fb8f46a22ca39d2a8e211a9fb4ca8) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump `@frontify/fondue` to `12.0.10` +- [#907](https://github.com/Frontify/brand-sdk/pull/907) [`f824d37`](https://github.com/Frontify/brand-sdk/commit/f824d371ed6fb8f46a22ca39d2a8e211a9fb4ca8) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump `@frontify/fondue` to `12.0.10` -- Updated dependencies [[`f824d37`](https://github.com/Frontify/brand-sdk/commit/f824d371ed6fb8f46a22ca39d2a8e211a9fb4ca8)]: - - @frontify/sidebar-settings@0.9.16 +- Updated dependencies [[`f824d37`](https://github.com/Frontify/brand-sdk/commit/f824d371ed6fb8f46a22ca39d2a8e211a9fb4ca8)]: + - @frontify/sidebar-settings@0.9.16 ## 0.34.14 ### Patch Changes -- [#901](https://github.com/Frontify/brand-sdk/pull/901) [`2bfb9f6`](https://github.com/Frontify/brand-sdk/commit/2bfb9f6f8028df00e571f87b4be288b579bf53ad) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(BlockItemWrapper): memoize BlockItemWrapper component +- [#901](https://github.com/Frontify/brand-sdk/pull/901) [`2bfb9f6`](https://github.com/Frontify/brand-sdk/commit/2bfb9f6f8028df00e571f87b4be288b579bf53ad) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(BlockItemWrapper): memoize BlockItemWrapper component ## 0.34.13 ### Patch Changes -- [#892](https://github.com/Frontify/brand-sdk/pull/892) [`fe3323c`](https://github.com/Frontify/brand-sdk/commit/fe3323ccb4c6b9c18bc5eee9564b3468e645fa4d) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `vite` to `5.2.10` +- [#892](https://github.com/Frontify/brand-sdk/pull/892) [`fe3323c`](https://github.com/Frontify/brand-sdk/commit/fe3323ccb4c6b9c18bc5eee9564b3468e645fa4d) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `vite` to `5.2.10` -- Updated dependencies [[`fe3323c`](https://github.com/Frontify/brand-sdk/commit/fe3323ccb4c6b9c18bc5eee9564b3468e645fa4d)]: - - @frontify/sidebar-settings@0.9.15 +- Updated dependencies [[`fe3323c`](https://github.com/Frontify/brand-sdk/commit/fe3323ccb4c6b9c18bc5eee9564b3468e645fa4d)]: + - @frontify/sidebar-settings@0.9.15 ## 0.34.12 ### Patch Changes -- [#890](https://github.com/Frontify/brand-sdk/pull/890) [`c7712e8`](https://github.com/Frontify/brand-sdk/commit/c7712e84ec90b6db1b23a23c56db63ed90d812bc) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.7` +- [#890](https://github.com/Frontify/brand-sdk/pull/890) [`c7712e8`](https://github.com/Frontify/brand-sdk/commit/c7712e84ec90b6db1b23a23c56db63ed90d812bc) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.7` -- Updated dependencies [[`c7712e8`](https://github.com/Frontify/brand-sdk/commit/c7712e84ec90b6db1b23a23c56db63ed90d812bc)]: - - @frontify/sidebar-settings@0.9.14 +- Updated dependencies [[`c7712e8`](https://github.com/Frontify/brand-sdk/commit/c7712e84ec90b6db1b23a23c56db63ed90d812bc)]: + - @frontify/sidebar-settings@0.9.14 ## 0.34.11 ### Patch Changes -- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update eslint and lint fix all files +- [#853](https://github.com/Frontify/brand-sdk/pull/853) [`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: update eslint and lint fix all files -- [#857](https://github.com/Frontify/brand-sdk/pull/857) [`7d818d8`](https://github.com/Frontify/brand-sdk/commit/7d818d88eb5b18da2015c3a9f823350e507be3be) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.0-beta.427` +- [#857](https://github.com/Frontify/brand-sdk/pull/857) [`7d818d8`](https://github.com/Frontify/brand-sdk/commit/7d818d88eb5b18da2015c3a9f823350e507be3be) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump `@frontify/fondue` to `12.0.0-beta.427` -- [#855](https://github.com/Frontify/brand-sdk/pull/855) [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump dependencies +- [#855](https://github.com/Frontify/brand-sdk/pull/855) [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - chore: bump dependencies -- Updated dependencies [[`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab), [`7d818d8`](https://github.com/Frontify/brand-sdk/commit/7d818d88eb5b18da2015c3a9f823350e507be3be), [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c)]: - - @frontify/sidebar-settings@0.9.13 +- Updated dependencies [[`d980eb3`](https://github.com/Frontify/brand-sdk/commit/d980eb367062b4c4cd6416f852408da4f13c74ab), [`7d818d8`](https://github.com/Frontify/brand-sdk/commit/7d818d88eb5b18da2015c3a9f823350e507be3be), [`bcfe9ab`](https://github.com/Frontify/brand-sdk/commit/bcfe9abea8872b8341b053159827a953bdbea16c)]: + - @frontify/sidebar-settings@0.9.13 ## 0.34.10 ### Patch Changes -- [#852](https://github.com/Frontify/brand-sdk/pull/852) [`28f5ec2`](https://github.com/Frontify/brand-sdk/commit/28f5ec282a14bd22871b84570c00630ba07dfa14) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockItemWrapper): hide toolbar segment if there are no items +- [#852](https://github.com/Frontify/brand-sdk/pull/852) [`28f5ec2`](https://github.com/Frontify/brand-sdk/commit/28f5ec282a14bd22871b84570c00630ba07dfa14) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockItemWrapper): hide toolbar segment if there are no items ## 0.34.9 ### Patch Changes -- [#848](https://github.com/Frontify/brand-sdk/pull/848) [`68533d1`](https://github.com/Frontify/brand-sdk/commit/68533d15490c0ac313f43b68472dfa44bea8b5c6) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix: border settings does not add px automatically +- [#848](https://github.com/Frontify/brand-sdk/pull/848) [`68533d1`](https://github.com/Frontify/brand-sdk/commit/68533d15490c0ac313f43b68472dfa44bea8b5c6) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix: border settings does not add px automatically ## 0.34.8 ### Patch Changes -- [#842](https://github.com/Frontify/brand-sdk/pull/842) [`0a86be7`](https://github.com/Frontify/brand-sdk/commit/0a86be761b5d3283d275d11dc8ba684821d8c17d) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat(LinkSelector): Internal section links will now not be shown if they have an unreadable title, such as an empty string. +- [#842](https://github.com/Frontify/brand-sdk/pull/842) [`0a86be7`](https://github.com/Frontify/brand-sdk/commit/0a86be761b5d3283d275d11dc8ba684821d8c17d) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat(LinkSelector): Internal section links will now not be shown if they have an unreadable title, such as an empty string. ## 0.34.7 ### Patch Changes -- Updated dependencies [[`b116dec`](https://github.com/Frontify/brand-sdk/commit/b116decf09a486d5c25e8f9cf9e4213cd2c65d3c)]: - - @frontify/sidebar-settings@0.9.12 +- Updated dependencies [[`b116dec`](https://github.com/Frontify/brand-sdk/commit/b116decf09a486d5c25e8f9cf9e4213cd2c65d3c)]: + - @frontify/sidebar-settings@0.9.12 ## 0.34.6 ### Patch Changes -- [#822](https://github.com/Frontify/brand-sdk/pull/822) [`b8ca543`](https://github.com/Frontify/brand-sdk/commit/b8ca54328becb5a084833bbdfdb3a7a2c9ea3d09) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(RichTextEditor): always reset page leave when text changes. This fixes an issue introduced in v0.34.5. +- [#822](https://github.com/Frontify/brand-sdk/pull/822) [`b8ca543`](https://github.com/Frontify/brand-sdk/commit/b8ca54328becb5a084833bbdfdb3a7a2c9ea3d09) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(RichTextEditor): always reset page leave when text changes. This fixes an issue introduced in v0.34.5. -- [#823](https://github.com/Frontify/brand-sdk/pull/823) [`a7a39ba`](https://github.com/Frontify/brand-sdk/commit/a7a39ba8d6de66bc56da497d043d73b860aa77b6) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(RichTextEditor): Reset `hasEnteredViewport` state every time view mode is entered +- [#823](https://github.com/Frontify/brand-sdk/pull/823) [`a7a39ba`](https://github.com/Frontify/brand-sdk/commit/a7a39ba8d6de66bc56da497d043d73b860aa77b6) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(RichTextEditor): Reset `hasEnteredViewport` state every time view mode is entered ## 0.34.5 ### Patch Changes -- [#817](https://github.com/Frontify/brand-sdk/pull/817) [`7307201`](https://github.com/Frontify/brand-sdk/commit/7307201f42889938c2a68664abebbc1da21ae9e4) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat(RichTextEditor): using the new `useIsInViewport` hook the RichTextEditor will now only be initialized once the component enters the viewport. +- [#817](https://github.com/Frontify/brand-sdk/pull/817) [`7307201`](https://github.com/Frontify/brand-sdk/commit/7307201f42889938c2a68664abebbc1da21ae9e4) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat(RichTextEditor): using the new `useIsInViewport` hook the RichTextEditor will now only be initialized once the component enters the viewport. ## 0.34.4 ### Patch Changes -- [#815](https://github.com/Frontify/brand-sdk/pull/815) [`17491e9`](https://github.com/Frontify/brand-sdk/commit/17491e923d9b66d158ee03003b3ac47899e6423f) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to 12.0.0-beta.415 +- [#815](https://github.com/Frontify/brand-sdk/pull/815) [`17491e9`](https://github.com/Frontify/brand-sdk/commit/17491e923d9b66d158ee03003b3ac47899e6423f) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue to 12.0.0-beta.415 -- Updated dependencies [[`17491e9`](https://github.com/Frontify/brand-sdk/commit/17491e923d9b66d158ee03003b3ac47899e6423f)]: - - @frontify/sidebar-settings@0.9.11 +- Updated dependencies [[`17491e9`](https://github.com/Frontify/brand-sdk/commit/17491e923d9b66d158ee03003b3ac47899e6423f)]: + - @frontify/sidebar-settings@0.9.11 ## 0.34.3 ### Patch Changes -- [#803](https://github.com/Frontify/brand-sdk/pull/803) [`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat(RichTextEditor): replace outer-most modal element with `FloatingModalWrapper`. +- [#803](https://github.com/Frontify/brand-sdk/pull/803) [`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat(RichTextEditor): replace outer-most modal element with `FloatingModalWrapper`. -- [#803](https://github.com/Frontify/brand-sdk/pull/803) [`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to ^12.0.0-beta.411 +- [#803](https://github.com/Frontify/brand-sdk/pull/803) [`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to ^12.0.0-beta.411 -- Updated dependencies [[`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1)]: - - @frontify/sidebar-settings@0.9.10 +- Updated dependencies [[`b4a72a2`](https://github.com/Frontify/brand-sdk/commit/b4a72a23c7ea5aa65beb1b264fb36930c0493ba1)]: + - @frontify/sidebar-settings@0.9.10 ## 0.34.2 ### Patch Changes -- [#800](https://github.com/Frontify/brand-sdk/pull/800) [`7e83e75`](https://github.com/Frontify/brand-sdk/commit/7e83e75243fdbfc5379be3bdf15c210039c4459c) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to 12.0.0-beta.410 +- [#800](https://github.com/Frontify/brand-sdk/pull/800) [`7e83e75`](https://github.com/Frontify/brand-sdk/commit/7e83e75243fdbfc5379be3bdf15c210039c4459c) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump @frontify/fondue to 12.0.0-beta.410 -- [#801](https://github.com/Frontify/brand-sdk/pull/801) [`51d5537`](https://github.com/Frontify/brand-sdk/commit/51d55375a86547f1036c4c892da97f6cb64b1e88) Thanks [@SamCreasey](https://github.com/SamCreasey)! - perf(RichTextEditor): Stabilize props to avoid unneccessary rerenders. +- [#801](https://github.com/Frontify/brand-sdk/pull/801) [`51d5537`](https://github.com/Frontify/brand-sdk/commit/51d55375a86547f1036c4c892da97f6cb64b1e88) Thanks [@SamCreasey](https://github.com/SamCreasey)! - perf(RichTextEditor): Stabilize props to avoid unneccessary rerenders. -- Updated dependencies [[`7e83e75`](https://github.com/Frontify/brand-sdk/commit/7e83e75243fdbfc5379be3bdf15c210039c4459c)]: - - @frontify/sidebar-settings@0.9.9 +- Updated dependencies [[`7e83e75`](https://github.com/Frontify/brand-sdk/commit/7e83e75243fdbfc5379be3bdf15c210039c4459c)]: + - @frontify/sidebar-settings@0.9.9 ## 0.34.1 ### Patch Changes -- [#796](https://github.com/Frontify/brand-sdk/pull/796) [`d24dcf3`](https://github.com/Frontify/brand-sdk/commit/d24dcf3fd78a871229e64b82690084ccfbd521ce) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue +- [#796](https://github.com/Frontify/brand-sdk/pull/796) [`d24dcf3`](https://github.com/Frontify/brand-sdk/commit/d24dcf3fd78a871229e64b82690084ccfbd521ce) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue -- Updated dependencies [[`d24dcf3`](https://github.com/Frontify/brand-sdk/commit/d24dcf3fd78a871229e64b82690084ccfbd521ce)]: - - @frontify/sidebar-settings@0.9.8 +- Updated dependencies [[`d24dcf3`](https://github.com/Frontify/brand-sdk/commit/d24dcf3fd78a871229e64b82690084ccfbd521ce)]: + - @frontify/sidebar-settings@0.9.8 ## 0.34.0 ### Minor Changes -- [#750](https://github.com/Frontify/brand-sdk/pull/750) [`8b4ded2`](https://github.com/Frontify/brand-sdk/commit/8b4ded214bd781c5aa3c917121bc013f4262da32) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): update fondue which comes with plate v30 +- [#750](https://github.com/Frontify/brand-sdk/pull/750) [`8b4ded2`](https://github.com/Frontify/brand-sdk/commit/8b4ded214bd781c5aa3c917121bc013f4262da32) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): update fondue which comes with plate v30 @udecode/plate libraries are no longer used as a direct dependency, instead all required parts are now imported from @frontify/fondue ### Patch Changes -- Updated dependencies [[`8b4ded2`](https://github.com/Frontify/brand-sdk/commit/8b4ded214bd781c5aa3c917121bc013f4262da32)]: - - @frontify/sidebar-settings@0.9.7 +- Updated dependencies [[`8b4ded2`](https://github.com/Frontify/brand-sdk/commit/8b4ded214bd781c5aa3c917121bc013f4262da32)]: + - @frontify/sidebar-settings@0.9.7 ## 0.33.5 ### Patch Changes -- [`babce0e`](https://github.com/Frontify/brand-sdk/commit/babce0eb251fa78ef9c7b4c2c0ce740c7d66718d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add the dist folder to published packages +- [`babce0e`](https://github.com/Frontify/brand-sdk/commit/babce0eb251fa78ef9c7b4c2c0ce740c7d66718d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add the dist folder to published packages -- Updated dependencies [[`babce0e`](https://github.com/Frontify/brand-sdk/commit/babce0eb251fa78ef9c7b4c2c0ce740c7d66718d)]: - - @frontify/sidebar-settings@0.9.6 +- Updated dependencies [[`babce0e`](https://github.com/Frontify/brand-sdk/commit/babce0eb251fa78ef9c7b4c2c0ce740c7d66718d)]: + - @frontify/sidebar-settings@0.9.6 ## 0.33.4 ### Patch Changes -- [`de53c69`](https://github.com/Frontify/brand-sdk/commit/de53c69b43e3f0a9b245cc2b193d6edef390dc00) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix broken build produced in `dev` branch +- [`de53c69`](https://github.com/Frontify/brand-sdk/commit/de53c69b43e3f0a9b245cc2b193d6edef390dc00) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix broken build produced in `dev` branch -- Updated dependencies [[`de53c69`](https://github.com/Frontify/brand-sdk/commit/de53c69b43e3f0a9b245cc2b193d6edef390dc00)]: - - @frontify/sidebar-settings@0.9.5 +- Updated dependencies [[`de53c69`](https://github.com/Frontify/brand-sdk/commit/de53c69b43e3f0a9b245cc2b193d6edef390dc00)]: + - @frontify/sidebar-settings@0.9.5 ## 0.33.3 ### Patch Changes -- [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [#776](https://github.com/Frontify/brand-sdk/pull/776) [`29ef8e1`](https://github.com/Frontify/brand-sdk/commit/29ef8e1e64a6372d580af06a86ef39ca2052662a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Remove CJS to embrace ESM +- [#776](https://github.com/Frontify/brand-sdk/pull/776) [`29ef8e1`](https://github.com/Frontify/brand-sdk/commit/29ef8e1e64a6372d580af06a86ef39ca2052662a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Remove CJS to embrace ESM -- Updated dependencies [[`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7), [`29ef8e1`](https://github.com/Frontify/brand-sdk/commit/29ef8e1e64a6372d580af06a86ef39ca2052662a), [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7)]: - - @frontify/sidebar-settings@0.9.4 +- Updated dependencies [[`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7), [`29ef8e1`](https://github.com/Frontify/brand-sdk/commit/29ef8e1e64a6372d580af06a86ef39ca2052662a), [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7)]: + - @frontify/sidebar-settings@0.9.4 ## 0.33.2 ### Patch Changes -- [#766](https://github.com/Frontify/brand-sdk/pull/766) [`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [#766](https://github.com/Frontify/brand-sdk/pull/766) [`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6)]: - - @frontify/sidebar-settings@0.9.3 +- Updated dependencies [[`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6)]: + - @frontify/sidebar-settings@0.9.3 ## 0.33.1 ### Patch Changes -- [#764](https://github.com/Frontify/brand-sdk/pull/764) [`ecd13ce`](https://github.com/Frontify/brand-sdk/commit/ecd13ced94615a5b9fd0d5d0ae5ff726930c556f) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(Toolbar): export `ToolbarFlyoutMenu` component and `ToolbarFlyoutMenuItem` type +- [#764](https://github.com/Frontify/brand-sdk/pull/764) [`ecd13ce`](https://github.com/Frontify/brand-sdk/commit/ecd13ced94615a5b9fd0d5d0ae5ff726930c556f) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(Toolbar): export `ToolbarFlyoutMenu` component and `ToolbarFlyoutMenuItem` type ## 0.33.0 ### Minor Changes -- [#756](https://github.com/Frontify/brand-sdk/pull/756) [`dc4b57d`](https://github.com/Frontify/brand-sdk/commit/dc4b57d698e037cac4d6eca75e45f2ef65e96b47) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - feat(Toolbar): extend `items` to include `menu` and `flyout` type. Each `item` must now contain a `type` prop (`"dragHandle"`, `"button"`, `"flyout"`, `"menu"`). The `flyoutItems` prop has been removed as any item in the items array can now be a flyout. This change is also reflected in the `BlockItemWrapper`, where `toolbarFlyoutItems` has now been removed. +- [#756](https://github.com/Frontify/brand-sdk/pull/756) [`dc4b57d`](https://github.com/Frontify/brand-sdk/commit/dc4b57d698e037cac4d6eca75e45f2ef65e96b47) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - feat(Toolbar): extend `items` to include `menu` and `flyout` type. Each `item` must now contain a `type` prop (`"dragHandle"`, `"button"`, `"flyout"`, `"menu"`). The `flyoutItems` prop has been removed as any item in the items array can now be a flyout. This change is also reflected in the `BlockItemWrapper`, where `toolbarFlyoutItems` has now been removed. Migration Example: @@ -882,14 +876,14 @@ ### Patch Changes -- Updated dependencies [[`7f57867`](https://github.com/Frontify/brand-sdk/commit/7f57867274c7ba21a0a1ab5ecc46852d559d968d)]: - - @frontify/sidebar-settings@0.9.2 +- Updated dependencies [[`7f57867`](https://github.com/Frontify/brand-sdk/commit/7f57867274c7ba21a0a1ab5ecc46852d559d968d)]: + - @frontify/sidebar-settings@0.9.2 ## 0.32.2 ### Patch Changes -- [#749](https://github.com/Frontify/brand-sdk/pull/749) [`5393e3a`](https://github.com/Frontify/brand-sdk/commit/5393e3aed9822bb00521a22b1cc75a62fafb4a59) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - refactor (Toolbar): split Toolbar into smaller subcomponents. `ToolbarFlyoutState` type has been removed, as well as `flyoutMenu.isOpen`, `flyoutMenu.onOpenChange`, `attachments.isOpen`, `attachments.onOpenChange` props that could be passed to the `Toolbar` component. To control the state of open `Flyouts` the `Toolbar` must instead be wrapped in a `MultiFlyoutContextProvider`. +- [#749](https://github.com/Frontify/brand-sdk/pull/749) [`5393e3a`](https://github.com/Frontify/brand-sdk/commit/5393e3aed9822bb00521a22b1cc75a62fafb4a59) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - refactor (Toolbar): split Toolbar into smaller subcomponents. `ToolbarFlyoutState` type has been removed, as well as `flyoutMenu.isOpen`, `flyoutMenu.onOpenChange`, `attachments.isOpen`, `attachments.onOpenChange` props that could be passed to the `Toolbar` component. To control the state of open `Flyouts` the `Toolbar` must instead be wrapped in a `MultiFlyoutContextProvider`. Migration Example: @@ -921,21 +915,21 @@ ) ``` -- [#757](https://github.com/Frontify/brand-sdk/pull/757) [`07f2dd3`](https://github.com/Frontify/brand-sdk/commit/07f2dd356663f678b8912c9bf669834c515f43f7) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(Attachments): allow sorting +- [#757](https://github.com/Frontify/brand-sdk/pull/757) [`07f2dd3`](https://github.com/Frontify/brand-sdk/commit/07f2dd356663f678b8912c9bf669834c515f43f7) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(Attachments): allow sorting -- [#744](https://github.com/Frontify/brand-sdk/pull/744) [`7aad48f`](https://github.com/Frontify/brand-sdk/commit/7aad48f022aab38577cf0233c108b4997587c939) Thanks [@ragi96](https://github.com/ragi96)! - feat: add support for the new color type of app-bridge v4 +- [#744](https://github.com/Frontify/brand-sdk/pull/744) [`7aad48f`](https://github.com/Frontify/brand-sdk/commit/7aad48f022aab38577cf0233c108b4997587c939) Thanks [@ragi96](https://github.com/ragi96)! - feat: add support for the new color type of app-bridge v4 ## 0.32.1 ### Patch Changes -- [#747](https://github.com/Frontify/brand-sdk/pull/747) [`447bf26`](https://github.com/Frontify/brand-sdk/commit/447bf26ad6816f354cc9de91f6451cf807458ffb) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump `tailwindcss` to 3.4.1 +- [#747](https://github.com/Frontify/brand-sdk/pull/747) [`447bf26`](https://github.com/Frontify/brand-sdk/commit/447bf26ad6816f354cc9de91f6451cf807458ffb) Thanks [@SamCreasey](https://github.com/SamCreasey)! - chore: bump `tailwindcss` to 3.4.1 ## 0.32.0 ### Minor Changes -- [#736](https://github.com/Frontify/brand-sdk/pull/736) [`2f7f30f`](https://github.com/Frontify/brand-sdk/commit/2f7f30f902f3c8ed3bacf5fa378014e148bb20aa) Thanks [@ragi96](https://github.com/ragi96)! - refactor(LinkSelector): Removed `appBridge` prop in favor of directly passing document handling functions: `getAllDocuments`, `getDocumentPagesByDocumentId`, and `getDocumentSectionsByDocumentPageId` for clearer API and enhanced modularity +- [#736](https://github.com/Frontify/brand-sdk/pull/736) [`2f7f30f`](https://github.com/Frontify/brand-sdk/commit/2f7f30f902f3c8ed3bacf5fa378014e148bb20aa) Thanks [@ragi96](https://github.com/ragi96)! - refactor(LinkSelector): Removed `appBridge` prop in favor of directly passing document handling functions: `getAllDocuments`, `getDocumentPagesByDocumentId`, and `getDocumentSectionsByDocumentPageId` for clearer API and enhanced modularity Replace this: @@ -967,562 +961,562 @@ ### Patch Changes -- [#728](https://github.com/Frontify/brand-sdk/pull/728) [`9de8764`](https://github.com/Frontify/brand-sdk/commit/9de87643decdbff847c2e29b9aa895773c8321b3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: Add missing path for types in the export list +- [#728](https://github.com/Frontify/brand-sdk/pull/728) [`9de8764`](https://github.com/Frontify/brand-sdk/commit/9de87643decdbff847c2e29b9aa895773c8321b3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix: Add missing path for types in the export list ## 0.31.4 ### Patch Changes -- [#722](https://github.com/Frontify/brand-sdk/pull/722) [`975f9c8`](https://github.com/Frontify/brand-sdk/commit/975f9c86409db9041ebcfa02ad8f684b4e5bc24c) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat: add "label" to customizable options for getBackgroundSettings +- [#722](https://github.com/Frontify/brand-sdk/pull/722) [`975f9c8`](https://github.com/Frontify/brand-sdk/commit/975f9c86409db9041ebcfa02ad8f684b4e5bc24c) Thanks [@SamCreasey](https://github.com/SamCreasey)! - feat: add "label" to customizable options for getBackgroundSettings ## 0.31.3 ### Patch Changes -- [#720](https://github.com/Frontify/brand-sdk/pull/720) [`7b8a520`](https://github.com/Frontify/brand-sdk/commit/7b8a5209df3b2116cf83838e6da2aae3f83fa33f) Thanks [@ragi96](https://github.com/ragi96)! - fix(Attachments): use the appropriate function for removing and adding asset +- [#720](https://github.com/Frontify/brand-sdk/pull/720) [`7b8a520`](https://github.com/Frontify/brand-sdk/commit/7b8a5209df3b2116cf83838e6da2aae3f83fa33f) Thanks [@ragi96](https://github.com/ragi96)! - fix(Attachments): use the appropriate function for removing and adding asset ## 0.31.2 ### Patch Changes -- Updated dependencies [[`68a9298`](https://github.com/Frontify/brand-sdk/commit/68a9298df9e2177e70333f47dc433a056d76625b)]: - - @frontify/app-bridge@3.1.0 +- Updated dependencies [[`68a9298`](https://github.com/Frontify/brand-sdk/commit/68a9298df9e2177e70333f47dc433a056d76625b)]: + - @frontify/app-bridge@3.1.0 ## 0.31.1 ### Patch Changes -- [#708](https://github.com/Frontify/brand-sdk/pull/708) [`e2a0023`](https://github.com/Frontify/brand-sdk/commit/e2a0023256001dcc64a597f6dcd9df66a1c9f186) Thanks [@ragi96](https://github.com/ragi96)! - feat: add support for @frontify/app-bridge 4.0.0-alpha.0 +- [#708](https://github.com/Frontify/brand-sdk/pull/708) [`e2a0023`](https://github.com/Frontify/brand-sdk/commit/e2a0023256001dcc64a597f6dcd9df66a1c9f186) Thanks [@ragi96](https://github.com/ragi96)! - feat: add support for @frontify/app-bridge 4.0.0-alpha.0 -- Updated dependencies [[`c98d8c4`](https://github.com/Frontify/brand-sdk/commit/c98d8c414b2cdd00d4945f0c29581370b0a7daa0)]: - - @frontify/app-bridge@3.0.4 +- Updated dependencies [[`c98d8c4`](https://github.com/Frontify/brand-sdk/commit/c98d8c414b2cdd00d4945f0c29581370b0a7daa0)]: + - @frontify/app-bridge@3.0.4 ## 0.31.0 ### Minor Changes -- [#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 +- [#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 ### Patch Changes -- [#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 +- [#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 -- Updated dependencies [[`759188b`](https://github.com/Frontify/brand-sdk/commit/759188b28219e23ef7ce19edbc2d5e3248270ea8)]: - - @frontify/sidebar-settings@0.9.1 +- Updated dependencies [[`759188b`](https://github.com/Frontify/brand-sdk/commit/759188b28219e23ef7ce19edbc2d5e3248270ea8)]: + - @frontify/sidebar-settings@0.9.1 ## 0.30.2 ### Patch Changes -- [#687](https://github.com/Frontify/brand-sdk/pull/687) [`b044981`](https://github.com/Frontify/brand-sdk/commit/b0449814d55554e82507e1341d0f42a35f17a5e5) Thanks [@ragi96](https://github.com/ragi96)! - chore(Attachments): replace deprecated functions with hooks +- [#687](https://github.com/Frontify/brand-sdk/pull/687) [`b044981`](https://github.com/Frontify/brand-sdk/commit/b0449814d55554e82507e1341d0f42a35f17a5e5) Thanks [@ragi96](https://github.com/ragi96)! - chore(Attachments): replace deprecated functions with hooks -- [#696](https://github.com/Frontify/brand-sdk/pull/696) [`edc00b0`](https://github.com/Frontify/brand-sdk/commit/edc00b0cb1b04753e1563231eb1e28f9e7d05670) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(Attachments): Add line-height class to `AttachmentsButtonTrigger`. +- [#696](https://github.com/Frontify/brand-sdk/pull/696) [`edc00b0`](https://github.com/Frontify/brand-sdk/commit/edc00b0cb1b04753e1563231eb1e28f9e7d05670) Thanks [@SamCreasey](https://github.com/SamCreasey)! - fix(Attachments): Add line-height class to `AttachmentsButtonTrigger`. -- [#695](https://github.com/Frontify/brand-sdk/pull/695) [`d7764c1`](https://github.com/Frontify/brand-sdk/commit/d7764c129ee1d61aaed4ce519e70eb5d0984bfec) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump @frontify/fondue to v12.0.0-beta.395 +- [#695](https://github.com/Frontify/brand-sdk/pull/695) [`d7764c1`](https://github.com/Frontify/brand-sdk/commit/d7764c129ee1d61aaed4ce519e70eb5d0984bfec) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump @frontify/fondue to v12.0.0-beta.395 -- [#689](https://github.com/Frontify/brand-sdk/pull/689) [`6c34c1c`](https://github.com/Frontify/brand-sdk/commit/6c34c1c8e354f95bb873a70bceef0939198574c4) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(Attachments): temporarily disable sorting +- [#689](https://github.com/Frontify/brand-sdk/pull/689) [`6c34c1c`](https://github.com/Frontify/brand-sdk/commit/6c34c1c8e354f95bb873a70bceef0939198574c4) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(Attachments): temporarily disable sorting -- Updated dependencies [[`d79e69a`](https://github.com/Frontify/brand-sdk/commit/d79e69a1c6d8f901b7f91866a92fd0d99363f07d), [`d7764c1`](https://github.com/Frontify/brand-sdk/commit/d7764c129ee1d61aaed4ce519e70eb5d0984bfec)]: - - @frontify/sidebar-settings@0.9.0 +- Updated dependencies [[`d79e69a`](https://github.com/Frontify/brand-sdk/commit/d79e69a1c6d8f901b7f91866a92fd0d99363f07d), [`d7764c1`](https://github.com/Frontify/brand-sdk/commit/d7764c129ee1d61aaed4ce519e70eb5d0984bfec)]: + - @frontify/sidebar-settings@0.9.0 ## 0.30.1 ### Patch Changes -- [#691](https://github.com/Frontify/brand-sdk/pull/691) [`2a2f106`](https://github.com/Frontify/brand-sdk/commit/2a2f106c0f79c7d43dfddf3d0193fa9eeb7835a3) Thanks [@SamCreasey](https://github.com/SamCreasey)! - Toolbar components and types have been made available in build +- [#691](https://github.com/Frontify/brand-sdk/pull/691) [`2a2f106`](https://github.com/Frontify/brand-sdk/commit/2a2f106c0f79c7d43dfddf3d0193fa9eeb7835a3) Thanks [@SamCreasey](https://github.com/SamCreasey)! - Toolbar components and types have been made available in build -- [#692](https://github.com/Frontify/brand-sdk/pull/692) [`43866c2`](https://github.com/Frontify/brand-sdk/commit/43866c28fa470d5dbf4e61a7d42796904629fead) Thanks [@SamCreasey](https://github.com/SamCreasey)! - BlockItemToolbar: Force line-height to be 1 on toolbar items to prevent wrapping element height from being miscalculated. +- [#692](https://github.com/Frontify/brand-sdk/pull/692) [`43866c2`](https://github.com/Frontify/brand-sdk/commit/43866c28fa470d5dbf4e61a7d42796904629fead) Thanks [@SamCreasey](https://github.com/SamCreasey)! - BlockItemToolbar: Force line-height to be 1 on toolbar items to prevent wrapping element height from being miscalculated. -- Updated dependencies [[`3fa74ba`](https://github.com/Frontify/brand-sdk/commit/3fa74badfedd8c52661f23e0528dc35d8a10062d)]: - - @frontify/app-bridge@3.0.2 - - @frontify/sidebar-settings@0.8.3 +- Updated dependencies [[`3fa74ba`](https://github.com/Frontify/brand-sdk/commit/3fa74badfedd8c52661f23e0528dc35d8a10062d)]: + - @frontify/app-bridge@3.0.2 + - @frontify/sidebar-settings@0.8.3 ## 0.30.0 ### Minor Changes -- [#672](https://github.com/Frontify/brand-sdk/pull/672) [`22eb8eb`](https://github.com/Frontify/brand-sdk/commit/22eb8eb8dce8f2d4dccf040376b3368b2962a59b) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - Toolbar design updated - - Add Attachments to the Toolbar component. `isFlyoutOpen`, `setIsFlyoutOpen` and `flyoutItems` props have been removed from the Toolbar and replaced - with a `flyoutMenu` object (`{ items: FlyoutItem[]; isOpen: boolean; onOpenChange: (isOpen: boolean)=>void }`). - `isFlyoutDisabled` prop has been removed. - `attachments` prop has been added (`{ isEnabled: boolean; isOpen: boolean; onOpenChange: (isOpen: boolean)=>void }`). - To enable block attachments in the Toolbar from the `BlockWrapper` component, set `showAttachments` to `true` and wrap the block in the `withAttachmentsProvider` HOC or alternatively, wrap the `BlockWrapper` in an `AttachmentsProvider`. - - `onAddAttachments` has been replaced with `onAttachmentsAdd` in the object returned from `useAttachments` hook. +- [#672](https://github.com/Frontify/brand-sdk/pull/672) [`22eb8eb`](https://github.com/Frontify/brand-sdk/commit/22eb8eb8dce8f2d4dccf040376b3368b2962a59b) Thanks [@SamCreasey](https://github.com/SamCreasey)! - - Toolbar design updated + - Add Attachments to the Toolbar component. `isFlyoutOpen`, `setIsFlyoutOpen` and `flyoutItems` props have been removed from the Toolbar and replaced + with a `flyoutMenu` object (`{ items: FlyoutItem[]; isOpen: boolean; onOpenChange: (isOpen: boolean)=>void }`). + `isFlyoutDisabled` prop has been removed. + `attachments` prop has been added (`{ isEnabled: boolean; isOpen: boolean; onOpenChange: (isOpen: boolean)=>void }`). + To enable block attachments in the Toolbar from the `BlockWrapper` component, set `showAttachments` to `true` and wrap the block in the `withAttachmentsProvider` HOC or alternatively, wrap the `BlockWrapper` in an `AttachmentsProvider`. + - `onAddAttachments` has been replaced with `onAttachmentsAdd` in the object returned from `useAttachments` hook. ### Patch Changes -- [#679](https://github.com/Frontify/brand-sdk/pull/679) [`61edea9`](https://github.com/Frontify/brand-sdk/commit/61edea939fc9c2c64badafb054a5c254c8cef580) Thanks [@ragi96](https://github.com/ragi96)! - feat(Attachments): replace download function to use the appBridge +- [#679](https://github.com/Frontify/brand-sdk/pull/679) [`61edea9`](https://github.com/Frontify/brand-sdk/commit/61edea939fc9c2c64badafb054a5c254c8cef580) Thanks [@ragi96](https://github.com/ragi96)! - feat(Attachments): replace download function to use the appBridge ## 0.29.17 ### Patch Changes -- Updated dependencies [[`a2b2ee7`](https://github.com/Frontify/brand-sdk/commit/a2b2ee78b8df136c823a3603c284aba4db08bbf7)]: - - @frontify/app-bridge@3.0.1 - - @frontify/sidebar-settings@0.8.2 +- Updated dependencies [[`a2b2ee7`](https://github.com/Frontify/brand-sdk/commit/a2b2ee78b8df136c823a3603c284aba4db08bbf7)]: + - @frontify/app-bridge@3.0.1 + - @frontify/sidebar-settings@0.8.2 ## 0.29.16 ### Patch Changes -- [#652](https://github.com/Frontify/brand-sdk/pull/652) [`eef2c98`](https://github.com/Frontify/brand-sdk/commit/eef2c982e12c50d6b5bd573c2ba73266a8a78ec8) Thanks [@mikeyrayvon](https://github.com/mikeyrayvon)! - feat: export type FlyoutToolbarItem +- [#652](https://github.com/Frontify/brand-sdk/pull/652) [`eef2c98`](https://github.com/Frontify/brand-sdk/commit/eef2c982e12c50d6b5bd573c2ba73266a8a78ec8) Thanks [@mikeyrayvon](https://github.com/mikeyrayvon)! - feat: export type FlyoutToolbarItem ## 0.29.15 ### Patch Changes -- [#636](https://github.com/Frontify/brand-sdk/pull/636) [`1dbc48e`](https://github.com/Frontify/brand-sdk/commit/1dbc48e9b8421a893d0b2da8f17ac201abc2b113) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [#636](https://github.com/Frontify/brand-sdk/pull/636) [`1dbc48e`](https://github.com/Frontify/brand-sdk/commit/1dbc48e9b8421a893d0b2da8f17ac201abc2b113) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`728cfd9`](https://github.com/Frontify/brand-sdk/commit/728cfd9e16a5c286fda4b2ae31dd96118c811929), [`1dbc48e`](https://github.com/Frontify/brand-sdk/commit/1dbc48e9b8421a893d0b2da8f17ac201abc2b113)]: - - @frontify/app-bridge@3.0.0 - - @frontify/sidebar-settings@0.8.1 +- Updated dependencies [[`728cfd9`](https://github.com/Frontify/brand-sdk/commit/728cfd9e16a5c286fda4b2ae31dd96118c811929), [`1dbc48e`](https://github.com/Frontify/brand-sdk/commit/1dbc48e9b8421a893d0b2da8f17ac201abc2b113)]: + - @frontify/app-bridge@3.0.0 + - @frontify/sidebar-settings@0.8.1 ## 0.29.14 ### Patch Changes -- Updated dependencies [[`13ca57e`](https://github.com/Frontify/brand-sdk/commit/13ca57e7440e5d7175e54109b89eb8dc60eee4fd), [`d55bd9f`](https://github.com/Frontify/brand-sdk/commit/d55bd9f39fdfa6e5c45a80744c058a605d81c893)]: - - @frontify/sidebar-settings@0.8.0 +- Updated dependencies [[`13ca57e`](https://github.com/Frontify/brand-sdk/commit/13ca57e7440e5d7175e54109b89eb8dc60eee4fd), [`d55bd9f`](https://github.com/Frontify/brand-sdk/commit/d55bd9f39fdfa6e5c45a80744c058a605d81c893)]: + - @frontify/sidebar-settings@0.8.0 ## 0.29.13 ### Patch Changes -- Updated dependencies [[`dfe83ee`](https://github.com/Frontify/brand-sdk/commit/dfe83ee7417d3916d9bc52b96e600deb130bf147), [`8920ec9`](https://github.com/Frontify/brand-sdk/commit/8920ec993401caf94813974c7fad476c3decc2c6)]: - - @frontify/sidebar-settings@0.7.0 +- Updated dependencies [[`dfe83ee`](https://github.com/Frontify/brand-sdk/commit/dfe83ee7417d3916d9bc52b96e600deb130bf147), [`8920ec9`](https://github.com/Frontify/brand-sdk/commit/8920ec993401caf94813974c7fad476c3decc2c6)]: + - @frontify/sidebar-settings@0.7.0 ## 0.29.12 ### Patch Changes -- [#628](https://github.com/Frontify/brand-sdk/pull/628) [`44efda9`](https://github.com/Frontify/brand-sdk/commit/44efda90fd454298ea623c7f41b370f81ad1a203) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockItemWRapper): fix toolbar focus style +- [#628](https://github.com/Frontify/brand-sdk/pull/628) [`44efda9`](https://github.com/Frontify/brand-sdk/commit/44efda90fd454298ea623c7f41b370f81ad1a203) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockItemWRapper): fix toolbar focus style ## 0.29.11 ### Patch Changes -- [#622](https://github.com/Frontify/brand-sdk/pull/622) [`34aa320`](https://github.com/Frontify/brand-sdk/commit/34aa32063c306826d35a6b973c3e5f6931dabc76) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockItemWrapper): add focus visible style to drag btn +- [#622](https://github.com/Frontify/brand-sdk/pull/622) [`34aa320`](https://github.com/Frontify/brand-sdk/commit/34aa32063c306826d35a6b973c3e5f6931dabc76) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(BlockItemWrapper): add focus visible style to drag btn ## 0.29.10 ### Patch Changes -- [#591](https://github.com/Frontify/brand-sdk/pull/591) [`076ee92`](https://github.com/Frontify/brand-sdk/commit/076ee92016edadc2c775072db7c9df40c6968032) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.341 +- [#591](https://github.com/Frontify/brand-sdk/pull/591) [`076ee92`](https://github.com/Frontify/brand-sdk/commit/076ee92016edadc2c775072db7c9df40c6968032) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.341 -- Updated dependencies [[`076ee92`](https://github.com/Frontify/brand-sdk/commit/076ee92016edadc2c775072db7c9df40c6968032)]: - - @frontify/sidebar-settings@0.6.13 +- Updated dependencies [[`076ee92`](https://github.com/Frontify/brand-sdk/commit/076ee92016edadc2c775072db7c9df40c6968032)]: + - @frontify/sidebar-settings@0.6.13 ## 0.29.9 ### Patch Changes -- [#583](https://github.com/Frontify/brand-sdk/pull/583) [`aed99a3`](https://github.com/Frontify/brand-sdk/commit/aed99a3a62e58c7b9436f8f031c64ac024566c2c) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.337 +- [#583](https://github.com/Frontify/brand-sdk/pull/583) [`aed99a3`](https://github.com/Frontify/brand-sdk/commit/aed99a3a62e58c7b9436f8f031c64ac024566c2c) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.337 -- Updated dependencies [[`aed99a3`](https://github.com/Frontify/brand-sdk/commit/aed99a3a62e58c7b9436f8f031c64ac024566c2c)]: - - @frontify/sidebar-settings@0.6.12 +- Updated dependencies [[`aed99a3`](https://github.com/Frontify/brand-sdk/commit/aed99a3a62e58c7b9436f8f031c64ac024566c2c)]: + - @frontify/sidebar-settings@0.6.12 ## 0.29.8 ### Patch Changes -- [#577](https://github.com/Frontify/brand-sdk/pull/577) [`2c17f39`](https://github.com/Frontify/brand-sdk/commit/2c17f396b7f3670cf8c9c041937a414bcd22ae94) Thanks [@ragi96](https://github.com/ragi96)! - feat: add autoFormatPlugin to defaultPluginsWithLinkChooser +- [#577](https://github.com/Frontify/brand-sdk/pull/577) [`2c17f39`](https://github.com/Frontify/brand-sdk/commit/2c17f396b7f3670cf8c9c041937a414bcd22ae94) Thanks [@ragi96](https://github.com/ragi96)! - feat: add autoFormatPlugin to defaultPluginsWithLinkChooser -- [#570](https://github.com/Frontify/brand-sdk/pull/570) [`9b2e5f3`](https://github.com/Frontify/brand-sdk/commit/9b2e5f3853832dfa3cf0ec9fe0ec2ad1c5927d23) Thanks [@ragi96](https://github.com/ragi96)! - fix(RTE): list style inconsistent between view and edit mode +- [#570](https://github.com/Frontify/brand-sdk/pull/570) [`9b2e5f3`](https://github.com/Frontify/brand-sdk/commit/9b2e5f3853832dfa3cf0ec9fe0ec2ad1c5927d23) Thanks [@ragi96](https://github.com/ragi96)! - fix(RTE): list style inconsistent between view and edit mode -- [#577](https://github.com/Frontify/brand-sdk/pull/577) [`2c17f39`](https://github.com/Frontify/brand-sdk/commit/2c17f396b7f3670cf8c9c041937a414bcd22ae94) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.334 +- [#577](https://github.com/Frontify/brand-sdk/pull/577) [`2c17f39`](https://github.com/Frontify/brand-sdk/commit/2c17f396b7f3670cf8c9c041937a414bcd22ae94) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.334 -- [#574](https://github.com/Frontify/brand-sdk/pull/574) [`a025aee`](https://github.com/Frontify/brand-sdk/commit/a025aeecfd3647a7bd75d139d9309310092d5b54) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(LinkSelector): initial click triggered twice +- [#574](https://github.com/Frontify/brand-sdk/pull/574) [`a025aee`](https://github.com/Frontify/brand-sdk/commit/a025aeecfd3647a7bd75d139d9309310092d5b54) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(LinkSelector): initial click triggered twice -- Updated dependencies [[`2c17f39`](https://github.com/Frontify/brand-sdk/commit/2c17f396b7f3670cf8c9c041937a414bcd22ae94)]: - - @frontify/sidebar-settings@0.6.11 +- Updated dependencies [[`2c17f39`](https://github.com/Frontify/brand-sdk/commit/2c17f396b7f3670cf8c9c041937a414bcd22ae94)]: + - @frontify/sidebar-settings@0.6.11 ## 0.29.7 ### Patch Changes -- [#566](https://github.com/Frontify/brand-sdk/pull/566) [`ece6876`](https://github.com/Frontify/brand-sdk/commit/ece68765bcd1675cf32f9fd20b77c8dd5e665ee1) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.324 +- [#566](https://github.com/Frontify/brand-sdk/pull/566) [`ece6876`](https://github.com/Frontify/brand-sdk/commit/ece68765bcd1675cf32f9fd20b77c8dd5e665ee1) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.324 -- Updated dependencies [[`ece6876`](https://github.com/Frontify/brand-sdk/commit/ece68765bcd1675cf32f9fd20b77c8dd5e665ee1)]: - - @frontify/sidebar-settings@0.6.10 +- Updated dependencies [[`ece6876`](https://github.com/Frontify/brand-sdk/commit/ece68765bcd1675cf32f9fd20b77c8dd5e665ee1)]: + - @frontify/sidebar-settings@0.6.10 ## 0.29.6 ### Patch Changes -- [#560](https://github.com/Frontify/brand-sdk/pull/560) [`7460f29`](https://github.com/Frontify/brand-sdk/commit/7460f298fa346f89da7de2a0465c12c077e22f05) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.319 +- [#560](https://github.com/Frontify/brand-sdk/pull/560) [`7460f29`](https://github.com/Frontify/brand-sdk/commit/7460f298fa346f89da7de2a0465c12c077e22f05) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.319 -- [#559](https://github.com/Frontify/brand-sdk/pull/559) [`0a75910`](https://github.com/Frontify/brand-sdk/commit/0a75910955da33d6866af1f42e82280f64118701) Thanks [@ragi96](https://github.com/ragi96)! - fix: button plugin add margins to button +- [#559](https://github.com/Frontify/brand-sdk/pull/559) [`0a75910`](https://github.com/Frontify/brand-sdk/commit/0a75910955da33d6866af1f42e82280f64118701) Thanks [@ragi96](https://github.com/ragi96)! - fix: button plugin add margins to button -- [#564](https://github.com/Frontify/brand-sdk/pull/564) [`3684397`](https://github.com/Frontify/brand-sdk/commit/368439792d855bbc5117f97931b7d52f75295677) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.321 +- [#564](https://github.com/Frontify/brand-sdk/pull/564) [`3684397`](https://github.com/Frontify/brand-sdk/commit/368439792d855bbc5117f97931b7d52f75295677) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.321 -- [#563](https://github.com/Frontify/brand-sdk/pull/563) [`c3b2f6c`](https://github.com/Frontify/brand-sdk/commit/c3b2f6cb86844a10cc7ff2d4ef8802945d5d1e5b) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): edit modal styles can be invisible +- [#563](https://github.com/Frontify/brand-sdk/pull/563) [`c3b2f6c`](https://github.com/Frontify/brand-sdk/commit/c3b2f6cb86844a10cc7ff2d4ef8802945d5d1e5b) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): edit modal styles can be invisible -- Updated dependencies [[`7460f29`](https://github.com/Frontify/brand-sdk/commit/7460f298fa346f89da7de2a0465c12c077e22f05), [`3684397`](https://github.com/Frontify/brand-sdk/commit/368439792d855bbc5117f97931b7d52f75295677)]: - - @frontify/sidebar-settings@0.6.9 +- Updated dependencies [[`7460f29`](https://github.com/Frontify/brand-sdk/commit/7460f298fa346f89da7de2a0465c12c077e22f05), [`3684397`](https://github.com/Frontify/brand-sdk/commit/368439792d855bbc5117f97931b7d52f75295677)]: + - @frontify/sidebar-settings@0.6.9 ## 0.29.5 ### Patch Changes -- [#548](https://github.com/Frontify/brand-sdk/pull/548) [`792804d`](https://github.com/Frontify/brand-sdk/commit/792804d17bca975a598ff9f919ee70cb1a09e720) Thanks [@ragi96](https://github.com/ragi96)! - fix: blockItemWrapper Toolbar z-index +- [#548](https://github.com/Frontify/brand-sdk/pull/548) [`792804d`](https://github.com/Frontify/brand-sdk/commit/792804d17bca975a598ff9f919ee70cb1a09e720) Thanks [@ragi96](https://github.com/ragi96)! - fix: blockItemWrapper Toolbar z-index ## 0.29.4 ### Patch Changes -- [#546](https://github.com/Frontify/brand-sdk/pull/546) [`69d862e`](https://github.com/Frontify/brand-sdk/commit/69d862e966954d521bdd856280c76f6a40483be8) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump app-bridge +- [#546](https://github.com/Frontify/brand-sdk/pull/546) [`69d862e`](https://github.com/Frontify/brand-sdk/commit/69d862e966954d521bdd856280c76f6a40483be8) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump app-bridge -- [`6c5d4f6`](https://github.com/Frontify/brand-sdk/commit/6c5d4f63ef8c5995790aa444dc29469b095d63ba) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Change App Bridge dependency selector +- [`6c5d4f6`](https://github.com/Frontify/brand-sdk/commit/6c5d4f63ef8c5995790aa444dc29469b095d63ba) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Change App Bridge dependency selector -- Updated dependencies [[`69d862e`](https://github.com/Frontify/brand-sdk/commit/69d862e966954d521bdd856280c76f6a40483be8), [`6c5d4f6`](https://github.com/Frontify/brand-sdk/commit/6c5d4f63ef8c5995790aa444dc29469b095d63ba)]: - - @frontify/sidebar-settings@0.6.8 +- Updated dependencies [[`69d862e`](https://github.com/Frontify/brand-sdk/commit/69d862e966954d521bdd856280c76f6a40483be8), [`6c5d4f6`](https://github.com/Frontify/brand-sdk/commit/6c5d4f63ef8c5995790aa444dc29469b095d63ba)]: + - @frontify/sidebar-settings@0.6.8 ## 0.29.3 ### Patch Changes -- [#545](https://github.com/Frontify/brand-sdk/pull/545) [`755bcc0`](https://github.com/Frontify/brand-sdk/commit/755bcc0ec121da805a69ab6c9a48854cb97a71be) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): default target is \_blank instead of \_self +- [#545](https://github.com/Frontify/brand-sdk/pull/545) [`755bcc0`](https://github.com/Frontify/brand-sdk/commit/755bcc0ec121da805a69ab6c9a48854cb97a71be) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): default target is \_blank instead of \_self -- [#543](https://github.com/Frontify/brand-sdk/pull/543) [`29c8128`](https://github.com/Frontify/brand-sdk/commit/29c8128c113ce2163a22274e5440c8df05025777) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.315 +- [#543](https://github.com/Frontify/brand-sdk/pull/543) [`29c8128`](https://github.com/Frontify/brand-sdk/commit/29c8128c113ce2163a22274e5440c8df05025777) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.315 -- [#545](https://github.com/Frontify/brand-sdk/pull/545) [`755bcc0`](https://github.com/Frontify/brand-sdk/commit/755bcc0ec121da805a69ab6c9a48854cb97a71be) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue +- [#545](https://github.com/Frontify/brand-sdk/pull/545) [`755bcc0`](https://github.com/Frontify/brand-sdk/commit/755bcc0ec121da805a69ab6c9a48854cb97a71be) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - chore: bump fondue -- Updated dependencies [[`29c8128`](https://github.com/Frontify/brand-sdk/commit/29c8128c113ce2163a22274e5440c8df05025777), [`755bcc0`](https://github.com/Frontify/brand-sdk/commit/755bcc0ec121da805a69ab6c9a48854cb97a71be)]: - - @frontify/sidebar-settings@0.6.7 +- Updated dependencies [[`29c8128`](https://github.com/Frontify/brand-sdk/commit/29c8128c113ce2163a22274e5440c8df05025777), [`755bcc0`](https://github.com/Frontify/brand-sdk/commit/755bcc0ec121da805a69ab6c9a48854cb97a71be)]: + - @frontify/sidebar-settings@0.6.7 ## 0.29.2 ### Patch Changes -- [#540](https://github.com/Frontify/brand-sdk/pull/540) [`98f876a`](https://github.com/Frontify/brand-sdk/commit/98f876a05cec68c51e9a6986b38bde3cf08597e7) Thanks [@ragi96](https://github.com/ragi96)! - fix: improving the toolbar style +- [#540](https://github.com/Frontify/brand-sdk/pull/540) [`98f876a`](https://github.com/Frontify/brand-sdk/commit/98f876a05cec68c51e9a6986b38bde3cf08597e7) Thanks [@ragi96](https://github.com/ragi96)! - fix: improving the toolbar style -- [#542](https://github.com/Frontify/brand-sdk/pull/542) [`eea4b74`](https://github.com/Frontify/brand-sdk/commit/eea4b746ccd69e2a96251b7d0e909237c20ca0ae) Thanks [@ragi96](https://github.com/ragi96)! - fix: BlockItemWrapper type issue +- [#542](https://github.com/Frontify/brand-sdk/pull/542) [`eea4b74`](https://github.com/Frontify/brand-sdk/commit/eea4b746ccd69e2a96251b7d0e909237c20ca0ae) Thanks [@ragi96](https://github.com/ragi96)! - fix: BlockItemWrapper type issue -- [#539](https://github.com/Frontify/brand-sdk/pull/539) [`5e94f00`](https://github.com/Frontify/brand-sdk/commit/5e94f00401dbe7451e2b90c157e89f808bd2fa06) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): link edit looks for button instead of a tags +- [#539](https://github.com/Frontify/brand-sdk/pull/539) [`5e94f00`](https://github.com/Frontify/brand-sdk/commit/5e94f00401dbe7451e2b90c157e89f808bd2fa06) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(RTE): link edit looks for button instead of a tags ## 0.29.1 ### Patch Changes -- [`2df4a2e`](https://github.com/Frontify/brand-sdk/commit/2df4a2ef0830c7d4a72a5b77e86d0645e33ad757) Thanks [@ragi96](https://github.com/ragi96)! - fix: export TextStyles enum correctly +- [`2df4a2e`](https://github.com/Frontify/brand-sdk/commit/2df4a2ef0830c7d4a72a5b77e86d0645e33ad757) Thanks [@ragi96](https://github.com/ragi96)! - fix: export TextStyles enum correctly -- [`3c1e752`](https://github.com/Frontify/brand-sdk/commit/3c1e7520967c5055c944a0f1afe6b41e046dcdd8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`3c1e752`](https://github.com/Frontify/brand-sdk/commit/3c1e7520967c5055c944a0f1afe6b41e046dcdd8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`9199d24`](https://github.com/Frontify/brand-sdk/commit/9199d24dd1221640687d6d157897eedc40ed3d43) Thanks [@ragi96](https://github.com/ragi96)! - fix: BlockItemWrapper typing issue +- [`9199d24`](https://github.com/Frontify/brand-sdk/commit/9199d24dd1221640687d6d157897eedc40ed3d43) Thanks [@ragi96](https://github.com/ragi96)! - fix: BlockItemWrapper typing issue -- Updated dependencies [[`3c1e752`](https://github.com/Frontify/brand-sdk/commit/3c1e7520967c5055c944a0f1afe6b41e046dcdd8)]: - - @frontify/sidebar-settings@0.6.6 +- Updated dependencies [[`3c1e752`](https://github.com/Frontify/brand-sdk/commit/3c1e7520967c5055c944a0f1afe6b41e046dcdd8)]: + - @frontify/sidebar-settings@0.6.6 ## 0.29.0 ### Minor Changes -- [#504](https://github.com/Frontify/brand-sdk/pull/504) [`b0d2b28`](https://github.com/Frontify/brand-sdk/commit/b0d2b28838e917a4fb3332a1f043ee29d8060752) Thanks [@ragi96](https://github.com/ragi96)! - refactor: use Fondue serializer instead of internal version +- [#504](https://github.com/Frontify/brand-sdk/pull/504) [`b0d2b28`](https://github.com/Frontify/brand-sdk/commit/b0d2b28838e917a4fb3332a1f043ee29d8060752) Thanks [@ragi96](https://github.com/ragi96)! - refactor: use Fondue serializer instead of internal version ### Patch Changes -- [#504](https://github.com/Frontify/brand-sdk/pull/504) [`b0d2b28`](https://github.com/Frontify/brand-sdk/commit/b0d2b28838e917a4fb3332a1f043ee29d8060752) Thanks [@ragi96](https://github.com/ragi96)! - Update dependencies +- [#504](https://github.com/Frontify/brand-sdk/pull/504) [`b0d2b28`](https://github.com/Frontify/brand-sdk/commit/b0d2b28838e917a4fb3332a1f043ee29d8060752) Thanks [@ragi96](https://github.com/ragi96)! - Update dependencies -- Updated dependencies [[`b0d2b28`](https://github.com/Frontify/brand-sdk/commit/b0d2b28838e917a4fb3332a1f043ee29d8060752)]: - - @frontify/sidebar-settings@0.6.5 +- Updated dependencies [[`b0d2b28`](https://github.com/Frontify/brand-sdk/commit/b0d2b28838e917a4fb3332a1f043ee29d8060752)]: + - @frontify/sidebar-settings@0.6.5 ## 0.28.6 ### Patch Changes -- [#522](https://github.com/Frontify/brand-sdk/pull/522) [`0fdb3c7`](https://github.com/Frontify/brand-sdk/commit/0fdb3c79590964ba0e66f0c95e2a30ea8a34836b) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.309 +- [#522](https://github.com/Frontify/brand-sdk/pull/522) [`0fdb3c7`](https://github.com/Frontify/brand-sdk/commit/0fdb3c79590964ba0e66f0c95e2a30ea8a34836b) Thanks [@ragi96](https://github.com/ragi96)! - chore: bump fondue to v12.0.0-beta.309 -- [#524](https://github.com/Frontify/brand-sdk/pull/524) [`c0b8cff`](https://github.com/Frontify/brand-sdk/commit/c0b8cff9b69f4cc5f83ebd150d3640fe50da501d) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(types): extend app bridge type +- [#524](https://github.com/Frontify/brand-sdk/pull/524) [`c0b8cff`](https://github.com/Frontify/brand-sdk/commit/c0b8cff9b69f4cc5f83ebd150d3640fe50da501d) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - fix(types): extend app bridge type -- Updated dependencies [[`0fdb3c7`](https://github.com/Frontify/brand-sdk/commit/0fdb3c79590964ba0e66f0c95e2a30ea8a34836b)]: - - @frontify/sidebar-settings@0.6.4 +- Updated dependencies [[`0fdb3c7`](https://github.com/Frontify/brand-sdk/commit/0fdb3c79590964ba0e66f0c95e2a30ea8a34836b)]: + - @frontify/sidebar-settings@0.6.4 ## 0.28.5 ### Patch Changes -- [#502](https://github.com/Frontify/brand-sdk/pull/502) [`d1a60e9`](https://github.com/Frontify/brand-sdk/commit/d1a60e9fabb2920d3fc716e18f58d8de1527ab26) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): add link selector +- [#502](https://github.com/Frontify/brand-sdk/pull/502) [`d1a60e9`](https://github.com/Frontify/brand-sdk/commit/d1a60e9fabb2920d3fc716e18f58d8de1527ab26) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): add link selector -- Updated dependencies [[`d1a60e9`](https://github.com/Frontify/brand-sdk/commit/d1a60e9fabb2920d3fc716e18f58d8de1527ab26)]: - - @frontify/sidebar-settings@0.6.3 +- Updated dependencies [[`d1a60e9`](https://github.com/Frontify/brand-sdk/commit/d1a60e9fabb2920d3fc716e18f58d8de1527ab26)]: + - @frontify/sidebar-settings@0.6.3 ## 0.28.4 ### Patch Changes -- [#503](https://github.com/Frontify/brand-sdk/pull/503) [`c56e7e9`](https://github.com/Frontify/brand-sdk/commit/c56e7e9112e04ae0e9ae35e4b7a98c11665045f2) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RTE): add dir to serializer +- [#503](https://github.com/Frontify/brand-sdk/pull/503) [`c56e7e9`](https://github.com/Frontify/brand-sdk/commit/c56e7e9112e04ae0e9ae35e4b7a98c11665045f2) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(RTE): add dir to serializer -- [`22684e3`](https://github.com/Frontify/brand-sdk/commit/22684e358fd2b073790a0959606c6a5d44e35c4e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`22684e3`](https://github.com/Frontify/brand-sdk/commit/22684e358fd2b073790a0959606c6a5d44e35c4e) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`22684e3`](https://github.com/Frontify/brand-sdk/commit/22684e358fd2b073790a0959606c6a5d44e35c4e)]: - - @frontify/sidebar-settings@0.6.2 +- Updated dependencies [[`22684e3`](https://github.com/Frontify/brand-sdk/commit/22684e358fd2b073790a0959606c6a5d44e35c4e)]: + - @frontify/sidebar-settings@0.6.2 ## 0.28.3 ### Patch Changes -- [`07624cb`](https://github.com/Frontify/brand-sdk/commit/07624cb8fba8d9ede4e5ea5db43780658f69f0ba) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix react being bundled into the package +- [`07624cb`](https://github.com/Frontify/brand-sdk/commit/07624cb8fba8d9ede4e5ea5db43780658f69f0ba) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix react being bundled into the package ## 0.28.2 ### Patch Changes -- [`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix issues with styles export +- [`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix issues with styles export -- Updated dependencies [[`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3)]: - - @frontify/sidebar-settings@0.6.1 +- Updated dependencies [[`fa969e9`](https://github.com/Frontify/brand-sdk/commit/fa969e90c980411273ff3c8c6f015b303fd59fe3)]: + - @frontify/sidebar-settings@0.6.1 ## 0.28.1 ### Patch Changes -- [`382f7fb`](https://github.com/Frontify/brand-sdk/commit/382f7fbde444170f8f7b90d2ab655edbfd260692) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix build +- [`382f7fb`](https://github.com/Frontify/brand-sdk/commit/382f7fbde444170f8f7b90d2ab655edbfd260692) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix build ## 0.28.0 ### Minor Changes -- [#453](https://github.com/Frontify/brand-sdk/pull/453) [`0807349`](https://github.com/Frontify/brand-sdk/commit/0807349856fe972953493c253ac8e4ce352d3ede) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - Added components, helpers and utilities to simplify Blocks development +- [#453](https://github.com/Frontify/brand-sdk/pull/453) [`0807349`](https://github.com/Frontify/brand-sdk/commit/0807349856fe972953493c253ac8e4ce352d3ede) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - Added components, helpers and utilities to simplify Blocks development -- [#466](https://github.com/Frontify/brand-sdk/pull/466) [`9f81a23`](https://github.com/Frontify/brand-sdk/commit/9f81a2363cd3c842d0ac5c014e0b07c46a3a1cca) Thanks [@triggertoo](https://github.com/triggertoo)! - Remove downloadAsset helper since it's unrelated to the settings +- [#466](https://github.com/Frontify/brand-sdk/pull/466) [`9f81a23`](https://github.com/Frontify/brand-sdk/commit/9f81a2363cd3c842d0ac5c014e0b07c46a3a1cca) Thanks [@triggertoo](https://github.com/triggertoo)! - Remove downloadAsset helper since it's unrelated to the settings ### Patch Changes -- [#482](https://github.com/Frontify/brand-sdk/pull/482) [`6b18a74`](https://github.com/Frontify/brand-sdk/commit/6b18a74794612f61bd2e34ea8fdd4572ebb5274e) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): update shared folder with latest changes +- [#482](https://github.com/Frontify/brand-sdk/pull/482) [`6b18a74`](https://github.com/Frontify/brand-sdk/commit/6b18a74794612f61bd2e34ea8fdd4572ebb5274e) Thanks [@fulopdaniel](https://github.com/fulopdaniel)! - feat(\*): update shared folder with latest changes -- Updated dependencies [[`4105251`](https://github.com/Frontify/brand-sdk/commit/4105251969f8ae639014a013a2cbc88df8e4935d), [`af49f65`](https://github.com/Frontify/brand-sdk/commit/af49f6572592522a550f970c98e3d8fd2d377cc3)]: - - @frontify/sidebar-settings@0.6.0 +- Updated dependencies [[`4105251`](https://github.com/Frontify/brand-sdk/commit/4105251969f8ae639014a013a2cbc88df8e4935d), [`af49f65`](https://github.com/Frontify/brand-sdk/commit/af49f6572592522a550f970c98e3d8fd2d377cc3)]: + - @frontify/sidebar-settings@0.6.0 ## 0.27.0 ### Minor Changes -- [#447](https://github.com/Frontify/brand-sdk/pull/447) [`86d8e33`](https://github.com/Frontify/brand-sdk/commit/86d8e333896642ca076aab4aeec3620f2d6d20b3) Thanks [@julianiff](https://github.com/julianiff)! - Allow function return (sync or async) for `defineSettings` +- [#447](https://github.com/Frontify/brand-sdk/pull/447) [`86d8e33`](https://github.com/Frontify/brand-sdk/commit/86d8e333896642ca076aab4aeec3620f2d6d20b3) Thanks [@julianiff](https://github.com/julianiff)! - Allow function return (sync or async) for `defineSettings` ### Patch Changes -- Updated dependencies [[`3eabb89`](https://github.com/Frontify/brand-sdk/commit/3eabb8959c2b68be50ab1bcef3996100ed877864), [`33e0a8f`](https://github.com/Frontify/brand-sdk/commit/33e0a8f49de433aca8cc06bafed6e5515b755dd2)]: - - @frontify/sidebar-settings@0.5.0 +- Updated dependencies [[`3eabb89`](https://github.com/Frontify/brand-sdk/commit/3eabb8959c2b68be50ab1bcef3996100ed877864), [`33e0a8f`](https://github.com/Frontify/brand-sdk/commit/33e0a8f49de433aca8cc06bafed6e5515b755dd2)]: + - @frontify/sidebar-settings@0.5.0 ## 0.26.8 ### Patch Changes -- [#426](https://github.com/Frontify/brand-sdk/pull/426) [`7729287`](https://github.com/Frontify/brand-sdk/commit/77292877e2bce6207196b5a8373711db94ab1716) Thanks [@triggertoo](https://github.com/triggertoo)! - Update @frontify/sidebar-settings to get react 18 support +- [#426](https://github.com/Frontify/brand-sdk/pull/426) [`7729287`](https://github.com/Frontify/brand-sdk/commit/77292877e2bce6207196b5a8373711db94ab1716) Thanks [@triggertoo](https://github.com/triggertoo)! - Update @frontify/sidebar-settings to get react 18 support -- Updated dependencies [[`b78b376`](https://github.com/Frontify/brand-sdk/commit/b78b3764d1c01e1c0cc81542fdea2d813bb62e33)]: - - @frontify/sidebar-settings@0.4.0 +- Updated dependencies [[`b78b376`](https://github.com/Frontify/brand-sdk/commit/b78b3764d1c01e1c0cc81542fdea2d813bb62e33)]: + - @frontify/sidebar-settings@0.4.0 ## 0.26.7 ### Patch Changes -- [#419](https://github.com/Frontify/brand-sdk/pull/419) [`ada3b73`](https://github.com/Frontify/brand-sdk/commit/ada3b73d4af947649b6135b26b8e5a1c26f79aad) Thanks [@triggertoo](https://github.com/triggertoo)! - Update @frontify/sidebar-settings to the latest version +- [#419](https://github.com/Frontify/brand-sdk/pull/419) [`ada3b73`](https://github.com/Frontify/brand-sdk/commit/ada3b73d4af947649b6135b26b8e5a1c26f79aad) Thanks [@triggertoo](https://github.com/triggertoo)! - Update @frontify/sidebar-settings to the latest version ## 0.26.6 ### Patch Changes -- [`caecf03`](https://github.com/Frontify/brand-sdk/commit/caecf03ffd52a07cd1c846f4a99f9736fef76b76) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`caecf03`](https://github.com/Frontify/brand-sdk/commit/caecf03ffd52a07cd1c846f4a99f9736fef76b76) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`2179c95`](https://github.com/Frontify/brand-sdk/commit/2179c95e787d89d1e75671d394b4dde61673638d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update App Bridge +- [`2179c95`](https://github.com/Frontify/brand-sdk/commit/2179c95e787d89d1e75671d394b4dde61673638d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update App Bridge -- Updated dependencies [[`caecf03`](https://github.com/Frontify/brand-sdk/commit/caecf03ffd52a07cd1c846f4a99f9736fef76b76), [`2179c95`](https://github.com/Frontify/brand-sdk/commit/2179c95e787d89d1e75671d394b4dde61673638d)]: - - @frontify/sidebar-settings@0.3.3 +- Updated dependencies [[`caecf03`](https://github.com/Frontify/brand-sdk/commit/caecf03ffd52a07cd1c846f4a99f9736fef76b76), [`2179c95`](https://github.com/Frontify/brand-sdk/commit/2179c95e787d89d1e75671d394b4dde61673638d)]: + - @frontify/sidebar-settings@0.3.3 ## 0.26.5 ### Patch Changes -- [`f11eaef`](https://github.com/Frontify/brand-sdk/commit/f11eaef8b3a602562994460059e2c30ea307cda1) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix version of fondue dependency +- [`f11eaef`](https://github.com/Frontify/brand-sdk/commit/f11eaef8b3a602562994460059e2c30ea307cda1) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - fix version of fondue dependency -- Updated dependencies [[`f11eaef`](https://github.com/Frontify/brand-sdk/commit/f11eaef8b3a602562994460059e2c30ea307cda1)]: - - @frontify/sidebar-settings@0.3.2 +- Updated dependencies [[`f11eaef`](https://github.com/Frontify/brand-sdk/commit/f11eaef8b3a602562994460059e2c30ea307cda1)]: + - @frontify/sidebar-settings@0.3.2 ## 0.26.4 ### Patch Changes -- [`3835898`](https://github.com/Frontify/brand-sdk/commit/38358988674acc7cad728357b146558ebba3964a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix Fondue dependency version issue +- [`3835898`](https://github.com/Frontify/brand-sdk/commit/38358988674acc7cad728357b146558ebba3964a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix Fondue dependency version issue -- Updated dependencies [[`3835898`](https://github.com/Frontify/brand-sdk/commit/38358988674acc7cad728357b146558ebba3964a)]: - - @frontify/sidebar-settings@0.3.1 +- Updated dependencies [[`3835898`](https://github.com/Frontify/brand-sdk/commit/38358988674acc7cad728357b146558ebba3964a)]: + - @frontify/sidebar-settings@0.3.1 ## 0.26.3 ### Patch Changes -- [`57228f5`](https://github.com/Frontify/brand-sdk/commit/57228f557c20f2a2a291ecabc560a8e7c1bb0e41) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update deps +- [`57228f5`](https://github.com/Frontify/brand-sdk/commit/57228f557c20f2a2a291ecabc560a8e7c1bb0e41) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update deps -- [#396](https://github.com/Frontify/brand-sdk/pull/396) [`a213ee6`](https://github.com/Frontify/brand-sdk/commit/a213ee68b2f11377d94df578a86ec360704d727b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Unpin dev dependencies +- [#396](https://github.com/Frontify/brand-sdk/pull/396) [`a213ee6`](https://github.com/Frontify/brand-sdk/commit/a213ee68b2f11377d94df578a86ec360704d727b) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Unpin dev dependencies -- Updated dependencies [[`57228f5`](https://github.com/Frontify/brand-sdk/commit/57228f557c20f2a2a291ecabc560a8e7c1bb0e41), [`a213ee6`](https://github.com/Frontify/brand-sdk/commit/a213ee68b2f11377d94df578a86ec360704d727b), [`a213ee6`](https://github.com/Frontify/brand-sdk/commit/a213ee68b2f11377d94df578a86ec360704d727b)]: - - @frontify/sidebar-settings@0.3.0 +- Updated dependencies [[`57228f5`](https://github.com/Frontify/brand-sdk/commit/57228f557c20f2a2a291ecabc560a8e7c1bb0e41), [`a213ee6`](https://github.com/Frontify/brand-sdk/commit/a213ee68b2f11377d94df578a86ec360704d727b), [`a213ee6`](https://github.com/Frontify/brand-sdk/commit/a213ee68b2f11377d94df578a86ec360704d727b)]: + - @frontify/sidebar-settings@0.3.0 ## 0.26.2 ### Patch Changes -- Updated dependencies [[`366ca28`](https://github.com/Frontify/brand-sdk/commit/366ca280e754cf875d91026ee0a3cf8e767b05ab)]: - - @frontify/sidebar-settings@0.2.0 +- Updated dependencies [[`366ca28`](https://github.com/Frontify/brand-sdk/commit/366ca280e754cf875d91026ee0a3cf8e767b05ab)]: + - @frontify/sidebar-settings@0.2.0 ## 0.26.1 ### Patch Changes -- [`0ed6221`](https://github.com/Frontify/brand-sdk/commit/0ed62215b22410d12b028eed0cc5c74c0f8453b2) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix issue with version of sidebar-settings +- [`0ed6221`](https://github.com/Frontify/brand-sdk/commit/0ed62215b22410d12b028eed0cc5c74c0f8453b2) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Fix issue with version of sidebar-settings ## 0.26.0 ### Minor Changes -- [#382](https://github.com/Frontify/brand-sdk/pull/382) [`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Renamed `slider` to `segmentedControls` +- [#382](https://github.com/Frontify/brand-sdk/pull/382) [`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Renamed `slider` to `segmentedControls` -- [#382](https://github.com/Frontify/brand-sdk/pull/382) [`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Inline enums to union types to have less Fondue breakage +- [#382](https://github.com/Frontify/brand-sdk/pull/382) [`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Inline enums to union types to have less Fondue breakage ### Patch Changes -- [`440e463`](https://github.com/Frontify/brand-sdk/commit/440e463326fb55dabc28dba346e1ec2e6ee03450) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`440e463`](https://github.com/Frontify/brand-sdk/commit/440e463326fb55dabc28dba346e1ec2e6ee03450) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557), [`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557), [`440e463`](https://github.com/Frontify/brand-sdk/commit/440e463326fb55dabc28dba346e1ec2e6ee03450)]: - - @frontify/sidebar-settings@0.1.0 +- Updated dependencies [[`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557), [`6a31872`](https://github.com/Frontify/brand-sdk/commit/6a31872fbe0cc426f1f2f384fab52e48dbaad557), [`440e463`](https://github.com/Frontify/brand-sdk/commit/440e463326fb55dabc28dba346e1ec2e6ee03450)]: + - @frontify/sidebar-settings@0.1.0 ## 0.25.12 ### Patch Changes -- [`d89d0e0`](https://github.com/Frontify/brand-sdk/commit/d89d0e06be900fd6bba897d05ad8427e5d44f1f0) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Allow beta versions of Fondue +- [`d89d0e0`](https://github.com/Frontify/brand-sdk/commit/d89d0e06be900fd6bba897d05ad8427e5d44f1f0) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Allow beta versions of Fondue -- Updated dependencies [[`d89d0e0`](https://github.com/Frontify/brand-sdk/commit/d89d0e06be900fd6bba897d05ad8427e5d44f1f0)]: - - @frontify/sidebar-settings@0.0.16 +- Updated dependencies [[`d89d0e0`](https://github.com/Frontify/brand-sdk/commit/d89d0e06be900fd6bba897d05ad8427e5d44f1f0)]: + - @frontify/sidebar-settings@0.0.16 ## 0.25.11 ### Patch Changes -- [`0198626`](https://github.com/Frontify/brand-sdk/commit/0198626b9d8e49f31d861a05e15ca6e59d349b59) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`0198626`](https://github.com/Frontify/brand-sdk/commit/0198626b9d8e49f31d861a05e15ca6e59d349b59) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`2f58027`](https://github.com/Frontify/brand-sdk/commit/2f580271ca0540729539da3dfe66286ee3f50eda), [`0198626`](https://github.com/Frontify/brand-sdk/commit/0198626b9d8e49f31d861a05e15ca6e59d349b59)]: - - @frontify/sidebar-settings@0.0.14 +- Updated dependencies [[`2f58027`](https://github.com/Frontify/brand-sdk/commit/2f580271ca0540729539da3dfe66286ee3f50eda), [`0198626`](https://github.com/Frontify/brand-sdk/commit/0198626b9d8e49f31d861a05e15ca6e59d349b59)]: + - @frontify/sidebar-settings@0.0.14 ## 0.25.10 ### Patch Changes -- [`5fb81d6`](https://github.com/Frontify/brand-sdk/commit/5fb81d6a3f8e0bd7083b2a2c1cc95b7a2d98e395) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`5fb81d6`](https://github.com/Frontify/brand-sdk/commit/5fb81d6a3f8e0bd7083b2a2c1cc95b7a2d98e395) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [#329](https://github.com/Frontify/brand-sdk/pull/329) [`d2ecd25`](https://github.com/Frontify/brand-sdk/commit/d2ecd2592d129d40de72d4793c8848f2f291f896) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add font input setting +- [#329](https://github.com/Frontify/brand-sdk/pull/329) [`d2ecd25`](https://github.com/Frontify/brand-sdk/commit/d2ecd2592d129d40de72d4793c8848f2f291f896) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add font input setting -- [`45653fa`](https://github.com/Frontify/brand-sdk/commit/45653faaf4168517ccbb3a9775bbf88871149692) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`45653fa`](https://github.com/Frontify/brand-sdk/commit/45653faaf4168517ccbb3a9775bbf88871149692) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`5fb81d6`](https://github.com/Frontify/brand-sdk/commit/5fb81d6a3f8e0bd7083b2a2c1cc95b7a2d98e395), [`d2ecd25`](https://github.com/Frontify/brand-sdk/commit/d2ecd2592d129d40de72d4793c8848f2f291f896), [`45653fa`](https://github.com/Frontify/brand-sdk/commit/45653faaf4168517ccbb3a9775bbf88871149692)]: - - @frontify/sidebar-settings@0.0.13 +- Updated dependencies [[`5fb81d6`](https://github.com/Frontify/brand-sdk/commit/5fb81d6a3f8e0bd7083b2a2c1cc95b7a2d98e395), [`d2ecd25`](https://github.com/Frontify/brand-sdk/commit/d2ecd2592d129d40de72d4793c8848f2f291f896), [`45653fa`](https://github.com/Frontify/brand-sdk/commit/45653faaf4168517ccbb3a9775bbf88871149692)]: + - @frontify/sidebar-settings@0.0.13 ## 0.25.9 ### Patch Changes -- [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add clearable to color input and dropdown +- [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add clearable to color input and dropdown -- [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- Updated dependencies [[`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f), [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f)]: - - @frontify/sidebar-settings@0.0.12 +- Updated dependencies [[`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f), [`d955377`](https://github.com/Frontify/brand-sdk/commit/d955377f1a6f115dac3cad8513627973c7bf428f)]: + - @frontify/sidebar-settings@0.0.12 ## 0.25.8 ### Patch Changes -- Updated dependencies [[`fa95406`](https://github.com/Frontify/brand-sdk/commit/fa9540631337193ffa0225a58f7b7b46b4f48e2a)]: - - @frontify/sidebar-settings@0.0.11 +- Updated dependencies [[`fa95406`](https://github.com/Frontify/brand-sdk/commit/fa9540631337193ffa0225a58f7b7b46b4f48e2a)]: + - @frontify/sidebar-settings@0.0.11 ## 0.25.7 ### Patch Changes -- [#299](https://github.com/Frontify/brand-sdk/pull/299) [`187466a`](https://github.com/Frontify/brand-sdk/commit/187466ae50c08f4abf5d0b257951ccf083d6344d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update to Vite 4 and TS 4.9 +- [#299](https://github.com/Frontify/brand-sdk/pull/299) [`187466a`](https://github.com/Frontify/brand-sdk/commit/187466ae50c08f4abf5d0b257951ccf083d6344d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update to Vite 4 and TS 4.9 -- [`e47c574`](https://github.com/Frontify/brand-sdk/commit/e47c5747ab1041a62dc880fa92436b8ab464bfef) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`e47c574`](https://github.com/Frontify/brand-sdk/commit/e47c5747ab1041a62dc880fa92436b8ab464bfef) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`3afb60d`](https://github.com/Frontify/brand-sdk/commit/3afb60d849a8ffb262aed4dc8e53d46b9b9a04ea) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Move App Bridge from peerDependencies to dependencies +- [`3afb60d`](https://github.com/Frontify/brand-sdk/commit/3afb60d849a8ffb262aed4dc8e53d46b9b9a04ea) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Move App Bridge from peerDependencies to dependencies -- [`64a68da`](https://github.com/Frontify/brand-sdk/commit/64a68da0d60cf0e529d534ae120ee1a35c1d587d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export `SimpleSettingBlock` type +- [`64a68da`](https://github.com/Frontify/brand-sdk/commit/64a68da0d60cf0e529d534ae120ee1a35c1d587d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export `SimpleSettingBlock` type -- Updated dependencies [[`187466a`](https://github.com/Frontify/brand-sdk/commit/187466ae50c08f4abf5d0b257951ccf083d6344d), [`e47c574`](https://github.com/Frontify/brand-sdk/commit/e47c5747ab1041a62dc880fa92436b8ab464bfef), [`3afb60d`](https://github.com/Frontify/brand-sdk/commit/3afb60d849a8ffb262aed4dc8e53d46b9b9a04ea)]: - - @frontify/sidebar-settings@0.0.10 +- Updated dependencies [[`187466a`](https://github.com/Frontify/brand-sdk/commit/187466ae50c08f4abf5d0b257951ccf083d6344d), [`e47c574`](https://github.com/Frontify/brand-sdk/commit/e47c5747ab1041a62dc880fa92436b8ab464bfef), [`3afb60d`](https://github.com/Frontify/brand-sdk/commit/3afb60d849a8ffb262aed4dc8e53d46b9b9a04ea)]: + - @frontify/sidebar-settings@0.0.10 ## 0.25.6 ### Patch Changes -- Updated dependencies [[`ff4cf93`](https://github.com/Frontify/brand-sdk/commit/ff4cf935fbffa4933b31eeea6cad3a0c89b8bf88)]: - - @frontify/sidebar-settings@0.0.9 +- Updated dependencies [[`ff4cf93`](https://github.com/Frontify/brand-sdk/commit/ff4cf935fbffa4933b31eeea6cad3a0c89b8bf88)]: + - @frontify/sidebar-settings@0.0.9 ## 0.25.5 ### Patch Changes -- [`4063217`](https://github.com/Frontify/brand-sdk/commit/4063217a946f0896f7dd3aacbc0b21f4c355b21c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies +- [`4063217`](https://github.com/Frontify/brand-sdk/commit/4063217a946f0896f7dd3aacbc0b21f4c355b21c) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies -- [`13be4e4`](https://github.com/Frontify/brand-sdk/commit/13be4e40dee7cc13c20de53d2c5c44a1ee1c3c8f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export more types with generic +- [`13be4e4`](https://github.com/Frontify/brand-sdk/commit/13be4e40dee7cc13c20de53d2c5c44a1ee1c3c8f) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export more types with generic -- Updated dependencies [[`4063217`](https://github.com/Frontify/brand-sdk/commit/4063217a946f0896f7dd3aacbc0b21f4c355b21c)]: - - @frontify/sidebar-settings@0.0.8 +- Updated dependencies [[`4063217`](https://github.com/Frontify/brand-sdk/commit/4063217a946f0896f7dd3aacbc0b21f4c355b21c)]: + - @frontify/sidebar-settings@0.0.8 ## 0.25.4 ### Patch Changes -- [`56eecbe`](https://github.com/Frontify/brand-sdk/commit/56eecbe5c5b60080d814dc5678510af8aeb111f8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add more export with AppBridge passed to generic +- [`56eecbe`](https://github.com/Frontify/brand-sdk/commit/56eecbe5c5b60080d814dc5678510af8aeb111f8) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Add more export with AppBridge passed to generic ## 0.25.3 ### Patch Changes -- [`f140510`](https://github.com/Frontify/brand-sdk/commit/f14051013520f73a9e60bcbac704eb607a69468a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Added documentation link to the types. - Added custom section handling in types. -- Updated dependencies [[`ac89fc6`](https://github.com/Frontify/brand-sdk/commit/ac89fc60cdf58d1a7cae2aae2a057c744fc7e9b6)]: - - @frontify/sidebar-settings@0.0.7 +- [`f140510`](https://github.com/Frontify/brand-sdk/commit/f14051013520f73a9e60bcbac704eb607a69468a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Added documentation link to the types. + Added custom section handling in types. +- Updated dependencies [[`ac89fc6`](https://github.com/Frontify/brand-sdk/commit/ac89fc60cdf58d1a7cae2aae2a057c744fc7e9b6)]: + - @frontify/sidebar-settings@0.0.7 ## 0.25.2 ### Patch Changes -- Updated dependencies [[`e58c9d5`](https://github.com/Frontify/brand-sdk/commit/e58c9d5ef0b20e33d91c831f4b19c37afae4f9aa), [`b651e3d`](https://github.com/Frontify/brand-sdk/commit/b651e3d06d19cbf9de6e85ed58aae8a9f2ed2615)]: - - @frontify/sidebar-settings@0.0.6 +- Updated dependencies [[`e58c9d5`](https://github.com/Frontify/brand-sdk/commit/e58c9d5ef0b20e33d91c831f4b19c37afae4f9aa), [`b651e3d`](https://github.com/Frontify/brand-sdk/commit/b651e3d06d19cbf9de6e85ed58aae8a9f2ed2615)]: + - @frontify/sidebar-settings@0.0.6 ## 0.25.1 ### Patch Changes -- [`712730e`](https://github.com/Frontify/frontify-cli/commit/712730ec8abda54a1fbc6df5447dcd10fd159ed1) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - export `SettingBlock` with generic +- [`712730e`](https://github.com/Frontify/frontify-cli/commit/712730ec8abda54a1fbc6df5447dcd10fd159ed1) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - export `SettingBlock` with generic -- Updated dependencies [[`d4bd194`](https://github.com/Frontify/frontify-cli/commit/d4bd194133470d2a212be80d14e299e63bc12783)]: - - @frontify/sidebar-settings@0.0.5 +- Updated dependencies [[`d4bd194`](https://github.com/Frontify/frontify-cli/commit/d4bd194133470d2a212be80d14e299e63bc12783)]: + - @frontify/sidebar-settings@0.0.5 ## 0.24.3 ### Patch Changes -- Updated dependencies [[`ab6318e`](https://github.com/Frontify/frontify-cli/commit/ab6318e02b460271fa4ca4d80aa2f95f70a1db2d)]: - - @frontify/sidebar-settings@0.0.4 +- Updated dependencies [[`ab6318e`](https://github.com/Frontify/frontify-cli/commit/ab6318e02b460271fa4ca4d80aa2f95f70a1db2d)]: + - @frontify/sidebar-settings@0.0.4 ## 0.24.2 ### Patch Changes -- [#279](https://github.com/Frontify/frontify-cli/pull/279) [`aa91a2d`](https://github.com/Frontify/frontify-cli/commit/aa91a2d7df7e8f6947b1852d2d2a4d1a12e0d5af) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export everything from the sidebar types +- [#279](https://github.com/Frontify/frontify-cli/pull/279) [`aa91a2d`](https://github.com/Frontify/frontify-cli/commit/aa91a2d7df7e8f6947b1852d2d2a4d1a12e0d5af) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Export everything from the sidebar types -- Updated dependencies [[`aa91a2d`](https://github.com/Frontify/frontify-cli/commit/aa91a2d7df7e8f6947b1852d2d2a4d1a12e0d5af)]: - - @frontify/sidebar-settings@0.0.3 +- Updated dependencies [[`aa91a2d`](https://github.com/Frontify/frontify-cli/commit/aa91a2d7df7e8f6947b1852d2d2a4d1a12e0d5af)]: + - @frontify/sidebar-settings@0.0.3 ## 0.24.1 ### Patch Changes -- [#277](https://github.com/Frontify/frontify-cli/pull/277) [`6e3bb0c`](https://github.com/Frontify/frontify-cli/commit/6e3bb0cf08bc616496dcb413dbde8d95094b3a9d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Use `@frontify/sidebar-settings` type package +- [#277](https://github.com/Frontify/frontify-cli/pull/277) [`6e3bb0c`](https://github.com/Frontify/frontify-cli/commit/6e3bb0cf08bc616496dcb413dbde8d95094b3a9d) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Use `@frontify/sidebar-settings` type package -- Updated dependencies [[`6e3bb0c`](https://github.com/Frontify/frontify-cli/commit/6e3bb0cf08bc616496dcb413dbde8d95094b3a9d)]: - - @frontify/sidebar-settings@0.0.2 +- Updated dependencies [[`6e3bb0c`](https://github.com/Frontify/frontify-cli/commit/6e3bb0cf08bc616496dcb413dbde8d95094b3a9d)]: + - @frontify/sidebar-settings@0.0.2 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a27a035d..b3cb38ae7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,8 +71,8 @@ importers: packages/app-bridge: dependencies: immer: - specifier: ^10.0.4 - version: 10.1.3 + specifier: ^11.1.4 + version: 11.1.4 lodash-es: specifier: ^4.18.1 version: 4.18.1 @@ -80,8 +80,8 @@ importers: specifier: ^3.0.1 version: 3.0.1 type-fest: - specifier: ^5.4.3 - version: 5.4.3 + specifier: ^5.4.4 + version: 5.5.0 devDependencies: '@frontify/eslint-config-react': specifier: ^1.0.15 @@ -377,7 +377,7 @@ importers: version: 3.9.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sinon@21.0.3) '@frontify/fondue': specifier: ^13.4.5 - version: 13.4.5(52e3f34042efac573f55142c6c63080b) + version: 13.4.5(4aee2f013be6658795fd396de7391243) '@frontify/sidebar-settings': specifier: workspace:^ version: link:../sidebar-settings @@ -6466,6 +6466,9 @@ packages: immer@10.1.3: resolution: {integrity: sha512-tmjF/k8QDKydUlm3mZU+tjM6zeq9/fFpPqH9SzWmBnVVKsPBg/V66qsMwb3/Bo90cgUN+ghdVBess+hPsxUyRw==} + immer@11.1.4: + resolution: {integrity: sha512-XREFCPo6ksxVzP4E0ekD5aMdf8WMwmdNaz6vuvxgI40UaEiu6q3p8X52aU6GdyvLY3XXX/8R7JOTXStz/nBbRw==} + import-fresh@2.0.0: resolution: {integrity: sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==} engines: {node: '>=4'} @@ -9142,6 +9145,10 @@ packages: resolution: {integrity: sha512-AXSAQJu79WGc79/3e9/CR77I/KQgeY1AhNvcShIH4PTcGYyC4xv6H4R4AUOwkPS5799KlVDAu8zExeCrkGquiA==} engines: {node: '>=20'} + type-fest@5.5.0: + resolution: {integrity: sha512-PlBfpQwiUvGViBNX84Yxwjsdhd1TUlXr6zjX7eoirtCPIr08NAmxwa+fcYBTeRQxHo9YC9wwF3m9i700sHma8g==} + engines: {node: '>=20'} + typed-array-buffer@1.0.3: resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} engines: {node: '>= 0.4'} @@ -11587,7 +11594,7 @@ snapshots: transitivePeerDependencies: - tailwindcss - '@frontify/fondue-rte@0.1.3(aeb9a3c7ef4e33a0a9bab8eadb6e5ebe)': + '@frontify/fondue-rte@0.1.3(a766ccaef24a5deb09fbf72e040d4843)': dependencies: '@ctrl/tinycolor': 4.2.0 '@dnd-kit/core': 6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -11624,29 +11631,29 @@ snapshots: '@react-stately/toggle': 3.9.3(react@18.3.1) '@react-stately/tree': 3.9.4(react@18.3.1) '@react-types/shared': 3.33.1(react@18.3.1) - '@udecode/plate-alignment': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-autoformat': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-basic-marks': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-break': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-code-block': 31.3.4(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-combobox': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-alignment': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-autoformat': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-basic-marks': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-break': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-code-block': 31.3.4(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-combobox': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) '@udecode/plate-core': 36.5.9(@types/react@18.3.27)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-emoji': 31.4.0(patch_hash=006e69514660726c5259e72f6c0685c34e7a0c7cfc69edda920240767a837b19)(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-floating': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-font': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-indent': 31.1.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-link': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-list': 31.1.3(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-mention': 31.3.5(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-normalizers': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-paragraph': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-emoji': 31.4.0(patch_hash=006e69514660726c5259e72f6c0685c34e7a0c7cfc69edda920240767a837b19)(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-floating': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-font': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-indent': 31.1.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-link': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-list': 31.1.3(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-mention': 31.3.5(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-normalizers': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-paragraph': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) '@udecode/plate-utils': 36.5.9(@types/react@18.3.27)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) '@udecode/react-utils': 31.0.0(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@udecode/slate': 31.0.0(slate-history@0.100.0(slate@0.102.0))(slate@0.102.0) '@udecode/slate-react': 31.0.0(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) '@udecode/slate-utils': 31.3.2(slate-history@0.100.0(slate@0.102.0))(slate@0.102.0) '@udecode/utils': 31.0.0 - '@udecode/zustood': 2.0.0(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1)) + '@udecode/zustood': 2.0.0(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1)) escape-html: 1.0.3 immer: 10.1.1 lodash-es: 4.18.1 @@ -11781,7 +11788,7 @@ snapshots: react: 18.3.1 tailwindcss: 3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3)) - '@frontify/fondue@13.4.5(52e3f34042efac573f55142c6c63080b)': + '@frontify/fondue@13.4.5(4aee2f013be6658795fd396de7391243)': dependencies: '@ctrl/tinycolor': 4.2.0 '@dnd-kit/core': 6.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -11792,7 +11799,7 @@ snapshots: '@frontify/fondue-charts': 7.0.0(@frontify/fondue-tokens@5.0.0(tailwindcss@3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3))))(@react-spring/web@9.7.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@frontify/fondue-components': 30.3.0(@frontify/fondue-icons@0.26.0(react@18.3.1)(tailwindcss@3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3))))(@frontify/fondue-tokens@5.0.0(tailwindcss@3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3))))(@types/react-dom@18.3.7(@types/react@18.3.27))(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3))) '@frontify/fondue-icons': 0.26.0(react@18.3.1)(tailwindcss@3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3))) - '@frontify/fondue-rte': 0.1.3(aeb9a3c7ef4e33a0a9bab8eadb6e5ebe) + '@frontify/fondue-rte': 0.1.3(a766ccaef24a5deb09fbf72e040d4843) '@frontify/fondue-tokens': 5.0.0(tailwindcss@3.4.18(ts-node@10.9.2(@types/node@24.11.0)(typescript@5.9.3))) '@popperjs/core': 2.11.8 '@react-aria/accordion': 3.0.0-alpha.37(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -14416,9 +14423,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-alignment@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-alignment@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14437,9 +14444,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-autoformat@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-autoformat@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) lodash: 4.17.23 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -14458,9 +14465,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-basic-marks@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-basic-marks@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14478,9 +14485,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-break@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-break@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14499,9 +14506,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-code-block@31.3.4(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-code-block@31.3.4(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) prismjs: 1.29.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -14521,9 +14528,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-combobox@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-combobox@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) downshift: 6.1.12(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -14553,10 +14560,10 @@ snapshots: - react-native - scheduler - '@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-core': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-utils': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-core': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-utils': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) '@udecode/react-utils': 33.0.0(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@udecode/slate': 36.0.6(slate-history@0.100.0(slate@0.102.0))(slate@0.102.0) '@udecode/slate-react': 36.0.6(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) @@ -14604,7 +14611,7 @@ snapshots: - react-native - scheduler - '@udecode/plate-core@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-core@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: '@udecode/slate': 36.0.6(slate-history@0.100.0(slate@0.102.0))(slate@0.102.0) '@udecode/slate-react': 36.0.6(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) @@ -14626,8 +14633,8 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) use-deep-compare: 1.2.1(react@18.3.1) - zustand: 4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1) - zustand-x: 3.0.3(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1)) + zustand: 4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1) + zustand-x: 3.0.3(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1)) transitivePeerDependencies: - '@types/react' - immer @@ -14646,11 +14653,11 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-emoji@31.4.0(patch_hash=006e69514660726c5259e72f6c0685c34e7a0c7cfc69edda920240767a837b19)(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-emoji@31.4.0(patch_hash=006e69514660726c5259e72f6c0685c34e7a0c7cfc69edda920240767a837b19)(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: '@emoji-mart/data': 1.2.1 - '@udecode/plate-combobox': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-combobox': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14670,11 +14677,11 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-floating@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-floating@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: '@floating-ui/core': 1.7.3 '@floating-ui/react': 0.22.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14693,9 +14700,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-font@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-font@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) lodash: 4.17.23 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -14714,9 +14721,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-indent@31.1.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-indent@31.1.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14736,11 +14743,11 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-link@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-link@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-floating': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-normalizers': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-floating': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-normalizers': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14760,10 +14767,10 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-list@31.1.3(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-list@31.1.3(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-reset-node': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-reset-node': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) lodash: 4.17.23 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -14783,10 +14790,10 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-mention@31.3.5(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-mention@31.3.5(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-combobox': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-combobox': 31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14805,9 +14812,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-normalizers@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-normalizers@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) lodash: 4.17.23 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -14826,9 +14833,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-paragraph@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-paragraph@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14846,9 +14853,9 @@ snapshots: slate-hyperscript: 0.100.0(slate@0.102.0) slate-react: 0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0) - '@udecode/plate-reset-node@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-reset-node@31.0.0(@udecode/plate-common@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-common': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) slate: 0.102.0 @@ -14878,9 +14885,9 @@ snapshots: - react-native - scheduler - '@udecode/plate-utils@36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': + '@udecode/plate-utils@36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0)': dependencies: - '@udecode/plate-core': 36.5.9(@types/react@18.3.27)(immer@10.1.3)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) + '@udecode/plate-core': 36.5.9(@types/react@18.3.27)(immer@11.1.4)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(slate-history@0.100.0(slate@0.102.0))(slate-hyperscript@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) '@udecode/react-utils': 33.0.0(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@udecode/slate': 36.0.6(slate-history@0.100.0(slate@0.102.0))(slate@0.102.0) '@udecode/slate-react': 36.0.6(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-history@0.100.0(slate@0.102.0))(slate-react@0.102.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate@0.102.0))(slate@0.102.0) @@ -14987,11 +14994,11 @@ snapshots: - react-native - scheduler - '@udecode/zustood@2.0.0(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1))': + '@udecode/zustood@2.0.0(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1))': dependencies: immer: 10.1.3 react-tracked: 1.7.14(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505) - zustand: 4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1) + zustand: 4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1) transitivePeerDependencies: - react - react-dom @@ -16447,7 +16454,7 @@ snapshots: dot-prop@10.1.0: dependencies: - type-fest: 5.4.3 + type-fest: 5.5.0 dotenv@8.6.0: {} @@ -17642,6 +17649,8 @@ snapshots: immer@10.1.3: {} + immer@11.1.4: {} + import-fresh@2.0.0: dependencies: caller-path: 2.0.0 @@ -19274,7 +19283,7 @@ snapshots: statuses: 2.0.2 strict-event-emitter: 0.5.1 tough-cookie: 6.0.0 - type-fest: 5.4.3 + type-fest: 5.5.0 until-async: 3.0.2 yargs: 17.7.2 optionalDependencies: @@ -19300,7 +19309,7 @@ snapshots: statuses: 2.0.2 strict-event-emitter: 0.5.1 tough-cookie: 6.0.0 - type-fest: 5.4.3 + type-fest: 5.5.0 until-async: 3.0.2 yargs: 17.7.2 optionalDependencies: @@ -19326,7 +19335,7 @@ snapshots: statuses: 2.0.2 strict-event-emitter: 0.5.1 tough-cookie: 6.0.0 - type-fest: 5.4.3 + type-fest: 5.5.0 until-async: 3.0.2 yargs: 17.7.2 optionalDependencies: @@ -21047,6 +21056,10 @@ snapshots: dependencies: tagged-tag: 1.0.0 + type-fest@5.5.0: + dependencies: + tagged-tag: 1.0.0 + typed-array-buffer@1.0.3: dependencies: call-bound: 1.0.4 @@ -21760,12 +21773,12 @@ snapshots: - react-native - scheduler - zustand-x@3.0.3(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1)): + zustand-x@3.0.3(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505)(zustand@4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1)): dependencies: immer: 10.1.3 lodash.mapvalues: 4.6.0 react-tracked: 1.7.14(react-dom@18.3.1(react@18.3.1))(react-native@0.74.2(@babel/core@7.29.0)(@babel/preset-env@7.28.3(@babel/core@7.29.0))(@types/react@18.3.27)(react@18.3.1))(react@18.3.1)(scheduler@0.24.0-canary-efb381bbf-20230505) - zustand: 4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1) + zustand: 4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1) transitivePeerDependencies: - react - react-dom @@ -21780,12 +21793,12 @@ snapshots: immer: 10.1.1 react: 18.3.1 - zustand@4.5.3(@types/react@18.3.27)(immer@10.1.3)(react@18.3.1): + zustand@4.5.3(@types/react@18.3.27)(immer@11.1.4)(react@18.3.1): dependencies: use-sync-external-store: 1.2.0(react@18.3.1) optionalDependencies: '@types/react': 18.3.27 - immer: 10.1.3 + immer: 11.1.4 react: 18.3.1 zwitch@2.0.4: {}