@semiont/react-ui 0.5.27 → 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/dist/{PdfAnnotationCanvas.client-EVUPTUWZ.js → PdfAnnotationCanvas.client-C2IGG4SW.js} +31 -4
- package/dist/{ar-OU3DQGC6.js → ar-FABPTJVB.js} +39 -23
- package/dist/{bn-PHWCR6AZ.js → bn-LKP6BDMH.js} +39 -23
- package/dist/{chunk-PCRRBU7H.js → chunk-2GOHTTHW.js} +39 -23
- package/dist/{chunk-5VDTWRXJ.js → chunk-2YHEE63S.js} +31 -31
- package/dist/{cs-NEXYZ62I.js → cs-YQYNWHRG.js} +39 -23
- package/dist/{da-FAT43YCU.js → da-QHZOYKRY.js} +39 -23
- package/dist/{de-KRQ3WBCU.js → de-GKA7RD7J.js} +39 -23
- package/dist/{el-Q4IU3EKC.js → el-45T257AL.js} +39 -23
- package/dist/{en-2KADE7N4.js → en-RVW5EQ66.js} +2 -2
- package/dist/{es-2IO3R2MK.js → es-AVER7RU4.js} +39 -23
- package/dist/{fa-Q5GOQFXX.js → fa-K3VPK3O2.js} +39 -23
- package/dist/{fi-R6NMRWBE.js → fi-5NEKF7EB.js} +39 -23
- package/dist/{fr-QY4D5E6J.js → fr-FUMNDLBZ.js} +39 -23
- package/dist/{he-X6Y77XHY.js → he-3JGNA3PR.js} +39 -23
- package/dist/{hi-XL7IOEQM.js → hi-IJY375DF.js} +39 -23
- package/dist/{id-QZ4ZZS67.js → id-LWHKJ7ZD.js} +39 -23
- package/dist/index.css +279 -74
- package/dist/index.d.ts +170 -145
- package/dist/index.js +2743 -2365
- package/dist/{it-ME2Q7OB6.js → it-EBVOV4RW.js} +39 -23
- package/dist/{ja-HX7QASRI.js → ja-KWRIX2NF.js} +39 -23
- package/dist/{ko-EQO5AHAV.js → ko-L5CJMFDS.js} +39 -23
- package/dist/{ms-UILFSF3I.js → ms-LSNMJDR2.js} +39 -23
- package/dist/{nl-NNI45PMK.js → nl-ZB32MB7U.js} +39 -23
- package/dist/{no-MAL5F6P6.js → no-4GTNY7M5.js} +39 -23
- package/dist/{pl-4RMY6JAJ.js → pl-LUHBLTHB.js} +39 -23
- package/dist/{pt-VQH2X3QQ.js → pt-C4H3UNQ6.js} +39 -23
- package/dist/{ro-XXCQO2OG.js → ro-GGITS5V4.js} +39 -23
- package/dist/{sv-7Z6EJ6U4.js → sv-T56RTLBP.js} +39 -23
- package/dist/test-utils.js +2 -2
- package/dist/{th-L3DXXYVQ.js → th-22X2IWCB.js} +39 -23
- package/dist/{tr-P3DFVLFJ.js → tr-77TFG62H.js} +39 -23
- package/dist/{uk-7C5D3PXS.js → uk-MIIL6NXT.js} +39 -23
- package/dist/{vi-ZLTLEO7P.js → vi-7JYOIGNV.js} +39 -23
- package/dist/{zh-5FHVWDIN.js → zh-ID6DRYU4.js} +39 -23
- package/package.json +9 -8
- package/src/components/AssistProgress.tsx +36 -2
- package/src/components/CodeMirrorRenderer.tsx +8 -8
- package/src/components/__tests__/AssistProgress.test.tsx +59 -0
- package/src/components/modals/ComposeStep.tsx +218 -0
- package/src/components/modals/ConfigureGatherStep.tsx +10 -18
- package/src/components/modals/ConfigureGenerationStep.tsx +35 -19
- package/src/components/modals/ConfigureSearchStep.tsx +19 -0
- 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 +238 -50
- package/src/components/modals/ResourceGenerateModal.tsx +216 -108
- package/src/components/modals/SearchModal.css +337 -101
- package/src/components/modals/SearchResultsStep.tsx +61 -68
- package/src/components/modals/WizardFooter.tsx +7 -1
- 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 +35 -0
- package/src/components/modals/__tests__/ConfigureSearchStep.test.tsx +24 -1
- package/src/components/modals/__tests__/GatherContextStep.resource.test.tsx +463 -25
- package/src/components/modals/__tests__/ReferenceWizardModal.test.tsx +417 -38
- package/src/components/modals/__tests__/ResourceGenerateModal.test.tsx +276 -85
- package/src/components/modals/__tests__/SearchResultsStep.test.tsx +61 -0
- package/src/components/modals/__tests__/WizardFooter.test.tsx +113 -4
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +34 -1
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +38 -1
- package/src/components/resource/AnnotateView.tsx +3 -3
- package/src/components/resource/BrowseView.tsx +5 -5
- package/src/components/resource/ResourceViewer.tsx +4 -4
- package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +1 -1
- package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +1 -1
- package/src/components/resource/__tests__/BrowseView.test.tsx +9 -9
- package/src/components/resource/annotate-renderers.tsx +3 -3
- package/src/components/resource/panels/AssistSection.css +35 -0
- package/src/components/resource/panels/ReferenceEntry.tsx +9 -2
- package/src/components/resource/panels/ReferencesPanel.tsx +4 -0
- package/src/components/resource/panels/ResourceInfoPanel.tsx +89 -20
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +7 -2
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +41 -0
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +33 -1
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +148 -6
- 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 -100
- package/src/features/resource-compose/state/compose-page-state-unit.ts +5 -57
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +71 -15
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +133 -59
- package/src/styles/core/forms.css +35 -8
- package/src/styles/features/resource-viewer.css +0 -22
- package/src/styles/features/resource.css +0 -4
- package/translations/ar.json +38 -22
- package/translations/bn.json +38 -22
- package/translations/cs.json +38 -22
- package/translations/da.json +38 -22
- package/translations/de.json +38 -22
- package/translations/el.json +38 -22
- package/translations/en.json +38 -22
- package/translations/es.json +38 -22
- package/translations/fa.json +38 -22
- package/translations/fi.json +38 -22
- package/translations/fr.json +38 -22
- package/translations/he.json +38 -22
- package/translations/hi.json +38 -22
- package/translations/id.json +38 -22
- package/translations/it.json +38 -22
- package/translations/ja.json +38 -22
- package/translations/ko.json +38 -22
- package/translations/ms.json +38 -22
- package/translations/nl.json +38 -22
- package/translations/no.json +38 -22
- package/translations/pl.json +38 -22
- package/translations/pt.json +38 -22
- package/translations/ro.json +38 -22
- package/translations/sv.json +38 -22
- package/translations/th.json +38 -22
- package/translations/tr.json +38 -22
- package/translations/uk.json +38 -22
- package/translations/vi.json +38 -22
- package/translations/zh.json +38 -22
- package/dist/PdfAnnotationCanvas.client-EVUPTUWZ.js.map +0 -1
- package/dist/PdfAnnotationCanvas.client-TGDPPGXJ.css.map +0 -1
- package/dist/ar-OU3DQGC6.js.map +0 -1
- package/dist/bn-PHWCR6AZ.js.map +0 -1
- package/dist/chunk-5VDTWRXJ.js.map +0 -1
- package/dist/chunk-BTUG3VJJ.js.map +0 -1
- package/dist/chunk-O23TLLXW.js.map +0 -1
- package/dist/chunk-PCRRBU7H.js.map +0 -1
- package/dist/chunk-QT7LYM72.js.map +0 -1
- package/dist/chunk-VXASXU4K.js.map +0 -1
- package/dist/cs-NEXYZ62I.js.map +0 -1
- package/dist/da-FAT43YCU.js.map +0 -1
- package/dist/de-KRQ3WBCU.js.map +0 -1
- package/dist/el-Q4IU3EKC.js.map +0 -1
- package/dist/en-2KADE7N4.js.map +0 -1
- package/dist/es-2IO3R2MK.js.map +0 -1
- package/dist/fa-Q5GOQFXX.js.map +0 -1
- package/dist/fi-R6NMRWBE.js.map +0 -1
- package/dist/fr-QY4D5E6J.js.map +0 -1
- package/dist/he-X6Y77XHY.js.map +0 -1
- package/dist/hi-XL7IOEQM.js.map +0 -1
- package/dist/id-QZ4ZZS67.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-ME2Q7OB6.js.map +0 -1
- package/dist/ja-HX7QASRI.js.map +0 -1
- package/dist/ko-EQO5AHAV.js.map +0 -1
- package/dist/ms-UILFSF3I.js.map +0 -1
- package/dist/nl-NNI45PMK.js.map +0 -1
- package/dist/no-MAL5F6P6.js.map +0 -1
- package/dist/pl-4RMY6JAJ.js.map +0 -1
- package/dist/pt-VQH2X3QQ.js.map +0 -1
- package/dist/ro-XXCQO2OG.js.map +0 -1
- package/dist/sv-7Z6EJ6U4.js.map +0 -1
- package/dist/test-utils.css.map +0 -1
- package/dist/test-utils.js.map +0 -1
- package/dist/th-L3DXXYVQ.js.map +0 -1
- package/dist/tr-P3DFVLFJ.js.map +0 -1
- package/dist/uk-7C5D3PXS.js.map +0 -1
- package/dist/vi-ZLTLEO7P.js.map +0 -1
- package/dist/zh-5FHVWDIN.js.map +0 -1
- package/src/components/modals/ResourceSearchModal.tsx +0 -224
- package/src/components/modals/__tests__/ResourceSearchModal.test.tsx +0 -163
|
@@ -13,6 +13,8 @@ var AssistProgress = {
|
|
|
13
13
|
codeCompleteCreated: "\u5DF2\u521B\u5EFA {{count}} \u4E2A{{kind}}",
|
|
14
14
|
codeGeneratingResource: "\u751F\u6210\u4E2D\u2026",
|
|
15
15
|
codeCreatingResource: "\u6B63\u5728\u521B\u5EFA\u8D44\u6E90\u2026",
|
|
16
|
+
codeCompleteGenerated: "\u5DF2\u521B\u5EFA\u8D44\u6E90",
|
|
17
|
+
codeCompleteGeneratedTruncated: "\u5DF2\u521B\u5EFA\u8D44\u6E90 \u2014 \u5728\u957F\u5EA6\u9650\u5236\u5904\u88AB\u622A\u65AD",
|
|
16
18
|
kindHighlight: "\u9AD8\u4EAE",
|
|
17
19
|
kindComment: "\u8BC4\u8BBA",
|
|
18
20
|
kindAssessment: "\u8BC4\u4F30",
|
|
@@ -247,6 +249,7 @@ var ReferencesPanel = {
|
|
|
247
249
|
noIncomingReferences: "\u65E0\u4F20\u5165\u5F15\u7528",
|
|
248
250
|
stub: "\u5B58\u6839\u5F15\u7528\uFF08\u672A\u94FE\u63A5\uFF09",
|
|
249
251
|
resolved: "\u5DF2\u89E3\u6790\u5F15\u7528\uFF08\u5DF2\u94FE\u63A5\uFF09",
|
|
252
|
+
derived: "\u6D3E\u751F",
|
|
250
253
|
open: "\u6253\u5F00",
|
|
251
254
|
unlink: "\u53D6\u6D88\u94FE\u63A5",
|
|
252
255
|
resolve: "\u89E3\u6790\u5F15\u7528",
|
|
@@ -254,7 +257,6 @@ var ReferencesPanel = {
|
|
|
254
257
|
createReference: "\u521B\u5EFA\u5F15\u7528",
|
|
255
258
|
entityTypesOptional: "\u5B9E\u4F53\u7C7B\u578B\uFF08\u53EF\u9009\uFF09",
|
|
256
259
|
fragmentSelected: "\u5DF2\u9009\u62E9\u7247\u6BB5",
|
|
257
|
-
imageRegionSelected: "\u5DF2\u9009\u62E9\u56FE\u50CF\u533A\u57DF",
|
|
258
260
|
annotateReferences: "\u6CE8\u91CA\u5F15\u7528",
|
|
259
261
|
selectEntityTypes: "\u5B9E\u4F53\u7C7B\u578B\uFF1A",
|
|
260
262
|
select: "\u9009\u62E9",
|
|
@@ -265,8 +267,6 @@ var ReferencesPanel = {
|
|
|
265
267
|
annotating: "\u6B63\u5728\u6CE8\u91CA...",
|
|
266
268
|
includeDescriptiveReferences: "\u5305\u542B\u63CF\u8FF0\u6027\u5F15\u7528",
|
|
267
269
|
descriptiveReferencesTooltip: "\u540C\u65F6\u67E5\u627E\u8BF8\u5982\u300C\u9996\u5E2D\u6267\u884C\u5B98\u300D\u3001\u300C\u79D1\u6280\u5DE8\u5934\u300D\u3001\u300C\u7269\u7406\u5B66\u5BB6\u300D\u7B49\u77ED\u8BED\uFF08\u9664\u540D\u79F0\u5916\uFF09",
|
|
268
|
-
annotationProgressTitle: "\u6B63\u5728\u6CE8\u91CA\u5B9E\u4F53\u5F15\u7528",
|
|
269
|
-
cancelAnnotation: "\u53D6\u6D88\u6CE8\u91CA",
|
|
270
270
|
found: "\u627E\u5230 {{count}} \u4E2A",
|
|
271
271
|
complete: "\u6CE8\u91CA\u5B8C\u6210\uFF01",
|
|
272
272
|
failed: "\u6CE8\u91CA\u5931\u8D25",
|
|
@@ -381,19 +381,14 @@ var Settings = {
|
|
|
381
381
|
};
|
|
382
382
|
var AnnotateView = {};
|
|
383
383
|
var ResourceGenerate = {
|
|
384
|
-
gatherTitle: "\u914D\u7F6E\u6536\u96C6",
|
|
385
|
-
reviewTitle: "\u67E5\u770B\u4E0A\u4E0B\u6587",
|
|
386
|
-
configureTitle: "\u914D\u7F6E\u751F\u6210",
|
|
387
|
-
next: "\u4E0B\u4E00\u6B65",
|
|
388
|
-
back: "\u8FD4\u56DE",
|
|
389
|
-
cancel: "\u53D6\u6D88",
|
|
390
384
|
gatherIntro: "\u9009\u62E9\u8981\u5305\u542B\u5728\u6536\u96C6\u7684\u4E0A\u4E0B\u6587\u4E2D\u7684\u5185\u5BB9\u3002",
|
|
391
385
|
includeContent: "\u5305\u542B\u8D44\u6E90\u5185\u5BB9",
|
|
392
386
|
includeSummary: "\u5305\u542B\u6458\u8981",
|
|
393
387
|
gatherDepth: "\u6DF1\u5EA6",
|
|
394
388
|
gatherMaxResources: "\u6700\u5927\u8D44\u6E90\u6570",
|
|
395
389
|
gatherButton: "\u6536\u96C6",
|
|
396
|
-
|
|
390
|
+
editGather: "\u66F4\u6539\u6536\u96C6\u8BBE\u7F6E",
|
|
391
|
+
recallLabel: "\u5DF2\u5305\u542B\u5728\u53EC\u56DE\u4E2D \u2014 \u53D6\u6D88\u9009\u62E9\u4EE5\u6392\u9664",
|
|
397
392
|
loadingContext: "\u6B63\u5728\u6536\u96C6\u4E0A\u4E0B\u6587...",
|
|
398
393
|
failedContext: "\u6536\u96C6\u4E0A\u4E0B\u6587\u5931\u8D25",
|
|
399
394
|
sourceContextLabel: "\u8D44\u6E90",
|
|
@@ -411,18 +406,22 @@ var ResourceGenerate = {
|
|
|
411
406
|
maxLength: "\u6700\u5927\u957F\u5EA6",
|
|
412
407
|
maxLengthHelp: "\u6700\u5927\u4EE4\u724C\u6570",
|
|
413
408
|
generate: "\u751F\u6210",
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
409
|
+
maxLengthCeiling: "\u53D7 {{model}} \u9650\u5236\u4E3A {{maxOutputTokens}} \u4E2A\u8BCD\u5143\u3002",
|
|
410
|
+
graphPaneTitle: "\u5468\u8FB9",
|
|
411
|
+
graphEmpty: "\u5C1A\u65E0\u94FE\u63A5\u3002",
|
|
412
|
+
resourceLinkLabel: "\u8D44\u6E90\u94FE\u63A5",
|
|
413
|
+
corpusPaneTitle: "\u76F8\u4F3C\u6BB5\u843D",
|
|
414
|
+
corpusEmpty: "\u672A\u627E\u5230\u76F8\u4F3C\u6BB5\u843D\u3002",
|
|
415
|
+
excludedReceipt: "{{types}} \u5DF2\u4ECE\u672C\u6B21\u53EC\u56DE\u4E2D\u6392\u9664",
|
|
416
|
+
machineRead: "OCR",
|
|
417
|
+
score: "\u8BC4\u5206",
|
|
418
|
+
saveLocation: "\u4FDD\u5B58\u4F4D\u7F6E",
|
|
419
|
+
discardDraftPrompt: "\u653E\u5F03\u6B64\u8349\u7A3F\uFF1F",
|
|
420
|
+
discardDraft: "\u653E\u5F03",
|
|
421
|
+
keepEditing: "\u7EE7\u7EED\u7F16\u8F91",
|
|
422
|
+
title: "\u4ECE\u6B64\u8D44\u6E90\u751F\u6210"
|
|
420
423
|
};
|
|
421
424
|
var ReferenceWizard = {
|
|
422
|
-
gatherTitle: "\u5DF2\u6536\u96C6\u7684\u4E0A\u4E0B\u6587",
|
|
423
|
-
configureGenerationTitle: "\u914D\u7F6E\u751F\u6210",
|
|
424
|
-
configureSearchTitle: "\u914D\u7F6E\u641C\u7D22",
|
|
425
|
-
searchResultsTitle: "\u641C\u7D22\u7ED3\u679C",
|
|
426
425
|
sourceContextLabel: "\u8D44\u6E90\u4E2D\u7684\u6CE8\u91CA\u4E0A\u4E0B\u6587",
|
|
427
426
|
connectionsLabel: "\u5BF9\u7B49\u6CE8\u91CA",
|
|
428
427
|
citedByLabel: "\u8D44\u6E90\u88AB\u5F15\u7528",
|
|
@@ -430,7 +429,6 @@ var ReferenceWizard = {
|
|
|
430
429
|
userHintPlaceholder: "\u63CF\u8FF0\u6B64\u6CE8\u91CA\u6240\u6307\u7684\u5185\u5BB9...",
|
|
431
430
|
loadingContext: "\u6B63\u5728\u6536\u96C6\u4E0A\u4E0B\u6587...",
|
|
432
431
|
failedContext: "\u6536\u96C6\u4E0A\u4E0B\u6587\u5931\u8D25",
|
|
433
|
-
cancel: "\u53D6\u6D88",
|
|
434
432
|
generate: "\u751F\u6210",
|
|
435
433
|
compose: "\u7F16\u5199",
|
|
436
434
|
resolutionStrategyLabel: "\u89E3\u6790\u7B56\u7565",
|
|
@@ -453,8 +451,26 @@ var ReferenceWizard = {
|
|
|
453
451
|
semanticScoring: "\u8BED\u4E49\u8BC4\u5206",
|
|
454
452
|
semanticScoringHelp: "\u4F7F\u7528 AI \u6309\u8BED\u4E49\u76F8\u5173\u6027\u5BF9\u7ED3\u679C\u8FDB\u884C\u8BC4\u5206",
|
|
455
453
|
searching: "\u641C\u7D22\u4E2D...",
|
|
454
|
+
searchFailed: "\u641C\u7D22\u5931\u8D25",
|
|
456
455
|
search: "\u641C\u7D22",
|
|
457
|
-
maxLengthCeiling: "\u53D7 {{model}} \u9650\u5236\u4E3A {{maxOutputTokens}} \u4E2A\u8BCD\u5143\u3002"
|
|
456
|
+
maxLengthCeiling: "\u53D7 {{model}} \u9650\u5236\u4E3A {{maxOutputTokens}} \u4E2A\u8BCD\u5143\u3002",
|
|
457
|
+
graphPaneTitle: "\u5468\u8FB9",
|
|
458
|
+
graphEmpty: "\u5C1A\u65E0\u94FE\u63A5 \u2014 \u89E3\u6790\u6B64\u5F15\u7528\u5C06\u521B\u5EFA\u7B2C\u4E00\u4E2A\u3002",
|
|
459
|
+
resourceLinkLabel: "\u8D44\u6E90\u94FE\u63A5",
|
|
460
|
+
corpusPaneTitle: "\u76F8\u4F3C\u6BB5\u843D",
|
|
461
|
+
corpusEmpty: "\u672A\u627E\u5230\u76F8\u4F3C\u6BB5\u843D \u2014 \u641C\u7D22\u4E0D\u592A\u53EF\u80FD\u6709\u7ED3\u679C\u3002",
|
|
462
|
+
excludedReceipt: "{{types}} \u5DF2\u4ECE\u672C\u6B21\u53EC\u56DE\u4E2D\u6392\u9664",
|
|
463
|
+
machineRead: "OCR",
|
|
464
|
+
userHintEffect: "\u5F15\u5BFC\u641C\u7D22\u4E0E\u751F\u6210",
|
|
465
|
+
saveLocation: "\u4FDD\u5B58\u4F4D\u7F6E",
|
|
466
|
+
entityTypes: "\u5B9E\u4F53\u7C7B\u578B",
|
|
467
|
+
contentLabel: "\u5185\u5BB9",
|
|
468
|
+
createAndLink: "\u521B\u5EFA\u5E76\u94FE\u63A5",
|
|
469
|
+
creatingAndLinking: "\u6B63\u5728\u521B\u5EFA\u5E76\u94FE\u63A5\u2026",
|
|
470
|
+
discardDraftPrompt: "\u653E\u5F03\u6B64\u8349\u7A3F\uFF1F",
|
|
471
|
+
discardDraft: "\u653E\u5F03",
|
|
472
|
+
keepEditing: "\u7EE7\u7EED\u7F16\u8F91",
|
|
473
|
+
resolveTitle: "\u89E3\u6790\u5F15\u7528"
|
|
458
474
|
};
|
|
459
475
|
var OutcomeToasts = {
|
|
460
476
|
createFailed: "\u65E0\u6CD5\u521B\u5EFA\u6279\u6CE8\uFF1A{{detail}}",
|
|
@@ -522,4 +538,4 @@ export {
|
|
|
522
538
|
UnifiedAnnotationsPanel,
|
|
523
539
|
zh_default as default
|
|
524
540
|
};
|
|
525
|
-
//# sourceMappingURL=zh-
|
|
541
|
+
//# sourceMappingURL=zh-ID6DRYU4.js.map
|
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
|
},
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
39
|
+
"!dist/**/*.map",
|
|
39
40
|
"src/styles",
|
|
40
41
|
"src/components",
|
|
41
42
|
"src/features",
|
|
@@ -91,21 +92,21 @@
|
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
94
|
"@headlessui/react": "^2.2.10",
|
|
94
|
-
"@testing-library/jest-dom": "^7.0.
|
|
95
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
95
96
|
"@testing-library/react": "^16.1.0",
|
|
96
97
|
"@types/react": "^19.2.18",
|
|
97
98
|
"@types/react-dom": "^19.2.4",
|
|
98
99
|
"@vitest/coverage-v8": "^4.1.8",
|
|
99
100
|
"autoprefixer": "^10.5.4",
|
|
100
101
|
"axe-core": "^4.12.1",
|
|
101
|
-
"cssnano": "^8.0.
|
|
102
|
+
"cssnano": "^8.0.5",
|
|
102
103
|
"fast-check": "^4.9.0",
|
|
103
104
|
"jest-axe": "^11.0.0",
|
|
104
105
|
"jsdom": "^29.1.1",
|
|
105
106
|
"postcss-import": "^16.1.1",
|
|
106
107
|
"rollup": "^4.62.3",
|
|
107
108
|
"rollup-plugin-dts": "^6.4.1",
|
|
108
|
-
"styled-components": "^6.
|
|
109
|
+
"styled-components": "^6.5.2",
|
|
109
110
|
"tsup": "^8.0.1",
|
|
110
111
|
"typescript": "^6.0.2",
|
|
111
112
|
"vitest": "^4.1.10"
|
|
@@ -117,13 +118,13 @@
|
|
|
117
118
|
"license": "Apache-2.0",
|
|
118
119
|
"repository": {
|
|
119
120
|
"type": "git",
|
|
120
|
-
"url": "https://github.com/The-AI-Alliance/semiont.git",
|
|
121
|
+
"url": "git+https://github.com/The-AI-Alliance/semiont.git",
|
|
121
122
|
"directory": "packages/react-ui"
|
|
122
123
|
},
|
|
123
124
|
"dependencies": {
|
|
124
|
-
"@semiont/core": "0.5.
|
|
125
|
-
"@semiont/http-transport": "0.5.
|
|
126
|
-
"@semiont/sdk": "0.5.
|
|
125
|
+
"@semiont/core": "0.5.28",
|
|
126
|
+
"@semiont/http-transport": "0.5.28",
|
|
127
|
+
"@semiont/sdk": "0.5.28",
|
|
127
128
|
"clsx": "^2.1.1",
|
|
128
129
|
"pdfjs-dist": "^6.2.108",
|
|
129
130
|
"react-error-boundary": "^6.1.2",
|
|
@@ -57,6 +57,22 @@ export type AssistDataType =
|
|
|
57
57
|
export interface AssistProgressProps {
|
|
58
58
|
progress: JobProgress;
|
|
59
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;
|
|
60
76
|
/**
|
|
61
77
|
* The run has ENDED. The owner's fact, not the payload's
|
|
62
78
|
* (ASSIST-PROGRESS-CONSOLIDATION D7): terminality is signalled on
|
|
@@ -96,6 +112,8 @@ export function AssistProgress({
|
|
|
96
112
|
progress,
|
|
97
113
|
dataType,
|
|
98
114
|
ended,
|
|
115
|
+
outcome,
|
|
116
|
+
endedMessage,
|
|
99
117
|
onCancel,
|
|
100
118
|
onDismiss,
|
|
101
119
|
translations: tr,
|
|
@@ -155,7 +173,9 @@ export function AssistProgress({
|
|
|
155
173
|
{ended ? '✅' : '✨'}
|
|
156
174
|
</span>
|
|
157
175
|
<span data-testid="semiont-assist-status">
|
|
158
|
-
{
|
|
176
|
+
{ended && endedMessage
|
|
177
|
+
? endedMessage
|
|
178
|
+
: progress.message ? tr.message(progress.message) : tr.inProgress}
|
|
159
179
|
</span>
|
|
160
180
|
</div>
|
|
161
181
|
|
|
@@ -166,11 +186,25 @@ export function AssistProgress({
|
|
|
166
186
|
</div>
|
|
167
187
|
)}
|
|
168
188
|
|
|
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). */}
|
|
169
203
|
<div className="semiont-progress-bar" data-testid="semiont-assist-bar">
|
|
170
204
|
<div
|
|
171
205
|
className="semiont-progress-bar__fill"
|
|
172
206
|
data-type={dataType}
|
|
173
|
-
style={{ width: `${progress.percentage}%` }}
|
|
207
|
+
style={{ width: `${ended ? 100 : progress.percentage}%` }}
|
|
174
208
|
/>
|
|
175
209
|
</div>
|
|
176
210
|
|
|
@@ -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(() => {
|
|
@@ -267,6 +267,26 @@ describe('AssistProgress — P3 consolidation', () => {
|
|
|
267
267
|
expect(screen.getByTestId(STATUS).textContent).toContain('tr.code(detecting-entities)');
|
|
268
268
|
});
|
|
269
269
|
|
|
270
|
+
it('the outcome link renders only in the ended frame (GENERATE-FROM-RESOURCE P2, D8)', async () => {
|
|
271
|
+
// The label is the resource's name — user content, deliberately NOT a
|
|
272
|
+
// translation. While the run is live there is no outcome to offer, even if
|
|
273
|
+
// a caller wires the prop early.
|
|
274
|
+
const onOpen = vi.fn();
|
|
275
|
+
const outcome = { label: 'Summary of PB', onOpen };
|
|
276
|
+
const { rerender } = render(
|
|
277
|
+
<AssistProgress ended={false} progress={detecting()} dataType="generation"
|
|
278
|
+
outcome={outcome} translations={T3()} />,
|
|
279
|
+
);
|
|
280
|
+
expect(screen.queryByText('Summary of PB')).toBeNull();
|
|
281
|
+
|
|
282
|
+
rerender(
|
|
283
|
+
<AssistProgress ended progress={detecting()} dataType="generation"
|
|
284
|
+
outcome={outcome} translations={T3()} />,
|
|
285
|
+
);
|
|
286
|
+
await userEvent.click(screen.getByRole('button', { name: 'Summary of PB' }));
|
|
287
|
+
expect(onOpen).toHaveBeenCalledTimes(1);
|
|
288
|
+
});
|
|
289
|
+
|
|
270
290
|
it('H1: the params line appears only when it adds information', () => {
|
|
271
291
|
// The discriminator is the COUNT, not the copy — splitting a localized
|
|
272
292
|
// string on commas to decide whether to show it would be its own defect.
|
|
@@ -288,3 +308,42 @@ describe('AssistProgress — P3 consolidation', () => {
|
|
|
288
308
|
expect(screen.getByTestId(PARAMS)).toBeInTheDocument();
|
|
289
309
|
});
|
|
290
310
|
});
|
|
311
|
+
|
|
312
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
313
|
+
// GENERATION-ARRIVAL P1 — the honest ended frame. The producer's terminal
|
|
314
|
+
// 100% frame races job:complete and can lose (its emit is a fire-and-forget
|
|
315
|
+
// heartbeat); terminality is the OWNER's fact (D7), so the ended rendering
|
|
316
|
+
// stops trusting the last payload: full bar, and the owner's terminal
|
|
317
|
+
// sentence when it supplies one.
|
|
318
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
319
|
+
describe('AssistProgress — the honest ended frame (GENERATION-ARRIVAL P1)', () => {
|
|
320
|
+
it('A1: an ended frame renders a FULL bar whatever the last payload said', () => {
|
|
321
|
+
const { container } = render(
|
|
322
|
+
<AssistProgress ended progress={detecting({ percentage: 95 })} dataType="generation" translations={T3()} />,
|
|
323
|
+
);
|
|
324
|
+
const fill = container.querySelector('.semiont-progress-bar__fill') as HTMLElement;
|
|
325
|
+
expect(fill.style.width).toBe('100%');
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('a live frame keeps the payload percentage', () => {
|
|
329
|
+
const { container } = render(
|
|
330
|
+
<AssistProgress ended={false} progress={detecting({ percentage: 95 })} dataType="generation" translations={T3()} />,
|
|
331
|
+
);
|
|
332
|
+
const fill = container.querySelector('.semiont-progress-bar__fill') as HTMLElement;
|
|
333
|
+
expect(fill.style.width).toBe('95%');
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
it('endedMessage replaces the stale payload copy once ended', () => {
|
|
337
|
+
render(
|
|
338
|
+
<AssistProgress ended endedMessage="tr.ended" progress={detecting({ percentage: 95 })} dataType="generation" translations={T3()} />,
|
|
339
|
+
);
|
|
340
|
+
expect(screen.getByTestId(STATUS).textContent).toBe('tr.ended');
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
it('endedMessage is inert while the run is live', () => {
|
|
344
|
+
render(
|
|
345
|
+
<AssistProgress ended={false} endedMessage="tr.ended" progress={detecting()} dataType="generation" translations={T3()} />,
|
|
346
|
+
);
|
|
347
|
+
expect(screen.getByTestId(STATUS).textContent).toBe('tr.code(detecting-entities)');
|
|
348
|
+
});
|
|
349
|
+
});
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { LOCALES } from '@semiont/core';
|
|
5
|
+
import { CodeMirrorRenderer } from '../CodeMirrorRenderer';
|
|
6
|
+
import { WizardFooter } from './WizardFooter';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* COMPOSE-IN-MODAL P1 — the compose strategy's form, as a pure step.
|
|
10
|
+
*
|
|
11
|
+
* The from-reference slice of the compose page, lifted: name, save location,
|
|
12
|
+
* entity types, language, editor. Deliberately none of the page's
|
|
13
|
+
* upload/format/encoding machinery (the modal composes text; uploads stay on
|
|
14
|
+
* the standalone page — plan non-goal). The draft is CONTROLLED by the host
|
|
15
|
+
* (WIZARD-NAVIGATION D3), and the evidence display is the host's job (A3).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export interface ComposeDraft {
|
|
19
|
+
name: string;
|
|
20
|
+
/** Bare working-tree path; the file:// prefix is applied at submit. */
|
|
21
|
+
storagePath: string;
|
|
22
|
+
content: string;
|
|
23
|
+
/** Picked types — consulted only when the reference fixed none (D6). */
|
|
24
|
+
entityTypes: string[];
|
|
25
|
+
language: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ComposeParams {
|
|
29
|
+
name: string;
|
|
30
|
+
/** Full file:// URI. */
|
|
31
|
+
storagePath: string;
|
|
32
|
+
content: string;
|
|
33
|
+
entityTypes: string[];
|
|
34
|
+
language: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ComposeStepProps {
|
|
38
|
+
draft: ComposeDraft;
|
|
39
|
+
onDraftChange: (patch: Partial<ComposeDraft>) => void;
|
|
40
|
+
/** Entity types fixed when the reference was created — read-only tags when
|
|
41
|
+
* non-empty (D6): they are not this step's to change. */
|
|
42
|
+
referenceEntityTypes: string[];
|
|
43
|
+
/** Picker vocabulary when the reference fixed none. Owner-supplied, so a
|
|
44
|
+
* failed load cannot surface as an empty vocabulary. */
|
|
45
|
+
entityTypeOptions: string[];
|
|
46
|
+
showLineNumbers: boolean;
|
|
47
|
+
hoverDelayMs: number;
|
|
48
|
+
onBack: () => void;
|
|
49
|
+
/** Create-and-link. Async: the footer pends until it settles; rejection
|
|
50
|
+
* re-enables it (the host surfaces the error — same posture as Link). */
|
|
51
|
+
onCompose: (params: ComposeParams) => Promise<void>;
|
|
52
|
+
translations: {
|
|
53
|
+
resourceTitle: string;
|
|
54
|
+
resourceTitlePlaceholder: string;
|
|
55
|
+
saveLocation: string;
|
|
56
|
+
entityTypes: string;
|
|
57
|
+
language: string;
|
|
58
|
+
contentLabel: string;
|
|
59
|
+
back: string;
|
|
60
|
+
createAndLink: string;
|
|
61
|
+
creatingAndLinking: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function ComposeStep({
|
|
66
|
+
draft,
|
|
67
|
+
onDraftChange,
|
|
68
|
+
referenceEntityTypes,
|
|
69
|
+
entityTypeOptions,
|
|
70
|
+
showLineNumbers,
|
|
71
|
+
hoverDelayMs,
|
|
72
|
+
onBack,
|
|
73
|
+
onCompose,
|
|
74
|
+
translations: t,
|
|
75
|
+
}: ComposeStepProps) {
|
|
76
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
77
|
+
const fixedTypes = referenceEntityTypes.length > 0;
|
|
78
|
+
|
|
79
|
+
const handleSubmit = async (e: React.FormEvent) => {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
if (!draft.name.trim() || !draft.storagePath.trim()) return;
|
|
82
|
+
setIsCreating(true);
|
|
83
|
+
try {
|
|
84
|
+
await onCompose({
|
|
85
|
+
name: draft.name,
|
|
86
|
+
storagePath: `file://${draft.storagePath}`,
|
|
87
|
+
content: draft.content,
|
|
88
|
+
entityTypes: fixedTypes ? referenceEntityTypes : draft.entityTypes,
|
|
89
|
+
language: draft.language,
|
|
90
|
+
});
|
|
91
|
+
} catch {
|
|
92
|
+
// The rejection's job ends here: it kept the wizard's close from
|
|
93
|
+
// running and the host already surfaced the failure. Letting it
|
|
94
|
+
// escape a React event handler is an unhandled rejection.
|
|
95
|
+
} finally {
|
|
96
|
+
setIsCreating(false);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<form onSubmit={handleSubmit} className="semiont-form">
|
|
102
|
+
{/* Name */}
|
|
103
|
+
<div className="semiont-form__field">
|
|
104
|
+
<label htmlFor="compose-name" className="semiont-form__label">
|
|
105
|
+
{t.resourceTitle}
|
|
106
|
+
</label>
|
|
107
|
+
<input
|
|
108
|
+
id="compose-name"
|
|
109
|
+
type="text"
|
|
110
|
+
value={draft.name}
|
|
111
|
+
onChange={(e) => onDraftChange({ name: e.target.value })}
|
|
112
|
+
placeholder={t.resourceTitlePlaceholder}
|
|
113
|
+
required
|
|
114
|
+
className="semiont-input"
|
|
115
|
+
disabled={isCreating}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
{/* Storage URI */}
|
|
120
|
+
<div className="semiont-form__field">
|
|
121
|
+
<label htmlFor="compose-storagePath" className="semiont-form__label">
|
|
122
|
+
{t.saveLocation}
|
|
123
|
+
</label>
|
|
124
|
+
<div className="semiont-input-addon">
|
|
125
|
+
<span className="semiont-input-addon__prefix">file://</span>
|
|
126
|
+
<input
|
|
127
|
+
id="compose-storagePath"
|
|
128
|
+
type="text"
|
|
129
|
+
value={draft.storagePath}
|
|
130
|
+
onChange={(e) => onDraftChange({ storagePath: e.target.value })}
|
|
131
|
+
placeholder="people/my-resource.md"
|
|
132
|
+
required
|
|
133
|
+
className="semiont-input semiont-input--addon"
|
|
134
|
+
disabled={isCreating}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
{/* Entity types: fixed at reference creation → tags; otherwise picker */}
|
|
140
|
+
<div className="semiont-form__field">
|
|
141
|
+
<div className="semiont-form__label">{t.entityTypes}</div>
|
|
142
|
+
{fixedTypes ? (
|
|
143
|
+
<div className="semiont-form__entity-type-tags" role="list">
|
|
144
|
+
{referenceEntityTypes.map((type) => (
|
|
145
|
+
<span key={type} role="listitem" className="semiont-form__entity-type-tag">
|
|
146
|
+
{type}
|
|
147
|
+
</span>
|
|
148
|
+
))}
|
|
149
|
+
</div>
|
|
150
|
+
) : (
|
|
151
|
+
<div className="semiont-form__entity-type-buttons" role="group">
|
|
152
|
+
{entityTypeOptions.map((type) => {
|
|
153
|
+
const isSelected = draft.entityTypes.includes(type);
|
|
154
|
+
return (
|
|
155
|
+
<button
|
|
156
|
+
key={type}
|
|
157
|
+
type="button"
|
|
158
|
+
onClick={() => onDraftChange({
|
|
159
|
+
entityTypes: isSelected
|
|
160
|
+
? draft.entityTypes.filter((x) => x !== type)
|
|
161
|
+
: [...draft.entityTypes, type],
|
|
162
|
+
})}
|
|
163
|
+
className="semiont-form__entity-type-button"
|
|
164
|
+
data-selected={isSelected}
|
|
165
|
+
aria-pressed={isSelected}
|
|
166
|
+
disabled={isCreating}
|
|
167
|
+
>
|
|
168
|
+
{type}
|
|
169
|
+
</button>
|
|
170
|
+
);
|
|
171
|
+
})}
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
{/* Language */}
|
|
177
|
+
<div className="semiont-form__field">
|
|
178
|
+
<label htmlFor="compose-language" className="semiont-form__label">
|
|
179
|
+
{t.language}
|
|
180
|
+
</label>
|
|
181
|
+
<select
|
|
182
|
+
id="compose-language"
|
|
183
|
+
value={draft.language}
|
|
184
|
+
onChange={(e) => onDraftChange({ language: e.target.value })}
|
|
185
|
+
disabled={isCreating}
|
|
186
|
+
className="semiont-select"
|
|
187
|
+
>
|
|
188
|
+
{LOCALES.map((lang) => (
|
|
189
|
+
<option key={lang.code} value={lang.code}>
|
|
190
|
+
{lang.nativeName}
|
|
191
|
+
</option>
|
|
192
|
+
))}
|
|
193
|
+
</select>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
{/* Content editor */}
|
|
197
|
+
<div className="semiont-form__field semiont-form__editor">
|
|
198
|
+
<label className="semiont-form__label">{t.contentLabel}</label>
|
|
199
|
+
<div className="semiont-form__editor-wrapper" lang={draft.language}>
|
|
200
|
+
<CodeMirrorRenderer
|
|
201
|
+
content={draft.content}
|
|
202
|
+
editable={!isCreating}
|
|
203
|
+
sourceView={true}
|
|
204
|
+
showLineNumbers={showLineNumbers}
|
|
205
|
+
hoverDelayMs={hoverDelayMs}
|
|
206
|
+
onChange={(content: string) => onDraftChange({ content })}
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<WizardFooter
|
|
212
|
+
backLabel={t.back}
|
|
213
|
+
onBack={onBack}
|
|
214
|
+
primary={{ label: t.createAndLink, pendingLabel: t.creatingAndLinking, pending: isCreating, type: 'submit' }}
|
|
215
|
+
/>
|
|
216
|
+
</form>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
+
import { WizardFooter } from './WizardFooter';
|
|
4
5
|
|
|
5
6
|
export interface ResourceGatherConfig {
|
|
6
7
|
depth: number;
|
|
@@ -10,16 +11,13 @@ export interface ResourceGatherConfig {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface ConfigureGatherStepProps {
|
|
13
|
-
defaults?: Partial<ResourceGatherConfig>;
|
|
14
14
|
onGather: (config: ResourceGatherConfig) => void;
|
|
15
|
-
onCancel: () => void;
|
|
16
15
|
translations: {
|
|
17
16
|
intro: string;
|
|
18
17
|
includeContent: string;
|
|
19
18
|
includeSummary: string;
|
|
20
19
|
depth: string;
|
|
21
20
|
maxResources: string;
|
|
22
|
-
cancel: string;
|
|
23
21
|
gather: string;
|
|
24
22
|
};
|
|
25
23
|
/** Slot for the exclusion multi-select (GENERATE-FROM-BUTTON Phase 4). */
|
|
@@ -29,13 +27,14 @@ export interface ConfigureGatherStepProps {
|
|
|
29
27
|
/**
|
|
30
28
|
* First step of the resource-generate flow: pick the gather options before
|
|
31
29
|
* `gather.resource` runs. The `children` slot hosts the entity-type exclusion
|
|
32
|
-
* multi-select (Phase 4).
|
|
30
|
+
* multi-select (Phase 4). Dismissal is the modal's corner ✕/Esc/backdrop
|
|
31
|
+
* (WIZARD-NAVIGATION D1), so the footer carries the advance alone.
|
|
33
32
|
*/
|
|
34
|
-
export function ConfigureGatherStep({
|
|
35
|
-
const [includeContent, setIncludeContent] = useState(
|
|
36
|
-
const [includeSummary, setIncludeSummary] = useState(
|
|
37
|
-
const [depth, setDepth] = useState(
|
|
38
|
-
const [maxResources, setMaxResources] = useState(
|
|
33
|
+
export function ConfigureGatherStep({ onGather, translations: t, children }: ConfigureGatherStepProps) {
|
|
34
|
+
const [includeContent, setIncludeContent] = useState(true);
|
|
35
|
+
const [includeSummary, setIncludeSummary] = useState(true);
|
|
36
|
+
const [depth, setDepth] = useState(2);
|
|
37
|
+
const [maxResources, setMaxResources] = useState(10);
|
|
39
38
|
|
|
40
39
|
const handleSubmit = (e: React.FormEvent) => {
|
|
41
40
|
e.preventDefault();
|
|
@@ -43,7 +42,7 @@ export function ConfigureGatherStep({ defaults, onGather, onCancel, translations
|
|
|
43
42
|
};
|
|
44
43
|
|
|
45
44
|
return (
|
|
46
|
-
<form onSubmit={handleSubmit} className="semiont-form
|
|
45
|
+
<form onSubmit={handleSubmit} className="semiont-form">
|
|
47
46
|
<p className="semiont-form__helper-text">{t.intro}</p>
|
|
48
47
|
|
|
49
48
|
<div className="semiont-form__checkbox-field">
|
|
@@ -89,14 +88,7 @@ export function ConfigureGatherStep({ defaults, onGather, onCancel, translations
|
|
|
89
88
|
{/* Exclusion multi-select slot (Phase 4) */}
|
|
90
89
|
{children}
|
|
91
90
|
|
|
92
|
-
<
|
|
93
|
-
<button type="button" onClick={onCancel} className="semiont-button--secondary semiont-button--flex">
|
|
94
|
-
✕ {t.cancel}
|
|
95
|
-
</button>
|
|
96
|
-
<button type="submit" className="semiont-button--primary semiont-button--flex">
|
|
97
|
-
✨ {t.gather}
|
|
98
|
-
</button>
|
|
99
|
-
</div>
|
|
91
|
+
<WizardFooter primary={{ label: t.gather, type: 'submit' }} />
|
|
100
92
|
</form>
|
|
101
93
|
);
|
|
102
94
|
}
|