@xeplr/cli 0.3.12 → 0.3.14
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/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 48" width="200" height="48" role="img" aria-label="Sample logo">
|
|
2
|
+
<!-- An <img> draws currentColor as black, so the name follows the
|
|
3
|
+
viewer's light or dark setting itself. -->
|
|
4
|
+
<style>text { fill: #1f2937 } @media (prefers-color-scheme: dark) { text { fill: #f3f4f6 } }</style>
|
|
2
5
|
<rect x="2" y="8" width="32" height="32" rx="8" fill="#6366f1"/>
|
|
3
6
|
<path d="M10 16h16M18 16v16M14 32h8" stroke="#fff" stroke-width="3.5" stroke-linecap="round"/>
|
|
4
7
|
<text x="44" y="31" font-family="system-ui, -apple-system, Segoe UI, Roboto, sans-serif"
|
|
5
|
-
font-size="18" font-weight="600"
|
|
8
|
+
font-size="18" font-weight="600" >Your App</text>
|
|
6
9
|
</svg>
|
|
@@ -20,6 +20,18 @@ export default function FormDesigner() {
|
|
|
20
20
|
const screenKey = form + (part === 'list' ? '_list' : '_edit')
|
|
21
21
|
const [current, setCurrent] = useState(null) // { key, document, lockedNames }
|
|
22
22
|
const [error, setError] = useState(null)
|
|
23
|
+
// BOTH SCREENS' DOCUMENTS, not just their names. The list's Columns are
|
|
24
|
+
// the FORM's fields, and its "Edit in" opens the form: without the form's
|
|
25
|
+
// document the list can offer only the columns it already has, so a field
|
|
26
|
+
// added to the form could never be shown in its list.
|
|
27
|
+
const [documents, setDocuments] = useState({})
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
let cancelled = false
|
|
31
|
+
Promise.all(PARTS.map((p) => factory.loadDraft(form + p.suffix).then((row) => [p.part, row.document], () => [p.part, null])))
|
|
32
|
+
.then((pairs) => { if (!cancelled) setDocuments(Object.fromEntries(pairs)) })
|
|
33
|
+
return () => { cancelled = true }
|
|
34
|
+
}, [form, part])
|
|
23
35
|
|
|
24
36
|
useEffect(() => {
|
|
25
37
|
let cancelled = false
|
|
@@ -65,7 +77,7 @@ export default function FormDesigner() {
|
|
|
65
77
|
document={current.document}
|
|
66
78
|
lockedNames={current.lockedNames}
|
|
67
79
|
onPublish={publish}
|
|
68
|
-
screens={PARTS.map((p) => ({ id: form + p.suffix, name: p.label }))}
|
|
80
|
+
screens={PARTS.map((p) => ({ id: form + p.suffix, name: p.label, document: documents[p.part] || undefined }))}
|
|
69
81
|
/>
|
|
70
82
|
</div>
|
|
71
83
|
)}
|