Hiyve Components - v1.0.0
    Preparing search index...

    Function collectEmbeddedFileIds

    • Walk a TipTap JSON document and collect every assignmentEmbed node's fileId. Returns a deduplicated, insertion-ordered list.

      Use this to discover which files an assignment references inline so they can be shared with assignees, fetched, or pre-loaded alongside the assignment file itself.

      Parameters

      • content: JSONContent | null | undefined

        The AssignmentFile's content JSON (or any TipTap node). Safely handles null/undefined and non-tree shapes.

      Returns string[]

      Array of unique fileIds in document order. Empty when there are no embeds, no fileIds, or the input isn't a node tree.

      const fileIds = collectEmbeddedFileIds(assignment.content);
      // ['file-abc123', 'file-def456']