@lax-wp/editor 0.4.13 → 0.4.15-beta.0
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 +25 -0
- package/dist/api/audit.d.ts +79 -0
- package/dist/api/derivedRulebook.d.ts +470 -0
- package/dist/api/documentVersions.d.ts +519 -0
- package/dist/api/effectiveRules.d.ts +372 -0
- package/dist/api/methodology.d.ts +62 -0
- package/dist/api/playbook.d.ts +604 -0
- package/dist/api/promotions.d.ts +1432 -0
- package/dist/api/r1.d.ts +1097 -0
- package/dist/api/r1.fixtures.d.ts +111 -0
- package/dist/api/redlineJobs.d.ts +377 -0
- package/dist/api/redlineStream.d.ts +2979 -0
- package/dist/api/redlines.d.ts +504 -0
- package/dist/api/regsync.d.ts +2355 -0
- package/dist/api/ruleAuthoring.d.ts +305 -0
- package/dist/api/ruleBuilder.d.ts +1009 -0
- package/dist/api/ruleOverrides.d.ts +31 -0
- package/dist/api/ruleStats.d.ts +84 -0
- package/dist/api/rulesCatalog.d.ts +234 -0
- package/dist/api/versions.d.ts +76 -0
- package/dist/api/workspace.d.ts +41 -0
- package/dist/components/EditorSidebar.d.ts +4 -1
- package/dist/components/audit/AuditView.d.ts +8 -0
- package/dist/components/capturededits/AddAsRuleModal.d.ts +8 -0
- package/dist/components/capturededits/CapturedEditCard.d.ts +15 -0
- package/dist/components/capturededits/CapturedEditsTray.d.ts +4 -0
- package/dist/components/capturededits/capturedEditIntent.d.ts +23 -0
- package/dist/components/common/EscDropdown.d.ts +2 -0
- package/dist/components/compliance/MethodologyPanel.d.ts +14 -0
- package/dist/components/compliance/RegSyncPanel.d.ts +18 -0
- package/dist/components/compliance/index.d.ts +8 -0
- package/dist/components/compliance/primitives.d.ts +41 -0
- package/dist/components/documents/DocumentVersionHistory.d.ts +12 -0
- package/dist/components/documents/documentDiff.d.ts +68 -0
- package/dist/components/documents/index.d.ts +4 -0
- package/dist/components/flowdown/FlowdownPanel.d.ts +28 -0
- package/dist/components/flowdown/FlowdownRowCard.d.ts +27 -0
- package/dist/components/flowdown/flowdownModel.d.ts +150 -0
- package/dist/components/history/PlaybookVersionHistory.d.ts +10 -0
- package/dist/components/history/versionDiff.d.ts +14 -0
- package/dist/components/playbook/AllPlaybooksView.d.ts +41 -0
- package/dist/components/playbook/DerivedRulebookView.d.ts +9 -0
- package/dist/components/playbook/DraftedRulePreview.d.ts +17 -0
- package/dist/components/playbook/EffectiveRulesView.d.ts +11 -0
- package/dist/components/playbook/NewRuleDrawer.d.ts +11 -0
- package/dist/components/playbook/PlaybookCard.d.ts +13 -0
- package/dist/components/playbook/PlaybookPage.d.ts +29 -0
- package/dist/components/playbook/PlaybookPanel.d.ts +73 -0
- package/dist/components/playbook/PromotionSuggestions.d.ts +1 -0
- package/dist/components/playbook/ReprioritizeDialog.d.ts +16 -0
- package/dist/components/playbook/RuleDetail.d.ts +27 -0
- package/dist/components/playbook/RuleEditorFields.d.ts +42 -0
- package/dist/components/playbook/RuleEditorModal.d.ts +27 -0
- package/dist/components/playbook/RulePerformancePanel.d.ts +4 -0
- package/dist/components/playbook/RuleRow.d.ts +26 -0
- package/dist/components/playbook/ThisDocumentView.d.ts +45 -0
- package/dist/components/playbook/ViewTabs.d.ts +8 -0
- package/dist/components/playbook/index.d.ts +14 -0
- package/dist/components/playbook/predicateSummary.d.ts +10 -0
- package/dist/components/playbook/primitives.d.ts +82 -0
- package/dist/components/playbook/useFocusTrap.d.ts +6 -0
- package/dist/components/playbook/usePlaybookData.d.ts +161 -0
- package/dist/components/playbook/usePlaybookLabel.d.ts +18 -0
- package/dist/components/r1/ApprovalPanel.d.ts +10 -0
- package/dist/components/r1/CandidateRuleCard.d.ts +8 -0
- package/dist/components/r1/ExecSummaryPanel.d.ts +23 -0
- package/dist/components/r1/PrimeUploadPanel.d.ts +8 -0
- package/dist/components/r1/ReviewStartControls.d.ts +24 -0
- package/dist/components/r1/ReviewSummaryTab.d.ts +38 -0
- package/dist/components/r1/index.d.ts +13 -0
- package/dist/components/r1/primitives.d.ts +59 -0
- package/dist/components/redline/AiReviewPanel.d.ts +194 -0
- package/dist/components/redline/RedlineHoverCard.d.ts +13 -0
- package/dist/components/redline/RedlineItem.d.ts +12 -0
- package/dist/components/redline/ReviewCard.d.ts +49 -0
- package/dist/components/redline/index.d.ts +6 -0
- package/dist/components/redline/reviewItems.d.ts +49 -0
- package/dist/components/redline/reviewPrefs.d.ts +18 -0
- package/dist/components/redline/useRunScopedCards.d.ts +16 -0
- package/dist/components/rulebuilder/AuthorForms.d.ts +28 -0
- package/dist/components/rulebuilder/CandidateQueue.d.ts +21 -0
- package/dist/components/rulebuilder/DraftPane.d.ts +12 -0
- package/dist/components/rulebuilder/RuleBuilderPanel.d.ts +6 -0
- package/dist/components/rulebuilder/RuleCard.d.ts +16 -0
- package/dist/components/rulebuilder/TestBench.d.ts +10 -0
- package/dist/components/rulebuilder/VocabularyPanel.d.ts +26 -0
- package/dist/components/rulebuilder/index.d.ts +13 -0
- package/dist/components/rulebuilder/primitives.d.ts +54 -0
- package/dist/components/rulebuilder/useRuleBuilder.d.ts +291 -0
- package/dist/components/sidebar/ExpandableSidebar.d.ts +2 -0
- package/dist/components/sidebar/WorkspaceRetentionPanel.d.ts +18 -0
- package/dist/components/sidebar/content/TrackChangesContent.d.ts +8 -0
- package/dist/components/sidebar/content/anonymization-page/PIIAnonymization.d.ts +1 -1
- package/dist/components/sidebar/content/anonymization-page/PiiIdleView.d.ts +12 -0
- package/dist/components/sidebar/content/anonymization-page/PiiRecoveryView.d.ts +16 -0
- package/dist/components/sidebar/content/anonymization-page/PiiSummaryView.d.ts +34 -0
- package/dist/components/sidebar/content/anonymization-page/PiiUnavailableView.d.ts +1 -0
- package/dist/components/sidebar/content/anonymization-page/RestoreConfirmDialog.d.ts +9 -0
- package/dist/components/sidebar/content/anonymization-page/anonymizationUtils.d.ts +38 -17
- package/dist/components/sidebar/content/anonymization-page/piiVault.d.ts +18 -0
- package/dist/components/sidebar/content/index.d.ts +0 -1
- package/dist/components/toolbar/AutocompletionToggle.d.ts +1 -0
- package/dist/components/trackChanges/TrackChangesCards.d.ts +1 -0
- package/dist/components/trackChanges/index.d.ts +2 -0
- package/dist/components/trackChanges/utils.d.ts +5 -0
- package/dist/config/EditorConfig.d.ts +197 -73
- package/dist/constants/Extensions.d.ts +12 -0
- package/dist/constants/playbook.d.ts +108 -0
- package/dist/contexts/CapturedEditsContext.d.ts +56 -0
- package/dist/contexts/EditorShellContext.d.ts +4 -1
- package/dist/editor.css +1 -1
- package/dist/extensions/AnonymizedText.d.ts +31 -2
- package/dist/extensions/VariableText.d.ts +20 -0
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/plugins/CapturedEditsPlugin.d.ts +90 -0
- package/dist/extensions/plugins/MarkHighlightPlugin.d.ts +0 -1
- package/dist/extensions/plugins/RedlinePlugin.d.ts +9 -0
- package/dist/extensions/redline/changeTypes.d.ts +70 -0
- package/dist/extensions/redline/constants.d.ts +25 -0
- package/dist/extensions/redline/engine/blockNodes.d.ts +31 -0
- package/dist/extensions/redline/engine/clipboard.d.ts +16 -0
- package/dist/extensions/redline/engine/deletion.d.ts +34 -0
- package/dist/extensions/redline/engine/formatSplit.d.ts +16 -0
- package/dist/extensions/redline/engine/insertion.d.ts +26 -0
- package/dist/extensions/redline/engine/predicates.d.ts +73 -0
- package/dist/extensions/redline/engine/textReplace.d.ts +19 -0
- package/dist/extensions/redline/id.d.ts +7 -0
- package/dist/extensions/redline/index.d.ts +36 -0
- package/dist/extensions/redline/plugin.d.ts +34 -0
- package/dist/extensions/redline/query/scan.d.ts +52 -0
- package/dist/extensions/redline/review/applyChange.d.ts +25 -0
- package/dist/extensions/redline/review/index.d.ts +1 -0
- package/dist/extensions/redline/review/nodeResolvers.d.ts +29 -0
- package/dist/extensions/redline/review/pairedNodes.d.ts +38 -0
- package/dist/extensions/redline/review/structuralRevert.d.ts +20 -0
- package/dist/extensions/redline/review/textResolver.d.ts +9 -0
- package/dist/extensions/redline/schema/marks.d.ts +65 -0
- package/dist/extensions/redline/schema/shared.d.ts +34 -0
- package/dist/extensions/redline/session.d.ts +71 -0
- package/dist/extensions/redline/types.d.ts +24 -0
- package/dist/extensions/trackedChanges/TrackedChanges.d.ts +64 -0
- package/dist/extensions/trackedChanges/constants.d.ts +34 -0
- package/dist/extensions/trackedChanges/engine.d.ts +32 -0
- package/dist/extensions/trackedChanges/index.d.ts +13 -0
- package/dist/extensions/trackedChanges/marks.d.ts +20 -0
- package/dist/extensions/trackedChanges/normalize.d.ts +2 -0
- package/dist/extensions/trackedChanges/plugin.d.ts +32 -0
- package/dist/extensions/trackedChanges/query.d.ts +3 -0
- package/dist/extensions/trackedChanges/review.d.ts +34 -0
- package/dist/extensions/trackedChanges/types.d.ts +72 -0
- package/dist/extensions/trackedChanges/utils.d.ts +20 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/useRedlineHover.d.ts +17 -0
- package/dist/hooks/useRedlineReview.d.ts +83 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.es.js +38491 -22189
- package/dist/index.umd.js +224 -125
- package/dist/utils/cdts.d.ts +37 -0
- package/dist/utils/groundingAdapter.d.ts +36 -0
- package/package.json +39 -33
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDTS (Category / Domain / Type / Subtype) coordinate helpers — REQ-D3.
|
|
3
|
+
*
|
|
4
|
+
* Pure functions only. The prefix test is DISPLAY-ONLY (the "active" chip);
|
|
5
|
+
* authorization and evaluation walk-up are server-authoritative.
|
|
6
|
+
*/
|
|
7
|
+
/** A CDTS coordinate. Empty/absent fields wildcard everything deeper. */
|
|
8
|
+
export interface CdtsScope {
|
|
9
|
+
category?: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
subtype?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Non-empty CDTS segments in order, stopping at the first empty field —
|
|
16
|
+
* matches the backend's Depth() semantics (a wildcarded parent with a set
|
|
17
|
+
* child counts as the parent's depth).
|
|
18
|
+
*/
|
|
19
|
+
export declare const scopeSegments: (scope: CdtsScope) => string[];
|
|
20
|
+
/** Depth 0 = global, 4 = fully specified. */
|
|
21
|
+
export declare const scopeDepth: (scope: CdtsScope) => number;
|
|
22
|
+
/** Human-readable coordinate, e.g. "Gov › Services › MSA › IT-Services". */
|
|
23
|
+
export declare const formatScope: (scope: CdtsScope, separator?: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* True when `playbookScope` sits on the document's walk-up chain — i.e. its
|
|
26
|
+
* segments are a (possibly empty, possibly exact) prefix of the document's.
|
|
27
|
+
* A root-level (global) playbook matches every document.
|
|
28
|
+
*/
|
|
29
|
+
export declare const isOnChain: (playbookScope: CdtsScope, docScope: CdtsScope) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The document's CDTS walk-up chain, most-specific first, ending at the
|
|
32
|
+
* global root — the order rule groups render in (REQ-P3) and the order the
|
|
33
|
+
* evaluator applies playbooks in.
|
|
34
|
+
*/
|
|
35
|
+
export declare const chainFor: (docScope: CdtsScope) => CdtsScope[];
|
|
36
|
+
/** Serialized form for the `?cdts=` query param: segments joined with "/". */
|
|
37
|
+
export declare const serializeScope: (scope: CdtsScope) => string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grounding adapter — REQ-D4.
|
|
3
|
+
*
|
|
4
|
+
* A thin, read-only, memoized pure function over the review response the
|
|
5
|
+
* existing redline flow already holds. Parses the `grounding[]` sidecar
|
|
6
|
+
* (REDLINE_WIRE_FORMAT.md §5 Channel 2) and indexes fired counts by rule_id.
|
|
7
|
+
* No suggestion-store rebuild in Phase 1; a reload before a re-run yields
|
|
8
|
+
* null counts, which render as "—" (REQ-R2).
|
|
9
|
+
*/
|
|
10
|
+
/** One entry of the `grounding[]` sidecar (Channel 2). */
|
|
11
|
+
export interface GroundingRecord {
|
|
12
|
+
node_path?: unknown;
|
|
13
|
+
redline_user_id?: unknown;
|
|
14
|
+
redline_timestamp?: unknown;
|
|
15
|
+
rule_id?: unknown;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** Anything shaped like the orchestrator's review response. */
|
|
19
|
+
export interface ReviewResponseLike {
|
|
20
|
+
grounding?: unknown;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Count grounding entries per rule_id. Pure and defensive:
|
|
25
|
+
* - absent / empty / non-array `grounding` → empty map;
|
|
26
|
+
* - entries without a string rule_id are skipped;
|
|
27
|
+
* - unknown rule_ids are counted anyway (consumers simply won't look them up);
|
|
28
|
+
* - duplicate citations — same (node_path, redline_user_id, redline_timestamp)
|
|
29
|
+
* identity key — are counted once.
|
|
30
|
+
*/
|
|
31
|
+
export declare const countFiredByRule: (grounding: unknown) => Map<string, number>;
|
|
32
|
+
/**
|
|
33
|
+
* Memoized fired-count index for a review response. Returns null when no
|
|
34
|
+
* review response exists yet (pre-run: badges must show "—", never "0 fired").
|
|
35
|
+
*/
|
|
36
|
+
export declare const firedCountsByRule: (review: ReviewResponseLike | null | undefined) => ReadonlyMap<string, number> | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lax-wp/editor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.15-beta.0",
|
|
4
4
|
"description": "A modern, feature-rich editor built with React and TipTap",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editor",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"build": "npm run build:types && vite build",
|
|
39
39
|
"build:types": "tsc --project tsconfig.build.json",
|
|
40
40
|
"lint": "eslint .",
|
|
41
|
+
"test": "vitest run",
|
|
41
42
|
"preview": "vite preview",
|
|
42
43
|
"prepublishOnly": "npm run build",
|
|
43
44
|
"link:register": "npm run build && npm link",
|
|
@@ -47,46 +48,48 @@
|
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"@emotion/react": "^11.14.0",
|
|
49
50
|
"@emotion/styled": "^11.14.1",
|
|
51
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
50
52
|
"@mui/icons-material": "^7.3.4",
|
|
51
53
|
"@mui/material": "^7.3.4",
|
|
52
|
-
"@tiptap/extension-blockquote": "^3.
|
|
53
|
-
"@tiptap/extension-bold": "^3.
|
|
54
|
-
"@tiptap/extension-character-count": "^3.
|
|
55
|
-
"@tiptap/extension-code-block-lowlight": "^3.
|
|
56
|
-
"@tiptap/extension-collaboration": "^3.
|
|
57
|
-
"@tiptap/extension-collaboration-caret": "^3.
|
|
58
|
-
"@tiptap/extension-document": "^3.
|
|
59
|
-
"@tiptap/extension-hard-break": "^3.
|
|
60
|
-
"@tiptap/extension-heading": "^3.
|
|
61
|
-
"@tiptap/extension-highlight": "^3.
|
|
62
|
-
"@tiptap/extension-horizontal-rule": "^3.
|
|
63
|
-
"@tiptap/extension-image": "^3.
|
|
64
|
-
"@tiptap/extension-italic": "^3.
|
|
65
|
-
"@tiptap/extension-link": "^3.
|
|
66
|
-
"@tiptap/extension-list": "^3.
|
|
67
|
-
"@tiptap/extension-paragraph": "^3.
|
|
68
|
-
"@tiptap/extension-strike": "^3.
|
|
69
|
-
"@tiptap/extension-subscript": "^3.
|
|
70
|
-
"@tiptap/extension-superscript": "^3.
|
|
71
|
-
"@tiptap/extension-table": "^3.
|
|
72
|
-
"@tiptap/extension-task-item": "^3.
|
|
73
|
-
"@tiptap/extension-task-list": "^3.
|
|
74
|
-
"@tiptap/extension-text": "^3.
|
|
75
|
-
"@tiptap/extension-text-align": "^3.
|
|
76
|
-
"@tiptap/extension-text-style": "^3.
|
|
77
|
-
"@tiptap/extension-typography": "^3.
|
|
78
|
-
"@tiptap/extension-underline": "^3.
|
|
79
|
-
"@tiptap/extensions": "^3.
|
|
80
|
-
"@tiptap/pm": "^3.
|
|
81
|
-
"@tiptap/react": "^3.
|
|
82
|
-
"@tiptap/starter-kit": "^3.
|
|
54
|
+
"@tiptap/extension-blockquote": "^3.31.2",
|
|
55
|
+
"@tiptap/extension-bold": "^3.31.2",
|
|
56
|
+
"@tiptap/extension-character-count": "^3.31.2",
|
|
57
|
+
"@tiptap/extension-code-block-lowlight": "^3.31.2",
|
|
58
|
+
"@tiptap/extension-collaboration": "^3.31.2",
|
|
59
|
+
"@tiptap/extension-collaboration-caret": "^3.31.2",
|
|
60
|
+
"@tiptap/extension-document": "^3.31.2",
|
|
61
|
+
"@tiptap/extension-hard-break": "^3.31.2",
|
|
62
|
+
"@tiptap/extension-heading": "^3.31.2",
|
|
63
|
+
"@tiptap/extension-highlight": "^3.31.2",
|
|
64
|
+
"@tiptap/extension-horizontal-rule": "^3.31.2",
|
|
65
|
+
"@tiptap/extension-image": "^3.31.2",
|
|
66
|
+
"@tiptap/extension-italic": "^3.31.2",
|
|
67
|
+
"@tiptap/extension-link": "^3.31.2",
|
|
68
|
+
"@tiptap/extension-list": "^3.31.2",
|
|
69
|
+
"@tiptap/extension-paragraph": "^3.31.2",
|
|
70
|
+
"@tiptap/extension-strike": "^3.31.2",
|
|
71
|
+
"@tiptap/extension-subscript": "^3.31.2",
|
|
72
|
+
"@tiptap/extension-superscript": "^3.31.2",
|
|
73
|
+
"@tiptap/extension-table": "^3.31.2",
|
|
74
|
+
"@tiptap/extension-task-item": "^3.31.2",
|
|
75
|
+
"@tiptap/extension-task-list": "^3.31.2",
|
|
76
|
+
"@tiptap/extension-text": "^3.31.2",
|
|
77
|
+
"@tiptap/extension-text-align": "^3.31.2",
|
|
78
|
+
"@tiptap/extension-text-style": "^3.31.2",
|
|
79
|
+
"@tiptap/extension-typography": "^3.31.2",
|
|
80
|
+
"@tiptap/extension-underline": "^3.31.2",
|
|
81
|
+
"@tiptap/extensions": "^3.31.2",
|
|
82
|
+
"@tiptap/pm": "^3.31.2",
|
|
83
|
+
"@tiptap/react": "^3.31.2",
|
|
84
|
+
"@tiptap/starter-kit": "^3.31.2",
|
|
83
85
|
"classnames": "^2.5.1",
|
|
84
86
|
"html-to-image": "^1.11.13",
|
|
85
87
|
"install": "^0.13.0",
|
|
86
88
|
"lowlight": "^3.3.0",
|
|
87
89
|
"react-custom-scrollbars-2": "^4.5.0",
|
|
88
90
|
"react-keyshorts": "^2.0.2",
|
|
89
|
-
"react-select": "^5.10.2"
|
|
91
|
+
"react-select": "^5.10.2",
|
|
92
|
+
"zod": "^3.25.76"
|
|
90
93
|
},
|
|
91
94
|
"peerDependencies": {
|
|
92
95
|
"@lax-wp/design-system": "*",
|
|
@@ -125,6 +128,8 @@
|
|
|
125
128
|
"@eslint/js": "^9.30.1",
|
|
126
129
|
"@lax-wp/design-system": "^0.11.20",
|
|
127
130
|
"@monaco-editor/react": "^4.6.0",
|
|
131
|
+
"@testing-library/dom": "^10.4.1",
|
|
132
|
+
"@testing-library/user-event": "^14.6.1",
|
|
128
133
|
"@types/react": "^18.2.0",
|
|
129
134
|
"@types/react-dom": "^18.2.0",
|
|
130
135
|
"@vitejs/plugin-react": "^4.7.0",
|
|
@@ -138,6 +143,7 @@
|
|
|
138
143
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
139
144
|
"framer-motion": "^12.23.12",
|
|
140
145
|
"globals": "^16.3.0",
|
|
146
|
+
"jsdom": "^30.0.1",
|
|
141
147
|
"lottie-web": "^5.12.2",
|
|
142
148
|
"playwright": "^1.54.1",
|
|
143
149
|
"postcss": "^8.4.49",
|