@payloadcms/ui 3.0.0-beta.1 → 3.0.0-beta.11

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/dist/elements/HydrateClientUser/index.d.ts +3 -2
  2. package/dist/elements/HydrateClientUser/index.d.ts.map +1 -1
  3. package/dist/elements/HydrateClientUser/index.js.map +1 -1
  4. package/dist/elements/ListControls/index.js +1 -1
  5. package/dist/elements/ListControls/index.js.map +1 -1
  6. package/dist/elements/Publish/index.js +1 -1
  7. package/dist/elements/Publish/index.js.map +1 -1
  8. package/dist/elements/TableColumns/buildColumnState.d.ts.map +1 -1
  9. package/dist/elements/TableColumns/buildColumnState.js +1 -0
  10. package/dist/elements/TableColumns/buildColumnState.js.map +1 -1
  11. package/dist/elements/withMergedProps/index.d.ts +2 -1
  12. package/dist/elements/withMergedProps/index.d.ts.map +1 -1
  13. package/dist/elements/withMergedProps/index.js +7 -1
  14. package/dist/elements/withMergedProps/index.js.map +1 -1
  15. package/dist/exports/elements.d.ts +3 -2
  16. package/dist/exports/elements.d.ts.map +1 -1
  17. package/dist/exports/elements.js +5 -2
  18. package/dist/exports/elements.js.map +1 -1
  19. package/dist/exports/fields.d.ts +2 -0
  20. package/dist/exports/fields.d.ts.map +1 -0
  21. package/dist/exports/fields.js +3 -0
  22. package/dist/exports/fields.js.map +1 -0
  23. package/dist/exports/providers.d.ts +2 -0
  24. package/dist/exports/providers.d.ts.map +1 -0
  25. package/dist/exports/providers.js +3 -0
  26. package/dist/exports/providers.js.map +1 -0
  27. package/dist/fields/HiddenInput/index.d.ts +1 -1
  28. package/dist/fields/HiddenInput/index.d.ts.map +1 -1
  29. package/dist/fields/HiddenInput/index.js.map +1 -1
  30. package/dist/providers/ComponentMap/buildComponentMap/WithServerSideProps.d.ts +3 -0
  31. package/dist/providers/ComponentMap/buildComponentMap/WithServerSideProps.d.ts.map +1 -0
  32. package/dist/providers/ComponentMap/buildComponentMap/WithServerSideProps.js +19 -0
  33. package/dist/providers/ComponentMap/buildComponentMap/WithServerSideProps.js.map +1 -0
  34. package/dist/providers/ComponentMap/buildComponentMap/actions.d.ts +2 -1
  35. package/dist/providers/ComponentMap/buildComponentMap/actions.d.ts.map +1 -1
  36. package/dist/providers/ComponentMap/buildComponentMap/actions.js +7 -3
  37. package/dist/providers/ComponentMap/buildComponentMap/actions.js.map +1 -1
  38. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts +3 -2
  39. package/dist/providers/ComponentMap/buildComponentMap/collections.d.ts.map +1 -1
  40. package/dist/providers/ComponentMap/buildComponentMap/collections.js +35 -14
  41. package/dist/providers/ComponentMap/buildComponentMap/collections.js.map +1 -1
  42. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts +2 -1
  43. package/dist/providers/ComponentMap/buildComponentMap/fields.d.ts.map +1 -1
  44. package/dist/providers/ComponentMap/buildComponentMap/fields.js +42 -12
  45. package/dist/providers/ComponentMap/buildComponentMap/fields.js.map +1 -1
  46. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts +3 -2
  47. package/dist/providers/ComponentMap/buildComponentMap/globals.d.ts.map +1 -1
  48. package/dist/providers/ComponentMap/buildComponentMap/globals.js +19 -6
  49. package/dist/providers/ComponentMap/buildComponentMap/globals.js.map +1 -1
  50. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts +2 -1
  51. package/dist/providers/ComponentMap/buildComponentMap/index.d.ts.map +1 -1
  52. package/dist/providers/ComponentMap/buildComponentMap/index.js +20 -4
  53. package/dist/providers/ComponentMap/buildComponentMap/index.js.map +1 -1
  54. package/dist/providers/ComponentMap/index.d.ts +1 -0
  55. package/dist/providers/ComponentMap/index.d.ts.map +1 -1
  56. package/dist/providers/ComponentMap/index.js +1 -0
  57. package/dist/providers/ComponentMap/index.js.map +1 -1
  58. package/dist/scss/app.scss +2 -3
  59. package/dist/scss/vars.scss +0 -7
  60. package/package.json +9 -9
  61. package/dist/assets/fonts/SuisseIntl-Bold.woff +0 -0
  62. package/dist/assets/fonts/SuisseIntl-Bold.woff2 +0 -0
  63. package/dist/assets/fonts/SuisseIntl-Medium.woff +0 -0
  64. package/dist/assets/fonts/SuisseIntl-Medium.woff2 +0 -0
  65. package/dist/assets/fonts/SuisseIntl-SemiBold.woff +0 -0
  66. package/dist/assets/fonts/SuisseIntl-SemiBold.woff2 +0 -0
  67. package/dist/assets/fonts/SuisseIntl.woff +0 -0
  68. package/dist/assets/fonts/SuisseIntl.woff2 +0 -0
  69. package/dist/assets/fonts/merriweather-v30-latin-900.woff +0 -0
  70. package/dist/assets/fonts/merriweather-v30-latin-900.woff2 +0 -0
  71. package/dist/assets/fonts/merriweather-v30-latin-900italic.woff +0 -0
  72. package/dist/assets/fonts/merriweather-v30-latin-900italic.woff2 +0 -0
  73. package/dist/assets/fonts/merriweather-v30-latin-italic.woff +0 -0
  74. package/dist/assets/fonts/merriweather-v30-latin-italic.woff2 +0 -0
  75. package/dist/assets/fonts/merriweather-v30-latin-regular.woff +0 -0
  76. package/dist/assets/fonts/merriweather-v30-latin-regular.woff2 +0 -0
  77. package/dist/scss/fonts.scss +0 -75
@@ -3,24 +3,35 @@ import { isPlainFunction, isReactComponent } from 'payload/utilities';
3
3
  import React from 'react';
4
4
  import { mapActions } from './actions.js';
5
5
  import { mapFields } from './fields.js';
6
- export const mapGlobals = ({ DefaultEditView, config, globals, i18n, readOnly: readOnlyOverride })=>globals.reduce((acc, globalConfig)=>{
6
+ export const mapGlobals = ({ DefaultEditView, WithServerSideProps, config, globals, i18n, readOnly: readOnlyOverride })=>globals.reduce((acc, globalConfig)=>{
7
7
  const { slug, fields } = globalConfig;
8
8
  const editViewFromConfig = globalConfig?.admin?.components?.views?.Edit;
9
9
  const SaveButton = globalConfig?.admin?.components?.elements?.SaveButton;
10
- const SaveButtonComponent = SaveButton ? /*#__PURE__*/ React.createElement(SaveButton, null) : undefined;
10
+ const SaveButtonComponent = SaveButton ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
11
+ Component: SaveButton
12
+ }) : undefined;
11
13
  const SaveDraftButton = globalConfig?.admin?.components?.elements?.SaveDraftButton;
12
- const SaveDraftButtonComponent = SaveDraftButton ? /*#__PURE__*/ React.createElement(SaveDraftButton, null) : undefined;
14
+ const SaveDraftButtonComponent = SaveDraftButton ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
15
+ Component: SaveDraftButton
16
+ }) : undefined;
13
17
  const PreviewButton = globalConfig?.admin?.components?.elements?.PreviewButton;
14
- const PreviewButtonComponent = PreviewButton ? /*#__PURE__*/ React.createElement(PreviewButton, null) : undefined;
18
+ const PreviewButtonComponent = PreviewButton ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
19
+ Component: PreviewButton
20
+ }) : undefined;
15
21
  const PublishButton = globalConfig?.admin?.components?.elements?.PublishButton;
16
- const PublishButtonComponent = PublishButton ? /*#__PURE__*/ React.createElement(PublishButton, null) : undefined;
22
+ const PublishButtonComponent = PublishButton ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
23
+ Component: PublishButton
24
+ }) : undefined;
17
25
  const CustomEditView = typeof editViewFromConfig === 'function' ? editViewFromConfig : typeof editViewFromConfig === 'object' && typeof editViewFromConfig.Default === 'function' ? editViewFromConfig.Default : typeof editViewFromConfig?.Default === 'object' && 'Component' in editViewFromConfig.Default && typeof editViewFromConfig.Default.Component === 'function' ? editViewFromConfig.Default.Component : undefined;
18
26
  const Edit = CustomEditView || DefaultEditView;
19
27
  const descriptionProps = {
20
28
  description: globalConfig.admin && 'description' in globalConfig.admin && ((typeof globalConfig.admin?.description === 'string' || typeof globalConfig.admin?.description === 'object') && globalConfig.admin.description || typeof globalConfig.admin?.description === 'function' && isPlainFunction(globalConfig.admin?.description) && globalConfig.admin?.description()) || undefined
21
29
  };
22
30
  const DescriptionComponent = globalConfig.admin && 'description' in globalConfig.admin && (isReactComponent(globalConfig.admin.description) && globalConfig.admin.description || globalConfig.admin.description && ViewDescription) || undefined;
23
- const Description = DescriptionComponent !== undefined ? /*#__PURE__*/ React.createElement(DescriptionComponent, descriptionProps || {}) : undefined;
31
+ const Description = DescriptionComponent !== undefined ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
32
+ Component: DescriptionComponent,
33
+ ...descriptionProps || {}
34
+ }) : undefined;
24
35
  const componentMap = {
25
36
  Description,
26
37
  Edit: /*#__PURE__*/ React.createElement(Edit, {
@@ -31,9 +42,11 @@ export const mapGlobals = ({ DefaultEditView, config, globals, i18n, readOnly: r
31
42
  SaveButton: SaveButtonComponent,
32
43
  SaveDraftButton: SaveDraftButtonComponent,
33
44
  actionsMap: mapActions({
45
+ WithServerSideProps,
34
46
  globalConfig
35
47
  }),
36
48
  fieldMap: mapFields({
49
+ WithServerSideProps,
37
50
  config,
38
51
  fieldSchema: fields,
39
52
  i18n,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/providers/ComponentMap/buildComponentMap/globals.tsx"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type {\n EditViewProps,\n EntityDescriptionComponent,\n EntityDescriptionFunction,\n SanitizedConfig,\n SanitizedGlobalConfig,\n} from 'payload/types'\n\nimport { ViewDescription, type ViewDescriptionProps } from '@payloadcms/ui/elements/ViewDescription'\nimport { isPlainFunction, isReactComponent } from 'payload/utilities'\nimport React from 'react'\n\nimport type { GlobalComponentMap } from './types.js'\n\nimport { mapActions } from './actions.js'\nimport { mapFields } from './fields.js'\n\nexport const mapGlobals = ({\n DefaultEditView,\n config,\n globals,\n i18n,\n readOnly: readOnlyOverride,\n}: {\n DefaultEditView: React.FC<EditViewProps>\n config: SanitizedConfig\n globals: SanitizedGlobalConfig[]\n i18n: I18n\n readOnly?: boolean\n}): {\n [key: SanitizedGlobalConfig['slug']]: GlobalComponentMap\n} =>\n globals.reduce((acc, globalConfig) => {\n const { slug, fields } = globalConfig\n\n const editViewFromConfig = globalConfig?.admin?.components?.views?.Edit\n\n const SaveButton = globalConfig?.admin?.components?.elements?.SaveButton\n const SaveButtonComponent = SaveButton ? <SaveButton /> : undefined\n\n const SaveDraftButton = globalConfig?.admin?.components?.elements?.SaveDraftButton\n const SaveDraftButtonComponent = SaveDraftButton ? <SaveDraftButton /> : undefined\n\n const PreviewButton = globalConfig?.admin?.components?.elements?.PreviewButton\n const PreviewButtonComponent = PreviewButton ? <PreviewButton /> : undefined\n\n const PublishButton = globalConfig?.admin?.components?.elements?.PublishButton\n const PublishButtonComponent = PublishButton ? <PublishButton /> : undefined\n\n const CustomEditView =\n typeof editViewFromConfig === 'function'\n ? editViewFromConfig\n : typeof editViewFromConfig === 'object' && typeof editViewFromConfig.Default === 'function'\n ? editViewFromConfig.Default\n : typeof editViewFromConfig?.Default === 'object' &&\n 'Component' in editViewFromConfig.Default &&\n typeof editViewFromConfig.Default.Component === 'function'\n ? editViewFromConfig.Default.Component\n : undefined\n\n const Edit = (CustomEditView as React.FC<EditViewProps>) || DefaultEditView\n\n const descriptionProps: ViewDescriptionProps = {\n description:\n (globalConfig.admin &&\n 'description' in globalConfig.admin &&\n (((typeof globalConfig.admin?.description === 'string' ||\n typeof globalConfig.admin?.description === 'object') &&\n globalConfig.admin.description) ||\n (typeof globalConfig.admin?.description === 'function' &&\n isPlainFunction<EntityDescriptionFunction>(globalConfig.admin?.description) &&\n globalConfig.admin?.description()))) ||\n undefined,\n }\n\n const DescriptionComponent =\n (globalConfig.admin &&\n 'description' in globalConfig.admin &&\n ((isReactComponent<EntityDescriptionComponent>(globalConfig.admin.description) &&\n globalConfig.admin.description) ||\n (globalConfig.admin.description && ViewDescription))) ||\n undefined\n\n const Description =\n DescriptionComponent !== undefined ? (\n <DescriptionComponent {...(descriptionProps || {})} />\n ) : undefined\n\n const componentMap: GlobalComponentMap = {\n Description,\n Edit: <Edit globalSlug={globalConfig.slug} />,\n PreviewButton: PreviewButtonComponent,\n PublishButton: PublishButtonComponent,\n SaveButton: SaveButtonComponent,\n SaveDraftButton: SaveDraftButtonComponent,\n actionsMap: mapActions({\n globalConfig,\n }),\n fieldMap: mapFields({\n config,\n fieldSchema: fields,\n i18n,\n readOnly: readOnlyOverride,\n }),\n isPreviewEnabled: !!globalConfig?.admin?.preview,\n }\n\n return {\n ...acc,\n [slug]: componentMap,\n }\n }, {})\n"],"names":["ViewDescription","isPlainFunction","isReactComponent","React","mapActions","mapFields","mapGlobals","DefaultEditView","config","globals","i18n","readOnly","readOnlyOverride","reduce","acc","globalConfig","slug","fields","editViewFromConfig","admin","components","views","Edit","SaveButton","elements","SaveButtonComponent","undefined","SaveDraftButton","SaveDraftButtonComponent","PreviewButton","PreviewButtonComponent","PublishButton","PublishButtonComponent","CustomEditView","Default","Component","descriptionProps","description","DescriptionComponent","Description","componentMap","globalSlug","actionsMap","fieldMap","fieldSchema","isPreviewEnabled","preview"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,SAASA,eAAe,QAAmC,0CAAyC;AACpG,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,oBAAmB;AACrE,OAAOC,WAAW,QAAO;AAIzB,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,SAAS,QAAQ,cAAa;AAEvC,OAAO,MAAMC,aAAa,CAAC,EACzBC,eAAe,EACfC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,UAAUC,gBAAgB,EAO3B,GAGCH,QAAQI,MAAM,CAAC,CAACC,KAAKC;QACnB,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGF;QAEzB,MAAMG,qBAAqBH,cAAcI,OAAOC,YAAYC,OAAOC;QAEnE,MAAMC,aAAaR,cAAcI,OAAOC,YAAYI,UAAUD;QAC9D,MAAME,sBAAsBF,2BAAa,oBAACA,oBAAgBG;QAE1D,MAAMC,kBAAkBZ,cAAcI,OAAOC,YAAYI,UAAUG;QACnE,MAAMC,2BAA2BD,gCAAkB,oBAACA,yBAAqBD;QAEzE,MAAMG,gBAAgBd,cAAcI,OAAOC,YAAYI,UAAUK;QACjE,MAAMC,yB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ACfC,eAAeC;YACfT,YAAYE;YACZE,iBAAiBC;YACjBc,YAAYtC,WAAW;gBACrBW;YACF;YACA4B,UAAUtC,UAAU;gBAClBG;gBACAoC,aAAa3B;gBACbP;gBACAC,UAAUC;YACZ;YACAiC,kBAAkB,CAAC,CAAC9B,cAAcI,OAAO2B;QAC3C;QAEA,OAAO;YACL,GAAGhC,GAAG;YACN,CAACE,KAAK,EAAEwB;QACV;IACF,GAAG,CAAC,GAAE"}
1
+ {"version":3,"sources":["../../../../src/providers/ComponentMap/buildComponentMap/globals.tsx"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type {\n EditViewProps,\n EntityDescriptionComponent,\n EntityDescriptionFunction,\n SanitizedConfig,\n SanitizedGlobalConfig,\n WithServerSideProps as WithServerSidePropsType,\n} from 'payload/types'\n\nimport { ViewDescription, type ViewDescriptionProps } from '@payloadcms/ui/elements/ViewDescription'\nimport { isPlainFunction, isReactComponent } from 'payload/utilities'\nimport React from 'react'\n\nimport type { GlobalComponentMap } from './types.js'\n\nimport { mapActions } from './actions.js'\nimport { mapFields } from './fields.js'\n\nexport const mapGlobals = ({\n DefaultEditView,\n WithServerSideProps,\n config,\n globals,\n i18n,\n readOnly: readOnlyOverride,\n}: {\n DefaultEditView: React.FC<EditViewProps>\n WithServerSideProps: WithServerSidePropsType\n config: SanitizedConfig\n globals: SanitizedGlobalConfig[]\n i18n: I18n\n readOnly?: boolean\n}): {\n [key: SanitizedGlobalConfig['slug']]: GlobalComponentMap\n} =>\n globals.reduce((acc, globalConfig) => {\n const { slug, fields } = globalConfig\n\n const editViewFromConfig = globalConfig?.admin?.components?.views?.Edit\n\n const SaveButton = globalConfig?.admin?.components?.elements?.SaveButton\n\n const SaveButtonComponent = SaveButton ? (\n <WithServerSideProps Component={SaveButton} />\n ) : undefined\n\n const SaveDraftButton = globalConfig?.admin?.components?.elements?.SaveDraftButton\n\n const SaveDraftButtonComponent = SaveDraftButton ? (\n <WithServerSideProps Component={SaveDraftButton} />\n ) : undefined\n\n const PreviewButton = globalConfig?.admin?.components?.elements?.PreviewButton\n\n const PreviewButtonComponent = PreviewButton ? (\n <WithServerSideProps Component={PreviewButton} />\n ) : undefined\n\n const PublishButton = globalConfig?.admin?.components?.elements?.PublishButton\n\n const PublishButtonComponent = PublishButton ? (\n <WithServerSideProps Component={PublishButton} />\n ) : undefined\n\n const CustomEditView =\n typeof editViewFromConfig === 'function'\n ? editViewFromConfig\n : typeof editViewFromConfig === 'object' && typeof editViewFromConfig.Default === 'function'\n ? editViewFromConfig.Default\n : typeof editViewFromConfig?.Default === 'object' &&\n 'Component' in editViewFromConfig.Default &&\n typeof editViewFromConfig.Default.Component === 'function'\n ? editViewFromConfig.Default.Component\n : undefined\n\n const Edit = (CustomEditView as React.FC<EditViewProps>) || DefaultEditView\n\n const descriptionProps: ViewDescriptionProps = {\n description:\n (globalConfig.admin &&\n 'description' in globalConfig.admin &&\n (((typeof globalConfig.admin?.description === 'string' ||\n typeof globalConfig.admin?.description === 'object') &&\n globalConfig.admin.description) ||\n (typeof globalConfig.admin?.description === 'function' &&\n isPlainFunction<EntityDescriptionFunction>(globalConfig.admin?.description) &&\n globalConfig.admin?.description()))) ||\n undefined,\n }\n\n const DescriptionComponent =\n (globalConfig.admin &&\n 'description' in globalConfig.admin &&\n ((isReactComponent<EntityDescriptionComponent>(globalConfig.admin.description) &&\n globalConfig.admin.description) ||\n (globalConfig.admin.description && ViewDescription))) ||\n undefined\n\n const Description =\n DescriptionComponent !== undefined ? (\n <WithServerSideProps Component={DescriptionComponent} {...(descriptionProps || {})} />\n ) : undefined\n\n const componentMap: GlobalComponentMap = {\n Description,\n Edit: <Edit globalSlug={globalConfig.slug} />,\n PreviewButton: PreviewButtonComponent,\n PublishButton: PublishButtonComponent,\n SaveButton: SaveButtonComponent,\n SaveDraftButton: SaveDraftButtonComponent,\n actionsMap: mapActions({\n WithServerSideProps,\n globalConfig,\n }),\n fieldMap: mapFields({\n WithServerSideProps,\n config,\n fieldSchema: fields,\n i18n,\n readOnly: readOnlyOverride,\n }),\n isPreviewEnabled: !!globalConfig?.admin?.preview,\n }\n\n return {\n ...acc,\n [slug]: componentMap,\n }\n }, {})\n"],"names":["ViewDescription","isPlainFunction","isReactComponent","React","mapActions","mapFields","mapGlobals","DefaultEditView","WithServerSideProps","config","globals","i18n","readOnly","readOnlyOverride","reduce","acc","globalConfig","slug","fields","editViewFromConfig","admin","components","views","Edit","SaveButton","elements","SaveButtonComponent","Component","undefined","SaveDraftButton","SaveDraftButtonComponent","PreviewButton","PreviewButtonComponent","PublishButton","PublishButtonComponent","CustomEditView","Default","descriptionProps","description","DescriptionComponent","Description","componentMap","globalSlug","actionsMap","fieldMap","fieldSchema","isPreviewEnabled","preview"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAUA,SAASA,eAAe,QAAmC,0CAAyC;AACpG,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,oBAAmB;AACrE,OAAOC,WAAW,QAAO;AAIzB,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,SAAS,QAAQ,cAAa;AAEvC,OAAO,MAAMC,aAAa,CAAC,EACzBC,eAAe,EACfC,mBAAmB,EACnBC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,UAAUC,gBAAgB,EAQ3B,GAGCH,QAAQI,MAAM,CAAC,CAACC,KAAKC;QACnB,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGF;QAEzB,MAAMG,qBAAqBH,cAAcI,OAAOC,YAAYC,OAAOC;QAEnE,MAAMC,aAAaR,cAAcI,OAAOC,YAAYI,UAAUD;QAE9D,MAAME,sBAAsBF,2BAC1B,oBAAChB;YAAoBmB,WAAWH;aAC9BI;QAEJ,MAAMC,kBAAkBb,cAAcI,OAAOC,YAAYI,UAAUI;QAEnE,MAAMC,2BAA2BD,gCAC/B,oBAACrB;YAAoBmB,WAAWE;aAC9BD;QAEJ,M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oB,CAAC,CAAC;aAC/ET;QAEN,MAAMa,eAAmC;YACvCD;YACAjB,oBAAM,oBAACA;gBAAKmB,YAAY1B,aAAaC,IAAI;;YACzCc,eAAeC;YACfC,eAAeC;YACfV,YAAYE;YACZG,iBAAiBC;YACjBa,YAAYvC,WAAW;gBACrBI;gBACAQ;YACF;YACA4B,UAAUvC,UAAU;gBAClBG;gBACAC;gBACAoC,aAAa3B;gBACbP;gBACAC,UAAUC;YACZ;YACAiC,kBAAkB,CAAC,CAAC9B,cAAcI,OAAO2B;QAC3C;QAEA,OAAO;YACL,GAAGhC,GAAG;YACN,CAACE,KAAK,EAAEwB;QACV;IACF,GAAG,CAAC,GAAE"}
@@ -1,5 +1,5 @@
1
1
  import type { I18n } from '@payloadcms/translations';
2
- import type { AdminViewProps, EditViewProps, SanitizedConfig } from 'payload/types';
2
+ import type { AdminViewProps, EditViewProps, Payload, SanitizedConfig } from 'payload/types';
3
3
  import React from 'react';
4
4
  import type { ComponentMap } from './types.js';
5
5
  export declare const buildComponentMap: (args: {
@@ -8,6 +8,7 @@ export declare const buildComponentMap: (args: {
8
8
  children: React.ReactNode;
9
9
  config: SanitizedConfig;
10
10
  i18n: I18n;
11
+ payload: Payload;
11
12
  readOnly?: boolean;
12
13
  }) => {
13
14
  componentMap: ComponentMap;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/ComponentMap/buildComponentMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEnF,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,eAAO,MAAM,iBAAiB,SAAU;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,CAAA;IACxC,eAAe,EAAE,MAAM,EAAE,CAAC,cAAc,CAAC,CAAA;IACzC,QAAQ,EAAE,MAAM,SAAS,CAAA;IACzB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,KAAG;IACF,YAAY,EAAE,YAAY,CAAA;IAC1B,eAAe,EAAE,MAAM,SAAS,CAAA;CAyDjC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/ComponentMap/buildComponentMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,OAAO,EACP,eAAe,EAEhB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAM9C,eAAO,MAAM,iBAAiB,SAAU;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,CAAA;IACxC,eAAe,EAAE,MAAM,EAAE,CAAC,cAAc,CAAC,CAAA;IACzC,QAAQ,EAAE,MAAM,SAAS,CAAA;IACzB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,KAAG;IACF,YAAY,EAAE,YAAY,CAAA;IAC1B,eAAe,EAAE,MAAM,SAAS,CAAA;CAmEjC,CAAA"}
@@ -1,11 +1,20 @@
1
1
  import React from 'react';
2
+ import { WithServerSideProps as WithServerSidePropsGeneric } from './WithServerSideProps.js';
2
3
  import { mapCollections } from './collections.js';
3
4
  import { mapGlobals } from './globals.js';
4
5
  export const buildComponentMap = (args)=>{
5
- const { DefaultEditView, DefaultListView, children, config, i18n, readOnly } = args;
6
+ const { DefaultEditView, DefaultListView, children, config, i18n, payload, readOnly } = args;
7
+ const WithServerSideProps = ({ Component, ...rest })=>{
8
+ return /*#__PURE__*/ React.createElement(WithServerSidePropsGeneric, {
9
+ Component: Component,
10
+ payload: payload,
11
+ ...rest
12
+ });
13
+ };
6
14
  const collections = mapCollections({
7
15
  DefaultEditView,
8
16
  DefaultListView,
17
+ WithServerSideProps,
9
18
  collections: config.collections,
10
19
  config,
11
20
  i18n,
@@ -13,6 +22,7 @@ export const buildComponentMap = (args)=>{
13
22
  });
14
23
  const globals = mapGlobals({
15
24
  DefaultEditView,
25
+ WithServerSideProps,
16
26
  config,
17
27
  globals: config.globals,
18
28
  i18n,
@@ -28,14 +38,20 @@ export const buildComponentMap = (args)=>{
28
38
  return /*#__PURE__*/ React.createElement(Component, null, children);
29
39
  };
30
40
  const LogoutButtonComponent = config.admin?.components?.logout?.Button;
31
- const LogoutButton = LogoutButtonComponent ? /*#__PURE__*/ React.createElement(LogoutButtonComponent, null) : null;
41
+ const LogoutButton = LogoutButtonComponent ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
42
+ Component: LogoutButtonComponent
43
+ }) : null;
32
44
  const IconComponent = config.admin?.components?.graphics?.Icon;
33
- const Icon = IconComponent ? /*#__PURE__*/ React.createElement(IconComponent, null) : null;
45
+ const Icon = IconComponent ? /*#__PURE__*/ React.createElement(WithServerSideProps, {
46
+ Component: IconComponent
47
+ }) : null;
34
48
  return {
35
49
  componentMap: {
36
50
  Icon,
37
51
  LogoutButton,
38
- actions: config.admin?.components?.actions?.map((Component)=>/*#__PURE__*/ React.createElement(Component, null)),
52
+ actions: config.admin?.components?.actions?.map((Component)=>/*#__PURE__*/ React.createElement(WithServerSideProps, {
53
+ Component: Component
54
+ })),
39
55
  collections,
40
56
  globals
41
57
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/providers/ComponentMap/buildComponentMap/index.tsx"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { AdminViewProps, EditViewProps, SanitizedConfig } from 'payload/types'\n\nimport React from 'react'\n\nimport type { ComponentMap } from './types.js'\n\nimport { mapCollections } from './collections.js'\nimport { mapGlobals } from './globals.js'\n\nexport const buildComponentMap = (args: {\n DefaultEditView: React.FC<EditViewProps>\n DefaultListView: React.FC<AdminViewProps>\n children: React.ReactNode\n config: SanitizedConfig\n i18n: I18n\n readOnly?: boolean\n}): {\n componentMap: ComponentMap\n wrappedChildren: React.ReactNode\n} => {\n const { DefaultEditView, DefaultListView, children, config, i18n, readOnly } = args\n\n const collections = mapCollections({\n DefaultEditView,\n DefaultListView,\n collections: config.collections,\n config,\n i18n,\n readOnly,\n })\n\n const globals = mapGlobals({\n DefaultEditView,\n config,\n globals: config.globals,\n i18n,\n readOnly,\n })\n\n const NestProviders = ({ children, providers }) => {\n const Component = providers[0]\n if (providers.length > 1) {\n return (\n <Component>\n <NestProviders providers={providers.slice(1)}>{children}</NestProviders>\n </Component>\n )\n }\n return <Component>{children}</Component>\n }\n\n const LogoutButtonComponent = config.admin?.components?.logout?.Button\n\n const LogoutButton = LogoutButtonComponent ? <LogoutButtonComponent /> : null\n\n const IconComponent = config.admin?.components?.graphics?.Icon\n\n const Icon = IconComponent ? <IconComponent /> : null\n\n return {\n componentMap: {\n Icon,\n LogoutButton,\n actions: config.admin?.components?.actions?.map((Component) => <Component />),\n collections,\n globals,\n },\n wrappedChildren:\n Array.isArray(config.admin?.components?.providers) &&\n config.admin?.components?.providers.length > 0 ? (\n <NestProviders providers={config.admin?.components?.providers}>{children}</NestProviders>\n ) : (\n children\n ),\n }\n}\n"],"names":["React","mapCollections","mapGlobals","buildComponentMap","args","DefaultEditView","DefaultListView","children","config","i18n","readOnly","collections","globals","NestProviders","providers","Component","length","slice","LogoutButtonComponent","admin","components","logout","Button","LogoutButton","IconComponent","graphics","Icon","componentMap","actions","map","wrappedChildren","Array","isArray"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,OA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ComponentMap/buildComponentMap/index.tsx"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type {\n AdminViewProps,\n EditViewProps,\n Payload,\n SanitizedConfig,\n WithServerSideProps as WithServerSidePropsType,\n} from 'payload/types'\n\nimport React from 'react'\n\nimport type { ComponentMap } from './types.js'\n\nimport { WithServerSideProps as WithServerSidePropsGeneric } from './WithServerSideProps.js'\nimport { mapCollections } from './collections.js'\nimport { mapGlobals } from './globals.js'\n\nexport const buildComponentMap = (args: {\n DefaultEditView: React.FC<EditViewProps>\n DefaultListView: React.FC<AdminViewProps>\n children: React.ReactNode\n config: SanitizedConfig\n i18n: I18n\n payload: Payload\n readOnly?: boolean\n}): {\n componentMap: ComponentMap\n wrappedChildren: React.ReactNode\n} => {\n const { DefaultEditView, DefaultListView, children, config, i18n, payload, readOnly } = args\n\n const WithServerSideProps: WithServerSidePropsType = ({ Component, ...rest }) => {\n return <WithServerSidePropsGeneric Component={Component} payload={payload} {...rest} />\n }\n\n const collections = mapCollections({\n DefaultEditView,\n DefaultListView,\n WithServerSideProps,\n collections: config.collections,\n config,\n i18n,\n readOnly,\n })\n\n const globals = mapGlobals({\n DefaultEditView,\n WithServerSideProps,\n config,\n globals: config.globals,\n i18n,\n readOnly,\n })\n\n const NestProviders = ({ children, providers }) => {\n const Component = providers[0]\n if (providers.length > 1) {\n return (\n <Component>\n <NestProviders providers={providers.slice(1)}>{children}</NestProviders>\n </Component>\n )\n }\n return <Component>{children}</Component>\n }\n\n const LogoutButtonComponent = config.admin?.components?.logout?.Button\n\n const LogoutButton = LogoutButtonComponent ? (\n <WithServerSideProps Component={LogoutButtonComponent} />\n ) : null\n\n const IconComponent = config.admin?.components?.graphics?.Icon\n\n const Icon = IconComponent ? <WithServerSideProps Component={IconComponent} /> : null\n\n return {\n componentMap: {\n Icon,\n LogoutButton,\n actions: config.admin?.components?.actions?.map((Component) => (\n <WithServerSideProps Component={Component} />\n )),\n collections,\n globals,\n },\n wrappedChildren:\n Array.isArray(config.admin?.components?.providers) &&\n config.admin?.components?.providers.length > 0 ? (\n <NestProviders providers={config.admin?.components?.providers}>{children}</NestProviders>\n ) : (\n children\n ),\n }\n}\n"],"names":["React","WithServerSideProps","WithServerSidePropsGeneric","mapCollections","mapGlobals","buildComponentMap","args","DefaultEditView","DefaultListView","children","config","i18n","payload","readOnly","Component","rest","collections","globals","NestProviders","providers","length","slice","LogoutButtonComponent","admin","components","logout","Button","LogoutButton","IconComponent","graphics","Icon","componentMap","actions","map","wrappedChildren","Array","isArray"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,OAAOA,WAAW,QAAO;AAIzB,SAASC,uBAAuBC,0BAA0B,QAAQ,2BAA0B;AAC5F,SAASC,cAAc,QAAQ,mBAAkB;AACjD,SAASC,UAAU,QAAQ,eAAc;AAEzC,OAAO,MAAMC,oBAAoB,CAACC;IAYhC,MAAM,EAAEC,eAAe,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGP;IAExF,MAAML,sBAA+C,CAAC,EAAEa,SAAS,EAAE,GAAGC,MAAM;QAC1E,qBAAO,oBAACb;YAA2BY,WAAWA;YAAWF,SAASA;YAAU,GAAGG,IAAI;;IACrF;IAEA,MAAMC,cAAcb,eAAe;QACjCI;QACAC;QACAP;QACAe,aAAaN,OAAOM,WAAW;QAC/BN;QACAC;QACAE;IACF;IAEA,MAAMI,UAAUb,WAAW;QACzBG;QACAN;QACAS;QACAO,SAASP,OAAOO,OAAO;QACvBN;QACAE;IACF;IAEA,MAAMK,gBAAgB,CAAC,EAAET,QAAQ,EAAEU,SAAS,EAAE;QAC5C,MAAML,YAAYK,SAAS,CAAC,EAAE;QAC9B,IAAIA,UAAUC,MAAM,GAAG,GAAG;YACxB,qBACE,oBAACN,+BACC,oBAACI;gBAAcC,WAAWA,UAAUE,KAAK,CAAC;eAAKZ;QAGrD;QACA,qBAAO,oBAACK,iBAAWL;IACrB;IAEA,MAAMa,wBAAwBZ,OAAOa,KAAK,EAAEC,YAAYC,QAAQC;IAEhE,MAAMC,eAAeL,sCACnB,oBAACrB;QAAoBa,WAAWQ;SAC9B;IAEJ,MAAMM,gBAAgBlB,OAAOa,KAAK,EAAEC,YAAYK,UAAUC;IAE1D,MAAMA,OAAOF,8BAAgB,oBAAC3B;QAAoBa,WAAWc;SAAoB;IAEjF,OAAO;QACLG,cAAc;YACZD;YACAH;YACAK,SAAStB,OAAOa,KAAK,EAAEC,YAAYQ,SAASC,IAAI,CAACnB,0BAC/C,oBAACb;oBAAoBa,WAAWA;;YAElCE;YACAC;QACF;QACAiB,iBACEC,MAAMC,OAAO,CAAC1B,OAAOa,KAAK,EAAEC,YAAYL,cACxCT,OAAOa,KAAK,EAAEC,YAAYL,UAAUC,SAAS,kBAC3C,oBAACF;YAAcC,WAAWT,OAAOa,KAAK,EAAEC,YAAYL;WAAYV,YAEhEA;IAEN;AACF,EAAC"}
@@ -16,6 +16,7 @@ export type IComponentMapContext = {
16
16
  path: string;
17
17
  }) => MappedField | undefined;
18
18
  };
19
+ export { WithServerSideProps } from './buildComponentMap/WithServerSideProps.js';
19
20
  export declare const ComponentMapProvider: React.FC<{
20
21
  children: React.ReactNode;
21
22
  componentMap: ComponentMap;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ComponentMap/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAEvF,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,YAAY,CAAA;IAC1B,eAAe,EAAE,CAAC,IAAI,EAAE;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,UAAU,CAAC,EAAE,MAAM,CAAA;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E,KAAK,EAAE,GAAG,QAAQ,CAAA;IACtF,oBAAoB,EAAE,CAAC,IAAI,EAAE;QAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,MAAM,CAAA;KACb,KAAK,WAAW,GAAG,SAAS,CAAA;CAC9B,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAIhF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAwDA,CAAA;AAED,eAAO,MAAM,eAAe,QAAO,oBAAuD,CAAA"}
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import React, { createContext, useCallback, useContext } from 'react';
3
+ export { WithServerSideProps } from './buildComponentMap/WithServerSideProps.js';
3
4
  const ComponentMapContext = /*#__PURE__*/ createContext({});
4
5
  export const ComponentMapProvider = ({ children, componentMap })=>{
5
6
  const getMappedFieldByPath = useCallback(({ collectionSlug, globalSlug, path })=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/providers/ComponentMap/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useCallback, useContext } from 'react'\n\nimport type { ComponentMap, FieldMap, MappedField } from './buildComponentMap/types.js'\n\nexport type IComponentMapContext = {\n componentMap: ComponentMap\n getComponentMap: (args: {\n collectionSlug?: string\n globalSlug?: string\n }) => ComponentMap['collections'][0] | ComponentMap['globals'][0]\n getFieldMap: (args: { collectionSlug?: string; globalSlug?: string }) => [] | FieldMap\n getMappedFieldByPath: (args: {\n collectionSlug?: string\n globalSlug?: string\n path: string\n }) => MappedField | undefined\n}\n\nconst ComponentMapContext = createContext<IComponentMapContext>({} as IComponentMapContext)\n\nexport const ComponentMapProvider: React.FC<{\n children: React.ReactNode\n componentMap: ComponentMap\n}> = ({ children, componentMap }) => {\n const getMappedFieldByPath: IComponentMapContext['getMappedFieldByPath'] = useCallback(\n ({ collectionSlug, globalSlug, path }) => {\n let fieldMap: FieldMap\n\n if (collectionSlug) {\n fieldMap = componentMap.collections[collectionSlug].fieldMap\n }\n\n if (globalSlug) {\n fieldMap = componentMap.globals[globalSlug].fieldMap\n }\n\n // TODO: better lookup for nested fields, etc.\n return fieldMap.find((field) => 'name' in field && field.name === path)\n },\n [componentMap],\n )\n\n const getFieldMap: IComponentMapContext['getFieldMap'] = useCallback(\n ({ collectionSlug, globalSlug }) => {\n if (collectionSlug) {\n return componentMap.collections[collectionSlug].fieldMap\n }\n\n if (globalSlug) {\n return componentMap.globals[globalSlug].fieldMap\n }\n\n return []\n },\n [componentMap],\n )\n\n const getComponentMap: IComponentMapContext['getComponentMap'] = useCallback(\n ({ collectionSlug, globalSlug }) => {\n if (collectionSlug) {\n return componentMap.collections[collectionSlug]\n }\n\n if (globalSlug) {\n return componentMap.globals[globalSlug]\n }\n\n return {} as ComponentMap['collections'][0] | ComponentMap['globals'][0]\n },\n [componentMap],\n )\n\n return (\n <ComponentMapContext.Provider\n value={{ componentMap, getComponentMap, getFieldMap, getMappedFieldByPath }}\n >\n {children}\n </ComponentMapContext.Provider>\n )\n}\n\nexport const useComponentMap = (): IComponentMapContext => useContext(ComponentMapContext)\n"],"names":["React","createContext","useCallback","useContext","ComponentMapContext","ComponentMapProvider","children","componentMap","getMappedFieldByPath","collectionSlug","globalSlug","path","fieldMap","collections","globals","find","field","name","getFieldMap","getComponentMap","Provider","value","useComponentMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,QAAQ,QAAO;AAkBrE,MAAMC,oCAAsBH,cAAoC,CAAC;AAEjE,OAAO,MAAMI,uBAGR,CAAC,EAAEC,QAAQ,EAAEC,YAAY,EAAE;IAC9B,MAAMC,uBAAqEN,YACzE,CAAC,EAAEO,cAAc,EAAEC,UAAU,EAAEC,IAAI,EAAE;QACnC,IAAIC;QAEJ,IAAIH,gBAAgB;YAClBG,WAAWL,aAAaM,WAAW,CAACJ,eAAe,CAACG,QAAQ;QAC9D;QAEA,IAAIF,YAAY;YACdE,WAAWL,aAAaO,OAAO,CAACJ,WAAW,CAACE,QAAQ;QACtD;QAEA,8CAA8C;QAC9C,OAAOA,SAASG,IAAI,CAAC,CAACC,QAAU,UAAUA,SAASA,MAAMC,IAAI,KAAKN;IACpE,GACA;QAACJ;KAAa;IAGhB,MAAMW,cAAmDhB,YACvD,CAAC,EAAEO,cAAc,EAAEC,UAAU,EAAE;QAC7B,IAAID,gBAAgB;YAClB,OAAOF,aAAaM,WAAW,CAACJ,eAAe,CAACG,QAAQ;QAC1D;QAEA,IAAIF,YAAY;YACd,OAAOH,aAAaO,OAAO,CAACJ,WAAW,CAACE,QAAQ;QAClD;QAEA,OAAO,EAAE;IACX,GACA;QAACL;KAAa;IAGhB,MAAMY,kBAA2DjB,YAC/D,CAAC,EAAEO,cAAc,EAAEC,UAAU,EAAE;QAC7B,IAAID,gBAAgB;YAClB,OAAOF,aAAaM,WAAW,CAACJ,eAAe;QACjD;QAEA,IAAIC,YAAY;YACd,OAAOH,aAAaO,OAAO,CAACJ,WAAW;QACzC;QAEA,OAAO,CAAC;IACV,GACA;QAACH;KAAa;IAGhB,qBACE,oBAACH,oBAAoBgB,QAAQ;QAC3BC,OAAO;YAAEd;YAAcY;YAAiBD;YAAaV;QAAqB;OAEzEF;AAGP,EAAC;AAED,OAAO,MAAMgB,kBAAkB,IAA4BnB,WAAWC,qBAAoB"}
1
+ {"version":3,"sources":["../../../src/providers/ComponentMap/index.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, useCallback, useContext } from 'react'\n\nimport type { ComponentMap, FieldMap, MappedField } from './buildComponentMap/types.js'\n\nexport type IComponentMapContext = {\n componentMap: ComponentMap\n getComponentMap: (args: {\n collectionSlug?: string\n globalSlug?: string\n }) => ComponentMap['collections'][0] | ComponentMap['globals'][0]\n getFieldMap: (args: { collectionSlug?: string; globalSlug?: string }) => [] | FieldMap\n getMappedFieldByPath: (args: {\n collectionSlug?: string\n globalSlug?: string\n path: string\n }) => MappedField | undefined\n}\n\nexport { WithServerSideProps } from './buildComponentMap/WithServerSideProps.js'\n\nconst ComponentMapContext = createContext<IComponentMapContext>({} as IComponentMapContext)\n\nexport const ComponentMapProvider: React.FC<{\n children: React.ReactNode\n componentMap: ComponentMap\n}> = ({ children, componentMap }) => {\n const getMappedFieldByPath: IComponentMapContext['getMappedFieldByPath'] = useCallback(\n ({ collectionSlug, globalSlug, path }) => {\n let fieldMap: FieldMap\n\n if (collectionSlug) {\n fieldMap = componentMap.collections[collectionSlug].fieldMap\n }\n\n if (globalSlug) {\n fieldMap = componentMap.globals[globalSlug].fieldMap\n }\n\n // TODO: better lookup for nested fields, etc.\n return fieldMap.find((field) => 'name' in field && field.name === path)\n },\n [componentMap],\n )\n\n const getFieldMap: IComponentMapContext['getFieldMap'] = useCallback(\n ({ collectionSlug, globalSlug }) => {\n if (collectionSlug) {\n return componentMap.collections[collectionSlug].fieldMap\n }\n\n if (globalSlug) {\n return componentMap.globals[globalSlug].fieldMap\n }\n\n return []\n },\n [componentMap],\n )\n\n const getComponentMap: IComponentMapContext['getComponentMap'] = useCallback(\n ({ collectionSlug, globalSlug }) => {\n if (collectionSlug) {\n return componentMap.collections[collectionSlug]\n }\n\n if (globalSlug) {\n return componentMap.globals[globalSlug]\n }\n\n return {} as ComponentMap['collections'][0] | ComponentMap['globals'][0]\n },\n [componentMap],\n )\n\n return (\n <ComponentMapContext.Provider\n value={{ componentMap, getComponentMap, getFieldMap, getMappedFieldByPath }}\n >\n {children}\n </ComponentMapContext.Provider>\n )\n}\n\nexport const useComponentMap = (): IComponentMapContext => useContext(ComponentMapContext)\n"],"names":["React","createContext","useCallback","useContext","WithServerSideProps","ComponentMapContext","ComponentMapProvider","children","componentMap","getMappedFieldByPath","collectionSlug","globalSlug","path","fieldMap","collections","globals","find","field","name","getFieldMap","getComponentMap","Provider","value","useComponentMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,QAAQ,QAAO;AAkBrE,SAASC,mBAAmB,QAAQ,6CAA4C;AAEhF,MAAMC,oCAAsBJ,cAAoC,CAAC;AAEjE,OAAO,MAAMK,uBAGR,CAAC,EAAEC,QAAQ,EAAEC,YAAY,EAAE;IAC9B,MAAMC,uBAAqEP,YACzE,CAAC,EAAEQ,cAAc,EAAEC,UAAU,EAAEC,IAAI,EAAE;QACnC,IAAIC;QAEJ,IAAIH,gBAAgB;YAClBG,WAAWL,aAAaM,WAAW,CAACJ,eAAe,CAACG,QAAQ;QAC9D;QAEA,IAAIF,YAAY;YACdE,WAAWL,aAAaO,OAAO,CAACJ,WAAW,CAACE,QAAQ;QACtD;QAEA,8CAA8C;QAC9C,OAAOA,SAASG,IAAI,CAAC,CAACC,QAAU,UAAUA,SAASA,MAAMC,IAAI,KAAKN;IACpE,GACA;QAACJ;KAAa;IAGhB,MAAMW,cAAmDjB,YACvD,CAAC,EAAEQ,cAAc,EAAEC,UAAU,EAAE;QAC7B,IAAID,gBAAgB;YAClB,OAAOF,aAAaM,WAAW,CAACJ,eAAe,CAACG,QAAQ;QAC1D;QAEA,IAAIF,YAAY;YACd,OAAOH,aAAaO,OAAO,CAACJ,WAAW,CAACE,QAAQ;QAClD;QAEA,OAAO,EAAE;IACX,GACA;QAACL;KAAa;IAGhB,MAAMY,kBAA2DlB,YAC/D,CAAC,EAAEQ,cAAc,EAAEC,UAAU,EAAE;QAC7B,IAAID,gBAAgB;YAClB,OAAOF,aAAaM,WAAW,CAACJ,eAAe;QACjD;QAEA,IAAIC,YAAY;YACd,OAAOH,aAAaO,OAAO,CAACJ,WAAW;QACzC;QAEA,OAAO,CAAC;IACV,GACA;QAACH;KAAa;IAGhB,qBACE,oBAACH,oBAAoBgB,QAAQ;QAC3BC,OAAO;YAAEd;YAAcY;YAAiBD;YAAaV;QAAqB;OAEzEF;AAGP,EAAC;AAED,OAAO,MAAMgB,kBAAkB,IAA4BpB,WAAWE,qBAAoB"}
@@ -1,4 +1,3 @@
1
- @import 'fonts';
2
1
  @import 'styles';
3
2
  @import './toastify.scss';
4
3
  @import './colors.scss';
@@ -20,9 +19,9 @@
20
19
  --theme-overlay: rgba(5, 5, 5, 0.5);
21
20
  --theme-baseline: #{$baseline-px};
22
21
  --theme-baseline-body-size: #{$baseline-body-size};
23
- --font-body: 'Suisse Intl', system-ui;
22
+ --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
23
+ sans-serif;
24
24
  --font-mono: monospace;
25
- --font-serif: 'Merriweather', serif;
26
25
 
27
26
  --style-radius-s: #{$style-radius-s};
28
27
  --style-radius-m: #{$style-radius-m};
@@ -21,13 +21,6 @@ $baseline: math.div($baseline-px, $baseline-body-size) + rem;
21
21
  @return (math.div($baseline-px, $baseline-body-size) * $multiplier) + rem;
22
22
  }
23
23
 
24
- //////////////////////////////
25
- // FONTS (DEPRECATED. DO NOT USE. PREFER CSS VARIABLES)
26
- //////////////////////////////
27
-
28
- $font-body: 'Suisse Intl' !default;
29
- $font-mono: monospace !default;
30
-
31
24
  //////////////////////////////
32
25
  // COLORS (DEPRECATED. DO NOT USE. PREFER CSS VARIABLES)
33
26
  //////////////////////////////
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/ui",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.11",
4
4
  "type": "module",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -82,9 +82,9 @@
82
82
  "default": "./dist/prod/styles.css"
83
83
  },
84
84
  "./scss": {
85
- "import": "./dist/scss.scss",
86
- "require": "./dist/scss.scss",
87
- "default": "./dist/scss.scss"
85
+ "import": "./dist/scss/styles.scss",
86
+ "require": "./dist/scss/styles.scss",
87
+ "default": "./dist/scss/styles.scss"
88
88
  },
89
89
  "./scss/app.scss": "./dist/scss/app.scss"
90
90
  },
@@ -106,7 +106,7 @@
106
106
  "terser-webpack-plugin": "^5.3.10",
107
107
  "webpack": "^5.78.0",
108
108
  "webpack-cli": "^5.1.4",
109
- "payload": "3.0.0-beta.1",
109
+ "payload": "3.0.0-beta.11",
110
110
  "@payloadcms/eslint-config": "1.1.1"
111
111
  },
112
112
  "dependencies": {
@@ -131,15 +131,15 @@
131
131
  "react-toastify": "10.0.4",
132
132
  "use-context-selector": "1.4.1",
133
133
  "uuid": "9.0.1",
134
- "@payloadcms/translations": "3.0.0-beta.1"
134
+ "@payloadcms/translations": "3.0.0-beta.11"
135
135
  },
136
136
  "peerDependencies": {
137
- "next": "14.2.0-canary.23",
137
+ "next": "^14.2.0-canary.23",
138
138
  "react": "^18.0.0",
139
- "payload": "3.0.0-beta.1"
139
+ "payload": "3.0.0-beta.11"
140
140
  },
141
141
  "engines": {
142
- "node": ">=18.17.0"
142
+ "node": ">=18.20.2"
143
143
  },
144
144
  "files": [
145
145
  "dist"
Binary file
Binary file
@@ -1,75 +0,0 @@
1
- @font-face {
2
- font-family: 'Suisse Intl';
3
- src:
4
- url('../assets/fonts/SuisseIntl.woff2') format('woff2'),
5
- url('../assets/fonts/SuisseIntl.woff') format('woff');
6
- font-weight: normal;
7
- font-style: normal;
8
- }
9
-
10
- @font-face {
11
- font-family: 'Suisse Intl';
12
- src:
13
- url('../assets/fonts/SuisseIntl-Medium.woff2') format('woff2'),
14
- url('../assets/fonts/SuisseIntl-Medium.woff') format('woff');
15
- font-weight: 500;
16
- font-style: normal;
17
- }
18
-
19
- @font-face {
20
- font-family: 'Suisse Intl';
21
- src:
22
- url('../assets/fonts/SuisseIntl-SemiBold.woff2') format('woff2'),
23
- url('../assets/fonts/SuisseIntl-SemiBold.woff') format('woff');
24
- font-weight: 600;
25
- font-style: normal;
26
- }
27
-
28
- @font-face {
29
- font-family: 'Suisse Intl';
30
- src:
31
- url('../assets/fonts/SuisseIntl-Bold.woff2') format('woff2'),
32
- url('../assets/fonts/SuisseIntl-Bold.woff') format('woff');
33
- font-weight: bold;
34
- font-style: normal;
35
- }
36
-
37
- @font-face {
38
- font-family: 'Merriweather';
39
- font-style: normal;
40
- font-weight: 400;
41
- src:
42
- local(''),
43
- url('../assets/fonts/merriweather-v30-latin-regular.woff2') format('woff2'),
44
- url('../assets/fonts/merriweather-v30-latin-regular.woff') format('woff');
45
- }
46
-
47
- @font-face {
48
- font-family: 'Merriweather';
49
- font-style: italic;
50
- font-weight: 400;
51
- src:
52
- local(''),
53
- url('../assets/fonts/merriweather-v30-latin-italic.woff2') format('woff2'),
54
- url('../assets/fonts/merriweather-v30-latin-italic.woff') format('woff');
55
- }
56
-
57
- @font-face {
58
- font-family: 'Merriweather';
59
- font-style: normal;
60
- font-weight: 900;
61
- src:
62
- local(''),
63
- url('../assets/fonts/merriweather-v30-latin-900.woff2') format('woff2'),
64
- url('../assets/fonts/merriweather-v30-latin-900.woff') format('woff');
65
- }
66
-
67
- @font-face {
68
- font-family: 'Merriweather';
69
- font-style: italic;
70
- font-weight: 900;
71
- src:
72
- local(''),
73
- url('../assets/fonts/merriweather-v30-latin-900italic.woff2') format('woff2'),
74
- url('../assets/fonts/merriweather-v30-latin-900italic.woff') format('woff');
75
- }