@unityevolv/ofiskit-ui-builder 0.3.1 → 0.5.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.
- package/dist/BuilderSteps.d.ts +12 -1
- package/dist/BuilderSteps.d.ts.map +1 -1
- package/dist/BuilderSteps.js +42 -8
- package/dist/BuilderSteps.js.map +1 -1
- package/dist/OfficeBuilder.d.ts.map +1 -1
- package/dist/OfficeBuilder.js +5 -1
- package/dist/OfficeBuilder.js.map +1 -1
- package/dist/background/BackgroundStep.d.ts +41 -0
- package/dist/background/BackgroundStep.d.ts.map +1 -1
- package/dist/background/BackgroundStep.js +87 -11
- package/dist/background/BackgroundStep.js.map +1 -1
- package/dist/background/officeImport.d.ts +60 -0
- package/dist/background/officeImport.d.ts.map +1 -0
- package/dist/background/officeImport.js +92 -0
- package/dist/background/officeImport.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/panel/SaveBar.d.ts +2 -0
- package/dist/panel/SaveBar.d.ts.map +1 -1
- package/dist/panel/SaveBar.js +2 -2
- package/dist/panel/SaveBar.js.map +1 -1
- package/dist/prompt/PromptStep.d.ts +13 -1
- package/dist/prompt/PromptStep.d.ts.map +1 -1
- package/dist/prompt/PromptStep.js +40 -14
- package/dist/prompt/PromptStep.js.map +1 -1
- package/dist/prompt/prompt.d.ts +20 -0
- package/dist/prompt/prompt.d.ts.map +1 -1
- package/dist/prompt/prompt.js +8 -0
- package/dist/prompt/prompt.js.map +1 -1
- package/package.json +1 -1
package/dist/BuilderSteps.d.ts
CHANGED
|
@@ -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,
|
|
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,EAEL,KAAK,gBAAgB,EAEtB,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEtE;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,cAAc,CAAA;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC1D,8DAA8D;IAC9D,QAAQ,CAAC,CAAC,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"}
|
package/dist/BuilderSteps.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
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
|
|
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:
|
|
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(
|
|
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" })] }))] })] }));
|
package/dist/BuilderSteps.js.map
CHANGED
|
@@ -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,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,oB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AS,EAAE,IAAI,KAAK,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAChE,QAAQ,EAAE,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,EAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,uBAEpB,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,KAAK,EAC7B,KAAC,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;
|
|
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"}
|
package/dist/OfficeBuilder.js
CHANGED
|
@@ -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) })] })] }));
|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,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7E,QAAQ,EAAE,OAAO,CAAC,GAAG,EACrB,QAAQ,EAAE,YAAY,GACtB,CACH,IACO,EAMV,KAAC,OAAO,IACN,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GACpC,IACI,IACJ,CACP,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,7 +39,37 @@ 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
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The bounds a raster background is held to, per canvas shape: the exact
|
|
50
|
+
* ratio, because every room is placed in normalised coordinates against the
|
|
51
|
+
* picture and nothing is cropped for the author, and a resolution between a
|
|
52
|
+
* sharp tablet and a 4K wall. A host that stores pictures (the office
|
|
53
|
+
* service) holds them to the same bounds, so a picture accepted here is
|
|
54
|
+
* never refused later. An SVG scales: its ratio may be off by `RATIO_TOLERANCE`
|
|
55
|
+
* and it has no resolution.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BACKGROUND_BOUNDS: Readonly<Record<CanvasShape, {
|
|
58
|
+
ratio: readonly [number, number];
|
|
59
|
+
min: readonly [number, number];
|
|
60
|
+
max: readonly [number, number];
|
|
61
|
+
}>>;
|
|
62
|
+
/** How far an SVG's ratio may be from the canvas's: the office-svg spec's ratioTolerance. */
|
|
63
|
+
export declare const RATIO_TOLERANCE = 0.03;
|
|
64
|
+
/**
|
|
65
|
+
* Why a picture of width x height cannot be the background of a canvas, in
|
|
66
|
+
* the author's words, or null when it can. The recommended resolution comes
|
|
67
|
+
* from the prompt document, which is what the author was told to generate.
|
|
68
|
+
*/
|
|
69
|
+
export declare function backgroundProblem(shape: CanvasShape, canvas: {
|
|
70
|
+
ratio: string;
|
|
71
|
+
resolution: string;
|
|
72
|
+
}, width: number, height: number, svg: boolean): string | null;
|
|
32
73
|
/** The name a background should have beside template.json, keeping its type. */
|
|
33
74
|
export declare function backgroundFileName(file: File, slot: 'light' | 'dark'): string;
|
|
34
75
|
export declare function BackgroundStep(props: BackgroundStepProps): import("react").JSX.Element;
|
|
@@ -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,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;
|
|
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,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,kDAAkD;AAClD,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAA;AAE3E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,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;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CACtC,MAAM,CACJ,WAAW,EACX;IACE,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,GAAG,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,GAAG,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,CACF,CAKF,CAAA;AAED,6FAA6F;AAC7F,eAAO,MAAM,eAAe,OAAO,CAAA;AAInC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAC7C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,GACX,MAAM,GAAG,IAAI,CAoBf;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,+BAsOxD"}
|
|
@@ -2,6 +2,50 @@ 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';
|
|
6
|
+
/**
|
|
7
|
+
* The bounds a raster background is held to, per canvas shape: the exact
|
|
8
|
+
* ratio, because every room is placed in normalised coordinates against the
|
|
9
|
+
* picture and nothing is cropped for the author, and a resolution between a
|
|
10
|
+
* sharp tablet and a 4K wall. A host that stores pictures (the office
|
|
11
|
+
* service) holds them to the same bounds, so a picture accepted here is
|
|
12
|
+
* never refused later. An SVG scales: its ratio may be off by `RATIO_TOLERANCE`
|
|
13
|
+
* and it has no resolution.
|
|
14
|
+
*/
|
|
15
|
+
export const BACKGROUND_BOUNDS = {
|
|
16
|
+
landscape: { ratio: [16, 9], min: [1920, 1080], max: [3840, 2160] },
|
|
17
|
+
square: { ratio: [1, 1], min: [1080, 1080], max: [2160, 2160] },
|
|
18
|
+
portrait: { ratio: [3, 4], min: [1080, 1440], max: [2160, 2880] },
|
|
19
|
+
};
|
|
20
|
+
/** How far an SVG's ratio may be from the canvas's: the office-svg spec's ratioTolerance. */
|
|
21
|
+
export const RATIO_TOLERANCE = 0.03;
|
|
22
|
+
const size = ([width, height]) => `${width}x${height}`;
|
|
23
|
+
/**
|
|
24
|
+
* Why a picture of width x height cannot be the background of a canvas, in
|
|
25
|
+
* the author's words, or null when it can. The recommended resolution comes
|
|
26
|
+
* from the prompt document, which is what the author was told to generate.
|
|
27
|
+
*/
|
|
28
|
+
export function backgroundProblem(shape, canvas, width, height, svg) {
|
|
29
|
+
const bounds = BACKGROUND_BOUNDS[shape];
|
|
30
|
+
const [ratioWidth, ratioHeight] = bounds.ratio;
|
|
31
|
+
if (svg) {
|
|
32
|
+
const target = ratioWidth / ratioHeight;
|
|
33
|
+
if (Math.abs(width / height - target) / target > RATIO_TOLERANCE) {
|
|
34
|
+
return `That picture is ${width}x${height}, which is not ${canvas.ratio}. Rooms would sit wrong against it; draw it to ${canvas.ratio}.`;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (width * ratioHeight !== height * ratioWidth) {
|
|
39
|
+
return `That image is ${width}x${height}, which is not exactly ${canvas.ratio}. Rooms would sit wrong against it. Generate it at ${canvas.resolution}, or crop it to ${canvas.ratio}.`;
|
|
40
|
+
}
|
|
41
|
+
if (width < bounds.min[0] || height < bounds.min[1]) {
|
|
42
|
+
return `That image is ${width}x${height}, smaller than ${size(bounds.min)}. It would look soft on a large screen. Generate it at ${canvas.resolution}.`;
|
|
43
|
+
}
|
|
44
|
+
if (width > bounds.max[0] || height > bounds.max[1]) {
|
|
45
|
+
return `That image is ${width}x${height}, larger than ${size(bounds.max)}. Scale it down to ${canvas.resolution}.`;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
5
49
|
/** The name a background should have beside template.json, keeping its type. */
|
|
6
50
|
export function backgroundFileName(file, slot) {
|
|
7
51
|
const extension = isSvg(file) ? 'svg' : (/\.([a-z0-9]+)$/i.exec(file.name)?.[1] ?? 'png');
|
|
@@ -16,6 +60,8 @@ export function BackgroundStep(props) {
|
|
|
16
60
|
const [problem, setProblem] = useState(null);
|
|
17
61
|
/** The light image, when it is an SVG: the only kind a dark version can be made from. */
|
|
18
62
|
const [lightSvg, setLightSvg] = useState(null);
|
|
63
|
+
/** The rooms the light image carried, which a dark image is held to. */
|
|
64
|
+
const [lightOffice, setLightOffice] = useState(null);
|
|
19
65
|
/** A dark version made here, which the author needs as a file; they never had one. */
|
|
20
66
|
const [generated, setGenerated] = useState(null);
|
|
21
67
|
const [generating, setGenerating] = useState(false);
|
|
@@ -26,6 +72,29 @@ export function BackgroundStep(props) {
|
|
|
26
72
|
}, [generated]);
|
|
27
73
|
/** Check an image against the canvas, and hand it to the host if it fits. */
|
|
28
74
|
async function accept(file, slot) {
|
|
75
|
+
// An SVG is read before it is shown: what it carries decides what happens
|
|
76
|
+
// next, and a refused one is never shown at all.
|
|
77
|
+
let office = null;
|
|
78
|
+
if (isSvg(file)) {
|
|
79
|
+
office = importOfficeFile(await file.text(), backgroundFileName(file, slot));
|
|
80
|
+
if (office.kind === 'refused') {
|
|
81
|
+
setProblem(`That file cannot be used as a background. ${office.issues
|
|
82
|
+
.map((issue) => issue.message)
|
|
83
|
+
.join(' ')}`);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (slot === 'dark' && lightOffice) {
|
|
87
|
+
// The dark variant is a recolouring of the same scene, never a different
|
|
88
|
+
// layout: the rooms it carries must be the rooms the light one carries.
|
|
89
|
+
const moved = office.kind === 'office'
|
|
90
|
+
? firstMovedRoom(lightOffice.template, office.template)
|
|
91
|
+
: 'every room';
|
|
92
|
+
if (moved !== null) {
|
|
93
|
+
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.`);
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
29
98
|
const url = URL.createObjectURL(file);
|
|
30
99
|
const image = new Image();
|
|
31
100
|
const ok = await new Promise((resolve) => {
|
|
@@ -38,18 +107,13 @@ export function BackgroundStep(props) {
|
|
|
38
107
|
URL.revokeObjectURL(url);
|
|
39
108
|
return false;
|
|
40
109
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (Math.abs(actual - target) > 0.03) {
|
|
45
|
-
setProblem(`That image is ${image.width}x${image.height}, which is not ${canvas.ratio}. ` +
|
|
46
|
-
`Rooms would sit slightly wrong against it. Generate it at ${canvas.resolution}.`);
|
|
110
|
+
const refused = backgroundProblem(shape, canvas, image.width, image.height, isSvg(file));
|
|
111
|
+
if (refused) {
|
|
112
|
+
setProblem(refused);
|
|
47
113
|
URL.revokeObjectURL(url);
|
|
48
114
|
return false;
|
|
49
115
|
}
|
|
50
|
-
setProblem(
|
|
51
|
-
? `That image is only ${image.width} pixels wide. It will look soft on a large screen.`
|
|
52
|
-
: null);
|
|
116
|
+
setProblem(null);
|
|
53
117
|
if (slot === 'light') {
|
|
54
118
|
// A new light picture makes any dark version made from the old one stale.
|
|
55
119
|
setLightSvg(isSvg(file) ? file : null);
|
|
@@ -57,6 +121,11 @@ export function BackgroundStep(props) {
|
|
|
57
121
|
// Replaced by whatever came in now; generating sets it again straight after.
|
|
58
122
|
setGenerated(null);
|
|
59
123
|
props.onImage(slot, url, backgroundFileName(file, slot));
|
|
124
|
+
if (slot === 'light') {
|
|
125
|
+
const carried = office?.kind === 'office' ? office : null;
|
|
126
|
+
setLightOffice(carried);
|
|
127
|
+
props.onOffice?.(carried);
|
|
128
|
+
}
|
|
60
129
|
return true;
|
|
61
130
|
}
|
|
62
131
|
/**
|
|
@@ -84,16 +153,23 @@ export function BackgroundStep(props) {
|
|
|
84
153
|
setGenerating(false);
|
|
85
154
|
}
|
|
86
155
|
}
|
|
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.
|
|
156
|
+
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. A picture is exactly ", canvas.ratio, ", between", ' ', size(BACKGROUND_BOUNDS[shape].min), " and ", size(BACKGROUND_BOUNDS[shape].max), "; generate it at ", canvas.resolution, ". An SVG drawn to the office convention brings its rooms with it."] }), _jsx(Field, { label: "Light image", help: "PNG, JPEG, WebP or SVG.", children: (control) => (_jsx("input", { ...control, type: "file", accept: "image/png,image/jpeg,image/webp,image/svg+xml", className: "file-input file-input-bordered file-input-sm w-full", onChange: (event) => {
|
|
88
157
|
const file = event.target.files?.[0];
|
|
89
158
|
if (file)
|
|
90
159
|
void accept(file, 'light');
|
|
91
|
-
} })) }), _jsx(Preview, { url: props.images.light, label: "The light image" })
|
|
160
|
+
} })) }), _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 &&
|
|
161
|
+
`, 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/png,image/jpeg,image/webp,image/svg+xml", className: "file-input file-input-bordered file-input-sm w-full", onChange: (event) => {
|
|
92
162
|
const file = event.target.files?.[0];
|
|
93
163
|
if (file)
|
|
94
164
|
void accept(file, 'dark');
|
|
95
165
|
} })) }), 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 }))] }));
|
|
96
166
|
}
|
|
167
|
+
/** Every message, each on its own line, so the list copies cleanly. */
|
|
168
|
+
function Report({ issues, warnings, }) {
|
|
169
|
+
if (issues.length === 0 && warnings.length === 0)
|
|
170
|
+
return null;
|
|
171
|
+
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}`)))] }));
|
|
172
|
+
}
|
|
97
173
|
/** What is loaded, so the author can see it is the right picture before drawing on it. */
|
|
98
174
|
function Preview({ url, label }) {
|
|
99
175
|
if (!url) {
|
|
@@ -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;
|
|
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;AAC9C,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,GAEjB,MAAM,mBAAmB,CAAA;AAgD1B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAS1B;IACF,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;IACnE,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;IAC/D,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAA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{ 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,UAAU,GAIX,MAAM,8BAA8B,CAAA;AA6BrC,mFAAmF;AACnF,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC;IAC5C,aAAa,CAAC,UAAU;IACxB,aAAa,CAAC,aAAa;IAC3B,aAAa,CAAC,mBAAmB;CAClC,CAAC,CAAA;AAEF,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,SAAiB;IAChE,MAAM,MAAM,GAAoB,aA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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 { BACKGROUND_BOUNDS, BackgroundStep, backgroundFileName, backgroundProblem, RATIO_TOLERANCE, 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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB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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
|
@@ -13,8 +13,9 @@ export { OfficeBuilder } from './OfficeBuilder.js';
|
|
|
13
13
|
export { BuilderCanvas } from './canvas/BuilderCanvas.js';
|
|
14
14
|
export { BuilderSteps } from './BuilderSteps.js';
|
|
15
15
|
export { PromptStep } from './prompt/PromptStep.js';
|
|
16
|
-
export { BackgroundStep, backgroundFileName, } from './background/BackgroundStep.js';
|
|
16
|
+
export { BACKGROUND_BOUNDS, BackgroundStep, backgroundFileName, backgroundProblem, RATIO_TOLERANCE, } 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,
|
|
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,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,GAIhB,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"}
|
package/dist/panel/SaveBar.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|
package/dist/panel/SaveBar.js
CHANGED
|
@@ -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,
|
|
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,KAMvB;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,KAAK,CAAA;IAEpC,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,EAAE,CAAC,CAC5C,uBAAoC,KAAK,CAAC,OAAO,IAAxC,GAAG,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
|
*
|
|
@@ -11,6 +11,12 @@ import { type PromptDocument } from './prompt.js';
|
|
|
11
11
|
* The canvas shape is chosen here because it cannot change afterwards: every
|
|
12
12
|
* room is placed relative to it. The step says so rather than letting somebody
|
|
13
13
|
* find out after an hour of drawing.
|
|
14
|
+
*
|
|
15
|
+
* The step fits one screen. There are two ways to a picture, a painting the
|
|
16
|
+
* rooms are drawn onto or an SVG that carries them, and each is a tab, so
|
|
17
|
+
* neither sits under the other; the fields that tune the picture prompt and
|
|
18
|
+
* the advice about it fold away until wanted, since most authors copy the
|
|
19
|
+
* prompt as a preset filled it.
|
|
14
20
|
*/
|
|
15
21
|
export interface PromptStepProps {
|
|
16
22
|
document: PromptDocument;
|
|
@@ -18,6 +24,12 @@ export interface PromptStepProps {
|
|
|
18
24
|
onShapeChange(shape: CanvasShape): void;
|
|
19
25
|
/** What choosing a different shape would undo, said before it happens. */
|
|
20
26
|
shapeChangeWarning?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The other way to a picture: a prompt per theme and view that asks an
|
|
29
|
+
* assistant for an office drawn to the SVG convention, rooms included, so the
|
|
30
|
+
* rooms step opens laid out. Absent, and only the picture prompt is offered.
|
|
31
|
+
*/
|
|
32
|
+
officePrompts?: readonly OfficePrompt[];
|
|
21
33
|
}
|
|
22
34
|
export declare function PromptStep(props: PromptStepProps): import("react").JSX.Element;
|
|
23
35
|
//# 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
|
|
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;;;;;;;;;;;;;;;;;GAiBG;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;AAUD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BA0MhD"}
|
|
@@ -1,24 +1,50 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Alert, Button, Icon, Input, Textarea } from '@unityevolv/unitykit';
|
|
2
|
+
import { Accordion, Alert, Button, Icon, Input, Tabs, Textarea } from '@unityevolv/unitykit';
|
|
3
3
|
import { CANVAS_SHAPES } from '@unityevolv/ofiskit-template';
|
|
4
4
|
import { useMemo, useState } from 'react';
|
|
5
5
|
import { applyPreset, defaultSlots, renderPrompt, } from './prompt.js';
|
|
6
|
+
/** The look of a choice among a few, pressed or not: shapes, themes and views. */
|
|
7
|
+
const choice = (pressed) => [
|
|
8
|
+
'rounded-lg border px-3 py-2 text-sm',
|
|
9
|
+
'focus-visible:outline-2 focus-visible:outline-primary',
|
|
10
|
+
pressed ? 'border-primary bg-primary/10 font-medium' : 'border-base-300 hover:bg-base-200',
|
|
11
|
+
].join(' ');
|
|
6
12
|
export function PromptStep(props) {
|
|
7
13
|
const { document: prompt, shape } = props;
|
|
8
14
|
const [values, setValues] = useState(() => defaultSlots(prompt));
|
|
9
|
-
const [copied, setCopied] = useState(
|
|
15
|
+
const [copied, setCopied] = useState(null);
|
|
16
|
+
const [officeId, setOfficeId] = useState(props.officePrompts?.[0]?.id ?? null);
|
|
10
17
|
const text = useMemo(() => renderPrompt(prompt, shape, values), [prompt, shape, values]);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const office = props.officePrompts?.find((candidate) => candidate.id === officeId) ?? null;
|
|
19
|
+
function copy(which, content) {
|
|
20
|
+
void navigator.clipboard.writeText(content).then(() => {
|
|
21
|
+
setCopied(which);
|
|
22
|
+
setTimeout(() => setCopied(null), 2000);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const picture = (_jsxs("div", { className: "grid gap-4 pt-3 lg:grid-cols-[1fr_18rem]", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-base 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("p", { className: "mt-1 text-sm text-base-content/75", children: "Paste it into an image model, or hand it to an illustrator, and upload the picture on the next step." }), _jsx(Textarea, { readOnly: true, value: text, rows: 9, className: "mt-2 font-mono text-xs", "aria-label": "The prompt" })] }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold", children: "Start from a theme" }), _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(Accordion, { type: "multiple", variant: "plus", headingLevel: 3, items: [
|
|
26
|
+
{
|
|
27
|
+
value: 'fields',
|
|
28
|
+
title: 'Adjust the prompt',
|
|
29
|
+
content: (_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))) })),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 'guidance',
|
|
33
|
+
title: 'Worth knowing',
|
|
34
|
+
content: (_jsx("ul", { className: "list-disc space-y-1 pl-4 text-xs text-base-content/75", children: prompt.guidance.map((line) => (_jsx("li", { children: line }, line))) })),
|
|
35
|
+
},
|
|
36
|
+
] })] })] }));
|
|
37
|
+
/*
|
|
38
|
+
* The same job done the other way round: instead of a painting the rooms
|
|
39
|
+
* are drawn onto by hand, an SVG that carries its rooms, drawn by the
|
|
40
|
+
* author's own assistant from a theme's symbols. The prompt is generated
|
|
41
|
+
* from the spec and the symbols and only copied here, so what the
|
|
42
|
+
* assistant is told and what the importer accepts cannot drift apart.
|
|
43
|
+
*/
|
|
44
|
+
const drawn = props.officePrompts && props.officePrompts.length > 0 && office ? (_jsxs("div", { className: "pt-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-base 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: choice(candidate.id === office.id), children: candidate.label }, candidate.id))) }), _jsx(Textarea, { readOnly: true, value: office.text, rows: 9, className: "mt-2 font-mono text-xs", "aria-label": "The office prompt" })] })) : null;
|
|
45
|
+
return (_jsxs("div", { className: "mx-auto max-w-5xl space-y-4 p-4", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [_jsx("h2", { className: "text-base font-semibold", children: "Shape of the office" }), _jsx("div", { className: "flex flex-wrap gap-2", children: CANVAS_SHAPES.map((candidate) => (_jsxs("button", { type: "button", onClick: () => props.onShapeChange(candidate), "aria-pressed": shape === candidate, className: choice(shape === candidate), children: [prompt.canvases[candidate].label, _jsx("span", { className: "ms-2 text-xs text-base-content", children: prompt.canvases[candidate].resolution })] }, candidate))) })] }), _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." }), props.shapeChangeWarning && (_jsx(Alert, { variant: "warn", className: "mt-3", children: props.shapeChangeWarning }))] }), drawn ? (_jsx(Tabs, { label: "How to get the picture", variant: "border", items: [
|
|
46
|
+
{ value: 'picture', label: 'Picture prompt', content: picture },
|
|
47
|
+
{ value: 'office', label: 'Office prompt: your AI draws the rooms', content: drawn },
|
|
48
|
+
] })) : (picture)] }));
|
|
23
49
|
}
|
|
24
50
|
//# sourceMappingURL=PromptStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptStep.js","sourceRoot":"","sources":["../../src/prompt/PromptStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"PromptStep.js","sourceRoot":"","sources":["../../src/prompt/PromptStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAoB,MAAM,8BAA8B,CAAA;AAC9E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,GAIb,MAAM,aAAa,CAAA;AAmCpB,kFAAkF;AAClF,MAAM,MAAM,GAAG,CAAC,OAAgB,EAAE,EAAE,CAClC;IACE,qCAAqC;IACrC,uDAAuD;IACvD,OAAO,CAAC,CAAC,CAAC,0CA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EAAC,gCAAgC,YAC7C,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,UAAU,GACjC,KAfF,SAAS,CAgBP,CACV,CAAC,GACE,IACF,EACN,YAAG,SAAS,EAAC,mCAAmC,uGAE5C,EACH,KAAK,CAAC,kBAAkB,IAAI,CAC3B,KAAC,KAAK,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YACnC,KAAK,CAAC,kBAAkB,GACnB,CACT,IACG,EAEL,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IACH,KAAK,EAAC,wBAAwB,EAC9B,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE;oBACL,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE;oBAC/D,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,wCAAwC,EAAE,OAAO,EAAE,KAAK,EAAE;iBACrF,GACD,CACH,CAAC,CAAC,CAAC,CACF,OAAO,CACR,IACG,CACP,CAAA;AACH,CAAC"}
|
package/dist/prompt/prompt.d.ts
CHANGED
|
@@ -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,8BAA8B,CAAA;AAE/D;;;;;;;;GAQG;AAEH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACnF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACjC,8EAA8E;IAC9E,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACtC;A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,CAAA;IACjC,8EAA8E;IAC9E,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACtC;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE/C,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,UAAU,CAIjE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,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"}
|
package/dist/prompt/prompt.js
CHANGED
|
@@ -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,CAAC,CAAC,CACzE,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAwB,EACxB,KAAkB,EAClB,MAAkB;IAElB,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEvC,MAAM,aAAa,GAA2B;QAC5C,GAAG,MAAM;QACT,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE;QACvC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5D,CAAA;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE,CACxE,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,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O,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
|
+
"version": "0.5.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",
|