Skip to content

Floorplan export: expose exportFloorplanPdf and add a structure+utility scope #619

Description

@Vasily-Zh

Context

We embed the editor in a host app and have been carrying two local patches
against floorplan-export for a while. Both look generic rather than
app-specific, so we'd rather upstream them than keep re-applying them on every
release. Happy to send PRs — this issue is to check the direction first.

1. exportFloorplanPdf is not exported from the package entry

It's only reachable from the built-in Settings panel button. A host that builds
its own UI (different placement, its own label, its own trigger) has no way to
call it. Re-exporting it from src/index.tsx costs nothing and doesn't change
behaviour.

2. A third scope: structure + utility, without furniture

FloorplanExportScope is 'full' | 'structure' today:

  • full — everything, furniture included;
  • structurecategory === 'structure' only, i.e. a bare shell.

An electrician's sheet needs a third one: the shell plus engineering
(category === 'utility' — ducts, pipes, and any host-registered utility node
kinds), without furniture. There is no way to get that today, and marking a
utility node as 'structure' to force it in is a semantic lie that leaks into
palette, layers and filters.

The filter change is one clause:

(scope === 'full' ||
  def.category === 'structure' ||
  (scope === 'routing' && def.category === 'utility'))

3. (lower confidence) Host content on the exported sheet

We also patch in three host-provided extras, and these are more opinionated —
listing them only in case they're of interest:

  • a disclaimer line printed at the bottom of every plan page (sheets get
    printed and handed out one at a time, so a note on the title page alone
    doesn't travel);
  • extra pages after the plans (legend, schedules) rendered from host-supplied
    blocks;
  • an overlay geometry per level, drawn with the same placement/viewport as the
    plan — we use it for room labels, since our rooms live in host metadata
    rather than as scene nodes.

If any of this is welcome, say which parts and we'll open focused PRs.

Version

@pascal-app/editor@1.0.0-beta.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions