bridgerte 0.9.3 → 0.9.5

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.
Files changed (47) hide show
  1. package/README.md +892 -861
  2. package/dist/bridge.cjs.map +1 -1
  3. package/dist/bridge.d.ts +1 -3
  4. package/dist/bridge.js.map +1 -1
  5. package/dist/core.cjs +1 -1
  6. package/dist/core.cjs.map +1 -1
  7. package/dist/core.d.ts +9 -3
  8. package/dist/core.js +44 -54
  9. package/dist/core.js.map +1 -1
  10. package/dist/dom.cjs +1 -1
  11. package/dist/dom.d.ts +9 -3
  12. package/dist/dom.js +6 -5
  13. package/dist/index-BWi3d-Zp.js +314 -0
  14. package/dist/index-BWi3d-Zp.js.map +1 -0
  15. package/dist/index-B_g23O7q.cjs +4 -0
  16. package/dist/index-B_g23O7q.cjs.map +1 -0
  17. package/dist/index-CuNKUHed.js.map +1 -1
  18. package/dist/index-DF8OhKI4.cjs +2 -0
  19. package/dist/index-DF8OhKI4.cjs.map +1 -0
  20. package/dist/{index-BwZ0II4h.js → index-DyCMSFrm.js} +1135 -1141
  21. package/dist/index-DyCMSFrm.js.map +1 -0
  22. package/dist/index-GaS65GL0.cjs.map +1 -1
  23. package/dist/index-H5V0EMkq.cjs +36 -0
  24. package/dist/index-H5V0EMkq.cjs.map +1 -0
  25. package/dist/index-sbZNOcCB.js +54 -0
  26. package/dist/index-sbZNOcCB.js.map +1 -0
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.ts +17 -3
  29. package/dist/index.js +24 -21
  30. package/dist/index.js.map +1 -1
  31. package/dist/native-spec.cjs +1 -1
  32. package/dist/native-spec.cjs.map +1 -1
  33. package/dist/native-spec.d.ts +1 -3
  34. package/dist/native-spec.js +73 -119
  35. package/dist/native-spec.js.map +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/webview.cjs +1 -1
  38. package/dist/webview.d.ts +1 -3
  39. package/dist/webview.js +1 -1
  40. package/package.json +1 -1
  41. package/dist/index-BaOlPu8L.cjs +0 -4
  42. package/dist/index-BaOlPu8L.cjs.map +0 -1
  43. package/dist/index-BwZ0II4h.js.map +0 -1
  44. package/dist/index-bN5Hs6-3.js +0 -299
  45. package/dist/index-bN5Hs6-3.js.map +0 -1
  46. package/dist/index-hd9Zi2DV.cjs +0 -36
  47. package/dist/index-hd9Zi2DV.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"native-spec.cjs","sources":["../../native-spec/src/menuSchema/payloadPanels.ts","../../native-spec/src/menuSchema/tableHeaderMenuItems.ts","../../native-spec/src/menuSchema/defaultMenuSchema.ts","../../native-spec/src/commandState/index.ts","../../native-spec/src/toolbarConfig/index.ts"],"sourcesContent":["import {\n BRIDGERTE_TABLE_INSERT_MAX_COLS,\n BRIDGERTE_TABLE_INSERT_MAX_ROWS,\n type PayloadPanelSchema\n} from '@bridgerte/core';\n\n/**\n * 代码块语言列表给 DOM 代码块顶部控制栏和原生侧自绘使用。\n *\n * 空字符串表示纯文本;默认候选按 Shiki 高频技术文档语言维护。业务如需裁剪语言、\n * 调整顺序或接入更多 Shiki 语言,传入自己的 `codeBlockLanguagePanel` 即可。\n */\nexport const codeBlockLanguagePanel: PayloadPanelSchema = {\n id: 'code-block-language',\n title: '代码语言',\n fields: [\n {\n type: 'select',\n name: 'language',\n label: '语言',\n defaultValue: '',\n options: [\n { label: '纯文本', value: '' },\n { label: 'Bash', value: 'shellscript' },\n { label: 'C', value: 'c' },\n { label: 'C++', value: 'cpp' },\n { label: 'C#', value: 'csharp' },\n { label: 'CSS', value: 'css' },\n { label: 'Dart', value: 'dart' },\n { label: 'Dockerfile', value: 'docker' },\n { label: 'Go', value: 'go' },\n { label: 'HTML', value: 'html' },\n { label: 'Java', value: 'java' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'JSON', value: 'json' },\n { label: 'Kotlin', value: 'kotlin' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'PHP', value: 'php' },\n { label: 'Python', value: 'python' },\n { label: 'Rust', value: 'rust' },\n { label: 'SQL', value: 'sql' },\n { label: 'Swift', value: 'swift' },\n { label: 'TOML', value: 'toml' },\n { label: 'TSX', value: 'tsx' },\n { label: 'TypeScript', value: 'typescript' },\n { label: 'Vue', value: 'vue' },\n { label: 'XML', value: 'xml' },\n { label: 'YAML', value: 'yaml' }\n ]\n }\n ]\n};\n\n/**\n * 兼容旧导出名。\n *\n * 代码块语言现在由代码块 header 触发,不再代表 toolbar 菜单 payload。\n */\nexport const codeBlockLanguagePayloadPanel = codeBlockLanguagePanel;\n\n/**\n * 颜色菜单使用 color 字段而不是预设色列表。\n *\n * DOM 默认面板可以渲染内置颜色控件,RN/Flutter/WebView 或业务自绘层仍读取同一份 schema。\n */\nexport const textColorPanel: PayloadPanelSchema = {\n id: 'text-color',\n title: '文字颜色',\n fields: [\n {\n type: 'color',\n name: 'value',\n label: '颜色'\n }\n ]\n};\n\nexport const backgroundColorPanel: PayloadPanelSchema = {\n id: 'background-color',\n title: '背景色',\n fields: [\n {\n type: 'color',\n name: 'value',\n label: '背景'\n }\n ]\n};\n\nexport const fontSizePanel: PayloadPanelSchema = {\n id: 'font-size',\n title: '字号',\n fields: [\n {\n type: 'select',\n name: 'value',\n label: '字号',\n defaultValue: '16px',\n options: [\n { label: '小号 14px', value: '14px' },\n { label: '正文 16px', value: '16px' },\n { label: '强调 18px', value: '18px' },\n { label: '标题 20px', value: '20px' },\n { label: '大标题 24px', value: '24px' }\n ]\n }\n ]\n};\n\nexport const fontFamilyPanel: PayloadPanelSchema = {\n id: 'font-family',\n title: '字体',\n fields: [\n {\n type: 'select',\n name: 'value',\n label: '字体',\n defaultValue: '',\n options: [\n { label: '跟随页面', value: '' },\n { label: '无衬线', value: 'sans-serif' },\n { label: '衬线', value: 'serif' },\n { label: '等宽', value: 'monospace' }\n ]\n }\n ]\n};\n\nexport const lineHeightPanel: PayloadPanelSchema = {\n id: 'line-height',\n title: '行高',\n fields: [\n {\n type: 'select',\n name: 'value',\n label: '行高',\n defaultValue: '1.7',\n options: [\n { label: '紧凑 1.4', value: '1.4' },\n { label: '常规 1.7', value: '1.7' },\n { label: '舒展 2', value: '2' }\n ]\n }\n ]\n};\n\n/**\n * 表格插入使用 number 字段收集行列。\n *\n * DOM 默认面板、H5 自绘和 RN/Flutter 原生表单都读取同一份 schema;真正的表格进阶操作\n * 仍放后续表格菜单阶段继续扩展。\n */\nexport const tableInsertPanel: PayloadPanelSchema = {\n id: 'table-insert',\n title: '插入表格',\n fields: [\n {\n type: 'number',\n name: 'rows',\n label: '行数',\n defaultValue: '3',\n min: 1,\n max: BRIDGERTE_TABLE_INSERT_MAX_ROWS,\n step: 1\n },\n {\n type: 'number',\n name: 'cols',\n label: '列数',\n defaultValue: '3',\n min: 1,\n max: BRIDGERTE_TABLE_INSERT_MAX_COLS,\n step: 1\n }\n ]\n};\n","import type { MenuItem } from './type';\n\n/*\n * 表格 header 和后续表格浮动菜单共用这组操作入口。\n * 这些菜单默认不进入 toolbar 排列,但仍放在 native-spec,保证 DOM/RN/Flutter 自绘读取同一份\n * command/label/icon 协议。\n */\nexport const tableHeaderMenuItems: MenuItem[] = [\n {\n id: 'table-insert-row-after',\n command: { type: 'table.insertRow', direction: 'after' },\n label: '插入行',\n icon: 'rows-plus',\n group: 'table'\n },\n {\n id: 'table-delete-row',\n command: { type: 'table.deleteRow' },\n label: '删除行',\n icon: 'rows-minus',\n group: 'table'\n },\n {\n id: 'table-insert-column-after',\n command: { type: 'table.insertColumn', direction: 'after' },\n label: '插入列',\n icon: 'columns-plus',\n group: 'table'\n },\n {\n id: 'table-delete-column',\n command: { type: 'table.deleteColumn' },\n label: '删除列',\n icon: 'columns-minus',\n group: 'table'\n },\n {\n id: 'table-delete',\n command: { type: 'table.delete' },\n label: '删除表格',\n icon: 'table-delete',\n group: 'table'\n }\n];\n","import type { MenuItem } from './type';\nimport {\n backgroundColorPanel,\n fontFamilyPanel,\n fontSizePanel,\n lineHeightPanel,\n tableInsertPanel,\n textColorPanel\n} from './payloadPanels';\nimport { tableHeaderMenuItems } from './tableHeaderMenuItems';\n\n/**\n * 默认菜单 schema 覆盖 wangEditor 常用入口。\n *\n * RN/Flutter 可以按 group 渲染分组,也可以基于 id 做业务侧排序或裁剪。\n */\nexport const defaultMenuSchema: MenuItem[] = [\n {\n id: 'bold',\n command: { type: 'format.bold' },\n label: '加粗',\n icon: 'bold',\n group: 'text'\n },\n {\n id: 'italic',\n command: { type: 'format.italic' },\n label: '斜体',\n icon: 'italic',\n group: 'text'\n },\n {\n id: 'underline',\n command: { type: 'format.underline' },\n label: '下划线',\n icon: 'underline',\n group: 'text'\n },\n {\n id: 'strike',\n command: { type: 'format.strike' },\n label: '删除线',\n icon: 'strikethrough',\n group: 'text'\n },\n {\n id: 'inline-code',\n command: { type: 'format.inlineCode' },\n label: '行内代码',\n icon: 'code',\n group: 'text'\n },\n {\n id: 'superscript',\n command: { type: 'format.superscript' },\n label: '上标',\n icon: 'superscript',\n group: 'text'\n },\n {\n id: 'subscript',\n command: { type: 'format.subscript' },\n label: '下标',\n icon: 'subscript',\n group: 'text'\n },\n {\n id: 'clear-style',\n command: { type: 'format.clear' },\n label: '清除样式',\n icon: 'remove-formatting',\n group: 'text'\n },\n {\n id: 'color',\n command: { type: 'format.color', value: '' },\n label: '文字颜色',\n icon: 'palette',\n group: 'style',\n requiresPayload: true,\n payloadPanel: textColorPanel\n },\n {\n id: 'background-color',\n command: { type: 'format.backgroundColor', value: '' },\n label: '背景色',\n icon: 'paint-bucket',\n group: 'style',\n requiresPayload: true,\n payloadPanel: backgroundColorPanel\n },\n {\n id: 'font-size',\n command: { type: 'format.fontSize', value: '' },\n label: '字号',\n icon: 'case-sensitive',\n group: 'style',\n requiresPayload: true,\n payloadPanel: fontSizePanel\n },\n {\n id: 'font-family',\n command: { type: 'format.fontFamily', value: '' },\n label: '字体',\n icon: 'type',\n group: 'style',\n requiresPayload: true,\n payloadPanel: fontFamilyPanel\n },\n {\n id: 'line-height',\n command: { type: 'format.lineHeight', value: '' },\n label: '行高',\n icon: 'wrap-text',\n group: 'style',\n requiresPayload: true,\n payloadPanel: lineHeightPanel\n },\n {\n id: 'paragraph',\n command: { type: 'block.paragraph' },\n label: '正文',\n icon: 'pilcrow',\n group: 'block'\n },\n {\n id: 'heading-1',\n command: { type: 'block.heading', level: 1 },\n label: '一级标题',\n icon: 'heading-1',\n group: 'block'\n },\n {\n id: 'heading-2',\n command: { type: 'block.heading', level: 2 },\n label: '二级标题',\n icon: 'heading-2',\n group: 'block'\n },\n {\n id: 'heading-3',\n command: { type: 'block.heading', level: 3 },\n label: '三级标题',\n icon: 'heading-3',\n group: 'block'\n },\n {\n id: 'heading-4',\n command: { type: 'block.heading', level: 4 },\n label: '四级标题',\n icon: 'heading-4',\n group: 'block'\n },\n {\n id: 'heading-5',\n command: { type: 'block.heading', level: 5 },\n label: '五级标题',\n icon: 'heading-5',\n group: 'block'\n },\n {\n id: 'heading-6',\n command: { type: 'block.heading', level: 6 },\n label: '六级标题',\n icon: 'heading-6',\n group: 'block'\n },\n {\n id: 'quote',\n command: { type: 'block.quote' },\n label: '引用',\n icon: 'quote',\n group: 'block'\n },\n {\n id: 'divider',\n command: { type: 'block.divider' },\n label: '分割线',\n icon: 'minus',\n group: 'block'\n },\n {\n id: 'code-block',\n command: { type: 'block.code' },\n label: '代码块',\n icon: 'square-code',\n group: 'block'\n },\n {\n id: 'ordered-list',\n command: { type: 'list.ordered' },\n label: '有序列表',\n icon: 'list-ordered',\n group: 'list'\n },\n {\n id: 'unordered-list',\n command: { type: 'list.unordered' },\n label: '无序列表',\n icon: 'list',\n group: 'list'\n },\n {\n id: 'todo-list',\n command: { type: 'list.todo' },\n label: '待办列表',\n icon: 'list-todo',\n group: 'list'\n },\n {\n id: 'align-left',\n command: { type: 'align', value: 'left' },\n label: '左对齐',\n icon: 'align-left',\n group: 'align'\n },\n {\n id: 'align-center',\n command: { type: 'align', value: 'center' },\n label: '居中',\n icon: 'align-center',\n group: 'align'\n },\n {\n id: 'align-right',\n command: { type: 'align', value: 'right' },\n label: '右对齐',\n icon: 'align-right',\n group: 'align'\n },\n {\n id: 'align-justify',\n command: { type: 'align', value: 'justify' },\n label: '两端对齐',\n icon: 'align-justify',\n group: 'align'\n },\n {\n id: 'indent-increase',\n command: { type: 'indent.increase' },\n label: '增加缩进',\n icon: 'indent-increase',\n group: 'align'\n },\n {\n id: 'indent-decrease',\n command: { type: 'indent.decrease' },\n label: '减少缩进',\n icon: 'indent-decrease',\n group: 'align'\n },\n {\n id: 'mention',\n command: { type: 'mention.insert', item: { id: '', label: '', value: '' } },\n label: '@ 提及',\n icon: 'at-sign',\n group: 'insert',\n requiresPayload: true\n },\n {\n id: 'upload-image',\n command: { type: 'media.pickImage' },\n label: '上传图片',\n icon: 'upload-image',\n group: 'media'\n },\n {\n id: 'upload-video',\n command: { type: 'media.pickVideo' },\n label: '上传视频',\n icon: 'upload-video',\n group: 'media'\n },\n {\n id: 'table',\n command: { type: 'table.insert', rows: 3, cols: 3 },\n label: '表格',\n icon: 'table',\n group: 'table',\n requiresPayload: true,\n payloadPanel: tableInsertPanel\n },\n ...tableHeaderMenuItems,\n {\n id: 'slash-command',\n command: { type: 'slash.open' },\n label: '/ 命令',\n icon: 'list-plus',\n group: 'insert'\n },\n {\n id: 'undo',\n command: { type: 'history.undo' },\n label: '撤销',\n icon: 'undo',\n group: 'history'\n },\n {\n id: 'redo',\n command: { type: 'history.redo' },\n label: '重做',\n icon: 'redo',\n group: 'history'\n },\n {\n id: 'clear',\n command: { type: 'content.clear' },\n label: '清空',\n icon: 'trash-2',\n group: 'history'\n },\n {\n id: 'fullscreen',\n command: { type: 'fullscreen.toggle' },\n label: '全屏',\n icon: 'maximize',\n group: 'view'\n }\n];\n","import type { CommandState, EditorCommand } from '@bridgerte/core';\nimport type { MenuItem } from '../menuSchema';\nimport { defaultMenuSchema } from '../menuSchema';\n\nconst commandStateValueByType: Partial<Record<EditorCommand['type'], (command: EditorCommand) => (\n CommandState['value'] | undefined\n)>> = {\n align: (command) => command.type === 'align' ? command.value : undefined,\n 'block.heading': (command) => command.type === 'block.heading' ? command.level : undefined,\n 'block.setCodeLanguage': (command) => (\n command.type === 'block.setCodeLanguage' ? command.language : undefined\n )\n};\n\n/**\n * 取出菜单命令用于匹配 `CommandState.value` 的稳定值。\n *\n * 同类命令存在多个菜单项时使用这个值区分,比如对齐方式和标题级别。\n */\nexport const getCommandStateMatchValue = (\n command: EditorCommand\n): CommandState['value'] | undefined => commandStateValueByType[command.type]?.(command);\n\n/**\n * 判断某条命令状态是否对应一个完整命令 payload。\n */\nexport const isCommandStateForCommand = (\n command: EditorCommand,\n state: CommandState\n): boolean => {\n const matchValue = getCommandStateMatchValue(command);\n\n return state.command === command.type\n && (matchValue === undefined || state.value === matchValue);\n};\n\n/**\n * 判断某条命令状态是否对应一个菜单项。\n *\n * 原生 toolbar 可以用它把 `CommandState[]` 映射回具体按钮 active/disabled 状态。\n */\nexport const isMenuItemCommandState = (item: MenuItem, state: CommandState): boolean => (\n isCommandStateForCommand(item.command, state)\n);\n\n/**\n * 为给定菜单生成默认禁用状态。\n *\n * 编辑器未 ready 或无选区时,原生 toolbar 可以先使用这组状态兜底。\n */\nexport function createDisabledCommandStates(menuSchema = defaultMenuSchema): CommandState[] {\n return menuSchema.map((item) => ({\n command: item.command.type,\n active: false,\n disabled: true,\n value: getCommandStateMatchValue(item.command)\n }));\n}\n","import type { ToolbarConfig, ToolbarGroupConfig, ToolbarKey } from '@bridgerte/core';\nimport type { MenuItem } from '../menuSchema';\nimport { defaultMenuSchema } from '../menuSchema';\nimport type { ResolvedToolbarItem } from './type';\n\nexport type * from './type';\n\n/**\n * 默认 DOM toolbar 配置。\n *\n * 这里只选择已实现或带参数面板的基础按钮;完整菜单全集仍由 `defaultMenuSchema` 维护。\n */\nexport const defaultToolbarConfig: ToolbarConfig = {\n toolbarKeys: [\n 'undo',\n 'redo',\n 'clear',\n '|',\n 'paragraph',\n 'heading-1',\n 'heading-2',\n 'heading-3',\n 'heading-4',\n 'heading-5',\n 'heading-6',\n 'quote',\n 'divider',\n 'code-block',\n '|',\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'inline-code',\n 'superscript',\n 'subscript',\n 'clear-style',\n 'color',\n 'background-color',\n 'font-size',\n 'font-family',\n 'line-height',\n '|',\n 'ordered-list',\n 'unordered-list',\n 'todo-list',\n '|',\n 'upload-image',\n 'upload-video',\n '|',\n 'table',\n '|',\n 'align-left',\n 'align-center',\n 'align-right',\n 'align-justify',\n 'indent-increase',\n 'indent-decrease',\n '|',\n 'fullscreen'\n ]\n};\n\nconst isToolbarGroupConfig = (key: ToolbarKey): key is ToolbarGroupConfig => (\n typeof key === 'object' && Array.isArray(key.menuKeys)\n);\n\nconst createMenuMap = (menuSchema: MenuItem[]) => new Map(\n menuSchema.map((item) => [item.id, item])\n);\n\nconst shouldExcludeToolbarKey = (\n key: ToolbarKey,\n excludeKeys: Set<string>\n) => {\n if (typeof key === 'string') return key !== '|' && excludeKeys.has(key);\n\n return excludeKeys.has(key.key) || key.menuKeys.every((menuKey) => excludeKeys.has(menuKey));\n};\n\nconst applyToolbarConfigOverrides = (\n baseKeys: ToolbarKey[],\n toolbarConfig?: ToolbarConfig\n): ToolbarKey[] => {\n const excludeKeys = new Set(toolbarConfig?.excludeKeys ?? []);\n /*\n * 先排除再插入,等价于“在用户最终想保留的默认菜单里加东西”。\n * insert index 做夹取,避免业务传入负数或超长下标时破坏默认 toolbar。\n */\n const filteredKeys = baseKeys.filter((key) => !shouldExcludeToolbarKey(key, excludeKeys));\n\n if (!toolbarConfig?.insertKeys) return filteredKeys;\n\n const insertIndex = Math.max(0, Math.min(toolbarConfig.insertKeys.index, filteredKeys.length));\n\n return [\n ...filteredKeys.slice(0, insertIndex),\n ...toolbarConfig.insertKeys.keys,\n ...filteredKeys.slice(insertIndex)\n ];\n};\n\nconst resolveToolbarKey = (\n key: ToolbarKey,\n menuMap: Map<string, MenuItem>,\n excludeKeys: Set<string>,\n separatorIndex: number\n): ResolvedToolbarItem[] => {\n if (key === '|') {\n return [{ type: 'separator', key: `separator-${separatorIndex}` }];\n }\n\n if (typeof key === 'string') {\n const item = menuMap.get(key);\n\n // 未知 key 直接忽略;需要 payload 但没有 panel 的菜单暂不渲染,避免按钮点击后无法生成合法命令。\n if (!item || (item.requiresPayload && !item.payloadPanel) || excludeKeys.has(item.id)) {\n return [];\n }\n\n return [{ type: 'button', item }];\n }\n\n if (isToolbarGroupConfig(key)) {\n const items = key.menuKeys\n .filter((menuKey) => !excludeKeys.has(menuKey))\n .map((menuKey) => menuMap.get(menuKey))\n .filter((item): item is MenuItem => (\n item !== undefined && (!item.requiresPayload || item.payloadPanel !== undefined)\n ));\n\n return items.length > 0 ? [{\n type: 'group',\n key: key.key,\n title: key.title,\n icon: key.icon,\n items\n }] : [];\n }\n\n return [];\n};\n\nconst shouldKeepResolvedToolbarItem = (\n item: ResolvedToolbarItem,\n items: ResolvedToolbarItem[]\n) => {\n if (item.type !== 'separator') return true;\n\n const previousItem = items[items.length - 1];\n\n return previousItem !== undefined && previousItem.type !== 'separator';\n};\n\nconst trimTrailingToolbarSeparators = (items: ResolvedToolbarItem[]) => {\n while (items.at(-1)?.type === 'separator') {\n items.pop();\n }\n\n return items;\n};\n\n/**\n * 把 wangEditor 风格的 JSON 配置解析成 DOM/RN/Flutter 都能消费的菜单结构。\n *\n * 未知 key 和缺少 payloadPanel 的 requiresPayload 菜单会被忽略,避免默认 toolbar 渲染无法处理的按钮。\n * 分割线会自动去掉开头、结尾和连续项,避免被跳过的菜单留下空分隔。\n */\nexport const resolveToolbarMenu = (\n toolbarConfig: ToolbarConfig = defaultToolbarConfig,\n menuSchema: MenuItem[] = defaultMenuSchema\n): ResolvedToolbarItem[] => {\n const menuMap = createMenuMap(menuSchema);\n const baseKeys = toolbarConfig.toolbarKeys ?? defaultToolbarConfig.toolbarKeys ?? [];\n const toolbarKeys = applyToolbarConfigOverrides(baseKeys, toolbarConfig);\n const excludeKeys = new Set(toolbarConfig.excludeKeys ?? []);\n let separatorIndex = 0;\n\n const resolvedItems = toolbarKeys.reduce<ResolvedToolbarItem[]>((items, key) => {\n const nextItems = resolveToolbarKey(key, menuMap, excludeKeys, separatorIndex);\n\n if (key === '|') separatorIndex += 1;\n\n nextItems.forEach((item) => {\n if (shouldKeepResolvedToolbarItem(item, items)) {\n items.push(item);\n }\n });\n\n return items;\n }, []);\n\n return trimTrailingToolbarSeparators(resolvedItems);\n};\n"],"names":["codeBlockLanguagePanel","codeBlockLanguagePayloadPanel","textColorPanel","backgroundColorPanel","fontSizePanel","fontFamilyPanel","lineHeightPanel","tableInsertPanel","BRIDGERTE_TABLE_INSERT_MAX_ROWS","BRIDGERTE_TABLE_INSERT_MAX_COLS","tableHeaderMenuItems","defaultMenuSchema","commandStateValueByType","command","getCommandStateMatchValue","_a","isCommandStateForCommand","state","matchValue","isMenuItemCommandState","item","createDisabledCommandStates","menuSchema","defaultToolbarConfig","isToolbarGroupConfig","key","createMenuMap","shouldExcludeToolbarKey","excludeKeys","menuKey","applyToolbarConfigOverrides","baseKeys","toolbarConfig","filteredKeys","insertIndex","resolveToolbarKey","menuMap","separatorIndex","items","shouldKeepResolvedToolbarItem","previousItem","trimTrailingToolbarSeparators","resolveToolbarMenu","toolbarKeys","resolvedItems","nextItems"],"mappings":"wHAYaA,EAA6C,CACxD,GAAI,sBACJ,MAAO,OACP,OAAQ,CACN,CACE,KAAM,SACN,KAAM,WACN,MAAO,KACP,aAAc,GACd,QAAS,CACP,CAAE,MAAO,MAAO,MAAO,EAAA,EACvB,CAAE,MAAO,OAAQ,MAAO,aAAA,EACxB,CAAE,MAAO,IAAK,MAAO,GAAA,EACrB,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,KAAM,MAAO,QAAA,EACtB,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,aAAc,MAAO,QAAA,EAC9B,CAAE,MAAO,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AA8BG,CAAa,CACpD"}
1
+ {"version":3,"file":"native-spec.cjs","sources":["../../native-spec/src/menuSchema/payloadPanels.ts","../../native-spec/src/menuSchema/tableHeaderMenuItems.ts","../../native-spec/src/menuSchema/defaultMenuSchema.ts","../../native-spec/src/commandState/index.ts","../../native-spec/src/toolbarConfig/index.ts"],"sourcesContent":["import {\n BRIDGERTE_TABLE_INSERT_MAX_COLS,\n BRIDGERTE_TABLE_INSERT_MAX_ROWS,\n type PayloadPanelSchema\n} from '@bridgerte/core';\n\n/**\n * 代码块语言列表给 DOM 代码块顶部控制栏和原生侧自绘使用。\n *\n * 空字符串表示纯文本;默认候选按 Shiki 高频技术文档语言维护。业务如需裁剪语言、\n * 调整顺序或接入更多 Shiki 语言,传入自己的 `codeBlockLanguagePanel` 即可。\n */\nexport const codeBlockLanguagePanel: PayloadPanelSchema = {\n id: 'code-block-language',\n title: '代码语言',\n fields: [\n {\n type: 'select',\n name: 'language',\n label: '语言',\n defaultValue: '',\n options: [\n { label: '纯文本', value: '' },\n { label: 'Bash', value: 'shellscript' },\n { label: 'C', value: 'c' },\n { label: 'C++', value: 'cpp' },\n { label: 'C#', value: 'csharp' },\n { label: 'CSS', value: 'css' },\n { label: 'Dart', value: 'dart' },\n { label: 'Dockerfile', value: 'docker' },\n { label: 'Go', value: 'go' },\n { label: 'HTML', value: 'html' },\n { label: 'Java', value: 'java' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'JSON', value: 'json' },\n { label: 'Kotlin', value: 'kotlin' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'PHP', value: 'php' },\n { label: 'Python', value: 'python' },\n { label: 'Rust', value: 'rust' },\n { label: 'SQL', value: 'sql' },\n { label: 'Swift', value: 'swift' },\n { label: 'TOML', value: 'toml' },\n { label: 'TSX', value: 'tsx' },\n { label: 'TypeScript', value: 'typescript' },\n { label: 'Vue', value: 'vue' },\n { label: 'XML', value: 'xml' },\n { label: 'YAML', value: 'yaml' }\n ]\n }\n ]\n};\n\n/**\n * 兼容旧导出名。\n *\n * 代码块语言现在由代码块 header 触发,不再代表 toolbar 菜单 payload。\n */\nexport const codeBlockLanguagePayloadPanel = codeBlockLanguagePanel;\n\n/**\n * 颜色菜单使用 color 字段而不是预设色列表。\n *\n * DOM 默认面板可以渲染内置颜色控件,RN/Flutter/WebView 或业务自绘层仍读取同一份 schema。\n */\nexport const textColorPanel: PayloadPanelSchema = {\n id: 'text-color',\n title: '文字颜色',\n fields: [\n {\n type: 'color',\n name: 'value',\n label: '颜色'\n }\n ]\n};\n\nexport const backgroundColorPanel: PayloadPanelSchema = {\n id: 'background-color',\n title: '背景色',\n fields: [\n {\n type: 'color',\n name: 'value',\n label: '背景'\n }\n ]\n};\n\nexport const fontSizePanel: PayloadPanelSchema = {\n id: 'font-size',\n title: '字号',\n fields: [\n {\n type: 'select',\n name: 'value',\n label: '字号',\n defaultValue: '16px',\n options: [\n { label: '小号 14px', value: '14px' },\n { label: '正文 16px', value: '16px' },\n { label: '强调 18px', value: '18px' },\n { label: '标题 20px', value: '20px' },\n { label: '大标题 24px', value: '24px' }\n ]\n }\n ]\n};\n\nexport const fontFamilyPanel: PayloadPanelSchema = {\n id: 'font-family',\n title: '字体',\n fields: [\n {\n type: 'select',\n name: 'value',\n label: '字体',\n defaultValue: '',\n options: [\n { label: '跟随页面', value: '' },\n { label: '无衬线', value: 'sans-serif' },\n { label: '衬线', value: 'serif' },\n { label: '等宽', value: 'monospace' }\n ]\n }\n ]\n};\n\nexport const lineHeightPanel: PayloadPanelSchema = {\n id: 'line-height',\n title: '行高',\n fields: [\n {\n type: 'select',\n name: 'value',\n label: '行高',\n defaultValue: '1.7',\n options: [\n { label: '紧凑 1.4', value: '1.4' },\n { label: '常规 1.7', value: '1.7' },\n { label: '舒展 2', value: '2' }\n ]\n }\n ]\n};\n\n/**\n * 表格插入使用 number 字段收集行列。\n *\n * DOM 默认面板、H5 自绘和 RN/Flutter 原生表单都读取同一份 schema;真正的表格进阶操作\n * 仍放后续表格菜单阶段继续扩展。\n */\nexport const tableInsertPanel: PayloadPanelSchema = {\n id: 'table-insert',\n title: '插入表格',\n fields: [\n {\n type: 'number',\n name: 'rows',\n label: '行数',\n defaultValue: '3',\n min: 1,\n max: BRIDGERTE_TABLE_INSERT_MAX_ROWS,\n step: 1\n },\n {\n type: 'number',\n name: 'cols',\n label: '列数',\n defaultValue: '3',\n min: 1,\n max: BRIDGERTE_TABLE_INSERT_MAX_COLS,\n step: 1\n }\n ]\n};\n","import type { MenuItem } from './type';\r\n\r\n/*\r\n * 表格 header 和后续表格浮动菜单共用这组操作入口。\r\n * 这些菜单默认不进入 toolbar 排列,但仍放在 native-spec,保证 DOM/RN/Flutter 自绘读取同一份\r\n * command/label/icon 协议。\r\n */\r\nexport const tableHeaderMenuItems: MenuItem[] = [\r\n {\r\n id: 'table-insert-row-after',\r\n command: { type: 'table.insertRow', direction: 'after' },\r\n label: '插入行',\r\n icon: 'rows-plus'\r\n },\r\n {\r\n id: 'table-delete-row',\r\n command: { type: 'table.deleteRow' },\r\n label: '删除行',\r\n icon: 'rows-minus'\r\n },\r\n {\r\n id: 'table-insert-column-after',\r\n command: { type: 'table.insertColumn', direction: 'after' },\r\n label: '插入列',\r\n icon: 'columns-plus'\r\n },\r\n {\r\n id: 'table-delete-column',\r\n command: { type: 'table.deleteColumn' },\r\n label: '删除列',\r\n icon: 'columns-minus'\r\n },\r\n {\r\n id: 'table-delete',\r\n command: { type: 'table.delete' },\r\n label: '删除表格',\r\n icon: 'table-delete'\r\n }\r\n];\r\n","import type { MenuItem } from './type';\r\nimport {\r\n backgroundColorPanel,\r\n fontFamilyPanel,\r\n fontSizePanel,\r\n lineHeightPanel,\r\n tableInsertPanel,\r\n textColorPanel\r\n} from './payloadPanels';\r\nimport { tableHeaderMenuItems } from './tableHeaderMenuItems';\r\n\r\n/**\r\n * 默认菜单 schema 覆盖 wangEditor 常用入口。\r\n *\r\n * RN/Flutter 基于 id、icon、label 和 command 自绘菜单;显示分组和分割线由 toolbarConfig 决定。\n */\r\nexport const defaultMenuSchema: MenuItem[] = [\r\n {\r\n id: 'bold',\r\n command: { type: 'format.bold' },\r\n label: '加粗',\r\n icon: 'bold'\r\n },\r\n {\r\n id: 'italic',\r\n command: { type: 'format.italic' },\r\n label: '斜体',\r\n icon: 'italic'\r\n },\r\n {\r\n id: 'underline',\r\n command: { type: 'format.underline' },\r\n label: '下划线',\r\n icon: 'underline'\r\n },\r\n {\r\n id: 'strike',\r\n command: { type: 'format.strike' },\r\n label: '删除线',\r\n icon: 'strikethrough'\r\n },\r\n {\r\n id: 'inline-code',\r\n command: { type: 'format.inlineCode' },\r\n label: '行内代码',\r\n icon: 'code'\r\n },\r\n {\r\n id: 'superscript',\r\n command: { type: 'format.superscript' },\r\n label: '上标',\r\n icon: 'superscript'\r\n },\r\n {\r\n id: 'subscript',\r\n command: { type: 'format.subscript' },\r\n label: '下标',\r\n icon: 'subscript'\r\n },\r\n {\r\n id: 'clear-style',\r\n command: { type: 'format.clear' },\r\n label: '清除样式',\r\n icon: 'remove-formatting'\r\n },\r\n {\r\n id: 'color',\r\n command: { type: 'format.color', value: '' },\r\n label: '文字颜色',\r\n icon: 'palette',\r\n requiresPayload: true,\r\n payloadPanel: textColorPanel\r\n },\r\n {\r\n id: 'background-color',\r\n command: { type: 'format.backgroundColor', value: '' },\r\n label: '背景色',\r\n icon: 'paint-bucket',\r\n requiresPayload: true,\r\n payloadPanel: backgroundColorPanel\r\n },\r\n {\r\n id: 'font-size',\r\n command: { type: 'format.fontSize', value: '' },\r\n label: '字号',\r\n icon: 'case-sensitive',\r\n requiresPayload: true,\r\n payloadPanel: fontSizePanel\r\n },\r\n {\r\n id: 'font-family',\r\n command: { type: 'format.fontFamily', value: '' },\r\n label: '字体',\r\n icon: 'type',\r\n requiresPayload: true,\r\n payloadPanel: fontFamilyPanel\r\n },\r\n {\r\n id: 'line-height',\r\n command: { type: 'format.lineHeight', value: '' },\r\n label: '行高',\r\n icon: 'wrap-text',\r\n requiresPayload: true,\r\n payloadPanel: lineHeightPanel\r\n },\r\n {\r\n id: 'paragraph',\r\n command: { type: 'block.paragraph' },\r\n label: '正文',\r\n icon: 'pilcrow'\r\n },\r\n {\r\n id: 'heading-1',\r\n command: { type: 'block.heading', level: 1 },\r\n label: '一级标题',\r\n icon: 'heading-1'\r\n },\r\n {\r\n id: 'heading-2',\r\n command: { type: 'block.heading', level: 2 },\r\n label: '二级标题',\r\n icon: 'heading-2'\r\n },\r\n {\r\n id: 'heading-3',\r\n command: { type: 'block.heading', level: 3 },\r\n label: '三级标题',\r\n icon: 'heading-3'\r\n },\r\n {\r\n id: 'heading-4',\r\n command: { type: 'block.heading', level: 4 },\r\n label: '四级标题',\r\n icon: 'heading-4'\r\n },\r\n {\r\n id: 'heading-5',\r\n command: { type: 'block.heading', level: 5 },\r\n label: '五级标题',\r\n icon: 'heading-5'\r\n },\r\n {\r\n id: 'heading-6',\r\n command: { type: 'block.heading', level: 6 },\r\n label: '六级标题',\r\n icon: 'heading-6'\r\n },\r\n {\r\n id: 'quote',\r\n command: { type: 'block.quote' },\r\n label: '引用',\r\n icon: 'quote'\r\n },\r\n {\r\n id: 'divider',\r\n command: { type: 'block.divider' },\r\n label: '分割线',\r\n icon: 'minus'\r\n },\r\n {\r\n id: 'code-block',\r\n command: { type: 'block.code' },\r\n label: '代码块',\r\n icon: 'square-code'\r\n },\r\n {\r\n id: 'ordered-list',\r\n command: { type: 'list.ordered' },\r\n label: '有序列表',\r\n icon: 'list-ordered'\r\n },\r\n {\r\n id: 'unordered-list',\r\n command: { type: 'list.unordered' },\r\n label: '无序列表',\r\n icon: 'list'\r\n },\r\n {\r\n id: 'todo-list',\r\n command: { type: 'list.todo' },\r\n label: '待办列表',\r\n icon: 'list-todo'\r\n },\r\n {\r\n id: 'align-left',\r\n command: { type: 'align', value: 'left' },\r\n label: '左对齐',\r\n icon: 'align-left'\r\n },\r\n {\r\n id: 'align-center',\r\n command: { type: 'align', value: 'center' },\r\n label: '居中',\r\n icon: 'align-center'\r\n },\r\n {\r\n id: 'align-right',\r\n command: { type: 'align', value: 'right' },\r\n label: '右对齐',\r\n icon: 'align-right'\r\n },\r\n {\r\n id: 'align-justify',\r\n command: { type: 'align', value: 'justify' },\r\n label: '两端对齐',\r\n icon: 'align-justify'\r\n },\r\n {\r\n id: 'indent-increase',\r\n command: { type: 'indent.increase' },\r\n label: '增加缩进',\r\n icon: 'indent-increase'\r\n },\r\n {\r\n id: 'indent-decrease',\r\n command: { type: 'indent.decrease' },\r\n label: '减少缩进',\r\n icon: 'indent-decrease'\r\n },\r\n {\r\n id: 'mention',\r\n command: { type: 'mention.insert', item: { id: '', label: '', value: '' } },\r\n label: '@ 提及',\r\n icon: 'at-sign',\r\n requiresPayload: true\r\n },\r\n {\r\n id: 'upload-image',\r\n command: { type: 'media.pickImage' },\r\n label: '上传图片',\r\n icon: 'upload-image'\r\n },\r\n {\r\n id: 'upload-video',\r\n command: { type: 'media.pickVideo' },\r\n label: '上传视频',\r\n icon: 'upload-video'\r\n },\r\n {\r\n id: 'table',\r\n command: { type: 'table.insert', rows: 3, cols: 3 },\r\n label: '表格',\r\n icon: 'table',\r\n requiresPayload: true,\r\n payloadPanel: tableInsertPanel\r\n },\r\n ...tableHeaderMenuItems,\r\n {\r\n id: 'slash-command',\r\n command: { type: 'slash.open' },\r\n label: '/ 命令',\r\n icon: 'list-plus'\r\n },\r\n {\r\n id: 'undo',\r\n command: { type: 'history.undo' },\r\n label: '撤销',\r\n icon: 'undo'\r\n },\r\n {\r\n id: 'redo',\r\n command: { type: 'history.redo' },\r\n label: '重做',\r\n icon: 'redo'\r\n },\r\n {\r\n id: 'clear',\r\n command: { type: 'content.clear' },\r\n label: '清空',\r\n icon: 'trash-2'\r\n },\r\n {\r\n id: 'fullscreen',\r\n command: { type: 'fullscreen.toggle' },\r\n label: '全屏',\r\n icon: 'maximize'\r\n }\r\n];\r\n","import type { CommandState, EditorCommand } from '@bridgerte/core';\r\nimport type { MenuItem } from '../menuSchema';\r\nimport { defaultMenuSchema } from '../menuSchema';\r\n\r\nconst commandStateValueByType: Partial<Record<EditorCommand['type'], (command: EditorCommand) => (\r\n CommandState['value'] | undefined\r\n)>> = {\r\n align: (command) => command.type === 'align' ? command.value : undefined,\r\n 'block.heading': (command) => command.type === 'block.heading' ? command.level : undefined,\r\n 'block.setCodeLanguage': (command) => (\r\n command.type === 'block.setCodeLanguage' ? command.language : undefined\r\n )\r\n};\r\n\r\n/**\r\n * 取出菜单命令用于匹配 `CommandState.value` 的稳定值。\r\n *\r\n * 同类命令存在多个菜单项时使用这个值区分,比如对齐方式和标题级别。\r\n */\r\nexport const getCommandStateMatchValue = (\r\n command: EditorCommand\r\n): CommandState['value'] | undefined => commandStateValueByType[command.type]?.(command);\r\n\r\n/**\r\n * 判断某条命令状态是否对应一个完整命令 payload。\r\n */\r\nexport const isCommandStateForCommand = (\r\n command: EditorCommand,\r\n state: CommandState\r\n): boolean => {\r\n const matchValue = getCommandStateMatchValue(command);\r\n\r\n return state.command === command.type\r\n && (matchValue === undefined || state.value === matchValue);\r\n};\r\n\r\n/**\r\n * 判断某条命令状态是否对应一个菜单项。\r\n *\r\n * 原生 toolbar 可以用它把 `CommandState[]` 映射回具体按钮 active/disabled 状态。\r\n */\r\nexport const isMenuItemCommandState = (item: MenuItem, state: CommandState): boolean => (\r\n isCommandStateForCommand(item.command, state)\r\n);\r\n\r\n/**\r\n * 为给定菜单生成默认禁用状态。\r\n *\r\n * 编辑器未 ready 或无选区时,原生 toolbar 可以先使用这组状态兜底。\r\n */\r\nexport function createDisabledCommandStates(menuSchema = defaultMenuSchema): CommandState[] {\r\n return menuSchema.map((item) => ({\r\n command: item.command.type,\r\n active: false,\r\n disabled: true,\r\n value: getCommandStateMatchValue(item.command)\r\n }));\r\n}\r\n","import type { ToolbarConfig, ToolbarGroupConfig, ToolbarKey } from '@bridgerte/core';\r\nimport type { MenuItem } from '../menuSchema';\r\nimport { defaultMenuSchema } from '../menuSchema';\r\nimport type { ResolvedToolbarItem } from './type';\r\n\r\nexport type * from './type';\r\n\r\n/**\r\n * 默认 DOM toolbar 配置。\r\n *\r\n * 这里只选择已实现或带参数面板的基础按钮;完整菜单全集仍由 `defaultMenuSchema` 维护。\r\n */\r\nexport const defaultToolbarConfig: ToolbarConfig = {\r\n toolbarKeys: [\r\n 'undo',\r\n 'redo',\r\n 'clear',\r\n '|',\r\n 'paragraph',\r\n 'heading-1',\r\n 'heading-2',\r\n 'heading-3',\r\n 'heading-4',\r\n 'heading-5',\r\n 'heading-6',\r\n 'quote',\r\n 'divider',\r\n 'code-block',\r\n '|',\r\n 'bold',\r\n 'italic',\r\n 'underline',\r\n 'strike',\r\n 'inline-code',\r\n 'superscript',\r\n 'subscript',\r\n 'clear-style',\r\n 'color',\r\n 'background-color',\r\n 'font-size',\r\n 'font-family',\r\n 'line-height',\r\n '|',\r\n 'ordered-list',\n 'unordered-list',\n 'todo-list',\n '|',\n 'upload-image',\n 'upload-video',\n '|',\n 'table',\n '|',\n 'align-left',\r\n 'align-center',\r\n 'align-right',\r\n 'align-justify',\r\n 'indent-increase',\r\n 'indent-decrease',\r\n '|',\r\n 'fullscreen'\r\n ]\r\n};\r\n\r\nconst isToolbarGroupConfig = (key: ToolbarKey): key is ToolbarGroupConfig => (\r\n typeof key === 'object' && Array.isArray(key.menuKeys)\r\n);\r\n\r\nconst createMenuMap = (menuSchema: MenuItem[]) => new Map(\r\n menuSchema.map((item) => [item.id, item])\r\n);\r\n\r\nconst shouldExcludeToolbarKey = (\r\n key: ToolbarKey,\r\n excludeKeys: Set<string>\r\n) => {\r\n if (typeof key === 'string') return key !== '|' && excludeKeys.has(key);\r\n\r\n return excludeKeys.has(key.key) || key.menuKeys.every((menuKey) => excludeKeys.has(menuKey));\r\n};\r\n\r\nconst applyToolbarConfigOverrides = (\r\n baseKeys: ToolbarKey[],\r\n toolbarConfig?: ToolbarConfig\r\n): ToolbarKey[] => {\r\n const excludeKeys = new Set(toolbarConfig?.excludeKeys ?? []);\r\n /*\r\n * 先排除再插入,等价于“在用户最终想保留的默认菜单里加东西”。\r\n * insert index 做夹取,避免业务传入负数或超长下标时破坏默认 toolbar。\r\n */\r\n const filteredKeys = baseKeys.filter((key) => !shouldExcludeToolbarKey(key, excludeKeys));\r\n\r\n if (!toolbarConfig?.insertKeys) return filteredKeys;\r\n\r\n const insertIndex = Math.max(0, Math.min(toolbarConfig.insertKeys.index, filteredKeys.length));\r\n\r\n return [\r\n ...filteredKeys.slice(0, insertIndex),\r\n ...toolbarConfig.insertKeys.keys,\r\n ...filteredKeys.slice(insertIndex)\r\n ];\r\n};\r\n\r\nconst resolveToolbarKey = (\r\n key: ToolbarKey,\r\n menuMap: Map<string, MenuItem>,\r\n excludeKeys: Set<string>,\r\n separatorIndex: number\r\n): ResolvedToolbarItem[] => {\r\n if (key === '|') {\r\n return [{ type: 'separator', key: `separator-${separatorIndex}` }];\r\n }\r\n\r\n if (typeof key === 'string') {\r\n const item = menuMap.get(key);\r\n\r\n // 未知 key 直接忽略;需要 payload 但没有 panel 的菜单暂不渲染,避免按钮点击后无法生成合法命令。\r\n if (!item || (item.requiresPayload && !item.payloadPanel) || excludeKeys.has(item.id)) {\r\n return [];\r\n }\r\n\r\n return [{ type: 'button', item }];\r\n }\r\n\r\n if (isToolbarGroupConfig(key)) {\r\n const items = key.menuKeys\r\n .filter((menuKey) => !excludeKeys.has(menuKey))\r\n .map((menuKey) => menuMap.get(menuKey))\r\n .filter((item): item is MenuItem => (\r\n item !== undefined && (!item.requiresPayload || item.payloadPanel !== undefined)\r\n ));\r\n\r\n return items.length > 0 ? [{\r\n type: 'group',\r\n key: key.key,\r\n title: key.title,\r\n icon: key.icon,\r\n items\r\n }] : [];\r\n }\r\n\r\n return [];\r\n};\r\n\r\nconst shouldKeepResolvedToolbarItem = (\r\n item: ResolvedToolbarItem,\r\n items: ResolvedToolbarItem[]\r\n) => {\r\n if (item.type !== 'separator') return true;\r\n\r\n const previousItem = items[items.length - 1];\r\n\r\n return previousItem !== undefined && previousItem.type !== 'separator';\r\n};\r\n\r\nconst trimTrailingToolbarSeparators = (items: ResolvedToolbarItem[]) => {\r\n while (items.at(-1)?.type === 'separator') {\r\n items.pop();\r\n }\r\n\r\n return items;\r\n};\r\n\r\n/**\r\n * 把 wangEditor 风格的 JSON 配置解析成 DOM/RN/Flutter 都能消费的菜单结构。\r\n *\r\n * 未知 key 和缺少 payloadPanel 的 requiresPayload 菜单会被忽略,避免默认 toolbar 渲染无法处理的按钮。\r\n * 分割线会自动去掉开头、结尾和连续项,避免被跳过的菜单留下空分隔。\r\n */\r\nexport const resolveToolbarMenu = (\r\n toolbarConfig: ToolbarConfig = defaultToolbarConfig,\r\n menuSchema: MenuItem[] = defaultMenuSchema\r\n): ResolvedToolbarItem[] => {\r\n const menuMap = createMenuMap(menuSchema);\r\n const baseKeys = toolbarConfig.toolbarKeys ?? defaultToolbarConfig.toolbarKeys ?? [];\r\n const toolbarKeys = applyToolbarConfigOverrides(baseKeys, toolbarConfig);\r\n const excludeKeys = new Set(toolbarConfig.excludeKeys ?? []);\r\n let separatorIndex = 0;\r\n\r\n const resolvedItems = toolbarKeys.reduce<ResolvedToolbarItem[]>((items, key) => {\r\n const nextItems = resolveToolbarKey(key, menuMap, excludeKeys, separatorIndex);\r\n\r\n if (key === '|') separatorIndex += 1;\r\n\r\n nextItems.forEach((item) => {\r\n if (shouldKeepResolvedToolbarItem(item, items)) {\r\n items.push(item);\r\n }\r\n });\r\n\r\n return items;\r\n }, []);\r\n\r\n return trimTrailingToolbarSeparators(resolvedItems);\r\n};\r\n"],"names":["codeBlockLanguagePanel","codeBlockLanguagePayloadPanel","textColorPanel","backgroundColorPanel","fontSizePanel","fontFamilyPanel","lineHeightPanel","tableInsertPanel","BRIDGERTE_TABLE_INSERT_MAX_ROWS","BRIDGERTE_TABLE_INSERT_MAX_COLS","tableHeaderMenuItems","defaultMenuSchema","commandStateValueByType","command","getCommandStateMatchValue","_a","isCommandStateForCommand","state","matchValue","isMenuItemCommandState","item","createDisabledCommandStates","menuSchema","defaultToolbarConfig","isToolbarGroupConfig","key","createMenuMap","shouldExcludeToolbarKey","excludeKeys","menuKey","applyToolbarConfigOverrides","baseKeys","toolbarConfig","filteredKeys","insertIndex","resolveToolbarKey","menuMap","separatorIndex","items","shouldKeepResolvedToolbarItem","previousItem","trimTrailingToolbarSeparators","resolveToolbarMenu","toolbarKeys","resolvedItems","nextItems"],"mappings":"wHAYaA,EAA6C,CACxD,GAAI,sBACJ,MAAO,OACP,OAAQ,CACN,CACE,KAAM,SACN,KAAM,WACN,MAAO,KACP,aAAc,GACd,QAAS,CACP,CAAE,MAAO,MAAO,MAAO,EAAA,EACvB,CAAE,MAAO,OAAQ,MAAO,aAAA,EACxB,CAAE,MAAO,IAAK,MAAO,GAAA,EACrB,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,KAAM,MAAO,QAAA,EACtB,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,aAAc,MAAO,QAAA,EAC9B,CAAE,MAAO,KAAM,MAAO,IAAA,EACtB,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,aAAc,MAAO,YAAA,EAC9B,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,SAAU,MAAO,QAAA,EAC1B,CAAE,MAAO,WAAY,MAAO,UAAA,EAC5B,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,SAAU,MAAO,QAAA,EAC1B,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,QAAS,MAAO,OAAA,EACzB,CAAE,MAAO,OAAQ,MAAO,MAAA,EACxB,CAAE,MAAO,MAAO,MAAO,KAAA,EACvB,CAAE,MAAO,aAAc,MAAO,YAAA,EAC9B,CAAE,MAA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OAAIZ,IAAQ,MAAKY,GAAkB,GAEnCQ,EAAU,QAASzB,GAAS,CACtBmB,EAA8BnB,EAAMkB,CAAK,GAC3CA,EAAM,KAAKlB,CAAI,CAEnB,CAAC,EAEMkB,CACT,EAAG,CAAA,CAAE,EAEL,OAAOG,EAA8BG,CAAa,CACpD"}
@@ -182,7 +182,7 @@ export type ToolbarGroupConfig = {
182
182
  /**
183
183
  * toolbar JSON 配置项。
184
184
  *
185
- * 字符串使用 `MenuItem.id`;特殊字符串 `|` 表示分割线,视觉保持和默认 group 分隔一致。
185
+ * 字符串使用 `MenuItem.id`;特殊字符串 `|` 表示分割线,收纳菜单用对象配置显式声明。
186
186
  */
187
187
  export type ToolbarKey = string | ToolbarGroupConfig;
188
188
  /**
@@ -513,7 +513,6 @@ export type SlashCommandItem = {
513
513
  icon?: string;
514
514
  description?: string;
515
515
  keywords?: string[];
516
- group?: string;
517
516
  requiresPayload?: boolean;
518
517
  payloadPanel?: PayloadPanelSchema;
519
518
  };
@@ -579,7 +578,6 @@ export type MenuItem = {
579
578
  command: EditorCommand;
580
579
  label: string;
581
580
  icon: string;
582
- group: 'text' | 'style' | 'block' | 'list' | 'align' | 'insert' | 'media' | 'table' | 'history' | 'view';
583
581
  requiresPayload?: boolean;
584
582
  payloadPanel?: PayloadPanelSchema;
585
583
  children?: MenuItem[];