@marktiderman/genesis-forms-studio 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +83 -2
- package/dist/chunk-ZHH2UHOS.js +632 -0
- package/dist/chunk-ZHH2UHOS.js.map +1 -0
- package/dist/index.d.ts +268 -0
- package/dist/index.js +885 -0
- package/dist/index.js.map +1 -0
- package/dist/rules-BntWGD6S.d.ts +418 -0
- package/dist/rules.d.ts +4 -0
- package/dist/rules.js +3 -0
- package/dist/rules.js.map +1 -0
- package/dist/styles.css +10 -0
- package/package.json +66 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mark Tiderman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @marktiderman/genesis-forms-studio
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The workspace around a [Genesis Forms](../forms/README.md) builder: the page header, the
|
|
4
|
+
Responses tab, the Settings page and the Share dialog. It stores nothing. The host passes the
|
|
5
|
+
form's rows and handles every action (save, publish, mark handled, reply), so any app can use it.
|
|
6
|
+
|
|
7
|
+
```css
|
|
8
|
+
@import "tailwindcss";
|
|
9
|
+
@import "@marktiderman/genesis-ui/styles.css";
|
|
10
|
+
@import "@marktiderman/genesis-forms-studio/styles.css";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## The page
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import {
|
|
17
|
+
ResourceHeader, ReadinessChip, formNavItems, formStatusChip, FORM_NAV_ICONS,
|
|
18
|
+
formAvailability, formCounts, readinessOf,
|
|
19
|
+
} from "@marktiderman/genesis-forms-studio";
|
|
20
|
+
import { AppShellPageHeader, AppShellSubNavEnd, useAppShellSubNav } from "@marktiderman/genesis-ui/layout";
|
|
21
|
+
|
|
22
|
+
useAppShellSubNav(
|
|
23
|
+
formNavItems(`/forms/${form.id}`, { ...formCounts(definition), responses }, FORM_NAV_ICONS),
|
|
24
|
+
{ mode: "tabs" },
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
<AppShellPageHeader>
|
|
28
|
+
<ResourceHeader
|
|
29
|
+
title={form.title}
|
|
30
|
+
parent={<Link to="/forms">Forms</Link>}
|
|
31
|
+
status={formStatusChip(formAvailability(form), form.version)}
|
|
32
|
+
saveState="saved"
|
|
33
|
+
onUndo={builder.undo} onRedo={builder.redo}
|
|
34
|
+
onPreview={openPreview} onShare={openShare}
|
|
35
|
+
publish={{ onClick: publish, label: form.version ? "Publish changes" : "Publish" }}
|
|
36
|
+
/>
|
|
37
|
+
</AppShellPageHeader>
|
|
38
|
+
<AppShellSubNavEnd><ReadinessChip readiness={readinessOf(analysis.findings)} /></AppShellSubNavEnd>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- `formNavItems("/forms/f1", { questions, logic, responses })` declares the form's four child items
|
|
42
|
+
(Questions, Logic and endings, Responses, Settings) as `?tab=` links with their counts as badges,
|
|
43
|
+
for the app shell's `useAppShellSubNav`. `formCounts(definition)` gives the first two.
|
|
44
|
+
- `ReadinessChip` ("Ready to publish", or "3 problems to fix") goes in the row's trailing slot,
|
|
45
|
+
`<AppShellSubNavEnd>`. `readinessOf(analysis.findings)` reads it from the builder's checks.
|
|
46
|
+
|
|
47
|
+
## Responses
|
|
48
|
+
|
|
49
|
+
- `ResponsesToolbar`: the Summary / Each response switch, the host's filters and its export
|
|
50
|
+
actions (a Sheet, Download CSV).
|
|
51
|
+
- `ResponsesFilters`: when (presets or dates), choice filters over extra columns (a class, a
|
|
52
|
+
coach), a rating floor, and the low-ratings chip. Its value goes through `toResponseFilter` and
|
|
53
|
+
`filterResponses`.
|
|
54
|
+
- `HeadlineNumbers` with `headlineNumbers(items, definitions, { previous })` and `headlineCards`:
|
|
55
|
+
Responses (and the change against the period before, from `comparisonFilter`), Average rating,
|
|
56
|
+
Low ratings, and the consent or yes/no rate.
|
|
57
|
+
- `QuestionSummaryCards` from `summarizeResponses`: each rating's spread with low scores marked,
|
|
58
|
+
choice counts, consent and yes/no as one split bar, and the latest written answers.
|
|
59
|
+
- `FollowUpList` from `needsFollowUp(items, { isHandled })`: low-rated responses, newest first,
|
|
60
|
+
with the host's actions on each.
|
|
61
|
+
|
|
62
|
+
## Settings
|
|
63
|
+
|
|
64
|
+
`ResourceSettingsPage` puts every section on one page with jump links ("On this page"); each
|
|
65
|
+
section is a `SettingsSection` card whose rows are genesis-ui `SettingsRow` and `ToggleRow`. A
|
|
66
|
+
section without `content` is a jump link only, for a part of the page the host renders elsewhere.
|
|
67
|
+
|
|
68
|
+
## Share
|
|
69
|
+
|
|
70
|
+
`ShareDialog`: the link with Copy, a QR code and poster (the host draws it), embed code, and a
|
|
71
|
+
prefilled-link builder (`prefilledUrl`).
|
|
72
|
+
|
|
73
|
+
## Rules only
|
|
74
|
+
|
|
75
|
+
`@marktiderman/genesis-forms-studio/rules` has the pure functions without React, for a server:
|
|
76
|
+
`summarizeResponses`, the filters, `answerColumns`, `answersByKey`, `answerCell`, `toCsv`,
|
|
77
|
+
`carryAnswers`, `formAvailability`, `takesResponses`, `prefilledUrl`, `embedSnippet` and the rest.
|
|
78
|
+
|
|
79
|
+
## Generic pieces
|
|
80
|
+
|
|
81
|
+
`src/generic/` holds what isn't about forms: `ResourceHeader`, `ReadinessChip`,
|
|
82
|
+
`ResponsesToolbar`, `HeadlineNumbers`, `SummaryCard`, `FollowUpList`,
|
|
83
|
+
`ResourceSettingsPage`, `SettingsSection`, `ShareDialog` and their words. Courses, lessons and
|
|
84
|
+
worksheets use the same page pattern, so these are meant to move to genesis-ui.
|