Skip to content

Releases

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 09:49
4614c65

Minor Changes

  • a6232da: Added: a "Shown fields" menu next to a list's filters hides and shows fields in every layout — table, cards, board, calendar, gallery, items, split — instead of only a table's columns, one table at a time

    • views.list.fields: { toggle, persist, hidden }: the menu (on by default), where the choice is kept ("local" or false), and the fields hidden until the reader shows them.
    • Fields are data keys, nested ones included: hiding user hides user.name; user.email can be hidden alone.
    • <Field name="price">…</Field> and useFieldVisible("price") let a list component of your own follow the menu; useFieldVisibility() reads and changes the whole choice.
    • The choice is kept per resource, shared by its layouts, through the new fieldVisibility port of configurePorts (read, write, optional subscribe): localStorage by default, SSR-safe, or an API.
    • The table's "Properties" menu keeps the column order; the columns hidden there before are carried over to the new store the first time the list opens.
    • Saved views and presets remember the fields hidden as hiddenFields; a view saved with columns.hidden still applies it.

v2.1.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 19:56
1613ad5

Minor Changes

  • dc3301a: Added: layout.table({ virtualize }) draws only the rows on screen past 200 rows, instead of mounting every row of the page — a table of thousands of records opens, scrolls and restyles like one of fifty

    • On by default above 200 rows; virtualize: true always, virtualize: false never, { threshold, overscan } sets the number of rows and how many are drawn beyond each edge of the screen (8 by default).
    • The table stays a <table>: the rows off screen are spacer rows of their measured height, the header and the pinned cells are untouched, and column widths are held while scrolling.
    • Groups (folded or not) and views opened inline under a row are virtualized as one flat list.
    • Select all and bulk actions work on every record of the page, drawn or not; ↑ / ↓ and Ctrl+Home / Ctrl+End move to another row and scroll to it; the table carries aria-rowcount and each row its aria-rowindex.
    • New dependency: @tanstack/react-virtual.

Patch Changes

  • f8f91bf: Changed: the built-in components no longer compile to selectors that make Chrome restyle the whole page when a window opens or closes, instead of :has() placed before the element it styles and ~ between any two slots

    • Applications scanning react-resource-view/dist with @source no longer get group-has-*, has-[…]:*: or has-[…]:[&>…]: rules (field, checkbox, item, alert dialog, button group), nor [data-slot] ~ [data-slot] (button group). On a page of tens of thousands of nodes, each of them cost hundreds of milliseconds per opening or closing of a dialog.
    • The same rules are written with a class as the subject, the :has() on the styled element itself, or :nth-child(n + 2 of [data-slot]): the components look the same, at the same specificity or higher.
    • An application that worked around these classes with @source not inline(…) can drop that workaround.

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 16 Nov 08:26
588d370

Major Changes

  • b7c6b83: Breaking: the index no longer re-exports the internal helpers nor the testing tools: these names can no longer be imported from react-resource-view, their code stays in its module

    Removed from the index, to be released with version 2.0.0:

    • onResourceViewDefaultsChange (marked @internal) and getRegisteredOpenFrames
    • BUILT_IN_OPEN and resolveOpen
    • adoptResources and useInlineClaim
    • writeOptimistically, isOptimistic and notifyWriteError
    • joinPath, appendBracketParam and flattenStrapiRecord
    • PermissionCacheContext
    • resetApiConfig, for tests
    • Header and ContentList, internal components of the list view (names that collided with the router's)

    None of these names is used by the documentation or the website. @internal declarations no longer appear in the published .d.ts files (stripInternal). A test now freezes the list of public exports: any addition or removal changes it.

Minor Changes

  • 150902e: Added: commandPalette on AdminLayout / createAdminLayout opens a Cmd+K / Ctrl+K palette built from the scope — go to a menu entry, start a creation — and lists only what the resources permit, instead of leaving the back office without keyboard navigation.

    • commandPalette: { searchable: true } also looks records up by the titleField of each resource, sent as a filter like the list's own.
    • The palette is a role="dialog" holding a combobox and a listbox; Escape closes it.
  • 51a6912: Changed: afterSave: "read" on views.create and views.update leads to the page of the saved record, and useFormByResource fills the form itself when the record arrives, instead of a view copying the synchronisation of EditView

    • "read" is accepted by the development validation next to "close", "stay" and "reload".
    • A form handed a data of its own (a row of a list) keeps that record and is not refilled.
  • 5fb8020: Changed: layout.board({ groupBy: "status" }) draws one column per option of the form's status input, instead of asking for columns next to the options it already declares

    • columns stays available to reorder the columns or show only some of them.
    • In development, a board without columns is refused only when the input it groups by has no options to read them from.
  • 37179f8: Added: layout.board({ columns }) accepts a function ({ viewResourceContext, rows, defaults }) => columns, read again at each render, and hideEmpty (on the board or on a column) hides the columns holding no card except while a card is dragged, instead of replacing the whole board list component to do either

    • defaults are the options of the form's input the board groups by.
    • "Move to…" still lists every column, hidden or not.
  • 6d40944: Changed: below sm, the calendar's month view shows the initials of the days, one dot per event and the list of the tapped day underneath, instead of titles cut to "02:" in 44 px cells.

  • f5a2886: Changed: layout.cards({ frame: false }) draws components.row on its own, without border, padding or actions footer, and actions: false removes the actions footer of a framed card, instead of always wrapping the row in a card of its own

    • A row component that already draws its own card no longer gets a double frame; selection and opening keep working.
    • The codemod writes frame: false on cards whose cardViewOptionFactory had a rowComponent.
  • 82bd6e2: Added: createPage("help", { name, icon, component }) declares a page without data (a home, a help, a dashboard): a menu entry and a route to a component, with no create, read, update or delete route and no request to the API, instead of a createViewResource with every permission turned off and a fake getCollection.

    • migrate writes a 0.x resource made only of a name, an icon and a viewComponent as createPage, and no longer reports RV1-PERM-002 on it.
  • 029a3d9: Changed: in development, a tab with neither resource nor component or whose resource is an unknown id, a layout.chart() with neither groupBy nor dateField and a layout.cards({ columns }) outside 1 to 6 throw an explicit error, instead of passing silently.

  • 31915ba: Added: ChartAggregate, ChartInterval, BaseJsonLdItemInterface and DefinitionProblem types are exported, as is inspectDefinition, which lists the problems of a declaration without throwing, so it can be tested in CI. The README shows a vitest example.

  • 7f556f2: Added: npx react-resource-view generate resources writes one resource declaration per collection of the OpenAPI schema, instead of leaving every createViewResource to be written by hand after init

    • Reads OpenAPI 3.0/3.1 and Swagger 2.0 (API Platform, FastAPI, Supabase…) from a file or a URL — by default src/api-schema/openapi.json.
    • Writes the path, the form.inputs (enums as selects, IRIs and foreign keys as searchable relations, dates, numbers, booleans), the permissions the exposed operations allow, a table, and a board when an enum named status is among the inputs.
    • Registers the resources in the scope's resources; --only books,authors restricts them, --dry-run lists the files, and no existing file is overwritten without --force.
  • 7b8b0b7: Added: react-resource-view/i18n exports messages, the English reference of every message the library shows, and missingKeys(dictionary), which lists the keys a dictionary leaves untranslated, instead of copying the keys by hand into each project

    • messages is keyed on the English text: messages["Saved"] === "Saved". A dictionary for another language has one entry per key.
    • missingKeys returns the keys without an entry, and those with an empty one. Call it from a test to fail when a new version of the library adds a message your dictionary does not translate.
    • The documentation has an "i18n" page that shows how to merge the catalogue with your own keys.
  • 5ca6970: Added: layout.gallery({ imageField }) draws a grid of cards headed by a picture, for products, articles or profiles

    • imageField is typed on the item and accepts an URL, a data URL, a media object ({ url, name }) or a list of them; a record without an image gets a placeholder, and the pictures load lazily.
    • aspect ("4/3", "1/1", "16/9"), fit ("cover", "contain"), titleField, columns and fields shape the cards.
  • 7744b2b: Changed: below sm, the layout switcher shows the icon of each layout alone (its name stays the tab's accessible name), instead of cutting the last tabs off at 390 px.

  • a0855d0: Changed: an empty list tells "nothing yet" from "nothing matched", draws the resource's own icon and name, and offers to clear the filters when one is active, instead of always saying "Nothing matched your search"

    • New views.list.empty: { icon, title, body, filteredTitle } declares them without a component; icon defaults to the resource's icon, title to "No yet".
    • The create button only shows where permissions.create allows it.
    • components.empty still replaces the whole state.
  • 5d87b71: Added: two media controls, createMediaImageInput (one image: preview, replace, crop, remove) and createMediaFilesInput (a list of documents: name, type, size, preview or icon, download, removal), which keep the file as base64 in the record instead of requiring an upload API

    • Options: accept (MIME types, image/* families or extensions), maxSize, maxFiles, dragAndDrop, crop: { aspect }; a refused file is named under the field with the reason, through react-mini-i18n.
    • store changes what becomes of a file: a data URL by default (storeAsDataUrl), or the URL returned by a function that sends it to the API.
    • components: { dropzone, imagePreview, fileItem } replaces part of the rendering; mediaImageInputControllerFactory and mediaFilesInputControllerFactory set these options once for the whole application.
    • Outside a form, MediaValue shows a thumbnail for an image and an icon with the name for a document: on a detail page, in a table cell (two files then "+N") and on the cards, instead of the raw base64.
  • fba905e: Added: mobileNavMaxItems on AdminLayout / createAdminLayout (4 by default) caps the entries of the mobile bottom bar; the following ones move into the "More" drawer, ahead of footerMenu, and "More" is marked current when the page on screen is one of them.

  • c93ffa0: Changed: a burst of realtime pushes is read once, 250 ms after the last one (realtime: { debounce } to change it), and a read that a newer one replaces, or that the unmount outlives, is aborted: ResourceContext carries a signal that the REST repository passes to fetch, instead of five full reads of the list whose stale answers were only dropped on arrival.

  • 7e51ed8: Added: realtime accepts { subscribe, withCredentials }: the channel is pluggable (Supabase Realtime, SSE, WebSockets), and Mercure reconnects with a growing delay and reads the views again when the hub comes back, instead of closing for good after an HTTP error.

  • 365ffc7: Changed: a hand-written repository answers { items, totalItems } and always receives { id: string }, instead of a JSON-LD collection and an id that was sometimes the item, the IRI or the bare segment

    • getCollection accepts { data: { items, totalItems, nextCursor? } } without a cast; createResourceCollection and JSON-LD collections still work.
    • getItem and removeItem receive { id } and updateItem the record with its id, always the short identifier as a string. A repository that read the @id of the item it was given must read id instead.
    • New idField on the resource: links, keys and selection are built from that field, so the records need no @id.
  • f454c8e: Added: restDialect describes a common REST API through configuration (X-Total-Count, Link header, cursor paginati...

Read more

v1.2.2

Choose a tag to compare

@github-actions github-actions released this 22 Oct 14:36
7c11a8d

Patch Changes

  • a8cad12: docs: the README and the starter written by init link api-dumper at github.com/hermez-agency/api-dumper, where the repository moved

v1.2.1

Choose a tag to compare

@github-actions github-actions released this 22 Oct 14:30
8410f14

Patch Changes

  • 17ca3d1: fix(ui): les dialogs, drawers, popovers et selects s'ouvrent et se ferment en fondu, au lieu d'apparaître et disparaître d'un coup

    • dialog, alert-dialog, popover et select s'animaient avec animate-in, fade-in-0, zoom-in-95 et slide-in-from-*. Ces classes ne viennent pas de Tailwind : elles appartiennent à tailwindcss-animate / tw-animate-css, qui n'est ni installé ni importé — elles ne généraient donc aucun CSS. Elles sont remplacées par des transitions sur opacity et scale, pilotées par les attributs data-starting-style / data-ending-style de Base UI, comme le fait déjà drawer. Rien à installer côté application : ce sont des utilitaires Tailwind de base.
    • Une vue ouverte en dialog ou en drawer n'animait ni son entrée ni sa sortie, quel que soit le CSS : le cadre était monté déjà ouvert, et la fermeture changeait l'URL, donc le démontait, avant que la transition ait pu démarrer. Il s'ouvre maintenant juste avant que la page soit peinte sans lui, et l'URL ne change qu'une fois la transition de sortie terminée.
    • Le popup d'un select aligné sur son déclencheur (alignItemWithTrigger, la valeur par défaut) reste sans animation : l'élément sélectionné y est posé sur le bouton, et le faire grandir l'en ferait glisser.

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 10:45
667c5a9

Minor Changes

  • 3fd769d: feat(admin): un hôte configure le layout d'admin par ses options, au lieu de le corriger de l'extérieur

    • Le menu d'un scope garde les getters de ses entrées : un nom qui suit la langue, un lien qui suit le dernier choix du lecteur, sont relus à chaque dessin au lieu d'être figés au chargement du scope.
    • MenuItemInterface.badge : un composant dessiné au bout de l'entrée (un compteur), sans remplacer l'entrée par un component qui refait son lien et son état actif. useIsActiveMenuEntry est exporté pour les entrées qui en ont quand même un.
    • La barre du bas d'un téléphone porte data-slot="admin-mobile-nav" et aria-current, et ses entrées se partagent sa largeur au lieu de défiler de côté.
    • SidebarInset est min-w-0 : une vue fullWidth plus large que l'écran ne pousse plus la barre du haut hors de l'écran.
    • Le fil d'Ariane se coupe à la place que lui laisse la barre, au lieu de passer sous son extrémité.
    • L'icône d'une liste s'aligne sur son titre (data-slot="list-header-title"), et les cartes d'une colonne de board portent data-slot="board-column-cards".
    • Le bouton « créer » d'une liste prend le reste de sa ligne sur téléphone, à côté du sélecteur de layout, au lieu d'une ligne à lui.
    • La barre de filtres n'élargit plus son contenu à fit-content : des filtres de l'application qui passent à la ligne y passent à la largeur de la liste.
    • Une vue ouverte en dialog ne dépasse plus la hauteur de l'écran : le titre garde sa ligne, le contenu défile dans le reste.
  • 941d036: feat(views): the list's export button offers CSV and JSON and reads every page itself, instead of downloading a server CSV

    • The rows are read page by page through the resource's repository, with the list's current filters and sort, so the export works on any dialect — Strapi and local storage included — and the button shows how many rows have been read so far.
    • Only the columns the table shows are exported. CSV cells holding commas, quotes or line breaks are quoted, and the file opens in Excel with its accents intact; JSON keeps the raw values.
    • dialect.exportRequest is no longer used by the button.
  • dccab91: feat(views): the table's columns are shown, hidden and reordered from a "Properties" menu, as in Notion, without touching the declaration

    • A box per column shows or hides it, a handle drags it elsewhere (Alt + ↑ / ↓ from the keyboard); the table keeps one column at least.
    • The choice is kept in localStorage, per resource and per layout (react-resource-view:columns:<resource>:<layout>). The declaration stays the default: "Reset to default" forgets the choice, and a field added to the form later appears where it is declared.
  • f71220b: feat(views): Shift+click on column headers sorts a table on several columns, with their rank shown, instead of replacing the sort

    • A plain click still goes ascending, descending, then no sort, on that column alone; Shift+click keeps the other sorted columns and queues the clicked one behind them (a column already sorted keeps its rank while its direction moves on).
    • Once two columns or more are sorted, each header shows its rank next to the arrow. The sort stays in the URL and goes to the API as order[field]=asc|desc, in that order.

Patch Changes

  • 5bd5cd4: fix: the react-data-form and react-mini-i18n peers accept their current releases (^0.3.0, ^0.1.0 || ^0.2.0), so pnpm add react-resource-view react-data-form react-mini-i18n resource-registry installs them instead of react-data-form 0.1.0

    • In 0.x a caret pins the minor: ^0.1.0 ruled out react-data-form 0.2 and 0.3 and react-mini-i18n 0.2, which only add features. init writes the same ranges into a new starter.
    • react-mini-i18n keeps ^0.1.0 alongside ^0.2.0: react-data-form 0.3.0 still asks for ^0.1.0, and npm would otherwise refuse the install with ERESOLVE.

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 19 Oct 13:57
a1b4c67

Minor Changes

  • d3a7625: refactor: the optional react-resource-view/styles.css theme now follows the Hermez design system, not shadcn's neutral greys

    Visible only to applications that import the library's stylesheet; an application with its own shadcn variables sees nothing change.

    • Colours: warm "stone" greys (background #fafaf9, cards #ffffff, text #1c1917, secondary text #57534e, borders #e7e5e4, fields #d6d3d1), an orange primary #bf4a02 under white text, the brand orange #e46212 as focus ring, and #fff6ee as highlight. The .dark block keeps the same hue (background #0c0a09, primary #ff8b44). The destructive red is #b91c1c, so the destructive button reaches 4.5:1.
    • New tokens: --success, --info, --glory and --warning (the success, info, glory and warning buttons and badges had no colour until now), --chart-1 to --chart-5, and the typography variables --typeface-heading, --typeface-body, --typeface-mono, --heading-weight, --heading-tracking (with font-heading, font-sans and font-mono mapped to them).
    • Radius: --radius goes from 0.875rem to 0.75rem, and --radius-2xl to --radius-4xl now derive from it — buttons, selects and badges stay pills, slightly tighter, and follow a custom --radius.
    • Shadows: shadow-sm, shadow-md and shadow-lg are tinted with the theme's text colour, lighter than Tailwind's.
    • No font is shipped and no rule restyles the application's headings: --typeface-heading names Bricolage Grotesque, used only if the application loads it. The variables stay in @layer base, so the application's own still win.

Patch Changes

  • c0e4eb4: fix(views): the table keeps its row actions in sight when it is wider than the screen, instead of pushing them out of view

    • The actions column and its header are position: sticky on the right edge, opaque, with a shadow on their left; the buttons are at least 40 px wide and tall. A fade on the table's edges tells that columns are hidden on that side.
    • layout.table({ stickyActions: false }) leaves the actions in the flow; layout.table({ stickyFirstColumn: true }) also pins the first column to the left.

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 16 Oct 10:36
56575bb

Major Changes

  • 60d41c1: 1.0: a declaration that reads once and makes sense without the documentation.
    Breaking changes, each one rewritten by npx react-resource-view migrate or
    explained step by step in MIGRATION-1.0.md; migrations/1.0.json is the same
    list as data, for a script or an AI to apply.

    • One place per notion. view is gone: what every action shares — form,
      fullWidth, titleField, components, description — sits at the root of
      the resource; what belongs to one action sits in views.list | read | create | update | delete, each typed with only the options that have an effect there.
      Root, action and layout are merged deeply, so views.update says only what
      differs, and inputs: { notes: false } removes an inherited field. Actions
      are plain strings (views.update, rowActions: ["read"]); ActionList is
      still accepted.
    • Permissions. canRead, canList, canCreate, canUpdate, canDelete
      and behavior.canExport become one permissions object — "all",
      "readonly", a list of actions, or a boolean or a function per action.
      Everything is allowed by default, so the shortest declaration has all its
      buttons. A function is told the record (({ item }) => item.status !== "done")
      and may answer asynchronously; answers are cached per record while a list is
      on screen. A refused action also protects its route: /books/update/1 draws
      the scope's forbiddenFallback instead of the form. canList is now read for
      the list (it was ignored). usePermission(action, item) and
      useAllowedActions(actions, item) are added; permissionResource takes
      { item, context } and may return a promise.
    • behavior is gone, each option moved to where it has an effect:
      openIn → views.<action>.open ("page", "dialog", "drawer");
      closeAfterUpdate, refreshDataAfterUpdate, redirectToAfterUpdate → one
      afterSave: "close" | "stay" | "reload" | { redirect: (item) => string };
      rowActions → views.list.rowActions; eventSourced → realtime at the
      root; openRecordIn → views.read.open; selectable, bulkActions →
      views.list.selectable, views.list.bulkActions, for every layout of the
      list (bulkActions also takes "delete").
    • Layouts. viewVariants becomes views.list.layouts, and the seven
      factories one layout namespace: layout.table(), layout.cards({ columns }),
      layout.board({ groupBy, columns }), layout.calendar({ dateField }),
      layout.timeline({ startField, endField, groupBy }), layout.split({ readInList }),
      layout.items() and layout.custom() for one's own (read its options with
      useLayout()). Field options are checked against the resource's item type —
      a typo is a TypeScript error — and share one suffix: titleField,
      dateField, colorField, statusField. A layout's URL id is its type, so a
      new label breaks no shared link; fields picks a layout's columns.
    • Data. Without path, storage: "local" must be declared: a forgotten
      path no longer turns into localStorage silently. preGetCollection,
      preGetItem, preCreate, preUpdate become hooks.beforeList,
      beforeRead, beforeCreate, beforeUpdate, joined by beforeDelete,
      afterSave and afterDelete; hooks may be asynchronous and always receive
      the view context — creations and updates used to lose it on the way to the
      repository. Hand-written repository methods move to repository: { … }.
      limit becomes quota: { get, fallback } (useLimit → useQuota).
    • Titles and components. name is declared once; titles are derived and
      overridden with views.<action>.title, a button's text with buttonLabel.
      viewComponent and the other xxxComponent keys, and decoratorComponent,
      become one components object (view, wrapper, top, bottom, empty
      — ex noResult —, pagination, navigation, title, actions).
    • Tabs. subViewResource becomes views.read | update.tabs: { orientation, aside, items }, a tab being { id, label, resource, filter: ({ item }) => … }
      instead of an onInitViewResource returning the whole context.
    • Scopes and defaults. A resource no longer names its scope: the scope's
      resources ties them, and menu: "auto" (or a list mixing resources, links
      and groups) builds the navigation. setResourceConfig({ defaultResource })
      becomes configureResourceView({ defaults }), merged deeply into every
      resource, including those declared before it is called.
    • Types. ResourceDefinition is what one writes, ViewResource what the
      library builds; ViewResourceInterface, ResourceOptionInterface,
      ViewInterface and the factory option interfaces are replaced.
    • Optimistic writes. Every write going through a resource's repository —
      a form saved, a row deleted, a cell edited in place, a card moved, the
      writes of a bulk action made through its new mutation argument — is drawn
      before the API answers: the row changes at once (a created one appears,
      marked as being saved), the API's answer replaces it as soon as it comes,
      and a refusal puts it back with a toast — a form keeps the API's violations
      on its fields. Several writes to one record show the last one; a list read
      again while a write is in flight (a realtime push) keeps the row as
      written. On by default — a change of perceived behaviour —, turned off with
      optimistic: false at the root or per action
      (views.delete: { optimistic: false }). useResourceMutation(resource)
      gives an application's own actions the same optimism and rollback
      (create, update, remove, mutate, isPending), and RowInterface
      gains pending. Built on the library's own state rather than React 19's
      useOptimistic: no new requirement on the React version.
    • One routed opening. views.<action>.open is resolved once, and anything
      but "page" is written into the URL under the view it was opened from
      (…/tasks/list/tasks/update/12, filter and layout kept): a row's button —
      now a real link —, a board's card and a link typed by hand open the same
      frame, Back closes it, a reload opens it again over the same list, and a
      save closes it by going back to that URL. A list reads itself again once per
      save, instead of once per button of its rows. layout.board({ openRecord, expandable }) is gone: a card opens the record's read view where
      views.read.open says — on its page by default, where it used to open
      nothing.
    • Frames of one's own. open.custom({ type, placement, component }), on
      the model of layout.custom(): the component receives the title, the view,
      close and the link to the full page. placement: "inline" draws the view
      under the row that opened it in a table, a plain list or a card grid — a
      layout.custom() says it can with supports: ["inline"] and draws
      <InlineChildView row={row} /> — and falls back to a dialog elsewhere, with
      a warning in development. configureResourceView({ open: { accordion } })
      registers a frame under a name, typed through the OpenFrames interface.
    • "Open in full page". A read or update view opened in a frame has a
      link to the same view on its page beside the close button, a real
      <a href> that Ctrl/Cmd+click opens in a new tab. expandable: false on
      the view takes it away; create and delete do not have it unless they say
      expandable: true.
    • Checked in development. createViewResource and layout.* throw on a key
      they do not read — with the closest key, or the exact 1.0 rewrite of a 0.x
      one — on a resource with no data source, a board without groupBy, two
      layouts sharing a URL id, and warn about a title identical to the derived
      one. Nothing is checked in production.
    • Command line. npx react-resource-view migrate [paths] rewrites 0.x
      declarations (--dry-run, --check); create-view-variant writes a
      layout.custom() file; init starts on the 1.0 syntax.

Minor Changes

  • 29ce470: feat(views): a list sorts by its column headers, selects its records in every layout and says when it could not load, not only on the board and not with an empty list

    • views.list.sort: { fields, initial }: the table's headers of the fields named sort ascending, then descending, then not at all (aria-sort); the sort goes to the API through the dialect, into the URL, and survives "Clear the search". useSort() gives the same to a layout of one's own.
    • Breaking (1.0): selectable and bulkActions leave layout.board() for views.list, and reach every layout: checkboxes on the table's rows (and "Select all" in its header), the cards and the items. bulkActions accepts "delete", which deletes the selection after a confirmation, as far as permissions.delete allows. selectable defaults to true on a board and wherever bulk actions are declared. npx react-resource-view migrate rewrites both (RV1-BEHAV-006, RV1-LAYOUT-014).
    • A view whose records could not be loaded draws what the API answered and "Try again" (components.error replaces it), rather than "An error occurred" in a list, or an empty form that could be saved over the record. loadError on the view context holds what the request threw.
  • e7e7654: Moving to another view shows that the click was heard, instead of nothing until
    the next view appears at once: a thin bar runs along the top of the screen, in
    the theme's primary colour, until the new view has its data, and the view fades
    in, sliding up a few pixels. No new dependency.

    • The bar waits 150 ms, so an instant navigation flashes nothing, then stays
      300 ms at least; it runs quickly, then slower, and fills up when the view is
      there. The loading view is marked aria-busy, the b...
Read more

v0.15.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 13:32
b059285

Minor Changes

  • b1f8272: Open a card of a board, select several and move them together, instead of only
    dragging one card at a time onto a column.

    • behavior.openRecordIn ("drawer", "popup" or "window") makes the whole
      card clickable — hover and focus states, Enter from the keyboard — and opens
      the record's read view: in a panel on the right or a dialog, both written
      into the URL as a child view of the list (…/tasks/list/tasks/read/12, which
      parseLink now reads), so the link is shareable and Back closes it; or on
      the record's own page, through generateLink. The panel has a way to edit the
      record, traps the focus and gives it back to the card.
    • A button, a link, a menu, a checkbox or a drag handle drawn in a card keeps
      its click, without any stopPropagation: the card only opens on a click that
      lands on none of them (data-card-control marks anything else), and not when
      text is being selected.
    • Cards can be selected — checkbox, Ctrl/Cmd+click, Shift+click for a range, a
      long press on a phone, Escape to clear — and a bar offers "Move to…",
      behavior.bulkActions and "Deselect all". Dragging a selected card moves the
      whole selection under an "N cards" preview. Each record is updated through
      the repository and drawn in its new column at once; one that fails goes back,
      and a message says how many could not be moved. behavior.selectable: false
      turns selection off.
    • Each column scrolls on its own, and an empty column shows where to drop.
  • d970551: Add a Django REST Framework dialect: djangoDialect() reads DRF's
    { count, next, previous, results } page (or a bare array when the view has no
    paginator), pages with page / page_size — or limit / offset with
    pagination: "limit-offset" — sorts with ordering=-field, sends filters as
    query parameters for django-filter, addresses a record at /articles/{id}/ with
    DRF's trailing slash, and pins a 400's { field: ["message"] } on its input.
    Options: primaryKey, pagination, pageSizeParam, defaultItemsPerPage,
    orderParam and trailingSlash.

    npx react-resource-view init -b django starts a back office on it, dumping the
    schema drf-spectacular serves at /api/schema/?format=json.

Patch Changes

  • 9582599: init writes the react-data-form, react-mini-i18n, resource-registry and
    @tanstack/react-router ranges from the package's own peerDependencies, so a
    generated starter installs without --legacy-peer-deps instead of failing with
    ERESOLVE on a hard-coded react-data-form@^0.2.1 against a ^0.1.0 peer.
  • 35a40a9: A record saved from a button opening over a list (openIn: "popup" or
    "drawer") reads the list again with the filter it has now, instead of the one
    the button mounted with — a list filtered on « A », then on « B », no longer
    shows the rows of « A » under « B » after a save. The buttons of every row also
    share a single request instead of each reading the list again.

v0.14.0

Choose a tag to compare

@github-actions github-actions released this 12 Oct 09:17
f7b16c9

Minor Changes

  • 642aac2: Add a FastAPI dialect: fastapiDialect() lists, reads, creates, updates and
    deletes against a standard FastAPI CRUD router, instead of showing empty lists
    under the JSON-LD default.

    A page is skip / limit, as in the FastAPI tutorial, or page / size with
    pagination: "page-size" for fastapi-pagination, whose { items, total }
    drives the page count; a bare array hides the pagination. A sort is
    order_by=-created_at,title, an array filter repeats its parameter, and a 422
    lands under the field its loc names — ["body", "address", "city"] on
    address.city. Options: primaryKey, pagination, defaultItemsPerPage,
    orderParam and trailingSlash.

  • 5dfb920: Add npx react-resource-view init: it starts a back office on your API — API
    Platform, Spring Boot, another REST API, Supabase, Strapi or FastAPI — with the
    dialect wired, the URL in .env, and api-schema / api-schema:check scripts
    that dump the OpenAPI schema into TypeScript with api-dumper.

    Add a Spring Boot dialect: springDialect() pages with page (from 0) and
    size, sorts with sort=field,desc, reads a Page, a PagedModel or Spring
    Data REST's HAL, and pins Bean Validation errors on their field.

Patch Changes

  • ef36d4e: Capitalise the first letter of each view name in the view switcher, so a
    board or vue d'ensemble tab reads Board and Vue d'ensemble, custom and
    translated names included — the rest of the label is left as written.