@unityevolv/ofiskit-ui-builder 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { type AmbienceTrack, type CanvasShape, type Template } from '@unityevolv/ofiskit-template';
2
2
  import { type ReactNode } from 'react';
3
3
  import { type BackgroundImages } from './background/BackgroundStep.js';
4
- import type { PromptDocument } from './prompt/prompt.js';
4
+ import type { OfficePrompt, PromptDocument } from './prompt/prompt.js';
5
5
  /**
6
6
  * The whole builder, as three steps: the prompt, the background, the rooms.
7
7
  *
@@ -14,9 +14,20 @@ import type { PromptDocument } from './prompt/prompt.js';
14
14
  * undo history are all where they were left. The one thing that does start
15
15
  * again is the layout, and only when the shape changes, because every room is
16
16
  * placed relative to it.
17
+ *
18
+ * A picture that carries its rooms (an SVG drawn to the office convention) is
19
+ * the other way the layout starts: the rooms step opens with them placed, and
20
+ * says so, with a way back to a blank layout for an author who would rather
21
+ * draw.
17
22
  */
18
23
  export interface BuilderStepsProps {
19
24
  document: PromptDocument;
25
+ /**
26
+ * The prompts that ask an assistant for an office drawn to the SVG
27
+ * convention, one per theme and view. Absent, and the prompt step offers
28
+ * only the picture prompt.
29
+ */
30
+ officePrompts?: readonly OfficePrompt[];
20
31
  /** What the host's save button says. Download here; Save elsewhere. */
21
32
  saveLabel: string;
22
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BuilderSteps.d.ts","sourceRoot":"","sources":["../src/BuilderSteps.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;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KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;IAC7D,YAAY,CAAC,EAAE,WAAW,CAAA;IAC1B,sFAAsF;IACtF,eAAe,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;CAC3C;AA+BD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAgPpD"}
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Alert, Button, Icon, Stepper } from '@unityevolv/unitykit';
3
3
  import { createTemplate, } from '@unityevolv/ofiskit-template';
4
4
  import { useEffect, useRef, useState } from 'react';
5
5
  import { OfficeBuilder } from './OfficeBuilder.js';
6
- import { BackgroundStep } from './background/BackgroundStep.js';
6
+ import { BackgroundStep, } from './background/BackgroundStep.js';
7
+ import { describeFound, fillAreas } from './background/officeImport.js';
7
8
  import { PromptStep } from './prompt/PromptStep.js';
8
9
  /*
9
10
  * Horizontal at every width, with the descriptions dropped on a phone: stacked
@@ -32,35 +33,67 @@ export function BuilderSteps(props) {
32
33
  // What the files are called beside template.json, keeping the type each was
33
34
  // uploaded as: an SVG background is office-light.svg, not a .webp name.
34
35
  const [files, setFiles] = useState({ light: 'office-light.webp', dark: 'office-dark.webp' });
36
+ // The same names, readable in the same event they changed in: the background
37
+ // step reports the image and then, straight after, the rooms it carried.
38
+ const latestFiles = useRef(files);
35
39
  // Images are checked against the shape, so a new shape needs them again. The
36
40
  // key remounts the step, which clears what it was holding for the old ones.
37
41
  const [backgroundKey, setBackgroundKey] = useState(0);
38
- /** The layout the rooms step opened with; the builder keeps its own edits. */
42
+ /** The rooms the light picture carried, if it carried any. */
43
+ const [office, setOffice] = useState(null);
39
44
  const [layout, setLayout] = useState(null);
40
45
  /** The file names for the template: a dark one only when there is a dark image. */
41
46
  const namesFor = (current) => ({
42
47
  light: current.light,
43
48
  ...(images.dark ? { dark: current.dark } : {}),
44
49
  });
50
+ const blankLayout = () => createTemplate({ name: 'My office', canvas: shape, images: namesFor(latestFiles.current) });
51
+ /** The picture's rooms as a layout: named, on this canvas, every room with an area. */
52
+ const pictureLayout = (carried) => fillAreas({
53
+ ...carried.template,
54
+ name: 'My office',
55
+ canvas: shape,
56
+ images: namesFor(latestFiles.current),
57
+ });
45
58
  const canEnter = (index) => index !== ROOMS || images.light !== null;
46
59
  function go(index) {
47
60
  if (index < PROMPT || index > ROOMS || !canEnter(index))
48
61
  return;
49
62
  if (index === ROOMS && (!layout || layout.template.canvas !== shape)) {
50
63
  setLayout({
51
- template: createTemplate({ name: 'My office', canvas: shape, images: namesFor(files) }),
64
+ template: office ? pictureLayout(office) : blankLayout(),
52
65
  key: (layout?.key ?? 0) + 1,
66
+ fromPicture: office ? office.found : null,
53
67
  });
54
68
  }
55
69
  setStep(index);
56
70
  setReached((current) => Math.max(current, index));
57
71
  }
72
+ /**
73
+ * A new light picture that carries rooms replaces the layout, whatever was
74
+ * drawn: the author chose a file that says where the rooms are. One that
75
+ * carries none leaves the rooms alone, as replacing a picture always has.
76
+ */
77
+ function carried(next) {
78
+ setOffice(next);
79
+ if (next) {
80
+ setLayout({
81
+ template: pictureLayout(next),
82
+ key: (layout?.key ?? 0) + 1,
83
+ fromPicture: next.found,
84
+ });
85
+ }
86
+ }
87
+ function startBlank() {
88
+ setLayout({ template: blankLayout(), key: (layout?.key ?? 0) + 1, fromPicture: null });
89
+ }
58
90
  function changeShape(next) {
59
91
  if (next === shape)
60
92
  return;
61
93
  setShape(next);
62
94
  if (images.light || images.dark) {
63
95
  setImages({ light: null, dark: null });
96
+ setOffice(null);
64
97
  setBackgroundKey((key) => key + 1);
65
98
  setReached((current) => Math.min(current, BACKGROUND));
66
99
  }
@@ -89,14 +122,15 @@ export function BuilderSteps(props) {
89
122
  .join(' ');
90
123
  return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsx("div", { className: "border-b border-base-300 bg-base-100 px-4 py-3", children: _jsx("div", { className: "mx-auto w-full max-w-3xl", children: _jsx(Stepper, { steps: STEPS, current: step, label: "Office builder steps", orientation: "horizontal", onStepClick: go, allowUpcoming: reached > step }) }) }), _jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [_jsx("section", { ref: (node) => {
91
124
  panels.current[PROMPT] = node;
92
- }, tabIndex: -1, hidden: step !== PROMPT, "aria-label": "Prompt", className: "outline-none", children: _jsx(PromptStep, { document: props.document, shape: shape, onShapeChange: changeShape, ...(warning ? { shapeChangeWarning: warning } : {}) }) }), _jsx("section", { ref: (node) => {
125
+ }, tabIndex: -1, hidden: step !== PROMPT, "aria-label": "Prompt", className: "outline-none", children: _jsx(PromptStep, { document: props.document, shape: shape, onShapeChange: changeShape, ...(props.officePrompts ? { officePrompts: props.officePrompts } : {}), ...(warning ? { shapeChangeWarning: warning } : {}) }) }), _jsx("section", { ref: (node) => {
93
126
  panels.current[BACKGROUND] = node;
94
127
  }, tabIndex: -1, hidden: step !== BACKGROUND, "aria-label": "Background", className: "outline-none", children: _jsx(BackgroundStep, { document: props.document, shape: shape, images: images, onImage: (slot, url, fileName) => {
128
+ latestFiles.current = { ...latestFiles.current, [slot]: fileName };
95
129
  setImages((current) => ({ ...current, [slot]: url }));
96
- setFiles((current) => ({ ...current, [slot]: fileName }));
97
- } }, backgroundKey) }), _jsx("section", { ref: (node) => {
130
+ setFiles(latestFiles.current);
131
+ }, onOffice: carried }, backgroundKey) }), _jsx("section", { ref: (node) => {
98
132
  panels.current[ROOMS] = node;
99
- }, tabIndex: -1, hidden: step !== ROOMS, "aria-label": "Rooms", className: "outline-none", children: layout && (_jsxs(_Fragment, { children: [props.saveHint && (_jsx(Alert, { variant: "info", className: "mx-4 mt-4", children: props.saveHint(namesFor(files)) })), _jsx(OfficeBuilder, { template: layout.template, imageUrl: images.light, darkImageUrl: images.dark, saveLabel: props.saveLabel,
133
+ }, tabIndex: -1, hidden: step !== ROOMS, "aria-label": "Rooms", className: "outline-none", children: layout && (_jsxs(_Fragment, { children: [layout.fromPicture && (_jsxs(Alert, { variant: "info", className: "mx-4 mt-4", children: [_jsxs("span", { children: [describeFound(layout.fromPicture), " They are placed for you; check the user areas and save, or", ' '] }), _jsx(Button, { size: "sm", variant: "ghost", onClick: startBlank, children: "start blank instead" })] })), props.saveHint && (_jsx(Alert, { variant: "info", className: "mx-4 mt-4", children: props.saveHint(namesFor(files)) })), _jsx(OfficeBuilder, { template: layout.template, imageUrl: images.light, darkImageUrl: images.dark, saveLabel: props.saveLabel,
100
134
  // The names as they are now, not as they were when the layout
101
135
  // opened: the images may have been replaced since.
102
136
  onSave: (finished) => props.onSave({ ...finished, images: namesFor(files) }, images), onPickImage: () => go(BACKGROUND), ...(props.ambienceLibrary ? { ambienceLibrary: props.ambienceLibrary } : {}) }, layout.key)] })) })] }), _jsxs("nav", { "aria-label": "Builder steps", className: "flex items-center gap-2 border-t border-base-300 bg-base-100 px-4 py-2", children: [step > PROMPT && (_jsxs(Button, { size: "sm", variant: "ghost", onClick: () => go(step - 1), children: [_jsx(Icon, { name: "chevron-left", size: "sm" }), " Back"] })), step === BACKGROUND && !images.light && (_jsx("span", { className: "ml-auto text-xs text-base-content/70", children: "Add a background image to continue." })), step < ROOMS && (_jsxs(Button, { size: "sm", className: step === BACKGROUND && !images.light ? '' : 'ml-auto', disabled: !canEnter(step + 1), onClick: () => go(step + 1), children: ["Next: ", STEPS[step + 1]?.label, _jsx(Icon, { name: "chevron-right", size: "sm" })] }))] })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"BuilderSteps.js","sourceRoot":"","sources":["../src/BuilderSteps.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EACL,cAAc,GAIf,MAAM,8BAA8B,CAAA;AACrC,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IAAI,IAAC,IAAI,EAAC,eAAe,EAAC,IAAI,EAAC,IAAI,GAAG,IAChC,CACV,IACG,IACF,CACP,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OfficeBuilder.d.ts","sourceRoot":"","sources":["../src/OfficeBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,QAAQ,EAEd,MAAM,8BAA8B,CAAA;AAYrC;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IAChC,uEAAuE;IACvE,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;CAC3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAgItD"}
1
+ {"version":3,"file":"OfficeBuilder.d.ts","sourceRoot":"","sources":["../src/OfficeBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,QAAQ,EAEd,MAAM,8BAA8B,CAAA;AAarC;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IAChC,uEAAuE;IACvE,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;CAC3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAoItD"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { validateTemplate, withAvatarSize, } from '@unityevolv/ofiskit-template';
3
3
  import { useMemo, useState } from 'react';
4
+ import { edgeWarnings } from './background/officeImport.js';
4
5
  import { BuilderCanvas } from './canvas/BuilderCanvas.js';
5
6
  import { useHistory } from './history.js';
6
7
  import { AreaInspector } from './panel/AreaInspector.js';
@@ -18,6 +19,9 @@ export function OfficeBuilder(props) {
18
19
  const [unfitted, setUnfitted] = useState([]);
19
20
  const validation = useMemo(() => validateTemplate(template), [template]);
20
21
  const issues = validation.ok ? [] : validation.issues;
22
+ // A room against the canvas edge is allowed; it is told that a festival
23
+ // frame, when an org turns one on, covers that strip.
24
+ const notes = useMemo(() => edgeWarnings(template), [template]);
21
25
  const room = selection.kind !== 'none' && 'roomId' in selection
22
26
  ? template.rooms.find((candidate) => candidate.id === selection.roomId)
23
27
  : undefined;
@@ -50,6 +54,6 @@ export function OfficeBuilder(props) {
50
54
  ? 'Drag on the canvas to draw a room.'
51
55
  : tool === 'area'
52
56
  ? 'Drag inside a room to draw a user area. It snaps to whole avatar cells.'
53
- : 'Click to select. Drag a room to move it, or its bottom-right corner to resize.' })] }), _jsxs("aside", { className: "flex min-w-0 flex-col gap-4 overflow-y-auto", "aria-label": "Builder controls", children: [_jsx(ToolBar, { template: template, tool: tool, onTool: setTool, onUndo: history.undo, onRedo: history.redo, canUndo: history.canUndo, canRedo: history.canRedo, onAvatarSize: changeAvatarSize, unfitted: unfitted, onSelect: setSelection, showGhosts: showGhosts, onShowGhosts: setShowGhosts, ...(props.darkImageUrl ? { showDark, onShowDark: setShowDark } : {}), ...(props.onPickImage ? { onPickImage: props.onPickImage } : {}) }), _jsxs("section", { className: "border-t border-base-300 pt-3", children: [room && selection.kind === 'room' && (_jsx(RoomInspector, { template: template, room: room, ...(props.ambienceLibrary ? { ambienceLibrary: props.ambienceLibrary } : {}), onChange: history.set, onSelect: setSelection })), room && area && selection.kind === 'area' && (_jsx(AreaInspector, { template: template, room: room, area: area, onChange: history.set, onSelect: setSelection })), selection.kind === 'none' && (_jsx(TemplateDetails, { template: template, ...(props.ambienceLibrary ? { ambienceLibrary: props.ambienceLibrary } : {}), onChange: history.set, onSelect: setSelection }))] }), _jsx(SaveBar, { issues: issues, saveLabel: props.saveLabel, onSave: () => props.onSave(template) })] })] }));
57
+ : 'Click to select. Drag a room to move it, or its bottom-right corner to resize.' })] }), _jsxs("aside", { className: "flex min-w-0 flex-col gap-4 overflow-y-auto", "aria-label": "Builder controls", children: [_jsx(ToolBar, { template: template, tool: tool, onTool: setTool, onUndo: history.undo, onRedo: history.redo, canUndo: history.canUndo, canRedo: history.canRedo, onAvatarSize: changeAvatarSize, unfitted: unfitted, onSelect: setSelection, showGhosts: showGhosts, onShowGhosts: setShowGhosts, ...(props.darkImageUrl ? { showDark, onShowDark: setShowDark } : {}), ...(props.onPickImage ? { onPickImage: props.onPickImage } : {}) }), _jsxs("section", { className: "border-t border-base-300 pt-3", children: [room && selection.kind === 'room' && (_jsx(RoomInspector, { template: template, room: room, ...(props.ambienceLibrary ? { ambienceLibrary: props.ambienceLibrary } : {}), onChange: history.set, onSelect: setSelection })), room && area && selection.kind === 'area' && (_jsx(AreaInspector, { template: template, room: room, area: area, onChange: history.set, onSelect: setSelection })), selection.kind === 'none' && (_jsx(TemplateDetails, { template: template, ...(props.ambienceLibrary ? { ambienceLibrary: props.ambienceLibrary } : {}), onChange: history.set, onSelect: setSelection }))] }), _jsx(SaveBar, { issues: issues, notes: notes, saveLabel: props.saveLabel, onSave: () => props.onSave(template) })] })] }));
54
58
  }
55
59
  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ACP,CAAA;AACH,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { CanvasShape } from '@unityevolv/ofiskit-template';
2
2
  import type { PromptDocument } from '../prompt/prompt.js';
3
+ import { type ImportedOffice } from './officeImport.js';
3
4
  /**
4
5
  * Step two: the picture the office is drawn on.
5
6
  *
@@ -11,12 +12,22 @@ import type { PromptDocument } from '../prompt/prompt.js';
11
12
  * Each image is checked on the way in, against the shape chosen in step one: a
12
13
  * picture of the wrong ratio puts every room slightly wrong against it, and
13
14
  * finding that out here costs one regeneration rather than a whole layout.
15
+ *
16
+ * An SVG is read as well as looked at. One that carries its rooms (see
17
+ * docs/office-svg/spec.md) hands them to the host, and the rooms step opens
18
+ * already laid out; one that carries something that must not be shown to an
19
+ * office's members is refused with the element named. A plain SVG is a picture,
20
+ * as it always was.
14
21
  */
15
22
  export interface BackgroundImages {
16
23
  /** Object URLs of what is loaded so far. */
17
24
  light: string | null;
18
25
  dark: string | null;
19
26
  }
27
+ /** A light SVG that brought its rooms with it. */
28
+ export type OfficeFromPicture = Extract<ImportedOffice, {
29
+ kind: 'office';
30
+ }>;
20
31
  export interface BackgroundStepProps {
21
32
  document: PromptDocument;
22
33
  shape: CanvasShape;
@@ -28,6 +39,11 @@ export interface BackgroundStepProps {
28
39
  * not a `.webp` name for a file that is not one.
29
40
  */
30
41
  onImage(slot: 'light' | 'dark', url: string, fileName: string): void;
42
+ /**
43
+ * The light image carried its rooms, or (null) a new light image did not. Sent
44
+ * after `onImage`, so a host that ignores it still has the picture.
45
+ */
46
+ onOffice?(office: OfficeFromPicture | null): void;
31
47
  }
32
48
  /** The name a background should have beside template.json, keeping its type. */
33
49
  export declare function backgroundFileName(file: File, slot: 'light' | 'dark'): string;
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundStep.d.ts","sourceRoot":"","sources":["../../src/background/BackgroundStep.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG/D,OAAO,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AE,cAAc,CAAA;IACxB,KAAK,EAAE,WAAW,CAAA;IAClB,sCAAsC;IACtC,MAAM,EAAE,gBAAgB,CAAA;IACxB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACpE;;;OAGG;IACH,QAAQ,CAAC,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAA;CAClD;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAG7E;AAMD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BAmTxD"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { Alert, Button, Field } from '@unityevolv/unitykit';
3
3
  import { useEffect, useState } from 'react';
4
4
  import { darkVersion } from './darkVersion.js';
5
+ import { describeFound, firstMovedRoom, importOfficeFile, } from './officeImport.js';
5
6
  /** The name a background should have beside template.json, keeping its type. */
6
7
  export function backgroundFileName(file, slot) {
7
8
  const extension = isSvg(file) ? 'svg' : (/\.([a-z0-9]+)$/i.exec(file.name)?.[1] ?? 'png');
@@ -16,9 +17,13 @@ export function BackgroundStep(props) {
16
17
  const [problem, setProblem] = useState(null);
17
18
  /** The light image, when it is an SVG: the only kind a dark version can be made from. */
18
19
  const [lightSvg, setLightSvg] = useState(null);
20
+ /** The rooms the light image carried, which a dark image is held to. */
21
+ const [lightOffice, setLightOffice] = useState(null);
19
22
  /** A dark version made here, which the author needs as a file; they never had one. */
20
23
  const [generated, setGenerated] = useState(null);
21
24
  const [generating, setGenerating] = useState(false);
25
+ /** What a file dropped on "Check a file" would do, said without doing it. */
26
+ const [checked, setChecked] = useState(null);
22
27
  // The download link's URL is this step's own; the one handed to the host is not.
23
28
  useEffect(() => () => {
24
29
  if (generated)
@@ -26,6 +31,29 @@ export function BackgroundStep(props) {
26
31
  }, [generated]);
27
32
  /** Check an image against the canvas, and hand it to the host if it fits. */
28
33
  async function accept(file, slot) {
34
+ // An SVG is read before it is shown: what it carries decides what happens
35
+ // next, and a refused one is never shown at all.
36
+ let office = null;
37
+ if (isSvg(file)) {
38
+ office = importOfficeFile(await file.text(), backgroundFileName(file, slot));
39
+ if (office.kind === 'refused') {
40
+ setProblem(`That file cannot be used as a background. ${office.issues
41
+ .map((issue) => issue.message)
42
+ .join(' ')}`);
43
+ return false;
44
+ }
45
+ if (slot === 'dark' && lightOffice) {
46
+ // The dark variant is a recolouring of the same scene, never a different
47
+ // layout: the rooms it carries must be the rooms the light one carries.
48
+ const moved = office.kind === 'office'
49
+ ? firstMovedRoom(lightOffice.template, office.template)
50
+ : 'every room';
51
+ if (moved !== null) {
52
+ setProblem(`The dark picture does not carry the same rooms as the light one (${moved}). Export both from the same frames, or generate the dark version here.`);
53
+ return false;
54
+ }
55
+ }
56
+ }
29
57
  const url = URL.createObjectURL(file);
30
58
  const image = new Image();
31
59
  const ok = await new Promise((resolve) => {
@@ -57,6 +85,11 @@ export function BackgroundStep(props) {
57
85
  // Replaced by whatever came in now; generating sets it again straight after.
58
86
  setGenerated(null);
59
87
  props.onImage(slot, url, backgroundFileName(file, slot));
88
+ if (slot === 'light') {
89
+ const carried = office?.kind === 'office' ? office : null;
90
+ setLightOffice(carried);
91
+ props.onOffice?.(carried);
92
+ }
60
93
  return true;
61
94
  }
62
95
  /**
@@ -84,15 +117,37 @@ export function BackgroundStep(props) {
84
117
  setGenerating(false);
85
118
  }
86
119
  }
87
- return (_jsxs("div", { className: "mx-auto grid max-w-5xl gap-6 p-4 lg:grid-cols-2", children: [_jsxs("section", { className: "space-y-3", "aria-labelledby": "background-light", children: [_jsx("h2", { id: "background-light", className: "text-lg font-semibold", children: "Background image" }), _jsxs("p", { className: "text-sm text-base-content/75", children: ["Required. The office is drawn on this. It should be ", canvas.ratio, ", ideally", ' ', canvas.resolution, "."] }), _jsx(Field, { label: "Light image", help: "PNG, JPEG, WebP, AVIF or SVG.", children: (control) => (_jsx("input", { ...control, type: "file", accept: "image/*", className: "file-input file-input-bordered file-input-sm w-full", onChange: (event) => {
120
+ /** Report on a file as an import would, and keep nothing. */
121
+ async function check(file) {
122
+ if (!isSvg(file)) {
123
+ setChecked({ name: file.name, result: { kind: 'picture' } });
124
+ return;
125
+ }
126
+ setChecked({
127
+ name: file.name,
128
+ result: importOfficeFile(await file.text(), backgroundFileName(file, 'light')),
129
+ });
130
+ }
131
+ return (_jsxs("div", { className: "mx-auto grid max-w-5xl gap-6 p-4 lg:grid-cols-2", children: [_jsxs("section", { className: "space-y-3", "aria-labelledby": "background-light", children: [_jsx("h2", { id: "background-light", className: "text-lg font-semibold", children: "Background image" }), _jsxs("p", { className: "text-sm text-base-content/75", children: ["Required. The office is drawn on this. It should be ", canvas.ratio, ", ideally", ' ', canvas.resolution, ". An SVG drawn to the office convention brings its rooms with it."] }), _jsx(Field, { label: "Light image", help: "PNG, JPEG, WebP, AVIF or SVG.", children: (control) => (_jsx("input", { ...control, type: "file", accept: "image/*", className: "file-input file-input-bordered file-input-sm w-full", onChange: (event) => {
88
132
  const file = event.target.files?.[0];
89
133
  if (file)
90
134
  void accept(file, 'light');
91
- } })) }), _jsx(Preview, { url: props.images.light, label: "The light image" })] }), _jsxs("section", { className: "space-y-3", "aria-labelledby": "background-dark", children: [_jsx("h2", { id: "background-dark", className: "text-lg font-semibold", children: "Dark version" }), _jsx("p", { className: "text-sm text-base-content/75", children: "Optional, for the dark theme. The same scene recoloured, never a different layout." }), _jsx(Field, { label: "Dark image", help: "Upload one, or generate it from an SVG.", children: (control) => (_jsx("input", { ...control, type: "file", accept: "image/*", className: "file-input file-input-bordered file-input-sm w-full", onChange: (event) => {
135
+ } })) }), _jsx(Preview, { url: props.images.light, label: "The light image" }), lightOffice && (_jsxs("div", { role: "status", className: "text-xs", children: [_jsx("p", { className: "font-medium text-success", children: describeFound(lightOffice.found) }), _jsxs("p", { className: "text-base-content/75", children: ["They are placed for you on the next step", lightOffice.issues.length > 0 &&
136
+ `, with ${lightOffice.issues.length} thing${lightOffice.issues.length === 1 ? '' : 's'} to fix shown there`, "."] }), _jsx(Report, { issues: lightOffice.issues, warnings: lightOffice.warnings })] }))] }), _jsxs("section", { className: "space-y-3", "aria-labelledby": "background-dark", children: [_jsx("h2", { id: "background-dark", className: "text-lg font-semibold", children: "Dark version" }), _jsx("p", { className: "text-sm text-base-content/75", children: "Optional, for the dark theme. The same scene recoloured, never a different layout." }), _jsx(Field, { label: "Dark image", help: "Upload one, or generate it from an SVG.", children: (control) => (_jsx("input", { ...control, type: "file", accept: "image/*", className: "file-input file-input-bordered file-input-sm w-full", onChange: (event) => {
92
137
  const file = event.target.files?.[0];
93
138
  if (file)
94
139
  void accept(file, 'dark');
95
- } })) }), lightSvg && (_jsxs("div", { className: "space-y-1", children: [_jsx(Button, { size: "sm", variant: "secondary", disabled: generating, onClick: () => void generateDark(), children: "Generate dark version" }), _jsx("p", { className: "text-xs text-base-content/70", children: "Made from your SVG: walls and floors darken, lamps stay lit. Nothing is uploaded." })] })), _jsx("p", { role: "status", className: "text-xs", children: generated && (_jsxs(_Fragment, { children: ["Dark version ready.", ' ', _jsxs("a", { href: generated.url, download: generated.name, className: "link", children: ["Download ", generated.name] }), ' ', "and put it beside template.json."] })) }), _jsx(Preview, { url: props.images.dark, label: "The dark image" })] }), problem && (_jsx(Alert, { variant: "warn", className: "lg:col-span-2", children: problem }))] }));
140
+ } })) }), lightSvg && (_jsxs("div", { className: "space-y-1", children: [_jsx(Button, { size: "sm", variant: "secondary", disabled: generating, onClick: () => void generateDark(), children: "Generate dark version" }), _jsx("p", { className: "text-xs text-base-content/70", children: "Made from your SVG: walls and floors darken, lamps stay lit. Nothing is uploaded." })] })), _jsx("p", { role: "status", className: "text-xs", children: generated && (_jsxs(_Fragment, { children: ["Dark version ready.", ' ', _jsxs("a", { href: generated.url, download: generated.name, className: "link", children: ["Download ", generated.name] }), ' ', "and put it beside template.json."] })) }), _jsx(Preview, { url: props.images.dark, label: "The dark image" })] }), problem && (_jsx(Alert, { variant: "warn", className: "lg:col-span-2", children: problem })), _jsxs("section", { className: "space-y-2 lg:col-span-2", "aria-labelledby": "background-check", children: [_jsx("h2", { id: "background-check", className: "text-base font-semibold", children: "Check a file" }), _jsx("p", { className: "text-sm text-base-content/75", children: "See what the builder would make of an SVG without loading it: which rooms it finds and anything that needs fixing." }), _jsx(Field, { label: "File to check", help: "Nothing is saved.", children: (control) => (_jsx("input", { ...control, type: "file", accept: ".svg,image/svg+xml", className: "file-input file-input-bordered file-input-sm w-full max-w-md", onChange: (event) => {
141
+ const file = event.target.files?.[0];
142
+ if (file)
143
+ void check(file);
144
+ } })) }), checked && (_jsxs("div", { role: "status", className: "rounded-lg bg-base-200 p-3 text-xs", children: [_jsx("p", { className: "font-medium", children: checked.name }), checked.result.kind === 'picture' && (_jsx("p", { children: "A plain picture: no room groups. The rooms would be drawn by hand." })), checked.result.kind === 'refused' && (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-error", children: "This file cannot be used as a background." }), _jsx(Report, { issues: checked.result.issues, warnings: [] })] })), checked.result.kind === 'office' && (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-success", children: describeFound(checked.result.found) }), checked.result.issues.length === 0 && checked.result.warnings.length === 0 && (_jsx("p", { children: "Nothing to fix." })), _jsx(Report, { issues: checked.result.issues, warnings: checked.result.warnings })] }))] }))] })] }));
145
+ }
146
+ /** Every message, each on its own line, so the list copies cleanly. */
147
+ function Report({ issues, warnings, }) {
148
+ if (issues.length === 0 && warnings.length === 0)
149
+ return null;
150
+ return (_jsxs("ul", { className: "mt-1 list-disc space-y-0.5 pl-4", children: [issues.map((issue, index) => (_jsx("li", { children: issue.message }, `issue-${index}`))), warnings.map((warning, index) => (_jsx("li", { className: "text-base-content/70", children: warning.message }, `warning-${index}`)))] }));
96
151
  }
97
152
  /** What is loaded, so the author can see it is the right picture before drawing on it. */
98
153
  function Preview({ url, label }) {
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundStep.js","sourceRoot":"","sources":["../../src/background/BackgroundStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAkC9C,gFAAgF;AAChF,MAAM,UAAU,kBAAkB,CAAC,IAAU,EAAE,IAAsB;IACnE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAA;IACzF,OAAO,UAAU,IAAI,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAA;AACpD,CAAC;AAED,SAAS,KAAK,CAAC,IAAU;IACvB,OAAO,IAAI,CAAC,IAAI,KAAK,eAAe,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACnE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAErC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IAC3D,yFAAyF;IACzF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAc,IAAI,CAAC,CAAA;IAC3D,sFAAsF;IACtF,MAAM,CAAC,SAAS,EAAE,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I,CACP,CAAA;IACH,CAAC;IACD,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,KAAK,EACV,SAAS,EAAC,sEAAsE,GAChF,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { type Template, type TemplateIssue } from '@unityevolv/ofiskit-template';
2
+ /**
3
+ * What the builder makes of an uploaded SVG.
4
+ *
5
+ * Three outcomes, because three different things happen next. A picture is
6
+ * drawn on, as every background always has been. An office arrives with its
7
+ * rooms, and the rooms step opens already laid out. A refused file never
8
+ * becomes a background at all: the importer found something that must not be
9
+ * shown to the members of an office (a script, an embedded document, a link to
10
+ * somewhere else), and that is said with the element named rather than fixed
11
+ * quietly.
12
+ *
13
+ * Rule problems — two receptions, a room off the canvas, an area in the bar —
14
+ * do not refuse the file. The rooms come in as they are and the builder shows
15
+ * each problem where it is, which is how a hand-drawn mistake is shown too.
16
+ */
17
+ export type ImportedOffice = {
18
+ kind: 'picture';
19
+ } | {
20
+ kind: 'refused';
21
+ issues: TemplateIssue[];
22
+ } | {
23
+ kind: 'office';
24
+ template: Template;
25
+ found: {
26
+ rooms: number;
27
+ areas: number;
28
+ };
29
+ /** Rule problems the rooms step will show on the rooms they belong to. */
30
+ issues: TemplateIssue[];
31
+ warnings: TemplateIssue[];
32
+ };
33
+ export declare function importOfficeFile(source: string, imageName: string): ImportedOffice;
34
+ /**
35
+ * The first room in `light` that `dark` does not carry at the same place, or
36
+ * null when the two layouts agree.
37
+ *
38
+ * Matched by position rather than by name, because a dark export can be
39
+ * renamed freely but must not move anything: the dark variant is a recolouring
40
+ * of the same scene, never a different layout.
41
+ */
42
+ export declare function firstMovedRoom(light: Template, dark: Template): string | null;
43
+ /**
44
+ * Give every room without a user area one, centred, the way a room drawn by
45
+ * hand gets one. Two cells wide where the room allows it, one otherwise.
46
+ */
47
+ export declare function fillAreas(template: Template): Template;
48
+ /**
49
+ * How close to the canvas edge a room may sit before a festival frame covers
50
+ * its bar: as a fraction of the canvas, the widest inset among the shipped
51
+ * frames. A note, never a refusal: an org with frames off is not affected.
52
+ */
53
+ export declare const FRAME_INSET = 0.02;
54
+ export declare function edgeWarnings(template: Template): string[];
55
+ /** One line for the author: what the picture brought with it. */
56
+ export declare function describeFound(found: {
57
+ rooms: number;
58
+ areas: number;
59
+ }): string;
60
+ //# sourceMappingURL=officeImport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"officeImport.d.ts","sourceRoot":"","sources":["../../src/background/officeImport.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAA;AAErC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,GAC5C;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvC,0EAA0E;IAC1E,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B,CAAA;AASL,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,cAAc,CAelF;AAKD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAW7E;AAWD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CActD;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,OAAO,CAAA;AAE/B,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAazD;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAI7E"}
@@ -0,0 +1,92 @@
1
+ import { TemplateError, avatarUnit, centredArea, readOfficeSvg, usableRect, } from '@unityevolv/ofiskit-template';
2
+ /** The codes that make a file unusable as a background, whatever else it holds. */
3
+ const REFUSING = new Set([
4
+ TemplateError.SVG_UNSAFE,
5
+ TemplateError.SVG_MALFORMED,
6
+ TemplateError.SVG_CANVAS_MISMATCH,
7
+ ]);
8
+ export function importOfficeFile(source, imageName) {
9
+ const result = readOfficeSvg(source, { imageName });
10
+ const refusing = result.issues.filter((entry) => REFUSING.has(entry.code));
11
+ if (refusing.length > 0)
12
+ return { kind: 'refused', issues: refusing };
13
+ if (!result.marked || result.template === null)
14
+ return { kind: 'picture' };
15
+ return {
16
+ kind: 'office',
17
+ template: result.template,
18
+ found: result.found,
19
+ issues: result.issues,
20
+ warnings: result.warnings,
21
+ };
22
+ }
23
+ /** Tolerance when deciding two files carry the same rooms: floating-point dust only. */
24
+ const SAME = 1e-3;
25
+ /**
26
+ * The first room in `light` that `dark` does not carry at the same place, or
27
+ * null when the two layouts agree.
28
+ *
29
+ * Matched by position rather than by name, because a dark export can be
30
+ * renamed freely but must not move anything: the dark variant is a recolouring
31
+ * of the same scene, never a different layout.
32
+ */
33
+ export function firstMovedRoom(light, dark) {
34
+ if (light.rooms.length !== dark.rooms.length) {
35
+ return light.rooms.length > dark.rooms.length
36
+ ? (light.rooms.find((room) => !dark.rooms.some((other) => sameRect(room, other)))?.name ??
37
+ null)
38
+ : `${dark.rooms.length - light.rooms.length} extra`;
39
+ }
40
+ for (const room of light.rooms) {
41
+ if (!dark.rooms.some((other) => sameRect(room, other)))
42
+ return room.name;
43
+ }
44
+ return null;
45
+ }
46
+ function sameRect(a, b) {
47
+ return (Math.abs(a.rect.x - b.rect.x) < SAME &&
48
+ Math.abs(a.rect.y - b.rect.y) < SAME &&
49
+ Math.abs(a.rect.width - b.rect.width) < SAME &&
50
+ Math.abs(a.rect.height - b.rect.height) < SAME);
51
+ }
52
+ /**
53
+ * Give every room without a user area one, centred, the way a room drawn by
54
+ * hand gets one. Two cells wide where the room allows it, one otherwise.
55
+ */
56
+ export function fillAreas(template) {
57
+ const unit = avatarUnit(template.canvas, template.avatarSize);
58
+ return {
59
+ ...template,
60
+ rooms: template.rooms.map((room) => {
61
+ if (room.areas.length > 0)
62
+ return room;
63
+ const usable = usableRect(room, template.canvas);
64
+ const columns = usable.width >= 2 * unit.width ? 2 : 1;
65
+ return {
66
+ ...room,
67
+ areas: [centredArea(room, template.canvas, template.avatarSize, columns, 1)],
68
+ };
69
+ }),
70
+ };
71
+ }
72
+ /**
73
+ * How close to the canvas edge a room may sit before a festival frame covers
74
+ * its bar: as a fraction of the canvas, the widest inset among the shipped
75
+ * frames. A note, never a refusal: an org with frames off is not affected.
76
+ */
77
+ export const FRAME_INSET = 0.02;
78
+ export function edgeWarnings(template) {
79
+ return template.rooms
80
+ .filter((room) => room.rect.x < FRAME_INSET ||
81
+ room.rect.y < FRAME_INSET ||
82
+ room.rect.x + room.rect.width > 1 - FRAME_INSET ||
83
+ room.rect.y + room.rect.height > 1 - FRAME_INSET)
84
+ .map((room) => `${room.name} touches the edge of the canvas, where a festival frame would cover its bar.`);
85
+ }
86
+ /** One line for the author: what the picture brought with it. */
87
+ export function describeFound(found) {
88
+ const rooms = `${found.rooms} room${found.rooms === 1 ? '' : 's'}`;
89
+ const areas = `${found.areas} user area${found.areas === 1 ? '' : 's'}`;
90
+ return `${rooms} and ${areas} found in the picture.`;
91
+ }
92
+ //# sourceMappingURL=officeImport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"officeImport.js","sourceRoot":"","sources":["../../src/background/officeImport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,aAAa,EACb,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CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,aAAa,CAAC,KAAuC;IACnE,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,KAAK,QAAQ,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;IAClE,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,KAAK,aAAa,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;IACvE,OAAO,GAAG,KAAK,QAAQ,KAAK,wBAAwB,CAAA;AACtD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -14,8 +14,9 @@ export { BuilderCanvas, type BuilderCanvasProps } from './canvas/BuilderCanvas.j
14
14
  export type { ChangeOptions, OnChange, Selection, Tool } from './canvas/types.js';
15
15
  export { BuilderSteps, type BuilderStepsProps } from './BuilderSteps.js';
16
16
  export { PromptStep, type PromptStepProps } from './prompt/PromptStep.js';
17
- export { BackgroundStep, backgroundFileName, type BackgroundImages, type BackgroundStepProps, } from './background/BackgroundStep.js';
17
+ export { BackgroundStep, backgroundFileName, type BackgroundImages, type BackgroundStepProps, type OfficeFromPicture, } from './background/BackgroundStep.js';
18
18
  export { darkVersion } from './background/darkVersion.js';
19
+ export { describeFound, edgeWarnings, fillAreas, firstMovedRoom, importOfficeFile, type ImportedOffice, } from './background/officeImport.js';
19
20
  export { useHistory, type History } from './history.js';
20
- export { applyPreset, defaultSlots, loadPromptDocument, renderPrompt, type PromptDocument, type PromptPreset, type PromptSlot, type SlotValues, } from './prompt/prompt.js';
21
+ export { applyPreset, defaultSlots, loadOfficePrompts, loadPromptDocument, renderPrompt, type OfficePrompt, type PromptDocument, type PromptPreset, type PromptSlot, type SlotValues, } from './prompt/prompt.js';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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wBAAwB,CAAA;AACzE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAA"}
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ export { BuilderSteps } from './BuilderSteps.js';
15
15
  export { PromptStep } from './prompt/PromptStep.js';
16
16
  export { BackgroundStep, backgroundFileName, } from './background/BackgroundStep.js';
17
17
  export { darkVersion } from './background/darkVersion.js';
18
+ export { describeFound, edgeWarnings, fillAreas, firstMovedRoom, importOfficeFile, } from './background/officeImport.js';
18
19
  export { useHistory } from './history.js';
19
- export { applyPreset, defaultSlots, loadPromptDocument, renderPrompt, } from './prompt/prompt.js';
20
+ export { applyPreset, defaultSlots, loadOfficePrompts, loadPromptDocument, renderPrompt, } from './prompt/prompt.js';
20
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,aAAa,EAA2B,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,aAAa,EAA2B,MAAM,2BAA2B,CAAA;AAElF,OAAO,EAAE,YAAY,EAA0B,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EACL,cAAc,EACd,kBAAkB,GAGnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAA;AACvD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,YAAY,GAKb,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,aAAa,EAA2B,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,aAAa,EAA2B,MAAM,2BAA2B,CAAA;AAElF,OAAO,EAAE,YAAY,EAA0B,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EACL,cAAc,EACd,kBAAkB,GAInB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,gBAAgB,GAEjB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAA;AACvD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,GAMb,MAAM,oBAAoB,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import type { TemplateIssue } from '@unityevolv/ofiskit-template';
2
2
  export declare function SaveBar(props: {
3
3
  issues: TemplateIssue[];
4
+ /** Worth knowing, not worth refusing: shown under the verdict, never blocking it. */
5
+ notes?: string[];
4
6
  saveLabel: string;
5
7
  onSave(): void;
6
8
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"SaveBar.d.ts","sourceRoot":"","sources":["../../src/panel/SaveBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAajE,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,IAAI,IAAI,CAAA;CAAE,+BAwB5F"}
1
+ {"version":3,"file":"SaveBar.d.ts","sourceRoot":"","sources":["../../src/panel/SaveBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAajE,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,IAAI,IAAI,CAAA;CACf,+BAgCA"}
@@ -10,7 +10,7 @@ import { Alert, Button, Icon } from '@unityevolv/unitykit';
10
10
  /** Enough to show what kind of trouble it is in without filling the panel. */
11
11
  const SHOWN = 6;
12
12
  export function SaveBar(props) {
13
- const { issues } = props;
14
- return (_jsxs("section", { className: "border-t border-base-300 pt-3", children: [issues.length === 0 ? (_jsxs("p", { className: "flex items-center gap-1 text-sm text-success", children: [_jsx(Icon, { name: "check", size: "sm" }), " This layout is valid."] })) : (_jsx(Alert, { variant: "warn", title: `${issues.length} to fix`, children: _jsx("ul", { className: "mt-1 space-y-1 text-xs", children: issues.slice(0, SHOWN).map((issue, index) => (_jsx("li", { children: issue.message }, `${issue.code}-${index}`))) }) })), _jsxs(Button, { className: "mt-3 w-full", disabled: issues.length > 0, onClick: props.onSave, children: [_jsx(Icon, { name: "download", size: "sm" }), " ", props.saveLabel] })] }));
13
+ const { issues, notes = [] } = props;
14
+ return (_jsxs("section", { className: "border-t border-base-300 pt-3", children: [issues.length === 0 ? (_jsxs("p", { className: "flex items-center gap-1 text-sm text-success", children: [_jsx(Icon, { name: "check", size: "sm" }), " This layout is valid."] })) : (_jsx(Alert, { variant: "warn", title: `${issues.length} to fix`, children: _jsx("ul", { className: "mt-1 space-y-1 text-xs", children: issues.slice(0, SHOWN).map((issue, index) => (_jsx("li", { children: issue.message }, `${issue.code}-${index}`))) }) })), notes.length > 0 && (_jsx("ul", { className: "mt-2 space-y-1 text-xs text-base-content/75", children: notes.map((note) => (_jsx("li", { children: note }, note))) })), _jsxs(Button, { className: "mt-3 w-full", disabled: issues.length > 0, onClick: props.onSave, children: [_jsx(Icon, { name: "download", size: "sm" }), " ", props.saveLabel] })] }));
15
15
  }
16
16
  //# sourceMappingURL=SaveBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveBar.js","sourceRoot":"","sources":["../../src/panel/SaveBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAG1D;;;;;;GAMG;AAEH,8EAA8E;AAC9E,MAAM,KAAK,GAAG,CAAC,CAAA;AAEf,MAAM,UAAU,OAAO,CAAC,KAAqE;IAC3F,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAExB,OAAO,CACL,mBAAS,SAAS,EAAC,+BAA+B,aAC/C,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACrB,aAAG,SAAS,EAAC,8CAA8C,aACzD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,GAAG,8BAC7B,CACL,CAAC,CAAC,CAAC,CACF,KAAC,KAAK,IAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,SAAS,YACpD,aAAI,SAAS,EAAC,wBAAwB,YACnC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EA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AG,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,CAAsB,CACxD,CAAC,GACC,GACC,CACT,EAEA,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,aAAI,SAAS,EAAC,6CAA6C,YACxD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,uBAAgB,IAAI,IAAX,IAAI,CAAa,CAC3B,CAAC,GACC,CACN,EAED,MAAC,MAAM,IAAC,SAAS,EAAC,aAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,aAChF,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,IAAI,GAAG,OAAE,KAAK,CAAC,SAAS,IAC5C,IACD,CACX,CAAA;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type CanvasShape } from '@unityevolv/ofiskit-template';
2
- import { type PromptDocument } from './prompt.js';
2
+ import { type OfficePrompt, type PromptDocument } from './prompt.js';
3
3
  /**
4
4
  * Step one, before a single room is drawn: the prompt for the picture.
5
5
  *
@@ -18,6 +18,12 @@ export interface PromptStepProps {
18
18
  onShapeChange(shape: CanvasShape): void;
19
19
  /** What choosing a different shape would undo, said before it happens. */
20
20
  shapeChangeWarning?: string;
21
+ /**
22
+ * The other way to a picture: a prompt per theme and view that asks an
23
+ * assistant for an office drawn to the SVG convention, rooms included, so the
24
+ * rooms step opens laid out. Absent, and only the picture prompt is offered.
25
+ */
26
+ officePrompts?: readonly OfficePrompt[];
21
27
  }
22
28
  export declare function PromptStep(props: PromptStepProps): import("react").JSX.Element;
23
29
  //# sourceMappingURL=PromptStep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromptStep.d.ts","sourceRoot":"","sources":["../../src/prompt/PromptStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG9E,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,cAAc,CAAA;IACxB,KAAK,EAAE,WAAW,CAAA;IAClB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;IACvC,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAkIhD"}
1
+ {"version":3,"file":"PromptStep.d.ts","sourceRoot":"","sources":["../../src/prompt/PromptStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG9E,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,cAAc,EAEpB,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,cAAc,CAAA;IACxB,KAAK,EAAE,WAAW,CAAA;IAClB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;IACvC,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;CACxC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAoLhD"}
@@ -6,19 +6,28 @@ import { applyPreset, defaultSlots, renderPrompt, } from './prompt.js';
6
6
  export function PromptStep(props) {
7
7
  const { document: prompt, shape } = props;
8
8
  const [values, setValues] = useState(() => defaultSlots(prompt));
9
- const [copied, setCopied] = useState(false);
9
+ const [copied, setCopied] = useState(null);
10
+ const [officeId, setOfficeId] = useState(props.officePrompts?.[0]?.id ?? null);
10
11
  const text = useMemo(() => renderPrompt(prompt, shape, values), [prompt, shape, values]);
12
+ const office = props.officePrompts?.find((candidate) => candidate.id === officeId) ?? null;
13
+ function copy(which, content) {
14
+ void navigator.clipboard.writeText(content).then(() => {
15
+ setCopied(which);
16
+ setTimeout(() => setCopied(null), 2000);
17
+ });
18
+ }
11
19
  return (_jsxs("div", { className: "mx-auto grid max-w-5xl gap-6 p-4 lg:grid-cols-[1fr_20rem]", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: "Choose the shape of your office" }), _jsx("p", { className: "mt-1 text-sm text-base-content/75", children: "This cannot change once rooms are placed, because every room is positioned against it." }), _jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: CANVAS_SHAPES.map((candidate) => (_jsxs("button", { type: "button", onClick: () => props.onShapeChange(candidate), "aria-pressed": shape === candidate, className: [
12
20
  'rounded-lg border px-3 py-2 text-sm',
13
21
  'focus-visible:outline-2 focus-visible:outline-primary',
14
22
  shape === candidate
15
23
  ? 'border-primary bg-primary/10 font-medium'
16
24
  : 'border-base-300 hover:bg-base-200',
17
- ].join(' '), children: [prompt.canvases[candidate].label, _jsx("span", { className: "block text-xs text-base-content", children: prompt.canvases[candidate].resolution })] }, candidate))) }), props.shapeChangeWarning && (_jsx(Alert, { variant: "warn", className: "mt-3", children: props.shapeChangeWarning }))] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-semibold", children: "The prompt" }), _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => {
18
- void navigator.clipboard.writeText(text).then(() => {
19
- setCopied(true);
20
- setTimeout(() => setCopied(false), 2000);
21
- });
22
- }, children: [_jsx(Icon, { name: copied ? 'check' : 'copy', size: "sm" }), copied ? 'Copied' : 'Copy'] })] }), _jsx(Textarea, { readOnly: true, value: text, rows: 16, className: "mt-2 font-mono text-xs", "aria-label": "The prompt" })] })] }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold", children: "Start from a theme" }), _jsx("p", { className: "mt-1 text-xs text-base-content/70", children: "Each one fills in every field below. A good place to start if you have no idea what you want." }), _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: Object.entries(prompt.presets).map(([id, preset]) => (_jsx("button", { type: "button", onClick: () => setValues(applyPreset(preset)), className: "rounded-full bg-base-200 px-2 py-1 text-xs hover:bg-base-300 focus-visible:outline-2 focus-visible:outline-primary", children: preset.label }, id))) })] }), _jsx("div", { className: "space-y-2", children: Object.entries(prompt.slots).map(([key, slot]) => (_jsx(Input, { label: slot.label, help: slot.help, value: values[key] ?? '', onChange: (event) => setValues({ ...values, [key]: event.target.value }) }, key))) }), _jsxs("div", { className: "rounded-lg bg-base-200 p-3", children: [_jsx("h3", { className: "text-sm font-semibold", children: "Worth knowing" }), _jsx("ul", { className: "mt-1 list-disc space-y-1 pl-4 text-xs text-base-content/75", children: prompt.guidance.map((line) => (_jsx("li", { children: line }, line))) })] })] })] }));
25
+ ].join(' '), children: [prompt.canvases[candidate].label, _jsx("span", { className: "block text-xs text-base-content", children: prompt.canvases[candidate].resolution })] }, candidate))) }), props.shapeChangeWarning && (_jsx(Alert, { variant: "warn", className: "mt-3", children: props.shapeChangeWarning }))] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-semibold", children: "The prompt" }), _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => copy('picture', text), children: [_jsx(Icon, { name: copied === 'picture' ? 'check' : 'copy', size: "sm" }), copied === 'picture' ? 'Copied' : 'Copy'] })] }), _jsx(Textarea, { readOnly: true, value: text, rows: 16, className: "mt-2 font-mono text-xs", "aria-label": "The prompt" })] }), props.officePrompts && props.officePrompts.length > 0 && office && (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-semibold", children: "Or have your AI draw the office" }), _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => copy('office', office.text), children: [_jsx(Icon, { name: copied === 'office' ? 'check' : 'copy', size: "sm" }), copied === 'office' ? 'Copied' : 'Copy', " office prompt"] })] }), _jsx("p", { className: "mt-1 text-sm text-base-content/75", children: "Paste this into ChatGPT, Claude, Gemini or whichever assistant you use, answer its questions, and upload the SVG it returns on the next step. Its rooms come with it, so the rooms step opens already laid out." }), _jsx("div", { className: "mt-3 flex flex-wrap gap-2", role: "group", "aria-label": "Theme and view", children: props.officePrompts.map((candidate) => (_jsx("button", { type: "button", onClick: () => setOfficeId(candidate.id), "aria-pressed": candidate.id === office.id, className: [
26
+ 'rounded-lg border px-3 py-2 text-sm',
27
+ 'focus-visible:outline-2 focus-visible:outline-primary',
28
+ candidate.id === office.id
29
+ ? 'border-primary bg-primary/10 font-medium'
30
+ : 'border-base-300 hover:bg-base-200',
31
+ ].join(' '), children: candidate.label }, candidate.id))) }), _jsx(Textarea, { readOnly: true, value: office.text, rows: 8, className: "mt-2 font-mono text-xs", "aria-label": "The office prompt" })] }))] }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold", children: "Start from a theme" }), _jsx("p", { className: "mt-1 text-xs text-base-content/70", children: "Each one fills in every field below. A good place to start if you have no idea what you want." }), _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: Object.entries(prompt.presets).map(([id, preset]) => (_jsx("button", { type: "button", onClick: () => setValues(applyPreset(preset)), className: "rounded-full bg-base-200 px-2 py-1 text-xs hover:bg-base-300 focus-visible:outline-2 focus-visible:outline-primary", children: preset.label }, id))) })] }), _jsx("div", { className: "space-y-2", children: Object.entries(prompt.slots).map(([key, slot]) => (_jsx(Input, { label: slot.label, help: slot.help, value: values[key] ?? '', onChange: (event) => setValues({ ...values, [key]: event.target.value }) }, key))) }), _jsxs("div", { className: "rounded-lg bg-base-200 p-3", children: [_jsx("h3", { className: "text-sm font-semibold", children: "Worth knowing" }), _jsx("ul", { className: "mt-1 list-disc space-y-1 pl-4 text-xs text-base-content/75", children: prompt.guidance.map((line) => (_jsx("li", { children: line }, line))) })] })] })] }));
23
32
  }
24
33
  //# sourceMappingURL=Prom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AE,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAJnE,GAAG,CAKR,CACH,CAAC,GACE,EAEN,eAAK,SAAS,EAAC,4BAA4B,aACzC,aAAI,SAAS,EAAC,uBAAuB,8BAAmB,EACxD,aAAI,SAAS,EAAC,4DAA4D,YACvE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC7B,uBAAgB,IAAI,IAAX,IAAI,CAAa,CAC3B,CAAC,GACC,IACD,IACF,IACF,CACP,CAAA;AACH,CAAC"}
@@ -56,4 +56,24 @@ export declare function applyPreset(preset: PromptPreset): SlotValues;
56
56
  * hostname is ever written down in the product.
57
57
  */
58
58
  export declare function loadPromptDocument(path: string): Promise<PromptDocument>;
59
+ /**
60
+ * A prompt that asks an assistant for an office drawn to the SVG convention,
61
+ * in one theme and one view, with that theme's symbols inside it.
62
+ *
63
+ * Generated in the repository from the spec and the symbol libraries
64
+ * (`npm run office:prompt`), never written by hand, so the prompt, the
65
+ * designer guide and the importer cannot disagree. The builder only carries
66
+ * them to the clipboard.
67
+ */
68
+ export interface OfficePrompt {
69
+ /** `<theme>-<view>`, the file name without its extension. */
70
+ id: string;
71
+ theme: string;
72
+ view: 'cut' | 'top';
73
+ /** For a person: "Modern office, cutaway". */
74
+ label: string;
75
+ text: string;
76
+ }
77
+ /** Load the office prompts, served beside the prompt document as one index. */
78
+ export declare function loadOfficePrompts(path: string): Promise<OfficePrompt[]>;
59
79
  //# sourceMappingURL=prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8B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E,cAAc,EACxB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,UAAU,GACjB,MAAM,CAcR;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAG5D;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAK9E;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,KAAK,GAAG,KAAK,CAAA;IACnB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,+EAA+E;AAC/E,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAK7E"}
@@ -37,4 +37,12 @@ export async function loadPromptDocument(path) {
37
37
  throw new Error(`The background prompt could not be loaded (${response.status}).`);
38
38
  return (await response.json());
39
39
  }
40
+ /** Load the office prompts, served beside the prompt document as one index. */
41
+ export async function loadOfficePrompts(path) {
42
+ const response = await fetch(path);
43
+ if (!response.ok)
44
+ throw new Error(`The office prompts could not be loaded (${response.status}).`);
45
+ const index = (await response.json());
46
+ return index.prompts;
47
+ }
40
48
  //# sourceMappingURL=prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompt/prompt.ts"],"names":[],"mappings":"AAyCA,oEAAoE;AACpE,MAAM,UAAU,YAAY,CAAC,QAAwB;IACnD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAA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AE,GAAG,MAAM,CAAA;IAC1C,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;IAClC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,8CAA8C,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAA;IACpF,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAmB,CAAA;AAClD,CAAC;AAqBD,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAY;IAClD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;IAClC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAA;IACjG,MAAM,KAAK,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAgC,CAAA;IACpE,OAAO,KAAK,CAAC,OAAO,CAAA;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unityevolv/ofiskit-ui-builder",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "The office builder: draw rooms and user areas on a background image and emit a template. Takes a layout, emits a layout; the host decides what to do with it.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",