@panneau/media 5.0.0-alpha.8 → 5.0.0-alpha.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"resourceSource.d.ts","sourceRoot":"","sources":["../src/resourceSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAA0B,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,KAAK,EAAa,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAE1E,yFAAyF;AACzF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAEzF,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG,IAAI,CAC3B,QAAQ,EACR,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CACjE,CAAC;AA0CF;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,YAAY,GACtB,WAAW,CAuDb"}
1
+ {"version":3,"file":"resourceSource.d.ts","sourceRoot":"","sources":["../src/resourceSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAA0B,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,KAAK,EAAa,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAE1E,yFAAyF;AACzF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAEzF,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG,IAAI,CAC3B,QAAQ,EACR,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CACjE,CAAC;AA0CF;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,YAAY,GACtB,WAAW,CAkEb"}
@@ -1,4 +1,5 @@
1
1
  import { getAccept, getMaxSize } from "@panneau/fields";
2
+ import { isCursorPage } from "@panneau/protocol/runtime";
2
3
  //#region src/resourceSource.ts
3
4
  /** Fields a picker never edits: the original file, and what the backend computes. */
4
5
  var READ_ONLY = /* @__PURE__ */ new Set(["file", "media"]);
@@ -63,17 +64,25 @@ function createResourceMediaSource(adapter, library) {
63
64
  fields,
64
65
  canCreate: library.abilities?.create !== false,
65
66
  async list({ q, filter, sort, cursor }, options) {
66
- const page = cursor === null || cursor === void 0 ? 1 : Number(cursor);
67
+ const cursors = library.list?.pagination === "cursor";
68
+ const given = cursor !== null && cursor !== void 0 && cursor !== "";
69
+ const page = !cursors && given ? Number(cursor) : 1;
67
70
  const response = await adapter.list(library.id, {
68
- page,
71
+ ...cursors ? given ? { cursor } : {} : { page },
69
72
  ...q !== void 0 && q !== "" ? { q } : {},
70
73
  ...filter !== void 0 ? { filter } : {},
71
74
  ...sort !== void 0 ? { sort: [sort] } : {}
72
75
  }, options);
76
+ const { meta } = response;
73
77
  return {
74
78
  items: response.data.map(read),
75
- nextCursor: page < response.meta.lastPage ? String(page + 1) : null,
76
- total: response.meta.total
79
+ ...isCursorPage(meta) ? {
80
+ nextCursor: meta.nextCursor,
81
+ ...typeof meta.total === "number" ? { total: meta.total } : {}
82
+ } : {
83
+ nextCursor: page < meta.lastPage ? String(page + 1) : null,
84
+ total: meta.total
85
+ }
77
86
  };
78
87
  },
79
88
  async get(id, options) {
@@ -1 +1 @@
1
- {"version":3,"file":"resourceSource.js","names":["DataAdapter","getAccept","getMaxSize","Field","Item","MediaInfo","Resource","MediaSort","MediaSource","PickerMedia","MediaSourceAdapter","Pick","MediaLibrary","READ_ONLY","Set","DESCENDING","toPickerMedia","item","itemTitle","fields","file","media","createdAt","name","title","fileName","id","label","type","values","Object","fromEntries","map","field","sortsOf","library","sorts","list","key","find","has","undefined","preferred","defaultSort","split","first","sort","replace","filter","createResourceMediaSource","adapter","abilities","update","read","plural","accept","maxSize","filters","canCreate","create","q","cursor","options","page","Number","response","items","data","nextCursor","meta","lastPage","String","total","get","value","File","upload","mime","size"],"sources":["../src/resourceSource.ts"],"sourcesContent":["import type { DataAdapter } from '@panneau/data';\nimport { getAccept, getMaxSize } from '@panneau/fields';\nimport type { Field, Item, MediaInfo, Resource } from '@panneau/protocol';\n\nimport type { MediaSort, MediaSource, PickerMedia } from './picker/types';\n\n/** What a library source needs of an adapter: `@panneau/data`'s `DataAdapter` has it. */\nexport type MediaSourceAdapter = Pick<DataAdapter, 'list' | 'get' | 'create' | 'update'>;\n\n/** The library resource a source reads: a resource of kind `media` of the definition. */\nexport type MediaLibrary = Pick<\n Resource,\n 'id' | 'label' | 'itemTitle' | 'fields' | 'list' | 'abilities'\n>;\n\n/** Fields a picker never edits: the original file, and what the backend computes. */\nconst READ_ONLY = new Set(['file', 'media']);\n\n/** Sorts that make more sense from the largest or the latest. */\nconst DESCENDING = new Set(['createdAt', 'updatedAt', 'size', 'pixels', 'duration']);\n\nfunction toPickerMedia(item: Item, itemTitle: string, fields: readonly Field[]): PickerMedia {\n const { file, media, createdAt } = item as Item & {\n file?: { name?: unknown } | null;\n media?: MediaInfo;\n createdAt?: unknown;\n };\n const title = item[itemTitle];\n const fileName = typeof file?.name === 'string' ? file.name : null;\n return {\n id: item.id,\n label: typeof title === 'string' && title !== '' ? title : (fileName ?? item.id),\n fileName,\n createdAt: typeof createdAt === 'string' ? createdAt : null,\n media: media ?? { type: 'other' },\n values: Object.fromEntries(fields.map((field) => [field.name, item[field.name]])),\n };\n}\n\n/** The sorts of a library: those of its list, the default one first. */\nfunction sortsOf(library: MediaLibrary): MediaSort[] {\n const sorts = (library.list?.sorts ?? []).map((key): MediaSort => {\n const label = library.fields.find((field) => field.name === key)?.label;\n return {\n id: DESCENDING.has(key) ? `-${key}` : key,\n ...(label !== undefined ? { label } : {}),\n };\n });\n const preferred = library.list?.defaultSort?.split(',')[0];\n const first = sorts.find(\n (sort) => sort.id === preferred || sort.id.replace(/^-/, '') === preferred,\n );\n return first !== undefined ? [first, ...sorts.filter((sort) => sort !== first)] : sorts;\n}\n\n/**\n * The source of a library resource (`kind: \"media\"`, decision 0027), for the media picker:\n *\n * - `list()` sends `GET /resources/{library}` with `q`, `filter`, `sort`, and the page number as\n * the cursor;\n * - `create()` sends `POST /resources/{library}` with `{ file: { upload, name, mime, size } }`,\n * or the file itself;\n * - `update()` sends `PATCH /resources/{library}/{id}` with the values edited in the details.\n *\n * Its filters and sorts are those of the resource's list, its fields those of the resource except\n * `file` (none when the user can't update the library), and `canCreate` its `create` ability.\n */\nexport function createResourceMediaSource(\n adapter: MediaSourceAdapter,\n library: MediaLibrary,\n): MediaSource {\n const itemTitle = library.itemTitle ?? 'name';\n const file = library.fields.find((field) => field.name === 'file');\n const fields =\n library.abilities?.update === false\n ? []\n : library.fields.filter((field) => !READ_ONLY.has(field.name));\n const read = (item: Item) => toPickerMedia(item, itemTitle, fields);\n return {\n id: library.id,\n label: library.label.plural,\n accept: file !== undefined ? getAccept(file) : null,\n maxSize: file !== undefined ? getMaxSize(file) : null,\n filters: (library.list?.filters ?? []).filter((filter) => filter.id !== 'type'),\n sorts: sortsOf(library),\n fields,\n canCreate: library.abilities?.create !== false,\n async list({ q, filter, sort, cursor }, options) {\n const page = cursor === null || cursor === undefined ? 1 : Number(cursor);\n const response = await adapter.list(\n library.id,\n {\n page,\n ...(q !== undefined && q !== '' ? { q } : {}),\n ...(filter !== undefined ? { filter } : {}),\n ...(sort !== undefined ? { sort: [sort] } : {}),\n },\n options,\n );\n return {\n items: response.data.map(read),\n nextCursor: page < response.meta.lastPage ? String(page + 1) : null,\n total: response.meta.total,\n };\n },\n async get(id, options) {\n return read(await adapter.get(library.id, id, options));\n },\n async create(file, options) {\n // With what the browser knows of the file, which the backend may check first.\n const value =\n file instanceof File\n ? file\n : {\n upload: file.upload,\n name: file.name,\n ...(file.mime !== null ? { mime: file.mime } : {}),\n ...(file.size !== null ? { size: file.size } : {}),\n };\n return read(await adapter.create(library.id, { file: value }, options));\n },\n async update(id, values, options) {\n return read(await adapter.update(library.id, id, values, options));\n },\n };\n}\n"],"mappings":";;;AAgBA,IAAMa,4BAAY,IAAIC,IAAI,CAAC,QAAQ,OAAO,CAAC;;AAG3C,IAAMC,6BAAa,IAAID,IAAI;CAAC;CAAa;CAAa;CAAQ;CAAU;AAAU,CAAC;AAEnF,SAASE,cAAcC,MAAYC,WAAmBC,QAAuC;CACzF,MAAM,EAAEC,MAAMC,OAAOC,cAAcL;CAKnC,MAAMO,QAAQP,KAAKC;CACnB,MAAMO,WAAW,OAAOL,MAAMG,SAAS,WAAWH,KAAKG,OAAO;CAC9D,OAAO;EACHG,IAAIT,KAAKS;EACTC,OAAO,OAAOH,UAAU,YAAYA,UAAU,KAAKA,QAASC,YAAYR,KAAKS;EAC7ED;EACAH,WAAW,OAAOA,cAAc,WAAWA,YAAY;EACvDD,OAAOA,SAAS,EAAEO,MAAM,QAAQ;EAChCC,QAAQC,OAAOC,YAAYZ,OAAOa,KAAKC,UAAU,CAACA,MAAMV,MAAMN,KAAKgB,MAAMV,KAAK,CAAC,CAAC;CACpF;AACJ;;AAGA,SAASW,QAAQC,SAAoC;CACjD,MAAMC,SAASD,QAAQE,MAAMD,SAAS,CAAA,EAAA,CAAIJ,KAAKM,QAAmB;EAC9D,MAAMX,QAAQQ,QAAQhB,OAAOoB,MAAMN,UAAUA,MAAMV,SAASe,GAAG,CAAC,EAAEX;EAClE,OAAO;GACHD,IAAIX,WAAWyB,IAAIF,GAAG,IAAI,IAAIA,QAAQA;GACtC,GAAIX,UAAUc,KAAAA,IAAY,EAAEd,MAAM,IAAI,CAAC;EAC3C;CACJ,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K,EAAEA,EAAE,IAAI,CAAC;IAC3C,GAAIZ,WAAWP,KAAAA,IAAY,EAAEO,OAAO,IAAI,CAAC;IACzC,GAAIF,SAASL,KAAAA,IAAY,EAAEK,MAAM,CAACA,IAAI,EAAE,IAAI,CAAC;GACjD,GACAgB,OACJ;GACA,OAAO;IACHI,OAAOD,SAASE,KAAKnC,IAAIqB,IAAI;IAC7Be,YAAYL,OAAOE,SAASI,KAAKC,WAAWC,OAAOR,OAAO,CAAC,IAAI;IAC/DS,OAAOP,SAASI,KAAKG;GACzB;EACJ;EACA,MAAMC,IAAI/C,IAAIoC,SAAS;GACnB,OAAOT,KAAK,MAAMH,QAAQuB,IAAItC,QAAQT,IAAIA,IAAIoC,OAAO,CAAC;EAC1D;EACA,MAAMH,OAAOvC,MAAM0C,SAAS;GAExB,MAAMY,QACFtD,gBAAgBuD,OACVvD,OACA;IACIwD,QAAQxD,KAAKwD;IACbrD,MAAMH,KAAKG;IACX,GAAIH,KAAKyD,SAAS,OAAO,EAAEA,MAAMzD,KAAKyD,KAAK,IAAI,CAAC;IAChD,GAAIzD,KAAK0D,SAAS,OAAO,EAAEA,MAAM1D,KAAK0D,KAAK,IAAI,CAAC;GACpD;GACV,OAAOzB,KAAK,MAAMH,QAAQS,OAAOxB,QAAQT,IAAI,EAAEN,MAAMsD,MAAM,GAAGZ,OAAO,CAAC;EAC1E;EACA,MAAMV,OAAO1B,IAAIG,QAAQiC,SAAS;GAC9B,OAAOT,KAAK,MAAMH,QAAQE,OAAOjB,QAAQT,IAAIA,IAAIG,QAAQiC,OAAO,CAAC;EACrE;CACJ;AACJ"}
1
+ {"version":3,"file":"resourceSource.js","names":["DataAdapter","getAccept","getMaxSize","Field","Item","MediaInfo","Resource","isCursorPage","MediaSort","MediaSource","PickerMedia","MediaSourceAdapter","Pick","MediaLibrary","READ_ONLY","Set","DESCENDING","toPickerMedia","item","itemTitle","fields","file","media","createdAt","name","title","fileName","id","label","type","values","Object","fromEntries","map","field","sortsOf","library","sorts","list","key","find","has","undefined","preferred","defaultSort","split","first","sort","replace","filter","createResourceMediaSource","adapter","abilities","update","read","plural","accept","maxSize","filters","canCreate","create","q","cursor","options","cursors","pagination","given","page","Number","response","meta","items","data","nextCursor","total","lastPage","String","get","value","File","upload","mime","size"],"sources":["../src/resourceSource.ts"],"sourcesContent":["import type { DataAdapter } from '@panneau/data';\nimport { getAccept, getMaxSize } from '@panneau/fields';\nimport type { Field, Item, MediaInfo, Resource } from '@panneau/protocol';\nimport { isCursorPage } from '@panneau/protocol/runtime';\n\nimport type { MediaSort, MediaSource, PickerMedia } from './picker/types';\n\n/** What a library source needs of an adapter: `@panneau/data`'s `DataAdapter` has it. */\nexport type MediaSourceAdapter = Pick<DataAdapter, 'list' | 'get' | 'create' | 'update'>;\n\n/** The library resource a source reads: a resource of kind `media` of the definition. */\nexport type MediaLibrary = Pick<\n Resource,\n 'id' | 'label' | 'itemTitle' | 'fields' | 'list' | 'abilities'\n>;\n\n/** Fields a picker never edits: the original file, and what the backend computes. */\nconst READ_ONLY = new Set(['file', 'media']);\n\n/** Sorts that make more sense from the largest or the latest. */\nconst DESCENDING = new Set(['createdAt', 'updatedAt', 'size', 'pixels', 'duration']);\n\nfunction toPickerMedia(item: Item, itemTitle: string, fields: readonly Field[]): PickerMedia {\n const { file, media, createdAt } = item as Item & {\n file?: { name?: unknown } | null;\n media?: MediaInfo;\n createdAt?: unknown;\n };\n const title = item[itemTitle];\n const fileName = typeof file?.name === 'string' ? file.name : null;\n return {\n id: item.id,\n label: typeof title === 'string' && title !== '' ? title : (fileName ?? item.id),\n fileName,\n createdAt: typeof createdAt === 'string' ? createdAt : null,\n media: media ?? { type: 'other' },\n values: Object.fromEntries(fields.map((field) => [field.name, item[field.name]])),\n };\n}\n\n/** The sorts of a library: those of its list, the default one first. */\nfunction sortsOf(library: MediaLibrary): MediaSort[] {\n const sorts = (library.list?.sorts ?? []).map((key): MediaSort => {\n const label = library.fields.find((field) => field.name === key)?.label;\n return {\n id: DESCENDING.has(key) ? `-${key}` : key,\n ...(label !== undefined ? { label } : {}),\n };\n });\n const preferred = library.list?.defaultSort?.split(',')[0];\n const first = sorts.find(\n (sort) => sort.id === preferred || sort.id.replace(/^-/, '') === preferred,\n );\n return first !== undefined ? [first, ...sorts.filter((sort) => sort !== first)] : sorts;\n}\n\n/**\n * The source of a library resource (`kind: \"media\"`, decision 0027), for the media picker:\n *\n * - `list()` sends `GET /resources/{library}` with `q`, `filter`, `sort`, and the page number as\n * the cursor;\n * - `create()` sends `POST /resources/{library}` with `{ file: { upload, name, mime, size } }`,\n * or the file itself;\n * - `update()` sends `PATCH /resources/{library}/{id}` with the values edited in the details.\n *\n * Its filters and sorts are those of the resource's list, its fields those of the resource except\n * `file` (none when the user can't update the library), and `canCreate` its `create` ability.\n */\nexport function createResourceMediaSource(\n adapter: MediaSourceAdapter,\n library: MediaLibrary,\n): MediaSource {\n const itemTitle = library.itemTitle ?? 'name';\n const file = library.fields.find((field) => field.name === 'file');\n const fields =\n library.abilities?.update === false\n ? []\n : library.fields.filter((field) => !READ_ONLY.has(field.name));\n const read = (item: Item) => toPickerMedia(item, itemTitle, fields);\n return {\n id: library.id,\n label: library.label.plural,\n accept: file !== undefined ? getAccept(file) : null,\n maxSize: file !== undefined ? getMaxSize(file) : null,\n filters: (library.list?.filters ?? []).filter((filter) => filter.id !== 'type'),\n sorts: sortsOf(library),\n fields,\n canCreate: library.abilities?.create !== false,\n async list({ q, filter, sort, cursor }, options) {\n // The picker's cursor is the library's own, or the number of the next page.\n const cursors = library.list?.pagination === 'cursor';\n const given = cursor !== null && cursor !== undefined && cursor !== '';\n const page = !cursors && given ? Number(cursor) : 1;\n const response = await adapter.list(\n library.id,\n {\n ...(cursors ? (given ? { cursor } : {}) : { page }),\n ...(q !== undefined && q !== '' ? { q } : {}),\n ...(filter !== undefined ? { filter } : {}),\n ...(sort !== undefined ? { sort: [sort] } : {}),\n },\n options,\n );\n const { meta } = response;\n return {\n items: response.data.map(read),\n ...(isCursorPage(meta)\n ? {\n nextCursor: meta.nextCursor,\n ...(typeof meta.total === 'number' ? { total: meta.total } : {}),\n }\n : {\n nextCursor: page < meta.lastPage ? String(page + 1) : null,\n total: meta.total,\n }),\n };\n },\n async get(id, options) {\n return read(await adapter.get(library.id, id, options));\n },\n async create(file, options) {\n // With what the browser knows of the file, which the backend may check first.\n const value =\n file instanceof File\n ? file\n : {\n upload: file.upload,\n name: file.name,\n ...(file.mime !== null ? { mime: file.mime } : {}),\n ...(file.size !== null ? { size: file.size } : {}),\n };\n return read(await adapter.create(library.id, { file: value }, options));\n },\n async update(id, values, options) {\n return read(await adapter.update(library.id, id, values, options));\n },\n };\n}\n"],"mappings":";;;;AAiBA,IAAMc,4BAAY,IAAIC,IAAI,CAAC,QAAQ,OAAO,CAAC;;AAG3C,IAAMC,6BAAa,IAAID,IAAI;CAAC;CAAa;CAAa;CAAQ;CAAU;AAAU,CAAC;AAEnF,SAASE,cAAcC,MAAYC,WAAmBC,QAAuC;CACzF,MAAM,EAAEC,MAAMC,OAAOC,cAAcL;CAKnC,MAAMO,QAAQP,KAAKC;CACnB,MAAMO,WAAW,OAAOL,MAAMG,SAAS,WAAWH,KAAKG,OAAO;CAC9D,OAAO;EACHG,IAAIT,KAAKS;EACTC,OAAO,OAAOH,UAAU,YAAYA,UAAU,KAAKA,QAASC,YAAYR,KAAKS;EAC7ED;EACAH,WAAW,OAAOA,cAAc,WAAWA,YAAY;EACvDD,OAAOA,SAAS,EAAEO,MAAM,QAAQ;EAChCC,QAAQC,OAAOC,YAAYZ,OAAOa,KAAKC,UAAU,CAACA,MAAMV,MAAMN,KAAKgB,MAAMV,KAAK,CAAC,CAAC;CACpF;AACJ;;AAGA,SAASW,QAAQC,SAAoC;CACjD,MAAMC,SAASD,QAAQE,MAAMD,SAAS,CAAA,EAAA,CAAIJ,KAAKM,QAAmB;EAC9D,MAAMX,QAAQQ,QAAQhB,OAAOoB,MAAMN,UAAUA,MAAMV,SAASe,GAAG,CAAC,EAA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MAAMH,QAAQS,OAAOxB,QAAQT,IAAI,EAAEN,MAAMyD,MAAM,GAAGf,OAAO,CAAC;EAC1E;EACA,MAAMV,OAAO1B,IAAIG,QAAQiC,SAAS;GAC9B,OAAOT,KAAK,MAAMH,QAAQE,OAAOjB,QAAQT,IAAIA,IAAIG,QAAQiC,OAAO,CAAC;EACrE;CACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/media",
3
- "version": "5.0.0-alpha.8",
3
+ "version": "5.0.0-alpha.9",
4
4
  "description": "The media of Panneau: the media field, which makes media of uploads and follows their ingest.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,12 +48,12 @@
48
48
  "react-intl": "^12.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "@panneau/core": "5.0.0-alpha.8",
52
- "@panneau/data": "5.0.0-alpha.8",
53
- "@panneau/fields": "5.0.0-alpha.8",
54
- "@panneau/intl": "5.0.0-alpha.8",
55
- "@panneau/protocol": "5.0.0-alpha.8",
56
- "@panneau/ui": "5.0.0-alpha.8",
51
+ "@panneau/core": "5.0.0-alpha.9",
52
+ "@panneau/data": "5.0.0-alpha.9",
53
+ "@panneau/fields": "5.0.0-alpha.9",
54
+ "@panneau/intl": "5.0.0-alpha.9",
55
+ "@panneau/protocol": "5.0.0-alpha.9",
56
+ "@panneau/ui": "5.0.0-alpha.9",
57
57
  "lucide-react": "^1.57.0"
58
58
  }
59
59
  }