@isi-ui7/bos7-shared 0.2.0 → 0.2.2

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,6 @@
1
1
  {
2
2
  "name": "@isi-ui7/bos7-shared",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Shared auth7 and layout primitives for bos7 applications.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,7 +13,44 @@
13
13
  "module": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "exports": {
16
- ".": "./dist/index.js"
16
+ ".": "./dist/index.js",
17
+ "./auth7": "./src/auth7/index.ts",
18
+ "./page-layout": "./src/page-layout.tsx",
19
+ "./modal-layout": "./src/modal-layout.tsx",
20
+ "./form-layout": "./src/form-layout.tsx",
21
+ "./backend": "./src/backend.ts",
22
+ "./export": "./src/export.ts",
23
+ "./types/notification": "./src/types/notification.ts",
24
+ "./nats/client": "./src/nats/client.ts",
25
+ "./event-bus": "./src/event-bus/index.ts",
26
+ "./event-bus/useEventBus": "./src/event-bus/useEventBus.ts",
27
+ "./api": "./src/api.ts",
28
+ "./types/core": "./src/types/core.ts",
29
+ "./style-contract": "./src/style-contract.ts",
30
+ "./crud-components": "./src/crud-components.tsx",
31
+ "./workflow/backend": "./src/workflow/backend.ts",
32
+ "./workflow/notif7": "./src/workflow/notif7.ts",
33
+ "./workflow/api-client": "./src/workflow/api-client.ts",
34
+ "./workflow/starter": "./src/workflow/starter.ts",
35
+ "./workflow/use-workflow-tracker": "./src/workflow/use-workflow-tracker.ts",
36
+ "./workflow/crud-client": "./src/workflow/crud-client.ts",
37
+ "./data-table/cursor-adapter": "./src/data-table/cursor-adapter.ts",
38
+ "./notification/routing": "./src/notification/routing.ts",
39
+ "./shell/interaction": "./src/shell/interaction.ts",
40
+ "./shell/branch": "./src/shell/branch.ts",
41
+ "./notif7": "./src/notif7.ts",
42
+ "./shell/provider": "./src/shell/provider.tsx",
43
+ "./shell/app-shell-layout": "./src/shell/app-shell-layout.tsx",
44
+ "./notifications-bff": "./src/notifications-bff.ts",
45
+ "./observability/otel-init": "./src/observability/otel-init.ts",
46
+ "./form-types": "./src/form-types.ts",
47
+ "./form-numeric": "./src/form-numeric.ts",
48
+ "./form-renderer": "./src/form-renderer.tsx",
49
+ "./form-renderer-utils": "./src/form-renderer-utils.ts",
50
+ "./form-rules": "./src/form-rules.ts",
51
+ "./i18n": "./src/i18n.tsx",
52
+ "./workflow/use-crud-form": "./src/workflow/use-crud-form.ts",
53
+ "./styles": "./src/form-contract.css"
17
54
  },
18
55
  "publishConfig": {
19
56
  "registry": "https://registry.npmjs.org",
@@ -61,13 +98,13 @@
61
98
  "next": "16.1.1",
62
99
  "@carbon/react": "^1.97.0",
63
100
  "@carbon/icons-react": "^11.71.0",
101
+ "@isi-ui7/ui-shell": "0.2.2",
64
102
  "@isi-ui7/i18n": "0.2.0",
65
- "@isi-ui7/data-table": "0.2.1",
66
- "@isi-ui7/realtime": "0.2.2",
67
103
  "@isi-ui7/corporate-themes": "0.2.2",
68
- "@isi-ui7/lookup-input": "0.2.1",
69
- "@isi-ui7/ui-shell": "0.2.2",
70
- "@isi-ui7/modal-manager": "0.2.1"
104
+ "@isi-ui7/realtime": "0.2.2",
105
+ "@isi-ui7/modal-manager": "0.2.1",
106
+ "@isi-ui7/data-table": "0.2.1",
107
+ "@isi-ui7/lookup-input": "0.2.1"
71
108
  },
72
109
  "dependencies": {
73
110
  "@carbon/icons-react": "^11.71.0",
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { type ReactNode, useCallback, useState } from "react";
3
+ import { type ReactNode, useCallback, useEffect, useState } from "react";
4
4
  import { Add } from "@carbon/icons-react";
5
5
  import {
6
6
  Button,
@@ -112,6 +112,15 @@ export function CrudSchemaListPage<TData extends Record<string, unknown>>({
112
112
  }, [listSchema.title]),
113
113
  });
114
114
 
115
+ // Pick up instanceId parked by create/edit page before navigating back.
116
+ const { track } = tracker;
117
+ useEffect(() => {
118
+ const pendingId = sessionStorage.getItem('bos7:pending_wf_instance');
119
+ if (!pendingId) return;
120
+ sessionStorage.removeItem('bos7:pending_wf_instance');
121
+ track(pendingId);
122
+ }, [track]);
123
+
115
124
  const onPopupClick = useCallback(
116
125
  (row: Record<string, unknown>, actionId: string) => {
117
126
  const rid = encodeURIComponent(String(row.id ?? ""));
@@ -378,29 +378,28 @@ export function SchemaFormRenderer<TData extends Record<string, unknown>>({
378
378
  const lookup = field.lookup;
379
379
  return [
380
380
  <div key={key} className={UI7_FORM_VISUAL_CLASSNAMES.column} style={wrapperStyle}>
381
- <LookupInput
382
- id={key}
383
- labelText={mkLabel(field.label, effectiveRequired)}
384
- value={asString(rawValue)}
385
- onChange={(next: string) => setValue(field.key, next as TData[keyof TData])}
386
- onDataSelected={(row: Record<string, unknown>) => {
387
- if (lookup?.onDataPatch) {
388
- const patch = lookup.onDataPatch(row as never, value);
389
- onChange?.(patch);
390
- }
391
- }}
392
- dataSource={lookup?.dataSource ?? "api"}
393
- lookupAPI={lookup?.lookupAPI ?? ""}
394
- lookupDataStructure={lookup?.lookupDataStructure ?? {}}
395
- lookupFieldTitles={lookup?.lookupFieldTitles ?? {}}
396
- displayFieldNames={lookup?.displayFieldNames ?? []}
397
- popupWidthPx={lookup?.popupWidthPx}
398
- placeholder={lookup?.placeholder}
399
- disabled={disabled}
400
- />
401
- {field.helperText ? (
402
- <div className={UI7_FORM_VISUAL_CLASSNAMES.helper}>{field.helperText}</div>
403
- ) : null}
381
+ <FieldShell label={field.label} required={effectiveRequired} helperText={field.helperText} htmlFor={key}>
382
+ <LookupInput
383
+ id={key}
384
+ labelText=""
385
+ value={asString(rawValue)}
386
+ onChange={(next: string) => setValue(field.key, next as TData[keyof TData])}
387
+ onDataSelected={(row: Record<string, unknown>) => {
388
+ if (lookup?.onDataPatch) {
389
+ const patch = lookup.onDataPatch(row as never, value);
390
+ onChange?.(patch);
391
+ }
392
+ }}
393
+ dataSource={lookup?.dataSource ?? "api"}
394
+ lookupAPI={lookup?.lookupAPI ?? ""}
395
+ lookupDataStructure={lookup?.lookupDataStructure ?? {}}
396
+ lookupFieldTitles={lookup?.lookupFieldTitles ?? {}}
397
+ displayFieldNames={lookup?.displayFieldNames ?? []}
398
+ popupWidthPx={lookup?.popupWidthPx}
399
+ placeholder={lookup?.placeholder}
400
+ disabled={disabled}
401
+ />
402
+ </FieldShell>
404
403
  </div>,
405
404
  ];
406
405
  }
@@ -149,6 +149,7 @@ export function useCrudForm<TData extends Record<string, unknown>>({
149
149
  const url = resolveApiPath(schema.updateApiPath, params);
150
150
  instanceId = await submitWorkflowForm(url, "PUT", form);
151
151
  }
152
+ sessionStorage.setItem('bos7:pending_wf_instance', instanceId);
152
153
  onSuccess?.(instanceId);
153
154
  } catch (e: unknown) {
154
155
  setServerError(e instanceof Error ? e.message : String(e));