@ai-matrx/context-menu 0.1.9 → 0.1.11
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 +12 -0
- package/dist/builder.cjs +17 -18
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.js +2 -3
- package/dist/builder.js.map +1 -1
- package/dist/{chunk-ECKA474B.js → chunk-2B37SXQW.js} +21 -12
- package/dist/chunk-2B37SXQW.js.map +1 -0
- package/dist/{chunk-TSOUI723.cjs → chunk-7TIZAANU.cjs} +26 -11
- package/dist/chunk-7TIZAANU.cjs.map +1 -0
- package/dist/{chunk-A24SBKSA.js → chunk-EG23Y2KW.js} +14 -13
- package/dist/{chunk-A24SBKSA.js.map → chunk-EG23Y2KW.js.map} +1 -1
- package/dist/{chunk-7VDSMZWI.cjs → chunk-ERFH2RZC.cjs} +18 -17
- package/dist/chunk-ERFH2RZC.cjs.map +1 -0
- package/dist/{chunk-EIP5YS4Y.js → chunk-HJU3RU2B.js} +27 -12
- package/dist/chunk-HJU3RU2B.js.map +1 -0
- package/dist/{chunk-SWEWOUHK.cjs → chunk-IH5WN5JP.cjs} +31 -26
- package/dist/chunk-IH5WN5JP.cjs.map +1 -0
- package/dist/{chunk-QXHLM7SS.cjs → chunk-LDMYNYFC.cjs} +42 -33
- package/dist/chunk-LDMYNYFC.cjs.map +1 -0
- package/dist/{chunk-ANJYKQAA.cjs → chunk-MBU4Y22O.cjs} +3 -3
- package/dist/{chunk-ANJYKQAA.cjs.map → chunk-MBU4Y22O.cjs.map} +1 -1
- package/dist/{chunk-L6DPISFT.js → chunk-NBEXJ25Z.js} +24 -19
- package/dist/{chunk-L6DPISFT.js.map → chunk-NBEXJ25Z.js.map} +1 -1
- package/dist/{chunk-LE6ZUVCO.js → chunk-PB3PMDKV.js} +2 -2
- package/dist/{chunk-NOYMFNSU.js → chunk-SJWKMZEJ.js} +33 -12
- package/dist/chunk-SJWKMZEJ.js.map +1 -0
- package/dist/{chunk-XERD2YCJ.cjs → chunk-WROBL3DR.cjs} +32 -11
- package/dist/chunk-WROBL3DR.cjs.map +1 -0
- package/dist/design-store.cjs +0 -1
- package/dist/design-store.cjs.map +1 -1
- package/dist/design-store.js +0 -1
- package/dist/design-store.js.map +1 -1
- package/dist/engine.cjs +64 -96
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +7 -7
- package/dist/engine.d.ts +7 -7
- package/dist/engine.js +72 -104
- package/dist/engine.js.map +1 -1
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/menu-content.cjs +18 -19
- package/dist/menu-content.cjs.map +1 -1
- package/dist/menu-content.js +4 -5
- package/dist/menu-content.js.map +1 -1
- package/dist/menu-inspect.cjs +0 -1
- package/dist/menu-inspect.cjs.map +1 -1
- package/dist/menu-inspect.js +0 -1
- package/dist/menu-inspect.js.map +1 -1
- package/dist/model.cjs +4 -5
- package/dist/model.cjs.map +1 -1
- package/dist/model.js +3 -4
- package/dist/react.cjs +52 -44
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +30 -22
- package/dist/react.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-7VDSMZWI.cjs.map +0 -1
- package/dist/chunk-CUODNUAD.cjs +0 -24
- package/dist/chunk-CUODNUAD.cjs.map +0 -1
- package/dist/chunk-ECKA474B.js.map +0 -1
- package/dist/chunk-EIP5YS4Y.js.map +0 -1
- package/dist/chunk-NOYMFNSU.js.map +0 -1
- package/dist/chunk-PE3ZHHM5.js +0 -24
- package/dist/chunk-PE3ZHHM5.js.map +0 -1
- package/dist/chunk-QXHLM7SS.cjs.map +0 -1
- package/dist/chunk-SWEWOUHK.cjs.map +0 -1
- package/dist/chunk-TSOUI723.cjs.map +0 -1
- package/dist/chunk-XERD2YCJ.cjs.map +0 -1
- /package/dist/{chunk-LE6ZUVCO.js.map → chunk-PB3PMDKV.js.map} +0 -0
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/index.ts","../src/engine/utils/build-application-scope.ts","../src/engine/utils/availability.ts","../src/engine/utils/open-context-menu.ts","../src/engine/utils/resolveMarkdownContext.ts","../src/engine/regroup/engine-rows.ts","../src/engine/regroup/proposed-grouping.ts","../src/engine/proposed/proposed-arrangement.ts"],"sourcesContent":["/**\n * @ai-matrx/context-menu/engine — the context menu's logic, no components:\n * the menu types (the chat package's, plus the rich-document augmentation),\n * scope building, availability, grouping and arrangements, the record-menu\n * registry, table-row items, and THE HOST PORT (`configureContextMenuHost`).\n *\n * Components are `@ai-matrx/context-menu/react`. The heavy half (the menu\n * model, the engine hooks, the Alchemy provider, value resolution, editor\n * write-back) is `@ai-matrx/context-menu/model` — it loads with the menu body,\n * so this entry stays cheap for shell-reachable code.\n */\nexport * from \"./types\";\nexport * from \"./host/port\";\nexport * from \"./utils/build-application-scope\";\nexport * from \"./utils/availability\";\nexport * from \"./utils/open-context-menu\";\nexport * from \"./utils/selection-tracking\";\nexport * from \"./utils/menu-deadline\";\nexport * from \"./utils/resolveMarkdownContext\";\nexport * from \"./model/requirement-gate\";\nexport * from \"./table-row-item\";\nexport * from \"./regroup/grouping\";\nexport * from \"./regroup/engine-rows\";\nexport * from \"./regroup/proposed-grouping\";\nexport * from \"./record-menu-registry\";\nexport * from \"./proposed/proposed-arrangement\";\nexport * from \"./utils/already-here\";\nexport * from \"./utils/per-row-entity\";\nexport * from \"./utils/json-menu-actions\";\nexport * from \"./utils/join-extra-sections\";\nexport * from \"./utils/field-menu-header\";\nexport * from \"./utils/key-combo\";\nexport * from \"./utils/widget-handle\";\nexport * from \"./utils/table-at-target\";\nexport * from \"./region-trigger-attrs\";\nexport * from \"./managed-agent-launch\";\nexport * from \"./item/itemMenuToV3\";\nexport * from \"./selection-provider\";\n","export * from \"@ai-matrx/chat/context-menu/utils/build-application-scope\";\n","export * from \"@ai-matrx/chat/context-menu/utils/availability\";\n","/**\n * Opens the canonical context menu from an explicit overflow control.\n *\n * Touch surfaces cannot rely on a discoverable right-click. Dispatching the\n * same bubbling event keeps the overflow button on the exact desktop/mobile\n * ContextMenuV3 path instead of creating a second action menu.\n */\nexport function openContextMenuForElement(element: HTMLElement | null): void {\n if (!element) return;\n\n const rect = element.getBoundingClientRect();\n element.dispatchEvent(\n new MouseEvent(\"contextmenu\", {\n bubbles: true,\n cancelable: true,\n view: element.ownerDocument.defaultView ?? window,\n button: 2,\n buttons: 2,\n clientX: rect.left + rect.width / 2,\n clientY: rect.top + rect.height / 2,\n }),\n );\n}\n","export * from \"@ai-matrx/chat/context-menu/utils/resolveMarkdownContext\";\n","// features/context-menu-v3/regroup/engine-rows.ts\n//\n// The rows the context-menu ENGINE itself can contribute (model/menu-model.ts),\n// as the ids and categories `alchemy-provider.ts` gives them (`cm:<node id>`).\n// Together with the rich-document registry (`getAllActions()`) this is the full\n// inventory of universal menu rows; a surface's own rows (its extraSections)\n// are \"the page's own actions\" and are not listed here.\n//\n// Kept in step with menu-model.ts by hand; the regroup demo flags any `cm:` row\n// a live menu resolves that is missing here (\"not in the inventory\").\n\nimport type { ActionCategory } from \"@ai-matrx/alchemy/actions\";\n\nexport interface InventoryRow {\n id: string;\n label: string;\n category: ActionCategory;\n}\n\nexport const CONTEXT_MENU_ENGINE_ROWS: readonly InventoryRow[] = [\n { id: \"cm:copy\", label: \"Copy\", category: \"clipboard\" },\n { id: \"cm:cut\", label: \"Cut\", category: \"clipboard\" },\n { id: \"cm:paste\", label: \"Paste\", category: \"clipboard\" },\n { id: \"cm:undo\", label: \"Undo\", category: \"clipboard\" },\n { id: \"cm:redo\", label: \"Redo\", category: \"clipboard\" },\n { id: \"cm:find\", label: \"Find & Replace\", category: \"clipboard\" },\n { id: \"cm:speak\", label: \"Speak\", category: \"clipboard\" },\n { id: \"cm:listen\", label: \"Listen\", category: \"clipboard\" },\n { id: \"cm:copy-as\", label: \"Copy as\", category: \"clipboard\" },\n { id: \"cm:json\", label: \"JSON\", category: \"clipboard\" },\n { id: \"cm:select-all\", label: \"Select All\", category: \"edit\" },\n { id: \"cm:insert-reference\", label: \"Insert / Copy reference…\", category: \"edit\" },\n { id: \"cm:chat\", label: \"Chat\", category: \"app\" },\n { id: \"cm:view-history\", label: \"View History\", category: \"history\" },\n { id: \"cm:compare\", label: \"Compare\", category: \"app\" },\n { id: \"cm:export\", label: \"Export\", category: \"save\" },\n { id: \"cm:convert\", label: \"Convert\", category: \"save\" },\n { id: \"cm:attach\", label: \"Attach To\", category: \"share\" },\n { id: \"cm:share\", label: \"Share\", category: \"share\" },\n { id: \"cm:placement:ai-action\", label: \"AI Actions\", category: \"ai\" },\n { id: \"cm:placement:content-block\", label: \"Content blocks\", category: \"ai\" },\n { id: \"cm:placement:organization-tool\", label: \"Org Items\", category: \"ai\" },\n { id: \"cm:placement:user-tool\", label: \"My Items\", category: \"ai\" },\n { id: \"cm:placement:quick-action\", label: \"Quick actions (placement)\", category: \"ai\" },\n { id: \"cm:placement:bound-agent\", label: \"Agents\", category: \"ai\" },\n { id: \"cm:quick-actions\", label: \"Quick Actions\", category: \"feedback\" },\n { id: \"cm:save\", label: \"Save\", category: \"edit\" },\n { id: \"cm:delete\", label: \"Delete\", category: \"edit\" },\n { id: \"cm:admin\", label: \"Admin Tools\", category: \"admin\" },\n { id: \"cm:x:surface\", label: \"This page (location, context, agents)\", category: \"surface-info\" },\n];\n\n/** Engine rows whose ids are generated per library (one per agent category or placement). */\nexport const CONTEXT_MENU_ENGINE_ID_PREFIXES: readonly string[] = [\"cm:placement:\", \"cm:cat:\", \"cm:agents\", \"cm:entry:\"];\n","// features/context-menu-v3/regroup/proposed-grouping.ts\n//\n// THE PROPOSED GROUPING, v2 (2026-09-28, after Arman's review of v1: \"we should\n// distinguish between a few things better: Copy (as various things), Download\n// (becomes some sort of external file), Convert (becomes something different in\n// our system…), Action (Publish HTML, etc.)… we still need more categories…\n// the more of [sub-menus] we do, the better\").\n//\n// Every submenu is named by its OUTCOME — what the person gets — in one plain\n// word. Applied ONLY where a MenuRegroupContext asks for it (the regroup demo);\n// no production menu uses it until Arman approves. Plain data over the\n// registry's own action ids and categories: the rows themselves come from the\n// registry, never from this file.\n\nimport {\n ArrowRightLeft,\n Copy,\n Download,\n GitCompareArrows,\n Globe,\n History,\n Pencil,\n Share2,\n Shield,\n Tags,\n ThumbsUp,\n Volume2,\n} from \"lucide-react\";\nimport { registerAlchemyIcon } from \"@ai-matrx/rich-content/utils/alchemy-icon-keys\";\nimport { AGENT_ICON } from \"@ai-matrx/icons/domain\";\nimport type { MenuGrouping } from \"./grouping\";\n\nconst icon = (c: unknown) => registerAlchemyIcon(c);\n\nexport const PROPOSED_MENU_GROUPING: MenuGrouping = {\n name: \"v2 — grouped by what you get\",\n minMembers: 2,\n // `category` + `order` place each submenu row among the others (the package's\n // group order): Edit, Copy, Download, Convert to, Publish, Share, Organize,\n // History, AI, Read aloud, Compare, Feedback, Admin.\n groups: [\n { key: \"edit\", label: \"Edit\", definition: \"Change this item where it is: edit, rewrite, open in an editor, run, delete.\", icon: icon(Pencil), category: \"edit\", order: 0 },\n { key: \"copy\", label: \"Copy\", definition: \"It lands on your clipboard, in the form you pick: text, Markdown, rich text, HTML, a table, JSON, a reference.\", icon: icon(Copy), category: \"copy\", order: 0 },\n { key: \"download\", label: \"Download\", definition: \"It becomes a file outside the app: Markdown, PDF, Word, HTML — or a printout.\", icon: icon(Download), category: \"export\", order: 0 },\n { key: \"convert\", label: \"Convert to\", definition: \"It becomes a new thing inside the app: a note, document, task, file, flashcards, quiz, template, contact, data table.\", icon: icon(ArrowRightLeft), category: \"save\", order: 0 },\n { key: \"publish\", label: \"Publish\", definition: \"It goes out to the world: a public web page or published HTML anyone with the link can open.\", icon: icon(Globe), category: \"share\", order: 0 },\n { key: \"share\", label: \"Share\", definition: \"It goes to specific people or places: share with someone, send to Google Docs, email it.\", icon: icon(Share2), category: \"share\", order: 1 },\n { key: \"organize\", label: \"Organize\", definition: \"It stays what it is, but gets filed: attached to a project or context, pinned, annotated.\", icon: icon(Tags), category: \"history\", order: 0 },\n { key: \"history\", label: \"History\", definition: \"Earlier versions: view the history, fork from a point in it.\", icon: icon(History), category: \"history\", order: 1 },\n { key: \"ai\", label: \"AI\", definition: \"An AI works on it: ask, chat, run an agent or AI action, regenerate.\", icon: icon(AGENT_ICON), category: \"ai\", order: 0 },\n { key: \"listen\", label: \"Read aloud\", definition: \"You hear it: read it aloud, a spoken summary, the voice settings.\", icon: icon(Volume2), category: \"listen\", order: 0 },\n { key: \"compare\", label: \"Compare\", definition: \"You see it side by side with something else: the clipboard or a saved base.\", icon: icon(GitCompareArrows), category: \"study\", order: 0 },\n { key: \"feedback\", label: \"Feedback\", definition: \"Tell us how it went: thumbs up or down, report a problem.\", icon: icon(ThumbsUp), category: \"feedback\", order: 1 },\n { key: \"admin\", label: \"Admin\", definition: \"Creator and admin tools: inspect, debug, server-side message surgery. Admins only.\", icon: icon(Shield), category: \"admin\", order: 0 },\n ],\n rules: [\n // ── The page's own rows that DUPLICATE a category (Arman, 2026-09-28: \"the\n // more of that we do, the better\"): they move into that category, and merge\n // into the universal row that does the same thing when it is in the menu.\n // Only genuinely unique record actions (Open, Take, Duplicate, Move to Trash…)\n // stay at the top.\n { when: { pageOwnLabels: [\"^copy( to clipboard)?$\"] }, to: { kind: \"group\", key: \"copy\" }, mergeWithIds: [\"cm:copy\", \"copy\"] },\n { when: { pageOwnLabels: [\"^copy\\\\b\"] }, to: { kind: \"group\", key: \"copy\" } },\n {\n when: { pageOwnLabels: [\"^(export|download)( as)? markdown\"] },\n to: { kind: \"group\", key: \"download\" },\n mergeWithIds: [\"save-as-file\"],\n },\n { when: { pageOwnLabels: [\"^(export|download)\\\\b\", \"^print\\\\b\"] }, to: { kind: \"group\", key: \"download\" } },\n { when: { pageOwnLabels: [\"^share( link)?…?$\"] }, to: { kind: \"group\", key: \"share\" }, mergeWithIds: [\"cm:share\"] },\n { when: { pageOwnLabels: [\"^(share|send|email)\\\\b\"] }, to: { kind: \"group\", key: \"share\" } },\n { when: { pageOwnLabels: [\"^publish\\\\b\"] }, to: { kind: \"group\", key: \"publish\" } },\n { when: { pageOwnLabels: [\"^(convert|save to|save as|create (a )?(task|note|document))\\\\b\"] }, to: { kind: \"group\", key: \"convert\" } },\n { when: { pageOwnLabels: [\"^(move to folder|add tags?|tags?|attach)\\\\b\"] }, to: { kind: \"group\", key: \"organize\" } },\n { when: { pageOwnLabels: [\"^(read aloud|listen)\\\\b\"] }, to: { kind: \"group\", key: \"listen\" } },\n { when: { pageOwnLabels: [\"^compare\\\\b\"] }, to: { kind: \"group\", key: \"compare\" } },\n { when: { pageOwnLabels: [\"^save$\"] }, to: { kind: \"top\" }, mergeWithIds: [\"cm:save\"] },\n // A conversation's own rows, by id (their labels are computed at open).\n {\n when: { ids: [\"conversation-copy-plain\", \"conversation-copy-markdown\", \"conversation-copy-formatted\", \"conversation-copy-for-ai\", \"conversation-copy-link\"] },\n to: { kind: \"group\", key: \"copy\" },\n },\n { when: { idPrefixes: [\"conversation-download-\"] }, to: { kind: \"group\", key: \"download\" } },\n {\n when: { ids: [\"conversation-save-to-notes\", \"conversation-create-document\", \"conversation-create-task\"] },\n to: { kind: \"group\", key: \"convert\" },\n },\n { when: { ids: [\"conversation-share\", \"conversation-email-to-me\"] }, to: { kind: \"group\", key: \"share\" } },\n { when: { ids: [\"conversation-open-in-new-chat\"] }, to: { kind: \"group\", key: \"ai\" } },\n { when: { ids: [\"conversation-rename\", \"conversation-duplicate\"] }, to: { kind: \"group\", key: \"edit\" } },\n\n // The clicked thing's remaining own rows (a quiz row's Open / Take / Archive,\n // a note's Duplicate / Move to Trash) come first, as they are.\n { when: { pageOwn: true }, to: { kind: \"page-first\" } },\n // The universal verb strip (icons across the top) stays exactly as it is.\n {\n when: { ids: [\"cm:copy\", \"cm:cut\", \"cm:paste\", \"cm:undo\", \"cm:redo\", \"cm:find\", \"copy\", \"cm:select-all\"] },\n to: { kind: \"top\" },\n },\n // Quick Actions is already one submenu of quick tools; the page submenu is last;\n // an editor's own Save / Delete stay one click away.\n { when: { ids: [\"cm:quick-actions\", \"cm:save\", \"cm:delete\"], categories: [\"surface-info\"] }, to: { kind: \"top\" } },\n\n {\n when: {\n ids: [\"cm:copy-as\", \"cm:json\", \"cm:insert-reference\", \"copy-html-page\", \"conversation-copy-link\"],\n categories: [\"copy\"],\n },\n to: { kind: \"group\", key: \"copy\" },\n },\n {\n when: { ids: [\"cm:export\", \"save-as-file\", \"download-pdf\", \"download-docx\", \"download-html\", \"print\", \"full-print\"] },\n to: { kind: \"group\", key: \"download\" },\n },\n { when: { ids: [\"html-preview\", \"share-webpage\"] }, to: { kind: \"group\", key: \"publish\" } },\n {\n when: { ids: [\"cm:share\", \"send-google-doc\", \"email-to-me\", \"conversation-share\"] },\n to: { kind: \"group\", key: \"share\" },\n },\n {\n when: { ids: [\"cm:attach\", \"attach-artifact-to-chat\", \"set-context-value\", \"pin-message\", \"notes-and-comments\"] },\n to: { kind: \"group\", key: \"organize\" },\n },\n {\n when: { ids: [\"cm:view-history\", \"edit-history\", \"fork-at-message\", \"fork-and-regenerate\"] },\n to: { kind: \"group\", key: \"history\" },\n },\n {\n when: { ids: [\"cm:compare\", \"compare-with-clipboard\", \"set-compare-base\", \"compare-with-base\"] },\n to: { kind: \"group\", key: \"compare\" },\n },\n {\n when: { ids: [\"cm:speak\", \"cm:listen\", \"tts-voice-settings\"], categories: [\"listen\"] },\n to: { kind: \"group\", key: \"listen\" },\n },\n {\n when: {\n ids: [\"cm:chat\", \"regenerate-response\", \"regenerate-latest\", \"continue-in-chat\", \"send-to-agent\", \"code-block-chart\"],\n idPrefixes: [\"cm:placement:\", \"cm:cat:\", \"cm:agents\"],\n categories: [\"ai\", \"ask\"],\n },\n to: { kind: \"group\", key: \"ai\" },\n },\n {\n when: {\n ids: [\n \"edit\",\n \"edit-and-resubmit\",\n \"open-fullscreen-editor\",\n \"delete-message\",\n \"code-block-open-in-editor\",\n \"code-block-apply-to-file\",\n \"code-block-run\",\n \"replace-selection\",\n \"insert-below\",\n \"conversation-rename\",\n \"conversation-duplicate\",\n ],\n },\n to: { kind: \"group\", key: \"edit\" },\n },\n { when: { ids: [\"thumbs-up\", \"thumbs-down\", \"submit-feedback\"], categories: [\"feedback\"] }, to: { kind: \"group\", key: \"feedback\" } },\n { when: { ids: [\"cm:admin\"], categories: [\"creator\", \"admin\"] }, to: { kind: \"group\", key: \"admin\" } },\n // Everything that makes a new thing in the app — checked after the rows\n // above because the registry files several of them under \"save\".\n { when: { ids: [\"cm:convert\", \"add-to-rulebook\"], categories: [\"save\", \"study\", \"export\"] }, to: { kind: \"group\", key: \"convert\" } },\n ],\n // A row no rule names stays at the top level where the package places it —\n // and the demo's Categories section lists it under \"No category yet\".\n fallback: { kind: \"top\" },\n};\n","// features/context-menu-v3/proposed/proposed-arrangement.ts\n//\n// THE PROPOSED RIGHT-CLICK MENU (Arman, 2026-10-02), applied to the rows the REAL registry\n// resolved for a real surface — nothing here invents a row. It merges two designs: the object-first\n// layout (icons, four rows, one Intelligence row, large and header-less) and the regroup demo's\n// \"what you get\" categories (`../regroup/proposed-grouping.ts`, reused here, not copied).\n//\n// [icons: ≤6, one action each, never a submenu — chosen by WHAT was clicked]\n// a thing (row, card) Copy · Share · Duplicate · Favorite · Download · Archive (red)\n// editable text Cut · Copy · Paste · Undo · Redo · Find\n// read-only text Copy · Read aloud · Find · Share\n// [Type to filter…]\n// 4 rows: the clicked thing's own actions (editable text: its edit actions)\n// More <thing> options ▸\n// Intelligence ▸ every AI entry, one row, on every menu\n// Save & share ▸ Copy as · Download · Convert to · Publish · Share — one block each\n// Organize ▸ Attach · Pin · History · Compare\n// Tools ▸ Read aloud · Quick Actions · Feedback · This page · Admin\n//\n// A page's own row that does what a universal row does merges into it (regroup's merge rule):\n// one Share, one Download, one Copy. Copy link folds into Share (its dialog carries the link).\n// A thing that brings its own Download/Export owns that verb outright: the universal page-text\n// file rows (PDF, Word, HTML, Markdown, print — regroup's \"download\" group) are dropped for it,\n// because they would save the menu's text, not the thing (a table exports CSV/XLSX, never a PDF\n// of its row label). `recordActionsOnly` cannot do this: it keeps Export by design. \"Save as PDF\n// Document\" files the same page text as a PDF, so it goes with them.\n// Applied only where a MenuRegroupContext passes `transform` (the demo); production is unchanged\n// until Arman approves.\n\nimport { Archive, Copy, Ellipsis, FolderTree, Share2, Wrench } from \"lucide-react\";\nimport { INTELLIGENCE_ICON } from \"@ai-matrx/icons/domain\";\nimport type { Action, ActionCategory, ActionSection, ClickTarget, ResolvedAction } from \"@ai-matrx/alchemy/actions\";\nimport { registerAlchemyIcon } from \"@ai-matrx/rich-content/utils/alchemy-icon-keys\";\nimport { actionLabel, matchRule } from \"../regroup/grouping\";\nimport { PROPOSED_MENU_GROUPING } from \"../regroup/proposed-grouping\";\n\nconst icon = (c: unknown) => registerAlchemyIcon(c);\n\nexport const STRIP_MAX = 6;\nexport const OWN_ROWS_MAX = 4;\n\nexport type ClickedKind = \"thing\" | \"editable\" | \"text\";\n\n/** One icon slot: the first resolved leaf that matches fills it. */\ninterface StripSlot {\n key: string;\n ids?: readonly string[] | undefined;\n /** Labels of the clicked thing's OWN rows (case-insensitive). */\n ownLabels?: readonly RegExp[] | undefined;\n}\n\nconst SLOT: Record<string, StripSlot> = {\n copy: { key: \"copy\", ids: [\"cm:copy\", \"copy\"], ownLabels: [/^copy( to clipboard)?$/i] },\n cut: { key: \"cut\", ids: [\"cm:cut\"] },\n paste: { key: \"paste\", ids: [\"cm:paste\"] },\n undo: { key: \"undo\", ids: [\"cm:undo\"] },\n redo: { key: \"redo\", ids: [\"cm:redo\"] },\n find: { key: \"find\", ids: [\"cm:find\"] },\n speak: { key: \"speak\", ids: [\"cm:speak\"] },\n share: { key: \"share\", ownLabels: [/^share\\b/i], ids: [\"cm:share\"] },\n duplicate: { key: \"duplicate\", ownLabels: [/^duplicate\\b/i, /^make a copy\\b/i] },\n favorite: { key: \"favorite\", ownLabels: [/favou?rite/i, /^(un)?star\\b/i] },\n download: { key: \"download\", ownLabels: [/^(export|download)\\b/i] },\n archive: { key: \"archive\", ownLabels: [/^archive\\b/i, /^delete\\b/i, /^move to trash\\b/i] },\n};\n\n/** The icons for each kind of click, in drawing order. */\nconst STRIP_FOR: Record<ClickedKind, readonly string[]> = {\n thing: [\"copy\", \"share\", \"duplicate\", \"favorite\", \"download\", \"archive\"],\n editable: [\"cut\", \"copy\", \"paste\", \"undo\", \"redo\", \"find\"],\n text: [\"copy\", \"speak\", \"find\", \"share\"],\n};\n\n/** Universal rows outside regroup's \"download\" group that also turn the page text into a file. */\nconst PAGE_TEXT_FILE_IDS = new Set([\"save-as-pdf\"]);\n\n/** The object's own Open row, and the Link verb that sits right after it. */\nconst OPEN_ROW = /^open( record)?$/i;\nconst LINK_A_RECORD = /^link a record/i;\n// The record's other own verbs (Merge, Split, Extract parent) are top-level beside Open and Link, outside the own-row cap.\nconst RECORD_VERBS = [/^merge with/i, /^split(…|\\.\\.\\.)?$/i, /^extract parent/i];\n\n/** Own rows that fold into a strip verb instead of sitting beside it. */\nconst FOLDS_INTO_SHARE = [/^copy link\\b/i, /^share link\\b/i];\n\n/** Regroup's \"what you get\" groups → the three rows under Intelligence. */\nconst SAVE_SHARE_GROUPS = [\"copy\", \"download\", \"convert\", \"publish\", \"share\"] as const;\nconst ORGANIZE_GROUPS = new Set([\"organize\", \"history\", \"compare\"]);\nconst AI_ORDER: readonly (string | RegExp)[] = [\n \"cm:chat\",\n \"cm:placement:ai-action\",\n \"cm:placement:bound-agent\",\n \"cm:agents\",\n \"cm:placement:user-tool\",\n \"cm:placement:organization-tool\",\n \"cm:placement:content-block\",\n /^send to (another )?agent/i,\n /^custom agent/i,\n];\nconst AI_LABELS = [/^summari[sz]e\\b/i, /^send to (another )?agent/i, /^custom agent/i];\n\n/**\n * The clicked thing's own rows: a surface's `extraSections` (engine ids `cm:x:<…>`, except the\n * engine's own page submenu `cm:x:surface`) or a section the surface lifted / named after itself.\n */\nfunction isOwn(action: Action): boolean {\n if (action.id.startsWith(\"cm:x:\") && !action.id.startsWith(\"cm:x:surface\")) return true;\n const s = action.section as (ActionSection & { kind?: string }) | undefined;\n return Boolean(s && (s.primary || s.kind === \"target\"));\n}\n\nexport function clickedKind(target: ClickTarget, resolved: readonly ResolvedAction[]): ClickedKind {\n if (!target.readOnly && resolved.some((r) => r.action.id === \"cm:paste\")) return \"editable\";\n if (resolved.some((r) => isOwn(r.action))) return \"thing\";\n return \"text\";\n}\n\nfunction submenu(id: string, label: string, category: ActionCategory, iconKey: string, children: readonly Action[], order = 0): ResolvedAction {\n const action: Action = {\n id: `proposed:${id}`,\n label,\n category,\n order,\n icon: iconKey,\n pending: (t) => children.some((c) => Boolean(c.expand && c.pending?.(t))),\n eligible: () => ({ status: \"available\" }),\n expand: async () => children,\n run: () => undefined,\n };\n return { action, eligibility: { status: \"available\" } };\n}\n\n/** A submenu row stripped of its old section (a heading the new home does not draw). */\nfunction plain(action: Action, extra: Partial<Action> = {}): Action {\n const { section: _section, ...rest } = action;\n void _section;\n return { ...rest, ...extra };\n}\n\nexport interface ProposedOptions {\n /** The clicked thing's name for \"More <noun> options\" (\"table\", \"quiz\", \"note\"). */\n noun: string;\n}\n\nexport function proposedArrangement(\n target: ClickTarget,\n resolved: readonly ResolvedAction[],\n { noun }: ProposedOptions,\n): ResolvedAction[] {\n const kind = clickedKind(target, resolved);\n const label = (r: ResolvedAction) => actionLabel(r.action, target);\n const groupOf = (r: ResolvedAction) => {\n const to = matchRule(PROPOSED_MENU_GROUPING, r.action, target)?.to;\n return to?.kind === \"group\" ? to.key : null;\n };\n const used = new Set<string>();\n\n // 0 · the thing's own Download/Export replaces the universal file rows (see header).\n const ownsDownload = resolved.some((r) => isOwn(r.action) && SLOT.download!.ownLabels!.some((re) => re.test(label(r))));\n if (ownsDownload) {\n for (const r of resolved) {\n if (!isOwn(r.action) && (groupOf(r) === \"download\" || PAGE_TEXT_FILE_IDS.has(r.action.id))) used.add(r.action.id);\n }\n }\n\n // 1 · the icon row.\n const strip: ResolvedAction[] = [];\n for (const key of STRIP_FOR[kind]) {\n if (strip.length >= STRIP_MAX) break;\n const slot = SLOT[key]!;\n const pick =\n resolved.find(\n (r) => !used.has(r.action.id) && !r.action.expand && isOwn(r.action) && slot.ownLabels?.some((re) => re.test(label(r))),\n ) ?? resolved.find((r) => !used.has(r.action.id) && !r.action.expand && slot.ids?.includes(r.action.id));\n if (!pick) continue;\n used.add(pick.action.id);\n // One verb, one icon: the page's own Share/Copy wins over the universal twin.\n if (key === \"share\") for (const r of resolved) if (r.action.id === \"cm:share\") used.add(r.action.id);\n if (key === \"copy\") for (const r of resolved) if (r.action.id === \"cm:copy\") used.add(r.action.id);\n strip.push({\n ...pick,\n action: plain(pick.action, {\n category: \"clipboard\",\n order: strip.length,\n ...(key === \"archive\" ? { destructive: true, icon: pick.action.icon ?? icon(Archive) } : {}),\n ...(key === \"copy\" && !pick.action.icon ? { icon: icon(Copy) } : {}),\n }),\n });\n }\n const hasShare = strip.some((r) => /^share\\b/i.test(label(r)));\n\n // 2 · the clicked thing's own rows (editable text: its edit actions and the editor's Save).\n // An own row that does what a universal outcome does (\"Export as Markdown\", \"Share link…\") joins\n // that outcome under Save & share instead (the regroup merge rule) — unless it already became an icon.\n const ownCandidates = resolved.filter((r) => {\n if (used.has(r.action.id)) return false;\n const g = groupOf(r);\n if (g && (SAVE_SHARE_GROUPS as readonly string[]).includes(g) && !(hasShare && FOLDS_INTO_SHARE.some((re) => re.test(label(r))))) return false;\n if (isOwn(r.action)) return true;\n return kind === \"editable\" && (groupOf(r) === \"edit\" || r.action.id === \"cm:save\" || r.action.id === \"cm:delete\");\n });\n // OPEN AND \"LINK A RECORD…\" LEAD THE OWN ROWS (CHAIR-UI-STORE item 3, 2026-10-03): on a store\n // record's cell or row the cell's rows (Paste, Clear cell, …) and the row's (Copy row, Insert, …)\n // filled the four top rows and \"Link a record…\" fell under \"More … options\", while every CRM row\n // shows Open and Link top-level. They are the record's own verbs, so they go first, in that order.\n const lead = (re: RegExp) => {\n const at = ownCandidates.findIndex((r) => re.test(label(r)));\n return at >= 0 ? ownCandidates.splice(at, 1)[0]! : null;\n };\n const openRow = lead(OPEN_ROW);\n const linkRow = lead(LINK_A_RECORD);\n const verbRows = RECORD_VERBS.map(lead).filter((r): r is ResolvedAction => r !== null);\n const leading = [openRow, linkRow, ...verbRows].filter((r): r is ResolvedAction => r !== null);\n const verbIds = new Set(verbRows.map((r) => r.action.id));\n let counted = 0;\n ownCandidates.unshift(...leading);\n const own: ResolvedAction[] = [];\n const more: Action[] = [];\n for (const r of ownCandidates) {\n used.add(r.action.id);\n const folds = hasShare && FOLDS_INTO_SHARE.some((re) => re.test(label(r)));\n if (!folds && (verbIds.has(r.action.id) || counted < OWN_ROWS_MAX) && !r.action.expand) {\n const destructive = SLOT.archive!.ownLabels!.some((re) => re.test(label(r)));\n if (!verbIds.has(r.action.id)) counted += 1;\n own.push({ ...r, action: plain(r.action, { category: \"edit\", order: own.length, ...(destructive ? { destructive: true } : {}) }) });\n } else {\n more.push(plain(r.action));\n }\n }\n const top: ResolvedAction[] = [...strip, ...own];\n if (more.length) top.push(submenu(\"more\", `More ${noun} options`, \"edit\", icon(Ellipsis), more, OWN_ROWS_MAX));\n\n // 3 · everything else, by what you get.\n const ai: Action[] = [];\n const saveShare = new Map<string, Action[]>();\n const organize: Action[] = [];\n const tools: Action[] = [];\n for (const r of resolved) {\n if (used.has(r.action.id)) continue;\n used.add(r.action.id);\n const g = groupOf(r);\n if (g === \"ai\" || r.action.category === \"ai\" || r.action.category === \"ask\" || AI_LABELS.some((re) => re.test(label(r)))) {\n ai.push(plain(r.action));\n } else if (g && (SAVE_SHARE_GROUPS as readonly string[]).includes(g)) {\n const list = saveShare.get(g) ?? [];\n list.push(plain(r.action));\n saveShare.set(g, list);\n } else if (g && ORGANIZE_GROUPS.has(g)) {\n organize.push(plain(r.action));\n } else {\n tools.push(plain(r.action));\n }\n }\n // Chat and the libraries first, then hand-offs, then spoken summaries.\n const aiRank = (a: Action) => {\n const i = AI_ORDER.findIndex((p) => (typeof p === \"string\" ? a.id === p || a.id.startsWith(p) : p.test(String(a.label))));\n return i === -1 ? AI_ORDER.length : i;\n };\n ai.sort((a, b) => aiRank(a) - aiRank(b));\n top.push(submenu(\"intelligence\", \"Intelligence\", \"ai\", icon(INTELLIGENCE_ICON), ai));\n\n // Save & share: one block per outcome, a divider between blocks.\n const saveShareRows: Action[] = [];\n for (const g of SAVE_SHARE_GROUPS) {\n const rows = saveShare.get(g) ?? [];\n rows.forEach((a, i) => saveShareRows.push(i === 0 && saveShareRows.length > 0 ? { ...a, startsGroup: true } : a));\n }\n if (saveShareRows.length) top.push(submenu(\"save-share\", \"Save & share\", \"app\", icon(Share2), saveShareRows));\n if (organize.length) top.push(submenu(\"organize\", \"Organize\", \"app\", icon(FolderTree), organize, 1));\n if (tools.length) top.push(submenu(\"tools\", \"Tools\", \"feedback\", icon(Wrench), tools));\n return top;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,2BAAc;;;ACXd;AAAA;AAAA,8CAAc;;;ADad,2BAAc;;;AEbd;AAAA;AAAA,mCAAc;;;AFcd,2BAAc;;;AGPP,SAAS,0BAA0B,SAAmC;AAC3E,MAAI,CAAC,QAAS;AA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AACxH,WAAO,MAAM,KAAK,SAAS,SAAS;AAAA,EACtC;AACA,KAAG,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC;AACvC,MAAI,KAAK,QAAQ,gBAAgB,gBAAgB,MAAMA,MAAK,iBAAiB,GAAG,EAAE,CAAC;AAGnF,QAAM,gBAA0B,CAAC;AACjC,aAAW,KAAK,mBAAmB;AACjC,UAAM,OAAO,UAAU,IAAI,CAAC,KAAK,CAAC;AAClC,SAAK,QAAQ,CAAC,GAAG,MAAM,cAAc,KAAK,MAAM,KAAK,cAAc,SAAS,IAAI,EAAE,GAAG,GAAG,aAAa,KAAK,IAAI,CAAC,CAAC;AAAA,EAClH;AACA,MAAI,cAAc,OAAQ,KAAI,KAAK,QAAQ,cAAc,gBAAgB,OAAOA,MAAKG,OAAM,GAAG,aAAa,CAAC;AAC5G,MAAI,SAAS,OAAQ,KAAI,KAAK,QAAQ,YAAY,YAAY,OAAOH,MAAK,UAAU,GAAG,UAAU,CAAC,CAAC;AACnG,MAAI,MAAM,OAAQ,KAAI,KAAK,QAAQ,SAAS,SAAS,YAAYA,MAAK,MAAM,GAAG,KAAK,CAAC;AACrF,SAAO;AACT;","names":["Copy","Share2","registerAlchemyIcon","icon","registerAlchemyIcon","Copy","Share2"]}
|
|
1
|
+
{"version":3,"sources":["../src/engine/utils/build-application-scope.ts","../src/engine/utils/availability.ts","../src/engine/utils/open-context-menu.ts","../src/engine/utils/resolveMarkdownContext.ts","../src/engine/regroup/engine-rows.ts","../src/engine/regroup/proposed-grouping.ts","../src/engine/proposed/proposed-arrangement.ts"],"sourcesContent":["// Named, never `export *`: the bundler (esbuild) cannot see through a nested\n// `export * from \"<external>\"`, so the names went missing from the ESM entry and\n// every internal reader went through a runtime namespace copy (a TDZ under ts-jest).\nexport {\n buildApplicationScopeFromMenuContext,\n} from \"@ai-matrx/chat/context-menu/utils/build-application-scope\";\n","// Named, never `export *`: the bundler (esbuild) cannot see through a nested\n// `export * from \"<external>\"`, so the names went missing from the ESM entry and\n// every internal reader went through a runtime namespace copy (a TDZ under ts-jest).\nexport {\n applyAvailability,\n needs,\n unavailableHere,\n withAvailability,\n} from \"@ai-matrx/chat/context-menu/utils/availability\";\nexport type {\n AvailabilityMap,\n} from \"@ai-matrx/chat/context-menu/utils/availability\";\n","/**\n * Opens the canonical context menu from an explicit overflow control.\n *\n * Touch surfaces cannot rely on a discoverable right-click. Dispatching the\n * same bubbling event keeps the overflow button on the exact desktop/mobile\n * ContextMenuV3 path instead of creating a second action menu.\n */\nexport function openContextMenuForElement(element: HTMLElement | null): void {\n if (!element) return;\n\n const rect = element.getBoundingClientRect();\n element.dispatchEvent(\n new MouseEvent(\"contextmenu\", {\n bubbles: true,\n cancelable: true,\n view: element.ownerDocument.defaultView ?? window,\n button: 2,\n buttons: 2,\n clientX: rect.left + rect.width / 2,\n clientY: rect.top + rect.height / 2,\n }),\n );\n}\n","// Named, never `export *`: the bundler (esbuild) cannot see through a nested\n// `export * from \"<external>\"`, so the names went missing from the ESM entry and\n// every internal reader went through a runtime namespace copy (a TDZ under ts-jest).\nexport {\n resolveMarkdownContext,\n} from \"@ai-matrx/chat/context-menu/utils/resolveMarkdownContext\";\nexport type {\n MarkdownMenuContext,\n} from \"@ai-matrx/chat/context-menu/utils/resolveMarkdownContext\";\n","// features/context-menu-v3/regroup/engine-rows.ts\n//\n// The rows the context-menu ENGINE itself can contribute (model/menu-model.ts),\n// as the ids and categories `alchemy-provider.ts` gives them (`cm:<node id>`).\n// Together with the rich-document registry (`getAllActions()`) this is the full\n// inventory of universal menu rows; a surface's own rows (its extraSections)\n// are \"the page's own actions\" and are not listed here.\n//\n// Kept in step with menu-model.ts by hand; the regroup demo flags any `cm:` row\n// a live menu resolves that is missing here (\"not in the inventory\").\n\nimport type { ActionCategory } from \"@ai-matrx/alchemy/actions\";\n\nexport interface InventoryRow {\n id: string;\n label: string;\n category: ActionCategory;\n}\n\nexport const CONTEXT_MENU_ENGINE_ROWS: readonly InventoryRow[] = [\n { id: \"cm:copy\", label: \"Copy\", category: \"clipboard\" },\n { id: \"cm:cut\", label: \"Cut\", category: \"clipboard\" },\n { id: \"cm:paste\", label: \"Paste\", category: \"clipboard\" },\n { id: \"cm:undo\", label: \"Undo\", category: \"clipboard\" },\n { id: \"cm:redo\", label: \"Redo\", category: \"clipboard\" },\n { id: \"cm:find\", label: \"Find & Replace\", category: \"clipboard\" },\n { id: \"cm:speak\", label: \"Speak\", category: \"clipboard\" },\n { id: \"cm:listen\", label: \"Listen\", category: \"clipboard\" },\n { id: \"cm:copy-as\", label: \"Copy as\", category: \"clipboard\" },\n { id: \"cm:json\", label: \"JSON\", category: \"clipboard\" },\n { id: \"cm:select-all\", label: \"Select All\", category: \"edit\" },\n { id: \"cm:insert-reference\", label: \"Insert / Copy reference…\", category: \"edit\" },\n { id: \"cm:chat\", label: \"Chat\", category: \"app\" },\n { id: \"cm:view-history\", label: \"View History\", category: \"history\" },\n { id: \"cm:compare\", label: \"Compare\", category: \"app\" },\n { id: \"cm:export\", label: \"Export\", category: \"save\" },\n { id: \"cm:convert\", label: \"Convert\", category: \"save\" },\n { id: \"cm:attach\", label: \"Attach To\", category: \"share\" },\n { id: \"cm:share\", label: \"Share\", category: \"share\" },\n { id: \"cm:placement:ai-action\", label: \"AI Actions\", category: \"ai\" },\n { id: \"cm:placement:content-block\", label: \"Content blocks\", category: \"ai\" },\n { id: \"cm:placement:organization-tool\", label: \"Org Items\", category: \"ai\" },\n { id: \"cm:placement:user-tool\", label: \"My Items\", category: \"ai\" },\n { id: \"cm:placement:quick-action\", label: \"Quick actions (placement)\", category: \"ai\" },\n { id: \"cm:placement:bound-agent\", label: \"Agents\", category: \"ai\" },\n { id: \"cm:quick-actions\", label: \"Quick Actions\", category: \"feedback\" },\n { id: \"cm:save\", label: \"Save\", category: \"edit\" },\n { id: \"cm:delete\", label: \"Delete\", category: \"edit\" },\n { id: \"cm:admin\", label: \"Admin Tools\", category: \"admin\" },\n { id: \"cm:x:surface\", label: \"This page (location, context, agents)\", category: \"surface-info\" },\n];\n\n/** Engine rows whose ids are generated per library (one per agent category or placement). */\nexport const CONTEXT_MENU_ENGINE_ID_PREFIXES: readonly string[] = [\"cm:placement:\", \"cm:cat:\", \"cm:agents\", \"cm:entry:\"];\n","// features/context-menu-v3/regroup/proposed-grouping.ts\n//\n// THE PROPOSED GROUPING, v2 (2026-09-28, after Arman's review of v1: \"we should\n// distinguish between a few things better: Copy (as various things), Download\n// (becomes some sort of external file), Convert (becomes something different in\n// our system…), Action (Publish HTML, etc.)… we still need more categories…\n// the more of [sub-menus] we do, the better\").\n//\n// Every submenu is named by its OUTCOME — what the person gets — in one plain\n// word. Applied ONLY where a MenuRegroupContext asks for it (the regroup demo);\n// no production menu uses it until Arman approves. Plain data over the\n// registry's own action ids and categories: the rows themselves come from the\n// registry, never from this file.\n\nimport {\n ArrowRightLeft,\n Copy,\n Download,\n GitCompareArrows,\n Globe,\n History,\n Pencil,\n Share2,\n Shield,\n Tags,\n ThumbsUp,\n Volume2,\n} from \"lucide-react\";\nimport { registerAlchemyIcon } from \"@ai-matrx/rich-content/utils/alchemy-icon-keys\";\nimport { AGENT_ICON } from \"@ai-matrx/icons/domain\";\nimport type { MenuGrouping } from \"./grouping\";\n\nconst icon = (c: unknown) => registerAlchemyIcon(c);\n\nexport const PROPOSED_MENU_GROUPING: MenuGrouping = {\n name: \"v2 — grouped by what you get\",\n minMembers: 2,\n // `category` + `order` place each submenu row among the others (the package's\n // group order): Edit, Copy, Download, Convert to, Publish, Share, Organize,\n // History, AI, Read aloud, Compare, Feedback, Admin.\n groups: [\n { key: \"edit\", label: \"Edit\", definition: \"Change this item where it is: edit, rewrite, open in an editor, run, delete.\", icon: icon(Pencil), category: \"edit\", order: 0 },\n { key: \"copy\", label: \"Copy\", definition: \"It lands on your clipboard, in the form you pick: text, Markdown, rich text, HTML, a table, JSON, a reference.\", icon: icon(Copy), category: \"copy\", order: 0 },\n { key: \"download\", label: \"Download\", definition: \"It becomes a file outside the app: Markdown, PDF, Word, HTML — or a printout.\", icon: icon(Download), category: \"export\", order: 0 },\n { key: \"convert\", label: \"Convert to\", definition: \"It becomes a new thing inside the app: a note, document, task, file, flashcards, quiz, template, contact, data table.\", icon: icon(ArrowRightLeft), category: \"save\", order: 0 },\n { key: \"publish\", label: \"Publish\", definition: \"It goes out to the world: a public web page or published HTML anyone with the link can open.\", icon: icon(Globe), category: \"share\", order: 0 },\n { key: \"share\", label: \"Share\", definition: \"It goes to specific people or places: share with someone, send to Google Docs, email it.\", icon: icon(Share2), category: \"share\", order: 1 },\n { key: \"organize\", label: \"Organize\", definition: \"It stays what it is, but gets filed: attached to a project or context, pinned, annotated.\", icon: icon(Tags), category: \"history\", order: 0 },\n { key: \"history\", label: \"History\", definition: \"Earlier versions: view the history, fork from a point in it.\", icon: icon(History), category: \"history\", order: 1 },\n { key: \"ai\", label: \"AI\", definition: \"An AI works on it: ask, chat, run an agent or AI action, regenerate.\", icon: icon(AGENT_ICON), category: \"ai\", order: 0 },\n { key: \"listen\", label: \"Read aloud\", definition: \"You hear it: read it aloud, a spoken summary, the voice settings.\", icon: icon(Volume2), category: \"listen\", order: 0 },\n { key: \"compare\", label: \"Compare\", definition: \"You see it side by side with something else: the clipboard or a saved base.\", icon: icon(GitCompareArrows), category: \"study\", order: 0 },\n { key: \"feedback\", label: \"Feedback\", definition: \"Tell us how it went: thumbs up or down, report a problem.\", icon: icon(ThumbsUp), category: \"feedback\", order: 1 },\n { key: \"admin\", label: \"Admin\", definition: \"Creator and admin tools: inspect, debug, server-side message surgery. Admins only.\", icon: icon(Shield), category: \"admin\", order: 0 },\n ],\n rules: [\n // ── The page's own rows that DUPLICATE a category (Arman, 2026-09-28: \"the\n // more of that we do, the better\"): they move into that category, and merge\n // into the universal row that does the same thing when it is in the menu.\n // Only genuinely unique record actions (Open, Take, Duplicate, Move to Trash…)\n // stay at the top.\n { when: { pageOwnLabels: [\"^copy( to clipboard)?$\"] }, to: { kind: \"group\", key: \"copy\" }, mergeWithIds: [\"cm:copy\", \"copy\"] },\n { when: { pageOwnLabels: [\"^copy\\\\b\"] }, to: { kind: \"group\", key: \"copy\" } },\n {\n when: { pageOwnLabels: [\"^(export|download)( as)? markdown\"] },\n to: { kind: \"group\", key: \"download\" },\n mergeWithIds: [\"save-as-file\"],\n },\n { when: { pageOwnLabels: [\"^(export|download)\\\\b\", \"^print\\\\b\"] }, to: { kind: \"group\", key: \"download\" } },\n { when: { pageOwnLabels: [\"^share( link)?…?$\"] }, to: { kind: \"group\", key: \"share\" }, mergeWithIds: [\"cm:share\"] },\n { when: { pageOwnLabels: [\"^(share|send|email)\\\\b\"] }, to: { kind: \"group\", key: \"share\" } },\n { when: { pageOwnLabels: [\"^publish\\\\b\"] }, to: { kind: \"group\", key: \"publish\" } },\n { when: { pageOwnLabels: [\"^(convert|save to|save as|create (a )?(task|note|document))\\\\b\"] }, to: { kind: \"group\", key: \"convert\" } },\n { when: { pageOwnLabels: [\"^(move to folder|add tags?|tags?|attach)\\\\b\"] }, to: { kind: \"group\", key: \"organize\" } },\n { when: { pageOwnLabels: [\"^(read aloud|listen)\\\\b\"] }, to: { kind: \"group\", key: \"listen\" } },\n { when: { pageOwnLabels: [\"^compare\\\\b\"] }, to: { kind: \"group\", key: \"compare\" } },\n { when: { pageOwnLabels: [\"^save$\"] }, to: { kind: \"top\" }, mergeWithIds: [\"cm:save\"] },\n // A conversation's own rows, by id (their labels are computed at open).\n {\n when: { ids: [\"conversation-copy-plain\", \"conversation-copy-markdown\", \"conversation-copy-formatted\", \"conversation-copy-for-ai\", \"conversation-copy-link\"] },\n to: { kind: \"group\", key: \"copy\" },\n },\n { when: { idPrefixes: [\"conversation-download-\"] }, to: { kind: \"group\", key: \"download\" } },\n {\n when: { ids: [\"conversation-save-to-notes\", \"conversation-create-document\", \"conversation-create-task\"] },\n to: { kind: \"group\", key: \"convert\" },\n },\n { when: { ids: [\"conversation-share\", \"conversation-email-to-me\"] }, to: { kind: \"group\", key: \"share\" } },\n { when: { ids: [\"conversation-open-in-new-chat\"] }, to: { kind: \"group\", key: \"ai\" } },\n { when: { ids: [\"conversation-rename\", \"conversation-duplicate\"] }, to: { kind: \"group\", key: \"edit\" } },\n\n // The clicked thing's remaining own rows (a quiz row's Open / Take / Archive,\n // a note's Duplicate / Move to Trash) come first, as they are.\n { when: { pageOwn: true }, to: { kind: \"page-first\" } },\n // The universal verb strip (icons across the top) stays exactly as it is.\n {\n when: { ids: [\"cm:copy\", \"cm:cut\", \"cm:paste\", \"cm:undo\", \"cm:redo\", \"cm:find\", \"copy\", \"cm:select-all\"] },\n to: { kind: \"top\" },\n },\n // Quick Actions is already one submenu of quick tools; the page submenu is last;\n // an editor's own Save / Delete stay one click away.\n { when: { ids: [\"cm:quick-actions\", \"cm:save\", \"cm:delete\"], categories: [\"surface-info\"] }, to: { kind: \"top\" } },\n\n {\n when: {\n ids: [\"cm:copy-as\", \"cm:json\", \"cm:insert-reference\", \"copy-html-page\", \"conversation-copy-link\"],\n categories: [\"copy\"],\n },\n to: { kind: \"group\", key: \"copy\" },\n },\n {\n when: { ids: [\"cm:export\", \"save-as-file\", \"download-pdf\", \"download-docx\", \"download-html\", \"print\", \"full-print\"] },\n to: { kind: \"group\", key: \"download\" },\n },\n { when: { ids: [\"html-preview\", \"share-webpage\"] }, to: { kind: \"group\", key: \"publish\" } },\n {\n when: { ids: [\"cm:share\", \"send-google-doc\", \"email-to-me\", \"conversation-share\"] },\n to: { kind: \"group\", key: \"share\" },\n },\n {\n when: { ids: [\"cm:attach\", \"attach-artifact-to-chat\", \"set-context-value\", \"pin-message\", \"notes-and-comments\"] },\n to: { kind: \"group\", key: \"organize\" },\n },\n {\n when: { ids: [\"cm:view-history\", \"edit-history\", \"fork-at-message\", \"fork-and-regenerate\"] },\n to: { kind: \"group\", key: \"history\" },\n },\n {\n when: { ids: [\"cm:compare\", \"compare-with-clipboard\", \"set-compare-base\", \"compare-with-base\"] },\n to: { kind: \"group\", key: \"compare\" },\n },\n {\n when: { ids: [\"cm:speak\", \"cm:listen\", \"tts-voice-settings\"], categories: [\"listen\"] },\n to: { kind: \"group\", key: \"listen\" },\n },\n {\n when: {\n ids: [\"cm:chat\", \"regenerate-response\", \"regenerate-latest\", \"continue-in-chat\", \"send-to-agent\", \"code-block-chart\"],\n idPrefixes: [\"cm:placement:\", \"cm:cat:\", \"cm:agents\"],\n categories: [\"ai\", \"ask\"],\n },\n to: { kind: \"group\", key: \"ai\" },\n },\n {\n when: {\n ids: [\n \"edit\",\n \"edit-and-resubmit\",\n \"open-fullscreen-editor\",\n \"delete-message\",\n \"code-block-open-in-editor\",\n \"code-block-apply-to-file\",\n \"code-block-run\",\n \"replace-selection\",\n \"insert-below\",\n \"conversation-rename\",\n \"conversation-duplicate\",\n ],\n },\n to: { kind: \"group\", key: \"edit\" },\n },\n { when: { ids: [\"thumbs-up\", \"thumbs-down\", \"submit-feedback\"], categories: [\"feedback\"] }, to: { kind: \"group\", key: \"feedback\" } },\n { when: { ids: [\"cm:admin\"], categories: [\"creator\", \"admin\"] }, to: { kind: \"group\", key: \"admin\" } },\n // Everything that makes a new thing in the app — checked after the rows\n // above because the registry files several of them under \"save\".\n { when: { ids: [\"cm:convert\", \"add-to-rulebook\"], categories: [\"save\", \"study\", \"export\"] }, to: { kind: \"group\", key: \"convert\" } },\n ],\n // A row no rule names stays at the top level where the package places it —\n // and the demo's Categories section lists it under \"No category yet\".\n fallback: { kind: \"top\" },\n};\n","// features/context-menu-v3/proposed/proposed-arrangement.ts\n//\n// THE PROPOSED RIGHT-CLICK MENU (Arman, 2026-10-02), applied to the rows the REAL registry\n// resolved for a real surface — nothing here invents a row. It merges two designs: the object-first\n// layout (icons, four rows, one Intelligence row, large and header-less) and the regroup demo's\n// \"what you get\" categories (`../regroup/proposed-grouping.ts`, reused here, not copied).\n//\n// [icons: ≤6, one action each, never a submenu — chosen by WHAT was clicked]\n// a thing (row, card) Copy · Share · Duplicate · Favorite · Download · Archive (red)\n// editable text Cut · Copy · Paste · Undo · Redo · Find\n// read-only text Copy · Read aloud · Find · Share\n// [Type to filter…]\n// 4 rows: the clicked thing's own actions (editable text: its edit actions)\n// More <thing> options ▸\n// Intelligence ▸ every AI entry, one row, on every menu\n// Save & share ▸ Copy as · Download · Convert to · Publish · Share — one block each\n// Organize ▸ Attach · Pin · History · Compare\n// Tools ▸ Read aloud · Quick Actions · Feedback · This page · Admin\n//\n// A page's own row that does what a universal row does merges into it (regroup's merge rule):\n// one Share, one Download, one Copy. Copy link folds into Share (its dialog carries the link).\n// A thing that brings its own Download/Export owns that verb outright: the universal page-text\n// file rows (PDF, Word, HTML, Markdown, print — regroup's \"download\" group) are dropped for it,\n// because they would save the menu's text, not the thing (a table exports CSV/XLSX, never a PDF\n// of its row label). `recordActionsOnly` cannot do this: it keeps Export by design. \"Save as PDF\n// Document\" files the same page text as a PDF, so it goes with them.\n// Applied only where a MenuRegroupContext passes `transform` (the demo); production is unchanged\n// until Arman approves.\n\nimport { Archive, Copy, Ellipsis, FolderTree, Share2, Wrench } from \"lucide-react\";\nimport { INTELLIGENCE_ICON } from \"@ai-matrx/icons/domain\";\nimport type { Action, ActionCategory, ActionSection, ClickTarget, ResolvedAction } from \"@ai-matrx/alchemy/actions\";\nimport { registerAlchemyIcon } from \"@ai-matrx/rich-content/utils/alchemy-icon-keys\";\nimport { actionLabel, matchRule } from \"../regroup/grouping\";\nimport { PROPOSED_MENU_GROUPING } from \"../regroup/proposed-grouping\";\n\nconst icon = (c: unknown) => registerAlchemyIcon(c);\n\nexport const STRIP_MAX = 6;\nexport const OWN_ROWS_MAX = 4;\n\nexport type ClickedKind = \"thing\" | \"editable\" | \"text\";\n\n/** One icon slot: the first resolved leaf that matches fills it. */\ninterface StripSlot {\n key: string;\n ids?: readonly string[] | undefined;\n /** Labels of the clicked thing's OWN rows (case-insensitive). */\n ownLabels?: readonly RegExp[] | undefined;\n}\n\nconst SLOT: Record<string, StripSlot> = {\n copy: { key: \"copy\", ids: [\"cm:copy\", \"copy\"], ownLabels: [/^copy( to clipboard)?$/i] },\n cut: { key: \"cut\", ids: [\"cm:cut\"] },\n paste: { key: \"paste\", ids: [\"cm:paste\"] },\n undo: { key: \"undo\", ids: [\"cm:undo\"] },\n redo: { key: \"redo\", ids: [\"cm:redo\"] },\n find: { key: \"find\", ids: [\"cm:find\"] },\n speak: { key: \"speak\", ids: [\"cm:speak\"] },\n share: { key: \"share\", ownLabels: [/^share\\b/i], ids: [\"cm:share\"] },\n duplicate: { key: \"duplicate\", ownLabels: [/^duplicate\\b/i, /^make a copy\\b/i] },\n favorite: { key: \"favorite\", ownLabels: [/favou?rite/i, /^(un)?star\\b/i] },\n download: { key: \"download\", ownLabels: [/^(export|download)\\b/i] },\n archive: { key: \"archive\", ownLabels: [/^archive\\b/i, /^delete\\b/i, /^move to trash\\b/i] },\n};\n\n/** The icons for each kind of click, in drawing order. */\nconst STRIP_FOR: Record<ClickedKind, readonly string[]> = {\n thing: [\"copy\", \"share\", \"duplicate\", \"favorite\", \"download\", \"archive\"],\n editable: [\"cut\", \"copy\", \"paste\", \"undo\", \"redo\", \"find\"],\n text: [\"copy\", \"speak\", \"find\", \"share\"],\n};\n\n/** Universal rows outside regroup's \"download\" group that also turn the page text into a file. */\nconst PAGE_TEXT_FILE_IDS = new Set([\"save-as-pdf\"]);\n\n/** The object's own Open row, and the Link verb that sits right after it. */\nconst OPEN_ROW = /^open( record)?$/i;\nconst LINK_A_RECORD = /^link a record/i;\n// The record's other own verbs (Merge, Split, Extract parent) are top-level beside Open and Link, outside the own-row cap.\nconst RECORD_VERBS = [/^merge with/i, /^split(…|\\.\\.\\.)?$/i, /^extract parent/i];\n\n/** Own rows that fold into a strip verb instead of sitting beside it. */\nconst FOLDS_INTO_SHARE = [/^copy link\\b/i, /^share link\\b/i];\n\n/** Regroup's \"what you get\" groups → the three rows under Intelligence. */\nconst SAVE_SHARE_GROUPS = [\"copy\", \"download\", \"convert\", \"publish\", \"share\"] as const;\nconst ORGANIZE_GROUPS = new Set([\"organize\", \"history\", \"compare\"]);\nconst AI_ORDER: readonly (string | RegExp)[] = [\n \"cm:chat\",\n \"cm:placement:ai-action\",\n \"cm:placement:bound-agent\",\n \"cm:agents\",\n \"cm:placement:user-tool\",\n \"cm:placement:organization-tool\",\n \"cm:placement:content-block\",\n /^send to (another )?agent/i,\n /^custom agent/i,\n];\nconst AI_LABELS = [/^summari[sz]e\\b/i, /^send to (another )?agent/i, /^custom agent/i];\n\n/**\n * The clicked thing's own rows: a surface's `extraSections` (engine ids `cm:x:<…>`, except the\n * engine's own page submenu `cm:x:surface`) or a section the surface lifted / named after itself.\n */\nfunction isOwn(action: Action): boolean {\n if (action.id.startsWith(\"cm:x:\") && !action.id.startsWith(\"cm:x:surface\")) return true;\n const s = action.section as (ActionSection & { kind?: string }) | undefined;\n return Boolean(s && (s.primary || s.kind === \"target\"));\n}\n\nexport function clickedKind(target: ClickTarget, resolved: readonly ResolvedAction[]): ClickedKind {\n if (!target.readOnly && resolved.some((r) => r.action.id === \"cm:paste\")) return \"editable\";\n if (resolved.some((r) => isOwn(r.action))) return \"thing\";\n return \"text\";\n}\n\nfunction submenu(id: string, label: string, category: ActionCategory, iconKey: string, children: readonly Action[], order = 0): ResolvedAction {\n const action: Action = {\n id: `proposed:${id}`,\n label,\n category,\n order,\n icon: iconKey,\n pending: (t) => children.some((c) => Boolean(c.expand && c.pending?.(t))),\n eligible: () => ({ status: \"available\" }),\n expand: async () => children,\n run: () => undefined,\n };\n return { action, eligibility: { status: \"available\" } };\n}\n\n/** A submenu row stripped of its old section (a heading the new home does not draw). */\nfunction plain(action: Action, extra: Partial<Action> = {}): Action {\n const { section: _section, ...rest } = action;\n void _section;\n return { ...rest, ...extra };\n}\n\nexport interface ProposedOptions {\n /** The clicked thing's name for \"More <noun> options\" (\"table\", \"quiz\", \"note\"). */\n noun: string;\n}\n\nexport function proposedArrangement(\n target: ClickTarget,\n resolved: readonly ResolvedAction[],\n { noun }: ProposedOptions,\n): ResolvedAction[] {\n const kind = clickedKind(target, resolved);\n const label = (r: ResolvedAction) => actionLabel(r.action, target);\n const groupOf = (r: ResolvedAction) => {\n const to = matchRule(PROPOSED_MENU_GROUPING, r.action, target)?.to;\n return to?.kind === \"group\" ? to.key : null;\n };\n const used = new Set<string>();\n\n // 0 · the thing's own Download/Export replaces the universal file rows (see header).\n const ownsDownload = resolved.some((r) => isOwn(r.action) && SLOT.download!.ownLabels!.some((re) => re.test(label(r))));\n if (ownsDownload) {\n for (const r of resolved) {\n if (!isOwn(r.action) && (groupOf(r) === \"download\" || PAGE_TEXT_FILE_IDS.has(r.action.id))) used.add(r.action.id);\n }\n }\n\n // 1 · the icon row.\n const strip: ResolvedAction[] = [];\n for (const key of STRIP_FOR[kind]) {\n if (strip.length >= STRIP_MAX) break;\n const slot = SLOT[key]!;\n const pick =\n resolved.find(\n (r) => !used.has(r.action.id) && !r.action.expand && isOwn(r.action) && slot.ownLabels?.some((re) => re.test(label(r))),\n ) ?? resolved.find((r) => !used.has(r.action.id) && !r.action.expand && slot.ids?.includes(r.action.id));\n if (!pick) continue;\n used.add(pick.action.id);\n // One verb, one icon: the page's own Share/Copy wins over the universal twin.\n if (key === \"share\") for (const r of resolved) if (r.action.id === \"cm:share\") used.add(r.action.id);\n if (key === \"copy\") for (const r of resolved) if (r.action.id === \"cm:copy\") used.add(r.action.id);\n strip.push({\n ...pick,\n action: plain(pick.action, {\n category: \"clipboard\",\n order: strip.length,\n ...(key === \"archive\" ? { destructive: true, icon: pick.action.icon ?? icon(Archive) } : {}),\n ...(key === \"copy\" && !pick.action.icon ? { icon: icon(Copy) } : {}),\n }),\n });\n }\n const hasShare = strip.some((r) => /^share\\b/i.test(label(r)));\n\n // 2 · the clicked thing's own rows (editable text: its edit actions and the editor's Save).\n // An own row that does what a universal outcome does (\"Export as Markdown\", \"Share link…\") joins\n // that outcome under Save & share instead (the regroup merge rule) — unless it already became an icon.\n const ownCandidates = resolved.filter((r) => {\n if (used.has(r.action.id)) return false;\n const g = groupOf(r);\n if (g && (SAVE_SHARE_GROUPS as readonly string[]).includes(g) && !(hasShare && FOLDS_INTO_SHARE.some((re) => re.test(label(r))))) return false;\n if (isOwn(r.action)) return true;\n return kind === \"editable\" && (groupOf(r) === \"edit\" || r.action.id === \"cm:save\" || r.action.id === \"cm:delete\");\n });\n // OPEN AND \"LINK A RECORD…\" LEAD THE OWN ROWS (CHAIR-UI-STORE item 3, 2026-10-03): on a store\n // record's cell or row the cell's rows (Paste, Clear cell, …) and the row's (Copy row, Insert, …)\n // filled the four top rows and \"Link a record…\" fell under \"More … options\", while every CRM row\n // shows Open and Link top-level. They are the record's own verbs, so they go first, in that order.\n const lead = (re: RegExp) => {\n const at = ownCandidates.findIndex((r) => re.test(label(r)));\n return at >= 0 ? ownCandidates.splice(at, 1)[0]! : null;\n };\n const openRow = lead(OPEN_ROW);\n const linkRow = lead(LINK_A_RECORD);\n const verbRows = RECORD_VERBS.map(lead).filter((r): r is ResolvedAction => r !== null);\n const leading = [openRow, linkRow, ...verbRows].filter((r): r is ResolvedAction => r !== null);\n const verbIds = new Set(verbRows.map((r) => r.action.id));\n let counted = 0;\n ownCandidates.unshift(...leading);\n const own: ResolvedAction[] = [];\n const more: Action[] = [];\n for (const r of ownCandidates) {\n used.add(r.action.id);\n const folds = hasShare && FOLDS_INTO_SHARE.some((re) => re.test(label(r)));\n if (!folds && (verbIds.has(r.action.id) || counted < OWN_ROWS_MAX) && !r.action.expand) {\n const destructive = SLOT.archive!.ownLabels!.some((re) => re.test(label(r)));\n if (!verbIds.has(r.action.id)) counted += 1;\n own.push({ ...r, action: plain(r.action, { category: \"edit\", order: own.length, ...(destructive ? { destructive: true } : {}) }) });\n } else {\n more.push(plain(r.action));\n }\n }\n const top: ResolvedAction[] = [...strip, ...own];\n if (more.length) top.push(submenu(\"more\", `More ${noun} options`, \"edit\", icon(Ellipsis), more, OWN_ROWS_MAX));\n\n // 3 · everything else, by what you get.\n const ai: Action[] = [];\n const saveShare = new Map<string, Action[]>();\n const organize: Action[] = [];\n const tools: Action[] = [];\n for (const r of resolved) {\n if (used.has(r.action.id)) continue;\n used.add(r.action.id);\n const g = groupOf(r);\n if (g === \"ai\" || r.action.category === \"ai\" || r.action.category === \"ask\" || AI_LABELS.some((re) => re.test(label(r)))) {\n ai.push(plain(r.action));\n } else if (g && (SAVE_SHARE_GROUPS as readonly string[]).includes(g)) {\n const list = saveShare.get(g) ?? [];\n list.push(plain(r.action));\n saveShare.set(g, list);\n } else if (g && ORGANIZE_GROUPS.has(g)) {\n organize.push(plain(r.action));\n } else {\n tools.push(plain(r.action));\n }\n }\n // Chat and the libraries first, then hand-offs, then spoken summaries.\n const aiRank = (a: Action) => {\n const i = AI_ORDER.findIndex((p) => (typeof p === \"string\" ? a.id === p || a.id.startsWith(p) : p.test(String(a.label))));\n return i === -1 ? AI_ORDER.length : i;\n };\n ai.sort((a, b) => aiRank(a) - aiRank(b));\n top.push(submenu(\"intelligence\", \"Intelligence\", \"ai\", icon(INTELLIGENCE_ICON), ai));\n\n // Save & share: one block per outcome, a divider between blocks.\n const saveShareRows: Action[] = [];\n for (const g of SAVE_SHARE_GROUPS) {\n const rows = saveShare.get(g) ?? [];\n rows.forEach((a, i) => saveShareRows.push(i === 0 && saveShareRows.length > 0 ? { ...a, startsGroup: true } : a));\n }\n if (saveShareRows.length) top.push(submenu(\"save-share\", \"Save & share\", \"app\", icon(Share2), saveShareRows));\n if (organize.length) top.push(submenu(\"organize\", \"Organize\", \"app\", icon(FolderTree), organize, 1));\n if (tools.length) top.push(submenu(\"tools\", \"Tools\", \"feedback\", icon(Wrench), tools));\n return top;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA,EACE;AAAA,OACK;;;ACFP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACDA,SAAS,0BAA0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,KAAK,SAAS,SAAS;AAAA,EACtC;AACA,KAAG,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC;AACvC,MAAI,KAAK,QAAQ,gBAAgB,gBAAgB,MAAMA,MAAK,iBAAiB,GAAG,EAAE,CAAC;AAGnF,QAAM,gBAA0B,CAAC;AACjC,aAAW,KAAK,mBAAmB;AACjC,UAAM,OAAO,UAAU,IAAI,CAAC,KAAK,CAAC;AAClC,SAAK,QAAQ,CAAC,GAAG,MAAM,cAAc,KAAK,MAAM,KAAK,cAAc,SAAS,IAAI,EAAE,GAAG,GAAG,aAAa,KAAK,IAAI,CAAC,CAAC;AAAA,EAClH;AACA,MAAI,cAAc,OAAQ,KAAI,KAAK,QAAQ,cAAc,gBAAgB,OAAOA,MAAKG,OAAM,GAAG,aAAa,CAAC;AAC5G,MAAI,SAAS,OAAQ,KAAI,KAAK,QAAQ,YAAY,YAAY,OAAOH,MAAK,UAAU,GAAG,UAAU,CAAC,CAAC;AACnG,MAAI,MAAM,OAAQ,KAAI,KAAK,QAAQ,SAAS,SAAS,YAAYA,MAAK,MAAM,GAAG,KAAK,CAAC;AACrF,SAAO;AACT;","names":["Copy","Share2","registerAlchemyIcon","icon","registerAlchemyIcon","Copy","Share2"]}
|
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkMBU4Y22Ocjs = require('./chunk-MBU4Y22O.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -35,8 +35,7 @@ var _chunkANJYKQAAcjs = require('./chunk-ANJYKQAA.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
var _chunkPDHJTEZKcjs = require('./chunk-PDHJTEZK.cjs');
|
|
38
|
-
require('./chunk-
|
|
39
|
-
require('./chunk-CUODNUAD.cjs');
|
|
38
|
+
require('./chunk-LDMYNYFC.cjs');
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
|
|
@@ -70,5 +69,5 @@ require('./chunk-CUODNUAD.cjs');
|
|
|
70
69
|
|
|
71
70
|
|
|
72
71
|
|
|
73
|
-
exports.CATALOG =
|
|
72
|
+
exports.CATALOG = _chunkMBU4Y22Ocjs.CATALOG; exports.CATALOG_GROUPS = _chunkMBU4Y22Ocjs.CATALOG_GROUPS; exports.DEFAULT_LOOK = _chunkPDHJTEZKcjs.DEFAULT_LOOK; exports.DESIGN_FORMAT = _chunkPDHJTEZKcjs.DESIGN_FORMAT; exports.MENU_SURFACES = _chunkPDHJTEZKcjs.MENU_SURFACES; exports.MENU_TONES = _chunkPDHJTEZKcjs.MENU_TONES; exports.MenuPreview = _chunkMBU4Y22Ocjs.MenuPreview; exports.SLOT_SOURCES = _chunkMBU4Y22Ocjs.SLOT_SOURCES; exports.TEMPLATES = _chunkMBU4Y22Ocjs.TEMPLATES; exports.UNAVAILABLE_MODES = _chunkPDHJTEZKcjs.UNAVAILABLE_MODES; exports.canMove = _chunkPDHJTEZKcjs.canMove; exports.catalogOption = _chunkMBU4Y22Ocjs.catalogOption; exports.catalogUseCounts = _chunkPDHJTEZKcjs.catalogUseCounts; exports.cloneNode = _chunkPDHJTEZKcjs.cloneNode; exports.contains = _chunkPDHJTEZKcjs.contains; exports.countItems = _chunkPDHJTEZKcjs.countItems; exports.duplicateNode = _chunkPDHJTEZKcjs.duplicateNode; exports.emptyDesign = _chunkPDHJTEZKcjs.emptyDesign; exports.insertNode = _chunkPDHJTEZKcjs.insertNode; exports.isContainer = _chunkPDHJTEZKcjs.isContainer; exports.locate = _chunkPDHJTEZKcjs.locate; exports.moveNode = _chunkPDHJTEZKcjs.moveNode; exports.newId = _chunkPDHJTEZKcjs.newId; exports.parseDesign = _chunkPDHJTEZKcjs.parseDesign; exports.placedCatalogIds = _chunkPDHJTEZKcjs.placedCatalogIds; exports.removeNode = _chunkPDHJTEZKcjs.removeNode; exports.serializeDesign = _chunkPDHJTEZKcjs.serializeDesign; exports.slotOptions = _chunkMBU4Y22Ocjs.slotOptions; exports.slotSource = _chunkMBU4Y22Ocjs.slotSource; exports.unwrapNode = _chunkPDHJTEZKcjs.unwrapNode; exports.updateNode = _chunkPDHJTEZKcjs.updateNode; exports.wrapNode = _chunkPDHJTEZKcjs.wrapNode;
|
|
74
73
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,mpDAAC","file":"/home/runner/work/aidream/aidream/apps/shared/context-menu/dist/index.cjs"}
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
catalogOption,
|
|
9
9
|
slotOptions,
|
|
10
10
|
slotSource
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PB3PMDKV.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_LOOK,
|
|
14
14
|
DESIGN_FORMAT,
|
|
@@ -35,8 +35,7 @@ import {
|
|
|
35
35
|
updateNode,
|
|
36
36
|
wrapNode
|
|
37
37
|
} from "./chunk-63WDXKZ7.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-PE3ZHHM5.js";
|
|
38
|
+
import "./chunk-2B37SXQW.js";
|
|
40
39
|
export {
|
|
41
40
|
CATALOG,
|
|
42
41
|
CATALOG_GROUPS,
|
package/dist/menu-content.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkLDMYNYFCcjs = require('./chunk-LDMYNYFC.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -18,11 +18,11 @@ require('./chunk-6E24ONDY.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
22
|
-
require('./chunk-
|
|
21
|
+
var _chunkIH5WN5JPcjs = require('./chunk-IH5WN5JP.cjs');
|
|
22
|
+
require('./chunk-7TIZAANU.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkWROBL3DRcjs = require('./chunk-WROBL3DR.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -31,7 +31,6 @@ var _chunk57PCOASMcjs = require('./chunk-57PCOASM.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkPUSFH5CVcjs = require('./chunk-PUSFH5CV.cjs');
|
|
34
|
-
require('./chunk-CUODNUAD.cjs');
|
|
35
34
|
|
|
36
35
|
// src/engine/components/AlchemyMenuContent.tsx
|
|
37
36
|
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
@@ -740,7 +739,7 @@ function DesignedMenu({ design, rows, context, point, onClose, getInspectData })
|
|
|
740
739
|
}
|
|
741
740
|
return _reactdom.createPortal.call(void 0,
|
|
742
741
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
-
|
|
742
|
+
_chunkLDMYNYFCcjs.MenuPanel,
|
|
744
743
|
{
|
|
745
744
|
nodes: menu.nodes,
|
|
746
745
|
env,
|
|
@@ -1982,18 +1981,18 @@ function editorOnlyRichActionIds(actions) {
|
|
|
1982
1981
|
}
|
|
1983
1982
|
function AlchemyMenuContent(props) {
|
|
1984
1983
|
const { mode, point, open, onOpenChange, ...menuProps } = props;
|
|
1985
|
-
const m =
|
|
1986
|
-
const model =
|
|
1984
|
+
const m = _chunkIH5WN5JPcjs.useContextMenuActions.call(void 0, menuProps);
|
|
1985
|
+
const model = _chunkIH5WN5JPcjs.buildMenuModel.call(void 0, m, menuProps);
|
|
1987
1986
|
const { registry } = _host.useAlchemyActions.call(void 0, );
|
|
1988
1987
|
_useRichDocumentProvider.useRichDocumentProvider.call(void 0, );
|
|
1989
1988
|
const instanceId = React.useId();
|
|
1990
1989
|
const waitersRef = React.useRef([]);
|
|
1991
1990
|
const nextModel = () => new Promise((resolve) => waitersRef.current.push(resolve));
|
|
1992
|
-
const actionsRef = React.useRef(
|
|
1991
|
+
const actionsRef = React.useRef(_chunkIH5WN5JPcjs.contextMenuActionsFromModel.call(void 0, model, instanceId, { nextModel, editable: Boolean(menuProps.isEditable) }));
|
|
1993
1992
|
const drawnRef = React.useRef("");
|
|
1994
|
-
const drawn =
|
|
1993
|
+
const drawn = _chunkIH5WN5JPcjs.modelRevision.call(void 0, model);
|
|
1995
1994
|
React.useLayoutEffect(() => {
|
|
1996
|
-
actionsRef.current =
|
|
1995
|
+
actionsRef.current = _chunkIH5WN5JPcjs.contextMenuActionsFromModel.call(void 0, model, instanceId, { nextModel, editable: Boolean(menuProps.isEditable) });
|
|
1997
1996
|
if (drawnRef.current !== drawn) {
|
|
1998
1997
|
drawnRef.current = drawn;
|
|
1999
1998
|
const waiters = waitersRef.current;
|
|
@@ -2002,7 +2001,7 @@ function AlchemyMenuContent(props) {
|
|
|
2002
2001
|
}
|
|
2003
2002
|
});
|
|
2004
2003
|
React.useEffect(
|
|
2005
|
-
() => registry.register(
|
|
2004
|
+
() => registry.register(_chunkIH5WN5JPcjs.contextMenuProvider.call(void 0, instanceId, () => actionsRef.current)),
|
|
2006
2005
|
[registry, instanceId]
|
|
2007
2006
|
);
|
|
2008
2007
|
const hasRichDocument = m.registryActions.length > 0 && !(menuProps.recordActionsOnly && m.richDocCtx.source.type === "raw");
|
|
@@ -2042,16 +2041,16 @@ function AlchemyMenuContent(props) {
|
|
|
2042
2041
|
}
|
|
2043
2042
|
});
|
|
2044
2043
|
const [target] = React.useState(() => makeTarget(true));
|
|
2045
|
-
const chatMessage =
|
|
2044
|
+
const chatMessage = _chunkIH5WN5JPcjs.chatMessageSubject.call(void 0, {
|
|
2046
2045
|
state: m.richDocCtx.getState(),
|
|
2047
2046
|
source: m.richDocCtx.source,
|
|
2048
|
-
...
|
|
2047
|
+
..._chunkWROBL3DRcjs.compact.call(void 0, {
|
|
2049
2048
|
extensions: m.richDocCtx.extensions,
|
|
2050
2049
|
contextData: menuProps.contextData
|
|
2051
2050
|
})
|
|
2052
2051
|
});
|
|
2053
|
-
const { content, contentLabel } = _nullishCoalesce(
|
|
2054
|
-
const revision =
|
|
2052
|
+
const { content, contentLabel } = _nullishCoalesce(_chunkIH5WN5JPcjs.namedHeader.call(void 0, menuProps.heading, m.actionText), () => ( _chunkIH5WN5JPcjs.menuHeader.call(void 0, m.actionText, m.fieldLabel, chatMessage)));
|
|
2053
|
+
const revision = _chunkIH5WN5JPcjs.menuEngineRevision.call(void 0, drawn, { content, contentLabel });
|
|
2055
2054
|
const engine = { revision, content, contentLabel };
|
|
2056
2055
|
const close = () => onOpenChange(false);
|
|
2057
2056
|
const regroup = React.useContext(_chunkTGR6ZAA3cjs.MenuRegroupContext);
|
|
@@ -2089,7 +2088,7 @@ function AlchemyMenuContent(props) {
|
|
|
2089
2088
|
onOpenChange,
|
|
2090
2089
|
arrangement: menuProps.menuLayout,
|
|
2091
2090
|
density: menuProps.menuDensity,
|
|
2092
|
-
...
|
|
2091
|
+
..._chunkWROBL3DRcjs.compact.call(void 0, { subjectFold: menuProps.subjectFold }),
|
|
2093
2092
|
...panelLook
|
|
2094
2093
|
}
|
|
2095
2094
|
) });
|
|
@@ -2109,14 +2108,14 @@ function findShortcut(groups, id) {
|
|
|
2109
2108
|
}
|
|
2110
2109
|
function ShortcutKeyRunner(props) {
|
|
2111
2110
|
const { shortcutId, shortcutLabel, onDone, ...menuProps } = props;
|
|
2112
|
-
const m =
|
|
2111
|
+
const m = _chunkIH5WN5JPcjs.useContextMenuActions.call(void 0, menuProps);
|
|
2113
2112
|
const ran = _react.useRef.call(void 0, false);
|
|
2114
2113
|
_react.useEffect.call(void 0, () => {
|
|
2115
2114
|
if (ran.current || m.loading) return;
|
|
2116
2115
|
ran.current = true;
|
|
2117
2116
|
const entry = findShortcut(m.categoryGroups, shortcutId);
|
|
2118
2117
|
if (!entry) {
|
|
2119
|
-
|
|
2118
|
+
_chunkIH5WN5JPcjs.toast.call(void 0, {
|
|
2120
2119
|
title: m.librariesError ? `Couldn't load ${shortcutLabel}` : `${shortcutLabel} isn't available here`,
|
|
2121
2120
|
...m.librariesError ? { variant: "destructive" } : {}
|
|
2122
2121
|
});
|