@odla-ai/chapter 0.25.1 → 0.25.3

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.
@@ -168,6 +168,8 @@ interface CollectionSectionOptions {
168
168
  lifecycle?: boolean;
169
169
  roles?: readonly string[];
170
170
  networkSharing?: boolean;
171
+ /** Give the collection list the full workspace width until a record opens. */
172
+ collapseClosedDetail?: boolean;
171
173
  lifecycleAdapter?: (CrmLifecycleAdapter | ((ctx: AdminSectionContext) => CrmLifecycleAdapter));
172
174
  requireLifecycleAdapter?: boolean;
173
175
  renderSummary?: (context: CrmWorkspaceMasterContext, ctx: AdminSectionContext) => ComponentChildren;
@@ -183,6 +185,7 @@ declare function collectionSection(options: CollectionSectionOptions): AdminSect
183
185
  declare function peopleSection(options: PeopleSectionOptions & {
184
186
  roles?: readonly string[];
185
187
  networkSharing?: boolean;
188
+ collapseClosedDetail?: boolean;
186
189
  lifecycleAdapter?: CollectionSectionOptions["lifecycleAdapter"];
187
190
  requireLifecycleAdapter?: boolean;
188
191
  renderSummary?: CollectionSectionOptions["renderSummary"];
@@ -24,7 +24,7 @@ import {
24
24
  meetingsSection,
25
25
  peopleSection,
26
26
  useAdminResource
27
- } from "../../chunk-ZPAJL7KG.js";
27
+ } from "../../chunk-AWBRQH7E.js";
28
28
  import {
29
29
  ChapterCopyProvider,
30
30
  useChapterCopy
package/dist/ui/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  loadJoinResume,
14
14
  timeLabel,
15
15
  tzShort
16
- } from "../chunk-GMGTJIY3.js";
16
+ } from "../chunk-WHA3MUDQ.js";
17
17
  import {
18
18
  AdminNote,
19
19
  AdminPage,
@@ -40,7 +40,7 @@ import {
40
40
  meetingsSection,
41
41
  peopleSection,
42
42
  useAdminResource
43
- } from "../chunk-ZPAJL7KG.js";
43
+ } from "../chunk-AWBRQH7E.js";
44
44
  import {
45
45
  BrandStyle,
46
46
  ChapterCopyProvider,
@@ -206,7 +206,8 @@ interface JoinIslandProps {
206
206
  children?: ComponentChildren;
207
207
  };
208
208
  }
209
- /** The signup island. Renders the site's form, then drives payment (when the
209
+ /** The signup island. Renders the site's form, keeps one application
210
+ * `submissionId` across ambiguous retries, then drives payment (when the
210
211
  * chapter charges) and booking (when a calendar is connected) to confirmation. */
211
212
  declare function JoinIsland(props: JoinIslandProps): JSX.Element;
212
213
 
@@ -13,7 +13,7 @@ import {
13
13
  loadJoinResume,
14
14
  timeLabel,
15
15
  tzShort
16
- } from "../../chunk-GMGTJIY3.js";
16
+ } from "../../chunk-WHA3MUDQ.js";
17
17
  import {
18
18
  BrandStyle,
19
19
  ChapterCopyProvider,
@@ -138,6 +138,17 @@ function createWorkerContext(options) {
138
138
  // src/worker-routes.ts
139
139
  var import_crm2 = require("@odla-ai/crm");
140
140
 
141
+ // src/application-id.ts
142
+ var APPLICATION_ID_DOMAIN = "odla-ai/chapter/application/v1:";
143
+ async function applicationIdForSubmission(submissionId) {
144
+ const input = new TextEncoder().encode(`${APPLICATION_ID_DOMAIN}${submissionId}`);
145
+ const bytes = new Uint8Array(await crypto.subtle.digest("SHA-256", input)).slice(0, 16);
146
+ bytes[6] = bytes[6] & 15 | 128;
147
+ bytes[8] = bytes[8] & 63 | 128;
148
+ const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
149
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
150
+ }
151
+
141
152
  // src/member.ts
142
153
  var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
143
154
  function isValidEmail(value) {
@@ -181,7 +192,7 @@ async function submitApplication(db, chapter, fields, opts) {
181
192
  if (app.requireDisclaimerAck && !acked) {
182
193
  return { ok: false, error: "disclaimerAck is required" };
183
194
  }
184
- const id = opts.newId();
195
+ const id = opts.submissionId ? await applicationIdForSubmission(opts.submissionId) : opts.newId();
185
196
  const row = { id, status: chapter.pipeline.initial, createdAt: opts.now };
186
197
  for (const f of [...app.required, ...app.optional]) {
187
198
  if (typeof fields[f] === "string") row[f] = fields[f].trim();