@panneau/fields 5.0.0-alpha.3 → 5.0.0-alpha.5

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 (88) hide show
  1. package/README.md +67 -20
  2. package/dist/file/FileField.css +54 -0
  3. package/dist/file/FileField.d.ts +50 -0
  4. package/dist/file/FileField.d.ts.map +1 -0
  5. package/dist/file/FileField.js +198 -0
  6. package/dist/file/FileField.js.map +1 -0
  7. package/dist/file/FileField.module.js +22 -0
  8. package/dist/file/FileField.module.js.map +1 -0
  9. package/dist/file/index.d.ts +3 -0
  10. package/dist/file/index.d.ts.map +1 -0
  11. package/dist/file/index.js +1 -0
  12. package/dist/index.d.ts +9 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +9 -2
  15. package/dist/localized/LocalizedField.d.ts.map +1 -1
  16. package/dist/localized/LocalizedField.js +1 -0
  17. package/dist/localized/LocalizedField.js.map +1 -1
  18. package/dist/relation/RelationField.d.ts.map +1 -1
  19. package/dist/relation/RelationField.js +24 -24
  20. package/dist/relation/RelationField.js.map +1 -1
  21. package/dist/shared/DefinitionField.d.ts +3 -1
  22. package/dist/shared/DefinitionField.d.ts.map +1 -1
  23. package/dist/shared/DefinitionField.js +80 -72
  24. package/dist/shared/DefinitionField.js.map +1 -1
  25. package/dist/shared/builtIn.d.ts +3 -2
  26. package/dist/shared/builtIn.d.ts.map +1 -1
  27. package/dist/shared/builtIn.js +5 -2
  28. package/dist/shared/builtIn.js.map +1 -1
  29. package/dist/shared/check.d.ts +27 -0
  30. package/dist/shared/check.d.ts.map +1 -0
  31. package/dist/shared/check.js +18 -0
  32. package/dist/shared/check.js.map +1 -0
  33. package/dist/shared/context.d.ts +15 -2
  34. package/dist/shared/context.d.ts.map +1 -1
  35. package/dist/shared/context.js +26 -18
  36. package/dist/shared/context.js.map +1 -1
  37. package/dist/shared/entry.d.ts +4 -0
  38. package/dist/shared/entry.d.ts.map +1 -1
  39. package/dist/shared/entry.js +12 -1
  40. package/dist/shared/entry.js.map +1 -1
  41. package/dist/shared/types.d.ts +2 -0
  42. package/dist/shared/types.d.ts.map +1 -1
  43. package/dist/slug/SlugField.css +18 -0
  44. package/dist/slug/SlugField.d.ts +31 -3
  45. package/dist/slug/SlugField.d.ts.map +1 -1
  46. package/dist/slug/SlugField.js +231 -159
  47. package/dist/slug/SlugField.js.map +1 -1
  48. package/dist/slug/SlugField.module.js +14 -0
  49. package/dist/slug/SlugField.module.js.map +1 -0
  50. package/dist/slug/index.d.ts +1 -1
  51. package/dist/slug/index.d.ts.map +1 -1
  52. package/dist/slug/index.js +1 -1
  53. package/dist/upload/FilePicker.css +24 -0
  54. package/dist/upload/FilePicker.d.ts +14 -0
  55. package/dist/upload/FilePicker.d.ts.map +1 -0
  56. package/dist/upload/FilePicker.js +47 -0
  57. package/dist/upload/FilePicker.js.map +1 -0
  58. package/dist/upload/FilePicker.module.js +12 -0
  59. package/dist/upload/FilePicker.module.js.map +1 -0
  60. package/dist/upload/UploadList.css +93 -0
  61. package/dist/upload/UploadList.d.ts +18 -0
  62. package/dist/upload/UploadList.d.ts.map +1 -0
  63. package/dist/upload/UploadList.js +144 -0
  64. package/dist/upload/UploadList.js.map +1 -0
  65. package/dist/upload/UploadList.module.js +32 -0
  66. package/dist/upload/UploadList.module.js.map +1 -0
  67. package/dist/upload/files.d.ts +5 -0
  68. package/dist/upload/files.d.ts.map +1 -0
  69. package/dist/upload/files.js +26 -0
  70. package/dist/upload/files.js.map +1 -0
  71. package/dist/upload/types.d.ts +58 -0
  72. package/dist/upload/types.d.ts.map +1 -0
  73. package/dist/upload/useRejectionMessage.d.ts +4 -0
  74. package/dist/upload/useRejectionMessage.d.ts.map +1 -0
  75. package/dist/upload/useRejectionMessage.js +25 -0
  76. package/dist/upload/useRejectionMessage.js.map +1 -0
  77. package/dist/upload/useUploads.d.ts +30 -0
  78. package/dist/upload/useUploads.d.ts.map +1 -0
  79. package/dist/upload/useUploads.js +115 -0
  80. package/dist/upload/useUploads.js.map +1 -0
  81. package/dist/uppy/index.d.ts +3 -0
  82. package/dist/uppy/index.d.ts.map +1 -0
  83. package/dist/uppy/index.js +1 -0
  84. package/dist/uppy/uploader.d.ts +44 -0
  85. package/dist/uppy/uploader.d.ts.map +1 -0
  86. package/dist/uppy/uploader.js +139 -0
  87. package/dist/uppy/uploader.js.map +1 -0
  88. package/package.json +30 -5
@@ -6,6 +6,8 @@ var FieldsContext = createContext({
6
6
  components: {},
7
7
  locales: [],
8
8
  relationSource: null,
9
+ uploadSource: null,
10
+ checkSource: null,
9
11
  binding: null
10
12
  });
11
13
  /** The fields context of the closest `FieldsProvider`. */
@@ -14,12 +16,12 @@ function useFieldsContext() {
14
16
  }
15
17
  /**
16
18
  * Provides what fields rendered from a definition need: the components of each type, the locales
17
- * of localized values, a relation source and a binding. Values not given come from the parent
19
+ * of localized values, a relation source, an upload source, a check source and a binding. Values not given come from the parent
18
20
  * provider.
19
21
  */
20
22
  function FieldsProvider(t0) {
21
- const $ = c(11);
22
- const { components, locales, relationSource, binding, children } = t0;
23
+ const $ = c(13);
24
+ const { components, locales, relationSource, uploadSource, checkSource, binding, children } = t0;
23
25
  const parent = use(FieldsContext);
24
26
  let t1;
25
27
  if ($[0] !== components || $[1] !== parent.components) {
@@ -33,33 +35,39 @@ function FieldsProvider(t0) {
33
35
  } else t1 = $[2];
34
36
  const t2 = locales ?? parent.locales;
35
37
  const t3 = relationSource === void 0 ? parent.relationSource : relationSource;
36
- const t4 = binding === void 0 ? parent.binding : binding;
37
- let t5;
38
- if ($[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4) {
39
- t5 = {
38
+ const t4 = uploadSource === void 0 ? parent.uploadSource : uploadSource;
39
+ const t5 = checkSource === void 0 ? parent.checkSource : checkSource;
40
+ const t6 = binding === void 0 ? parent.binding : binding;
41
+ let t7;
42
+ if ($[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== t5 || $[8] !== t6) {
43
+ t7 = {
40
44
  components: t1,
41
45
  locales: t2,
42
46
  relationSource: t3,
43
- binding: t4
47
+ uploadSource: t4,
48
+ checkSource: t5,
49
+ binding: t6
44
50
  };
45
51
  $[3] = t1;
46
52
  $[4] = t2;
47
53
  $[5] = t3;
48
54
  $[6] = t4;
49
55
  $[7] = t5;
50
- } else t5 = $[7];
51
- const value = t5;
52
- let t6;
53
- if ($[8] !== children || $[9] !== value) {
54
- t6 = /* @__PURE__ */ jsx(FieldsContext, {
56
+ $[8] = t6;
57
+ $[9] = t7;
58
+ } else t7 = $[9];
59
+ const value = t7;
60
+ let t8;
61
+ if ($[10] !== children || $[11] !== value) {
62
+ t8 = /* @__PURE__ */ jsx(FieldsContext, {
55
63
  value,
56
64
  children
57
65
  });
58
- $[8] = children;
59
- $[9] = value;
60
- $[10] = t6;
61
- } else t6 = $[10];
62
- return t6;
66
+ $[10] = children;
67
+ $[11] = value;
68
+ $[12] = t8;
69
+ } else t8 = $[12];
70
+ return t8;
63
71
  }
64
72
  /** The parent path of a path: `blocks.2` for `blocks.2.title`, `''` for `title`. */
65
73
  function getParentPath(path) {
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":["value","children","_c"],"sources":["../../src/shared/context.tsx"],"sourcesContent":["import { type ComponentType, type ReactNode, createContext, use } from 'react';\n\nimport type { Field } from '@panneau/protocol';\n\nimport type { RelationSource } from './relation';\nimport type { FieldEntry } from './types';\n\n/** What a binding gives a field: its value, handlers and errors at a path. */\nexport interface BoundFieldProps {\n value: unknown;\n onChange: (value: unknown) => void;\n onBlur?: () => void;\n errors?: readonly string[];\n}\n\n/** Props of a binding: it decides whether a field shows, and where its value comes from. */\nexport interface FieldBindingProps {\n field: Field;\n /** Dot path of the field's value. */\n path: string;\n /** Dot path of the object the field belongs to: `''` at the top, `blocks.2` in a block. */\n parentPath: string;\n /** Renders the field with its bound value. */\n render: (bound: BoundFieldProps) => ReactNode;\n}\n\n/**\n * Binds nested fields (in groups, blocks and localized values) to a store by path, instead of the\n * value and `onChange` of their parent. `@panneau/forms` binds them to its form state, so that\n * every value is set, validated and shown in error by its own path.\n */\nexport type FieldBinding = ComponentType<FieldBindingProps>;\n\nexport interface FieldsContextValue {\n /** Registry entries, by field type, over the built-in ones. */\n components: Readonly<Record<string, FieldEntry>>;\n /** Locales of localized values, in order. */\n locales: readonly string[];\n /** Where relation fields search for items. */\n relationSource: RelationSource | null;\n binding: FieldBinding | null;\n}\n\nconst FieldsContext = createContext<FieldsContextValue>({\n components: {},\n locales: [],\n relationSource: null,\n binding: null,\n});\n\n/** The fields context of the closest `FieldsProvider`. */\nexport function useFieldsContext(): FieldsContextValue {\n return use(FieldsContext);\n}\n\nexport interface FieldsProviderProps {\n /** Registry entries by type, added over those of a parent provider. */\n components?: Readonly<Record<string, FieldEntry>>;\n locales?: readonly string[];\n relationSource?: RelationSource | null;\n binding?: FieldBinding | null;\n children?: ReactNode;\n}\n\n/**\n * Provides what fields rendered from a definition need: the components of each type, the locales\n * of localized values, a relation source and a binding. Values not given come from the parent\n * provider.\n */\nexport function FieldsProvider({\n components,\n locales,\n relationSource,\n binding,\n children,\n}: FieldsProviderProps) {\n const parent = use(FieldsContext);\n const value: FieldsContextValue = {\n components:\n components !== undefined ? { ...parent.components, ...components } : parent.components,\n locales: locales ?? parent.locales,\n relationSource: relationSource === undefined ? parent.relationSource : relationSource,\n binding: binding === undefined ? parent.binding : binding,\n };\n return <FieldsContext value={value}>{children}</FieldsContext>;\n}\n\n/** The parent path of a path: `blocks.2` for `blocks.2.title`, `''` for `title`. */\nexport function getParentPath(path: string): string {\n const index = path.lastIndexOf('.');\n return index === -1 ? '' : path.slice(0, index);\n}\n"],"mappings":";;;;AA2CA,IAAM,gBAAgB,cAAkC;CACpD,YAAY,CAAC;CACb,SAAS,CAAA;CACT,gBAAgB;CAChB,SAAS;AACb,CAAC;;AAGD,SAAgB,mBAAuC;CACnD,OAAO,IAAI,aAAa;AAC5B;;;;;;AAgBA,SAAO,eAAA,IAAA;CAAA,MAAA,IAAAE,EAAA,EAAA;CAAwB,MAAA,EAAA,YAAA,SAAA,gBAAA,SAAA,aAAA;CAO3B,MAAA,SAAe,IAAI,aAAa;CAAE,IAAA;CAAA,IAAA,EAAA,OAAA,cAAA,EAAA,OAAA,OAAA,YAAA;EAG1B,KAAA,eAAe,KAAA,IAAf;GAAA,GAAgC,OAAM;GAAW,GAAK;EAA+B,IAAhB,OAAM;EAAW,EAAA,KAAA;EAAA,EAAA,KAAA,OAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CACjF,MAAA,KAAA,WAAW,OAAM;CACV,MAAA,KAAA,mBAAmB,KAAA,IAAY,OAAM,iBAArC;CACP,MAAA,KAAA,YAAY,KAAA,IAAY,OAAM,UAA9B;CAAgD,IAAA;CAAA,IAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAAA,EAAA,OAAA,IAAA;EAL3B,KAAA;GAAA,YAE1B;GAAsF,SACjF;GAAyB,gBAClB;GAAqE,SAC5E;EACb;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAND,MAAA,QAAkC;CAMhC,IAAA;CAAA,IAAA,EAAA,OAAA,YAAA,EAAA,OAAA,OAAA;EACK,KAAA,oBAAC,eAAD;GAAsB;GAAQ;EAAhB,CAAA;EAAyC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAvD;AAAuD;;AAIlE,SAAgB,cAAc,MAAsB;CAChD,MAAM,QAAQ,KAAK,YAAY,GAAG;CAClC,OAAO,UAAU,KAAK,KAAK,KAAK,MAAM,GAAG,KAAK;AAClD"}
1
+ {"version":3,"file":"context.js","names":["value","children","_c"],"sources":["../../src/shared/context.tsx"],"sourcesContent":["import { type ComponentType, type ReactNode, createContext, use } from 'react';\n\nimport type { Field } from '@panneau/protocol';\n\nimport type { UploadSource } from '../upload/types';\nimport type { FieldCheckSource } from './check';\nimport type { RelationSource } from './relation';\nimport type { FieldEntry } from './types';\n\n/** What a binding gives a field: its value, handlers and errors at a path. */\nexport interface BoundFieldProps {\n value: unknown;\n onChange: (value: unknown) => void;\n onBlur?: () => void;\n errors?: readonly string[];\n}\n\n/** Props of a binding: it decides whether a field shows, and where its value comes from. */\nexport interface FieldBindingProps {\n field: Field;\n /** Dot path of the field's value. */\n path: string;\n /** Dot path of the object the field belongs to: `''` at the top, `blocks.2` in a block. */\n parentPath: string;\n /** Renders the field with its bound value. */\n render: (bound: BoundFieldProps) => ReactNode;\n}\n\n/**\n * Binds nested fields (in groups, blocks and localized values) to a store by path, instead of the\n * value and `onChange` of their parent. `@panneau/forms` binds them to its form state, so that\n * every value is set, validated and shown in error by its own path.\n */\nexport type FieldBinding = ComponentType<FieldBindingProps>;\n\nexport interface FieldsContextValue {\n /** Registry entries, by field type, over the built-in ones. */\n components: Readonly<Record<string, FieldEntry>>;\n /** Locales of localized values, in order. */\n locales: readonly string[];\n /** Where relation fields search for items. */\n relationSource: RelationSource | null;\n /**\n * Where fields that take files upload them directly to storage. Without one, they give the\n * files themselves.\n */\n uploadSource: UploadSource | null;\n /** Where fields with `check` check their value, such as a slug's availability. */\n checkSource: FieldCheckSource | null;\n binding: FieldBinding | null;\n}\n\nconst FieldsContext = createContext<FieldsContextValue>({\n components: {},\n locales: [],\n relationSource: null,\n uploadSource: null,\n checkSource: null,\n binding: null,\n});\n\n/** The fields context of the closest `FieldsProvider`. */\nexport function useFieldsContext(): FieldsContextValue {\n return use(FieldsContext);\n}\n\nexport interface FieldsProviderProps {\n /** Registry entries by type, added over those of a parent provider. */\n components?: Readonly<Record<string, FieldEntry>>;\n locales?: readonly string[];\n relationSource?: RelationSource | null;\n /** Make it once, outside of render: fields make an uploader for each source they get. */\n uploadSource?: UploadSource | null;\n /** `createFieldCheckSource(adapter, resource, id)`, for the form of an item. */\n checkSource?: FieldCheckSource | null;\n binding?: FieldBinding | null;\n children?: ReactNode;\n}\n\n/**\n * Provides what fields rendered from a definition need: the components of each type, the locales\n * of localized values, a relation source, an upload source, a check source and a binding. Values not given come from the parent\n * provider.\n */\nexport function FieldsProvider({\n components,\n locales,\n relationSource,\n uploadSource,\n checkSource,\n binding,\n children,\n}: FieldsProviderProps) {\n const parent = use(FieldsContext);\n const value: FieldsContextValue = {\n components:\n components !== undefined ? { ...parent.components, ...components } : parent.components,\n locales: locales ?? parent.locales,\n relationSource: relationSource === undefined ? parent.relationSource : relationSource,\n uploadSource: uploadSource === undefined ? parent.uploadSource : uploadSource,\n checkSource: checkSource === undefined ? parent.checkSource : checkSource,\n binding: binding === undefined ? parent.binding : binding,\n };\n return <FieldsContext value={value}>{children}</FieldsContext>;\n}\n\n/** The parent path of a path: `blocks.2` for `blocks.2.title`, `''` for `title`. */\nexport function getParentPath(path: string): string {\n const index = path.lastIndexOf('.');\n return index === -1 ? '' : path.slice(0, index);\n}\n"],"mappings":";;;;AAoDA,IAAM,gBAAgB,cAAkC;CACpD,YAAY,CAAC;CACb,SAAS,CAAA;CACT,gBAAgB;CAChB,cAAc;CACd,aAAa;CACb,SAAS;AACb,CAAC;;AAGD,SAAgB,mBAAuC;CACnD,OAAO,IAAI,aAAa;AAC5B;;;;;;AAoBA,SAAO,eAAA,IAAA;CAAA,MAAA,IAAAE,EAAA,EAAA;CAAwB,MAAA,EAAA,YAAA,SAAA,gBAAA,cAAA,aAAA,SAAA,aAAA;CAS3B,MAAA,SAAe,IAAI,aAAa;CAAE,IAAA;CAAA,IAAA,EAAA,OAAA,cAAA,EAAA,OAAA,OAAA,YAAA;EAG1B,KAAA,eAAe,KAAA,IAAf;GAAA,GAAgC,OAAM;GAAW,GAAK;EAA+B,IAAhB,OAAM;EAAW,EAAA,KAAA;EAAA,EAAA,KAAA,OAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CACjF,MAAA,KAAA,WAAW,OAAM;CACV,MAAA,KAAA,mBAAmB,KAAA,IAAY,OAAM,iBAArC;CACF,MAAA,KAAA,iBAAiB,KAAA,IAAY,OAAM,eAAnC;CACD,MAAA,KAAA,gBAAgB,KAAA,IAAY,OAAM,cAAlC;CACJ,MAAA,KAAA,YAAY,KAAA,IAAY,OAAM,UAA9B;CAAgD,IAAA;CAAA,IAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAAA,EAAA,OAAA,MAAA,EAAA,OAAA,IAAA;EAP3B,KAAA;GAAA,YAE1B;GAAsF,SACjF;GAAyB,gBAClB;GAAqE,cACvE;GAA+D,aAChE;GAA4D,SAChE;EACb;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CARD,MAAA,QAAkC;CAQhC,IAAA;CAAA,IAAA,EAAA,QAAA,YAAA,EAAA,QAAA,OAAA;EACK,KAAA,oBAAC,eAAD;GAAsB;GAAQ;EAAhB,CAAA;EAAyC,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAvD;AAAuD;;AAIlE,SAAgB,cAAc,MAAsB;CAChD,MAAM,QAAQ,KAAK,YAAY,GAAG;CAClC,OAAO,UAAU,KAAK,KAAK,KAAK,MAAM,GAAG,KAAK;AAClD"}
@@ -20,4 +20,8 @@ export declare function getFieldProps(props: FieldEntryProps): Omit<FieldProps<n
20
20
  };
21
21
  /** The value as a string, or `null`. */
22
22
  export declare function asString(value: unknown): string | null;
23
+ /** The accepted MIME types of a field that takes files: its `accept`, or its `accept` rule. */
24
+ export declare function getAccept(field: Field): string[] | null;
25
+ /** The largest file of a field, in bytes: its `maxSize` rule. */
26
+ export declare function getMaxSize(field: Field): number | null;
23
27
  //# sourceMappingURL=entry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/shared/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D,kDAAkD;AAClD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAE3E;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAKnF;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEhD;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,iBAG9F;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAmC,CAAC;AACvF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MACE,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,eAAe,GACvB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAe1E;AAED,wCAAwC;AACxC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEtD"}
1
+ {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/shared/entry.ts"],"names":[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AG,MAAM,GAAG,IAAI,CAGtD"}
@@ -39,7 +39,18 @@ function getFieldProps(props) {
39
39
  ...props.className !== void 0 ? { className: props.className } : {}
40
40
  };
41
41
  }
42
+ /** The accepted MIME types of a field that takes files: its `accept`, or its `accept` rule. */
43
+ function getAccept(field) {
44
+ if (field.accept !== void 0 && field.accept.length > 0) return field.accept;
45
+ const rule = findRule(field, "accept");
46
+ return rule !== void 0 && "value" in rule && Array.isArray(rule.value) ? rule.value.filter(isString) : null;
47
+ }
48
+ /** The largest file of a field, in bytes: its `maxSize` rule. */
49
+ function getMaxSize(field) {
50
+ const rule = findRule(field, "maxSize");
51
+ return rule !== void 0 && "value" in rule && isNumber(rule.value) ? rule.value : null;
52
+ }
42
53
  //#endregion
43
- export { findRule, getFieldProps, getRuleNumber, getSetting, isNumber, isRequired, isString };
54
+ export { findRule, getAccept, getFieldProps, getMaxSize, getRuleNumber, getSetting, isNumber, isRequired, isString };
44
55
 
45
56
  //# sourceMappingURL=entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry.js","names":[],"sources":["../../src/shared/entry.ts"],"sourcesContent":["import type { Field, Rule } from '@panneau/protocol';\n\nimport type { FieldEntryProps, FieldProps } from './types';\n\n/** The rule of a field with this name, if any. */\nexport function findRule(field: Field, rule: Rule['rule']): Rule | undefined {\n return field.rules?.find((candidate) => candidate.rule === rule);\n}\n\n/** The number of a `min` or `max` rule of a field, if any. */\nexport function getRuleNumber(field: Field, rule: 'min' | 'max'): number | undefined {\n const found = findRule(field, rule);\n return found !== undefined && 'value' in found && typeof found.value === 'number'\n ? found.value\n : undefined;\n}\n\n/** Whether a field has the `required` rule. */\nexport function isRequired(field: Field): boolean {\n return findRule(field, 'required') !== undefined;\n}\n\n/** A setting of a field (`settings.<name>`), when it has the expected type. */\nexport function getSetting<T>(field: Field, name: string, guard: (value: unknown) => value is T) {\n const value = field.settings?.[name];\n return guard(value) ? value : undefined;\n}\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number =>\n typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * The props that every field takes, from a registry entry's props: label (the field's name\n * without one), help, required mark, read-only, errors and handlers. Plugins use it to write their\n * own entries.\n */\nexport function getFieldProps(\n props: FieldEntryProps,\n): Omit<FieldProps<never>, 'value' | 'onChange'> & { placeholder?: string } {\n const { field } = props;\n return {\n name: props.path,\n // A field always has a label: its name when the definition gives none.\n label: field.label ?? field.name,\n description: field.help,\n ...(field.placeholder !== undefined ? { placeholder: field.placeholder } : {}),\n required: isRequired(field),\n readOnly: props.readOnly === true || field.readOnly === true,\n disabled: props.disabled === true,\n errors: props.errors ?? [],\n ...(props.onBlur !== undefined ? { onBlur: props.onBlur } : {}),\n ...(props.className !== undefined ? { className: props.className } : {}),\n };\n}\n\n/** The value as a string, or `null`. */\nexport function asString(value: unknown): string | null {\n return typeof value === 'string' ? value : null;\n}\n"],"mappings":";;AAKA,SAAgB,SAAS,OAAc,MAAsC;CACzE,OAAO,MAAM,OAAO,MAAM,cAAc,UAAU,SAAS,IAAI;AACnE;;AAGA,SAAgB,cAAc,OAAc,MAAyC;CACjF,MAAM,QAAQ,SAAS,OAAO,IAAI;CAClC,OAAO,UAAU,KAAA,KAAa,WAAW,SAAS,OAAO,MAAM,UAAU,WACnE,MAAM,QACN,KAAA;AACV;;AAGA,SAAgB,WAAW,OAAuB;CAC9C,OAAO,SAAS,OAAO,UAAU,MAAM,KAAA;AAC3C;;AAGA,SAAgB,WAAc,OAAc,MAAc,OAAuC;CAC7F,MAAM,QAAQ,MAAM,WAAW;CAC/B,OAAO,MAAM,KAAK,IAAI,QAAQ,KAAA;AAClC;AAEA,IAAa,YAAY,UAAoC,OAAO,UAAU;AAC9E,IAAa,YAAY,UACrB,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK;;;;;;AAOpD,SAAgB,cACZ,OACwE;CACxE,MAAM,EAAE,UAAU;CAClB,OAAO;EACH,MAAM,MAAM;EAEZ,OAAO,MAAM,SAAS,MAAM;EAC5B,aAAa,MAAM;EACnB,GAAI,MAAM,gBAAgB,KAAA,IAAY,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;EAC5E,UAAU,WAAW,KAAK;EAC1B,UAAU,MAAM,aAAa,QAAQ,MAAM,aAAa;EACxD,UAAU,MAAM,aAAa;EAC7B,QAAQ,MAAM,UAAU,CAAA;EACxB,GAAI,MAAM,WAAW,KAAA,IAAY,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;EAC7D,GAAI,MAAM,cAAc,KAAA,IAAY,EAAE,WAAW,MAAM,UAAU,IAAI,CAAC;CAC1E;AACJ"}
1
+ {"version":3,"file":"entry.js","names":[],"sources":["../../src/shared/entry.ts"],"sourcesContent":["import type { Field, Rule } from '@panneau/protocol';\n\nimport type { FieldEntryProps, FieldProps } from './types';\n\n/** The rule of a field with this name, if any. */\nexport function findRule(field: Field, rule: Rule['rule']): Rule | undefined {\n return field.rules?.find((candidate) => candidate.rule === rule);\n}\n\n/** The number of a `min` or `max` rule of a field, if any. */\nexport function getRuleNumber(field: Field, rule: 'min' | 'max'): number | undefined {\n const found = findRule(field, rule);\n return found !== undefined && 'value' in found && typeof found.value === 'number'\n ? found.value\n : undefined;\n}\n\n/** Whether a field has the `required` rule. */\nexport function isRequired(field: Field): boolean {\n return findRule(field, 'required') !== undefined;\n}\n\n/** A setting of a field (`settings.<name>`), when it has the expected type. */\nexport function getSetting<T>(field: Field, name: string, guard: (value: unknown) => value is T) {\n const value = field.settings?.[name];\n return guard(value) ? value : undefined;\n}\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number =>\n typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * The props that every field takes, from a registry entry's props: label (the field's name\n * without one), help, required mark, read-only, errors and handlers. Plugins use it to write their\n * own entries.\n */\nexport function getFieldProps(\n props: FieldEntryProps,\n): Omit<FieldProps<never>, 'value' | 'onChange'> & { placeholder?: string } {\n const { field } = props;\n return {\n name: props.path,\n // A field always has a label: its name when the definition gives none.\n label: field.label ?? field.name,\n description: field.help,\n ...(field.placeholder !== undefined ? { placeholder: field.placeholder } : {}),\n required: isRequired(field),\n readOnly: props.readOnly === true || field.readOnly === true,\n disabled: props.disabled === true,\n errors: props.errors ?? [],\n ...(props.onBlur !== undefined ? { onBlur: props.onBlur } : {}),\n ...(props.className !== undefined ? { className: props.className } : {}),\n };\n}\n\n/** The value as a string, or `null`. */\nexport function asString(value: unknown): string | null {\n return typeof value === 'string' ? value : null;\n}\n\n/** The accepted MIME types of a field that takes files: its `accept`, or its `accept` rule. */\nexport function getAccept(field: Field): string[] | null {\n if (field.accept !== undefined && field.accept.length > 0) {\n return field.accept;\n }\n const rule = findRule(field, 'accept');\n return rule !== undefined && 'value' in rule && Array.isArray(rule.value)\n ? rule.value.filter(isString)\n : null;\n}\n\n/** The largest file of a field, in bytes: its `maxSize` rule. */\nexport function getMaxSize(field: Field): number | null {\n const rule = findRule(field, 'maxSize');\n return rule !== undefined && 'value' in rule && isNumber(rule.value) ? rule.value : null;\n}\n"],"mappings":";;AAKA,SAAgB,SAAS,OAAc,MAAsC;CACzE,OAAO,MAAM,OAAO,MAAM,cAAc,UAAU,SAAS,IAAI;AACnE;;AAGA,SAAgB,cAAc,OAAc,MAAyC;CACjF,MAAM,QAAQ,SAAS,OAAO,IAAI;CAClC,OAAO,UAAU,KAAA,KAAa,WAAW,SAAS,OAAO,MAAM,UAAU,WACnE,MAAM,QACN,KAAA;AACV;;AAGA,SAAgB,WAAW,OAAuB;CAC9C,OAAO,SAAS,OAAO,UAAU,MAAM,KAAA;AAC3C;;AAGA,SAAgB,WAAc,OAAc,MAAc,OAAuC;CAC7F,MAAM,QAAQ,MAAM,WAAW;CAC/B,OAAO,MAAM,KAAK,IAAI,QAAQ,KAAA;AAClC;AAEA,IAAa,YAAY,UAAoC,OAAO,UAAU;AAC9E,IAAa,YAAY,UACrB,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK;;;;;;AAOpD,SAAgB,cACZ,OACwE;CACxE,MAAM,EAAE,UAAU;CAClB,OAAO;EACH,MAAM,MAAM;EAEZ,OAAO,MAAM,SAAS,MAAM;EAC5B,aAAa,MAAM;EACnB,GAAI,MAAM,gBAAgB,KAAA,IAAY,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;EAC5E,UAAU,WAAW,KAAK;EAC1B,UAAU,MAAM,aAAa,QAAQ,MAAM,aAAa;EACxD,UAAU,MAAM,aAAa;EAC7B,QAAQ,MAAM,UAAU,CAAA;EACxB,GAAI,MAAM,WAAW,KAAA,IAAY,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;EAC7D,GAAI,MAAM,cAAc,KAAA,IAAY,EAAE,WAAW,MAAM,UAAU,IAAI,CAAC;CAC1E;AACJ;;AAQA,SAAgB,UAAU,OAA+B;CACrD,IAAI,MAAM,WAAW,KAAA,KAAa,MAAM,OAAO,SAAS,GACpD,OAAO,MAAM;CAEjB,MAAM,OAAO,SAAS,OAAO,QAAQ;CACrC,OAAO,SAAS,KAAA,KAAa,WAAW,QAAQ,MAAM,QAAQ,KAAK,KAAK,IAClE,KAAK,MAAM,OAAO,QAAQ,IAC1B;AACV;;AAGA,SAAgB,WAAW,OAA6B;CACpD,MAAM,OAAO,SAAS,OAAO,SAAS;CACtC,OAAO,SAAS,KAAA,KAAa,WAAW,QAAQ,SAAS,KAAK,KAAK,IAAI,KAAK,QAAQ;AACxF"}
@@ -43,6 +43,8 @@ export interface FieldEntryProps {
43
43
  readOnly?: boolean;
44
44
  /** The object the field belongs to: the form's values, or a group or a block. */
45
45
  parentValue?: unknown;
46
+ /** The locale of the value: the input of a locale of a localized field. */
47
+ locale?: string;
46
48
  className?: string;
47
49
  }
48
50
  /** A registry entry: renders the field of a type from its definition. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAA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AC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wFAAwF;AACxF,MAAM,WAAW,eAAe;IAC5B,iDAAiD;IACjD,KAAK,EAAE,KAAK,CAAC;IACb,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ .panneau-slug-field-description {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--panneau-space-1);
5
+ }
6
+
7
+ .panneau-slug-field-url {
8
+ overflow-wrap: anywhere;
9
+ color: var(--panneau-color-link);
10
+ }
11
+
12
+ .panneau-slug-field-taken {
13
+ display: flex;
14
+ flex-wrap: wrap;
15
+ align-items: center;
16
+ gap: var(--panneau-space-2);
17
+ color: var(--panneau-color-warning);
18
+ }
@@ -1,3 +1,4 @@
1
+ import type { FieldCheckResponse } from '@panneau/protocol';
1
2
  import type { FieldEntryProps } from '../shared/types';
2
3
  import { type TextFieldProps } from '../text/TextField';
3
4
  /**
@@ -5,6 +6,10 @@ import { type TextFieldProps } from '../text/TextField';
5
6
  * accents (`Été à Montréal` gives `ete-a-montreal`).
6
7
  */
7
8
  export declare function slugify(text: string): string;
9
+ /** Checks a slug with the backend: whether it is available, and its URL. */
10
+ export type SlugCheck = (value: string, options: {
11
+ signal: AbortSignal;
12
+ }) => Promise<FieldCheckResponse>;
8
13
  export interface SlugFieldProps extends Omit<TextFieldProps, 'type' | 'suffix'> {
9
14
  /**
10
15
  * The text the slug is made from (a title). While the slug is empty or still matches it, the
@@ -13,12 +18,35 @@ export interface SlugFieldProps extends Omit<TextFieldProps, 'type' | 'suffix'>
13
18
  source?: string | null;
14
19
  /** Name of the source, for the button that generates the slug from it. */
15
20
  sourceLabel?: string;
21
+ /**
22
+ * Checks the slug as it is typed, and once when the field shows: the field then shows the
23
+ * URL the backend gives, and says when the slug is taken, with a free one to use instead.
24
+ */
25
+ onCheck?: SlugCheck | null;
26
+ /** How long typing must pause before a check, in milliseconds. Defaults to 300. */
27
+ checkDelay?: number;
28
+ /**
29
+ * What the check depends on besides the slug, such as the form's values: the slug is checked
30
+ * again when it changes. `onCheck` itself can change on every render.
31
+ */
32
+ checkKey?: string;
16
33
  }
17
34
  /**
18
35
  * A slug for URLs. Typed text is cleaned up on blur. With a `source`, the slug follows it until
19
- * it is edited, and a button generates it again.
36
+ * it is edited, and a button generates it again. With `onCheck`, the backend says whether the
37
+ * slug is taken, and gives its URL.
38
+ */
39
+ export declare function SlugField({ value, onChange, onBlur, source, sourceLabel, onCheck, checkDelay, checkKey, disabled, readOnly, prefix, errors, description, ...props }: SlugFieldProps): import("react").JSX.Element;
40
+ /**
41
+ * The text of a source value: the value itself, or for a localized value, its value in `locale`.
42
+ * Without a locale, the first locale that has a value.
43
+ */
44
+ export declare function sourceText(value: unknown, locale?: string): string | null;
45
+ /**
46
+ * The `slug` type: `from` names the field it follows, in the slug's own locale, or in the default
47
+ * locale (the first of the fields context) for a slug that isn't localized. Setting `prefix`
48
+ * shows a URL prefix. With `check`, the fields context's check source checks the slug of a field
49
+ * at the top of the resource, with the form's values.
20
50
  */
21
- export declare function SlugField({ value, onChange, onBlur, source, sourceLabel, disabled, readOnly, ...props }: SlugFieldProps): import("react").JSX.Element;
22
- /** The `slug` type: `from` names the field it follows, and setting `prefix` shows a URL prefix. */
23
51
  export declare function SlugFieldEntry(props: FieldEntryProps): import("react").JSX.Element;
24
52
  //# sourceMappingURL=SlugField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SlugField.d.ts","sourceRoot":"","sources":["../../src/slug/SlugField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3E;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,cAAc,+BAqDhB;AAcD,mGAAmG;AACnG,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,+BAgBpD"}
1
+ {"version":3,"file":"SlugField.d.ts","sourceRoot":"","sources":["../../src/slug/SlugField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAM5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnE;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C;AAED,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,CACpB,KAAK,EAAE,MAAM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