@ai-matrx/rich-content 0.2.52 → 0.2.53

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.53
4
+
5
+ - `RichDocumentActions` / `ActionBar` take `contentActions={false}` for a host whose own bar already carries the content action set for the same item (a `<RichCopySplit>` beside it), so Copy, Export, Print and Transform show once.
6
+
7
+ Consumer action: none.
8
+
3
9
  ## 0.2.52
4
10
 
5
11
  - `copy/ContentActions` — THE content action set (Arman, 2026-10-08): compact icons for a host's existing bar — split Copy, Plain/Formatted (the item's exact source, monospace, wrapped, selectable; per item, in memory), Export (one click: PDF · Word · HTML · Markdown file · Text file), Print, Transform (the Alchemy palette). On a phone it folds to Copy + "…" with every action one tap inside. `ContentView` / `PlainTextView` / `usePlainView` (copy/content-view-store) let a host's content area honor the switch; `hasContentActions(key)` lets a ⋯ row that duplicates the set hide itself.
@@ -7,6 +7,8 @@ export interface RichDocumentActionsProps {
7
7
  className?: string;
8
8
  /** Hide the ⋯ overflow menu (the primary row still renders). */
9
9
  hideOverflow?: boolean;
10
+ /** False only where the host's own bar already carries the content action set for this item. */
11
+ contentActions?: boolean;
10
12
  }
11
13
  export declare function RichDocumentActions(props: RichDocumentActionsProps): React.ReactElement;
12
14
  export default RichDocumentActions;
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
3
3
  import { useActionSurfaceProvider } from "./runtime/useActionSurfaceProvider.js";
4
4
  import { ActionBar } from "./variants/ActionBar.js";
5
5
  function RichDocumentActions(props) {
6
- const { content, source, actions, className, hideOverflow } = props;
6
+ const { content, source, actions, className, hideOverflow, contentActions } = props;
7
7
  const { ctx, getCtx, resolvedActions, target } = useActionSurfaceProvider({
8
8
  content,
9
9
  source,
@@ -18,7 +18,8 @@ function RichDocumentActions(props) {
18
18
  target,
19
19
  sourceId: ctx.instanceKey("alchemy"),
20
20
  className,
21
- hideOverflow
21
+ hideOverflow,
22
+ contentActions
22
23
  }
23
24
  );
24
25
  }
@@ -13,6 +13,11 @@ export interface ActionBarProps {
13
13
  hideOverflow?: boolean;
14
14
  /** Condensed presentation (the "mini-bar" variant). */
15
15
  mini?: boolean;
16
+ /**
17
+ * Render the content action set (default true). False ONLY where the host's own bar
18
+ * already carries it for the same item (a `<RichCopySplit>` beside this bar) — never twice.
19
+ */
20
+ contentActions?: boolean;
16
21
  }
17
22
  /** The registry rows the split Copy runs, by flavor (features/rich-document/actions/handlers/transfer.ts). */
18
23
  export declare const SPLIT_COPY_ACTION_IDS: Readonly<Record<SplitCopyFlavor, string>>;
@@ -28,7 +28,7 @@ const EXPORT_ACTION_IDS = {
28
28
  html: "download-html"
29
29
  };
30
30
  function ActionBar(props) {
31
- const { actions, getCtx, target, sourceId, className, hideOverflow = false, mini = false } = props;
31
+ const { actions, getCtx, target, sourceId, className, hideOverflow = false, mini = false, contentActions = true } = props;
32
32
  useRichDocumentProvider();
33
33
  const oneMenu = useOneMenuFor(getCtx().source);
34
34
  const hasCopy = actions.some((action) => action.category === "copy");
@@ -57,7 +57,7 @@ function ActionBar(props) {
57
57
  ),
58
58
  children: [
59
59
  hasCopy ? /* @__PURE__ */ jsxs(Fragment, { children: [
60
- /* @__PURE__ */ jsx(
60
+ contentActions ? /* @__PURE__ */ jsx(
61
61
  ContentActions,
62
62
  {
63
63
  content: () => getCtx().content,
@@ -69,7 +69,7 @@ function ActionBar(props) {
69
69
  onPrint: printAction ? () => printAction.run(getCtx()) : void 0,
70
70
  onTransform: () => void openExportPalette(sourceId)
71
71
  }
72
- ),
72
+ ) : null,
73
73
  /* @__PURE__ */ jsx(
74
74
  AlchemyDocumentMenu,
75
75
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/rich-content",
3
- "version": "0.2.52",
3
+ "version": "0.2.53",
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",
@@ -132,19 +132,19 @@
132
132
  "yaml": "^2.9.1",
133
133
  "@ai-matrx/agents": "latest",
134
134
  "@ai-matrx/alchemy": "latest",
135
- "@ai-matrx/content-ir": "latest",
136
135
  "@ai-matrx/canvas": "latest",
137
- "@ai-matrx/data": "latest",
138
136
  "@ai-matrx/content-ir-react": "latest",
137
+ "@ai-matrx/data": "latest",
138
+ "@ai-matrx/content-ir": "latest",
139
139
  "@ai-matrx/design-system": "latest",
140
140
  "@ai-matrx/diff": "latest",
141
- "@ai-matrx/icons": "latest",
142
141
  "@ai-matrx/kit": "latest",
143
- "@ai-matrx/print": "latest",
142
+ "@ai-matrx/icons": "latest",
143
+ "@ai-matrx/media": "latest",
144
144
  "@ai-matrx/records": "latest",
145
- "@ai-matrx/tap-target": "latest",
145
+ "@ai-matrx/print": "latest",
146
146
  "@ai-matrx/records-ui": "latest",
147
- "@ai-matrx/media": "latest"
147
+ "@ai-matrx/tap-target": "latest"
148
148
  },
149
149
  "peerDependencies": {
150
150
  "react": ">=19.0.0",