payload icon indicating copy to clipboard operation
payload copied to clipboard

feat!: removes Drawer reliance on EditDepth

Open JarrodMFlesch opened this issue 5 months ago • 0 comments

  • [x] I have read and understand the CONTRIBUTING.md document in this repository.

Description

This change separates Drawers reliance on EditDepth, and instead uses a new DrawerDepth provider so you can differentiate between the two.

Rendering an <EditDepthProvider> should not change the style of Drawers. Rendering a <DrawerDepthProvider> should. The indentation for drawers should be automatic, no need to set the depth of the drawer by reading the parent drawer depth and adding 1.

<DrawerDepthProvider> and the <EditDepthProvider> no longer take a depth parameter. They are self-contained and will self-increment their own depth based on their parent (which is based on its parent, etc etc up the tree).

Note: it seems like semantically, it would make more sense if <EditDepthProvider> was renamed to <FormDepthProvider>.

BREAKING CHANGES

This only applies to custom usage of Drawers in custom components

  • EditDepthProvider no longer takes a depth prop
  • If you were rendering a EditDepthProvider around your Drawer so the Drawer would have the left indent, you no longer need to do that, so you can remove the EditDepthProvider
  • Drawer Slugs (only important if you were targeting them with CSS or JS)
    • Document Drawer
      • previous: doc-drawer_${collectionSlug}_${depth}_${docID}
      • new: drawer-${depth}_doc-drawer__${collectionSlug}_${docID}
    • List Drawer
      • previous: list-drawer_${depth}_${uuid}
      • new: drawer-${depth}_list-drawer

Type of change

  • [x] Chore (non-breaking change which does not add functionality)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Change to the templates directory (does not affect core functionality)
  • [ ] Change to the examples directory (does not affect core functionality)
  • [ ] This change requires a documentation update

Checklist:

  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] Existing test suite passes locally with my changes
  • [ ] I have made corresponding changes to the documentation

JarrodMFlesch avatar Aug 30 '24 17:08 JarrodMFlesch