Changeset 2353937
- Timestamp:
- 08/06/2020 01:01:54 PM (6 years ago)
- Location:
- fria-single-value-chart/trunk
- Files:
-
- 15 edited
-
dist/blocks.build.js (modified) (1 diff)
-
dist/blocks.editor.build.css (modified) (1 diff)
-
dist/blocks.style.build.css (modified) (1 diff)
-
package-lock.json (modified) (1 diff)
-
package.json (modified) (1 diff)
-
plugin.php (modified) (1 diff)
-
readme.md (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
src/block/block.js (modified) (2 diffs)
-
src/block/editor.scss (modified) (1 diff)
-
src/block/style.scss (modified) (2 diffs)
-
src/components/EditableIndicatorArrow.js (modified) (2 diffs)
-
src/components/RenderIndicator.js (modified) (1 diff)
-
src/init.php (modified) (2 diffs)
-
tests/editableIndicatorArrow.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fria-single-value-chart/trunk/dist/blocks.build.js
r2344819 r2353937 1 !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){e.exports=React},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(0),o=n.n(r),a=n(11),l=n(12),c=n(13),i=n(14),u=(n.n(i),{thin:{component:l.a,label:Object(i.__)("Thin"),key:"thin"},simple:{component:a.a,label:Object(i.__)("Simple"),key:"simple"},trendline:{component:c.a,label:Object(i.__)("Trendline"),key:"trendline"}}),s=function(e){var t=e.type,n=void 0===t?"simple":t,r=e.rotation,a=e.color;return o.a.createElement(u[n].component,{rotation:r,color:a})};t.b=s},function(e,t){e.exports=wp.components},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return o});var r="#333333",o=function(e){return 7===e.length?[e[1]+e[2],e[3]+e[4],e[5]+e[6]].reduce(function(e,t){return e+parseInt(t,16)},0)>396?r:"#eeeeee":r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(5)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(6),a=(n.n(o),n(7)),l=(n.n(a),n(8)),c=n(15),i=n(16),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},__=wp.i18n.__,s=wp.editor.withColors;(0,wp.blocks.registerBlockType)("fria/ indicator",{title:__("FRI\u2027A Indicator"),icon:"arrow-up-alt",category:"common",keywords:[__("FRI\u2027A Indicator"),__("Metric"),__("KPI")],attributes:{config:{type:"object"},backgroundColor:{type:"string",default:"inherit"}},edit:s("backgroundColor")(function(e){var t=e.className,n=e.attributes,o=e.setAttributes,a=e.backgroundColor,c=e.setBackgroundColor,s=function(e){return function(t){o({config:Object.assign({},n.config,r({},e,t))})}};return wp.element.createElement("div",{className:t},wp.element.createElement(l.a,u({onChange:s},n.config,{background:a.color})),wp.element.createElement(i.a,{backgroundColor:a,setBackgroundColor:c,config:n.config,onChange:s}))}),save:function(e){var t=e.attributes,n=e.className;return wp.element.createElement("div",{className:n},wp.element.createElement(c.a,t.config))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";n(9);throw new Error('Cannot find module "./EditableParagraph"')},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(10)),a=n(1),l=function(e){var t=e.rotation,n=void 0===t?0:t,r=e.onChange,l=e.color,c=e.arrowType,i=function(){r((n+45)%360)};return wp.element.createElement("div",null,wp.element.createElement(a.b,{type:c,rotation:n,color:l}),wp.element.createElement(o.a,{onClick:i,color:l}))};t.a=l},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),function(e){var t=e.onClick,n=e.color,r=void 0===n?"#ffffff":n;return wp.element.createElement("button",{onClick:t,style:{color:r},className:"rotateIndicatorArrow"},wp.element.createElement("span",{className:"dashicons dashicons-image-rotate"}))});t.a=o},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(2)),a=(n.n(o),function(e){var t=e.color,n=e.rotation;return wp.element.createElement(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},wp.element.createElement(o.G,{"data-name":"Layer 2"},wp.element.createElement(o.Path,{fill:t,transform:"rotate("+(n+45)+" 12 12)",d:"M18 7.05a1 1 0 0 0-1-1L9 6a1 1 0 0 0 0 2h5.56l-8.27 8.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L16 9.42V15a1 1 0 0 0 1 1 1 1 0 0 0 1-1z"})))});t.a=a},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(2)),a=(n.n(o),function(e){var t=e.color,n=e.rotation;return wp.element.createElement(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},wp.element.createElement(o.G,{"data-name":"Layer 2"},wp.element.createElement(o.Path,{fill:t,transform:"rotate("+n+" 10 10)",d:"M1.729,9.212h14.656l-4.184-4.184c-0.307-0.306-0.307-0.801,0-1.107c0.305-0.306,0.801-0.306,1.106,0 l5.481,5.482c0.018,0.014,0.037,0.019,0.053,0.034c0.181,0.181,0.242,0.425,0.209,0.66c-0.004,0.038-0.012,0.071-0.021,0.109 c-0.028,0.098-0.075,0.188-0.143,0.271c-0.021,0.026-0.021,0.061-0.045,0.085c-0.015,0.016-0.034,0.02-0.051,0.033l-5.483,5.483 c-0.306,0.307-0.802,0.307-1.106,0c-0.307-0.305-0.307-0.801,0-1.105l4.184-4.185H1.729c-0.436,0-0.788-0.353-0.788-0.788 S1.293,9.212,1.729,9.212z"})))});t.a=a},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(2)),a=(n.n(o),function(e){var t=e.color,n=e.rotation;return wp.element.createElement(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},wp.element.createElement(o.G,{"data-name":"Layer 2"},wp.element.createElement(o.Path,{fill:t,transform:"rotate("+(n+45)+" 12 12)",d:"M21 7a.78.78 0 0 0 0-.21.64.64 0 0 0-.05-.17 1.1 1.1 0 0 0-.09-.14.75.75 0 0 0-.14-.17l-.12-.07a.69.69 0 0 0-.19-.1h-.2A.7.7 0 0 0 20 6h-5a1 1 0 0 0 0 2h2.83l-4 4.71-4.32-2.57a1 1 0 0 0-1.28.22l-5 6a1 1 0 0 0 .13 1.41A1 1 0 0 0 4 18a1 1 0 0 0 .77-.36l4.45-5.34 4.27 2.56a1 1 0 0 0 1.27-.21L19 9.7V12a1 1 0 0 0 2 0V7z"})))});t.a=a},function(e,t){e.exports=wp.i18n},function(e,t,n){"use strict";var r=n(1),o=n(3),a=function(e){var t=e.title,n=e.subtitle,a=e.rotation,l=e.backgroundColor,c=void 0===l?"#000000":l,i=e.borderRadius,u=e.font,s=e.arrowType,m=Object(o.b)(c),p={backgroundColor:c,borderRadius:i,maxHeight:"6em",color:m};return wp.element.createElement("div",{className:"indicator",style:p},wp.element.createElement("div",{className:"left"},wp.element.createElement("div",{className:"metric",style:{fontFamily:u}}," ",t," "),wp.element.createElement("div",{className:"subtitle",style:{fontFamily:u}},n)),wp.element.createElement("div",{className:"right"},wp.element.createElement(r.b,{type:s,rotation:a,color:m})))};t.a=a},function(e,t,n){"use strict";var r=n(1),o=wp.blockEditor,a=o.InspectorControls,l=o.PanelColorSettings,c=wp.components,i=c.TextControl,u=c.PanelBody,s=c.SelectControl,__=wp.i18n.__,m=function(e){var t=e.backgroundColor,n=e.setBackgroundColor,o=e.onChange,c=e.config;return wp.element.createElement(a,null,wp.element.createElement(u,{title:__("Configure FRI\u2027A Indicator")},wp.element.createElement(l,{title:__("Color Settings"),colorSettings:[{value:t.color,onChange:function(e){o("backgroundColor")(e),n(e)},label:__("Background Color")}]}),wp.element.createElement("h4",null," ",__("Font Settings")," "),wp.element.createElement(i,{value:c?c.font:"inherit",label:__("Set font (default is inherit)"),onChange:o("font")}),wp.element.createElement("h4",null," ",__("Arrow Type")),wp.element.createElement(s,{label:__("Select Arrow Type"),value:c?c.arrowType:"simple",options:Object.values(r.a).map(function(e){return{label:e.label,value:e.key}}),onChange:o("arrowType")})))};t.a=m}]);1 !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){e.exports=React},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(0),o=n.n(r),a=n(11),l=n(12),c=n(13),i=n(14),u=(n.n(i),{thin:{component:l.a,label:Object(i.__)("Thin"),key:"thin"},simple:{component:a.a,label:Object(i.__)("Simple"),key:"simple"},trendline:{component:c.a,label:Object(i.__)("Trendline"),key:"trendline"}}),s=function(e){var t=e.type,n=void 0===t?"simple":t,r=e.rotation,a=e.color;return o.a.createElement(u[n].component,{rotation:r,color:a})};t.b=s},function(e,t){e.exports=wp.components},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return o});var r="#333333",o=function(e){return 7===e.length?[e[1]+e[2],e[3]+e[4],e[5]+e[6]].reduce(function(e,t){return e+parseInt(t,16)},0)>396?r:"#eeeeee":r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(5)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(6),a=(n.n(o),n(7)),l=(n.n(a),n(8)),c=n(15),i=n(16),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},__=wp.i18n.__,s=wp.editor.withColors;(0,wp.blocks.registerBlockType)("fria/single-value-chart",{title:__("FRI\u2027A Single Value Chart"),icon:"arrow-up-alt",category:"common",keywords:[__("FRI\u2027A Single Value Chart"),__("Metric"),__("KPI"),__("Chart"),__("Single Value")],attributes:{config:{type:"object"},backgroundColor:{type:"string",default:"inherit"}},edit:s("backgroundColor")(function(e){var t=e.className,n=e.attributes,o=e.setAttributes,a=e.backgroundColor,c=e.setBackgroundColor,s=function(e){return function(t){o({config:Object.assign({},n.config,r({},e,t))})}};return wp.element.createElement("div",{className:t},wp.element.createElement(l.a,u({onChange:s},n.config,{background:a.color})),wp.element.createElement(i.a,{backgroundColor:a,setBackgroundColor:c,config:n.config,onChange:s}))}),save:function(e){var t=e.attributes,n=e.className;return wp.element.createElement("div",{className:n},wp.element.createElement(c.a,t.config))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";n(9);throw new Error('Cannot find module "./EditableParagraph"')},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(10)),a=n(1),l=function(e){var t=e.rotation,n=void 0===t?0:t,l=e.onChange,c=e.color,i=e.arrowType,u=function(){l((n+45)%360)};return wp.element.createElement(r.Fragment,null,wp.element.createElement(a.b,{type:i,rotation:n,color:c}),wp.element.createElement(o.a,{onClick:u,color:c}))};t.a=l},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),function(e){var t=e.onClick,n=e.color,r=void 0===n?"#ffffff":n;return wp.element.createElement("button",{onClick:t,style:{color:r},className:"rotateIndicatorArrow"},wp.element.createElement("span",{className:"dashicons dashicons-image-rotate"}))});t.a=o},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(2)),a=(n.n(o),function(e){var t=e.color,n=e.rotation;return wp.element.createElement(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},wp.element.createElement(o.G,{"data-name":"Layer 2"},wp.element.createElement(o.Path,{fill:t,transform:"rotate("+(n+45)+" 12 12)",d:"M18 7.05a1 1 0 0 0-1-1L9 6a1 1 0 0 0 0 2h5.56l-8.27 8.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L16 9.42V15a1 1 0 0 0 1 1 1 1 0 0 0 1-1z"})))});t.a=a},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(2)),a=(n.n(o),function(e){var t=e.color,n=e.rotation;return wp.element.createElement(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},wp.element.createElement(o.G,{"data-name":"Layer 2"},wp.element.createElement(o.Path,{fill:t,transform:"rotate("+n+" 10 10)",d:"M1.729,9.212h14.656l-4.184-4.184c-0.307-0.306-0.307-0.801,0-1.107c0.305-0.306,0.801-0.306,1.106,0 l5.481,5.482c0.018,0.014,0.037,0.019,0.053,0.034c0.181,0.181,0.242,0.425,0.209,0.66c-0.004,0.038-0.012,0.071-0.021,0.109 c-0.028,0.098-0.075,0.188-0.143,0.271c-0.021,0.026-0.021,0.061-0.045,0.085c-0.015,0.016-0.034,0.02-0.051,0.033l-5.483,5.483 c-0.306,0.307-0.802,0.307-1.106,0c-0.307-0.305-0.307-0.801,0-1.105l4.184-4.185H1.729c-0.436,0-0.788-0.353-0.788-0.788 S1.293,9.212,1.729,9.212z"})))});t.a=a},function(e,t,n){"use strict";var r=n(0),o=(n.n(r),n(2)),a=(n.n(o),function(e){var t=e.color,n=e.rotation;return wp.element.createElement(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},wp.element.createElement(o.G,{"data-name":"Layer 2"},wp.element.createElement(o.Path,{fill:t,transform:"rotate("+(n+45)+" 12 12)",d:"M21 7a.78.78 0 0 0 0-.21.64.64 0 0 0-.05-.17 1.1 1.1 0 0 0-.09-.14.75.75 0 0 0-.14-.17l-.12-.07a.69.69 0 0 0-.19-.1h-.2A.7.7 0 0 0 20 6h-5a1 1 0 0 0 0 2h2.83l-4 4.71-4.32-2.57a1 1 0 0 0-1.28.22l-5 6a1 1 0 0 0 .13 1.41A1 1 0 0 0 4 18a1 1 0 0 0 .77-.36l4.45-5.34 4.27 2.56a1 1 0 0 0 1.27-.21L19 9.7V12a1 1 0 0 0 2 0V7z"})))});t.a=a},function(e,t){e.exports=wp.i18n},function(e,t,n){"use strict";var r=n(1),o=n(3),a=function(e){var t=e.title,n=e.subtitle,a=e.rotation,l=e.backgroundColor,c=void 0===l?"#000000":l,i=e.borderRadius,u=e.font,s=e.arrowType,m=Object(o.b)(c),p={backgroundColor:c,borderRadius:i,maxHeight:"6em",color:m};return wp.element.createElement("div",{className:"indicator",style:p},wp.element.createElement("div",{className:"left"},wp.element.createElement("div",{className:"metric",style:{fontFamily:u}}," ",t," "),wp.element.createElement("div",{className:"subtitle",style:{fontFamily:u}},n)),wp.element.createElement("div",{className:"right"},wp.element.createElement(r.b,{type:s,rotation:a,color:m})))};t.a=a},function(e,t,n){"use strict";var r=n(1),o=wp.blockEditor,a=o.InspectorControls,l=o.PanelColorSettings,c=wp.components,i=c.TextControl,u=c.PanelBody,s=c.SelectControl,__=wp.i18n.__,m=function(e){var t=e.backgroundColor,n=e.setBackgroundColor,o=e.onChange,c=e.config;return wp.element.createElement(a,null,wp.element.createElement(u,{title:__("Configure FRI\u2027A Indicator")},wp.element.createElement(l,{title:__("Color Settings"),colorSettings:[{value:t.color,onChange:function(e){o("backgroundColor")(e),n(e)},label:__("Background Color")}]}),wp.element.createElement("h4",null," ",__("Font Settings")," "),wp.element.createElement(i,{value:c?c.font:"inherit",label:__("Set font (default is inherit)"),onChange:o("font")}),wp.element.createElement("h4",null," ",__("Arrow Type")),wp.element.createElement(s,{label:__("Select Arrow Type"),value:c?c.arrowType:"simple",options:Object.values(r.a).map(function(e){return{label:e.label,value:e.key}}),onChange:o("arrowType")})))};t.a=m}]); -
fria-single-value-chart/trunk/dist/blocks.editor.build.css
r2344819 r2353937 1 .wp-block- cgb-block-wp-fria-metrics-indicator{color:#292929;margin:0 auto;max-width:740px;padding:2rem}1 .wp-block-fria-single-value-chart{color:#292929;margin:0 auto;max-width:740px;padding:2rem} -
fria-single-value-chart/trunk/dist/blocks.style.build.css
r2344819 r2353937 1 .wp-block-fria- indicator .indicator{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;border-radius:10px;background-color:teal;-webkit-box-shadow:1px 1px 3px 0px rgba(0,0,0,0.6);box-shadow:1px 1px 3px 0px rgba(0,0,0,0.6);max-width:400px}.wp-block-fria-indicator .indicator div.left{min-width:70%;max-width:70%;min-height:90px;padding-left:1em}.wp-block-fria-indicator .indicator div.left input[type=text]{display:-ms-flexbox;display:flex;min-height:1.8em;word-wrap:break-word;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;overflow:hidden;background-color:transparent;border-color:transparent;width:100%}.wp-block-fria-indicator .indicator div.left input[type=text].dark::-webkit-input-placeholder{color:#000}.wp-block-fria-indicator .indicator div.left input[type=text].dark::-moz-placeholder{color:#000}.wp-block-fria-indicator .indicator div.left input[type=text].dark::-ms-input-placeholder{color:#000}.wp-block-fria-indicator .indicator div.left input[type=text].dark::placeholder{color:#000}.wp-block-fria-indicator .indicator div.left input[type=text].light::-webkit-input-placeholder{color:#fff}.wp-block-fria-indicator .indicator div.left input[type=text].light::-moz-placeholder{color:#fff}.wp-block-fria-indicator .indicator div.left input[type=text].light::-ms-input-placeholder{color:#fff}.wp-block-fria-indicator .indicator div.left input[type=text].light::placeholder{color:#fff}.wp-block-fria-indicator .indicator div.left .metric{font-size:36px;font-weight:700;line-height:36px;margin-top:10px}.wp-block-fria-indicator .indicator div.left .subtitle{margin-bottom:5px}.wp-block-fria-indicator .indicator div.right{max-width:30%;padding-right:1em}.wp-block-fria-indicator .indicator div.right svg{max-height:100%}.rotateIndicatorArrow{position:absolute;bottom:5px;right:5px;background:transparent;border:none;cursor:pointer;-webkit-transform:rotateY(180deg);transform:rotateY(180deg);color:#fff}1 .wp-block-fria-single-value-chart .indicator{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;border-radius:10px;background-color:teal;-webkit-box-shadow:1px 1px 3px 0px rgba(0,0,0,0.6);box-shadow:1px 1px 3px 0px rgba(0,0,0,0.6);max-width:400px}.wp-block-fria-single-value-chart .indicator div.left{min-width:70%;max-width:70%;min-height:90px;padding-left:1em}.wp-block-fria-single-value-chart .indicator div.left input[type=text]{display:-ms-flexbox;display:flex;min-height:1.8em;word-wrap:break-word;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;overflow:hidden;background-color:transparent;border-color:transparent;width:100%}.wp-block-fria-single-value-chart .indicator div.left input[type=text].dark::-webkit-input-placeholder{color:#000}.wp-block-fria-single-value-chart .indicator div.left input[type=text].dark::-moz-placeholder{color:#000}.wp-block-fria-single-value-chart .indicator div.left input[type=text].dark::-ms-input-placeholder{color:#000}.wp-block-fria-single-value-chart .indicator div.left input[type=text].dark::placeholder{color:#000}.wp-block-fria-single-value-chart .indicator div.left input[type=text].light::-webkit-input-placeholder{color:#fff}.wp-block-fria-single-value-chart .indicator div.left input[type=text].light::-moz-placeholder{color:#fff}.wp-block-fria-single-value-chart .indicator div.left input[type=text].light::-ms-input-placeholder{color:#fff}.wp-block-fria-single-value-chart .indicator div.left input[type=text].light::placeholder{color:#fff}.wp-block-fria-single-value-chart .indicator div.left .metric{font-size:36px;font-weight:700;line-height:36px;margin-top:10px}.wp-block-fria-single-value-chart .indicator div.left .subtitle{margin-bottom:5px}.wp-block-fria-single-value-chart .indicator div.right{max-width:30%;padding-right:1em;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.wp-block-fria-single-value-chart .indicator div.right svg{-ms-flex-positive:5;flex-grow:5}.wp-block-fria-single-value-chart .indicator div.right .rotateIndicatorArrow{-ms-flex-positive:1;flex-grow:1;background:transparent;border:none;cursor:pointer;-webkit-transform:rotateY(180deg);transform:rotateY(180deg);margin:0 auto;justify-self:flex-end;color:#fff} -
fria-single-value-chart/trunk/package-lock.json
r2344819 r2353937 1 1 { 2 "name": "wp-fria- metrics-indicator-cgb-guten-block",2 "name": "wp-fria-single-value-chart", 3 3 "version": "1.0.0", 4 4 "lockfileVersion": 1, -
fria-single-value-chart/trunk/package.json
r2344819 r2353937 1 1 { 2 "name": "wp-fria- metrics-indicator-cgb-guten-block",2 "name": "wp-fria-single-value-chart", 3 3 "version": "1.0.0", 4 4 "private": true, -
fria-single-value-chart/trunk/plugin.php
r2345372 r2353937 6 6 * Author: Fabian Biberger 7 7 * Author URI: https://fbiberger.de/ 8 * Version: 1.0. 0.48 * Version: 1.0.1 9 9 * License: GPL2+ 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt -
fria-single-value-chart/trunk/readme.md
r2344819 r2353937 1 1 ## What does this plugin do? 2 This plugin is a Gutenberg-Block that displays a basic indicatorfor a KPI or metric. It is very basic and has the following features at the moment:2 This plugin is a Gutenberg-Block that displays a basic single value chart for a KPI or metric. It is very basic and has the following features at the moment: 3 3 - Change Metric and Subtitle 4 - Change rotation for the Arrow Indicator4 - Change rotation for the Arrow 5 5 - Change background color (foreground color is adjusted automatically) 6 - Change font for the indicator6 - Change font for the chart 7 7 - Select one of three different arrow types 8 8 … … 15 15 - Adjust font sizes 16 16 - Adjust sizing 17 - Choose your own arrow indicators17 - Add your own arrow-images 18 18 - Adjust background shadow 19 19 - Adjust foreground colors … … 27 27 ### Development 28 28 - Clone this repository into the plugin folder of your wordpress installation 29 - `cd {your-installation-path}/wp-content/plugins/fria- indicator`29 - `cd {your-installation-path}/wp-content/plugins/fria-single-value-chart` 30 30 - `npm install` 31 31 -
fria-single-value-chart/trunk/readme.txt
r2344819 r2353937 3 3 Tags: charts, gutenberg, block, single value, arrow 4 4 Requires at least: 5.3 5 Tested up to: 5. 45 Tested up to: 5.5 6 6 Requires PHP: 7.3 7 7 License: GPL2+ … … 18 18 19 19 == Installation == 20 1. Visit \"Plugins > Add New\"21 2. Search for \"FRIA Single Value Chart\"22 3. Install \"FRIA Single Value Chart\" once it appears23 4. Activate \"FRIA Single Value Chart\" from your Plugins page.20 1. Visit "Plugins > Add New" 21 2. Search for "FRIA Single Value Chart" 22 3. Install "FRIA Single Value Chart" once it appears 23 4. Activate "FRIA Single Value Chart" from your Plugins page. 24 24 25 25 =Manually= 26 26 1. Upload the fria-single-value-chart folder to the /wp-content/plugins/ directory 27 2. Activate \"FRIA Single Value Chart\" from your Plugins page.27 2. Activate "FRIA Single Value Chart" from your Plugins page. 28 28 29 29 =After activation= … … 39 39 40 40 == Changelog == 41 =Version 1.0.1= 42 * Renamed the blocks - sorry for that, but the directory did not show them correctly 43 * Fixed the case where the rotation UI was not shown and repositioned it 44 41 45 =Version 1.0= 42 46 * Change arrowType and orientation orientation -
fria-single-value-chart/trunk/src/block/block.js
r2344819 r2353937 1 1 /** 2 * BLOCK: wp-fria- metrics-indicator2 * BLOCK: wp-fria-single-value-chart 3 3 * 4 4 * Registering a basic block with Gutenberg. … … 16 16 const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks 17 17 18 registerBlockType( 'fria/ indicator', {19 title: __( 'FRI‧A Indicator' ),18 registerBlockType( 'fria/single-value-chart', { 19 title: __( 'FRI‧A Single Value Chart' ), 20 20 icon: 'arrow-up-alt', 21 21 category: 'common', 22 22 keywords: [ 23 __( 'FRI‧A Indicator' ),23 __( 'FRI‧A Single Value Chart' ), 24 24 __( 'Metric' ), 25 25 __( 'KPI' ), 26 __( 'Chart' ), 27 __( 'Single Value' ), 26 28 ], 27 29 attributes: { -
fria-single-value-chart/trunk/src/block/editor.scss
r2344819 r2353937 6 6 */ 7 7 8 .wp-block- cgb-block-wp-fria-metrics-indicator{8 .wp-block-fria-single-value-chart { 9 9 color: $black; 10 10 margin: 0 auto; -
fria-single-value-chart/trunk/src/block/style.scss
r2344819 r2353937 5 5 */ 6 6 7 .wp-block-fria- indicator{7 .wp-block-fria-single-value-chart { 8 8 9 9 .indicator { … … 56 56 max-width: 30%; 57 57 padding-right: 1em; 58 display: flex; 59 flex-direction: column; 60 58 61 svg { 59 max-height: 100%; 62 flex-grow: 5; 63 } 64 65 .rotateIndicatorArrow { 66 flex-grow: 1; 67 background: transparent; 68 border: none; 69 cursor: pointer; 70 transform: rotateY(180deg); 71 margin: 0 auto; 72 justify-self: flex-end; 73 74 color: #fff; 60 75 } 61 76 } 62 77 } 63 78 } 64 65 .rotateIndicatorArrow {66 position: absolute;67 bottom: 5px;68 right: 5px;69 background: transparent;70 border: none;71 cursor: pointer;72 transform: rotateY(180deg);73 74 color: #fff;75 } -
fria-single-value-chart/trunk/src/components/EditableIndicatorArrow.js
r2344819 r2353937 1 import React from 'react';1 import React, { Fragment } from 'react'; 2 2 import RotatableIndicatorArrow from './RotatableIndicatorArrow'; 3 3 import Arrow from './arrows/genericArrow'; … … 10 10 11 11 return ( 12 < div>12 <Fragment> 13 13 <Arrow type={ arrowType } rotation={ rotation } color={ color } /> 14 14 <RotatableIndicatorArrow onClick={ handleClick } color={ color } /> 15 </ div>15 </Fragment> 16 16 ); 17 17 }; -
fria-single-value-chart/trunk/src/components/RenderIndicator.js
r2344819 r2353937 18 18 <Arrow type={ arrowType } rotation={ rotation } color={ color } /> 19 19 </div> 20 </div>; 20 </div>; 21 21 }; 22 22 -
fria-single-value-chart/trunk/src/init.php
r2344819 r2353937 78 78 */ 79 79 register_block_type( 80 ' cgb/block-wp-fria-metrics-indicator',80 'fria/single-value-chart', 81 81 array( 82 82 // Enqueue blocks.style.build.css on both frontend & backend. … … 88 88 ) 89 89 ); 90 91 // register_post_meta('post', 'wp-fria-indicator-config', array(92 // 'show_in_rest' => array(93 // 'schema' => array(94 // 'type' => 'object',95 // 'properties' => array(96 // 'title' => array(97 // 'type' => 'string',98 // ),99 // 'subtitle' => array(100 // 'type' => 'string',101 // ),102 // 'indicator' => array(103 // 'type' => 'string',104 // ),105 // 'background' => array(106 // 'type' => 'string',107 // ),108 // 'borderRadius' => array(109 // 'type' => 'string',110 // ),111 // ),112 // )113 // ),114 // 'single' => true,115 // 'type' => 'object'116 // ));117 90 } 118 91 -
fria-single-value-chart/trunk/tests/editableIndicatorArrow.test.js
r2344819 r2353937 11 11 12 12 const tree = renderedComponent.toJSON(); 13 tree. children.filter( child => ( child.type === 'button' ) )[ 0 ].props.onClick();13 tree.filter( child => ( child.type === 'button' ) )[ 0 ].props.onClick(); 14 14 15 15 expect( mockHandleClick ).toHaveBeenCalledWith( 45 );
Note: See TracChangeset
for help on using the changeset viewer.