@easy-editor/materials-dashboard-text 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,103 +1,109 @@
1
- # @easy-editor/materials-dashboard-text
2
-
3
- ## 0.0.17
4
-
5
- ### Patch Changes
6
-
7
- - feat: text add event
8
-
9
- ## 0.0.16
10
-
11
- ### Patch Changes
12
-
13
- - feat: text add datasource
14
-
15
- ## 0.0.15
16
-
17
- ### Patch Changes
18
-
19
- - feat: test node upgrade
20
-
21
- ## 0.0.14
22
-
23
- ### Patch Changes
24
-
25
- - feat: add NodeInfoSetter & title prop
26
-
27
- ## 0.0.13
28
-
29
- ### Patch Changes
30
-
31
- - feat: multi-version component
32
-
33
- ## 0.0.12
34
-
35
- ### Patch Changes
36
-
37
- - fix: remove category
38
-
39
- ## 0.0.11
40
-
41
- ### Patch Changes
42
-
43
- - feat: new setters
44
-
45
- ## 0.0.10
46
-
47
- ### Patch Changes
48
-
49
- - fix: configure error
50
-
51
- ## 0.0.9
52
-
53
- ### Patch Changes
54
-
55
- - build: add esm build
56
-
57
- ## 0.0.8
58
-
59
- ### Patch Changes
60
-
61
- - fix: react build error
62
-
63
- ## 0.0.7
64
-
65
- ### Patch Changes
66
-
67
- - fix: change componentName
68
-
69
- ## 0.0.6
70
-
71
- ### Patch Changes
72
-
73
- - feat: add metadata npm
74
-
75
- ## 0.0.5
76
-
77
- ### Patch Changes
78
-
79
- - feat: add devMode
80
-
81
- ## 0.0.4
82
-
83
- ### Patch Changes
84
-
85
- - perf: adjust structure
86
-
87
- ## 0.0.3
88
-
89
- ### Patch Changes
90
-
91
- - perf: material structure
92
-
93
- ## 0.0.2
94
-
95
- ### Patch Changes
96
-
97
- - perf: update material variable
98
-
99
- ## 0.0.1
100
-
101
- ### Patch Changes
102
-
103
- - feat: text materials
1
+ # @easy-editor/materials-dashboard-text
2
+
3
+ ## 0.0.18
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: build error
8
+
9
+ ## 0.0.17
10
+
11
+ ### Patch Changes
12
+
13
+ - feat: text add event
14
+
15
+ ## 0.0.16
16
+
17
+ ### Patch Changes
18
+
19
+ - feat: text add datasource
20
+
21
+ ## 0.0.15
22
+
23
+ ### Patch Changes
24
+
25
+ - feat: test node upgrade
26
+
27
+ ## 0.0.14
28
+
29
+ ### Patch Changes
30
+
31
+ - feat: add NodeInfoSetter & title prop
32
+
33
+ ## 0.0.13
34
+
35
+ ### Patch Changes
36
+
37
+ - feat: multi-version component
38
+
39
+ ## 0.0.12
40
+
41
+ ### Patch Changes
42
+
43
+ - fix: remove category
44
+
45
+ ## 0.0.11
46
+
47
+ ### Patch Changes
48
+
49
+ - feat: new setters
50
+
51
+ ## 0.0.10
52
+
53
+ ### Patch Changes
54
+
55
+ - fix: configure error
56
+
57
+ ## 0.0.9
58
+
59
+ ### Patch Changes
60
+
61
+ - build: add esm build
62
+
63
+ ## 0.0.8
64
+
65
+ ### Patch Changes
66
+
67
+ - fix: react build error
68
+
69
+ ## 0.0.7
70
+
71
+ ### Patch Changes
72
+
73
+ - fix: change componentName
74
+
75
+ ## 0.0.6
76
+
77
+ ### Patch Changes
78
+
79
+ - feat: add metadata npm
80
+
81
+ ## 0.0.5
82
+
83
+ ### Patch Changes
84
+
85
+ - feat: add devMode
86
+
87
+ ## 0.0.4
88
+
89
+ ### Patch Changes
90
+
91
+ - perf: adjust structure
92
+
93
+ ## 0.0.3
94
+
95
+ ### Patch Changes
96
+
97
+ - perf: material structure
98
+
99
+ ## 0.0.2
100
+
101
+ ### Patch Changes
102
+
103
+ - perf: update material variable
104
+
105
+ ## 0.0.1
106
+
107
+ ### Patch Changes
108
+
109
+ - feat: text materials
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["exports","react","react/jsx-runtime"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsText={},e.React,e.jsxRuntime)}(this,function(e,t,o){"use strict";function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function r(...e){return function(){for(var e,t,o=0,r="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}(e)}var a="component-module__container___VbZSk",l="component-module__text___nFUOn",i="component-module__link___20asF",s="component-module__underline___0oAJz",c="component-module__alignLeft___IOvpO",p="component-module__alignCenter___EIwIC",d="component-module__alignRight___p3ReL",u="component-module__valignTop___-5DmK",m="component-module__valignMiddle___i0are",f="component-module__valignBottom___97zzw";function g(e,t){if(!t)return e;const o=t.split(".");let n=e;for(const e of o){if(null==n)return;if("object"!=typeof n)return;n=n[e]}return n}function _(e){return void 0===e?[]:Array.isArray(e)?e:e&&"object"==typeof e?[e]:[]}!function(e,t){void 0===t&&(t={});var o=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".component-module__container___VbZSk{display:flex;height:100%;width:100%}.component-module__text___nFUOn{display:inline-block;word-break:break-word}.component-module__link___20asF{cursor:pointer;text-decoration:none;transition:opacity .2s ease}.component-module__link___20asF:hover{opacity:.8}.component-module__underline___0oAJz{text-decoration:underline}.component-module__alignLeft___IOvpO{justify-content:flex-start;text-align:left}.component-module__alignCenter___EIwIC{justify-content:center;text-align:center}.component-module__alignRight___p3ReL{justify-content:flex-end;text-align:right}.component-module__valignTop___-5DmK{align-items:flex-start}.component-module__valignMiddle___i0are{align-items:center}.component-module__valignBottom___97zzw{align-items:flex-end}");const h=(e,t,o)=>({type:"group",title:e,setter:{componentName:"CollapseSetter",props:{icon:!1,...o}},items:t}),x={name:"nodeInfo",title:"节点信息",setter:"NodeInfoSetter",extraProps:{label:!1}},b="EasyEditorMaterialsText",y=e=>({sourceType:"static",staticData:[{text:e}],fieldMappings:[{componentField:"text",sourceField:"text"}]});const S={componentName:b,title:"文本",group:"basic",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-text",version:"0.0.16",globalName:b,componentName:b},configure:{props:[{type:"group",title:"属性",setter:"TabSetter",items:[{type:"group",key:"config",title:"配置",items:[x,h("基础配置",[{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}},{name:"rotation",title:"旋转角度",setter:{componentName:"SliderSetter",props:{min:0,max:360,suffix:"°"}},extraProps:{defaultValue:0}},{name:"opacity",title:"不透明度",setter:{componentName:"SliderSetter",props:{min:0,max:100,suffix:"%"}},extraProps:{defaultValue:100}},{name:"background",title:"背景颜色",setter:"ColorSetter",extraProps:{defaultValue:"transparent"}}]),h("组件配置",[{type:"group",title:"组件配置",setter:"SubTabSetter",items:[{type:"group",key:"content",title:"内容",items:[{name:"isLink",title:"作为链接",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"href",title:"链接地址",setter:"StringSetter"},{name:"target",title:"打开方式",setter:{componentName:"SelectSetter",props:{options:[{label:"新窗口",value:"_blank"},{label:"当前窗口",value:"_self"}]}},extraProps:{defaultValue:"_blank"}}]},{type:"group",key:"font",title:"字体",items:[{name:"fontSize",title:"字体大小",setter:"NumberSetter",extraProps:{defaultValue:16}},{name:"fontWeight",title:"字体粗细",setter:{componentName:"SelectSetter",props:{options:[{label:"正常",value:"normal"},{label:"粗体",value:"bold"}]}},extraProps:{defaultValue:"normal"}},{name:"color",title:"颜色",setter:"ColorSetter",extraProps:{defaultValue:"#ffffff"}},{name:"lineHeight",title:"行高",setter:"NumberSetter",extraProps:{defaultValue:1.5}}]},{type:"group",key:"align",title:"对齐",items:[{name:"textAlign",title:"水平对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},extraProps:{defaultValue:"left"}},{name:"verticalAlign",title:"垂直对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"上",value:"top"},{label:"中",value:"middle"},{label:"下",value:"bottom"}]}},extraProps:{defaultValue:"middle"}}]},{type:"group",key:"effect",title:"效果",items:[{name:"underline",title:"下划线",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowEnable",title:"发光效果",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowColor",title:"发光颜色",setter:"ColorSetter",extraProps:{defaultValue:"#00d4ff"}}]}]}],{padding:"6px 16px 12px"})]},{type:"group",key:"data",title:"数据",items:[x,{name:"$data",title:"数据配置",setter:{componentName:"DataSetter",props:{expectedFields:[{name:"text",label:"text",type:"string",required:!0,description:"文本内容"}],showPreview:!0,previewLimit:10}},extraProps:{label:!1}}]},{type:"group",key:"advanced",title:"高级",items:[x,h("事件绑定",[{name:"events",title:"事件",setter:{componentName:"EventSetter",props:{events:[{title:"点击事件",children:[{label:"点击",value:"onClick",description:"鼠标点击时触发"},{label:"双击",value:"onDoubleClick",description:"鼠标双击时触发"}]},{title:"鼠标事件",children:[{label:"鼠标进入",value:"onMouseEnter",description:"鼠标进入时触发"},{label:"鼠标离开",value:"onMouseLeave",description:"鼠标离开时触发"}]}]}},extraProps:{label:!1}}]),h("高级配置",[{title:"条件渲染",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getNode().getExtraPropValue("condition"),setValue(e,t){e.getNode().setExtraProp("condition",t)}}}])]}]}],component:{},supports:{},advanced:{}},snippets:[{title:"普通文本",screenshot:"",schema:{componentName:b,title:"普通文本",props:{fontSize:16,color:"#ffffff",rotation:0,opacity:100,background:"transparent",$data:y("普通文本")},$dashboard:{rect:{width:120,height:40}}}},{title:"标题文本",screenshot:"",schema:{componentName:b,title:"标题文本",props:{fontSize:32,fontWeight:"bold",color:"#ffffff",textAlign:"center",rotation:0,opacity:100,background:"transparent",$data:y("标题文本")},$dashboard:{rect:{width:200,height:60}}}},{title:"发光标题",screenshot:"",schema:{componentName:b,title:"发光标题",props:{fontSize:36,fontWeight:"bold",color:"#00d4ff",textAlign:"center",glowEnable:!0,glowColor:"#00d4ff",glowIntensity:1.5,rotation:0,opacity:100,background:"transparent",$data:y("发光标题")},$dashboard:{rect:{width:240,height:80}}}},{title:"链接文本",screenshot:"",schema:{componentName:b,title:"链接文本",props:{fontSize:16,color:"#00d4ff",isLink:!0,href:"https://easy-editor-docs.vercel.app/",target:"_blank",underline:!0,rotation:0,opacity:100,background:"transparent",$data:y("点击跳转")},$dashboard:{rect:{width:120,height:40}}}},{title:"标签文本",screenshot:"",schema:{componentName:b,title:"标签文本",props:{fontSize:14,color:"#ffffff",textAlign:"center",verticalAlign:"middle",rotation:0,opacity:100,background:"rgba(0, 212, 255, 0.2)",$data:y("标签")},$dashboard:{rect:{width:80,height:32}}}}]};e.component=({ref:e,$data:n,__dataSource:h,fontSize:x=16,fontWeight:b="normal",fontFamily:y="inherit",color:S="#ffffff",textAlign:v="left",verticalAlign:k="middle",lineHeight:w=1.5,letterSpacing:N=0,isLink:V=!1,href:P="",target:C="_blank",underline:E=!1,glowEnable:$=!1,glowColor:A="#00d4ff",glowIntensity:M=1,rotation:T=0,opacity:j=100,background:z="transparent",style:I,onClick:F,onDoubleClick:L,onMouseEnter:D,onMouseLeave:R})=>{const O=t.useMemo(()=>{if(!n)return"";let e=[];if("static"===n.sourceType)e=Array.isArray(n.staticData)?n.staticData:[];else if("global"===n.sourceType&&n.datasourceId){const t=h?.page?.[n.datasourceId];e=_(t)}else if("datasource"===n.sourceType&&n.datasourceId){const t=h?.component?.[n.datasourceId];e=_(t)}const t=function(e,t){return t&&0!==t.length?e.map(e=>{const o={};for(const{componentField:n,sourceField:r}of t)n&&r&&(o[n]=g(e,r));return o}):e}(e,n.fieldMappings);return t.length>0&&void 0!==t[0].text?String(t[0].text):""},[n,h]),W={fontSize:x,fontWeight:b,fontFamily:y,color:S,lineHeight:w,letterSpacing:N,textShadow:$?`0 0 ${10*M}px ${A}, 0 0 ${20*M}px ${A}, 0 0 ${30*M}px ${A}`:void 0},B={...I,transform:0!==T?`rotate(${T}deg)`:void 0,opacity:j/100,backgroundColor:z},q=r(a,(e=>{switch(e){case"left":default:return c;case"center":return p;case"right":return d}})(v),(e=>{switch(e){case"top":return u;case"middle":default:return m;case"bottom":return f}})(k)),H=r(l,V&&i,E&&s);if(V&&P){const t="_blank"===C?"noopener noreferrer":"";return o.jsx("div",{className:q,ref:e,style:B,onClick:F,onDoubleClick:L,onMouseEnter:D,onMouseLeave:R,children:o.jsx("a",{className:H,href:P,rel:t,style:W,target:C,children:O})})}return o.jsx("div",{className:q,ref:e,style:B,onClick:F,onDoubleClick:L,onMouseEnter:D,onMouseLeave:R,children:o.jsx("span",{className:H,style:W,children:O})})},e.meta=S});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["exports","react","react/jsx-runtime"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsText={},e.React,e.jsxRuntime)}(this,function(e,t,o){"use strict";function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function r(...e){return function(){for(var e,t,o=0,r="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}(e)}var a="component-module__container___VbZSk",l="component-module__text___nFUOn",i="component-module__link___20asF",s="component-module__underline___0oAJz",c="component-module__alignLeft___IOvpO",p="component-module__alignCenter___EIwIC",d="component-module__alignRight___p3ReL",u="component-module__valignTop___-5DmK",m="component-module__valignMiddle___i0are",f="component-module__valignBottom___97zzw";function g(e,t){if(!t)return e;const o=t.split(".");let n=e;for(const e of o){if(null==n)return;if("object"!=typeof n)return;n=n[e]}return n}function _(e){return void 0===e?[]:Array.isArray(e)?e:e&&"object"==typeof e?[e]:[]}!function(e,t){void 0===t&&(t={});var o=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".component-module__container___VbZSk{display:flex;height:100%;width:100%}.component-module__text___nFUOn{display:inline-block;word-break:break-word}.component-module__link___20asF{cursor:pointer;text-decoration:none;transition:opacity .2s ease}.component-module__link___20asF:hover{opacity:.8}.component-module__underline___0oAJz{text-decoration:underline}.component-module__alignLeft___IOvpO{justify-content:flex-start;text-align:left}.component-module__alignCenter___EIwIC{justify-content:center;text-align:center}.component-module__alignRight___p3ReL{justify-content:flex-end;text-align:right}.component-module__valignTop___-5DmK{align-items:flex-start}.component-module__valignMiddle___i0are{align-items:center}.component-module__valignBottom___97zzw{align-items:flex-end}");const h=(e,t,o)=>({type:"group",title:e,setter:{componentName:"CollapseSetter",props:{icon:!1,...o}},items:t}),x={name:"nodeInfo",title:"节点信息",setter:"NodeInfoSetter",extraProps:{label:!1}},b="EasyEditorMaterialsText",y=e=>({sourceType:"static",staticData:[{text:e}],fieldMappings:[{componentField:"text",sourceField:"text"}]});const S={componentName:b,title:"文本",group:"basic",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-text",version:"0.0.18",globalName:b,componentName:b},configure:{props:[{type:"group",title:"属性",setter:"TabSetter",items:[{type:"group",key:"config",title:"配置",items:[x,h("基础配置",[{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}},{name:"rotation",title:"旋转角度",setter:{componentName:"SliderSetter",props:{min:0,max:360,suffix:"°"}},extraProps:{defaultValue:0}},{name:"opacity",title:"不透明度",setter:{componentName:"SliderSetter",props:{min:0,max:100,suffix:"%"}},extraProps:{defaultValue:100}},{name:"background",title:"背景颜色",setter:"ColorSetter",extraProps:{defaultValue:"transparent"}}]),h("组件配置",[{type:"group",title:"组件配置",setter:"SubTabSetter",items:[{type:"group",key:"content",title:"内容",items:[{name:"isLink",title:"作为链接",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"href",title:"链接地址",setter:"StringSetter"},{name:"target",title:"打开方式",setter:{componentName:"SelectSetter",props:{options:[{label:"新窗口",value:"_blank"},{label:"当前窗口",value:"_self"}]}},extraProps:{defaultValue:"_blank"}}]},{type:"group",key:"font",title:"字体",items:[{name:"fontSize",title:"字体大小",setter:"NumberSetter",extraProps:{defaultValue:16}},{name:"fontWeight",title:"字体粗细",setter:{componentName:"SelectSetter",props:{options:[{label:"正常",value:"normal"},{label:"粗体",value:"bold"}]}},extraProps:{defaultValue:"normal"}},{name:"color",title:"颜色",setter:"ColorSetter",extraProps:{defaultValue:"#ffffff"}},{name:"lineHeight",title:"行高",setter:"NumberSetter",extraProps:{defaultValue:1.5}}]},{type:"group",key:"align",title:"对齐",items:[{name:"textAlign",title:"水平对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},extraProps:{defaultValue:"left"}},{name:"verticalAlign",title:"垂直对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"上",value:"top"},{label:"中",value:"middle"},{label:"下",value:"bottom"}]}},extraProps:{defaultValue:"middle"}}]},{type:"group",key:"effect",title:"效果",items:[{name:"underline",title:"下划线",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowEnable",title:"发光效果",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowColor",title:"发光颜色",setter:"ColorSetter",extraProps:{defaultValue:"#00d4ff"}}]}]}],{padding:"6px 16px 12px"})]},{type:"group",key:"data",title:"数据",items:[x,{name:"$data",title:"数据配置",setter:{componentName:"DataSetter",props:{expectedFields:[{name:"text",label:"text",type:"string",required:!0,description:"文本内容"}],showPreview:!0,previewLimit:10}},extraProps:{label:!1}}]},{type:"group",key:"advanced",title:"高级",items:[x,h("事件绑定",[{name:"events",title:"事件",setter:{componentName:"EventSetter",props:{events:[{title:"点击事件",children:[{label:"点击",value:"onClick",description:"鼠标点击时触发"},{label:"双击",value:"onDoubleClick",description:"鼠标双击时触发"}]},{title:"鼠标事件",children:[{label:"鼠标进入",value:"onMouseEnter",description:"鼠标进入时触发"},{label:"鼠标离开",value:"onMouseLeave",description:"鼠标离开时触发"}]}]}},extraProps:{label:!1}}]),h("高级配置",[{title:"条件渲染",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getNode().getExtraPropValue("condition"),setValue(e,t){e.getNode().setExtraProp("condition",t)}}}])]}]}],component:{},supports:{},advanced:{}},snippets:[{title:"普通文本",screenshot:"",schema:{componentName:b,title:"普通文本",props:{fontSize:16,color:"#ffffff",rotation:0,opacity:100,background:"transparent",$data:y("普通文本")},$dashboard:{rect:{width:120,height:40}}}},{title:"标题文本",screenshot:"",schema:{componentName:b,title:"标题文本",props:{fontSize:32,fontWeight:"bold",color:"#ffffff",textAlign:"center",rotation:0,opacity:100,background:"transparent",$data:y("标题文本")},$dashboard:{rect:{width:200,height:60}}}},{title:"发光标题",screenshot:"",schema:{componentName:b,title:"发光标题",props:{fontSize:36,fontWeight:"bold",color:"#00d4ff",textAlign:"center",glowEnable:!0,glowColor:"#00d4ff",glowIntensity:1.5,rotation:0,opacity:100,background:"transparent",$data:y("发光标题")},$dashboard:{rect:{width:240,height:80}}}},{title:"链接文本",screenshot:"",schema:{componentName:b,title:"链接文本",props:{fontSize:16,color:"#00d4ff",isLink:!0,href:"https://easy-editor-docs.vercel.app/",target:"_blank",underline:!0,rotation:0,opacity:100,background:"transparent",$data:y("点击跳转")},$dashboard:{rect:{width:120,height:40}}}},{title:"标签文本",screenshot:"",schema:{componentName:b,title:"标签文本",props:{fontSize:14,color:"#ffffff",textAlign:"center",verticalAlign:"middle",rotation:0,opacity:100,background:"rgba(0, 212, 255, 0.2)",$data:y("标签")},$dashboard:{rect:{width:80,height:32}}}}]};e.component=({ref:e,$data:n,__dataSource:h,fontSize:x=16,fontWeight:b="normal",fontFamily:y="inherit",color:S="#ffffff",textAlign:v="left",verticalAlign:k="middle",lineHeight:w=1.5,letterSpacing:N=0,isLink:V=!1,href:P="",target:C="_blank",underline:E=!1,glowEnable:$=!1,glowColor:A="#00d4ff",glowIntensity:M=1,rotation:T=0,opacity:j=100,background:z="transparent",style:I,onClick:F,onDoubleClick:L,onMouseEnter:D,onMouseLeave:R})=>{const O=t.useMemo(()=>{if(!n)return"";let e=[];if("static"===n.sourceType)e=Array.isArray(n.staticData)?n.staticData:[];else if("global"===n.sourceType&&n.datasourceId){const t=h?.page?.[n.datasourceId];e=_(t)}else if("datasource"===n.sourceType&&n.datasourceId){const t=h?.component?.[n.datasourceId];e=_(t)}const t=function(e,t){return t&&0!==t.length?e.map(e=>{const o={};for(const{componentField:n,sourceField:r}of t)n&&r&&(o[n]=g(e,r));return o}):e}(e,n.fieldMappings);return t.length>0&&void 0!==t[0].text?String(t[0].text):""},[n,h]),W={fontSize:x,fontWeight:b,fontFamily:y,color:S,lineHeight:w,letterSpacing:N,textShadow:$?`0 0 ${10*M}px ${A}, 0 0 ${20*M}px ${A}, 0 0 ${30*M}px ${A}`:void 0},B={...I,transform:0!==T?`rotate(${T}deg)`:void 0,opacity:j/100,backgroundColor:z},q=r(a,(e=>{switch(e){case"left":default:return c;case"center":return p;case"right":return d}})(v),(e=>{switch(e){case"top":return u;case"middle":default:return m;case"bottom":return f}})(k)),H=r(l,V&&i,E&&s);if(V&&P){const t="_blank"===C?"noopener noreferrer":"";return o.jsx("div",{className:q,ref:e,style:B,onClick:F,onDoubleClick:L,onMouseEnter:D,onMouseLeave:R,children:o.jsx("a",{className:H,href:P,rel:t,style:W,target:C,children:O})})}return o.jsx("div",{className:q,ref:e,style:B,onClick:F,onDoubleClick:L,onMouseEnter:D,onMouseLeave:R,children:o.jsx("span",{className:H,style:W,children:O})})},e.meta=S});
package/dist/meta.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsTextMeta={})}(this,function(e){"use strict";const t=(e,t,a)=>({type:"group",title:e,setter:{componentName:"CollapseSetter",props:{icon:!1,...a}},items:t}),a={name:"nodeInfo",title:"节点信息",setter:"NodeInfoSetter",extraProps:{label:!1}},o="EasyEditorMaterialsText",r=e=>({sourceType:"static",staticData:[{text:e}],fieldMappings:[{componentField:"text",sourceField:"text"}]});const l={componentName:o,title:"文本",group:"basic",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-text",version:"0.0.16",globalName:o,componentName:o},configure:{props:[{type:"group",title:"属性",setter:"TabSetter",items:[{type:"group",key:"config",title:"配置",items:[a,t("基础配置",[{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}},{name:"rotation",title:"旋转角度",setter:{componentName:"SliderSetter",props:{min:0,max:360,suffix:"°"}},extraProps:{defaultValue:0}},{name:"opacity",title:"不透明度",setter:{componentName:"SliderSetter",props:{min:0,max:100,suffix:"%"}},extraProps:{defaultValue:100}},{name:"background",title:"背景颜色",setter:"ColorSetter",extraProps:{defaultValue:"transparent"}}]),t("组件配置",[{type:"group",title:"组件配置",setter:"SubTabSetter",items:[{type:"group",key:"content",title:"内容",items:[{name:"isLink",title:"作为链接",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"href",title:"链接地址",setter:"StringSetter"},{name:"target",title:"打开方式",setter:{componentName:"SelectSetter",props:{options:[{label:"新窗口",value:"_blank"},{label:"当前窗口",value:"_self"}]}},extraProps:{defaultValue:"_blank"}}]},{type:"group",key:"font",title:"字体",items:[{name:"fontSize",title:"字体大小",setter:"NumberSetter",extraProps:{defaultValue:16}},{name:"fontWeight",title:"字体粗细",setter:{componentName:"SelectSetter",props:{options:[{label:"正常",value:"normal"},{label:"粗体",value:"bold"}]}},extraProps:{defaultValue:"normal"}},{name:"color",title:"颜色",setter:"ColorSetter",extraProps:{defaultValue:"#ffffff"}},{name:"lineHeight",title:"行高",setter:"NumberSetter",extraProps:{defaultValue:1.5}}]},{type:"group",key:"align",title:"对齐",items:[{name:"textAlign",title:"水平对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},extraProps:{defaultValue:"left"}},{name:"verticalAlign",title:"垂直对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"上",value:"top"},{label:"中",value:"middle"},{label:"下",value:"bottom"}]}},extraProps:{defaultValue:"middle"}}]},{type:"group",key:"effect",title:"效果",items:[{name:"underline",title:"下划线",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowEnable",title:"发光效果",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowColor",title:"发光颜色",setter:"ColorSetter",extraProps:{defaultValue:"#00d4ff"}}]}]}],{padding:"6px 16px 12px"})]},{type:"group",key:"data",title:"数据",items:[a,{name:"$data",title:"数据配置",setter:{componentName:"DataSetter",props:{expectedFields:[{name:"text",label:"text",type:"string",required:!0,description:"文本内容"}],showPreview:!0,previewLimit:10}},extraProps:{label:!1}}]},{type:"group",key:"advanced",title:"高级",items:[a,t("事件绑定",[{name:"events",title:"事件",setter:{componentName:"EventSetter",props:{events:[{title:"点击事件",children:[{label:"点击",value:"onClick",description:"鼠标点击时触发"},{label:"双击",value:"onDoubleClick",description:"鼠标双击时触发"}]},{title:"鼠标事件",children:[{label:"鼠标进入",value:"onMouseEnter",description:"鼠标进入时触发"},{label:"鼠标离开",value:"onMouseLeave",description:"鼠标离开时触发"}]}]}},extraProps:{label:!1}}]),t("高级配置",[{title:"条件渲染",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getNode().getExtraPropValue("condition"),setValue(e,t){e.getNode().setExtraProp("condition",t)}}}])]}]}],component:{},supports:{},advanced:{}},snippets:[{title:"普通文本",screenshot:"",schema:{componentName:o,title:"普通文本",props:{fontSize:16,color:"#ffffff",rotation:0,opacity:100,background:"transparent",$data:r("普通文本")},$dashboard:{rect:{width:120,height:40}}}},{title:"标题文本",screenshot:"",schema:{componentName:o,title:"标题文本",props:{fontSize:32,fontWeight:"bold",color:"#ffffff",textAlign:"center",rotation:0,opacity:100,background:"transparent",$data:r("标题文本")},$dashboard:{rect:{width:200,height:60}}}},{title:"发光标题",screenshot:"",schema:{componentName:o,title:"发光标题",props:{fontSize:36,fontWeight:"bold",color:"#00d4ff",textAlign:"center",glowEnable:!0,glowColor:"#00d4ff",glowIntensity:1.5,rotation:0,opacity:100,background:"transparent",$data:r("发光标题")},$dashboard:{rect:{width:240,height:80}}}},{title:"链接文本",screenshot:"",schema:{componentName:o,title:"链接文本",props:{fontSize:16,color:"#00d4ff",isLink:!0,href:"https://easy-editor-docs.vercel.app/",target:"_blank",underline:!0,rotation:0,opacity:100,background:"transparent",$data:r("点击跳转")},$dashboard:{rect:{width:120,height:40}}}},{title:"标签文本",screenshot:"",schema:{componentName:o,title:"标签文本",props:{fontSize:14,color:"#ffffff",textAlign:"center",verticalAlign:"middle",rotation:0,opacity:100,background:"rgba(0, 212, 255, 0.2)",$data:r("标签")},$dashboard:{rect:{width:80,height:32}}}}]};e.meta=l});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsTextMeta={})}(this,function(e){"use strict";const t=(e,t,a)=>({type:"group",title:e,setter:{componentName:"CollapseSetter",props:{icon:!1,...a}},items:t}),a={name:"nodeInfo",title:"节点信息",setter:"NodeInfoSetter",extraProps:{label:!1}},o="EasyEditorMaterialsText",r=e=>({sourceType:"static",staticData:[{text:e}],fieldMappings:[{componentField:"text",sourceField:"text"}]});const l={componentName:o,title:"文本",group:"basic",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-text",version:"0.0.18",globalName:o,componentName:o},configure:{props:[{type:"group",title:"属性",setter:"TabSetter",items:[{type:"group",key:"config",title:"配置",items:[a,t("基础配置",[{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}},{name:"rotation",title:"旋转角度",setter:{componentName:"SliderSetter",props:{min:0,max:360,suffix:"°"}},extraProps:{defaultValue:0}},{name:"opacity",title:"不透明度",setter:{componentName:"SliderSetter",props:{min:0,max:100,suffix:"%"}},extraProps:{defaultValue:100}},{name:"background",title:"背景颜色",setter:"ColorSetter",extraProps:{defaultValue:"transparent"}}]),t("组件配置",[{type:"group",title:"组件配置",setter:"SubTabSetter",items:[{type:"group",key:"content",title:"内容",items:[{name:"isLink",title:"作为链接",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"href",title:"链接地址",setter:"StringSetter"},{name:"target",title:"打开方式",setter:{componentName:"SelectSetter",props:{options:[{label:"新窗口",value:"_blank"},{label:"当前窗口",value:"_self"}]}},extraProps:{defaultValue:"_blank"}}]},{type:"group",key:"font",title:"字体",items:[{name:"fontSize",title:"字体大小",setter:"NumberSetter",extraProps:{defaultValue:16}},{name:"fontWeight",title:"字体粗细",setter:{componentName:"SelectSetter",props:{options:[{label:"正常",value:"normal"},{label:"粗体",value:"bold"}]}},extraProps:{defaultValue:"normal"}},{name:"color",title:"颜色",setter:"ColorSetter",extraProps:{defaultValue:"#ffffff"}},{name:"lineHeight",title:"行高",setter:"NumberSetter",extraProps:{defaultValue:1.5}}]},{type:"group",key:"align",title:"对齐",items:[{name:"textAlign",title:"水平对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},extraProps:{defaultValue:"left"}},{name:"verticalAlign",title:"垂直对齐",setter:{componentName:"SegmentedSetter",props:{options:[{label:"上",value:"top"},{label:"中",value:"middle"},{label:"下",value:"bottom"}]}},extraProps:{defaultValue:"middle"}}]},{type:"group",key:"effect",title:"效果",items:[{name:"underline",title:"下划线",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowEnable",title:"发光效果",setter:"SwitchSetter",extraProps:{defaultValue:!1}},{name:"glowColor",title:"发光颜色",setter:"ColorSetter",extraProps:{defaultValue:"#00d4ff"}}]}]}],{padding:"6px 16px 12px"})]},{type:"group",key:"data",title:"数据",items:[a,{name:"$data",title:"数据配置",setter:{componentName:"DataSetter",props:{expectedFields:[{name:"text",label:"text",type:"string",required:!0,description:"文本内容"}],showPreview:!0,previewLimit:10}},extraProps:{label:!1}}]},{type:"group",key:"advanced",title:"高级",items:[a,t("事件绑定",[{name:"events",title:"事件",setter:{componentName:"EventSetter",props:{events:[{title:"点击事件",children:[{label:"点击",value:"onClick",description:"鼠标点击时触发"},{label:"双击",value:"onDoubleClick",description:"鼠标双击时触发"}]},{title:"鼠标事件",children:[{label:"鼠标进入",value:"onMouseEnter",description:"鼠标进入时触发"},{label:"鼠标离开",value:"onMouseLeave",description:"鼠标离开时触发"}]}]}},extraProps:{label:!1}}]),t("高级配置",[{title:"条件渲染",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getNode().getExtraPropValue("condition"),setValue(e,t){e.getNode().setExtraProp("condition",t)}}}])]}]}],component:{},supports:{},advanced:{}},snippets:[{title:"普通文本",screenshot:"",schema:{componentName:o,title:"普通文本",props:{fontSize:16,color:"#ffffff",rotation:0,opacity:100,background:"transparent",$data:r("普通文本")},$dashboard:{rect:{width:120,height:40}}}},{title:"标题文本",screenshot:"",schema:{componentName:o,title:"标题文本",props:{fontSize:32,fontWeight:"bold",color:"#ffffff",textAlign:"center",rotation:0,opacity:100,background:"transparent",$data:r("标题文本")},$dashboard:{rect:{width:200,height:60}}}},{title:"发光标题",screenshot:"",schema:{componentName:o,title:"发光标题",props:{fontSize:36,fontWeight:"bold",color:"#00d4ff",textAlign:"center",glowEnable:!0,glowColor:"#00d4ff",glowIntensity:1.5,rotation:0,opacity:100,background:"transparent",$data:r("发光标题")},$dashboard:{rect:{width:240,height:80}}}},{title:"链接文本",screenshot:"",schema:{componentName:o,title:"链接文本",props:{fontSize:16,color:"#00d4ff",isLink:!0,href:"https://easy-editor-docs.vercel.app/",target:"_blank",underline:!0,rotation:0,opacity:100,background:"transparent",$data:r("点击跳转")},$dashboard:{rect:{width:120,height:40}}}},{title:"标签文本",screenshot:"",schema:{componentName:o,title:"标签文本",props:{fontSize:14,color:"#ffffff",textAlign:"center",verticalAlign:"middle",rotation:0,opacity:100,background:"rgba(0, 212, 255, 0.2)",$data:r("标签")},$dashboard:{rect:{width:80,height:32}}}}]};e.meta=l});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-editor/materials-dashboard-text",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Text component for EasyEditor dashboard",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",