@ai-matrx/rich-content 0.2.15 → 0.2.17

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.
@@ -62,7 +62,7 @@ const parseMarkdownTable = (content, isStreamActive = false) => {
62
62
  if (tableLines.length < 3) return { markdown: null, data: null };
63
63
  const separatorLine = tableLines[1].trim();
64
64
  if (!isGfmDelimiterRow(separatorLine) || !tableStartsAt(lines, tableStartIndex)) {
65
- if (!isStreamActive && true) {
65
+ if (!isStreamActive && process.env.NODE_ENV === "development") {
66
66
  console.warn("Invalid table separator format:", separatorLine);
67
67
  }
68
68
  return { markdown: null, data: null };
@@ -81,7 +81,7 @@ const parseMarkdownTable = (content, isStreamActive = false) => {
81
81
  (row) => row.length > 0 && row.length <= Math.max(headers.length * 2, 10)
82
82
  );
83
83
  if (!hasValidStructure) {
84
- if (!isStreamActive && true) {
84
+ if (!isStreamActive && process.env.NODE_ENV === "development") {
85
85
  console.warn("Table structure validation failed - inconsistent row lengths");
86
86
  }
87
87
  return { markdown: null, data: null };
@@ -342,7 +342,7 @@ const TABLE_START_INPUTS = [
342
342
  under("<span>"),
343
343
  under("text <b>B3</b> first"),
344
344
  under("<!-- shift note -->"),
345
- under("<script>x<\/script>"),
345
+ under("<script>x</script>"),
346
346
  under("<details>", ""),
347
347
  under("Tonight's bays:", "<span>"),
348
348
  under("<div>", "hello"),
@@ -22,7 +22,7 @@ function useImagePolicy() {
22
22
  }
23
23
  let warnedUndeclared = false;
24
24
  function warnUndeclared(host) {
25
- if (warnedUndeclared || false) return;
25
+ if (warnedUndeclared || process.env.NODE_ENV === "production") return;
26
26
  warnedUndeclared = true;
27
27
  console.warn(
28
28
  `[rich-content] A remote image (${host}) rendered where no surface declared who wrote the text, so it waits for a click. Pass imagePolicy="self" | "other" | "ai" on the RichContent / RichDocument / MarkdownStream that renders it (components/rich-content/prose/remote-image-policy.tsx).`
@@ -1,5 +1,6 @@
1
1
  import { holdDeliberateIntent } from "../../host/app-bindings.js";
2
2
  import {
3
+ DuplicateActionError,
3
4
  computeEligibility,
4
5
  createClickTarget
5
6
  } from "@ai-matrx/alchemy/actions";
@@ -33,7 +34,7 @@ function readStore() {
33
34
  function registerAction(action) {
34
35
  const { actions: ACTIONS, listeners } = store();
35
36
  if (ACTIONS.has(action.id)) {
36
- if (true) {
37
+ if (process.env.NODE_ENV === "development") {
37
38
  console.warn(
38
39
  `[rich-document] action "${action.id}" re-registered (fast refresh) \u2014 replaced.`
39
40
  );
@@ -253,7 +253,10 @@ function extendMenuSection(submenu, actionIds) {
253
253
  structureVersion++;
254
254
  const section = MENU_STRUCTURE.find((s) => s.submenu === submenu);
255
255
  if (!section) throw new Error(`[rich-document] no menu section named "${submenu}"`);
256
- for (const id of actionIds) if (!section.actionIds.includes(id)) section.actionIds.push(id);
256
+ for (const id of actionIds) {
257
+ if (!section.actionIds.includes(id)) section.actionIds.push(id);
258
+ PLACED_IDS.add(id);
259
+ }
257
260
  }
258
261
  export {
259
262
  AI_SUBMENU_LABEL,
@@ -190,7 +190,7 @@ const declaredListeners = /* @__PURE__ */ new Set();
190
190
  function declareSelectionProvider(provider) {
191
191
  const existing = declared.get(provider.id);
192
192
  if (existing === provider) return;
193
- if (existing && false) {
193
+ if (existing && process.env.NODE_ENV !== "development") {
194
194
  throw new Error(`Selection provider "${provider.id}" was declared twice by different modules.`);
195
195
  }
196
196
  declared.set(provider.id, provider);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-content",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
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,21 +130,21 @@
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",
134
+ "@ai-matrx/alchemy": "latest",
136
135
  "@ai-matrx/content-ir": "latest",
137
136
  "@ai-matrx/content-ir-react": "latest",
137
+ "@ai-matrx/agents": "latest",
138
138
  "@ai-matrx/data": "latest",
139
+ "@ai-matrx/design-system": "latest",
139
140
  "@ai-matrx/diff": "latest",
140
141
  "@ai-matrx/icons": "latest",
141
- "@ai-matrx/design-system": "latest",
142
142
  "@ai-matrx/kit": "latest",
143
+ "@ai-matrx/media": "latest",
143
144
  "@ai-matrx/print": "latest",
144
145
  "@ai-matrx/records": "latest",
145
146
  "@ai-matrx/records-ui": "latest",
146
- "@ai-matrx/tap-target": "latest",
147
- "@ai-matrx/media": "latest"
147
+ "@ai-matrx/tap-target": "latest"
148
148
  },
149
149
  "peerDependencies": {
150
150
  "react": ">=19.0.0",