@ai-matrx/rich-editor 0.5.8 → 0.5.10
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.10
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/rich-editor/v0.5.9..npm/rich-editor/v0.5.10 -- apps/shared/rich-editor`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.5.9
|
|
10
|
+
|
|
11
|
+
- `hasEditInPlaceTarget()`: a right-click menu offers "Edit" only over in-place content.
|
|
12
|
+
|
|
13
|
+
Consumer action: none.
|
|
14
|
+
|
|
3
15
|
## 0.5.8
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
@@ -8,6 +8,8 @@ export interface InPlaceOpening {
|
|
|
8
8
|
}
|
|
9
9
|
/** The DOM event that opens the editor of the read zone it is dispatched on (detail: the point, if any). */
|
|
10
10
|
export declare const EDIT_IN_PLACE_EVENT = "matrx:edit-in-place";
|
|
11
|
+
/** Did the person just press in / right-click an edit-in-place zone (a menu offers "Edit" only then)? */
|
|
12
|
+
export declare function hasEditInPlaceTarget(maxAgeMs?: number): boolean;
|
|
11
13
|
/**
|
|
12
14
|
* Open the edit-in-place editor the person last pressed in or right-clicked (within `maxAgeMs`):
|
|
13
15
|
* the door for a bar's Edit icon and a right-click menu's "Edit". False when none is on screen.
|
|
@@ -25,6 +25,10 @@ function installTracking() {
|
|
|
25
25
|
document.addEventListener("pointerdown", remember, true);
|
|
26
26
|
document.addEventListener("contextmenu", remember, true);
|
|
27
27
|
}
|
|
28
|
+
function hasEditInPlaceTarget(maxAgeMs = 15e3) {
|
|
29
|
+
const last = state.last;
|
|
30
|
+
return !!last && last.zone.isConnected && Date.now() - last.at <= maxAgeMs && last.zone.getAttribute("data-edit-in-place") === "read";
|
|
31
|
+
}
|
|
28
32
|
function openEditInPlaceFromLastInteraction(maxAgeMs = 15e3) {
|
|
29
33
|
const last = state.last;
|
|
30
34
|
if (!last || !last.zone.isConnected || Date.now() - last.at > maxAgeMs) return false;
|
|
@@ -102,6 +106,7 @@ function EditInPlace({
|
|
|
102
106
|
export {
|
|
103
107
|
EDIT_IN_PLACE_EVENT,
|
|
104
108
|
EditInPlace,
|
|
109
|
+
hasEditInPlaceTarget,
|
|
105
110
|
openEditInPlaceFromLastInteraction,
|
|
106
111
|
useInPlaceTrigger
|
|
107
112
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/rich-editor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "The AI Matrx editor: Visual (Tiptap), Source (CodeMirror), Preview, the markdown formatting command layer, and edit-in-place — over @ai-matrx/rich-content. Consumers that only render never install it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -90,13 +90,13 @@
|
|
|
90
90
|
"@tiptap/suggestion": "^3.31.3",
|
|
91
91
|
"github-slugger": "^2.0.0",
|
|
92
92
|
"lucide-react": "^1.48.0",
|
|
93
|
+
"@ai-matrx/agents": "latest",
|
|
94
|
+
"@ai-matrx/alchemy": "latest",
|
|
93
95
|
"@ai-matrx/content-ir": "latest",
|
|
94
96
|
"@ai-matrx/design-system": "latest",
|
|
95
|
-
"@ai-matrx/alchemy": "latest",
|
|
96
|
-
"@ai-matrx/kit": "latest",
|
|
97
97
|
"@ai-matrx/print": "latest",
|
|
98
|
-
"@ai-matrx/
|
|
99
|
-
"@ai-matrx/
|
|
98
|
+
"@ai-matrx/kit": "latest",
|
|
99
|
+
"@ai-matrx/rich-content": "latest"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"react": ">=19.0.0",
|