@marktiderman/genesis-forms-studio 0.0.0-stage → 0.2.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/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,98 @@
1
- # Temporary Holding Version
1
+ # @marktiderman/genesis-forms-studio
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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
+ - Partial responses, for a form that saves answers as they go (`settings.saveProgress`): give each
62
+ item its `status` (`in_progress`, `partial`, `completed`) and, unfinished, its `furthest`
63
+ question (genesis-forms `formProgress`'s `fieldId`). Filters show sent and partial responses by
64
+ default (summaries count both; the Responses card says how many are partial);
65
+ `<ResponsesFilters statuses>` adds the status menu (Sent and partial, Sent, Partial, In
66
+ progress).
67
+ - `DropOffByQuestion` from `dropOffByQuestion(items, definitions)`: for each question, how many
68
+ people reached it, how many stopped there, and the drop-off share. A sent response reached
69
+ every question; a partial one, every question up to its furthest; in-progress ones are left out.
70
+ - `PhotoAnswer` (`{ photos, resolveUrl }`): a response's photos as thumbnails, each opening full
71
+ size in a new tab. The host resolves each reference to an address it may show (a short-lived
72
+ signed link, say) or null; a photo most browsers can't draw (HEIC) is a tile with its name and an
73
+ Open link, and one that can't be found says "Photo unavailable". In cells and CSVs a photo answer
74
+ is its file names.
75
+
76
+ ## Settings
77
+
78
+ `ResourceSettingsPage` puts every section on one page with jump links ("On this page"); each
79
+ section is a `SettingsSection` card whose rows are genesis-ui `SettingsRow` and `ToggleRow`. A
80
+ section without `content` is a jump link only, for a part of the page the host renders elsewhere.
81
+
82
+ ## Share
83
+
84
+ `ShareDialog`: the link with Copy, a QR code and poster (the host draws it), embed code, and a
85
+ prefilled-link builder (`prefilledUrl`).
86
+
87
+ ## Rules only
88
+
89
+ `@marktiderman/genesis-forms-studio/rules` has the pure functions without React, for a server:
90
+ `summarizeResponses`, the filters, `answerColumns`, `answersByKey`, `answerCell`, `toCsv`,
91
+ `carryAnswers`, `formAvailability`, `takesResponses`, `prefilledUrl`, `embedSnippet` and the rest.
92
+
93
+ ## Generic pieces
94
+
95
+ `src/generic/` holds what isn't about forms: `ResourceHeader`, `ReadinessChip`,
96
+ `ResponsesToolbar`, `HeadlineNumbers`, `SummaryCard`, `FollowUpList`,
97
+ `ResourceSettingsPage`, `SettingsSection`, `ShareDialog` and their words. Courses, lessons and
98
+ worksheets use the same page pattern, so these are meant to move to genesis-ui.