react-bricks 5.0.0-alpha.1 → 5.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/astro/index.js +1 -1
  2. package/astro/package.json +1 -1
  3. package/astro/react-bricks-astro.d.ts +26 -4
  4. package/astro/react-bricks-astro.esm.js +1 -1
  5. package/astro/server/index.js +1 -1
  6. package/astro/server/package.json +1 -1
  7. package/astro/server/react-bricks-astro-server.d.ts +112 -8
  8. package/astro/server/react-bricks-astro-server.esm.js +1 -1
  9. package/frontend/index.js +1 -1
  10. package/frontend/package.json +2 -2
  11. package/frontend/react-bricks-frontend.d.ts +1614 -0
  12. package/frontend/react-bricks-frontend.esm.js +1 -1
  13. package/index.js +1 -1
  14. package/package.json +21 -21
  15. package/react-bricks-4V0EE57f.esm.js +2 -0
  16. package/react-bricks-B1Vse8mD.esm.js +2 -0
  17. package/react-bricks-BDLU20-P.esm.js +2 -0
  18. package/react-bricks-BT4wWCiv.js +2 -0
  19. package/{react-bricks-YMWwwVZL.js → react-bricks-BXuIniPH.js} +2 -2
  20. package/react-bricks-Bb-tnKnX.js +2 -0
  21. package/react-bricks-BoS3Ip9Y.js +2 -0
  22. package/react-bricks-Bw3CYt-A.js +2 -0
  23. package/react-bricks-Byc_kz7c.js +2 -0
  24. package/react-bricks-C6CuP0pr.esm.js +2 -0
  25. package/react-bricks-CJr0ozQh.esm.js +2 -0
  26. package/react-bricks-CQGGPWSX.esm.js +2 -0
  27. package/react-bricks-CVY80vRp.js +2 -0
  28. package/react-bricks-CXYPizKP.esm.js +2 -0
  29. package/react-bricks-Cv6d5aJM.js +2 -0
  30. package/react-bricks-D11wVybc.js +2 -0
  31. package/react-bricks-D1NCAz33.esm.js +2 -0
  32. package/react-bricks-DMrrwMeN.esm.js +2 -0
  33. package/react-bricks-DXHTZMxL.js +2 -0
  34. package/react-bricks-Dj5O36Yd.js +2 -0
  35. package/react-bricks-DvQS_WEV.js +2 -0
  36. package/react-bricks-DxllOfhH.js +2 -0
  37. package/react-bricks-DzHM_JWb.esm.js +2 -0
  38. package/react-bricks-SER2nxcu.esm.js +2 -0
  39. package/react-bricks-WhMQmDjb.esm.js +2 -0
  40. package/react-bricks-hUn6ZQlj.esm.js +2 -0
  41. package/react-bricks-qteFeXyo.esm.js +2 -0
  42. package/react-bricks-rWV5-xpq.js +2 -0
  43. package/react-bricks.d.ts +70 -34
  44. package/react-bricks.esm.js +1 -1
  45. package/rsc/client/index.js +1 -1
  46. package/rsc/client/package.json +1 -1
  47. package/rsc/client/react-bricks-rsc-client.d.ts +26 -4
  48. package/rsc/client/react-bricks-rsc-client.esm.js +1 -1
  49. package/rsc/index.js +1 -1
  50. package/rsc/package.json +1 -1
  51. package/rsc/react-bricks-rsc.d.ts +130 -10
  52. package/rsc/react-bricks-rsc.esm.js +1 -1
  53. package/react-bricks-1p8UGL33.js +0 -2
  54. package/react-bricks-A7FR30z7.esm.js +0 -2
  55. package/react-bricks-B2-owpzT.js +0 -2
  56. package/react-bricks-B4rfjfZG.js +0 -2
  57. package/react-bricks-B5_r9nGa.esm.js +0 -2
  58. package/react-bricks-BJIqw1i4.js +0 -2
  59. package/react-bricks-BbdMRyhe.esm.js +0 -2
  60. package/react-bricks-Bn33fA9o.js +0 -2
  61. package/react-bricks-BzVkoQQ1.esm.js +0 -2
  62. package/react-bricks-CCMdKnAu.js +0 -2
  63. package/react-bricks-CG7Lgn2K.js +0 -2
  64. package/react-bricks-CI44eOAm.js +0 -2
  65. package/react-bricks-CfYUaV-v.esm.js +0 -2
  66. package/react-bricks-CtrB_G-F.js +0 -2
  67. package/react-bricks-CyebRIWY.esm.js +0 -2
  68. package/react-bricks-D4vAUrlY.esm.js +0 -2
  69. package/react-bricks-D7o5gAZ3.js +0 -2
  70. package/react-bricks-DB7WG0RJ.esm.js +0 -2
  71. package/react-bricks-DXZRgY8i.esm.js +0 -2
  72. package/react-bricks-DzZdqeB7.esm.js +0 -2
  73. package/react-bricks-EKI8_92y.esm.js +0 -2
  74. package/react-bricks-QRnivVKt.js +0 -2
  75. package/react-bricks-eSFEHqJY.js +0 -2
  76. package/react-bricks-fTP_ZCtN.esm.js +0 -2
  77. package/react-bricks-mgdoIOZ0.esm.js +0 -2
package/react-bricks.d.ts CHANGED
@@ -4,7 +4,6 @@ import { Descendant, Editor as Editor$1, BaseEditor, Element, Node } from 'slate
4
4
  import { RenderElementProps, RenderLeafProps, ReactEditor } from 'slate-react';
5
5
  import { HistoryEditor } from 'slate-history';
6
6
  import { Props } from 'react-inlinesvg';
7
- import * as _tanstack_react_query from '@tanstack/react-query';
8
7
  import { UseQueryResult } from '@tanstack/react-query';
9
8
  export { v4 as uuid } from 'uuid';
10
9
 
@@ -229,6 +228,7 @@ declare namespace types {
229
228
  deployHookStaging: boolean;
230
229
  deployHookDev: boolean;
231
230
  scheduledPublishing: boolean;
231
+ abTesting: boolean;
232
232
  embedPages: boolean;
233
233
  lockBlocks: boolean;
234
234
  flexibleRoles: boolean;
@@ -271,6 +271,17 @@ declare namespace types {
271
271
  isLocked: boolean;
272
272
  scheduledForPublishingOn: string;
273
273
  };
274
+ /**
275
+ * Variant for a Page
276
+ */
277
+ export type Variant = {
278
+ name: string;
279
+ weight: number;
280
+ status: PageStatus;
281
+ scheduledForPublishingOn: string;
282
+ scheduledForUnpublishingOn: string;
283
+ isLive: boolean;
284
+ };
274
285
  /**
275
286
  * The page editing User
276
287
  */
@@ -324,6 +335,8 @@ declare namespace types {
324
335
  type: string;
325
336
  name: string;
326
337
  slug: string;
338
+ variantName: string;
339
+ variantWeight: number;
327
340
  meta: IMeta;
328
341
  customValues?: Props;
329
342
  externalData?: Props;
@@ -342,8 +355,10 @@ declare namespace types {
342
355
  createdAt: string;
343
356
  publishedAt?: string;
344
357
  scheduledForPublishingOn?: string;
358
+ scheduledForUnpublishingOn?: string;
345
359
  language: string;
346
360
  translations: Translation[];
361
+ variants: Variant[];
347
362
  lastEditedBy: LastEditedBy;
348
363
  app?: AppOnPage;
349
364
  };
@@ -429,6 +444,7 @@ declare namespace types {
429
444
  * Options passed to the fetch function
430
445
  */
431
446
  export type FetchOptions = {
447
+ apiPrefix?: string;
432
448
  cache?: string;
433
449
  next?: {
434
450
  [key: string]: any;
@@ -793,10 +809,12 @@ declare namespace types {
793
809
  enableUnsplash?: boolean;
794
810
  unsplashApiKey?: string;
795
811
  enableDefaultEmbedBrick?: boolean;
812
+ checkUnsavedChanges?: boolean;
796
813
  permissions?: Permissions;
797
814
  allowAccentsInSlugs?: boolean;
798
815
  warningIfLowBattery?: boolean;
799
816
  rtlLanguages?: Array<string>;
817
+ apiPrefix?: string;
800
818
  }
801
819
  /**
802
820
  * The ReactBricks context
@@ -844,6 +862,7 @@ declare namespace types {
844
862
  enableUnsplash: boolean;
845
863
  unsplashApiKey?: string;
846
864
  enableDefaultEmbedBrick: boolean;
865
+ checkUnsavedChanges: boolean;
847
866
  permissions?: Permissions;
848
867
  allowAccentsInSlugs: boolean;
849
868
  warningIfLowBattery: boolean;
@@ -851,6 +870,7 @@ declare namespace types {
851
870
  language: string;
852
871
  }) => boolean;
853
872
  rtlLanguages: string[];
873
+ apiPrefix?: string;
854
874
  }
855
875
  /**
856
876
  * The current page in Admin
@@ -858,6 +878,7 @@ declare namespace types {
858
878
  export interface ICurrentPage {
859
879
  pageId: string;
860
880
  language?: string;
881
+ variantName?: string;
861
882
  }
862
883
  /**
863
884
  * The Admin context returned from useAdminContext
@@ -992,9 +1013,9 @@ declare namespace types {
992
1013
  name: string;
993
1014
  svg: string;
994
1015
  url: string;
995
- set: string;
1016
+ set: IconSets;
996
1017
  };
997
- export { };
1018
+ export {};
998
1019
  }
999
1020
 
1000
1021
  declare const useAdminContext: () => types.IReadAdminContext;
@@ -1273,7 +1294,7 @@ declare const ReactBricks: React.FC<types.ReactBricksConfig & {
1273
1294
  * Icon Props
1274
1295
  */
1275
1296
  interface IconProps extends Omit<Props, 'src'> {
1276
- icon: types.Icon;
1297
+ icon?: types.Icon;
1277
1298
  }
1278
1299
  /**
1279
1300
  * Component to render an Icon from an IconSelector sideEditProp
@@ -1314,17 +1335,13 @@ interface SendFormSubmissionResult {
1314
1335
  statusCode: number;
1315
1336
  message: string;
1316
1337
  }
1317
- declare const sendFormSubmission: ({ appId, appEnv, token, formId, emailAddress, data, }: SendFormSubmissionParams) => Promise<SendFormSubmissionResult>;
1338
+ declare const sendFormSubmission: ({ appId, appEnv, token, formId, emailAddress, data, fetchOptions, }: SendFormSubmissionParams) => Promise<SendFormSubmissionResult>;
1318
1339
 
1319
- interface Form {
1320
- id: string;
1321
- name: string;
1322
- }
1323
- declare const fetchForms: () => Promise<Form[]>;
1340
+ declare const fetchForms: (fetchOptions?: types.FetchOptions) => Promise<any>;
1324
1341
 
1325
- declare const usePage$1: (pageId: string, language?: string) => _tanstack_react_query.UseQueryResult<types.Page, Error>;
1342
+ declare const usePage$1: (pageId: string, language?: string, variantName?: string) => QueryObserverResult<TData, TError>;
1326
1343
 
1327
- declare const usePage: (slug: string, language?: string) => _tanstack_react_query.UseQueryResult<types.Page, Error>;
1344
+ declare const usePage: (slug: string, language?: string, variantName?: string) => QueryObserverResult<TData, TError>;
1328
1345
 
1329
1346
  /**
1330
1347
  * Values returned from usePages
@@ -1395,23 +1412,17 @@ declare const usePagesPublic: UsePagesPublicType;
1395
1412
  declare const useTagsPublic: (page?: number, pageSize?: number, options?: {
1396
1413
  q?: string;
1397
1414
  language?: string;
1398
- }) => _tanstack_react_query.UseQueryResult<{
1399
- items: string[];
1400
- pagination: {
1401
- page: number;
1402
- pageSize: number;
1403
- totalItems: number;
1404
- totalPages: number;
1405
- };
1406
- }, Error>;
1415
+ }) => QueryObserverResult<TData, TError>;
1407
1416
 
1408
1417
  declare const useReactBricksContext: () => types.IReactBricksContext;
1409
1418
 
1410
- declare function fetchPage({ slug, language, getExternalDataArgs, config, }: {
1419
+ declare function fetchPage({ slug, language, variantName, getExternalDataArgs, config, }: {
1411
1420
  slug: string;
1412
1421
  language?: string;
1422
+ variantName?: string;
1413
1423
  getExternalDataArgs?: any;
1414
1424
  config: types.ReactBricksConfig;
1425
+ fetchOptions?: types.FetchOptions;
1415
1426
  }): Promise<types.Page>;
1416
1427
  declare function fetchPage(slug: string, apiKey: string, language?: string, pageTypes?: types.IPageType[], getExternalDataArgs?: any): Promise<types.Page>;
1417
1428
 
@@ -1473,10 +1484,7 @@ declare function fetchPages<T extends boolean>(options: {
1473
1484
  config: types.ReactBricksConfig;
1474
1485
  }): Promise<types.PageFromList[]>;
1475
1486
 
1476
- declare const fetchTags: (apiKey: string, page?: number, pageSize?: number, options?: {
1477
- q?: string;
1478
- language?: string;
1479
- }) => Promise<{
1487
+ type FetchTagsResult = {
1480
1488
  items: string[];
1481
1489
  pagination: {
1482
1490
  page: number;
@@ -1484,7 +1492,21 @@ declare const fetchTags: (apiKey: string, page?: number, pageSize?: number, opti
1484
1492
  totalItems: number;
1485
1493
  totalPages: number;
1486
1494
  };
1487
- }>;
1495
+ };
1496
+ declare function fetchTags(apiKey: string, page?: number, pageSize?: number, options?: {
1497
+ q?: string;
1498
+ language?: string;
1499
+ }, fetchOptions?: types.FetchOptions): Promise<FetchTagsResult>;
1500
+ declare function fetchTags(options: {
1501
+ page?: number;
1502
+ pageSize?: number;
1503
+ filterBy?: {
1504
+ q?: string;
1505
+ language?: string;
1506
+ };
1507
+ config: types.ReactBricksConfig;
1508
+ fetchOptions?: types.FetchOptions;
1509
+ }): Promise<FetchTagsResult>;
1488
1510
 
1489
1511
  declare const _default: {
1490
1512
  serialize: (nodes: Node[]) => string;
@@ -1531,7 +1553,24 @@ declare const plugin$1: types.RichTextPlugin;
1531
1553
  declare const plugin: types.RichTextPlugin;
1532
1554
 
1533
1555
  declare namespace index {
1534
- export { plugin$f as bold, plugin$d as code, plugin$8 as heading1, plugin$7 as heading2, plugin$6 as heading3, plugin$5 as heading4, plugin$4 as heading5, plugin$3 as heading6, plugin$c as highlight, plugin$e as italic, plugin$9 as link, plugin$1 as orderedList, plugin$2 as quote, plugin$b as sub, plugin$a as sup, plugin as unorderedList };
1556
+ export {
1557
+ plugin$f as bold,
1558
+ plugin$d as code,
1559
+ plugin$8 as heading1,
1560
+ plugin$7 as heading2,
1561
+ plugin$6 as heading3,
1562
+ plugin$5 as heading4,
1563
+ plugin$4 as heading5,
1564
+ plugin$3 as heading6,
1565
+ plugin$c as highlight,
1566
+ plugin$e as italic,
1567
+ plugin$9 as link,
1568
+ plugin$1 as orderedList,
1569
+ plugin$2 as quote,
1570
+ plugin$b as sub,
1571
+ plugin$a as sup,
1572
+ plugin as unorderedList,
1573
+ };
1535
1574
  }
1536
1575
 
1537
1576
  declare const AppSettings: React.FC;
@@ -1622,12 +1661,9 @@ declare const useAuth: () => {
1622
1661
  type: "error";
1623
1662
  error: string;
1624
1663
  }>;
1625
- isLoggingIn: boolean;
1626
- ssoStartLogin: (uniqueAppIdentifier: string) => Promise<{
1627
- result: "OK" | "KO";
1628
- redirectUrl: string;
1629
- } | null>;
1630
- isLogginInSso: boolean;
1664
+ isLoggingIn: any;
1665
+ ssoStartLogin: (uniqueAppIdentifier: string) => Promise<any>;
1666
+ isLogginInSso: any;
1631
1667
  logoutUser: () => void;
1632
1668
  };
1633
1669