koishi-plugin-filter-pro 1.0.14 → 1.0.16
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 +1 -1
- package/dist/style.css +111 -36
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{icons as e,message as t,send as n}from"@koishijs/client";import{Fragment as r,Teleport as i,computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createElementVNode as l,createTextVNode as u,createVNode as d,defineComponent as f,normalizeClass as p,normalizeStyle as m,onBeforeUnmount as h,onMounted as g,openBlock as _,ref as v,renderList as y,resolveComponent as b,toDisplayString as x,vModelText as S,watch as C,withCtx as w,withDirectives as T}from"vue";const E=[`disabled`],D={class:`label`},O=[`onClick`];var k=f({__name:`fp-select`,props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},placeholder:{type:String,required:!1},disabled:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,u=t,d=v(null),f=v(!1),b=v({left:0,top:0,width:0}),S=a(()=>n.options.find(e=>e.value===n.modelValue)?.label||``);function w(){n.disabled||(f.value=!f.value,f.value&&A())}function T(e){u(`update:modelValue`,e),f.value=!1}function k(e){let t=e.target;!d.value||!t||d.value.contains(t)||(f.value=!1)}function A(){if(!d.value)return;let e=d.value.getBoundingClientRect(),t=window.innerHeight-e.bottom-6,n=e.top-6,r=t<180&&n>t,i=Math.min(240,r?n:t);b.value={left:e.left,width:e.width,top:r?Math.max(8,e.top-Math.max(120,i)-6):e.bottom+6}}function j(){f.value&&A()}return C(f,e=>{e&&A()}),g(()=>{document.addEventListener(`click`,k),window.addEventListener(`resize`,j),window.addEventListener(`scroll`,j,!0)}),h(()=>{document.removeEventListener(`click`,k),window.removeEventListener(`resize`,j),window.removeEventListener(`scroll`,j,!0)}),(t,n)=>(_(),c(r,null,[l(`div`,{class:`fp-select`,ref_key:`root`,ref:d},[l(`button`,{type:`button`,class:p([`trigger`,{disabled:e.disabled}]),onClick:w,disabled:e.disabled},[l(`span`,D,x(S.value||e.placeholder),1),n[0]||=l(`span`,{class:`arrow`},`▾`,-1)],10,E)],512),(_(),o(i,{to:`body`},[f.value?(_(),c(`div`,{key:0,class:`menu`,style:m({left:`${b.value.left}px`,top:`${b.value.top}px`,width:`${b.value.width}px`})},[(_(!0),c(r,null,y(e.options,t=>(_(),c(`button`,{key:t.value,type:`button`,class:p([`item`,{active:t.value===e.modelValue}]),onClick:e=>T(t.value)},x(t.label),11,O))),128))],4)):s(`v-if`,!0)]))],64))}}),A=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},j=A(k,[[`__scopeId`,`data-v-4a262c3e`]]);const M={class:`cf-editor`},N={class:`rows-section`},P={key:0,class:`connector-sep`},F=[`title`,`onClick`],I={class:`cf-row`},L=[`onUpdate:modelValue`],R={key:1,class:`bool-toggle`},z=[`checked`,`onChange`],ee={class:`bool-label`},B=[`onUpdate:modelValue`,`onInput`],te=[`disabled`,`onClick`],ne={class:`add-section`},re={class:`preview-section`},ie={class:`preview-code`};var V=A(f({name:`ExprEditor`,__name:`expr-editor`,props:{modelValue:{type:Object,required:!0}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=0,i=()=>String(++n),f=[{value:`guildId`,label:`群组 ID(guildId)`},{value:`channelId`,label:`频道 ID(channelId)`},{value:`userId`,label:`用户 ID(userId)`},{value:`platform`,label:`平台(platform)`},{value:`content`,label:`消息内容(content)`},{value:`isDirect`,label:`私聊(isDirect)`},{value:`type`,label:`消息类型(type)`}],m=[...f,{value:`__custom__`,label:`自定义字段...`}],h=[{value:`eq`,label:`等于`},{value:`ne`,label:`不等于`},{value:`includes`,label:`包含`},{value:`regex`,label:`正则匹配`},{value:`gt`,label:`大于`},{value:`gte`,label:`大于等于`},{value:`lt`,label:`小于`},{value:`lte`,label:`小于等于`},{value:`exists`,label:`存在`}],g=[{value:`eq`,label:`等于`},{value:`ne`,label:`不等于`},{value:`exists`,label:`存在`}],E={eq:`eq`,ne:`ne`,includes:`contains`,regex:`matches`,gt:`gt`,gte:`gte`,lt:`lt`,lte:`lte`,exists:`exists`},D=e,O=t,k=v(U(D.modelValue)),A=JSON.stringify(D.modelValue);C(()=>D.modelValue,e=>{let t=JSON.stringify(e);t!==A&&(A=t,k.value=U(e))},{deep:!0});function V(e,t=`guildId`){let n=t===`isDirect`;return{id:i(),field:t,customField:``,operator:`eq`,valueText:n?`false`:``,value:n?!1:``,connector:e}}function H(e,t){let n=f.some(t=>t.value===e.field),r=n?e.field:`__custom__`,a=r===`isDirect`?!1:``,o=e.value??a;return{id:i(),field:r,customField:n?``:e.field,operator:e.operator,valueText:o==null?``:String(o),value:o,connector:t}}function U(e){if(!e)return[V(null)];if(e.type===`compare`)return[H(e,null)];if(e.type===`group`){if(e.children.every(e=>e.type===`compare`))return e.children.map((t,n)=>H(t,n===0?null:e.operator));if(e.operator===`or`){let t=[],n=!0;for(let r of e.children)r.type===`compare`?(t.push(H(r,n?null:`or`)),n=!1):r.type===`group`&&r.operator===`and`&&r.children.forEach((e,r)=>{e.type===`compare`&&(t.push(H(e,n?null:r===0?`or`:`and`)),n=!1)});if(t.length>0)return t}}return[V(null)]}function W(e){return{type:`compare`,field:e.field===`__custom__`?(e.customField||``).trim()||`guildId`:e.field,operator:e.operator,value:e.operator===`exists`?void 0:e.value}}function G(e){if(e.length===0)return{type:`compare`,field:`guildId`,operator:`eq`,value:``};if(e.length===1)return W(e[0]);let t=[],n=[e[0]];for(let r=1;r<e.length;r++)e[r].connector===`or`?(t.push(n),n=[e[r]]):n.push(e[r]);t.push(n);let r=t.map(e=>e.length===1?W(e[0]):{type:`group`,operator:`and`,children:e.map(W)});return r.length===1?r[0]:{type:`group`,operator:`or`,children:r}}function K(e){if(e.type===`compare`){let t=E[e.operator]||e.operator,n=e.value===void 0?``:JSON.stringify(e.value);return`(${e.field} ${t} ${n})`}if(e.type===`group`){let t=e.operator===`and`?` AND `:` OR `;return e.children.map(K).join(t)}return e.type===`not`?`NOT (${K(e.child)})`:``}let q=a(()=>K(G(k.value)));function J(){let e=G(k.value);A=JSON.stringify(e),O(`update:modelValue`,e)}function Y(e){k.value.push(V(e??`and`)),J()}function X(e){k.value.length<=1||(k.value.splice(e,1),e===0&&(k.value[0].connector=null),J())}function Z(e){e<=0||(k.value[e].connector=k.value[e].connector===`or`?`and`:`or`,J())}function Q(e){let t=e.trim();if(!t)return``;if(t===`true`)return!0;if(t===`false`)return!1;if(t===`null`)return null;let n=Number(t);return Number.isFinite(n)?n:e}return(e,t)=>{let n=b(`k-button`);return _(),c(`div`,M,[s(` 条件行 `),l(`div`,N,[(_(!0),c(r,null,y(k.value,(e,t)=>(_(),c(r,{key:e.id},[s(` 连接符(第一行之后显示) `),t>0?(_(),c(`div`,P,[l(`button`,{class:p([`connector-toggle`,`conn-`+e.connector]),title:`点击切换为`+(e.connector===`or`?`且(AND)`:`或(OR)`),onClick:e=>Z(t)},x(e.connector===`or`?`或(OR)`:`且(AND)`),11,F)])):s(`v-if`,!0),s(` 条件行 `),l(`div`,I,[d(j,{"model-value":e.field,options:m,class:`sel-field`,"onUpdate:modelValue":t=>{let n=e.field===`isDirect`;e.field=t,t===`isDirect`?(e.value=!1,e.valueText=`false`,[`eq`,`ne`,`exists`].includes(e.operator)||(e.operator=`eq`)):n&&(e.value=``,e.valueText=``),J()}},null,8,[`model-value`,`onUpdate:modelValue`]),e.field===`__custom__`?T((_(),c(`input`,{key:0,class:`input custom-input`,"onUpdate:modelValue":t=>e.customField=t,onInput:J,placeholder:`字段路径,如 author.name`},null,40,L)),[[S,e.customField]]):s(`v-if`,!0),d(j,{"model-value":e.operator,options:e.field===`isDirect`?g:h,class:`sel-op`,"onUpdate:modelValue":t=>{e.operator=t,J()}},null,8,[`model-value`,`options`,`onUpdate:modelValue`]),s(` isDirect:开关 `),e.field===`isDirect`&&e.operator!==`exists`?(_(),c(`label`,R,[l(`input`,{type:`checkbox`,checked:e.value===!0,onChange:t=>{e.value=t.target.checked,e.valueText=String(e.value),J()}},null,40,z),l(`span`,ee,x(e.value===!0?`是(true)`:`否(false)`),1)])):e.field!==`isDirect`&&e.operator!==`exists`?(_(),c(r,{key:2},[s(` 普通文本输入 `),T(l(`input`,{class:`input val-input`,"onUpdate:modelValue":t=>e.valueText=t,onInput:()=>{e.value=Q(e.valueText),J()},placeholder:`比较值`},null,40,B),[[S,e.valueText]])],2112)):s(`v-if`,!0),l(`button`,{class:`del-btn`,disabled:k.value.length<=1,onClick:e=>X(t),title:`删除此条件`},`✕`,8,te)])],64))),128))]),s(` 添加条件 `),l(`div`,ne,[k.value.length===0?(_(),o(n,{key:0,onClick:t[0]||=e=>Y(null)},{default:w(()=>[...t[3]||=[u(`+ 添加条件`,-1)]]),_:1})):(_(),c(r,{key:1},[d(n,{onClick:t[1]||=e=>Y(`and`)},{default:w(()=>[...t[4]||=[u(`且(AND)`,-1)]]),_:1}),d(n,{onClick:t[2]||=e=>Y(`or`)},{default:w(()=>[...t[5]||=[u(`或(OR)`,-1)]]),_:1})],64))]),s(` 表达式预览 `),l(`div`,re,[t[6]||=l(`div`,{class:`preview-title`},`表达式预览`,-1),l(`code`,ie,x(q.value||`(空)`),1)])])}}}),[[`__scopeId`,`data-v-40533e84`]]);const H={class:`fp-layout`},U={class:`fp-main`},W={class:`editor-header`},G={class:`rule-list`},K=[`onClick`],q={class:`top`},J={class:`name`},Y={class:`meta`},X={class:`editor-header`},Z={class:`actions`},Q={class:`editor-body`},ae={class:`editor-grid`},oe={class:`field`},se={class:`field`},ce={key:0,class:`field`},le={class:`field`},ue={class:`field`},de={class:`field switch`},fe={class:`expr-wrap`},pe={class:`footer-actions`};var $=A(f({__name:`page`,setup(e){let i=n,f={bypass:`放行`,block:`拦截`},m=[{label:`全局`,value:`global`},{label:`插件`,value:`plugin`}],h=[{label:`放行(bypass)`,value:`bypass`},{label:`拦截(block)`,value:`block`}],g=a(()=>[{label:`请选择插件实例`,value:``},...E.value.map(e=>({label:e.label,value:e.key}))]),C=v([]),E=v([]),D=v(``),O=a(()=>[...C.value].sort((e,t)=>e.priority-t.priority||e.id.localeCompare(t.id))),k=a(()=>O.value.find(e=>e.id===D.value));function A(){return{type:`group`,operator:`and`,children:[{type:`compare`,field:`guildId`,operator:`eq`,value:``}]}}async function M(){let[e,n]=await Promise.all([i(`filter-pro/list`),i(`filter-pro/targets`)]);E.value=n,C.value=e,(!D.value||!C.value.some(e=>e.id===D.value))&&(D.value=O.value[0]?.id||``),t.success(`刷新成功`)}async function N(){await i(`filter-pro/create`,{name:`new-rule`,enabled:!0,priority:(O.value.at(-1)?.priority??-1)+1,action:`block`,target:{type:`global`,value:``},condition:A(),response:``}),await M(),D.value=O.value.at(-1)?.id||D.value,t.success(`创建成功`)}function P(e){let t=e.target,n=Number(t.value);(n<1||!Number.isInteger(n))&&(t.value=String(Math.max(1,Math.floor(Math.abs(n))||1)),k.value&&(k.value.priority=Number(t.value)))}async function F(e){e.enabled=!e.enabled,await i(`filter-pro/toggle`,{id:e.id,enabled:e.enabled})}async function I(e){let n=e.target.type===`global`?{type:`global`,value:``}:{type:`plugin`,value:e.target.value||``};await i(`filter-pro/update`,{id:e.id,name:e.name,enabled:e.enabled,priority:e.priority,action:e.action,target:n,condition:e.condition,response:e.response||``}),await M(),t.success(`保存成功`)}async function L(){k.value&&confirm(`确定要删除这条规则吗?`)&&await R(k.value.id)}async function R(e){await i(`filter-pro/delete`,e),await M(),t.success(`删除成功`)}async function z(e,t){let n=O.value,r=n.findIndex(t=>t.id===e);if(r<0)return;let a=r+t;if(a<0||a>=n.length)return;let o=[...n];[o[r],o[a]]=[o[a],o[r]],await i(`filter-pro/reorder`,o.map(e=>e.id)),await M()}return M(),(e,t)=>{let n=b(`k-button`),i=b(`k-card`),a=b(`k-layout`);return _(),o(a,null,{default:w(()=>[l(`div`,H,[l(`div`,U,[d(i,{class:`panel list`},{header:w(()=>[l(`div`,W,[t[11]||=l(`div`,{class:`panel-title`},`规则列表`,-1),d(n,{onClick:N},{default:w(()=>[...t[10]||=[u(`新建规则`,-1)]]),_:1})])]),default:w(()=>[l(`div`,G,[(_(!0),c(r,null,y(O.value,e=>(_(),c(`button`,{key:e.id,class:p([`rule-item`,{active:D.value===e.id}]),onClick:t=>D.value=e.id},[l(`div`,q,[l(`span`,J,x(e.name||`未命名规则`),1),l(`span`,{class:p([`badge`,e.action])},x(f[e.action]),3)]),l(`div`,Y,[l(`span`,null,`#`+x(e.priority),1),l(`span`,null,x(e.target.type===`global`?`全局`:e.target.value||`未指定插件`),1),l(`span`,null,x(e.enabled?`启用`:`停用`),1)])],10,K))),128))])]),_:1}),k.value?(_(),o(i,{key:0,class:`panel editor`},{header:w(()=>[l(`div`,X,[t[15]||=l(`div`,{class:`panel-title`},`规则编辑`,-1),l(`div`,Z,[d(n,{onClick:t[0]||=e=>k.value&&I(k.value),disabled:!k.value},{default:w(()=>[...t[12]||=[u(`保存`,-1)]]),_:1},8,[`disabled`]),d(n,{onClick:L,disabled:!k.value},{default:w(()=>[...t[13]||=[u(`删除`,-1)]]),_:1},8,[`disabled`]),d(n,{onClick:M},{default:w(()=>[...t[14]||=[u(`刷新`,-1)]]),_:1})])])]),default:w(()=>[l(`div`,Q,[l(`div`,ae,[l(`label`,oe,[t[16]||=l(`span`,null,`规则名`,-1),T(l(`input`,{class:`input`,"onUpdate:modelValue":t[1]||=e=>k.value.name=e,placeholder:`输入规则名`},null,512),[[S,k.value.name]])]),l(`label`,se,[t[17]||=l(`span`,null,`目标`,-1),d(j,{modelValue:k.value.target.type,"onUpdate:modelValue":t[2]||=e=>k.value.target.type=e,options:m},null,8,[`modelValue`])]),k.value.target.type===`plugin`?(_(),c(`label`,ce,[t[18]||=l(`span`,null,`插件实例`,-1),d(j,{"model-value":k.value.target.value??``,options:g.value,"onUpdate:modelValue":t[3]||=e=>k.value.target.value=e},null,8,[`model-value`,`options`])])):s(`v-if`,!0),l(`label`,le,[t[19]||=l(`span`,null,`动作`,-1),d(j,{modelValue:k.value.action,"onUpdate:modelValue":t[4]||=e=>k.value.action=e,options:h},null,8,[`modelValue`])]),l(`label`,ue,[t[20]||=l(`span`,null,`优先级`,-1),T(l(`input`,{class:`input`,type:`number`,min:`1`,step:`1`,"onUpdate:modelValue":t[5]||=e=>k.value.priority=e,onInput:P},null,544),[[S,k.value.priority,void 0,{number:!0}]])]),l(`label`,de,[t[22]||=l(`span`,null,`启用状态`,-1),l(`div`,{class:p([`toggle-switch`,{active:k.value.enabled}]),onClick:t[6]||=e=>F(k.value)},[...t[21]||=[l(`div`,{class:`toggle-thumb`},null,-1)]],2)])]),l(`div`,fe,[t[23]||=l(`div`,{class:`panel-title small`},`条件表达式`,-1),d(V,{modelValue:k.value.condition,"onUpdate:modelValue":t[7]||=e=>k.value.condition=e},null,8,[`modelValue`])]),l(`div`,pe,[d(n,{onClick:t[8]||=e=>z(k.value.id,-1)},{default:w(()=>[...t[24]||=[u(`上移`,-1)]]),_:1}),d(n,{onClick:t[9]||=e=>z(k.value.id,1)},{default:w(()=>[...t[25]||=[u(`下移`,-1)]]),_:1})])])]),_:1})):s(`v-if`,!0)])])]),_:1})}}}),[[`__scopeId`,`data-v-0e916acc`]]);const me={},he={class:`k-icon`,viewBox:`0 0 512 512`,xmlns:`http://www.w3.org/2000/svg`};function ge(e,t){return _(),c(`svg`,he,[s(` 漏斗主体 `),t[0]||=l(`path`,{fill:`none`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linejoin":`round`,d:`M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z`},null,-1)])}var _e=A(me,[[`render`,ge]]),ve=t=>{e.register(`activity:filter-pro`,_e),t.page({name:`规则集`,path:`/filter-pro`,icon:`activity:filter-pro`,order:320,component:$})};export{ve as default};
|
|
1
|
+
import{icons as e,message as t,send as n}from"@koishijs/client";import{Fragment as r,Teleport as i,computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createElementVNode as l,createTextVNode as u,createVNode as d,defineComponent as f,normalizeClass as p,normalizeStyle as m,onBeforeUnmount as h,onMounted as g,openBlock as _,ref as v,renderList as y,resolveComponent as b,toDisplayString as x,vModelText as S,watch as C,withCtx as w,withDirectives as T,withModifiers as E}from"vue";const D=[`disabled`],O={class:`label`},k=[`onClick`];var A=f({__name:`fp-select`,props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},placeholder:{type:String,required:!1},disabled:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,u=t,d=v(null),f=v(!1),b=v({left:0,top:0,width:0}),S=a(()=>n.options.find(e=>e.value===n.modelValue)?.label||``);function w(){n.disabled||(f.value=!f.value,f.value&&A())}function T(e){u(`update:modelValue`,e),f.value=!1}function E(e){let t=e.target;!d.value||!t||d.value.contains(t)||(f.value=!1)}function A(){if(!d.value)return;let e=d.value.getBoundingClientRect(),t=window.innerHeight-e.bottom-6,n=e.top-6,r=t<180&&n>t,i=Math.min(240,r?n:t);b.value={left:e.left,width:e.width,top:r?Math.max(8,e.top-Math.max(120,i)-6):e.bottom+6}}function j(){f.value&&A()}return C(f,e=>{e&&A()}),g(()=>{document.addEventListener(`click`,E),window.addEventListener(`resize`,j),window.addEventListener(`scroll`,j,!0)}),h(()=>{document.removeEventListener(`click`,E),window.removeEventListener(`resize`,j),window.removeEventListener(`scroll`,j,!0)}),(t,n)=>(_(),c(r,null,[l(`div`,{class:`fp-select`,ref_key:`root`,ref:d},[l(`button`,{type:`button`,class:p([`trigger`,{disabled:e.disabled}]),onClick:w,disabled:e.disabled},[l(`span`,O,x(S.value||e.placeholder),1),n[0]||=l(`span`,{class:`arrow`},`▾`,-1)],10,D)],512),(_(),o(i,{to:`body`},[f.value?(_(),c(`div`,{key:0,class:`menu`,style:m({left:`${b.value.left}px`,top:`${b.value.top}px`,width:`${b.value.width}px`})},[(_(!0),c(r,null,y(e.options,t=>(_(),c(`button`,{key:t.value,type:`button`,class:p([`item`,{active:t.value===e.modelValue}]),onClick:e=>T(t.value)},x(t.label),11,k))),128))],4)):s(`v-if`,!0)]))],64))}}),j=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},M=j(A,[[`__scopeId`,`data-v-4a262c3e`]]);const N={class:`cf-editor`},P={class:`rows-section`},F={key:0,class:`conn-and-wrap`},I={class:`cf-row`},L=[`onUpdate:modelValue`],R={key:1,class:`bool-toggle`},z=[`checked`,`onChange`],B={class:`bool-label`},V=[`onUpdate:modelValue`,`onInput`],H={class:`row-btns`},U=[`disabled`,`onClick`],ee={key:0,class:`add-section`},te={class:`preview-section`},ne={class:`preview-code`};var W=j(f({name:`ExprEditor`,__name:`expr-editor`,props:{modelValue:{type:Object,required:!0}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=0,i=()=>String(++n),f=[{value:`guildId`,label:`群组 ID(guildId)`},{value:`channelId`,label:`频道 ID(channelId)`},{value:`userId`,label:`用户 ID(userId)`},{value:`platform`,label:`平台(platform)`},{value:`content`,label:`消息内容(content)`},{value:`isDirect`,label:`私聊(isDirect)`},{value:`type`,label:`消息类型(type)`}],m=[...f,{value:`__custom__`,label:`自定义字段...`}],h=[{value:`eq`,label:`等于`},{value:`ne`,label:`不等于`},{value:`includes`,label:`包含`},{value:`regex`,label:`正则匹配`},{value:`gt`,label:`大于`},{value:`gte`,label:`大于等于`},{value:`lt`,label:`小于`},{value:`lte`,label:`小于等于`},{value:`exists`,label:`存在`}],g=[{value:`eq`,label:`等于`},{value:`ne`,label:`不等于`},{value:`exists`,label:`存在`}],E={eq:`eq`,ne:`ne`,includes:`contains`,regex:`matches`,gt:`gt`,gte:`gte`,lt:`lt`,lte:`lte`,exists:`exists`},D=e,O=t,k=v(G(D.modelValue)),A=JSON.stringify(D.modelValue);C(()=>D.modelValue,e=>{let t=JSON.stringify(e);t!==A&&(A=t,k.value=G(e))},{deep:!0});function j(e,t=`guildId`){let n=t===`isDirect`;return{id:i(),field:t,customField:``,operator:`eq`,valueText:n?`false`:``,value:n?!1:``,connector:e}}function W(e,t){let n=f.some(t=>t.value===e.field),r=n?e.field:`__custom__`,a=r===`isDirect`?!1:``,o=e.value??a;return{id:i(),field:r,customField:n?``:e.field,operator:e.operator,valueText:o==null?``:String(o),value:o,connector:t}}function G(e){if(!e)return[j(null)];if(e.type===`compare`)return[W(e,null)];if(e.type===`group`){if(e.children.every(e=>e.type===`compare`))return e.children.map((t,n)=>W(t,n===0?null:e.operator));if(e.operator===`or`){let t=[],n=!0;for(let r of e.children)r.type===`compare`?(t.push(W(r,n?null:`or`)),n=!1):r.type===`group`&&r.operator===`and`&&r.children.forEach((e,r)=>{e.type===`compare`&&(t.push(W(e,n?null:r===0?`or`:`and`)),n=!1)});if(t.length>0)return t}}return[j(null)]}function K(e){return{type:`compare`,field:e.field===`__custom__`?(e.customField||``).trim()||`guildId`:e.field,operator:e.operator,value:e.operator===`exists`?void 0:e.value}}function q(e){if(e.length===0)return{type:`compare`,field:`guildId`,operator:`eq`,value:``};if(e.length===1)return K(e[0]);let t=[],n=[e[0]];for(let r=1;r<e.length;r++)e[r].connector===`or`?(t.push(n),n=[e[r]]):n.push(e[r]);t.push(n);let r=t.map(e=>e.length===1?K(e[0]):{type:`group`,operator:`and`,children:e.map(K)});return r.length===1?r[0]:{type:`group`,operator:`or`,children:r}}function J(e){if(e.type===`compare`){let t=E[e.operator]||e.operator,n=e.value===void 0?``:JSON.stringify(e.value);return`(${e.field} ${t} ${n})`}if(e.type===`group`){let t=e.operator===`and`?` AND `:` OR `;return e.children.map(J).join(t)}return e.type===`not`?`NOT (${J(e.child)})`:``}let Y=a(()=>J(q(k.value)));function X(){let e=q(k.value);A=JSON.stringify(e),O(`update:modelValue`,e)}function Z(e){k.value.push(j(e??`and`)),X()}function Q(e,t){k.value.splice(e+1,0,j(t)),X()}function re(e){k.value.length<=1||(k.value.splice(e,1),e===0&&(k.value[0].connector=null),X())}function $(e){e<=0||(k.value[e].connector=k.value[e].connector===`or`?`and`:`or`,X())}function ie(e){let t=e.trim();if(!t)return``;if(t===`true`)return!0;if(t===`false`)return!1;if(t===`null`)return null;let n=Number(t);return Number.isFinite(n)?n:e}return(e,t)=>{let n=b(`k-button`);return _(),c(`div`,N,[s(` 条件行 `),l(`div`,P,[(_(!0),c(r,null,y(k.value,(e,i)=>(_(),c(r,{key:e.id},[s(` 连接符(第一行之后显示) `),i>0?(_(),c(`div`,{key:0,class:p([`connector-sep`,`conn-`+e.connector])},[s(` AND:细线 + 按钮 + 细线 `),e.connector===`and`?(_(),c(`div`,F,[t[2]||=l(`div`,{class:`conn-vline`},null,-1),d(n,{title:`点击切换为或(OR)`,onClick:e=>$(i)},{default:w(()=>[...t[1]||=[u(`且(AND)`,-1)]]),_:1},8,[`onClick`]),t[3]||=l(`div`,{class:`conn-vline`},null,-1)])):(_(),c(r,{key:1},[s(` OR:仅按钮 `),d(n,{title:`点击切换为且(AND)`,onClick:e=>$(i)},{default:w(()=>[...t[4]||=[u(`或(OR)`,-1)]]),_:1},8,[`onClick`])],2112))],2)):s(`v-if`,!0),s(` 条件行 `),l(`div`,I,[d(M,{"model-value":e.field,options:m,class:`sel-field`,"onUpdate:modelValue":t=>{let n=e.field===`isDirect`;e.field=t,t===`isDirect`?(e.value=!1,e.valueText=`false`,[`eq`,`ne`,`exists`].includes(e.operator)||(e.operator=`eq`)):n&&(e.value=``,e.valueText=``),X()}},null,8,[`model-value`,`onUpdate:modelValue`]),e.field===`__custom__`?T((_(),c(`input`,{key:0,class:`input custom-input`,"onUpdate:modelValue":t=>e.customField=t,onInput:X,placeholder:`字段路径,如 author.name`},null,40,L)),[[S,e.customField]]):s(`v-if`,!0),d(M,{"model-value":e.operator,options:e.field===`isDirect`?g:h,class:`sel-op`,"onUpdate:modelValue":t=>{e.operator=t,X()}},null,8,[`model-value`,`options`,`onUpdate:modelValue`]),s(` isDirect:开关 `),e.field===`isDirect`&&e.operator!==`exists`?(_(),c(`label`,R,[l(`input`,{type:`checkbox`,checked:e.value===!0,onChange:t=>{e.value=t.target.checked,e.valueText=String(e.value),X()}},null,40,z),l(`span`,B,x(e.value===!0?`是(true)`:`否(false)`),1)])):e.field!==`isDirect`&&e.operator!==`exists`?(_(),c(r,{key:2},[s(` 普通文本输入 `),T(l(`input`,{class:`input val-input`,"onUpdate:modelValue":t=>e.valueText=t,onInput:()=>{e.value=ie(e.valueText),X()},placeholder:`比较值`},null,40,V),[[S,e.valueText]])],2112)):s(`v-if`,!0),l(`div`,H,[d(n,{onClick:e=>Q(i,`and`)},{default:w(()=>[...t[5]||=[u(`且(AND)`,-1)]]),_:1},8,[`onClick`]),i===k.value.length-1?(_(),o(n,{key:0,onClick:e=>Q(i,`or`)},{default:w(()=>[...t[6]||=[u(`或(OR)`,-1)]]),_:1},8,[`onClick`])):s(`v-if`,!0)]),l(`button`,{class:`del-btn`,disabled:k.value.length<=1,onClick:e=>re(i),title:`删除此条件`},` ✕ `,8,U)])],64))),128))]),s(` 添加条件(仅空状态) `),k.value.length===0?(_(),c(`div`,ee,[d(n,{onClick:t[0]||=e=>Z(null)},{default:w(()=>[...t[7]||=[u(`+ 添加条件`,-1)]]),_:1})])):s(`v-if`,!0),s(` 表达式预览 `),l(`div`,te,[t[8]||=l(`div`,{class:`preview-title`},`表达式预览`,-1),l(`code`,ne,x(Y.value||`(空)`),1)])])}}}),[[`__scopeId`,`data-v-40533e84`]]);const G={class:`fp-layout`},K={class:`fp-main`},q={class:`editor-header`},J={class:`rule-list`},Y=[`onClick`],X={class:`top`},Z={class:`name`},Q={class:`meta`},re={class:`editor-header`},$={class:`actions`},ie={class:`editor-body`},ae={class:`editor-grid`},oe={class:`field`},se={class:`field`},ce={key:0,class:`field`},le={class:`field`},ue={class:`field`},de={class:`field switch`},fe={class:`expr-wrap`},pe={class:`footer-actions`},me={class:`confirm-dialog`},he={class:`confirm-actions`};var ge=j(f({__name:`page`,setup(e){let f=n,m={bypass:`放行`,block:`拦截`},h=[{label:`全局`,value:`global`},{label:`插件`,value:`plugin`}],g=[{label:`放行(bypass)`,value:`bypass`},{label:`拦截(block)`,value:`block`}],C=a(()=>[{label:`请选择插件实例`,value:``},...O.value.map(e=>({label:e.label,value:e.key}))]),D=v([]),O=v([]),k=v(``),A=a(()=>[...D.value].sort((e,t)=>e.priority-t.priority||e.id.localeCompare(t.id))),j=a(()=>A.value.find(e=>e.id===k.value));function N(){return{type:`group`,operator:`and`,children:[{type:`compare`,field:`guildId`,operator:`eq`,value:``}]}}async function P(){let[e,n]=await Promise.all([f(`filter-pro/list`),f(`filter-pro/targets`)]);O.value=n,D.value=e,(!k.value||!D.value.some(e=>e.id===k.value))&&(k.value=A.value[0]?.id||``),t.success(`刷新成功`)}async function F(){await f(`filter-pro/create`,{name:`new-rule`,enabled:!0,priority:(A.value.at(-1)?.priority??-1)+1,action:`block`,target:{type:`global`,value:``},condition:N(),response:``}),await P(),k.value=A.value.at(-1)?.id||k.value,t.success(`创建成功`)}function I(e){let t=e.target,n=Number(t.value);(n<1||!Number.isInteger(n))&&(t.value=String(Math.max(1,Math.floor(Math.abs(n))||1)),j.value&&(j.value.priority=Number(t.value)))}async function L(e){e.enabled=!e.enabled,await f(`filter-pro/toggle`,{id:e.id,enabled:e.enabled})}async function R(e){let n=e.target.type===`global`?{type:`global`,value:``}:{type:`plugin`,value:e.target.value||``};await f(`filter-pro/update`,{id:e.id,name:e.name,enabled:e.enabled,priority:e.priority,action:e.action,target:n,condition:e.condition,response:e.response||``}),await P(),t.success(`保存成功`)}let z=v(!1);async function B(){j.value&&(z.value=!0)}async function V(){z.value=!1,j.value&&await H(j.value.id)}async function H(e){await f(`filter-pro/delete`,e),await P(),t.success(`删除成功`)}async function U(e,t){let n=A.value,r=n.findIndex(t=>t.id===e);if(r<0)return;let i=r+t;if(i<0||i>=n.length)return;let a=[...n];[a[r],a[i]]=[a[i],a[r]],await f(`filter-pro/reorder`,a.map(e=>e.id)),await P()}return P(),(e,t)=>{let n=b(`k-button`),a=b(`k-card`),f=b(`k-layout`);return _(),c(r,null,[d(f,null,{default:w(()=>[l(`div`,G,[l(`div`,K,[d(a,{class:`panel list`},{header:w(()=>[l(`div`,q,[t[13]||=l(`div`,{class:`panel-title`},`规则列表`,-1),d(n,{onClick:F},{default:w(()=>[...t[12]||=[u(`新建规则`,-1)]]),_:1})])]),default:w(()=>[l(`div`,J,[(_(!0),c(r,null,y(A.value,e=>(_(),c(`button`,{key:e.id,class:p([`rule-item`,{active:k.value===e.id}]),onClick:t=>k.value=e.id},[l(`div`,X,[l(`span`,Z,x(e.name||`未命名规则`),1),l(`span`,{class:p([`badge`,e.action])},x(m[e.action]),3)]),l(`div`,Q,[l(`span`,null,`#`+x(e.priority),1),l(`span`,null,x(e.target.type===`global`?`全局`:e.target.value||`未指定插件`),1),l(`span`,null,x(e.enabled?`启用`:`停用`),1)])],10,Y))),128))])]),_:1}),j.value?(_(),o(a,{key:0,class:`panel editor`},{header:w(()=>[l(`div`,re,[t[17]||=l(`div`,{class:`panel-title`},`规则编辑`,-1),l(`div`,$,[d(n,{onClick:t[0]||=e=>j.value&&R(j.value),disabled:!j.value},{default:w(()=>[...t[14]||=[u(`保存`,-1)]]),_:1},8,[`disabled`]),d(n,{onClick:B,disabled:!j.value},{default:w(()=>[...t[15]||=[u(`删除`,-1)]]),_:1},8,[`disabled`]),d(n,{onClick:P},{default:w(()=>[...t[16]||=[u(`刷新`,-1)]]),_:1})])])]),default:w(()=>[l(`div`,ie,[l(`div`,ae,[l(`label`,oe,[t[18]||=l(`span`,null,`规则名`,-1),T(l(`input`,{class:`input`,"onUpdate:modelValue":t[1]||=e=>j.value.name=e,placeholder:`输入规则名`},null,512),[[S,j.value.name]])]),l(`label`,se,[t[19]||=l(`span`,null,`目标`,-1),d(M,{modelValue:j.value.target.type,"onUpdate:modelValue":t[2]||=e=>j.value.target.type=e,options:h},null,8,[`modelValue`])]),j.value.target.type===`plugin`?(_(),c(`label`,ce,[t[20]||=l(`span`,null,`插件实例`,-1),d(M,{"model-value":j.value.target.value??``,options:C.value,"onUpdate:modelValue":t[3]||=e=>j.value.target.value=e},null,8,[`model-value`,`options`])])):s(`v-if`,!0),l(`label`,le,[t[21]||=l(`span`,null,`动作`,-1),d(M,{modelValue:j.value.action,"onUpdate:modelValue":t[4]||=e=>j.value.action=e,options:g},null,8,[`modelValue`])]),l(`label`,ue,[t[22]||=l(`span`,null,`优先级`,-1),T(l(`input`,{class:`input`,type:`number`,min:`1`,step:`1`,"onUpdate:modelValue":t[5]||=e=>j.value.priority=e,onInput:I},null,544),[[S,j.value.priority,void 0,{number:!0}]])]),l(`label`,de,[t[24]||=l(`span`,null,`启用状态`,-1),l(`div`,{class:p([`toggle-switch`,{active:j.value.enabled}]),onClick:t[6]||=e=>L(j.value)},[...t[23]||=[l(`div`,{class:`toggle-thumb`},null,-1)]],2)])]),l(`div`,fe,[t[25]||=l(`div`,{class:`panel-title small`},`条件表达式`,-1),d(W,{modelValue:j.value.condition,"onUpdate:modelValue":t[7]||=e=>j.value.condition=e},null,8,[`modelValue`])]),l(`div`,pe,[d(n,{onClick:t[8]||=e=>U(j.value.id,-1)},{default:w(()=>[...t[26]||=[u(`上移`,-1)]]),_:1}),d(n,{onClick:t[9]||=e=>U(j.value.id,1)},{default:w(()=>[...t[27]||=[u(`下移`,-1)]]),_:1})])])]),_:1})):s(`v-if`,!0)])])]),_:1}),s(` 删除确认弹窗 `),(_(),o(i,{to:`body`},[z.value?(_(),c(`div`,{key:0,class:`confirm-overlay`,onClick:t[11]||=E(e=>z.value=!1,[`self`])},[l(`div`,me,[t[29]||=l(`div`,{class:`confirm-title`},`删除规则`,-1),t[30]||=l(`div`,{class:`confirm-body`},`确定要删除这条规则吗?此操作不可撤销。`,-1),l(`div`,he,[d(n,{onClick:t[10]||=e=>z.value=!1},{default:w(()=>[...t[28]||=[u(`取消`,-1)]]),_:1}),l(`button`,{class:`confirm-danger-btn`,onClick:V},`确认删除`)])])])):s(`v-if`,!0)]))],64)}}}),[[`__scopeId`,`data-v-0e916acc`]]);const _e={},ve={class:`k-icon`,viewBox:`0 0 512 512`,xmlns:`http://www.w3.org/2000/svg`};function ye(e,t){return _(),c(`svg`,ve,[s(` 漏斗主体 `),t[0]||=l(`path`,{fill:`none`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linejoin":`round`,d:`M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z`},null,-1)])}var be=j(_e,[[`render`,ye]]),xe=t=>{e.register(`activity:filter-pro`,be),t.page({name:`规则集`,path:`/filter-pro`,icon:`activity:filter-pro`,order:320,component:ge})};export{xe as default};
|
package/dist/style.css
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
}
|
|
6
6
|
.trigger[data-v-4a262c3e] {
|
|
7
7
|
width: 100%;
|
|
8
|
+
height: 35px;
|
|
9
|
+
box-sizing: border-box;
|
|
8
10
|
display: flex;
|
|
9
11
|
align-items: center;
|
|
10
12
|
justify-content: space-between;
|
|
@@ -61,29 +63,30 @@
|
|
|
61
63
|
.connector-sep[data-v-40533e84] {
|
|
62
64
|
display: flex;
|
|
63
65
|
align-items: center;
|
|
64
|
-
padding: 2px 0;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
padding:
|
|
70
|
-
border-radius: 4px;
|
|
71
|
-
border: 1px solid var(--k-card-border, rgba(127, 127, 127, 0.4));
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
background: var(--k-input-bg, transparent);
|
|
74
|
-
color: var(--k-text-normal, inherit);
|
|
75
|
-
letter-spacing: 0.04em;
|
|
76
|
-
transition: opacity 0.15s;
|
|
67
|
+
|
|
68
|
+
/* OR:按钮 + 上下内廝 */
|
|
69
|
+
.connector-sep.conn-or[data-v-40533e84] {
|
|
70
|
+
padding: 16px 0;
|
|
77
71
|
}
|
|
78
|
-
|
|
72
|
+
|
|
73
|
+
/* AND:无额外内廝,由线提供等高间距 */
|
|
74
|
+
.connector-sep.conn-and[data-v-40533e84] {
|
|
75
|
+
padding: 0;
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
|
|
78
|
+
/* AND 内部:线 + 按钮 + 线,列居中 */
|
|
79
|
+
.conn-and-wrap[data-v-40533e84] {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
align-items: center;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
|
|
85
|
+
/* 上下细线,高度与 OR 内廝相同,颜色和边框一致 */
|
|
86
|
+
.conn-vline[data-v-40533e84] {
|
|
87
|
+
width: 1px;
|
|
88
|
+
height: 12px;
|
|
89
|
+
background: var(--k-card-border, rgba(127, 127, 127, 0.35));
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
/* ── 条件行 ── */
|
|
@@ -92,19 +95,19 @@
|
|
|
92
95
|
align-items: center;
|
|
93
96
|
gap: 8px;
|
|
94
97
|
flex-wrap: wrap;
|
|
95
|
-
padding: 8px 10px;
|
|
96
|
-
border: 1px solid var(--k-card-border, rgba(127, 127, 127, 0.35));
|
|
97
|
-
border-radius: 8px;
|
|
98
|
-
background: color-mix(in srgb, var(--k-card-bg, #1a1a1a) 60%, transparent);
|
|
99
98
|
}
|
|
100
|
-
.sel-field[data-v-40533e84] {
|
|
99
|
+
.sel-field[data-v-40533e84] {
|
|
100
|
+
min-width: 168px;
|
|
101
101
|
}
|
|
102
|
-
.sel-op[data-v-40533e84]
|
|
102
|
+
.sel-op[data-v-40533e84] {
|
|
103
|
+
min-width: 110px;
|
|
103
104
|
}
|
|
104
105
|
.val-input[data-v-40533e84],
|
|
105
106
|
.custom-input[data-v-40533e84] {
|
|
106
107
|
flex: 1;
|
|
107
108
|
min-width: 120px;
|
|
109
|
+
height: 35px;
|
|
110
|
+
box-sizing: border-box;
|
|
108
111
|
color: var(--k-text-normal, inherit);
|
|
109
112
|
background: var(--k-input-bg, transparent);
|
|
110
113
|
border: 1px solid var(--k-card-border, rgba(127, 127, 127, 0.35));
|
|
@@ -122,20 +125,20 @@
|
|
|
122
125
|
flex: 1;
|
|
123
126
|
min-width: 120px;
|
|
124
127
|
}
|
|
125
|
-
.bool-toggle input[type=
|
|
128
|
+
.bool-toggle input[type="checkbox"][data-v-40533e84] {
|
|
126
129
|
appearance: none;
|
|
127
130
|
-webkit-appearance: none;
|
|
128
131
|
width: 36px;
|
|
129
132
|
height: 20px;
|
|
130
133
|
border-radius: 999px;
|
|
131
|
-
background: var(--k-card-border, rgba(127,127,127,0.4));
|
|
134
|
+
background: var(--k-card-border, rgba(127, 127, 127, 0.4));
|
|
132
135
|
position: relative;
|
|
133
136
|
cursor: pointer;
|
|
134
137
|
transition: background 0.2s;
|
|
135
138
|
flex-shrink: 0;
|
|
136
139
|
}
|
|
137
|
-
.bool-toggle input[type=
|
|
138
|
-
content:
|
|
140
|
+
.bool-toggle input[type="checkbox"][data-v-40533e84]::after {
|
|
141
|
+
content: "";
|
|
139
142
|
position: absolute;
|
|
140
143
|
width: 14px;
|
|
141
144
|
height: 14px;
|
|
@@ -145,10 +148,10 @@
|
|
|
145
148
|
left: 3px;
|
|
146
149
|
transition: left 0.2s;
|
|
147
150
|
}
|
|
148
|
-
.bool-toggle input[type=
|
|
151
|
+
.bool-toggle input[type="checkbox"][data-v-40533e84]:checked {
|
|
149
152
|
background: var(--k-color-primary, #4f7cff);
|
|
150
153
|
}
|
|
151
|
-
.bool-toggle input[type=
|
|
154
|
+
.bool-toggle input[type="checkbox"][data-v-40533e84]:checked::after {
|
|
152
155
|
left: 19px;
|
|
153
156
|
}
|
|
154
157
|
.bool-label[data-v-40533e84] {
|
|
@@ -156,10 +159,19 @@
|
|
|
156
159
|
color: var(--k-text-normal, inherit);
|
|
157
160
|
user-select: none;
|
|
158
161
|
}
|
|
162
|
+
|
|
163
|
+
/* ── 行内操作按钮(And / Or) ── */
|
|
164
|
+
.row-btns[data-v-40533e84] {
|
|
165
|
+
display: flex;
|
|
166
|
+
gap: 4px;
|
|
167
|
+
flex-shrink: 0;
|
|
168
|
+
margin-left: auto;
|
|
169
|
+
}
|
|
159
170
|
.del-btn[data-v-40533e84] {
|
|
160
171
|
flex-shrink: 0;
|
|
161
|
-
width:
|
|
162
|
-
height:
|
|
172
|
+
width: 35px;
|
|
173
|
+
height: 35px;
|
|
174
|
+
box-sizing: border-box;
|
|
163
175
|
display: flex;
|
|
164
176
|
align-items: center;
|
|
165
177
|
justify-content: center;
|
|
@@ -169,8 +181,9 @@
|
|
|
169
181
|
color: var(--k-text-secondary, #888);
|
|
170
182
|
cursor: pointer;
|
|
171
183
|
font-size: 14px;
|
|
172
|
-
|
|
173
|
-
|
|
184
|
+
transition:
|
|
185
|
+
color 0.15s,
|
|
186
|
+
background 0.15s;
|
|
174
187
|
}
|
|
175
188
|
.del-btn[data-v-40533e84]:hover {
|
|
176
189
|
color: #e74c3c;
|
|
@@ -204,7 +217,7 @@
|
|
|
204
217
|
}
|
|
205
218
|
.preview-code[data-v-40533e84] {
|
|
206
219
|
display: block;
|
|
207
|
-
font-family:
|
|
220
|
+
font-family: "Consolas", "Monaco", "Fira Code", monospace;
|
|
208
221
|
font-size: 13px;
|
|
209
222
|
background: color-mix(in srgb, #000 35%, transparent);
|
|
210
223
|
padding: 10px 14px;
|
|
@@ -368,6 +381,7 @@
|
|
|
368
381
|
.input[data-v-0e916acc] {
|
|
369
382
|
width: 100%;
|
|
370
383
|
min-width: 0;
|
|
384
|
+
height: 35px;
|
|
371
385
|
box-sizing: border-box;
|
|
372
386
|
color: var(--k-text-normal, inherit);
|
|
373
387
|
background: var(--k-input-bg, transparent);
|
|
@@ -383,6 +397,61 @@
|
|
|
383
397
|
gap: 8px;
|
|
384
398
|
flex-wrap: wrap;
|
|
385
399
|
}
|
|
400
|
+
|
|
401
|
+
/* ── 删除确认框 ── */
|
|
402
|
+
.confirm-overlay[data-v-0e916acc] {
|
|
403
|
+
position: fixed;
|
|
404
|
+
inset: 0;
|
|
405
|
+
z-index: 10000;
|
|
406
|
+
background: rgba(0, 0, 0, 0.55);
|
|
407
|
+
display: flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
}
|
|
411
|
+
.confirm-dialog[data-v-0e916acc] {
|
|
412
|
+
background: var(--k-card-bg, #1e1e1e);
|
|
413
|
+
border: 1px solid var(--k-card-border, rgba(127, 127, 127, 0.35));
|
|
414
|
+
border-radius: 12px;
|
|
415
|
+
padding: 24px 28px;
|
|
416
|
+
min-width: 320px;
|
|
417
|
+
max-width: 480px;
|
|
418
|
+
display: flex;
|
|
419
|
+
flex-direction: column;
|
|
420
|
+
gap: 12px;
|
|
421
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
422
|
+
}
|
|
423
|
+
.confirm-title[data-v-0e916acc] {
|
|
424
|
+
font-size: 16px;
|
|
425
|
+
font-weight: 700;
|
|
426
|
+
color: var(--k-text-normal, inherit);
|
|
427
|
+
}
|
|
428
|
+
.confirm-body[data-v-0e916acc] {
|
|
429
|
+
font-size: 14px;
|
|
430
|
+
color: var(--k-text-secondary, #aaa);
|
|
431
|
+
line-height: 1.6;
|
|
432
|
+
}
|
|
433
|
+
.confirm-actions[data-v-0e916acc] {
|
|
434
|
+
display: flex;
|
|
435
|
+
justify-content: flex-end;
|
|
436
|
+
gap: 8px;
|
|
437
|
+
margin-top: 4px;
|
|
438
|
+
}
|
|
439
|
+
.confirm-danger-btn[data-v-0e916acc] {
|
|
440
|
+
height: 35px;
|
|
441
|
+
box-sizing: border-box;
|
|
442
|
+
padding: 0 16px;
|
|
443
|
+
border-radius: 6px;
|
|
444
|
+
border: none;
|
|
445
|
+
background: #e74c3c;
|
|
446
|
+
color: #fff;
|
|
447
|
+
font-size: 14px;
|
|
448
|
+
font-weight: 600;
|
|
449
|
+
cursor: pointer;
|
|
450
|
+
transition: opacity 0.15s;
|
|
451
|
+
}
|
|
452
|
+
.confirm-danger-btn[data-v-0e916acc]:hover {
|
|
453
|
+
opacity: 0.85;
|
|
454
|
+
}
|
|
386
455
|
@media (max-width: 980px) {
|
|
387
456
|
.fp-main[data-v-0e916acc] {
|
|
388
457
|
grid-template-columns: 1fr;
|
|
@@ -392,3 +461,9 @@
|
|
|
392
461
|
}
|
|
393
462
|
}
|
|
394
463
|
|
|
464
|
+
|
|
465
|
+
.k-button {
|
|
466
|
+
height: 35px !important;
|
|
467
|
+
box-sizing: border-box !important;
|
|
468
|
+
}
|
|
469
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-filter-pro",
|
|
3
3
|
"description": "A powerful filter plugin for Koishi",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.mjs",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"lint": "biome check && biome lint",
|
|
26
26
|
"lint-fix": "biome format --write && biome lint --write"
|
|
27
27
|
},
|
|
28
|
+
"contributors": [
|
|
29
|
+
"q78kg <hoshino-yumetsuki@outlook.com>",
|
|
30
|
+
"shangxueink <1919892171@qq.com>"
|
|
31
|
+
],
|
|
28
32
|
"repository": {
|
|
29
33
|
"type": "git",
|
|
30
34
|
"url": "git+https://github.com/Hoshino-Yumetsuki/koishi-plugin-filter-pro",
|