@consilioweb/spellcheck 0.10.1
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 +21 -0
- package/README.md +567 -0
- package/dist/client.cjs +1711 -0
- package/dist/client.d.cts +77 -0
- package/dist/client.d.ts +77 -0
- package/dist/client.js +1702 -0
- package/dist/index.cjs +1691 -0
- package/dist/index.d.cts +268 -0
- package/dist/index.d.ts +268 -0
- package/dist/index.js +1677 -0
- package/dist/views.cjs +32 -0
- package/dist/views.d.cts +11 -0
- package/dist/views.d.ts +11 -0
- package/dist/views.js +30 -0
- package/package.json +102 -0
- package/scripts/debug-check.mjs +295 -0
- package/scripts/install.mjs +236 -0
- package/scripts/uninstall.mjs +350 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SpellCheckField — sidebar field component for the Payload editor.
|
|
5
|
+
* Shows spellcheck score + issues for the current document.
|
|
6
|
+
*
|
|
7
|
+
* After a fix or ignore, the issue is removed from the list (optimistic update)
|
|
8
|
+
* and the change is persisted to the spellcheck-results collection.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare const SpellCheckField: React.FC;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* SpellCheckDashboard — main admin dashboard for bulk spellcheck.
|
|
15
|
+
* Tab 1: Results table with scores, issues, and scan controls.
|
|
16
|
+
* Tab 2: Dynamic dictionary management (add/remove/import/export).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
declare const SpellCheckDashboard: React.FC;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Spellcheck Plugin — Type definitions.
|
|
23
|
+
*/
|
|
24
|
+
interface SpellCheckIssue {
|
|
25
|
+
/** LanguageTool rule ID (e.g. 'GRAMMAR', 'MORFOLOGIK_RULE_FR') */
|
|
26
|
+
ruleId: string;
|
|
27
|
+
/** LanguageTool category (e.g. 'GRAMMAR', 'TYPOS') */
|
|
28
|
+
category: string;
|
|
29
|
+
/** Human-readable message explaining the issue */
|
|
30
|
+
message: string;
|
|
31
|
+
/** Text context around the error */
|
|
32
|
+
context: string;
|
|
33
|
+
/** Offset of the error within the context string */
|
|
34
|
+
contextOffset: number;
|
|
35
|
+
/** Offset within the full extracted text */
|
|
36
|
+
offset: number;
|
|
37
|
+
/** Length of the problematic text */
|
|
38
|
+
length: number;
|
|
39
|
+
/** The original (wrong) text */
|
|
40
|
+
original: string;
|
|
41
|
+
/** Suggested replacements (max 3) */
|
|
42
|
+
replacements: string[];
|
|
43
|
+
/** Source engine: 'languagetool' or 'claude' */
|
|
44
|
+
source: 'languagetool' | 'claude';
|
|
45
|
+
/** Whether this is a premium-only rule */
|
|
46
|
+
isPremium?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* IssueCard — displays a single spellcheck issue with context, suggestion, and fix button.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
interface IssueCardProps {
|
|
54
|
+
issue: SpellCheckIssue;
|
|
55
|
+
onFix?: (original: string, replacement: string, offset: number, length: number) => void;
|
|
56
|
+
onIgnore?: (ruleId: string) => void;
|
|
57
|
+
onAddToDict?: (word: string) => void;
|
|
58
|
+
isFixed?: boolean;
|
|
59
|
+
}
|
|
60
|
+
declare const IssueCard: React.FC<IssueCardProps>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* SpellCheckScoreCell — custom Cell component for collection list views.
|
|
64
|
+
* Shows the spellcheck score badge (green/yellow/red) inline in the table.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
interface SpellCheckScoreCellProps {
|
|
68
|
+
rowData?: {
|
|
69
|
+
id?: string | number;
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
collectionSlug?: string;
|
|
73
|
+
cellData?: unknown;
|
|
74
|
+
}
|
|
75
|
+
declare const SpellCheckScoreCell: React.FC<SpellCheckScoreCellProps>;
|
|
76
|
+
|
|
77
|
+
export { IssueCard, SpellCheckDashboard, SpellCheckField, SpellCheckScoreCell };
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SpellCheckField — sidebar field component for the Payload editor.
|
|
5
|
+
* Shows spellcheck score + issues for the current document.
|
|
6
|
+
*
|
|
7
|
+
* After a fix or ignore, the issue is removed from the list (optimistic update)
|
|
8
|
+
* and the change is persisted to the spellcheck-results collection.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare const SpellCheckField: React.FC;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* SpellCheckDashboard — main admin dashboard for bulk spellcheck.
|
|
15
|
+
* Tab 1: Results table with scores, issues, and scan controls.
|
|
16
|
+
* Tab 2: Dynamic dictionary management (add/remove/import/export).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
declare const SpellCheckDashboard: React.FC;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Spellcheck Plugin — Type definitions.
|
|
23
|
+
*/
|
|
24
|
+
interface SpellCheckIssue {
|
|
25
|
+
/** LanguageTool rule ID (e.g. 'GRAMMAR', 'MORFOLOGIK_RULE_FR') */
|
|
26
|
+
ruleId: string;
|
|
27
|
+
/** LanguageTool category (e.g. 'GRAMMAR', 'TYPOS') */
|
|
28
|
+
category: string;
|
|
29
|
+
/** Human-readable message explaining the issue */
|
|
30
|
+
message: string;
|
|
31
|
+
/** Text context around the error */
|
|
32
|
+
context: string;
|
|
33
|
+
/** Offset of the error within the context string */
|
|
34
|
+
contextOffset: number;
|
|
35
|
+
/** Offset within the full extracted text */
|
|
36
|
+
offset: number;
|
|
37
|
+
/** Length of the problematic text */
|
|
38
|
+
length: number;
|
|
39
|
+
/** The original (wrong) text */
|
|
40
|
+
original: string;
|
|
41
|
+
/** Suggested replacements (max 3) */
|
|
42
|
+
replacements: string[];
|
|
43
|
+
/** Source engine: 'languagetool' or 'claude' */
|
|
44
|
+
source: 'languagetool' | 'claude';
|
|
45
|
+
/** Whether this is a premium-only rule */
|
|
46
|
+
isPremium?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* IssueCard — displays a single spellcheck issue with context, suggestion, and fix button.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
interface IssueCardProps {
|
|
54
|
+
issue: SpellCheckIssue;
|
|
55
|
+
onFix?: (original: string, replacement: string, offset: number, length: number) => void;
|
|
56
|
+
onIgnore?: (ruleId: string) => void;
|
|
57
|
+
onAddToDict?: (word: string) => void;
|
|
58
|
+
isFixed?: boolean;
|
|
59
|
+
}
|
|
60
|
+
declare const IssueCard: React.FC<IssueCardProps>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* SpellCheckScoreCell — custom Cell component for collection list views.
|
|
64
|
+
* Shows the spellcheck score badge (green/yellow/red) inline in the table.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
interface SpellCheckScoreCellProps {
|
|
68
|
+
rowData?: {
|
|
69
|
+
id?: string | number;
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
72
|
+
collectionSlug?: string;
|
|
73
|
+
cellData?: unknown;
|
|
74
|
+
}
|
|
75
|
+
declare const SpellCheckScoreCell: React.FC<SpellCheckScoreCellProps>;
|
|
76
|
+
|
|
77
|
+
export { IssueCard, SpellCheckDashboard, SpellCheckField, SpellCheckScoreCell };
|