@semiont/react-ui 0.5.26 → 0.5.28
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/README.md +28 -4
- package/dist/{PdfAnnotationCanvas.client-6ZSF6ZTJ.js → PdfAnnotationCanvas.client-C2IGG4SW.js} +33 -6
- package/dist/{PdfAnnotationCanvas.client-JCJMXWWJ.css → PdfAnnotationCanvas.client-TGDPPGXJ.css} +6 -1
- package/dist/{ar-YTUUGK2O.js → ar-FABPTJVB.js} +88 -26
- package/dist/{bn-ASGNGPMD.js → bn-LKP6BDMH.js} +88 -26
- package/dist/{chunk-L3WKRWP3.js → chunk-2GOHTTHW.js} +88 -26
- package/dist/{chunk-OBQOZCJE.js → chunk-2YHEE63S.js} +31 -31
- package/dist/{cs-WMYVAOZY.js → cs-YQYNWHRG.js} +88 -26
- package/dist/{da-FSHHN4D6.js → da-QHZOYKRY.js} +88 -26
- package/dist/{de-FJFO3TPT.js → de-GKA7RD7J.js} +88 -26
- package/dist/{el-XOH4QIAG.js → el-45T257AL.js} +88 -26
- package/dist/{en-3FCBW3YD.js → en-RVW5EQ66.js} +4 -2
- package/dist/{es-HDX4QI7E.js → es-AVER7RU4.js} +88 -26
- package/dist/{fa-DJ6WTFTJ.js → fa-K3VPK3O2.js} +88 -26
- package/dist/{fi-4S7H7W7U.js → fi-5NEKF7EB.js} +88 -26
- package/dist/{fr-6UJSYHXC.js → fr-FUMNDLBZ.js} +88 -26
- package/dist/{he-ZZJOHJX2.js → he-3JGNA3PR.js} +88 -26
- package/dist/{hi-HZJTAW7U.js → hi-IJY375DF.js} +88 -26
- package/dist/{id-E3I6ILEM.js → id-LWHKJ7ZD.js} +88 -26
- package/dist/index.css +380 -524
- package/dist/index.d.ts +318 -192
- package/dist/index.js +2960 -2421
- package/dist/integrations/css-modules-helper.js +1 -3
- package/dist/{it-ULAPAD7U.js → it-EBVOV4RW.js} +88 -26
- package/dist/{ja-SAHZQ4CZ.js → ja-KWRIX2NF.js} +88 -26
- package/dist/{ko-DFU2ADQ4.js → ko-L5CJMFDS.js} +88 -26
- package/dist/{ms-NWL76XNT.js → ms-LSNMJDR2.js} +88 -26
- package/dist/{nl-ATCM76WN.js → nl-ZB32MB7U.js} +88 -26
- package/dist/{no-UIAQ5RJF.js → no-4GTNY7M5.js} +88 -26
- package/dist/{pl-NOECQDXD.js → pl-LUHBLTHB.js} +88 -26
- package/dist/{pt-SVWIIUPC.js → pt-C4H3UNQ6.js} +88 -26
- package/dist/{ro-NR2DRTZG.js → ro-GGITS5V4.js} +88 -26
- package/dist/{sv-STVJ37JP.js → sv-T56RTLBP.js} +88 -26
- package/dist/test-utils.css +1 -1
- package/dist/test-utils.d.ts +1 -1
- package/dist/test-utils.js +2 -2
- package/dist/{th-UWQR4K54.js → th-22X2IWCB.js} +88 -26
- package/dist/{tr-WNXZSD27.js → tr-77TFG62H.js} +88 -26
- package/dist/{uk-SJRMB47Y.js → uk-MIIL6NXT.js} +88 -26
- package/dist/{vi-TMRQFES2.js → vi-7JYOIGNV.js} +88 -26
- package/dist/{zh-QOL3LYEM.js → zh-ID6DRYU4.js} +88 -26
- package/package.json +11 -10
- package/src/components/AssistProgress.tsx +178 -134
- package/src/components/CodeMirrorRenderer.tsx +8 -8
- package/src/components/{EntityFoundLog.tsx → ItemFoundLog.tsx} +12 -7
- package/src/components/ProtectedErrorBoundary.css +3 -1
- package/src/components/StatusDisplay.css +1 -1
- package/src/components/Toast.css +3 -1
- package/src/components/__tests__/AssistProgress.test.tsx +268 -141
- package/src/components/annotation/annotation-entries.css +0 -4
- package/src/components/annotation/references.css +0 -4
- package/src/components/image-annotation/AnnotationOverlay.tsx +6 -6
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +1 -1
- package/src/components/image-annotation/__tests__/AnnotationOverlay.click.test.tsx +7 -9
- package/src/components/image-annotation/__tests__/SvgDrawingCanvas.click.test.tsx +1 -2
- package/src/components/layout/Header.css +0 -4
- package/src/components/layout/LeftSidebar.css +0 -4
- package/src/components/modals/ComposeStep.tsx +218 -0
- package/src/components/modals/ConfigureGatherStep.tsx +10 -18
- package/src/components/modals/ConfigureGenerationStep.tsx +131 -54
- package/src/components/modals/ConfigureSearchStep.tsx +42 -40
- package/src/components/modals/ContextSummary.tsx +185 -72
- package/src/components/modals/CorpusPane.tsx +75 -0
- package/src/components/modals/DiscardPrompt.tsx +38 -0
- package/src/components/modals/GatherContextStep.tsx +237 -107
- package/src/components/modals/ReferenceWizardModal.tsx +287 -60
- package/src/components/modals/ResourceGenerateModal.tsx +233 -109
- package/src/components/modals/SearchModal.css +335 -111
- package/src/components/modals/SearchModal.tsx +1 -1
- package/src/components/modals/SearchResultsStep.tsx +63 -88
- package/src/components/modals/WizardFooter.tsx +69 -0
- package/src/components/modals/__tests__/ComposeStep.test.tsx +152 -0
- package/src/components/modals/__tests__/ConfigureGatherStep.test.tsx +14 -26
- package/src/components/modals/__tests__/ConfigureGenerationStep.test.tsx +290 -0
- package/src/components/modals/__tests__/ConfigureSearchStep.test.tsx +95 -0
- package/src/components/modals/__tests__/GatherContextStep.resource.test.tsx +463 -25
- package/src/components/modals/__tests__/ReferenceWizardModal.test.tsx +635 -0
- package/src/components/modals/__tests__/ResourceGenerateModal.test.tsx +277 -85
- package/src/components/modals/__tests__/SearchModal.search-wiring.test.tsx +6 -2
- package/src/components/modals/__tests__/SearchResultsStep.test.tsx +61 -0
- package/src/components/modals/__tests__/WizardFooter.test.tsx +344 -0
- package/src/components/modals/modals.css +16 -42
- package/src/components/navigation/NavigationTabs.css +0 -20
- package/src/components/pdf-annotation/PdfAnnotationCanvas.css +21 -2
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +36 -3
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +41 -6
- package/src/components/resource/AnnotateView.tsx +19 -8
- package/src/components/resource/AnnotationHistory.tsx +2 -0
- package/src/components/resource/BrowseView.tsx +20 -9
- package/src/components/resource/ResourceViewer.tsx +27 -28
- package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +1 -1
- package/src/components/resource/__tests__/AnnotateView.focus.test.tsx +50 -0
- package/src/components/resource/__tests__/AnnotationHistory.test.tsx +2 -0
- package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +1 -1
- package/src/components/resource/__tests__/BrowseView.test.tsx +38 -12
- package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +47 -3
- package/src/components/resource/annotate-renderers.tsx +3 -3
- package/src/components/resource/event-formatting.ts +0 -3
- package/src/components/resource/panels/AssessmentEntry.tsx +1 -1
- package/src/components/resource/panels/AssessmentPanel.css +5 -6
- package/src/components/resource/panels/AssistSection.css +95 -263
- package/src/components/resource/panels/AssistSection.tsx +4 -4
- package/src/components/resource/panels/AssistShell.tsx +12 -4
- package/src/components/resource/panels/CollaborationPanel.css +47 -22
- package/src/components/resource/panels/CollaborationPanel.tsx +93 -2
- package/src/components/resource/panels/CommentEntry.tsx +1 -1
- package/src/components/resource/panels/CommentsPanel.css +0 -16
- package/src/components/resource/panels/HighlightEntry.tsx +1 -1
- package/src/components/resource/panels/HighlightPanel.css +0 -7
- package/src/components/resource/panels/JsonLdPanel.css +0 -4
- package/src/components/resource/panels/ReferenceEntry.tsx +10 -3
- package/src/components/resource/panels/ReferencesPanel.css +0 -12
- package/src/components/resource/panels/ReferencesPanel.tsx +16 -20
- package/src/components/resource/panels/ResourceInfoPanel.css +0 -32
- package/src/components/resource/panels/ResourceInfoPanel.tsx +89 -20
- package/src/components/resource/panels/StatisticsPanel.css +0 -20
- package/src/components/resource/panels/TagEntry.tsx +1 -1
- package/src/components/resource/panels/TaggingPanel.css +0 -4
- package/src/components/resource/panels/TaggingPanel.tsx +2 -10
- package/src/components/resource/panels/UnifiedAnnotationsPanel.css +0 -4
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +7 -2
- package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/AssistSection.test.tsx +48 -50
- package/src/components/resource/panels/__tests__/AssistShell.test.tsx +11 -6
- package/src/components/resource/panels/__tests__/CollaborationPanel.test.tsx +89 -0
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +1 -2
- package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +44 -36
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +41 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.headless.test.tsx +1 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +67 -54
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +185 -7
- package/src/components/resource/panels/__tests__/TagEntry.test.tsx +0 -1
- package/src/components/settings/SettingsPanel.css +0 -4
- package/src/features/auth/auth.css +2 -26
- package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +0 -65
- package/src/features/resource-compose/components/ResourceComposePage.tsx +17 -130
- package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +1 -76
- package/src/features/resource-compose/state/compose-page-state-unit.ts +5 -48
- package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +55 -0
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +29 -0
- package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +53 -3
- package/src/features/resource-discovery/state/discover-state-unit.ts +29 -8
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +71 -15
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +166 -71
- package/src/features/resource-viewer/hooks/__tests__/useResourceViewedReport.test.tsx +63 -0
- package/src/features/resource-viewer/hooks/useResourceViewedReport.ts +33 -0
- package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +2 -2
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +1 -1
- package/src/styles/core/buttons.css +3 -1
- package/src/styles/core/forms.css +35 -29
- package/src/styles/core/indicators.css +0 -4
- package/src/styles/core/inputs.css +0 -4
- package/src/styles/core/progress.css +2 -34
- package/src/styles/core/sliders.css +0 -4
- package/src/styles/core/toggles.css +0 -4
- package/src/styles/features/resource-discovery.css +13 -0
- package/src/styles/features/resource-viewer.css +0 -42
- package/src/styles/features/resource.css +0 -4
- package/src/styles/motivations/motivation-assessment.css +2 -2
- package/src/styles/panels/history-panel.css +0 -40
- package/src/styles/panels/user-panel.css +0 -3
- package/src/styles/patterns/panel-helpers.css +0 -27
- package/src/styles/patterns/panel-sections.css +0 -59
- package/src/styles/patterns/panels-base.css +0 -32
- package/translations/ar.json +84 -24
- package/translations/bn.json +84 -24
- package/translations/cs.json +84 -24
- package/translations/da.json +84 -24
- package/translations/de.json +84 -24
- package/translations/el.json +84 -24
- package/translations/en.json +84 -24
- package/translations/es.json +84 -24
- package/translations/fa.json +84 -24
- package/translations/fi.json +84 -24
- package/translations/fr.json +84 -24
- package/translations/he.json +84 -24
- package/translations/hi.json +84 -24
- package/translations/id.json +84 -24
- package/translations/it.json +84 -24
- package/translations/ja.json +84 -24
- package/translations/ko.json +84 -24
- package/translations/ms.json +84 -24
- package/translations/nl.json +84 -24
- package/translations/no.json +84 -24
- package/translations/pl.json +84 -24
- package/translations/pt.json +84 -24
- package/translations/ro.json +84 -24
- package/translations/sv.json +84 -24
- package/translations/th.json +84 -24
- package/translations/tr.json +84 -24
- package/translations/uk.json +84 -24
- package/translations/vi.json +84 -24
- package/translations/zh.json +84 -24
- package/dist/PdfAnnotationCanvas.client-6ZSF6ZTJ.js.map +0 -1
- package/dist/PdfAnnotationCanvas.client-JCJMXWWJ.css.map +0 -1
- package/dist/ar-YTUUGK2O.js.map +0 -1
- package/dist/bn-ASGNGPMD.js.map +0 -1
- package/dist/chunk-BTUG3VJJ.js.map +0 -1
- package/dist/chunk-L3WKRWP3.js.map +0 -1
- package/dist/chunk-O23TLLXW.js.map +0 -1
- package/dist/chunk-OBQOZCJE.js.map +0 -1
- package/dist/chunk-QT7LYM72.js.map +0 -1
- package/dist/chunk-VXASXU4K.js.map +0 -1
- package/dist/chunk-XUDKYAVC.js +0 -21
- package/dist/chunk-XUDKYAVC.js.map +0 -1
- package/dist/cs-WMYVAOZY.js.map +0 -1
- package/dist/da-FSHHN4D6.js.map +0 -1
- package/dist/de-FJFO3TPT.js.map +0 -1
- package/dist/el-XOH4QIAG.js.map +0 -1
- package/dist/en-3FCBW3YD.js.map +0 -1
- package/dist/es-HDX4QI7E.js.map +0 -1
- package/dist/fa-DJ6WTFTJ.js.map +0 -1
- package/dist/fi-4S7H7W7U.js.map +0 -1
- package/dist/fr-6UJSYHXC.js.map +0 -1
- package/dist/he-ZZJOHJX2.js.map +0 -1
- package/dist/hi-HZJTAW7U.js.map +0 -1
- package/dist/id-E3I6ILEM.js.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/integrations/css-modules-helper.js.map +0 -1
- package/dist/integrations/styled-components-theme.js.map +0 -1
- package/dist/it-ULAPAD7U.js.map +0 -1
- package/dist/ja-SAHZQ4CZ.js.map +0 -1
- package/dist/ko-DFU2ADQ4.js.map +0 -1
- package/dist/ms-NWL76XNT.js.map +0 -1
- package/dist/nl-ATCM76WN.js.map +0 -1
- package/dist/no-UIAQ5RJF.js.map +0 -1
- package/dist/pl-NOECQDXD.js.map +0 -1
- package/dist/pt-SVWIIUPC.js.map +0 -1
- package/dist/ro-NR2DRTZG.js.map +0 -1
- package/dist/sv-STVJ37JP.js.map +0 -1
- package/dist/test-utils.css.map +0 -1
- package/dist/test-utils.js.map +0 -1
- package/dist/th-UWQR4K54.js.map +0 -1
- package/dist/tr-WNXZSD27.js.map +0 -1
- package/dist/uk-SJRMB47Y.js.map +0 -1
- package/dist/vi-TMRQFES2.js.map +0 -1
- package/dist/zh-QOL3LYEM.js.map +0 -1
- package/src/components/modals/ResourceSearchModal.tsx +0 -224
- package/src/components/modals/__tests__/ResourceSearchModal.test.tsx +0 -159
- package/src/integrations/tailwind-plugin.cjs +0 -224
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semiont/react-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.28",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=24.0.0"
|
|
6
6
|
},
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"./styles": "./src/styles/index.css",
|
|
23
23
|
"./styles/index.css": "./src/styles/index.css",
|
|
24
24
|
"./styles/variables.css": "./src/styles/variables.css",
|
|
25
|
-
"./tailwind": "./src/integrations/tailwind-plugin.cjs",
|
|
26
25
|
"./integrations/css-modules": {
|
|
27
26
|
"types": "./dist/integrations/css-modules-helper.d.ts",
|
|
28
27
|
"import": "./dist/integrations/css-modules-helper.js",
|
|
@@ -37,6 +36,7 @@
|
|
|
37
36
|
},
|
|
38
37
|
"files": [
|
|
39
38
|
"dist",
|
|
39
|
+
"!dist/**/*.map",
|
|
40
40
|
"src/styles",
|
|
41
41
|
"src/components",
|
|
42
42
|
"src/features",
|
|
@@ -92,21 +92,21 @@
|
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@headlessui/react": "^2.2.10",
|
|
95
|
-
"@testing-library/jest-dom": "^
|
|
95
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
96
96
|
"@testing-library/react": "^16.1.0",
|
|
97
97
|
"@types/react": "^19.2.18",
|
|
98
98
|
"@types/react-dom": "^19.2.4",
|
|
99
99
|
"@vitest/coverage-v8": "^4.1.8",
|
|
100
100
|
"autoprefixer": "^10.5.4",
|
|
101
101
|
"axe-core": "^4.12.1",
|
|
102
|
-
"cssnano": "^8.0.
|
|
102
|
+
"cssnano": "^8.0.5",
|
|
103
103
|
"fast-check": "^4.9.0",
|
|
104
|
-
"jest-axe": "^
|
|
104
|
+
"jest-axe": "^11.0.0",
|
|
105
105
|
"jsdom": "^29.1.1",
|
|
106
106
|
"postcss-import": "^16.1.1",
|
|
107
107
|
"rollup": "^4.62.3",
|
|
108
108
|
"rollup-plugin-dts": "^6.4.1",
|
|
109
|
-
"styled-components": "^6.
|
|
109
|
+
"styled-components": "^6.5.2",
|
|
110
110
|
"tsup": "^8.0.1",
|
|
111
111
|
"typescript": "^6.0.2",
|
|
112
112
|
"vitest": "^4.1.10"
|
|
@@ -118,13 +118,14 @@
|
|
|
118
118
|
"license": "Apache-2.0",
|
|
119
119
|
"repository": {
|
|
120
120
|
"type": "git",
|
|
121
|
-
"url": "https://github.com/The-AI-Alliance/semiont.git",
|
|
121
|
+
"url": "git+https://github.com/The-AI-Alliance/semiont.git",
|
|
122
122
|
"directory": "packages/react-ui"
|
|
123
123
|
},
|
|
124
124
|
"dependencies": {
|
|
125
|
-
"@semiont/core": "0.5.
|
|
126
|
-
"@semiont/http-transport": "0.5.
|
|
127
|
-
"@semiont/sdk": "0.5.
|
|
125
|
+
"@semiont/core": "0.5.28",
|
|
126
|
+
"@semiont/http-transport": "0.5.28",
|
|
127
|
+
"@semiont/sdk": "0.5.28",
|
|
128
|
+
"clsx": "^2.1.1",
|
|
128
129
|
"pdfjs-dist": "^6.2.108",
|
|
129
130
|
"react-error-boundary": "^6.1.2",
|
|
130
131
|
"react-markdown": "^10.1.0",
|
|
@@ -1,181 +1,225 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type { components } from '@semiont/core';
|
|
4
|
-
import {
|
|
4
|
+
import { ItemFoundLog } from './ItemFoundLog';
|
|
5
5
|
|
|
6
6
|
type JobProgress = components['schemas']['JobProgress'];
|
|
7
|
+
type JobProgressMessage = components['schemas']['JobProgressMessage'];
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Every string this component renders. Required by default and with NO
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Every string this component renders. Required by default and with NO English
|
|
11
|
+
* fallbacks (ASSIST-SURFACE-WARTS Lane A): a `tr.x || 'X'` default turns a
|
|
12
|
+
* forgotten key into English text in a Japanese UI, silently and only at
|
|
13
|
+
* runtime. Required keys make the same mistake a type error at the call site.
|
|
14
|
+
*
|
|
15
|
+
* The nine wire codes collapse to ONE required function rather than nine keys:
|
|
16
|
+
* the code→copy switch belongs in one place, and threading nine strings through
|
|
17
|
+
* five call sites would put five copies of it in the tree. Build it with
|
|
18
|
+
* `assistProgressCopy(t)`.
|
|
14
19
|
*/
|
|
15
20
|
export interface AssistProgressTranslations {
|
|
16
|
-
/**
|
|
17
|
-
title?: string;
|
|
18
|
-
/** Cancel-button title attribute. */
|
|
21
|
+
/** Control label while the run is in flight. */
|
|
19
22
|
cancel: string;
|
|
20
|
-
/**
|
|
23
|
+
/** Control label once the run has ended. */
|
|
24
|
+
close: string;
|
|
25
|
+
/** Localized copy for a progress code. */
|
|
26
|
+
message: (m: JobProgressMessage) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Shown when no code has arrived yet — a pure liveness heartbeat, or an event
|
|
29
|
+
* predating the coded wire. `JobProgress.message` is optional for exactly
|
|
30
|
+
* these cases.
|
|
31
|
+
*/
|
|
21
32
|
inProgress: string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The subject line: what is being worked on, with its position when known.
|
|
35
|
+
* Takes the wire's `{ kind, value }` — the localized name for `kind` is the
|
|
36
|
+
* translation layer's business, not this component's.
|
|
37
|
+
*/
|
|
38
|
+
subject: (current: NonNullable<JobProgress['current']>, done?: number, total?: number) => string;
|
|
39
|
+
/**
|
|
40
|
+
* Localized NAME for an echoed request parameter. The wire sends a code
|
|
41
|
+
* (`instructions`, `tone`, …); the VALUE beside it is the user's own words
|
|
42
|
+
* and is never translated.
|
|
43
|
+
*/
|
|
44
|
+
paramLabel: (code: string) => string;
|
|
30
45
|
/** Completed entity-type log line (reference flow only). */
|
|
31
46
|
found?: (count: number) => string;
|
|
32
|
-
/** Current-work detail line, reference-flow wording; falls back to `processing`. */
|
|
33
|
-
current?: (label: string) => string;
|
|
34
|
-
/** Dismiss-button label. */
|
|
35
|
-
close: string;
|
|
36
47
|
}
|
|
37
48
|
|
|
49
|
+
/**
|
|
50
|
+
* The CSS `data-type` hook: five motivations plus generation. A closed set, so
|
|
51
|
+
* it is typed as one — a typo used to produce unstyled chrome, silently
|
|
52
|
+
* (CLEAN-PROGRESS A9).
|
|
53
|
+
*/
|
|
54
|
+
export type AssistDataType =
|
|
55
|
+
| 'highlight' | 'comment' | 'assessment' | 'reference' | 'tag' | 'generation';
|
|
56
|
+
|
|
38
57
|
export interface AssistProgressProps {
|
|
39
58
|
progress: JobProgress;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
dataType: AssistDataType;
|
|
60
|
+
/**
|
|
61
|
+
* What the finished run produced, offered as a link in the ended frame
|
|
62
|
+
* (GENERATE-FROM-RESOURCE D8). The label is the artifact's own name — user
|
|
63
|
+
* content, never translated. Rendered only once `ended`: mid-run there is no
|
|
64
|
+
* outcome to offer, whatever the caller has wired.
|
|
65
|
+
*/
|
|
66
|
+
outcome?: { label: string; onOpen: () => void } | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The owner's terminal sentence, rendered in place of the payload message
|
|
69
|
+
* once `ended` (GENERATION-ARRIVAL P1). The producer's final frame is a
|
|
70
|
+
* fire-and-forget emit that can lose the race with `job:complete`, so an
|
|
71
|
+
* ended frame must not trust the last payload to describe the ending —
|
|
72
|
+
* the owner, which signalled `ended`, supplies the words too. Inert while
|
|
73
|
+
* the run is live.
|
|
74
|
+
*/
|
|
75
|
+
endedMessage?: string;
|
|
44
76
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
77
|
+
* The run has ENDED. The owner's fact, not the payload's
|
|
78
|
+
* (ASSIST-PROGRESS-CONSOLIDATION D7): terminality is signalled on
|
|
79
|
+
* `job:complete` / `job:fail`, which `AssistShell` already observes via
|
|
80
|
+
* `isAssisting`. This component deliberately does not read `progress.stage` —
|
|
81
|
+
* no producer in the repo emits a terminal stage, and the two branches that
|
|
82
|
+
* believed the schema's description were unreachable for exactly that reason.
|
|
83
|
+
*
|
|
84
|
+
* REQUIRED (CLEAN-PROGRESS A1). It was optional, and the one call site that
|
|
85
|
+
* forgot it shipped a flow that could never reach the ended state at all.
|
|
86
|
+
* Nothing about a progress payload can tell this component the run is over,
|
|
87
|
+
* so the owner must say — and a default of `false` is a wrong answer, not a
|
|
88
|
+
* safe one.
|
|
48
89
|
*/
|
|
90
|
+
ended: boolean;
|
|
91
|
+
/** Cancel the underlying job. Caller wires `client.job.cancelRequest(...)`. */
|
|
92
|
+
onCancel?: () => void;
|
|
93
|
+
/** Dismiss the display. Caller wires `client.mark.dismissProgress()`. */
|
|
49
94
|
onDismiss?: () => void;
|
|
50
|
-
/** Render the percentage bar (tag flow's visual; percentage itself comes from `progress`). */
|
|
51
|
-
showPercentBar?: boolean;
|
|
52
95
|
translations: AssistProgressTranslations;
|
|
53
96
|
}
|
|
54
97
|
|
|
55
98
|
/**
|
|
56
|
-
* The one job-progress renderer
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
99
|
+
* The one job-progress renderer, for all five motivations.
|
|
100
|
+
*
|
|
101
|
+
* Presentational and provider-free: no session, no context — cancel/dismiss
|
|
102
|
+
* arrive as callbacks, so it renders identically on the page and in embeddable
|
|
103
|
+
* (bring-your-own-session) hosts.
|
|
104
|
+
*
|
|
105
|
+
* One shape for every flow. What varies is DATA, not flags: a bar appears
|
|
106
|
+
* because there is a fraction to fill it, a subject line appears because there
|
|
107
|
+
* is a subject. The previous `title` / `showPercentBar` / `found` / `current`
|
|
108
|
+
* opt-ins produced four unrelated layouts from one component, which is what
|
|
109
|
+
* generated the duplicate renders and doubled chrome this replaces.
|
|
63
110
|
*/
|
|
64
111
|
export function AssistProgress({
|
|
65
112
|
progress,
|
|
66
113
|
dataType,
|
|
114
|
+
ended,
|
|
115
|
+
outcome,
|
|
116
|
+
endedMessage,
|
|
67
117
|
onCancel,
|
|
68
118
|
onDismiss,
|
|
69
|
-
showPercentBar = false,
|
|
70
119
|
translations: tr,
|
|
71
120
|
}: AssistProgressProps) {
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
const
|
|
121
|
+
// One vocabulary, so no guessing (CLEAN-PROGRESS D2). This used to be a pair
|
|
122
|
+
// of `??` chains reconciling entity-type fields with category fields — the
|
|
123
|
+
// component had to know which flow it was drawing to find the same two facts.
|
|
124
|
+
const current = progress.current;
|
|
125
|
+
const done = progress.processed;
|
|
126
|
+
const total = progress.total;
|
|
76
127
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
128
|
+
// H1: the params line earns its space only when it says something the status
|
|
129
|
+
// line does not. The ONLY redundant case is a single entity type, where the
|
|
130
|
+
// subject beneath already names it — so that case alone is suppressed.
|
|
131
|
+
//
|
|
132
|
+
// Deliberately NOT `total > 1`: other flows send params that never restate the
|
|
133
|
+
// subject (a highlight run reports Instructions and Density), and those have
|
|
134
|
+
// no `total` at all. Gating on the presence of a count would have hidden
|
|
135
|
+
// genuinely informative parameters — an over-application of H1 caught by
|
|
136
|
+
// AssistSection's highlight fixture.
|
|
137
|
+
const params = total === 1 ? undefined : progress.requestParams;
|
|
138
|
+
|
|
139
|
+
// `percentage` is REQUIRED on JobProgress, so every progress event can fill a
|
|
140
|
+
// bar — the bar's existence is not conditional on anything.
|
|
141
|
+
//
|
|
142
|
+
// It used to also require the fraction (`done`/`total`), which SILENTLY
|
|
143
|
+
// REMOVED THE TAG FLOW'S BAR: `processTagJob` reports percentage only and
|
|
144
|
+
// emits no category fields at all, so `done`/`total` are permanently
|
|
145
|
+
// undefined there (caught in review of PR #1179). The fraction is a richer,
|
|
146
|
+
// optional signal that only flows counting per-item work have; it belongs to
|
|
147
|
+
// the SUBJECT line, not to whether a bar exists.
|
|
99
148
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
149
|
+
return (
|
|
150
|
+
<div className="semiont-assist-progress" data-type={dataType} data-ended={ended}>
|
|
151
|
+
{params && params.length > 0 && (
|
|
152
|
+
<div className="semiont-assist-progress__params" data-testid="semiont-assist-params">
|
|
153
|
+
{/* H1 removed the BLOCK HEADING ("Request Parameters:"), not the
|
|
154
|
+
per-parameter labels: a bare "5" for Density says nothing. */}
|
|
155
|
+
{params.map((param, idx) => (
|
|
156
|
+
<span key={idx} className="semiont-assist-progress__param">
|
|
157
|
+
<span className="semiont-assist-progress__param-label">
|
|
158
|
+
{tr.paramLabel(param.label)}:
|
|
159
|
+
</span>{' '}
|
|
160
|
+
<span>{param.value}</span>
|
|
161
|
+
</span>
|
|
108
162
|
))}
|
|
109
163
|
</div>
|
|
110
164
|
)}
|
|
111
165
|
|
|
112
|
-
{/*
|
|
113
|
-
{tr.found && progress.
|
|
114
|
-
<
|
|
166
|
+
{/* H2: kept uncapped — per-item counts are small in practice. */}
|
|
167
|
+
{tr.found && progress.completedItems && (
|
|
168
|
+
<ItemFoundLog entries={progress.completedItems} formatFound={tr.found} />
|
|
115
169
|
)}
|
|
116
170
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
one; see ASSIST-SURFACE-WARTS watch-items. */}
|
|
128
|
-
<span>{progress.message || tr.complete}</span>
|
|
129
|
-
</div>
|
|
130
|
-
) : progress.stage === 'error' ? (
|
|
131
|
-
<div className="semiont-annotation-progress__message">
|
|
132
|
-
<span className="semiont-annotation-progress__icon">❌</span>
|
|
133
|
-
<span>{progress.message || tr.failed}</span>
|
|
134
|
-
</div>
|
|
135
|
-
) : (
|
|
136
|
-
<div className="semiont-annotation-progress__message">
|
|
137
|
-
<span className="semiont-annotation-progress__icon">✨</span>
|
|
138
|
-
<span>
|
|
139
|
-
{progress.message
|
|
140
|
-
|| (progress.currentEntityType ? currentLabel(progress.currentEntityType) : tr.inProgress)}
|
|
141
|
-
</span>
|
|
142
|
-
</div>
|
|
143
|
-
)}
|
|
171
|
+
<div className="semiont-assist-progress__status">
|
|
172
|
+
<span className="semiont-assist-progress__icon" aria-hidden="true">
|
|
173
|
+
{ended ? '✅' : '✨'}
|
|
174
|
+
</span>
|
|
175
|
+
<span data-testid="semiont-assist-status">
|
|
176
|
+
{ended && endedMessage
|
|
177
|
+
? endedMessage
|
|
178
|
+
: progress.message ? tr.message(progress.message) : tr.inProgress}
|
|
179
|
+
</span>
|
|
180
|
+
</div>
|
|
144
181
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
{!terminal && progress.currentCategory && (
|
|
152
|
-
<div className="semiont-annotation-progress__details">
|
|
153
|
-
{tr.processing(progress.currentCategory)}
|
|
154
|
-
{progress.processedCategories !== undefined && progress.totalCategories !== undefined && (
|
|
155
|
-
<> ({progress.processedCategories}/{progress.totalCategories})</>
|
|
156
|
-
)}
|
|
157
|
-
</div>
|
|
158
|
-
)}
|
|
182
|
+
{/* H3: stage above, subject beneath. */}
|
|
183
|
+
{current && (
|
|
184
|
+
<div className="semiont-assist-progress__subject" data-testid="semiont-assist-subject">
|
|
185
|
+
{tr.subject(current, done, total)}
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
159
188
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
189
|
+
{/* D8: the finished run's artifact, by name. */}
|
|
190
|
+
{ended && outcome && (
|
|
191
|
+
<button
|
|
192
|
+
type="button"
|
|
193
|
+
onClick={outcome.onOpen}
|
|
194
|
+
className="semiont-assist-progress__outcome"
|
|
195
|
+
data-testid="semiont-assist-outcome"
|
|
196
|
+
>
|
|
197
|
+
{outcome.label}
|
|
198
|
+
</button>
|
|
199
|
+
)}
|
|
200
|
+
|
|
201
|
+
{/* An ended run is 100% done by definition — the last payload's number
|
|
202
|
+
is a mid-run fact and must not survive the ending (A1). */}
|
|
203
|
+
<div className="semiont-progress-bar" data-testid="semiont-assist-bar">
|
|
204
|
+
<div
|
|
205
|
+
className="semiont-progress-bar__fill"
|
|
206
|
+
data-type={dataType}
|
|
207
|
+
style={{ width: `${ended ? 100 : progress.percentage}%` }}
|
|
208
|
+
/>
|
|
172
209
|
</div>
|
|
173
210
|
|
|
174
|
-
{/*
|
|
175
|
-
{
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
211
|
+
{/* D3: ONE control, its meaning set by the lifecycle. */}
|
|
212
|
+
{(ended ? onDismiss : onCancel) && (
|
|
213
|
+
<button
|
|
214
|
+
onClick={ended ? onDismiss : onCancel}
|
|
215
|
+
className="semiont-assist-progress__control"
|
|
216
|
+
data-testid="semiont-assist-control"
|
|
217
|
+
title={ended ? tr.close : tr.cancel}
|
|
218
|
+
aria-label={ended ? tr.close : tr.cancel}
|
|
219
|
+
type="button"
|
|
220
|
+
>
|
|
221
|
+
✕
|
|
222
|
+
</button>
|
|
179
223
|
)}
|
|
180
224
|
</div>
|
|
181
225
|
);
|
|
@@ -37,7 +37,7 @@ interface Props {
|
|
|
37
37
|
onTextSelect?: (exact: string, position: { start: number; end: number }) => void;
|
|
38
38
|
onChange?: (content: string) => void;
|
|
39
39
|
editable?: boolean;
|
|
40
|
-
|
|
40
|
+
sparkleAnnotationIds?: Set<string>;
|
|
41
41
|
hoveredAnnotationId?: string | null;
|
|
42
42
|
scrollToAnnotationId?: string | null;
|
|
43
43
|
sourceView?: boolean; // If true, show raw source (no markdown rendering)
|
|
@@ -52,7 +52,7 @@ interface Props {
|
|
|
52
52
|
// Effect to update annotation decorations with segments and new IDs
|
|
53
53
|
interface AnnotationUpdate {
|
|
54
54
|
segments: TextSegment[];
|
|
55
|
-
|
|
55
|
+
sparkleAnnotationIds?: Set<string>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const updateAnnotationsEffect = StateEffect.define<AnnotationUpdate>();
|
|
@@ -70,10 +70,10 @@ const updateWidgetsEffect = StateEffect.define<WidgetUpdate>();
|
|
|
70
70
|
// Build CodeMirror decorations from pure metadata
|
|
71
71
|
function buildAnnotationDecorations(
|
|
72
72
|
segments: TextSegment[],
|
|
73
|
-
|
|
73
|
+
sparkleAnnotationIds?: Set<string>
|
|
74
74
|
): DecorationSet {
|
|
75
75
|
const builder = new RangeSetBuilder<Decoration>();
|
|
76
|
-
const entries = computeAnnotationDecorations(segments,
|
|
76
|
+
const entries = computeAnnotationDecorations(segments, sparkleAnnotationIds);
|
|
77
77
|
|
|
78
78
|
for (const { start, end, meta } of entries) {
|
|
79
79
|
const decoration = Decoration.mark({
|
|
@@ -103,7 +103,7 @@ function createAnnotationDecorationsField() {
|
|
|
103
103
|
|
|
104
104
|
for (const effect of tr.effects) {
|
|
105
105
|
if (effect.is(updateAnnotationsEffect)) {
|
|
106
|
-
decorations = buildAnnotationDecorations(effect.value.segments, effect.value.
|
|
106
|
+
decorations = buildAnnotationDecorations(effect.value.segments, effect.value.sparkleAnnotationIds);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -175,7 +175,7 @@ export function CodeMirrorRenderer({
|
|
|
175
175
|
segments = [],
|
|
176
176
|
onChange,
|
|
177
177
|
editable = false,
|
|
178
|
-
|
|
178
|
+
sparkleAnnotationIds,
|
|
179
179
|
hoveredAnnotationId,
|
|
180
180
|
scrollToAnnotationId,
|
|
181
181
|
sourceView = false,
|
|
@@ -410,9 +410,9 @@ export function CodeMirrorRenderer({
|
|
|
410
410
|
if (!viewRef.current) return;
|
|
411
411
|
|
|
412
412
|
viewRef.current.dispatch({
|
|
413
|
-
effects: updateAnnotationsEffect.of({ segments: convertedSegments, ...(
|
|
413
|
+
effects: updateAnnotationsEffect.of({ segments: convertedSegments, ...(sparkleAnnotationIds && { sparkleAnnotationIds }) })
|
|
414
414
|
});
|
|
415
|
-
}, [convertedSegments,
|
|
415
|
+
}, [convertedSegments, sparkleAnnotationIds]);
|
|
416
416
|
|
|
417
417
|
// Update widgets when content, segments, or generatingReferenceId changes
|
|
418
418
|
useEffect(() => {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
4
|
-
|
|
3
|
+
export interface ItemFoundEntry {
|
|
4
|
+
/** The item itself — an entity type, a tag category — shown verbatim. */
|
|
5
|
+
value: string;
|
|
5
6
|
foundCount: number;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
export interface
|
|
9
|
-
entries:
|
|
9
|
+
export interface ItemFoundLogProps {
|
|
10
|
+
entries: ItemFoundEntry[];
|
|
10
11
|
/** Formats the per-entity count line, e.g. `(n) => t('found', { count: n })`. */
|
|
11
12
|
formatFound: (count: number) => string;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
* "✓ Person: 5 found" — the completed
|
|
16
|
+
* "✓ Person: 5 found" — the completed-items log.
|
|
16
17
|
*
|
|
17
18
|
* One markup for one concept (ASSIST-SURFACE-WARTS Lane B). This was two
|
|
18
19
|
* class families a single panel apart: the live progress display used
|
|
@@ -20,8 +21,12 @@ export interface EntityFoundLogProps {
|
|
|
20
21
|
* `semiont-assist-widget__log*`, with the same rows rendered by hand in both.
|
|
21
22
|
* Presentational and provider-free, like AssistProgress — the caller brings
|
|
22
23
|
* the formatter.
|
|
24
|
+
*
|
|
25
|
+
* Item-shaped rather than entity-type-shaped (CLEAN-PROGRESS D2): the tag flow
|
|
26
|
+
* counts categories the same way the reference flow counts entity types, and a
|
|
27
|
+
* shared component should not be named for one of its callers.
|
|
23
28
|
*/
|
|
24
|
-
export function
|
|
29
|
+
export function ItemFoundLog({ entries, formatFound }: ItemFoundLogProps) {
|
|
25
30
|
if (entries.length === 0) return null;
|
|
26
31
|
|
|
27
32
|
return (
|
|
@@ -29,7 +34,7 @@ export function EntityFoundLog({ entries, formatFound }: EntityFoundLogProps) {
|
|
|
29
34
|
{entries.map((item, index) => (
|
|
30
35
|
<div key={index} className="semiont-annotation-log-item">
|
|
31
36
|
<span className="semiont-annotation-check">✓</span>
|
|
32
|
-
<span className="semiont-annotation-entity-type">{item.
|
|
37
|
+
<span className="semiont-annotation-entity-type">{item.value}:</span>
|
|
33
38
|
<span>{formatFound(item.foundCount)}</span>
|
|
34
39
|
</div>
|
|
35
40
|
))}
|
|
@@ -88,8 +88,10 @@
|
|
|
88
88
|
color: var(--semiont-color-gray-700);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/* gray-500 is thin for this size on a near-black surface, and the hover below
|
|
92
|
+
already lifts to gray-300 — resting darker than its own hover target. */
|
|
91
93
|
[data-theme="dark"] .semiont-protected-error-boundary-summary {
|
|
92
|
-
color: var(--semiont-color-gray-
|
|
94
|
+
color: var(--semiont-color-gray-400);
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
[data-theme="dark"] .semiont-protected-error-boundary-summary:hover {
|
package/src/components/Toast.css
CHANGED
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
animation: slideIn var(--semiont-duration-base) var(--semiont-ease);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/* Separation, not decoration: a 10%-black shadow is invisible against a dark
|
|
30
|
+
backdrop, so the dark theme takes the deeper one. */
|
|
29
31
|
[data-theme="dark"] .semiont-toast {
|
|
30
|
-
box-shadow: var(--semiont-shadow-
|
|
32
|
+
box-shadow: var(--semiont-shadow-xl);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
@keyframes slideIn {
|