@ai-matrx/rich-content 0.2.46 → 0.2.47
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,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.47
|
|
4
|
+
|
|
5
|
+
- The JSON value types and guards (`isJsonObject`, `isJsonArray`, `isJsonPrimitive`, `Json*`)
|
|
6
|
+
in `./utils/json` are re-exported from their one home, `@ai-matrx/kit/json-format`; only
|
|
7
|
+
`toJsonRecord` stays rich-content's own (architecture step 3).
|
|
8
|
+
|
|
9
|
+
Consumer action: none — `@ai-matrx/rich-content/utils/json` keeps every name.
|
|
10
|
+
|
|
3
11
|
## 0.2.46
|
|
4
12
|
|
|
5
13
|
- **A text field's "…" menu reads its text aloud.** `RegistryActionList` has no bar above it,
|
|
@@ -111,7 +111,7 @@ declare const JSON_BLOCK_PATTERNS: {
|
|
|
111
111
|
};
|
|
112
112
|
readonly decision_tree: {
|
|
113
113
|
readonly rootKey: "decision_tree";
|
|
114
|
-
readonly validate: (parsed: unknown) => import("
|
|
114
|
+
readonly validate: (parsed: unknown) => import("@ai-matrx/kit/json-format").JsonValue | undefined;
|
|
115
115
|
};
|
|
116
116
|
readonly comparison_table: {
|
|
117
117
|
readonly rootKey: "comparison";
|
package/dist/utils/json.d.ts
CHANGED
|
@@ -35,21 +35,9 @@
|
|
|
35
35
|
* open / loosely-shaped JSON the standards doc calls "just an object" — they
|
|
36
36
|
* give it an honest name so nobody reaches for `any` or a whole-row cast.
|
|
37
37
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* cleanly (mirrors Supabase's original generated `Json` object member).
|
|
42
|
-
*/
|
|
43
|
-
export interface JsonObject {
|
|
44
|
-
[key: string]: JsonValue | undefined;
|
|
45
|
-
}
|
|
46
|
-
export type JsonArray = JsonValue[];
|
|
47
|
-
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
48
|
-
/**
|
|
49
|
-
* Narrow an `unknown` (e.g. a bare JSONB column) to a `JsonObject`.
|
|
50
|
-
* Plain object only — arrays and `null` return false.
|
|
51
|
-
*/
|
|
52
|
-
export declare function isJsonObject(value: unknown): value is JsonObject;
|
|
38
|
+
import type { JsonObject, JsonValue } from "@ai-matrx/kit/json-format";
|
|
39
|
+
export { isJsonArray, isJsonObject, isJsonPrimitive } from "@ai-matrx/kit/json-format";
|
|
40
|
+
export type { JsonArray, JsonObject, JsonPrimitive, JsonValue } from "@ai-matrx/kit/json-format";
|
|
53
41
|
/**
|
|
54
42
|
* Convert a `JsonObject` (values `JsonValue | undefined`) into the strict
|
|
55
43
|
* `Record<string, JsonValue>` shape generated API request bodies demand,
|
|
@@ -57,7 +45,3 @@ export declare function isJsonObject(value: unknown): value is JsonObject;
|
|
|
57
45
|
* only appears via optional-key reads). Cast-free by construction.
|
|
58
46
|
*/
|
|
59
47
|
export declare function toJsonRecord(obj: JsonObject): Record<string, JsonValue>;
|
|
60
|
-
/** Narrow an `unknown` to a `JsonArray`. */
|
|
61
|
-
export declare function isJsonArray(value: unknown): value is JsonArray;
|
|
62
|
-
/** Narrow an `unknown` to a JSON primitive (string | number | boolean | null). */
|
|
63
|
-
export declare function isJsonPrimitive(value: unknown): value is JsonPrimitive;
|
package/dist/utils/json.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
-
}
|
|
1
|
+
import { isJsonArray, isJsonObject, isJsonPrimitive } from "@ai-matrx/kit/json-format";
|
|
4
2
|
function toJsonRecord(obj) {
|
|
5
3
|
const out = {};
|
|
6
4
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -8,12 +6,6 @@ function toJsonRecord(obj) {
|
|
|
8
6
|
}
|
|
9
7
|
return out;
|
|
10
8
|
}
|
|
11
|
-
function isJsonArray(value) {
|
|
12
|
-
return Array.isArray(value);
|
|
13
|
-
}
|
|
14
|
-
function isJsonPrimitive(value) {
|
|
15
|
-
return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
16
|
-
}
|
|
17
9
|
export {
|
|
18
10
|
isJsonArray,
|
|
19
11
|
isJsonObject,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/rich-content",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.47",
|
|
4
4
|
"description": "The AI Matrx formatted-text engine: the one markdown renderer, streaming markdown, the block splitter and renderer, the generic blocks, <RichContent> levels, the rich-document action registry and menus, copy, and the selection toolbar — as portable React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -130,12 +130,11 @@
|
|
|
130
130
|
"unist-util-visit": "^5.1.0",
|
|
131
131
|
"unist-util-visit-parents": "^6.0.2",
|
|
132
132
|
"yaml": "^2.9.1",
|
|
133
|
-
"@ai-matrx/agents": "latest",
|
|
134
|
-
"@ai-matrx/alchemy": "latest",
|
|
135
133
|
"@ai-matrx/canvas": "latest",
|
|
136
134
|
"@ai-matrx/content-ir": "latest",
|
|
137
135
|
"@ai-matrx/content-ir-react": "latest",
|
|
138
136
|
"@ai-matrx/data": "latest",
|
|
137
|
+
"@ai-matrx/alchemy": "latest",
|
|
139
138
|
"@ai-matrx/design-system": "latest",
|
|
140
139
|
"@ai-matrx/diff": "latest",
|
|
141
140
|
"@ai-matrx/icons": "latest",
|
|
@@ -144,7 +143,8 @@
|
|
|
144
143
|
"@ai-matrx/print": "latest",
|
|
145
144
|
"@ai-matrx/records": "latest",
|
|
146
145
|
"@ai-matrx/records-ui": "latest",
|
|
147
|
-
"@ai-matrx/tap-target": "latest"
|
|
146
|
+
"@ai-matrx/tap-target": "latest",
|
|
147
|
+
"@ai-matrx/agents": "latest"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
150
|
"react": ">=19.0.0",
|