bridgerte 0.9.0

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/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import { B as o, a as t, b as r } from "./index-CuNKUHed.js";
2
+ import { BRIDGE_CONTENT_CHANGE_DEBOUNCE_MS as m, BRIDGE_HEIGHT_CHANGE_THROTTLE_MS as T, defaultBridgeEventTiming as d, isBridgeMessage as l } from "./bridge.js";
3
+ import { codeBlockLanguagePanel as _, codeBlockLanguagePayloadPanel as s, createDisabledCommandStates as i, defaultMenuSchema as R, defaultToolbarConfig as c, getCommandStateMatchValue as B, isCommandStateForCommand as S, isMenuItemCommandState as g, resolveToolbarMenu as C, tableHeaderMenuItems as u } from "./native-spec.js";
4
+ import { c as M, a as N, b as f, d as b } from "./index-C7IVE5Bd.js";
5
+ import { resolvePayloadPanelSchema as x } from "./core.js";
6
+ export {
7
+ o as BRIDGERTE_CONTENT_VERSION,
8
+ t as BRIDGERTE_TABLE_INSERT_MAX_COLS,
9
+ r as BRIDGERTE_TABLE_INSERT_MAX_ROWS,
10
+ m as BRIDGE_CONTENT_CHANGE_DEBOUNCE_MS,
11
+ T as BRIDGE_HEIGHT_CHANGE_THROTTLE_MS,
12
+ _ as codeBlockLanguagePanel,
13
+ s as codeBlockLanguagePayloadPanel,
14
+ i as createDisabledCommandStates,
15
+ M as createFloatingLayer,
16
+ N as createRichTextEditor,
17
+ f as createRichTextToolbar,
18
+ b as createWebViewBridgeRuntime,
19
+ d as defaultBridgeEventTiming,
20
+ R as defaultMenuSchema,
21
+ c as defaultToolbarConfig,
22
+ B as getCommandStateMatchValue,
23
+ l as isBridgeMessage,
24
+ S as isCommandStateForCommand,
25
+ g as isMenuItemCommandState,
26
+ x as resolvePayloadPanelSchema,
27
+ C as resolveToolbarMenu,
28
+ u as tableHeaderMenuItems
29
+ };
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-GaS65GL0.cjs"),g={id:"code-block-language",title:"代码语言",fields:[{type:"select",name:"language",label:"语言",defaultValue:"",options:[{label:"纯文本",value:""},{label:"C",value:"c"},{label:"C-like",value:"clike"},{label:"C++",value:"cpp"},{label:"CSS",value:"css"},{label:"HTML",value:"html"},{label:"Java",value:"java"},{label:"JavaScript",value:"javascript"},{label:"JSON",value:"json"},{label:"Markdown",value:"markdown"},{label:"Objective-C",value:"objc"},{label:"PowerShell",value:"powershell"},{label:"Python",value:"python"},{label:"Rust",value:"rust"},{label:"SQL",value:"sql"},{label:"Swift",value:"swift"},{label:"TypeScript",value:"typescript"},{label:"XML",value:"xml"}]}]},k=g,x={id:"text-color",title:"文字颜色",fields:[{type:"color",name:"value",label:"颜色"}]},P={id:"background-color",title:"背景色",fields:[{type:"color",name:"value",label:"背景"}]},S={id:"font-size",title:"字号",fields:[{type:"select",name:"value",label:"字号",defaultValue:"16px",options:[{label:"小号 14px",value:"14px"},{label:"正文 16px",value:"16px"},{label:"强调 18px",value:"18px"},{label:"标题 20px",value:"20px"},{label:"大标题 24px",value:"24px"}]}]},w={id:"font-family",title:"字体",fields:[{type:"select",name:"value",label:"字体",defaultValue:"",options:[{label:"跟随页面",value:""},{label:"无衬线",value:"sans-serif"},{label:"衬线",value:"serif"},{label:"等宽",value:"monospace"}]}]},M={id:"line-height",title:"行高",fields:[{type:"select",name:"value",label:"行高",defaultValue:"1.7",options:[{label:"紧凑 1.4",value:"1.4"},{label:"常规 1.7",value:"1.7"},{label:"舒展 2",value:"2"}]}]},T={id:"table-insert",title:"插入表格",fields:[{type:"number",name:"rows",label:"行数",defaultValue:"3",min:1,max:b.BRIDGERTE_TABLE_INSERT_MAX_ROWS,step:1},{type:"number",name:"cols",label:"列数",defaultValue:"3",min:1,max:b.BRIDGERTE_TABLE_INSERT_MAX_COLS,step:1}]},y=[{id:"table-insert-row-after",command:{type:"table.insertRow",direction:"after"},label:"插入行",icon:"rows-plus",group:"table"},{id:"table-delete-row",command:{type:"table.deleteRow"},label:"删除行",icon:"rows-minus",group:"table"},{id:"table-insert-column-after",command:{type:"table.insertColumn",direction:"after"},label:"插入列",icon:"columns-plus",group:"table"},{id:"table-delete-column",command:{type:"table.deleteColumn"},label:"删除列",icon:"columns-minus",group:"table"},{id:"table-delete",command:{type:"table.delete"},label:"删除表格",icon:"table-delete",group:"table"}],c=[{id:"bold",command:{type:"format.bold"},label:"加粗",icon:"bold",group:"text"},{id:"italic",command:{type:"format.italic"},label:"斜体",icon:"italic",group:"text"},{id:"underline",command:{type:"format.underline"},label:"下划线",icon:"underline",group:"text"},{id:"strike",command:{type:"format.strike"},label:"删除线",icon:"strikethrough",group:"text"},{id:"inline-code",command:{type:"format.inlineCode"},label:"行内代码",icon:"code",group:"text"},{id:"superscript",command:{type:"format.superscript"},label:"上标",icon:"superscript",group:"text"},{id:"subscript",command:{type:"format.subscript"},label:"下标",icon:"subscript",group:"text"},{id:"clear-style",command:{type:"format.clear"},label:"清除样式",icon:"remove-formatting",group:"text"},{id:"color",command:{type:"format.color",value:""},label:"文字颜色",icon:"palette",group:"style",requiresPayload:!0,payloadPanel:x},{id:"background-color",command:{type:"format.backgroundColor",value:""},label:"背景色",icon:"paint-bucket",group:"style",requiresPayload:!0,payloadPanel:P},{id:"font-size",command:{type:"format.fontSize",value:""},label:"字号",icon:"case-sensitive",group:"style",requiresPayload:!0,payloadPanel:S},{id:"font-family",command:{type:"format.fontFamily",value:""},label:"字体",icon:"type",group:"style",requiresPayload:!0,payloadPanel:w},{id:"line-height",command:{type:"format.lineHeight",value:""},label:"行高",icon:"wrap-text",group:"style",requiresPayload:!0,payloadPanel:M},{id:"paragraph",command:{type:"block.paragraph"},label:"正文",icon:"pilcrow",group:"block"},{id:"heading-1",command:{type:"block.heading",level:1},label:"一级标题",icon:"heading-1",group:"block"},{id:"heading-2",command:{type:"block.heading",level:2},label:"二级标题",icon:"heading-2",group:"block"},{id:"heading-3",command:{type:"block.heading",level:3},label:"三级标题",icon:"heading-3",group:"block"},{id:"heading-4",command:{type:"block.heading",level:4},label:"四级标题",icon:"heading-4",group:"block"},{id:"heading-5",command:{type:"block.heading",level:5},label:"五级标题",icon:"heading-5",group:"block"},{id:"heading-6",command:{type:"block.heading",level:6},label:"六级标题",icon:"heading-6",group:"block"},{id:"quote",command:{type:"block.quote"},label:"引用",icon:"quote",group:"block"},{id:"divider",command:{type:"block.divider"},label:"分割线",icon:"minus",group:"block"},{id:"code-block",command:{type:"block.code"},label:"代码块",icon:"square-code",group:"block"},{id:"ordered-list",command:{type:"list.ordered"},label:"有序列表",icon:"list-ordered",group:"list"},{id:"unordered-list",command:{type:"list.unordered"},label:"无序列表",icon:"list",group:"list"},{id:"todo-list",command:{type:"list.todo"},label:"待办列表",icon:"list-todo",group:"list"},{id:"align-left",command:{type:"align",value:"left"},label:"左对齐",icon:"align-left",group:"align"},{id:"align-center",command:{type:"align",value:"center"},label:"居中",icon:"align-center",group:"align"},{id:"align-right",command:{type:"align",value:"right"},label:"右对齐",icon:"align-right",group:"align"},{id:"align-justify",command:{type:"align",value:"justify"},label:"两端对齐",icon:"align-justify",group:"align"},{id:"indent-increase",command:{type:"indent.increase"},label:"增加缩进",icon:"indent-increase",group:"align"},{id:"indent-decrease",command:{type:"indent.decrease"},label:"减少缩进",icon:"indent-decrease",group:"align"},{id:"mention",command:{type:"mention.insert",item:{id:"",label:"",value:""}},label:"@ 提及",icon:"at-sign",group:"insert",requiresPayload:!0},{id:"upload-image",command:{type:"media.pickImage"},label:"上传图片",icon:"upload-image",group:"media"},{id:"upload-video",command:{type:"media.pickVideo"},label:"上传视频",icon:"upload-video",group:"media"},{id:"table",command:{type:"table.insert",rows:3,cols:3},label:"表格",icon:"table",group:"table",requiresPayload:!0,payloadPanel:T},...y,{id:"slash-command",command:{type:"slash.open"},label:"/ 命令",icon:"list-plus",group:"insert"},{id:"undo",command:{type:"history.undo"},label:"撤销",icon:"undo",group:"history"},{id:"redo",command:{type:"history.redo"},label:"重做",icon:"redo",group:"history"},{id:"clear",command:{type:"content.clear"},label:"清空",icon:"trash-2",group:"history"},{id:"fullscreen",command:{type:"fullscreen.toggle"},label:"全屏",icon:"maximize",group:"view"}],r={align:e=>e.type==="align"?e.value:void 0,"block.heading":e=>e.type==="block.heading"?e.level:void 0,"block.setCodeLanguage":e=>e.type==="block.setCodeLanguage"?e.language:void 0},u=e=>{var l;return(l=r[e.type])==null?void 0:l.call(r,e)},v=(e,l)=>{const a=u(e);return l.command===e.type&&(a===void 0||l.value===a)},q=(e,l)=>v(e.command,l);function I(e=c){return e.map(l=>({command:l.command.type,active:!1,disabled:!0,value:u(l.command)}))}const d={toolbarKeys:["undo","redo","clear","|","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","quote","divider","code-block","|","bold","italic","underline","strike","inline-code","superscript","subscript","clear-style","color","background-color","font-size","font-family","line-height","|","ordered-list","unordered-list","todo-list","|","upload-image","upload-video","|","table","|","align-left","align-center","align-right","align-justify","indent-increase","indent-decrease","|","fullscreen"]},K=e=>typeof e=="object"&&Array.isArray(e.menuKeys),C=e=>new Map(e.map(l=>[l.id,l])),L=(e,l)=>typeof e=="string"?e!=="|"&&l.has(e):l.has(e.key)||e.menuKeys.every(a=>l.has(a)),j=(e,l)=>{const a=new Set((l==null?void 0:l.excludeKeys)??[]),n=e.filter(o=>!L(o,a));if(!(l!=null&&l.insertKeys))return n;const t=Math.max(0,Math.min(l.insertKeys.index,n.length));return[...n.slice(0,t),...l.insertKeys.keys,...n.slice(t)]},R=(e,l,a,n)=>{if(e==="|")return[{type:"separator",key:`separator-${n}`}];if(typeof e=="string"){const t=l.get(e);return!t||t.requiresPayload&&!t.payloadPanel||a.has(t.id)?[]:[{type:"button",item:t}]}if(K(e)){const t=e.menuKeys.filter(o=>!a.has(o)).map(o=>l.get(o)).filter(o=>o!==void 0&&(!o.requiresPayload||o.payloadPanel!==void 0));return t.length>0?[{type:"group",key:e.key,title:e.title,icon:e.icon,items:t}]:[]}return[]},E=(e,l)=>{if(e.type!=="separator")return!0;const a=l[l.length-1];return a!==void 0&&a.type!=="separator"},V=e=>{var l;for(;((l=e.at(-1))==null?void 0:l.type)==="separator";)e.pop();return e},_=(e=d,l=c)=>{const a=C(l),n=e.toolbarKeys??d.toolbarKeys??[],t=j(n,e),o=new Set(e.excludeKeys??[]);let s=0;const h=t.reduce((i,p)=>{const f=R(p,a,o,s);return p==="|"&&(s+=1),f.forEach(m=>{E(m,i)&&i.push(m)}),i},[]);return V(h)};exports.codeBlockLanguagePanel=g;exports.codeBlockLanguagePayloadPanel=k;exports.createDisabledCommandStates=I;exports.defaultMenuSchema=c;exports.defaultToolbarConfig=d;exports.getCommandStateMatchValue=u;exports.isCommandStateForCommand=v;exports.isMenuItemCommandState=q;exports.resolveToolbarMenu=_;exports.tableHeaderMenuItems=y;
2
+ //# sourceMappingURL=native-spec.cjs.map
@@ -0,0 +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 * 空字符串表示纯文本;默认候选覆盖 Lexical Prism tokenizer 当前内置语言,并保留\n * JSON 这个高频实用项。业务如需裁剪语言、调整顺序或接入更多 Prism 语言,传入\n * 自己的 `codeBlockLanguagePanel` 即可,不需要改 DOM 内置语言菜单。\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: 'C', value: 'c' },\n { label: 'C-like', value: 'clike' },\n { label: 'C++', value: 'cpp' },\n { label: 'CSS', value: 'css' },\n { label: 'HTML', value: 'html' },\n { label: 'Java', value: 'java' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'JSON', value: 'json' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'Objective-C', value: 'objc' },\n { label: 'PowerShell', value: 'powershell' },\n { label: 'Python', value: 'python' },\n { label: 'Rust', value: 'rust' },\n { label: 'SQL', value: 'sql' },\n { label: 'Swift', value: 'swift' },\n { label: 'TypeScript', value: 'typescript' },\n { label: 'XML', value: 'xml' }\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":"wHAaaA,EAA6C,CACxD,GAAI,sBACJ,MAAO,OACP,OAAQ,CACN,CACE,KAAM,SACN,KAAM,WACN,MAAO,KACP,aAAc,GACd,QAAS,CACP,CAAE,MAAO,MAAO,MAAO,EA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