@panneau/protocol 5.0.0-alpha.4 → 5.0.0-alpha.41

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 (159) hide show
  1. package/dist/addresses.d.ts +23 -0
  2. package/dist/addresses.d.ts.map +1 -0
  3. package/dist/addresses.js +52 -0
  4. package/dist/addresses.js.map +1 -0
  5. package/dist/aggregates.d.ts +135 -0
  6. package/dist/aggregates.d.ts.map +1 -0
  7. package/dist/aggregates.js +236 -0
  8. package/dist/aggregates.js.map +1 -0
  9. package/dist/compound.d.ts +20 -0
  10. package/dist/compound.d.ts.map +1 -0
  11. package/dist/compound.js +27 -0
  12. package/dist/compound.js.map +1 -0
  13. package/dist/conditions.d.ts +1 -1
  14. package/dist/conformance/index.d.ts +6 -0
  15. package/dist/conformance/index.d.ts.map +1 -1
  16. package/dist/conformance/index.js +970 -11
  17. package/dist/conformance/index.js.map +1 -1
  18. package/dist/constants.d.ts +108 -2
  19. package/dist/constants.d.ts.map +1 -1
  20. package/dist/constants.js +181 -3
  21. package/dist/constants.js.map +1 -1
  22. package/dist/context.d.ts +15 -0
  23. package/dist/context.d.ts.map +1 -0
  24. package/dist/context.js +34 -0
  25. package/dist/context.js.map +1 -0
  26. package/dist/currencies.d.ts +22 -0
  27. package/dist/currencies.d.ts.map +1 -0
  28. package/dist/currencies.js +231 -0
  29. package/dist/currencies.js.map +1 -0
  30. package/dist/dashboards.d.ts +95 -0
  31. package/dist/dashboards.d.ts.map +1 -0
  32. package/dist/dashboards.js +140 -0
  33. package/dist/dashboards.js.map +1 -0
  34. package/dist/index.d.ts +4 -4
  35. package/dist/index.js +22 -8
  36. package/dist/libraries.d.ts +33 -0
  37. package/dist/libraries.d.ts.map +1 -0
  38. package/dist/libraries.js +59 -0
  39. package/dist/libraries.js.map +1 -0
  40. package/dist/links.d.ts +38 -0
  41. package/dist/links.d.ts.map +1 -0
  42. package/dist/links.js +65 -0
  43. package/dist/links.js.map +1 -0
  44. package/dist/lint.d.ts +4 -4
  45. package/dist/lint.d.ts.map +1 -1
  46. package/dist/lint.js +540 -15
  47. package/dist/lint.js.map +1 -1
  48. package/dist/mock/auth.d.ts +71 -0
  49. package/dist/mock/auth.d.ts.map +1 -0
  50. package/dist/mock/auth.js +346 -0
  51. package/dist/mock/auth.js.map +1 -0
  52. package/dist/mock/example.d.ts +1 -1
  53. package/dist/mock/example.d.ts.map +1 -1
  54. package/dist/mock/example.js +49 -28
  55. package/dist/mock/example.js.map +1 -1
  56. package/dist/mock/index.d.ts +96 -5
  57. package/dist/mock/index.d.ts.map +1 -1
  58. package/dist/mock/index.js +505 -44
  59. package/dist/mock/index.js.map +1 -1
  60. package/dist/openapi.d.ts.map +1 -1
  61. package/dist/openapi.js +462 -50
  62. package/dist/openapi.js.map +1 -1
  63. package/dist/periods.d.ts +61 -0
  64. package/dist/periods.d.ts.map +1 -0
  65. package/dist/periods.js +130 -0
  66. package/dist/periods.js.map +1 -0
  67. package/dist/problem.d.ts +1 -1
  68. package/dist/query.d.ts +18 -0
  69. package/dist/query.d.ts.map +1 -1
  70. package/dist/query.js +34 -8
  71. package/dist/query.js.map +1 -1
  72. package/dist/resourceTypes.d.ts +39 -0
  73. package/dist/resourceTypes.d.ts.map +1 -0
  74. package/dist/resourceTypes.js +34 -0
  75. package/dist/resourceTypes.js.map +1 -0
  76. package/dist/rules.d.ts +18 -5
  77. package/dist/rules.d.ts.map +1 -1
  78. package/dist/rules.js +233 -15
  79. package/dist/rules.js.map +1 -1
  80. package/dist/runtime/index.d.ts +23 -10
  81. package/dist/runtime/index.d.ts.map +1 -1
  82. package/dist/runtime/index.js +16 -3
  83. package/dist/schemas/action.d.ts +119 -10
  84. package/dist/schemas/action.d.ts.map +1 -1
  85. package/dist/schemas/action.js +20 -3
  86. package/dist/schemas/action.js.map +1 -1
  87. package/dist/schemas/api.d.ts +266 -5
  88. package/dist/schemas/api.d.ts.map +1 -1
  89. package/dist/schemas/api.js +134 -16
  90. package/dist/schemas/api.js.map +1 -1
  91. package/dist/schemas/boot.d.ts +25 -1
  92. package/dist/schemas/boot.d.ts.map +1 -1
  93. package/dist/schemas/boot.js +2 -1
  94. package/dist/schemas/boot.js.map +1 -1
  95. package/dist/schemas/common.d.ts +1 -0
  96. package/dist/schemas/common.d.ts.map +1 -1
  97. package/dist/schemas/common.js +2 -1
  98. package/dist/schemas/common.js.map +1 -1
  99. package/dist/schemas/definition.d.ts +1414 -30
  100. package/dist/schemas/definition.d.ts.map +1 -1
  101. package/dist/schemas/definition.js +77 -17
  102. package/dist/schemas/definition.js.map +1 -1
  103. package/dist/schemas/field.d.ts +358 -2
  104. package/dist/schemas/field.d.ts.map +1 -1
  105. package/dist/schemas/field.js +161 -20
  106. package/dist/schemas/field.js.map +1 -1
  107. package/dist/schemas/index.d.ts +5820 -46
  108. package/dist/schemas/index.d.ts.map +1 -1
  109. package/dist/schemas/index.js +69 -7
  110. package/dist/schemas/index.js.map +1 -1
  111. package/dist/schemas/jsonRules.d.ts +83 -0
  112. package/dist/schemas/jsonRules.d.ts.map +1 -0
  113. package/dist/schemas/jsonRules.js +46 -0
  114. package/dist/schemas/jsonRules.js.map +1 -0
  115. package/dist/schemas/layout.d.ts +2 -1
  116. package/dist/schemas/layout.d.ts.map +1 -1
  117. package/dist/schemas/layout.js +2 -1
  118. package/dist/schemas/layout.js.map +1 -1
  119. package/dist/schemas/list.d.ts +34 -2
  120. package/dist/schemas/list.d.ts.map +1 -1
  121. package/dist/schemas/list.js +21 -6
  122. package/dist/schemas/list.js.map +1 -1
  123. package/dist/schemas/resource.d.ts +826 -17
  124. package/dist/schemas/resource.d.ts.map +1 -1
  125. package/dist/schemas/resource.js +26 -4
  126. package/dist/schemas/resource.js.map +1 -1
  127. package/dist/schemas/theme.d.ts +6 -2
  128. package/dist/schemas/theme.d.ts.map +1 -1
  129. package/dist/schemas/theme.js +1 -0
  130. package/dist/schemas/theme.js.map +1 -1
  131. package/dist/schemas/widget.d.ts +4379 -0
  132. package/dist/schemas/widget.d.ts.map +1 -0
  133. package/dist/schemas/widget.js +269 -0
  134. package/dist/schemas/widget.js.map +1 -0
  135. package/dist/search.d.ts +51 -0
  136. package/dist/search.d.ts.map +1 -0
  137. package/dist/search.js +53 -0
  138. package/dist/search.js.map +1 -0
  139. package/dist/themes.d.ts +1 -1
  140. package/dist/transforms.d.ts +17 -0
  141. package/dist/transforms.d.ts.map +1 -0
  142. package/dist/transforms.js +34 -0
  143. package/dist/transforms.js.map +1 -0
  144. package/dist/validate.d.ts +5 -3
  145. package/dist/validate.d.ts.map +1 -1
  146. package/dist/validate.js +36 -2
  147. package/dist/validate.js.map +1 -1
  148. package/dist/values.d.ts +5 -1
  149. package/dist/values.d.ts.map +1 -1
  150. package/dist/values.js +16 -2
  151. package/dist/values.js.map +1 -1
  152. package/dist/widgets.d.ts +232 -0
  153. package/dist/widgets.d.ts.map +1 -0
  154. package/dist/widgets.js +630 -0
  155. package/dist/widgets.js.map +1 -0
  156. package/package.json +6 -3
  157. package/schema/boot.schema.json +1461 -104
  158. package/schema/definition.schema.json +1459 -105
  159. package/schema/openapi.json +7176 -2000
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/schemas/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,gBAAgB;;;;;;;;;;;iBAmB3B,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACxD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,sEAAsE;AACtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { Abilities } from "./common.js";
2
- import { BlockType, Field } from "./field.js";
2
+ import { Field } from "./field.js";
3
3
  import { LayoutNode } from "./layout.js";
4
4
  import { Action } from "./action.js";
5
5
  import { ListDefinition } from "./list.js";
6
+ import { OverviewPeriod, Widget } from "./widget.js";
6
7
  import { z } from "zod";
7
8
  //#region src/schemas/resource.ts
8
9
  var ResourceFeatures = z.looseObject({
@@ -12,8 +13,24 @@ var ResourceFeatures = z.looseObject({
12
13
  mode: z.enum(["component", "iframe"]),
13
14
  component: z.string().optional().meta({ description: "`component`: the plugin preview." })
14
15
  })]).optional(),
15
- search: z.boolean().optional().meta({ description: "Whether the resource is in the global search." })
16
+ search: z.boolean().optional().meta({ description: "Whether the resource is in the global search. Defaults to whether its list has a search (`list.search`)." })
16
17
  });
18
+ var ResourceType = z.looseObject({
19
+ id: z.string().min(1).meta({ description: "The `type` of the items of this type, which the client sends on create." }),
20
+ label: z.string().meta({ description: "The name of the type: the title of its create form and of its choice when creating." }),
21
+ description: z.string().optional().meta({ description: "A line under the label, in the choice of a type." }),
22
+ icon: z.string().optional(),
23
+ get fields() {
24
+ return z.array(Field).meta({ description: "The type's own fields, after those of the resource. The resource's `form.layout` can name them: forms of the other types leave them out." });
25
+ },
26
+ abilities: Abilities.optional().meta({ description: "`create: false`: the type is not offered when creating, and the backend refuses to create one (a singleton such as the home page). Its items can still be edited." })
27
+ }).meta({ description: "A type of the items of a resource (decision 0077): the items of a type have the fields of the resource and its own." });
28
+ var SummaryPeriod = OverviewPeriod.extend({ filter: z.string().min(1).optional().meta({ description: "The id of the list's `date-range` filter that the period sets. Defaults to the first `date-range` filter of the list." }) }).meta({ description: "The period of a summary (decision 0084): the list's own `date-range` filter, so choosing it filters the rows too." });
29
+ var ResourceSummary = z.looseObject({
30
+ widgets: z.array(Widget).meta({ description: "The widgets of the summary for the user, in order, drawn above the list in the grid of a dashboard. Widgets on this resource get the list's current filters and search, unless `settings.followsList` is `false`. Widgets with data of their own are fed by `GET /dashboard/widgets/{widget}?resource={resource}`, with the filters and the search of the list." }),
31
+ list: z.enum(["collapsed"]).optional().meta({ description: "`collapsed`: the resource opens on its summary, with its list folded under it behind \"Show the N items\". Without it, the list is shown under the summary." }),
32
+ period: SummaryPeriod.optional()
33
+ }).meta({ description: "Widgets above the list of a resource, which follow its filters and its search (decision 0084)." });
17
34
  var Resource = z.looseObject({
18
35
  id: z.string().min(1),
19
36
  kind: z.string().min(1).optional().meta({ description: "What the resource is. `media`: a library of media (decision 0026), with a `file` field and a `media` on each item. Without it, an ordinary resource. Clients treat a kind they don't know as an ordinary resource." }),
@@ -24,16 +41,21 @@ var Resource = z.looseObject({
24
41
  description: z.string().optional(),
25
42
  icon: z.string().optional(),
26
43
  itemTitle: z.string().optional().meta({ description: "The field used as the title of an item, in lists and pickers." }),
44
+ itemSubtitle: z.string().optional().meta({ description: "The field shown under the title of an item, in search results, cards and pickers." }),
45
+ itemImage: z.string().optional().meta({ description: "The field that holds the image of an item (a media, a file or a URL), in search results, pickers, the gallery and the thumbnails of the table. Defaults to the item's `media` in a resource of kind `media` (decision 0061)." }),
46
+ open: z.union([z.enum(["panel", "edit"]), z.string().min(1)]).optional().meta({ description: "Where an item's title goes, in its list and wherever the app links to the item (decision 0082). `edit`, the default: its edit form, and the show route redirects there. An item the user can't update still opens in the panel. `panel`: the show route, with the item's details in a panel next to the list, for items read more than edited, or shown with their preview. Clients treat a value they don't know as `edit`." }),
47
+ itemActions: z.array(z.string().min(1)).optional().meta({ description: "The built-in item actions the resource shows, in their order (decision 0040): some of `show`, `edit`, `duplicate` and `delete`. Defaults to all four. Each one is shown on the items whose abilities allow it (`view`, `update`, `duplicate`, `delete`). `[]` shows none. Clients ignore ids they don't know." }),
27
48
  fields: z.array(Field),
28
49
  form: z.looseObject({ layout: z.array(LayoutNode).optional() }).optional(),
29
50
  list: ListDefinition.optional(),
30
51
  actions: z.array(Action).optional(),
31
52
  abilities: Abilities.optional(),
32
53
  features: ResourceFeatures.optional(),
33
- types: z.array(BlockType).optional().meta({ description: "Variants of the resource, each with its own extra fields." }),
54
+ types: z.array(ResourceType).optional().meta({ description: "The types of the resource's items, each with fields of its own (decision 0077). Each item has a `type`, set when it is created, among their ids." }),
55
+ summary: ResourceSummary.optional().meta({ description: "Widgets above the list, which follow its filters and its search (decision 0084)." }),
34
56
  settings: z.record(z.string(), z.unknown()).optional()
35
57
  }).meta({ description: "A set of items managed in the admin." });
36
58
  //#endregion
37
- export { Resource, ResourceFeatures };
59
+ export { Resource, ResourceFeatures, ResourceSummary, ResourceType, SummaryPeriod };
38
60
 
39
61
  //# sourceMappingURL=resource.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource.js","names":[],"sources":["../../src/schemas/resource.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action } from './action';\nimport { Abilities } from './common';\nimport { BlockType, Field } from './field';\nimport { LayoutNode } from './layout';\nimport { ListDefinition } from './list';\n\nexport const ResourceFeatures = z.looseObject({\n drafts: z.boolean().optional(),\n revisions: z.boolean().optional(),\n preview: z\n .union([\n z.null(),\n z.looseObject({\n mode: z.enum(['component', 'iframe']),\n component: z\n .string()\n .optional()\n .meta({ description: '`component`: the plugin preview.' }),\n }),\n ])\n .optional(),\n search: z\n .boolean()\n .optional()\n .meta({ description: 'Whether the resource is in the global search.' }),\n});\n\nexport const Resource = z\n .looseObject({\n id: z.string().min(1),\n kind: z.string().min(1).optional().meta({\n description:\n \"What the resource is. `media`: a library of media (decision 0026), with a `file` field and a `media` on each item. Without it, an ordinary resource. Clients treat a kind they don't know as an ordinary resource.\",\n }),\n label: z.looseObject({ singular: z.string(), plural: z.string() }),\n description: z.string().optional(),\n icon: z.string().optional(),\n itemTitle: z\n .string()\n .optional()\n .meta({ description: 'The field used as the title of an item, in lists and pickers.' }),\n fields: z.array(Field),\n form: z.looseObject({ layout: z.array(LayoutNode).optional() }).optional(),\n list: ListDefinition.optional(),\n actions: z.array(Action).optional(),\n abilities: Abilities.optional(),\n features: ResourceFeatures.optional(),\n types: z\n .array(BlockType)\n .optional()\n .meta({ description: 'Variants of the resource, each with its own extra fields.' }),\n settings: z.record(z.string(), z.unknown()).optional(),\n })\n .meta({ description: 'A set of items managed in the admin.' });\n\nexport type ResourceFeatures = z.infer<typeof ResourceFeatures>;\nexport type Resource = z.infer<typeof Resource>;\n/** A resource as a backend writes it, before defaults are applied. */\nexport type ResourceInput = z.input<typeof Resource>;\n"],"mappings":";;;;;;;AAQA,IAAa,mBAAmB,EAAE,YAAY;CAC1C,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC7B,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS;CAChC,SAAS,EACJ,MAAM,CACH,EAAE,KAAK,GACP,EAAE,YAAY;EACV,MAAM,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC;EACpC,WAAW,EACN,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,mCAAmC,CAAC;CACjE,CAAC,CACL,CAAC,CAAC,CACD,SAAS;CACd,QAAQ,EACH,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,gDAAgD,CAAC;AAC9E,CAAC;AAED,IAAa,WAAW,EACnB,YAAY;CACT,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACpC,aACI,qNACR,CAAC;CACD,OAAO,EAAE,YAAY;EAAE,UAAU,EAAE,OAAO;EAAG,QAAQ,EAAE,OAAO;CAAE,CAAC;CACjE,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,WAAW,EACN,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,gEAAgE,CAAC;CAC1F,QAAQ,EAAE,MAAM,KAAK;CACrB,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;CACzE,MAAM,eAAe,SAAS;CAC9B,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,WAAW,UAAU,SAAS;CAC9B,UAAU,iBAAiB,SAAS;CACpC,OAAO,EACF,MAAM,SAAS,CAAC,CAChB,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,4DAA4D,CAAC;CACtF,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;AACzD,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,uCAAuC,CAAC"}
1
+ {"version":3,"file":"resource.js","names":[],"sources":["../../src/schemas/resource.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action } from './action';\nimport { Abilities } from './common';\nimport { Field } from './field';\nimport { LayoutNode } from './layout';\nimport { ListDefinition } from './list';\nimport { OverviewPeriod, Widget } from './widget';\n\nexport const ResourceFeatures = z.looseObject({\n drafts: z.boolean().optional(),\n revisions: z.boolean().optional(),\n preview: z\n .union([\n z.null(),\n z.looseObject({\n mode: z.enum(['component', 'iframe']),\n component: z\n .string()\n .optional()\n .meta({ description: '`component`: the plugin preview.' }),\n }),\n ])\n .optional(),\n search: z.boolean().optional().meta({\n description:\n 'Whether the resource is in the global search. Defaults to whether its list has a search (`list.search`).',\n }),\n});\n\nexport const ResourceType = z\n .looseObject({\n id: z.string().min(1).meta({\n description: 'The `type` of the items of this type, which the client sends on create.',\n }),\n label: z.string().meta({\n description:\n 'The name of the type: the title of its create form and of its choice when creating.',\n }),\n description: z\n .string()\n .optional()\n .meta({ description: 'A line under the label, in the choice of a type.' }),\n icon: z.string().optional(),\n // The return type is written out so that declaration files name `Field`.\n get fields(): z.ZodArray<typeof Field> {\n return z.array(Field).meta({\n description:\n \"The type's own fields, after those of the resource. The resource's `form.layout` can name them: forms of the other types leave them out.\",\n });\n },\n abilities: Abilities.optional().meta({\n description:\n '`create: false`: the type is not offered when creating, and the backend refuses to create one (a singleton such as the home page). Its items can still be edited.',\n }),\n })\n .meta({\n description:\n 'A type of the items of a resource (decision 0077): the items of a type have the fields of the resource and its own.',\n });\n\nexport const SummaryPeriod = OverviewPeriod.extend({\n filter: z.string().min(1).optional().meta({\n description:\n \"The id of the list's `date-range` filter that the period sets. Defaults to the first `date-range` filter of the list.\",\n }),\n}).meta({\n description:\n \"The period of a summary (decision 0084): the list's own `date-range` filter, so choosing it filters the rows too.\",\n});\n\nexport const ResourceSummary = z\n .looseObject({\n widgets: z.array(Widget).meta({\n description:\n \"The widgets of the summary for the user, in order, drawn above the list in the grid of a dashboard. Widgets on this resource get the list's current filters and search, unless `settings.followsList` is `false`. Widgets with data of their own are fed by `GET /dashboard/widgets/{widget}?resource={resource}`, with the filters and the search of the list.\",\n }),\n list: z.enum(['collapsed']).optional().meta({\n description:\n '`collapsed`: the resource opens on its summary, with its list folded under it behind \"Show the N items\". Without it, the list is shown under the summary.',\n }),\n period: SummaryPeriod.optional(),\n })\n .meta({\n description:\n 'Widgets above the list of a resource, which follow its filters and its search (decision 0084).',\n });\n\nexport const Resource = z\n .looseObject({\n id: z.string().min(1),\n kind: z.string().min(1).optional().meta({\n description:\n \"What the resource is. `media`: a library of media (decision 0026), with a `file` field and a `media` on each item. Without it, an ordinary resource. Clients treat a kind they don't know as an ordinary resource.\",\n }),\n label: z.looseObject({ singular: z.string(), plural: z.string() }),\n description: z.string().optional(),\n icon: z.string().optional(),\n itemTitle: z\n .string()\n .optional()\n .meta({ description: 'The field used as the title of an item, in lists and pickers.' }),\n itemSubtitle: z.string().optional().meta({\n description:\n 'The field shown under the title of an item, in search results, cards and pickers.',\n }),\n itemImage: z.string().optional().meta({\n description:\n \"The field that holds the image of an item (a media, a file or a URL), in search results, pickers, the gallery and the thumbnails of the table. Defaults to the item's `media` in a resource of kind `media` (decision 0061).\",\n }),\n open: z\n .union([z.enum(['panel', 'edit']), z.string().min(1)])\n .optional()\n .meta({\n description:\n \"Where an item's title goes, in its list and wherever the app links to the item (decision 0082). `edit`, the default: its edit form, and the show route redirects there. An item the user can't update still opens in the panel. `panel`: the show route, with the item's details in a panel next to the list, for items read more than edited, or shown with their preview. Clients treat a value they don't know as `edit`.\",\n }),\n itemActions: z.array(z.string().min(1)).optional().meta({\n description:\n \"The built-in item actions the resource shows, in their order (decision 0040): some of `show`, `edit`, `duplicate` and `delete`. Defaults to all four. Each one is shown on the items whose abilities allow it (`view`, `update`, `duplicate`, `delete`). `[]` shows none. Clients ignore ids they don't know.\",\n }),\n fields: z.array(Field),\n form: z.looseObject({ layout: z.array(LayoutNode).optional() }).optional(),\n list: ListDefinition.optional(),\n actions: z.array(Action).optional(),\n abilities: Abilities.optional(),\n features: ResourceFeatures.optional(),\n types: z.array(ResourceType).optional().meta({\n description:\n \"The types of the resource's items, each with fields of its own (decision 0077). Each item has a `type`, set when it is created, among their ids.\",\n }),\n summary: ResourceSummary.optional().meta({\n description:\n 'Widgets above the list, which follow its filters and its search (decision 0084).',\n }),\n settings: z.record(z.string(), z.unknown()).optional(),\n })\n .meta({ description: 'A set of items managed in the admin.' });\n\nexport type ResourceFeatures = z.infer<typeof ResourceFeatures>;\nexport type ResourceType = z.infer<typeof ResourceType>;\nexport type SummaryPeriod = z.infer<typeof SummaryPeriod>;\nexport type ResourceSummary = z.infer<typeof ResourceSummary>;\nexport type Resource = z.infer<typeof Resource>;\n/** A resource as a backend writes it, before defaults are applied. */\nexport type ResourceInput = z.input<typeof Resource>;\n"],"mappings":";;;;;;;;AASA,IAAa,mBAAmB,EAAE,YAAY;CAC1C,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC7B,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS;CAChC,SAAS,EACJ,MAAM,CACH,EAAE,KAAK,GACP,EAAE,YAAY;EACV,MAAM,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC;EACpC,WAAW,EACN,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,mCAAmC,CAAC;CACjE,CAAC,CACL,CAAC,CAAC,CACD,SAAS;CACd,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAChC,aACI,2GACR,CAAC;AACL,CAAC;AAED,IAAa,eAAe,EACvB,YAAY;CACT,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EACvB,aAAa,0EACjB,CAAC;CACD,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,EACnB,aACI,sFACR,CAAC;CACD,aAAa,EACR,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,mDAAmD,CAAC;CAC7E,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAE1B,IAAI,SAAmC;EACnC,OAAO,EAAE,MAAM,KAAK,CAAC,CAAC,KAAK,EACvB,aACI,2IACR,CAAC;CACL;CACA,WAAW,UAAU,SAAS,CAAC,CAAC,KAAK,EACjC,aACI,oKACR,CAAC;AACL,CAAC,CAAC,CACD,KAAK,EACF,aACI,sHACR,CAAC;AAEL,IAAa,gBAAgB,eAAe,OAAO,EAC/C,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACtC,aACI,wHACR,CAAC,EACL,CAAC,CAAC,CAAC,KAAK,EACJ,aACI,oHACR,CAAC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AY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;CACzE,MAAM,eAAe,SAAS;CAC9B,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,WAAW,UAAU,SAAS;CAC9B,UAAU,iBAAiB,SAAS;CACpC,OAAO,EAAE,MAAM,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACzC,aACI,mJACR,CAAC;CACD,SAAS,gBAAgB,SAAS,CAAC,CAAC,KAAK,EACrC,aACI,mFACR,CAAC;CACD,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;AACzD,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,uCAAuC,CAAC"}
@@ -111,16 +111,20 @@ export declare const Theme: z.ZodObject<{
111
111
  export declare const DefinitionTheme: z.ZodObject<{
112
112
  tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
113
113
  colorScheme: z.ZodOptional<z.ZodEnum<{
114
- dark: "dark";
115
114
  auto: "auto";
115
+ dark: "dark";
116
116
  light: "light";
117
117
  }>>;
118
118
  density: z.ZodOptional<z.ZodEnum<{
119
- auto: "auto";
120
119
  compact: "compact";
120
+ auto: "auto";
121
121
  comfortable: "comfortable";
122
122
  touch: "touch";
123
123
  }>>;
124
+ navigation: z.ZodOptional<z.ZodEnum<{
125
+ sidebar: "sidebar";
126
+ dock: "dock";
127
+ }>>;
124
128
  extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
125
129
  label: z.ZodOptional<z.ZodString>;
126
130
  dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/schemas/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO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"
60
60
  ]).optional(),
61
+ navigation: z.enum(["sidebar", "dock"]).optional().meta({ description: "Where the app shows the `main` menu: `sidebar` (the default), a column on the left, or `dock`, a dock at the bottom of the window (decision 0076)." }),
61
62
  extends: z.union([z.string(), z.array(z.string())]).optional().meta({ description: "Themes registered by plugins, by id, that this theme builds on, in order: its own values override theirs." })
62
63
  }).meta({ description: "The theme of the admin: a theme, built on themes of plugins." });
63
64
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","names":[],"sources":["../../src/schemas/theme.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Names of tones, palette colors, components and variants: they become CSS class names. */\nconst Name = z.string().regex(/^[a-z0-9-]+$/);\n\nexport const ThemeTokens = z\n .record(z.string().regex(/^[a-zA-Z0-9_-]+$/), z.string().regex(/^[^{};<]*$/))\n .meta({\n description:\n 'CSS variables without the leading `--`, and their values: `{ \"panneau-color-accent\": \"#05f\" }`. Values cannot contain `{`, `}`, `;` or `<`.',\n });\n\nexport const ToneValues = z.looseObject({\n text: z.string().meta({ description: 'Text and icons on surfaces.' }),\n subtle: z.string().meta({ description: 'Background of the subtle appearance.' }),\n border: z.string().meta({ description: 'Border of the subtle appearance.' }),\n outline: z.string().meta({ description: 'Border of the outline appearance.' }),\n solid: z.string().meta({ description: 'Background of the solid appearance.' }),\n solidHover: z.string().meta({ description: 'Background of the solid appearance on hover.' }),\n solidText: z.string().meta({ description: 'Text on the solid appearance.' }),\n});\n\nexport const ToneInput = z\n .union([\n z.string().meta({ description: 'One color, from which Panneau derives the others.' }),\n ToneValues.extend({ dark: ToneValues.partial().optional() }),\n ])\n .meta({ description: 'A tone: one color, or every value with dark scheme overrides.' });\n\nexport const ThemeFontFace = z\n .looseObject({\n family: z.string().regex(/^[^{}<;\"\\\\]+$/),\n src: z\n .string()\n .regex(/^[^{}<]+$/)\n .meta({\n description: \"The `src` descriptor: `url(/fonts/geist.woff2) format('woff2')`.\",\n }),\n weight: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n style: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n display: z.enum(['auto', 'block', 'swap', 'fallback', 'optional']).optional(),\n unicodeRange: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n })\n .meta({ description: 'A font face, written as an `@font-face` rule.' });\n\nexport const ThemeFontStylesheet = z\n .looseObject({ stylesheet: z.string().min(1) })\n .meta({ description: 'A hosted stylesheet that declares font faces.' });\n\nexport const ThemeFont = z.union([ThemeFontFace, ThemeFontStylesheet]);\n\nconst themeShape = {\n label: z.string().optional(),\n tokens: ThemeTokens.meta({\n description:\n 'Tokens of the light scheme, or of both schemes when `dark` does not set them.',\n }),\n dark: ThemeTokens.optional().meta({ description: 'Tokens that change in the dark scheme.' }),\n palette: z\n .record(Name, z.string().regex(/^[^{};<]*$/))\n .optional()\n .meta({\n description:\n 'Raw colors, written as `--panneau-palette-<name>`: tokens and tones use them with `var(--panneau-palette-<name>)`.',\n }),\n tones: z.record(Name, ToneInput).optional().meta({\n description: 'Tones added or redefined by the theme, applied by `panneau-tone-<name>`.',\n }),\n components: z\n .record(Name, z.looseObject({ variants: z.record(Name, ThemeTokens).optional() }))\n .optional()\n .meta({\n description:\n 'Named variants of components: tokens applied by `panneau-<component>-variant-<name>`.',\n }),\n densities: z\n .looseObject({\n compact: ThemeTokens.optional(),\n comfortable: ThemeTokens.optional(),\n touch: ThemeTokens.optional(),\n })\n .optional()\n .meta({\n description:\n 'Tokens of each density (`panneau-control-height`…), which change with the density of the root.',\n }),\n fonts: z.array(ThemeFont).optional().meta({\n description: 'Font faces and font stylesheets, added to the page once.',\n }),\n};\n\nexport const Theme = z\n .looseObject(themeShape)\n .meta({ description: 'A theme of `@panneau/ui`, as plain data (decision 0024).' });\n\nexport const DefinitionTheme = z\n .looseObject({\n ...themeShape,\n tokens: themeShape.tokens.optional(),\n colorScheme: z.enum(['light', 'dark', 'auto']).optional(),\n density: z.enum(['compact', 'comfortable', 'touch', 'auto']).optional(),\n extends: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .meta({\n description:\n 'Themes registered by plugins, by id, that this theme builds on, in order: its own values override theirs.',\n }),\n })\n .meta({ description: 'The theme of the admin: a theme, built on themes of plugins.' });\n\nexport type ThemeTokens = z.infer<typeof ThemeTokens>;\nexport type ToneValues = z.infer<typeof ToneValues>;\nexport type ToneInput = z.infer<typeof ToneInput>;\nexport type Theme = z.infer<typeof Theme>;\nexport type DefinitionTheme = z.infer<typeof DefinitionTheme>;\nexport type ThemeFontFace = z.infer<typeof ThemeFontFace>;\nexport type ThemeFontStylesheet = z.infer<typeof ThemeFontStylesheet>;\nexport type ThemeFont = z.infer<typeof ThemeFont>;\n"],"mappings":";;;AAGA,IAAM,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,cAAc;AAE5C,IAAa,cAAc,EACtB,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,kBAAkB,GAAG,EAAE,OAAO,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,CAC5E,KAAK,EACF,aACI,kJACR,CAAC;AAEL,IAAa,aAAa,EAAE,YAAY;CACpC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,8BAA8B,CAAC;CACpE,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,uCAAuC,CAAC;CAC/E,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,mCAAmC,CAAC;CAC3E,SAAS,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,oCAAoC,CAAC;CAC7E,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,sCAAsC,CAAC;CAC7E,YAAY,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,+CAA+C,CAAC;CAC3F,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,gCAAgC,CAAC;AAC/E,CAAC;AAED,IAAa,YAAY,EACpB,MAAM,CACH,EAAE,OAAO,C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,CAAC,CAAC,KAAK,EAC7C,aAAa,2EACjB,CAAC;CACD,YAAY,EACP,OAAO,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,MAAM,WAAW,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CACjF,SAAS,CAAC,CACV,KAAK,EACF,aACI,wFACR,CAAC;CACL,WAAW,EACN,YAAY;EACT,SAAS,YAAY,SAAS;EAC9B,aAAa,YAAY,SAAS;EAClC,OAAO,YAAY,SAAS;CAChC,CAAC,CAAC,CACD,SAAS,CAAC,CACV,KAAK,EACF,aACI,iGACR,CAAC;CACL,OAAO,EAAE,MAAM,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACtC,aAAa,2DACjB,CAAC;AACL;AAEA,IAAa,QAAQ,EAChB,YAAY,UAAU,CAAC,CACvB,KAAK,EAAE,aAAa,2DAA2D,CAAC;AAErF,IAAa,kBAAkB,EAC1B,YAAY;CACT,GAAG;CACH,QAAQ,WAAW,OAAO,SAAS;CACnC,aAAa,EAAE,KAAK;EAAC;EAAS;EAAQ;CAAM,CAAC,CAAC,CAAC,SAAS;CACxD,SAAS,EAAE,KAAK;EAAC;EAAW;EAAe;EAAS;CAAM,CAAC,CAAC,CAAC,SAAS;CACtE,SAAS,EACJ,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CACxC,SAAS,CAAC,CACV,KAAK,EACF,aACI,4GACR,CAAC;AACT,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,+DAA+D,CAAC"}
1
+ {"version":3,"file":"theme.js","names":[],"sources":["../../src/schemas/theme.ts"],"sourcesContent":["import { z } from 'zod';\n\n/** Names of tones, palette colors, components and variants: they become CSS class names. */\nconst Name = z.string().regex(/^[a-z0-9-]+$/);\n\nexport const ThemeTokens = z\n .record(z.string().regex(/^[a-zA-Z0-9_-]+$/), z.string().regex(/^[^{};<]*$/))\n .meta({\n description:\n 'CSS variables without the leading `--`, and their values: `{ \"panneau-color-accent\": \"#05f\" }`. Values cannot contain `{`, `}`, `;` or `<`.',\n });\n\nexport const ToneValues = z.looseObject({\n text: z.string().meta({ description: 'Text and icons on surfaces.' }),\n subtle: z.string().meta({ description: 'Background of the subtle appearance.' }),\n border: z.string().meta({ description: 'Border of the subtle appearance.' }),\n outline: z.string().meta({ description: 'Border of the outline appearance.' }),\n solid: z.string().meta({ description: 'Background of the solid appearance.' }),\n solidHover: z.string().meta({ description: 'Background of the solid appearance on hover.' }),\n solidText: z.string().meta({ description: 'Text on the solid appearance.' }),\n});\n\nexport const ToneInput = z\n .union([\n z.string().meta({ description: 'One color, from which Panneau derives the others.' }),\n ToneValues.extend({ dark: ToneValues.partial().optional() }),\n ])\n .meta({ description: 'A tone: one color, or every value with dark scheme overrides.' });\n\nexport const ThemeFontFace = z\n .looseObject({\n family: z.string().regex(/^[^{}<;\"\\\\]+$/),\n src: z\n .string()\n .regex(/^[^{}<]+$/)\n .meta({\n description: \"The `src` descriptor: `url(/fonts/geist.woff2) format('woff2')`.\",\n }),\n weight: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n style: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n display: z.enum(['auto', 'block', 'swap', 'fallback', 'optional']).optional(),\n unicodeRange: z\n .string()\n .regex(/^[^{}<;]*$/)\n .optional(),\n })\n .meta({ description: 'A font face, written as an `@font-face` rule.' });\n\nexport const ThemeFontStylesheet = z\n .looseObject({ stylesheet: z.string().min(1) })\n .meta({ description: 'A hosted stylesheet that declares font faces.' });\n\nexport const ThemeFont = z.union([ThemeFontFace, ThemeFontStylesheet]);\n\nconst themeShape = {\n label: z.string().optional(),\n tokens: ThemeTokens.meta({\n description:\n 'Tokens of the light scheme, or of both schemes when `dark` does not set them.',\n }),\n dark: ThemeTokens.optional().meta({ description: 'Tokens that change in the dark scheme.' }),\n palette: z\n .record(Name, z.string().regex(/^[^{};<]*$/))\n .optional()\n .meta({\n description:\n 'Raw colors, written as `--panneau-palette-<name>`: tokens and tones use them with `var(--panneau-palette-<name>)`.',\n }),\n tones: z.record(Name, ToneInput).optional().meta({\n description: 'Tones added or redefined by the theme, applied by `panneau-tone-<name>`.',\n }),\n components: z\n .record(Name, z.looseObject({ variants: z.record(Name, ThemeTokens).optional() }))\n .optional()\n .meta({\n description:\n 'Named variants of components: tokens applied by `panneau-<component>-variant-<name>`.',\n }),\n densities: z\n .looseObject({\n compact: ThemeTokens.optional(),\n comfortable: ThemeTokens.optional(),\n touch: ThemeTokens.optional(),\n })\n .optional()\n .meta({\n description:\n 'Tokens of each density (`panneau-control-height`…), which change with the density of the root.',\n }),\n fonts: z.array(ThemeFont).optional().meta({\n description: 'Font faces and font stylesheets, added to the page once.',\n }),\n};\n\nexport const Theme = z\n .looseObject(themeShape)\n .meta({ description: 'A theme of `@panneau/ui`, as plain data (decision 0024).' });\n\nexport const DefinitionTheme = z\n .looseObject({\n ...themeShape,\n tokens: themeShape.tokens.optional(),\n colorScheme: z.enum(['light', 'dark', 'auto']).optional(),\n density: z.enum(['compact', 'comfortable', 'touch', 'auto']).optional(),\n navigation: z.enum(['sidebar', 'dock']).optional().meta({\n description:\n 'Where the app shows the `main` menu: `sidebar` (the default), a column on the left, or `dock`, a dock at the bottom of the window (decision 0076).',\n }),\n extends: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .meta({\n description:\n 'Themes registered by plugins, by id, that this theme builds on, in order: its own values override theirs.',\n }),\n })\n .meta({ description: 'The theme of the admin: a theme, built on themes of plugins.' });\n\nexport type ThemeTokens = z.infer<typeof ThemeTokens>;\nexport type ToneValues = z.infer<typeof ToneValues>;\nexport type ToneInput = z.infer<typeof ToneInput>;\nexport type Theme = z.infer<typeof Theme>;\nexport type DefinitionTheme = z.infer<typeof DefinitionTheme>;\nexport type ThemeFontFace = z.infer<typeof ThemeFontFace>;\nexport type ThemeFontStylesheet = z.infer<typeof ThemeFontStylesheet>;\nexport type ThemeFont = z.infer<typeof Theme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