@adatechnology/content-ui 0.3.0 → 0.5.0

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.
package/dist/index.d.ts CHANGED
@@ -163,6 +163,29 @@ var imageDialogTitle = "Inserir imagem";
163
163
  var imageUploadFromDevice = "Enviar do aparelho";
164
164
  var dialogInsert = "Inserir";
165
165
  var fileNoneChosen = "Nenhum arquivo escolhido";
166
+ var photoDialogTitle = "Inserir fotos";
167
+ var photoPickButton = "Escolher fotos";
168
+ var photoDropHint = "Arraste as fotos para cá, cole com Ctrl+V ou escolha do aparelho.";
169
+ var photoCount = "{count} de {max} fotos";
170
+ var photoItemLabel = "Foto {position}";
171
+ var photoAltLabel = "Descrição da foto";
172
+ var photoAltWarning = "Sem descrição, quem usa leitor de tela não saberá o que a foto mostra.";
173
+ var photoCaptionLabel = "Legenda (opcional)";
174
+ var photoRemove = "Remover foto";
175
+ var photoMoveUp = "Mover para cima";
176
+ var photoMoveDown = "Mover para baixo";
177
+ var photoStatusWaiting = "Aguardando";
178
+ var photoStatusReducing = "Reduzindo";
179
+ var photoStatusUploading = "Enviando";
180
+ var photoStatusDone = "Pronta";
181
+ var photoStatusError = "Falhou";
182
+ var photoRetry = "Tentar de novo";
183
+ var photoSending = "Enviando fotos…";
184
+ var photoNotImage = "{name} não é uma imagem.";
185
+ var photoLimitReached = "O máximo é {max} fotos por vez; {count} ficaram de fora.";
186
+ var photoErrorDecode = "Não foi possível ler esta foto. Tente JPG, PNG ou WebP.";
187
+ var photoErrorEncode = "Este navegador não consegue preparar a foto para envio.";
188
+ var photoErrorTooLarge = "A foto continua grande demais mesmo depois de reduzida.";
166
189
  var emojiTitle = "Escolher emoji";
167
190
  var emojiSearch = "Buscar emoji";
168
191
  var emojiCategories = "Categorias de emoji";
@@ -174,6 +197,12 @@ var emojiNature = "Natureza";
174
197
  var emojiTravel = "Lugares";
175
198
  var emojiObjects = "Objetos";
176
199
  var emojiSymbols = "Símbolos";
200
+ var imageOpen = "Ampliar foto {n} de {total}";
201
+ var imageViewer = "Visualizador de fotos";
202
+ var imagePosition = "Foto {n} de {total}";
203
+ var imageCounter = "{n} / {total}";
204
+ var imagePrevious = "Foto anterior";
205
+ var imageNext = "Próxima foto";
177
206
  var ptBR = {
178
207
  statusDraft: statusDraft,
179
208
  statusScheduled: statusScheduled,
@@ -335,6 +364,29 @@ var ptBR = {
335
364
  imageUploadFromDevice: imageUploadFromDevice,
336
365
  dialogInsert: dialogInsert,
337
366
  fileNoneChosen: fileNoneChosen,
367
+ photoDialogTitle: photoDialogTitle,
368
+ photoPickButton: photoPickButton,
369
+ photoDropHint: photoDropHint,
370
+ photoCount: photoCount,
371
+ photoItemLabel: photoItemLabel,
372
+ photoAltLabel: photoAltLabel,
373
+ photoAltWarning: photoAltWarning,
374
+ photoCaptionLabel: photoCaptionLabel,
375
+ photoRemove: photoRemove,
376
+ photoMoveUp: photoMoveUp,
377
+ photoMoveDown: photoMoveDown,
378
+ photoStatusWaiting: photoStatusWaiting,
379
+ photoStatusReducing: photoStatusReducing,
380
+ photoStatusUploading: photoStatusUploading,
381
+ photoStatusDone: photoStatusDone,
382
+ photoStatusError: photoStatusError,
383
+ photoRetry: photoRetry,
384
+ photoSending: photoSending,
385
+ photoNotImage: photoNotImage,
386
+ photoLimitReached: photoLimitReached,
387
+ photoErrorDecode: photoErrorDecode,
388
+ photoErrorEncode: photoErrorEncode,
389
+ photoErrorTooLarge: photoErrorTooLarge,
338
390
  emojiTitle: emojiTitle,
339
391
  emojiSearch: emojiSearch,
340
392
  emojiCategories: emojiCategories,
@@ -345,7 +397,13 @@ var ptBR = {
345
397
  emojiNature: emojiNature,
346
398
  emojiTravel: emojiTravel,
347
399
  emojiObjects: emojiObjects,
348
- emojiSymbols: emojiSymbols
400
+ emojiSymbols: emojiSymbols,
401
+ imageOpen: imageOpen,
402
+ imageViewer: imageViewer,
403
+ imagePosition: imagePosition,
404
+ imageCounter: imageCounter,
405
+ imagePrevious: imagePrevious,
406
+ imageNext: imageNext
349
407
  };
350
408
 
351
409
  /**
@@ -403,6 +461,11 @@ type ContentAdminApi = {
403
461
  removeRecurrence?(id: string): Promise<void>;
404
462
  /** Ausente: o filtro de tag vira campo livre e o editor não sugere tags. */
405
463
  listTags?(): Promise<readonly TagCount[]>;
464
+ /** Upload genérico de foto; ausente, o editor cai em `uploadCoverImage`. */
465
+ uploadImage?(file: File): Promise<{
466
+ readonly url: string;
467
+ readonly key: string;
468
+ }>;
406
469
  /** Ausente: a capa é só por URL — sem alvo de upload que sempre falharia. */
407
470
  uploadCoverImage?(file: File): Promise<{
408
471
  readonly url: string;
@@ -518,7 +581,38 @@ declare function validateDraft(draft: PostDraft): Partial<Record<DraftErrorField
518
581
  /** Entrada do campo de tags: separa por vírgula/quebra e normaliza como o servidor fará. */
519
582
  declare function splitTagInput(value: string): string[];
520
583
 
584
+ /**
585
+ * O que a lista está mostrando agora, para o host montar um botão "Exportar" ao lado dos filtros.
586
+ *
587
+ * O pacote não exporta nada: quem gera o arquivo é o backend do host, com os mesmos filtros da tela.
588
+ * `filters` traz os filtros ativos já como texto; `pageCount`, quantas linhas a página tem.
589
+ */
590
+ type ListExportContext = {
591
+ readonly total: number;
592
+ readonly page: number;
593
+ readonly pageSize: number;
594
+ readonly pageCount: number;
595
+ readonly filters: Readonly<Record<string, string>>;
596
+ };
597
+ type PostListProps = {
598
+ readonly onSelect: (post: PostSummary) => void;
599
+ /** Ausente: sem botão "Novo post". */
600
+ readonly onCreate?: () => void;
601
+ readonly pageSize?: number;
602
+ /** Mude o valor para forçar recarga (ex.: depois de salvar no editor). */
603
+ readonly reloadKey?: number;
604
+ /** Guarda busca, aba, tags, página, tamanho e ordem na query string. */
605
+ readonly syncUrl?: boolean;
606
+ readonly renderDateTimeInput?: RenderDateTimeInput;
607
+ readonly renderSelect?: RenderSelect;
608
+ /** Ausente: sem exportação. Opt-in do host, na barra do título. */
609
+ readonly renderExport?: (context: ListExportContext) => ReactNode;
610
+ };
611
+ declare function PostList({ onSelect, onCreate, pageSize, reloadKey, syncUrl, renderDateTimeInput, renderSelect, renderExport, }: PostListProps): react.JSX.Element;
612
+
521
613
  type ContentWorkspaceProps = {
614
+ /** Repassado à lista: botão de exportação do host (opt-in). */
615
+ readonly renderExport?: PostListProps['renderExport'];
522
616
  readonly pageSize?: number;
523
617
  /** Valores iniciais do post novo (ex.: autor logado). */
524
618
  readonly newPostDefaults?: Partial<PostDraft>;
@@ -532,21 +626,7 @@ type ContentWorkspaceProps = {
532
626
  /** Barra de formatação do corpo do post (padrão: ligada). */
533
627
  readonly showFormattingToolbar?: boolean;
534
628
  };
535
- declare function ContentWorkspace({ pageSize, newPostDefaults, onPostSaved, renderDateTimeInput, renderSelect, syncUrl, showFormattingToolbar, }: ContentWorkspaceProps): react.JSX.Element;
536
-
537
- type PostListProps = {
538
- readonly onSelect: (post: PostSummary) => void;
539
- /** Ausente: sem botão "Novo post". */
540
- readonly onCreate?: () => void;
541
- readonly pageSize?: number;
542
- /** Mude o valor para forçar recarga (ex.: depois de salvar no editor). */
543
- readonly reloadKey?: number;
544
- /** Guarda busca, aba, tags, página, tamanho e ordem na query string. */
545
- readonly syncUrl?: boolean;
546
- readonly renderDateTimeInput?: RenderDateTimeInput;
547
- readonly renderSelect?: RenderSelect;
548
- };
549
- declare function PostList({ onSelect, onCreate, pageSize, reloadKey, syncUrl, renderDateTimeInput, renderSelect, }: PostListProps): react.JSX.Element;
629
+ declare function ContentWorkspace({ pageSize, newPostDefaults, onPostSaved, renderDateTimeInput, renderSelect, syncUrl, renderExport, showFormattingToolbar, }: ContentWorkspaceProps): react.JSX.Element;
550
630
 
551
631
  type PostEditorProps = {
552
632
  /** Ausente: post novo. */
@@ -635,13 +715,17 @@ declare function EmojiPicker({ onPick, onClose }: EmojiPickerProps): react.JSX.E
635
715
  * `<input type="file">` nativo mostra o idioma do navegador e não aceita estilo).
636
716
  */
637
717
  type FilePickerProps = {
638
- readonly buttonLabel: string;
639
- readonly emptyLabel: string;
718
+ readonly labels: {
719
+ readonly button: string;
720
+ readonly empty: string;
721
+ };
640
722
  readonly accept: string;
641
723
  readonly isBusy?: boolean;
642
- readonly onPick: (file: File) => void;
724
+ /** Com vários, o `onPick` recebe todos de uma vez e o campo mantém o texto vazio (dica). */
725
+ readonly isMultiple?: boolean;
726
+ readonly onPick: (files: readonly File[]) => void;
643
727
  };
644
- declare function FilePicker({ buttonLabel, emptyLabel, accept, isBusy, onPick }: FilePickerProps): react.JSX.Element;
728
+ declare function FilePicker({ labels, accept, isBusy, isMultiple, onPick }: FilePickerProps): react.JSX.Element;
645
729
 
646
730
  type StatusChipProps = {
647
731
  readonly status: PostStatus;
@@ -948,4 +1032,4 @@ declare function buildPageItems(params: {
948
1032
  readonly siblings?: number;
949
1033
  }): PageItem[];
950
1034
 
951
- export { type AsyncResource, COVER_MAX_BYTES, COVER_MIME_TYPES, type ContentAdminApi, type ContentLocale, type ContentMessages, ContentProvider, type ContentProviderProps, type ContentPublicApi, type ContentText, ContentWorkspace, type ContentWorkspaceProps, DEFAULT_CONTENT_LOCALE, DRAFT_ERROR, type DateTimeInputProps, type DraftErrorField, EMOJI_BY_CATEGORY, EMOJI_CATEGORIES, EMPTY_POST_DRAFT, type EditorFeedback, EmojiPicker, type EmojiPickerProps, FilePicker, type FilePickerProps, type LinePrefixKind, type ListPostsParams, type ListPublishedPostsParams, type ListUrlState, MarkdownContent, type MarkdownContentProps, MarkdownEditor, type MarkdownEditorProps, PAGE_SIZE_OPTIONS, POST_LIST_TAB, type PageItem, Pagination, type PaginationProps, PostCard, type PostCardProps, type PostDraft, PostEditor, type PostEditorProps, type PostEditorState, PostList, type PostListFilters, PostListPage, type PostListPageProps, type PostListProps, type PostListTab, type PostMeta, PostPage, type PostPageProps, type RenderDateTimeInput, type RenderLink, type RenderLinkProps, type RenderSelect, SHARE_NETWORK, SHARE_NETWORKS, type SelectInputProps, ShareButtons, type ShareButtonsProps, type ShareLink, type ShareNetwork, StatusChip, type StatusChipProps, TagsInput, type TagsInputProps, type TextSelection, Tooltip, type TooltipProps, type UploadImageResult, buildPageItems, buildPostMeta, buildShareLinks, deriveSlug, draftFromPost, draftToInput, formatPostDate, fromDateTimeLocalValue, insertImage, insertLink, insertText, interpolate, isDraftDirty, parseListUrlState, resolveContentMessages, searchEmoji, serializeListUrlState, splitTagInput, toDateTimeLocalValue, toggleLinePrefix, toggleWrap, useAsyncResource, useContentAdminApi, useContentPublicApi, useContentText, usePostEditor, usePostList, useRenderLink, useUnsavedChangesGuard, validateDraft };
1035
+ export { type AsyncResource, COVER_MAX_BYTES, COVER_MIME_TYPES, type ContentAdminApi, type ContentLocale, type ContentMessages, ContentProvider, type ContentProviderProps, type ContentPublicApi, type ContentText, ContentWorkspace, type ContentWorkspaceProps, DEFAULT_CONTENT_LOCALE, DRAFT_ERROR, type DateTimeInputProps, type DraftErrorField, EMOJI_BY_CATEGORY, EMOJI_CATEGORIES, EMPTY_POST_DRAFT, type EditorFeedback, EmojiPicker, type EmojiPickerProps, FilePicker, type FilePickerProps, type LinePrefixKind, type ListExportContext, type ListPostsParams, type ListPublishedPostsParams, type ListUrlState, MarkdownContent, type MarkdownContentProps, MarkdownEditor, type MarkdownEditorProps, PAGE_SIZE_OPTIONS, POST_LIST_TAB, type PageItem, Pagination, type PaginationProps, PostCard, type PostCardProps, type PostDraft, PostEditor, type PostEditorProps, type PostEditorState, PostList, type PostListFilters, PostListPage, type PostListPageProps, type PostListProps, type PostListTab, type PostMeta, PostPage, type PostPageProps, type RenderDateTimeInput, type RenderLink, type RenderLinkProps, type RenderSelect, SHARE_NETWORK, SHARE_NETWORKS, type SelectInputProps, ShareButtons, type ShareButtonsProps, type ShareLink, type ShareNetwork, StatusChip, type StatusChipProps, TagsInput, type TagsInputProps, type TextSelection, Tooltip, type TooltipProps, type UploadImageResult, buildPageItems, buildPostMeta, buildShareLinks, deriveSlug, draftFromPost, draftToInput, formatPostDate, fromDateTimeLocalValue, insertImage, insertLink, insertText, interpolate, isDraftDirty, parseListUrlState, resolveContentMessages, searchEmoji, serializeListUrlState, splitTagInput, toDateTimeLocalValue, toggleLinePrefix, toggleWrap, useAsyncResource, useContentAdminApi, useContentPublicApi, useContentText, usePostEditor, usePostList, useRenderLink, useUnsavedChangesGuard, validateDraft };