How does Joplin Cloud hanle encryption when Note or Notebook is shared?

Yes it's the same principle. If you share the note, E2EE no longer applies to that note.

I'm planning to add support for E2EE for shared notes and notebooks, but first I need to improve how E2EE works (started here)