diff --git a/blocks/accordion-controller/build/index.asset.php b/blocks/accordion-controller/build/index.asset.php index d049cc208..f61b11dc9 100644 --- a/blocks/accordion-controller/build/index.asset.php +++ b/blocks/accordion-controller/build/index.asset.php @@ -1 +1 @@ - array('classnames', 'prc-block-utils', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'fe5949887c2247c8b447'); + array('classnames', 'prc-block-utils', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '589c188e7bd836db5cd8'); diff --git a/blocks/accordion-controller/build/index.js b/blocks/accordion-controller/build/index.js index 37ab2755c..0b1809e0c 100644 --- a/blocks/accordion-controller/build/index.js +++ b/blocks/accordion-controller/build/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var o,e={924:(o,e,t)=>{const r=window.wp.blocks,n=window.React,l=window.classnames;var c=t.n(l);const i=window.prcBlockUtils,a=window.wp.element,s=window.wp.blockEditor,d=window.wp.i18n;function u({colors:o,clientId:e}){const t=(0,s.__experimentalUseMultipleOriginColorsAndGradients)(),{titleBackgroundColor:r,setTitleBackgroundColor:l,titleTextColor:c,setTitleTextColor:i,contentBackgroundColor:a,setContentBackgroundColor:u,contentTextColor:p,setContentTextColor:C}=o;return(0,n.createElement)(s.InspectorControls,{group:"color"},(0,n.createElement)(s.__experimentalColorGradientSettingsDropdown,{settings:[{colorValue:c?.color,onColorChange:i,label:(0,d.__)("Title Text")},{colorValue:r?.color,onColorChange:l,label:(0,d.__)("Title Background")},{colorValue:p?.color,onColorChange:C,label:(0,d.__)("Content Text")},{colorValue:a?.color,onColorChange:u,label:(0,d.__)("Content Background")}],panelId:e,hasColorsOrGradients:!1,disableCustomColors:!0,__experimentalIsRenderedInSidebar:!0,...t}))}const p=["prc-block/accordion"],C=(0,s.withColors)({contentTextColor:"color"},{contentBackgroundColor:"color"},{titleBackgroundColor:"color"},{titleTextColor:"color"})((function({attributes:o,className:e,titleBackgroundColor:t,setTitleBackgroundColor:r,titleTextColor:l,setTitleTextColor:d,contentBackgroundColor:C,setContentBackgroundColor:g,contentTextColor:k,setContentTextColor:b,__unstableLayoutClassNames:x,clientId:m}){const f=(0,i.getBlockGapSupportValue)(o,"vertical"),w=(0,s.useBlockProps)({className:c()(e,x,{"has-block-gap":"0"!==f})}),B=(0,s.useInnerBlocksProps)(w,{allowedBlocks:p,orientation:"vertical",renderAppender:s.InnerBlocks.ButtonBlockAppender});return(0,n.createElement)(a.Fragment,null,(0,n.createElement)(u,{colors:{titleBackgroundColor:t,setTitleBackgroundColor:r,titleTextColor:l,setTitleTextColor:d,contentBackgroundColor:C,setContentBackgroundColor:g,contentTextColor:k,setContentTextColor:b},clientId:m}),(0,n.createElement)("div",{...B}))})),g=window.prcIcons,k=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/accordion-controller","version":"0.1.0","title":"Accordion Controller","category":"design","description":"Controls a group of accordion blocks.","attributes":{"titleBackgroundColor":{"type":"string"},"titleTextColor":{"type":"string"},"contentBackgroundColor":{"type":"string"},"contentTextColor":{"type":"string"}},"supports":{"anchor":true,"html":false,"color":{"link":true,"text":false,"background":false},"spacing":{"blockGap":{"sides":["vertical"]},"margin":["top","bottom"]},"__experimentalBorder":{"color":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"style":true,"width":true}},"typography":{"fontSize":true,"__experimentalFontFamily":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"layout":{"allowEditing":false,"default":{"type":"flex","orientation":"vertical"}},"interactivity":true},"example":{"attributes":{},"innerBlocks":[{"name":"prc-block/accordion","attributes":{"title":"Accordion 1"},"innerBlocks":[{"name":"core/paragraph","attributes":{"content":"Content 1"}}]},{"name":"prc-block/accordion","attributes":{"title":"Accordion 2"},"innerBlocks":[{"name":"core/paragraph","attributes":{"content":"Content 2"}}]}],"viewportWidth":640},"providesContext":{"prc-block/accordion-controller/content-background":"contentBackgroundColor","prc-block/accordion-controller/content-text":"contentTextColor","prc-block/accordion-controller/title-background":"titleBackgroundColor","prc-block/accordion-controller/title-text":"titleTextColor"},"textdomain":"accordion-controller","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewModule":"file:./view.js"}'),{name:b}=k,x={icon:function(){return(0,n.createElement)(g.NewIcon,{icon:"shutters",library:"solid"})},edit:C,save:function(){return(0,n.createElement)(s.InnerBlocks.Content,null)}};(0,r.registerBlockType)(b,{...k,...x})}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,r),l.exports}r.m=e,o=[],r.O=(e,t,n,l)=>{if(!t){var c=1/0;for(d=0;d=l)&&Object.keys(r.O).every((o=>r.O[o](t[a])))?t.splice(a--,1):(i=!1,l0&&o[d-1][2]>l;d--)o[d]=o[d-1];o[d]=[t,n,l]},r.n=o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return r.d(e,{a:e}),e},r.d=(o,e)=>{for(var t in e)r.o(e,t)&&!r.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},r.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),(()=>{var o={57:0,350:0};r.O.j=e=>0===o[e];var e=(e,t)=>{var n,l,[c,i,a]=t,s=0;if(c.some((e=>0!==o[e]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(a)var d=a(r)}for(e&&e(t);sr(924)));n=r.O(n)})(); +(()=>{"use strict";var o,e={177:(o,e,t)=>{const r=window.wp.blocks,n=window.React,l=window.classnames;var c=t.n(l);const i=window.prcBlockUtils,a=window.wp.element,s=window.wp.blockEditor,d=window.wp.i18n;function u({colors:o,clientId:e}){const t=(0,s.__experimentalUseMultipleOriginColorsAndGradients)(),{titleBackgroundColor:r,setTitleBackgroundColor:l,titleTextColor:c,setTitleTextColor:i,contentBackgroundColor:a,setContentBackgroundColor:u,contentTextColor:p,setContentTextColor:C}=o;return(0,n.createElement)(s.InspectorControls,{group:"color"},(0,n.createElement)(s.__experimentalColorGradientSettingsDropdown,{settings:[{colorValue:c?.color,onColorChange:i,label:(0,d.__)("Title Text")},{colorValue:r?.color,onColorChange:l,label:(0,d.__)("Title Background")},{colorValue:p?.color,onColorChange:C,label:(0,d.__)("Content Text")},{colorValue:a?.color,onColorChange:u,label:(0,d.__)("Content Background")}],panelId:e,hasColorsOrGradients:!1,disableCustomColors:!0,__experimentalIsRenderedInSidebar:!0,...t}))}const p=["prc-block/accordion"],C=(0,s.withColors)({contentTextColor:"color"},{contentBackgroundColor:"color"},{titleBackgroundColor:"color"},{titleTextColor:"color"})((function({attributes:o,className:e,titleBackgroundColor:t,setTitleBackgroundColor:r,titleTextColor:l,setTitleTextColor:d,contentBackgroundColor:C,setContentBackgroundColor:g,contentTextColor:k,setContentTextColor:b,__unstableLayoutClassNames:x,clientId:m}){const f=(0,i.getBlockGapSupportValue)(o,"vertical"),B=(0,s.useBlockProps)({className:c()(e,x,{"has-block-gap":"0"!==f})}),w=(0,s.useInnerBlocksProps)(B,{allowedBlocks:p,orientation:"vertical",renderAppender:s.InnerBlocks.ButtonBlockAppender});return(0,n.createElement)(a.Fragment,null,(0,n.createElement)(u,{colors:{titleBackgroundColor:t,setTitleBackgroundColor:r,titleTextColor:l,setTitleTextColor:d,contentBackgroundColor:C,setContentBackgroundColor:g,contentTextColor:k,setContentTextColor:b},clientId:m}),(0,n.createElement)("div",{...w}))})),g=window.prcIcons,k=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/accordion-controller","version":"0.1.0","title":"Accordion Controller","category":"design","description":"Controls a group of accordion blocks.","attributes":{"titleBackgroundColor":{"type":"string"},"titleTextColor":{"type":"string"},"contentBackgroundColor":{"type":"string"},"contentTextColor":{"type":"string"}},"supports":{"anchor":true,"html":false,"color":{"link":true,"text":false,"background":false},"spacing":{"blockGap":{"sides":["vertical"]},"margin":["top","bottom"]},"__experimentalBorder":{"color":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"style":true,"width":true}},"typography":{"fontSize":true,"__experimentalFontFamily":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"layout":{"allowEditing":false,"default":{"type":"flex","orientation":"vertical"}},"interactivity":true},"example":{"attributes":{},"innerBlocks":[{"name":"prc-block/accordion","attributes":{"title":"Accordion 1"},"innerBlocks":[{"name":"core/paragraph","attributes":{"content":"Content 1"}}]},{"name":"prc-block/accordion","attributes":{"title":"Accordion 2"},"innerBlocks":[{"name":"core/paragraph","attributes":{"content":"Content 2"}}]}],"viewportWidth":640},"providesContext":{"prc-block/accordion-controller/content-background":"contentBackgroundColor","prc-block/accordion-controller/content-text":"contentTextColor","prc-block/accordion-controller/title-background":"titleBackgroundColor","prc-block/accordion-controller/title-text":"titleTextColor"},"textdomain":"accordion-controller","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewModule":"file:./view.js"}'),{name:b}=k,x={icon:function(){return(0,n.createElement)(g.Icon,{icon:"shutters",library:"solid"})},edit:C,save:function(){return(0,n.createElement)(s.InnerBlocks.Content,null)}};(0,r.registerBlockType)(b,{...k,...x})}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,r),l.exports}r.m=e,o=[],r.O=(e,t,n,l)=>{if(!t){var c=1/0;for(d=0;d=l)&&Object.keys(r.O).every((o=>r.O[o](t[a])))?t.splice(a--,1):(i=!1,l0&&o[d-1][2]>l;d--)o[d]=o[d-1];o[d]=[t,n,l]},r.n=o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return r.d(e,{a:e}),e},r.d=(o,e)=>{for(var t in e)r.o(e,t)&&!r.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:e[t]})},r.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),(()=>{var o={826:0,431:0};r.O.j=e=>0===o[e];var e=(e,t)=>{var n,l,[c,i,a]=t,s=0;if(c.some((e=>0!==o[e]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(a)var d=a(r)}for(e&&e(t);sr(177)));n=r.O(n)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/blocks/accordion-controller/build/index.js.map b/blocks/accordion-controller/build/index.js.map index 2550a8472..41d263496 100644 --- a/blocks/accordion-controller/build/index.js.map +++ b/blocks/accordion-controller/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"uBAAIA,E,iBCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAmB,W,aCAxD,MAAM,EAA+BA,OAAsB,cCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAe,YCAzD,EAA+BA,OAAW,GAAQ,KCczC,SAASC,GAAS,OAAEC,EAAM,SAAEC,IAC1C,MAAMC,GAAgBC,EAAAA,EAAAA,sDAEhB,qBACLC,EAAoB,wBACpBC,EAAuB,eACvBC,EAAc,kBACdC,EAAiB,uBACjBC,EAAsB,0BACtBC,EAAyB,iBACzBC,EAAgB,oBAChBC,GACGX,EAEJ,OACCY,EAAAA,EAAAA,eAACC,EAAAA,kBAAiB,CAACC,MAAM,UACxBF,EAAAA,EAAAA,eAACG,EAAAA,4CAA6B,CAC7BC,SAAW,CACV,CACCC,WAAYX,GAAgBY,MAC5BC,cAAeZ,EACfa,OAAOC,EAAAA,EAAAA,IAAG,eAEX,CACCJ,WAAYb,GAAsBc,MAClCC,cAAed,EACfe,OAAOC,EAAAA,EAAAA,IAAG,qBAEX,CACCJ,WAAYP,GAAkBQ,MAC9BC,cAAeR,EACfS,OAAOC,EAAAA,EAAAA,IAAG,iBAEX,CACCJ,WAAYT,GAAwBU,MACpCC,cAAeV,EACfW,OAAOC,EAAAA,EAAAA,IAAG,wBAGZC,QAAUrB,EACVsB,sBAAuB,EACvBC,qBAAsB,EACtBC,mCAAiC,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AASkB,IAC5EH,OAAOa,eAAe5B,EAASkB,EAAK,CAAEW,YAAY,EAAMC,IAAKJ,EAAWR,IAE1E,ECNDtB,EAAoB+B,EAAI,CAACI,EAAKC,IAAUjB,OAAOkB,UAAUC,eAAeC,KAAKJ,EAAKC,G,MCKlF,IAAII,EAAkB,CACrB,GAAI,EACJ,IAAK,GAaNxC,EAAoBQ,EAAEU,EAAKuB,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BC,KACvD,IAGI3C,EAAUwC,GAHT/B,EAAUmC,EAAaC,GAAWF,EAGhB7B,EAAI,EAC3B,GAAGL,EAASqC,MAAMC,GAAgC,IAAxBR,EAAgBQ,KAAa,CACtD,IAAI/C,KAAY4C,EACZ7C,EAAoB+B,EAAEc,EAAa5C,KACrCD,EAAoBO,EAAEN,GAAY4C,EAAY5C,IAGhD,GAAG6C,EAAS,IAAIrC,EAASqC,EAAQ9C,EAClC,CAEA,IADG2C,GAA4BA,EAA2BC,GACrD7B,EAAIL,EAASM,OAAQD,IACzB0B,EAAU/B,EAASK,GAChBf,EAAoB+B,EAAES,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOzC,EAAoBQ,EAAEC,EAAO,EAGjCwC,EAAqBC,WAA6C,iCAAIA,WAA6C,kCAAK,GAC5HD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBtD,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FsD,EAAsBtD,EAAoBQ,EAAE8C,E","sources":["webpack://accordion-controller/webpack/runtime/chunk loaded","webpack://accordion-controller/external window [\"wp\",\"blocks\"]","webpack://accordion-controller/external window \"React\"","webpack://accordion-controller/external window \"classnames\"","webpack://accordion-controller/external window \"prcBlockUtils\"","webpack://accordion-controller/external window [\"wp\",\"element\"]","webpack://accordion-controller/external window [\"wp\",\"blockEditor\"]","webpack://accordion-controller/external window [\"wp\",\"i18n\"]","webpack://accordion-controller/./src/controls.jsx","webpack://accordion-controller/./src/edit.jsx","webpack://accordion-controller/external window \"prcIcons\"","webpack://accordion-controller/./src/index.js","webpack://accordion-controller/./src/icon.jsx","webpack://accordion-controller/./src/save.jsx","webpack://accordion-controller/webpack/bootstrap","webpack://accordion-controller/webpack/runtime/compat get default export","webpack://accordion-controller/webpack/runtime/define property getters","webpack://accordion-controller/webpack/runtime/hasOwnProperty shorthand","webpack://accordion-controller/webpack/runtime/jsonp chunk loading","webpack://accordion-controller/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { \n\tInspectorControls, \n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients\n } from '@wordpress/block-editor';\n\nexport default function Controls({ colors, clientId }) {\n\tconst colorSettings = useMultipleOriginColorsAndGradients();\n\n\tconst {\n\t\ttitleBackgroundColor,\n\t\tsetTitleBackgroundColor,\n\t\ttitleTextColor,\n\t\tsetTitleTextColor,\n\t\tcontentBackgroundColor,\n\t\tsetContentBackgroundColor,\n\t\tcontentTextColor,\n\t\tsetContentTextColor,\n\t} = colors;\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * External Dependencies\n */\nimport classNames from 'classnames';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInnerBlocks,\n\twithColors,\n} from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\nconst ALLOWED_BLOCKS = ['prc-block/accordion'];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nfunction Edit({\n\tattributes,\n\tclassName,\n\ttitleBackgroundColor,\n\tsetTitleBackgroundColor,\n\ttitleTextColor,\n\tsetTitleTextColor,\n\tcontentBackgroundColor,\n\tsetContentBackgroundColor,\n\tcontentTextColor,\n\tsetContentTextColor,\n\t__unstableLayoutClassNames: layoutClassNames,\n\tclientId,\n}) {\n\tconst blockGap = getBlockGapSupportValue(attributes, 'vertical');\n\n\tconst blockProps = useBlockProps({\n\t\tclassName: classNames( className, layoutClassNames, {\n\t\t\t'has-block-gap': \"0\" !== blockGap,\n\t\t} ),\n\t});\n\n\tconst innerBlocksProps = useInnerBlocksProps(blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\torientation: 'vertical',\n\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t});\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n\nexport default withColors(\n\t{ contentTextColor: 'color' },\n\t{ contentBackgroundColor: 'color' },\n\t{ titleBackgroundColor: 'color' },\n\t{ titleTextColor: 'color' },\n)(Edit);","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport './editor.scss';\nimport edit from './edit';\nimport icon from './icon';\nimport save from './save';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { icons, Icon, NewIcon } from '@prc/icons';\n\nexport default function () {\n\treturn (\n\t\t\n\t\t// \n\t);\n}\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save() {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0,\n\t350: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkaccordion_controller\"] = globalThis[\"webpackChunkaccordion_controller\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [350], () => (__webpack_require__(924)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","Controls","colors","clientId","colorSettings","useMultipleOriginColorsAndGradients","titleBackgroundColor","setTitleBackgroundColor","titleTextColor","setTitleTextColor","contentBackgroundColor","setContentBackgroundColor","contentTextColor","setContentTextColor","createElement","InspectorControls","group","ColorGradientSettingsDropdown","settings","colorValue","color","onColorChange","label","__","panelId","hasColorsOrGradients","disableCustomColors","__experimentalIsRenderedInSidebar","ALLOWED_BLOCKS","withColors","attributes","className","__unstableLayoutClassNames","layoutClassNames","blockGap","getBlockGapSupportValue","blockProps","useBlockProps","classNames","innerBlocksProps","useInnerBlocksProps","allowedBlocks","orientation","renderAppender","InnerBlocks","ButtonBlockAppender","Fragment","name","metadata","icon","NewIcon","library","edit","save","Content","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":"uBAAIA,E,iBCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAmB,W,aCAxD,MAAM,EAA+BA,OAAsB,cCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAe,YCAzD,EAA+BA,OAAW,GAAQ,KCczC,SAASC,GAAS,OAAEC,EAAM,SAAEC,IAC1C,MAAMC,GAAgBC,EAAAA,EAAAA,sDAEhB,qBACLC,EAAoB,wBACpBC,EAAuB,eACvBC,EAAc,kBACdC,EAAiB,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f,EAAoB+B,EAAES,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOzC,EAAoBQ,EAAEC,EAAO,EAGjCwC,EAAqBC,WAA6C,iCAAIA,WAA6C,kCAAK,GAC5HD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBtD,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FsD,EAAsBtD,EAAoBQ,EAAE8C,E","sources":["webpack://accordion-controller/webpack/runtime/chunk loaded","webpack://accordion-controller/external window [\"wp\",\"blocks\"]","webpack://accordion-controller/external window \"React\"","webpack://accordion-controller/external window \"classnames\"","webpack://accordion-controller/external window \"prcBlockUtils\"","webpack://accordion-controller/external window [\"wp\",\"element\"]","webpack://accordion-controller/external window [\"wp\",\"blockEditor\"]","webpack://accordion-controller/external window [\"wp\",\"i18n\"]","webpack://accordion-controller/./src/controls.jsx","webpack://accordion-controller/./src/edit.jsx","webpack://accordion-controller/external window \"prcIcons\"","webpack://accordion-controller/./src/index.js","webpack://accordion-controller/./src/icon.jsx","webpack://accordion-controller/./src/save.jsx","webpack://accordion-controller/webpack/bootstrap","webpack://accordion-controller/webpack/runtime/compat get default export","webpack://accordion-controller/webpack/runtime/define property getters","webpack://accordion-controller/webpack/runtime/hasOwnProperty shorthand","webpack://accordion-controller/webpack/runtime/jsonp chunk loading","webpack://accordion-controller/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { \n\tInspectorControls, \n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients\n } from '@wordpress/block-editor';\n\nexport default function Controls({ colors, clientId }) {\n\tconst colorSettings = useMultipleOriginColorsAndGradients();\n\n\tconst {\n\t\ttitleBackgroundColor,\n\t\tsetTitleBackgroundColor,\n\t\ttitleTextColor,\n\t\tsetTitleTextColor,\n\t\tcontentBackgroundColor,\n\t\tsetContentBackgroundColor,\n\t\tcontentTextColor,\n\t\tsetContentTextColor,\n\t} = colors;\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/**\n * External Dependencies\n */\nimport classNames from 'classnames';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInnerBlocks,\n\twithColors,\n} from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\nconst ALLOWED_BLOCKS = ['prc-block/accordion'];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nfunction Edit({\n\tattributes,\n\tclassName,\n\ttitleBackgroundColor,\n\tsetTitleBackgroundColor,\n\ttitleTextColor,\n\tsetTitleTextColor,\n\tcontentBackgroundColor,\n\tsetContentBackgroundColor,\n\tcontentTextColor,\n\tsetContentTextColor,\n\t__unstableLayoutClassNames: layoutClassNames,\n\tclientId,\n}) {\n\tconst blockGap = getBlockGapSupportValue(attributes, 'vertical');\n\n\tconst blockProps = useBlockProps({\n\t\tclassName: classNames( className, layoutClassNames, {\n\t\t\t'has-block-gap': \"0\" !== blockGap,\n\t\t} ),\n\t});\n\n\tconst innerBlocksProps = useInnerBlocksProps(blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\torientation: 'vertical',\n\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t});\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n\nexport default withColors(\n\t{ contentTextColor: 'color' },\n\t{ contentBackgroundColor: 'color' },\n\t{ titleBackgroundColor: 'color' },\n\t{ titleTextColor: 'color' },\n)(Edit);","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport './editor.scss';\nimport edit from './edit';\nimport icon from './icon';\nimport save from './save';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { Icon } from '@prc/icons';\n\nexport default function () {\n\treturn ;\n}\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save() {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t826: 0,\n\t431: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkaccordion_controller\"] = globalThis[\"webpackChunkaccordion_controller\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [431], () => (__webpack_require__(177)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","Controls","colors","clientId","colorSettings","useMultipleOriginColorsAndGradients","titleBackgroundColor","setTitleBackgroundColor","titleTextColor","setTitleTextColor","contentBackgroundColor","setContentBackgroundColor","contentTextColor","setContentTextColor","createElement","InspectorControls","group","ColorGradientSettingsDropdown","settings","colorValue","color","onColorChange","label","__","panelId","hasColorsOrGradients","disableCustomColors","__experimentalIsRenderedInSidebar","ALLOWED_BLOCKS","withColors","attributes","className","__unstableLayoutClassNames","layoutClassNames","blockGap","getBlockGapSupportValue","blockProps","useBlockProps","classNames","innerBlocksProps","useInnerBlocksProps","allowedBlocks","orientation","renderAppender","InnerBlocks","ButtonBlockAppender","Fragment","name","metadata","icon","Icon","library","edit","save","Content","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/form-field/build/index.asset.php b/blocks/form-field/build/index.asset.php index 0cca15b09..bb04a25de 100644 --- a/blocks/form-field/build/index.asset.php +++ b/blocks/form-field/build/index.asset.php @@ -1 +1 @@ - array('prc-block-utils', 'prc-components', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'bd467c18a6c74729d618'); + array('prc-block-utils', 'prc-components', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'ca9dd0638b59b30f5250'); diff --git a/blocks/form-field/build/index.js b/blocks/form-field/build/index.js index b6d4dfdeb..bca8c7155 100644 --- a/blocks/form-field/build/index.js +++ b/blocks/form-field/build/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={824:()=>{const e=window.wp.i18n,t=window.wp.blocks,r=window.React,l=window.prcBlockUtils,o=window.prcComponents,i=window.wp.element,n=window.wp.blockEditor,a=window.wp.data,c=window.wp.components;function s({attributes:e,setAttributes:t}){const{required:l}=e;return(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(c.PanelBody,{title:"Form Field Settings"},(0,r.createElement)(c.ToggleControl,{label:"Required",checked:l,onChange:e=>{t({required:e})}})))}function p({attributes:e,setAttributes:t,context:r}){}function u({attributes:e,setAttributes:t,context:l}){return(0,r.createElement)(i.Fragment,null,(0,r.createElement)(s,{attributes:e,setAttributes:t,context:l}),(0,r.createElement)(p,{attributes:e,setAttributes:t,context:l}))}window.wp.coreData;const m=["prc-block/form-input-text","prc-block/form-input-date"],d=[{name:"form-field-input-text",isDefault:!0,title:(0,e.__)("Form Input Text","prc-block-library"),excerpt:(0,e.__)("Form Input Text block...","prc-block-library"),attributes:{className:"is-style-form-field-input-text",allowedBlocks:["prc-block/form-input-text"]},innerBlocks:[["prc-block/form-input-text",{placeholder:"Text...",type:"text"}]],scope:["inserter","transform"],isActive:({className:e})=>!!e&&e.includes("is-style-form-field-input-text")},{name:"form-field-input-textarea",title:(0,e.__)("Form Input Text Area","prc-block-library"),excerpt:(0,e.__)("Form Input Text Area block...","prc-block-library"),attributes:{className:"is-style-form-field-input-textarea",allowedBlocks:["prc-block/form-input-text"]},innerBlocks:[["prc-block/form-input-text",{placeholder:"Text Area...",type:"textarea"}]],scope:["inserter","transform"],isActive:({className:e})=>!!e&&e.includes("is-style-form-field-input-textarea")},{name:"form-field-input-email",title:(0,e.__)("Form Input Email","prc-block-library"),excerpt:(0,e.__)("Form Input Email block...","prc-block-library"),attributes:{className:"is-style-form-field-input-email",allowedBlocks:["prc-block/form-input-text"]},innerBlocks:[["prc-block/form-input-text",{placeholder:"Email Address...",type:"email"}]],scope:["inserter","transform"],isActive:({className:e})=>!!e&&e.includes("is-style-form-field-input-email")},{name:"form-field-select",title:(0,e.__)("Form Input Select","prc-block-library"),excerpt:(0,e.__)("Form Select block...","prc-block-library"),attributes:{className:"is-style-form-field-select",allowedBlocks:["prc-block/form-input-select"]},innerBlocks:[["prc-block/form-input-select",{placeholder:"Select ...",type:"select"}]]}],f=window.prcIcons,b=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/form-field","version":"0.1.0","title":"Form Field","description":"A simple form field wrapper for input text blocks. Provides a label and required indicator.","category":"design","attributes":{"allowedBlocks":{"type":"array"},"required":{"type":"boolean","default":false},"label":{"type":"string","default":""},"style":{"type":"object","default":{"spacing":{"blockGap":"var:preset|spacing|10"}}}},"supports":{"anchor":true,"html":false,"spacing":{"blockGap":true,"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"padding":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"interactivity":true},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"only-label","label":"Only Label"}],"providesContext":{"prc-block/form-field/required":"required","prc-block/form-field/label":"label"},"usesContext":["prc-facets/template/facetType","prc-facets/template/facetName","prc-facets/template/facetLabel"],"textdomain":"form-field","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewModule":"file:./view.js"}'),{name:k}=b,x={icon:function(){return(0,r.createElement)(f.Icon,{icon:f.icons.faPenField,width:18,preserveAspectRatio:"xMidYMid meet"})},edit:function({attributes:c,setAttributes:s,context:p,clientId:d,isSelected:f,insertBlocksAfter:b}){const{allowedBlocks:k,label:x,required:y}=c,w=(0,n.useBlockProps)({required:y,style:{"--block-gap":(0,l.getBlockGapSupportValue)(c)}}),_=(0,n.useInnerBlocksProps)({},{allowedBlocks:k||m,templateLock:!0}),{currentVariation:v}=(0,a.useSelect)((e=>{const{getBlockVariations:t,getActiveBlockVariation:r}=e("core/blocks");return{currentVariation:r("prc-block/form-field",c)}}),[]),{insertBlock:g,moveBlockToPosition:h,selectNextBlock:B,updateBlockAttributes:F}=(0,a.useDispatch)("core/block-editor");return(0,r.createElement)(i.Fragment,null,(0,r.createElement)(u,{attributes:c,setAttributes:s,context:!1}),(0,r.createElement)("div",{...w},(0,r.createElement)(o.StyledComponentContext,{cacheKey:`form-field-${d}`},(0,r.createElement)(n.RichText,{tagName:"label",placeholder:(0,e.__)("Label","prc-block-library"),value:x,onChange:e=>{s({label:e})},__unstableOnSplitAtEnd:()=>(console.log("innerBlocksProps",_),void(e=>{const r=v?.attributes,l=(0,t.createBlocksFromInnerBlocksTemplate)(v?.innerBlocks);b((0,t.createBlock)("prc-block/form-field",{...r},l))})())}),(0,r.createElement)("div",{..._}))))},save:function({attributes:e}){return(0,r.createElement)(n.InnerBlocks.Content,null)},variations:d};(0,t.registerBlockType)(k,{...b,...x})}},r={};function l(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,l),i.exports}l.m=t,e=[],l.O=(t,r,o,i)=>{if(!r){var n=1/0;for(p=0;p=i)&&Object.keys(l.O).every((e=>l.O[e](r[c])))?r.splice(c--,1):(a=!1,i0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[r,o,i]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,r)=>{var o,i,[n,a,c]=r,s=0;if(n.some((t=>0!==e[t]))){for(o in a)l.o(a,o)&&(l.m[o]=a[o]);if(c)var p=c(l)}for(t&&t(r);sl(824)));o=l.O(o)})(); +(()=>{"use strict";var e,t={824:()=>{const e=window.wp.i18n,t=window.wp.blocks,r=window.React,l=window.prcBlockUtils,o=window.prcComponents,i=window.wp.element,n=window.wp.blockEditor,a=window.wp.data,c=window.wp.components;function s({attributes:e,setAttributes:t}){const{required:l}=e;return(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(c.PanelBody,{title:"Form Field Settings"},(0,r.createElement)(c.ToggleControl,{label:"Required",checked:l,onChange:e=>{t({required:e})}})))}function p({attributes:e,setAttributes:t,context:r}){}function u({attributes:e,setAttributes:t,context:l}){return(0,r.createElement)(i.Fragment,null,(0,r.createElement)(s,{attributes:e,setAttributes:t,context:l}),(0,r.createElement)(p,{attributes:e,setAttributes:t,context:l}))}window.wp.coreData;const m=["prc-block/form-input-text","prc-block/form-input-date"],d=[{name:"form-field-input-text",isDefault:!0,title:(0,e.__)("Form Input Text","prc-block-library"),excerpt:(0,e.__)("Form Input Text block...","prc-block-library"),attributes:{className:"is-style-form-field-input-text",allowedBlocks:["prc-block/form-input-text"]},innerBlocks:[["prc-block/form-input-text",{placeholder:"Text...",type:"text"}]],scope:["inserter","transform"],isActive:({className:e})=>!!e&&e.includes("is-style-form-field-input-text")},{name:"form-field-input-textarea",title:(0,e.__)("Form Input Text Area","prc-block-library"),excerpt:(0,e.__)("Form Input Text Area block...","prc-block-library"),attributes:{className:"is-style-form-field-input-textarea",allowedBlocks:["prc-block/form-input-text"]},innerBlocks:[["prc-block/form-input-text",{placeholder:"Text Area...",type:"textarea"}]],scope:["inserter","transform"],isActive:({className:e})=>!!e&&e.includes("is-style-form-field-input-textarea")},{name:"form-field-input-email",title:(0,e.__)("Form Input Email","prc-block-library"),excerpt:(0,e.__)("Form Input Email block...","prc-block-library"),attributes:{className:"is-style-form-field-input-email",allowedBlocks:["prc-block/form-input-text"]},innerBlocks:[["prc-block/form-input-text",{placeholder:"Email Address...",type:"email"}]],scope:["inserter","transform"],isActive:({className:e})=>!!e&&e.includes("is-style-form-field-input-email")},{name:"form-field-select",title:(0,e.__)("Form Input Select","prc-block-library"),excerpt:(0,e.__)("Form Select block...","prc-block-library"),attributes:{className:"is-style-form-field-select",allowedBlocks:["prc-block/form-input-select"]},innerBlocks:[["prc-block/form-input-select",{placeholder:"Select ...",type:"select"}]]}],f=window.prcIcons,b=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/form-field","version":"0.1.0","title":"Form Field","description":"A simple form field wrapper for input text blocks. Provides a label and required indicator.","category":"design","attributes":{"allowedBlocks":{"type":"array"},"required":{"type":"boolean","default":false},"label":{"type":"string","default":""},"style":{"type":"object","default":{"spacing":{"blockGap":"var:preset|spacing|10"}}}},"supports":{"anchor":true,"html":false,"spacing":{"blockGap":true,"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"padding":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"interactivity":true},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"only-label","label":"Only Label"}],"providesContext":{"prc-block/form-field/required":"required","prc-block/form-field/label":"label"},"usesContext":["prc-facets/template/facetType","prc-facets/template/facetName","prc-facets/template/facetLabel"],"textdomain":"form-field","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewModule":"file:./view.js"}'),{name:k}=b,x={icon:function(){return(0,r.createElement)(f.Icon,{icon:"pen-field"})},edit:function({attributes:c,setAttributes:s,context:p,clientId:d,isSelected:f,insertBlocksAfter:b}){const{allowedBlocks:k,label:x,required:y}=c,w=(0,n.useBlockProps)({required:y,style:{"--block-gap":(0,l.getBlockGapSupportValue)(c)}}),_=(0,n.useInnerBlocksProps)({},{allowedBlocks:k||m,templateLock:!0}),{currentVariation:g}=(0,a.useSelect)((e=>{const{getBlockVariations:t,getActiveBlockVariation:r}=e("core/blocks");return{currentVariation:r("prc-block/form-field",c)}}),[]),{insertBlock:v,moveBlockToPosition:h,selectNextBlock:B,updateBlockAttributes:F}=(0,a.useDispatch)("core/block-editor");return(0,r.createElement)(i.Fragment,null,(0,r.createElement)(u,{attributes:c,setAttributes:s,context:!1}),(0,r.createElement)("div",{...w},(0,r.createElement)(o.StyledComponentContext,{cacheKey:`form-field-${d}`},(0,r.createElement)(n.RichText,{tagName:"label",placeholder:(0,e.__)("Label","prc-block-library"),value:x,onChange:e=>{s({label:e})},__unstableOnSplitAtEnd:()=>(console.log("innerBlocksProps",_),void(e=>{const r=g?.attributes,l=(0,t.createBlocksFromInnerBlocksTemplate)(g?.innerBlocks);b((0,t.createBlock)("prc-block/form-field",{...r},l))})())}),(0,r.createElement)("div",{..._}))))},save:function({attributes:e}){return(0,r.createElement)(n.InnerBlocks.Content,null)},variations:d};(0,t.registerBlockType)(k,{...b,...x})}},r={};function l(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,l),i.exports}l.m=t,e=[],l.O=(t,r,o,i)=>{if(!r){var n=1/0;for(p=0;p=i)&&Object.keys(l.O).every((e=>l.O[e](r[c])))?r.splice(c--,1):(a=!1,i0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[r,o,i]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,r)=>{var o,i,[n,a,c]=r,s=0;if(n.some((t=>0!==e[t]))){for(o in a)l.o(a,o)&&(l.m[o]=a[o]);if(c)var p=c(l)}for(t&&t(r);sl(824)));o=l.O(o)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/blocks/form-field/build/index.js.map b/blocks/form-field/build/index.js.map index e5524eac2..b6928374c 100644 --- a/blocks/form-field/build/index.js.map +++ b/blocks/form-field/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAsB,cCArD,EAA+BA,OAAsB,cCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAe,YCAzD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAc,WC4B9D,SAASC,GAAe,WAAEC,EAAU,cAAEC,IACrC,MAAM,SAAEC,GAAaF,EACrB,OACCG,EAAAA,EAAAA,eAACC,EAAAA,kBAAiB,MACjBD,EAAAA,EAAAA,eAACE,EAAAA,UAAS,CAACC,MAAM,wBAChBH,EAAAA,EAAAA,eAACI,EAAAA,cAAa,CACbC,MAAM,WACNC,QAASP,EACTQ,SAAWC,IACVV,EAAc,CAAEC,SAAUS,GAAc,KAM9C,CAEA,SAASC,GAAQ,WAAEZ,EAAU,cAAEC,EAAa,QAAEY,IAoC7C,CAGc,SAASC,GAAS,WAAEd,EAAU,cAAEC,EAAa,QAAEY,IAC7D,OACCV,EAAAA,EAAAA,eAACY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\"i18n\"]","webpack://form-field/external window [\"wp\",\"blocks\"]","webpack://form-field/external window \"React\"","webpack://form-field/external window \"prcBlockUtils\"","webpack://form-field/external window \"prcComponents\"","webpack://form-field/external window [\"wp\",\"element\"]","webpack://form-field/external window [\"wp\",\"blockEditor\"]","webpack://form-field/external window [\"wp\",\"data\"]","webpack://form-field/external window [\"wp\",\"components\"]","webpack://form-field/./src/controls.jsx","webpack://form-field/external window [\"wp\",\"coreData\"]","webpack://form-field/./src/edit.jsx","webpack://form-field/./src/variations.js","webpack://form-field/external window \"prcIcons\"","webpack://form-field/./src/index.js","webpack://form-field/./src/icon.jsx","webpack://form-field/./src/save.jsx","webpack://form-field/webpack/bootstrap","webpack://form-field/webpack/runtime/hasOwnProperty shorthand","webpack://form-field/webpack/runtime/jsonp chunk loading","webpack://form-field/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcComponents\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useState, useEffect, useCallback } from '@wordpress/element';\nimport { BlockControls, InspectorControls } from '@wordpress/block-editor';\nimport {\n\tBaseControl,\n\tButton,\n\tCardDivider,\n\tPanelBody,\n\tSelectControl,\n\tTextControl,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal Dependencies\n */\n\nfunction InspectorPanel({ attributes, setAttributes }) {\n\tconst { required } = attributes;\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ required: newRequired });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n}\n\nfunction Toolbar({ attributes, setAttributes, context }) {\n\t// This is here for convenience, but if you do not need a toolbar it should be removed.\n\t// const { myNewAttribute } = attributes;\n\t// const MemoizedIconValue = useCallback(() => {\n\t// \tif (myNewAttribute) {\n\t// \t\treturn 'admin-site';\n\t// \t}\n\t// \treturn 'admin-site-alt';\n\t// }, [myNewAttribute]);\n\t// return (\n\t// \t\n\t// \t\t\n\t// \t\t\t {\n\t// \t\t\t\t\t\t\tsetAttributes({ myNewAttribute: true });\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t\t{\n\t// \t\t\t\t\t\ttitle: 'B',\n\t// \t\t\t\t\t\ticon: 'admin-site-alt',\n\t// \t\t\t\t\t\tisActive: false === myNewAttribute,\n\t// \t\t\t\t\t\tonClick: () => {\n\t// \t\t\t\t\t\t\tsetAttributes({ myNewAttribute: false });\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t]}\n\t// \t\t\t/>\n\t// \t\t\n\t// \t\n\t// );\n}\n\nexport default function Controls({ attributes, setAttributes, context }) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","/**\n * External Dependencies\n */\nimport { getBlockGapSupportValue } from '@prc/block-utils';\nimport { StyledComponentContext } from '@prc/components';\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tRichText,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n} from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\nconst ALLOWED_BLOCKS = [\n\t'prc-block/form-input-text',\n\t'prc-block/form-input-date',\n];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n * @param {Object} props.context Context object with the block's context values.\n * @param {string} props.clientId Unique ID of the block.\n * @param {boolean} props.isSelected Whether or not the block is currently selected.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tcontext,\n\tclientId,\n\tisSelected,\n\tinsertBlocksAfter,\n}) {\n\tconst { allowedBlocks, label, required } = attributes;\n\tconst blockProps = useBlockProps({\n\t\trequired: required,\n\t\tstyle: {\n\t\t\t'--block-gap': getBlockGapSupportValue(attributes),\n\t\t},\n\t});\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: allowedBlocks ? allowedBlocks : ALLOWED_BLOCKS,\n\t\t\ttemplateLock: true,\n\t\t}\n\t);\n\n\tconst { currentVariation } = useSelect((select) => {\n\t\tconst { getBlockVariations, getActiveBlockVariation } =\n\t\t\tselect('core/blocks');\n\t\tconst activeVariation = getActiveBlockVariation(\n\t\t\t'prc-block/form-field',\n\t\t\tattributes\n\t\t);\n\t\treturn {\n\t\t\tcurrentVariation: activeVariation,\n\t\t};\n\t}, []);\n\n\tconst {\n\t\tinsertBlock,\n\t\tmoveBlockToPosition,\n\t\tselectNextBlock,\n\t\tupdateBlockAttributes,\n\t} = useDispatch('core/block-editor');\n\n\t/**\n\t * Inserts a new form-field block after the current block and selects it.\n\t *\n\t * @return\n\t */\n\tconst insertNewBlock = (variation) => {\n\t\tconst attrs = {};\n\t\tconst newAttrs = currentVariation?.attributes;\n\t\tconst newInnerBlocks = createBlocksFromInnerBlocksTemplate(\n\t\t\tcurrentVariation?.innerBlocks\n\t\t);\n\t\treturn insertBlocksAfter(\n\t\t\tcreateBlock('prc-block/form-field', { ...newAttrs }, newInnerBlocks)\n\t\t);\n\t};\n\n\t/**\n\t * Insert a new block, or select the next block\n\t * if one is available when the user presses enter at the end of the block.\n\t */\n\tconst onEnterSplit = () => {\n\t\tconst type = 'checkbox';\n\t\tconsole.log('innerBlocksProps', innerBlocksProps);\n\t\t// With non-checkbox|radio input types we want to select the next block, but the way checkbox renders the label after the input element we want to insert a new block instead.\n\t\tif ('checkbox' !== type) {\n\t\t\tselectNextBlock(clientId);\n\t\t} else {\n\t\t\tinsertNewBlock();\n\t\t}\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetAttributes({ label: newLabel });\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t__unstableOnSplitAtEnd={() => onEnterSplit()}\n\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport default [\n\t{\n\t\tname: 'form-field-input-text',\n\t\tisDefault: true,\n\t\ttitle: __('Form Input Text', 'prc-block-library'),\n\t\texcerpt: __('Form Input Text block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-input-text',\n\t\t\tallowedBlocks: ['prc-block/form-input-text'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-text',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Text...',\n\t\t\t\t\ttype: 'text',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: ['inserter', 'transform'],\n\t\tisActive: ({ className }) =>\n\t\t\tclassName\n\t\t\t\t? className.includes('is-style-form-field-input-text')\n\t\t\t\t: false,\n\t},\n\t{\n\t\tname: 'form-field-input-textarea',\n\t\ttitle: __('Form Input Text Area', 'prc-block-library'),\n\t\texcerpt: __('Form Input Text Area block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-input-textarea',\n\t\t\tallowedBlocks: ['prc-block/form-input-text'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-text',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Text Area...',\n\t\t\t\t\ttype: 'textarea',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: ['inserter', 'transform'],\n\t\tisActive: ({ className }) =>\n\t\t\tclassName\n\t\t\t\t? className.includes('is-style-form-field-input-textarea')\n\t\t\t\t: false,\n\t},\n\t{\n\t\tname: 'form-field-input-email',\n\t\ttitle: __('Form Input Email', 'prc-block-library'),\n\t\texcerpt: __('Form Input Email block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-input-email',\n\t\t\tallowedBlocks: ['prc-block/form-input-text'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-text',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Email Address...',\n\t\t\t\t\ttype: 'email',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: ['inserter', 'transform'],\n\t\tisActive: ({ className }) =>\n\t\t\tclassName\n\t\t\t\t? className.includes('is-style-form-field-input-email')\n\t\t\t\t: false,\n\t},\n\t{\n\t\tname: 'form-field-select',\n\t\ttitle: __('Form Input Select', 'prc-block-library'),\n\t\texcerpt: __('Form Select block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-select',\n\t\t\tallowedBlocks: ['prc-block/form-input-select'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-select',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Select ...',\n\t\t\t\t\ttype: 'select',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t},\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport './editor.scss';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport icon from './icon';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n\tvariations,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType( name, { ...metadata, ...settings } );\n","/**\n * External Dependencies\n */\nimport { icons, Icon } from '@prc/icons';\n\nexport default function() {\n\treturn(\n\t\t\n\t);\n}\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save( { attributes } ) {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0,\n\t350: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkform_field\"] = globalThis[\"webpackChunkform_field\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [350], () => (__webpack_require__(824)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","InspectorPanel","attributes","setAttributes","required","createElement","InspectorControls","PanelBody","title","ToggleControl","label","checked","onChange","newRequired","Toolbar","context","Controls","Fragment","ALLOWED_BLOCKS","name","isDefault","__","excerpt","className","allowedBlocks","innerBlocks","placeholder","type","scope","isActive","includes","metadata","settings","icon","Icon","icons","faPenField","width","preserveAspectRatio","edit","clientId","isSelected","insertBlocksAfter","blockProps","useBlockProps","style","getBlockGapSupportValue","innerBlocksProps","useInnerBlocksProps","templateLock","currentVariation","useSelect","select","getBlockVariations","getActiveBlockVariation","insertBlock","moveBlockToPosition","selectNextBlock","updateBlockAttributes","useDispatch","StyledComponentContext","cacheKey","RichText","tagName","value","newLabel","__unstableOnSplitAtEnd","console","log","variation","newAttrs","newInnerBlocks","createBlocksFromInnerBlocksTemplate","createBlock","insertNewBlock","save","InnerBlocks","Content","variations","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAsB,cCArD,EAA+BA,OAAsB,cCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAe,YCAzD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAc,WC4B9D,SAASC,GAAe,WAAEC,EAAU,cAAEC,IACrC,MAAM,SAAEC,GAAaF,EACrB,OACCG,EAAAA,EAAAA,eAACC,EAAAA,kBAAi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AAK,GACxGD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsB7C,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7F6C,EAAsB7C,EAAoBQ,EAAEqC,E","sources":["webpack://form-field/webpack/runtime/chunk loaded","webpack://form-field/external window [\"wp\",\"i18n\"]","webpack://form-field/external window [\"wp\",\"blocks\"]","webpack://form-field/external window \"React\"","webpack://form-field/external window \"prcBlockUtils\"","webpack://form-field/external window \"prcComponents\"","webpack://form-field/external window [\"wp\",\"element\"]","webpack://form-field/external window [\"wp\",\"blockEditor\"]","webpack://form-field/external window [\"wp\",\"data\"]","webpack://form-field/external window [\"wp\",\"components\"]","webpack://form-field/./src/controls.jsx","webpack://form-field/external window [\"wp\",\"coreData\"]","webpack://form-field/./src/edit.jsx","webpack://form-field/./src/variations.js","webpack://form-field/external window \"prcIcons\"","webpack://form-field/./src/index.js","webpack://form-field/./src/icon.jsx","webpack://form-field/./src/save.jsx","webpack://form-field/webpack/bootstrap","webpack://form-field/webpack/runtime/hasOwnProperty shorthand","webpack://form-field/webpack/runtime/jsonp chunk loading","webpack://form-field/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcComponents\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useState, useEffect, useCallback } from '@wordpress/element';\nimport { BlockControls, InspectorControls } from '@wordpress/block-editor';\nimport {\n\tBaseControl,\n\tButton,\n\tCardDivider,\n\tPanelBody,\n\tSelectControl,\n\tTextControl,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal Dependencies\n */\n\nfunction InspectorPanel({ attributes, setAttributes }) {\n\tconst { required } = attributes;\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ required: newRequired });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n}\n\nfunction Toolbar({ attributes, setAttributes, context }) {\n\t// This is here for convenience, but if you do not need a toolbar it should be removed.\n\t// const { myNewAttribute } = attributes;\n\t// const MemoizedIconValue = useCallback(() => {\n\t// \tif (myNewAttribute) {\n\t// \t\treturn 'admin-site';\n\t// \t}\n\t// \treturn 'admin-site-alt';\n\t// }, [myNewAttribute]);\n\t// return (\n\t// \t\n\t// \t\t\n\t// \t\t\t {\n\t// \t\t\t\t\t\t\tsetAttributes({ myNewAttribute: true });\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t\t{\n\t// \t\t\t\t\t\ttitle: 'B',\n\t// \t\t\t\t\t\ticon: 'admin-site-alt',\n\t// \t\t\t\t\t\tisActive: false === myNewAttribute,\n\t// \t\t\t\t\t\tonClick: () => {\n\t// \t\t\t\t\t\t\tsetAttributes({ myNewAttribute: false });\n\t// \t\t\t\t\t\t},\n\t// \t\t\t\t\t},\n\t// \t\t\t\t]}\n\t// \t\t\t/>\n\t// \t\t\n\t// \t\n\t// );\n}\n\nexport default function Controls({ attributes, setAttributes, context }) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","/**\n * External Dependencies\n */\nimport { getBlockGapSupportValue } from '@prc/block-utils';\nimport { StyledComponentContext } from '@prc/components';\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tRichText,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n} from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\nconst ALLOWED_BLOCKS = [\n\t'prc-block/form-input-text',\n\t'prc-block/form-input-date',\n];\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n * @param {Object} props.context Context object with the block's context values.\n * @param {string} props.clientId Unique ID of the block.\n * @param {boolean} props.isSelected Whether or not the block is currently selected.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tcontext,\n\tclientId,\n\tisSelected,\n\tinsertBlocksAfter,\n}) {\n\tconst { allowedBlocks, label, required } = attributes;\n\tconst blockProps = useBlockProps({\n\t\trequired: required,\n\t\tstyle: {\n\t\t\t'--block-gap': getBlockGapSupportValue(attributes),\n\t\t},\n\t});\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tallowedBlocks: allowedBlocks ? allowedBlocks : ALLOWED_BLOCKS,\n\t\t\ttemplateLock: true,\n\t\t}\n\t);\n\n\tconst { currentVariation } = useSelect((select) => {\n\t\tconst { getBlockVariations, getActiveBlockVariation } =\n\t\t\tselect('core/blocks');\n\t\tconst activeVariation = getActiveBlockVariation(\n\t\t\t'prc-block/form-field',\n\t\t\tattributes\n\t\t);\n\t\treturn {\n\t\t\tcurrentVariation: activeVariation,\n\t\t};\n\t}, []);\n\n\tconst {\n\t\tinsertBlock,\n\t\tmoveBlockToPosition,\n\t\tselectNextBlock,\n\t\tupdateBlockAttributes,\n\t} = useDispatch('core/block-editor');\n\n\t/**\n\t * Inserts a new form-field block after the current block and selects it.\n\t *\n\t * @return\n\t */\n\tconst insertNewBlock = (variation) => {\n\t\tconst attrs = {};\n\t\tconst newAttrs = currentVariation?.attributes;\n\t\tconst newInnerBlocks = createBlocksFromInnerBlocksTemplate(\n\t\t\tcurrentVariation?.innerBlocks\n\t\t);\n\t\treturn insertBlocksAfter(\n\t\t\tcreateBlock('prc-block/form-field', { ...newAttrs }, newInnerBlocks)\n\t\t);\n\t};\n\n\t/**\n\t * Insert a new block, or select the next block\n\t * if one is available when the user presses enter at the end of the block.\n\t */\n\tconst onEnterSplit = () => {\n\t\tconst type = 'checkbox';\n\t\tconsole.log('innerBlocksProps', innerBlocksProps);\n\t\t// With non-checkbox|radio input types we want to select the next block, but the way checkbox renders the label after the input element we want to insert a new block instead.\n\t\tif ('checkbox' !== type) {\n\t\t\tselectNextBlock(clientId);\n\t\t} else {\n\t\t\tinsertNewBlock();\n\t\t}\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t {\n\t\t\t\t\t\t\tsetAttributes({ label: newLabel });\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t__unstableOnSplitAtEnd={() => onEnterSplit()}\n\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport default [\n\t{\n\t\tname: 'form-field-input-text',\n\t\tisDefault: true,\n\t\ttitle: __('Form Input Text', 'prc-block-library'),\n\t\texcerpt: __('Form Input Text block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-input-text',\n\t\t\tallowedBlocks: ['prc-block/form-input-text'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-text',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Text...',\n\t\t\t\t\ttype: 'text',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: ['inserter', 'transform'],\n\t\tisActive: ({ className }) =>\n\t\t\tclassName\n\t\t\t\t? className.includes('is-style-form-field-input-text')\n\t\t\t\t: false,\n\t},\n\t{\n\t\tname: 'form-field-input-textarea',\n\t\ttitle: __('Form Input Text Area', 'prc-block-library'),\n\t\texcerpt: __('Form Input Text Area block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-input-textarea',\n\t\t\tallowedBlocks: ['prc-block/form-input-text'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-text',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Text Area...',\n\t\t\t\t\ttype: 'textarea',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: ['inserter', 'transform'],\n\t\tisActive: ({ className }) =>\n\t\t\tclassName\n\t\t\t\t? className.includes('is-style-form-field-input-textarea')\n\t\t\t\t: false,\n\t},\n\t{\n\t\tname: 'form-field-input-email',\n\t\ttitle: __('Form Input Email', 'prc-block-library'),\n\t\texcerpt: __('Form Input Email block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-input-email',\n\t\t\tallowedBlocks: ['prc-block/form-input-text'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-text',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Email Address...',\n\t\t\t\t\ttype: 'email',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: ['inserter', 'transform'],\n\t\tisActive: ({ className }) =>\n\t\t\tclassName\n\t\t\t\t? className.includes('is-style-form-field-input-email')\n\t\t\t\t: false,\n\t},\n\t{\n\t\tname: 'form-field-select',\n\t\ttitle: __('Form Input Select', 'prc-block-library'),\n\t\texcerpt: __('Form Select block...', 'prc-block-library'),\n\t\tattributes: {\n\t\t\tclassName: 'is-style-form-field-select',\n\t\t\tallowedBlocks: ['prc-block/form-input-select'],\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'prc-block/form-input-select',\n\t\t\t\t{\n\t\t\t\t\tplaceholder: 'Select ...',\n\t\t\t\t\ttype: 'select',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t},\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport './editor.scss';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport icon from './icon';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n\tvariations,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType( name, { ...metadata, ...settings } );\n","/**\n * External Dependencies\n */\nimport { Icon } from '@prc/icons';\n\nexport default function () {\n\treturn ;\n}\n","/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\n\n/**\n * React hook that is used to mark the block wrapper element.\n * It provides all the necessary props like the class name.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops\n */\nimport { InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * The save function defines the way in which the different attributes should\n * be combined into the final markup, which is then serialized by the block\n * editor into `post_content`.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @return {WPElement} Element to render.\n */\nexport default function Save( { attributes } ) {\n\treturn ;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0,\n\t350: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkform_field\"] = globalThis[\"webpackChunkform_field\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [350], () => (__webpack_require__(824)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","InspectorPanel","attributes","setAttributes","required","createElement","InspectorControls","PanelBody","title","ToggleControl","label","checked","onChange","newRequired","Toolbar","context","Controls","Fragment","ALLOWED_BLOCKS","name","isDefault","__","excerpt","className","allowedBlocks","innerBlocks","placeholder","type","scope","isActive","includes","metadata","settings","icon","Icon","edit","clientId","isSelected","insertBlocksAfter","blockProps","useBlockProps","style","getBlockGapSupportValue","innerBlocksProps","useInnerBlocksProps","templateLock","currentVariation","useSelect","select","getBlockVariations","getActiveBlockVariation","insertBlock","moveBlockToPosition","selectNextBlock","updateBlockAttributes","useDispatch","StyledComponentContext","cacheKey","RichText","tagName","value","newLabel","__unstableOnSplitAtEnd","console","log","variation","newAttrs","newInnerBlocks","createBlocksFromInnerBlocksTemplate","createBlock","insertNewBlock","save","InnerBlocks","Content","variations","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/form-input-select/build/block.json b/blocks/form-input-select/build/block.json index 086d21f53..bdf765b6c 100644 --- a/blocks/form-input-select/build/block.json +++ b/blocks/form-input-select/build/block.json @@ -29,6 +29,24 @@ }, "value": { "type": "string" + }, + "style": { + "type": "object", + "default": { + "border": { + "width": "1px", + "color": "#dadbdb", + "radius": "3px" + }, + "spacing": { + "padding": { + "top": "0.3rem", + "bottom": "0.3rem", + "left": "var:preset|spacing|20", + "right": "var:preset|spacing|20" + } + } + } } }, "supports": { @@ -64,17 +82,6 @@ "prc-facets/template/facetLabel", "prc-block/sortable-options" ], - "styles": [ - { - "name": "default", - "label": "Default", - "isDefault": true - }, - { - "name": "autocomplete", - "label": "Autcomplete" - } - ], "parent": [ "prc-block/form-field" ], @@ -82,5 +89,5 @@ "editorScript": "file:./index.js", "style": "file:./style-index.css", "render": "file:./render.php", - "viewScriptModule": "file:./view.js" + "viewModule": "file:./view.js" } \ No newline at end of file diff --git a/blocks/form-input-select/build/index.asset.php b/blocks/form-input-select/build/index.asset.php index a62e6b8c9..bfc05f123 100644 --- a/blocks/form-input-select/build/index.asset.php +++ b/blocks/form-input-select/build/index.asset.php @@ -1 +1 @@ - array('classnames', 'prc-block-utils', 'prc-controls', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-polyfill'), 'version' => '9c1cdcb0a17ec7519130'); + array('classnames', 'prc-block-utils', 'prc-controls', 'prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-polyfill'), 'version' => 'fe3b3e640663922f39fe'); diff --git a/blocks/form-input-select/build/index.css.map b/blocks/form-input-select/build/index.css.map new file mode 100644 index 000000000..6dc90beb2 --- /dev/null +++ b/blocks/form-input-select/build/index.css.map @@ -0,0 +1 @@ +{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mDACC;AAFF;AAIC;EACC;EACA;EACA;EACA;EACA;EACA;AAFF,C","sources":["webpack://form-input-select/./src/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-prc-block-form-input-select {\n\t--border-color: rgba(0, 0, 0, 0.2);\n\t--wp--custom--border-radius: 3px;\n\n\tflex-grow: 1;\n\ttext-align: left;\n\tvertical-align: top;\n\t-webkit-appearance: none;\n\tpadding: 9px 13px; // cribbed from core/button styling.\n\tborder: 1px solid transparent;\n\tborder-color: var(--border-color);\n\tborder-radius: var(--wp--custom--border-radius);\n\tbox-shadow: inset 0 0 0 0 transparent;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\tmargin: 0;\n\toutline: none;\n\ttransition:\n\t\tcolor 0.1s ease,\n\t\tborder-color 0.1s ease;\n\t&[required]:after {\n\t\tcontent: \"*\";\n\t\tcolor: red;\n\t\tfont-size: 1.1em;\n\t\tposition: absolute;\n\t\ttop: 5px;\n\t\tright: 5px;\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/form-input-select/build/index.js b/blocks/form-input-select/build/index.js index a869d5920..4ca337373 100644 --- a/blocks/form-input-select/build/index.js +++ b/blocks/form-input-select/build/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={314:()=>{const e=window.wp.blocks,t=window.React,r=(window.classnames,window.prcBlockUtils,window.wp.blockEditor),l=window.prcControls,o=window.wp.i18n,a=window.wp.components,n=[{label:"North America",value:"north-america"},{label:"South America",value:"south-america"},{label:"Europe",value:"europe"},{label:"Asia",value:"asia"},{label:"Africa",value:"africa"},{label:"Australia",value:"australia"}];function i({attributes:e,setAttributes:i,clientId:s,context:c}){const{placeholder:p,options:u}=e,d=(0,t.useMemo)((()=>c["prc-block/sortable-options"]?JSON.parse(c["prc-block/sortable-options"]):{}),[c]);return(0,t.useEffect)((()=>{if(u.length>0)return;const e=Object.keys(d).map((e=>({label:d[e].name,name:d[e].name,value:e,disabled:!1})));e.length>0?i({options:e}):i({options:n})}),[u,d]),(0,t.createElement)(r.InspectorControls,null,(0,t.createElement)(a.PanelBody,{title:(0,o.__)("Form Input Field Settings")},(0,t.createElement)(a.TextControl,{label:"Placeholder",value:p,onChange:e=>{i({placeholder:e})}}),(0,t.createElement)(a.ToggleControl,{label:"Disabled",checked:e.disabled,help:"If toggled on, the user cannot interact with this input.",onChange:e=>{i({disabled:e})}})),(0,t.createElement)(a.PanelBody,{title:(0,o.__)("Form Input Field Options")},(0,t.createElement)(l.Sorter,{options:u,setAttributes:i,attribute:"options",clientId:s})))}const s=window.prcIcons,c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/form-input-select","version":"0.1.0","title":"Form Input Select","category":"widgets","description":"Create a dropdown element with a list of options.","attributes":{"options":{"type":"array","default":[]},"placeholder":{"type":"string","default":"Select an option"},"disabled":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"ui-white"},"textColor":{"type":"string","default":"ui-black"},"value":{"type":"string"}},"supports":{"anchor":true,"html":false,"reusable":true,"inserter":false,"__experimentalBorder":{"color":true,"width":true,"radius":true},"color":{"gradients":false},"spacing":{"padding":true,"margin":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true},"interactivity":true},"usesContext":["prc-block/form-field-required","prc-block/form-field-label","prc-facets/template/facetType","prc-facets/template/facetName","prc-facets/template/facetLabel","prc-block/sortable-options"],"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"autocomplete","label":"Autcomplete"}],"parent":["prc-block/form-field"],"textdomain":"form-input-select","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php","viewScriptModule":"file:./view.js"}'),{name:p}=c,u={icon:function(){return(0,t.createElement)(s.Icon,{icon:"list-dropdown"})},edit:function({attributes:e,setAttributes:l,clientId:o,isSelected:a,context:n}){const{placeholder:s}=e,c=(0,r.useBlockProps)({onChange:e=>e.preventDefault()});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i,{attributes:e,setAttributes:l,clientId:o,context:n}),(0,t.createElement)("div",{...c},(0,t.createElement)("div",{className:"wp-block-prc-block-form-input-select__input"},(0,t.createElement)("input",{type:"search",role:"combobox",placeholder:s}))))}};(0,e.registerBlockType)(p,{...c,...u})}},r={};function l(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,l),a.exports}l.m=t,e=[],l.O=(t,r,o,a)=>{if(!r){var n=1/0;for(p=0;p=a)&&Object.keys(l.O).every((e=>l.O[e](r[s])))?r.splice(s--,1):(i=!1,a0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[r,o,a]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};l.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,[n,i,s]=r,c=0;if(n.some((t=>0!==e[t]))){for(o in i)l.o(i,o)&&(l.m[o]=i[o]);if(s)var p=s(l)}for(t&&t(r);cl(314)));o=l.O(o)})(); +(()=>{"use strict";var e,t={344:()=>{const e=window.wp.blocks,t=window.React,r=(window.classnames,window.prcBlockUtils,window.wp.blockEditor),o=window.prcControls,l=window.wp.i18n,a=window.wp.components,n=[{label:"North America",value:"north-america"},{label:"South America",value:"south-america"},{label:"Europe",value:"europe"},{label:"Asia",value:"asia"},{label:"Africa",value:"africa"},{label:"Australia",value:"australia"}];function i({attributes:e,setAttributes:i,clientId:s,context:c}){const{placeholder:p,options:u}=e,d=(0,t.useMemo)((()=>c["prc-block/sortable-options"]?JSON.parse(c["prc-block/sortable-options"]):{}),[c]);return(0,t.useEffect)((()=>{if(u.length>0)return;const e=Object.keys(d).map((e=>({label:d[e].name,name:d[e].name,value:e,disabled:!1})));e.length>0?i({options:e}):i({options:n})}),[u,d]),(0,t.createElement)(r.InspectorControls,null,(0,t.createElement)(a.PanelBody,{title:(0,l.__)("Form Input Field Settings")},(0,t.createElement)(a.TextControl,{label:"Placeholder",value:p,onChange:e=>{i({placeholder:e})}}),(0,t.createElement)(a.ToggleControl,{label:"Disabled",checked:e.disabled,help:"If toggled on, the user cannot interact with this input.",onChange:e=>{i({disabled:e})}})),(0,t.createElement)(a.PanelBody,{title:(0,l.__)("Form Input Field Options")},(0,t.createElement)(o.Sorter,{options:u,setAttributes:i,attribute:"options",clientId:s})))}const s=window.prcIcons,c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/form-input-select","version":"0.1.0","title":"Form Input Select","category":"widgets","description":"Create a dropdown element with a list of options.","attributes":{"options":{"type":"array","default":[]},"placeholder":{"type":"string","default":"Select an option"},"disabled":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"ui-white"},"textColor":{"type":"string","default":"ui-black"},"value":{"type":"string"},"style":{"type":"object","default":{"border":{"width":"1px","color":"#dadbdb","radius":"3px"},"spacing":{"padding":{"top":"0.3rem","bottom":"0.3rem","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}}}},"supports":{"anchor":true,"html":false,"reusable":true,"inserter":false,"__experimentalBorder":{"color":true,"width":true,"radius":true},"color":{"gradients":false},"spacing":{"padding":true,"margin":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true},"interactivity":true},"usesContext":["prc-block/form-field-required","prc-block/form-field-label","prc-facets/template/facetType","prc-facets/template/facetName","prc-facets/template/facetLabel","prc-block/sortable-options"],"parent":["prc-block/form-field"],"textdomain":"form-input-select","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php","viewModule":"file:./view.js"}'),{name:p}=c,u={icon:function(){return(0,t.createElement)(s.Icon,{icon:"list-dropdown"})},edit:function({attributes:e,setAttributes:o,clientId:l,isSelected:a,context:n}){const{placeholder:s}=e,c=(0,r.useBlockProps)({onChange:e=>e.preventDefault()});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i,{attributes:e,setAttributes:o,clientId:l,context:n}),(0,t.createElement)("div",{...c},(0,t.createElement)("div",{className:"wp-block-prc-block-form-input-select__input"},(0,t.createElement)("input",{type:"search",role:"combobox",placeholder:s}))))}};(0,e.registerBlockType)(p,{...c,...u})}},r={};function o(e){var l=r[e];if(void 0!==l)return l.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,r,l,a)=>{if(!r){var n=1/0;for(p=0;p=a)&&Object.keys(o.O).every((e=>o.O[e](r[s])))?r.splice(s--,1):(i=!1,a0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[r,l,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={656:0,564:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var l,a,[n,i,s]=r,c=0;if(n.some((t=>0!==e[t]))){for(l in i)o.o(i,l)&&(o.m[l]=i[l]);if(s)var p=s(o)}for(t&&t(r);co(344)));l=o.O(l)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/blocks/form-input-select/build/index.js.map b/blocks/form-input-select/build/index.js.map index 128431459..c90535a3a 100644 --- a/blocks/form-input-select/build/index.js.map +++ b/blocks/form-input-select/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,GCA+BA,OAAmB,WCAnBA,OAAsB,cFAtBA,OAAW,GAAe,aGAzD,EAA+BA,OAAoB,YCAnD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAc,WCiBxDC,EAAkB,CACvB,CAAEC,MAAO,gBAAiBC,MAAO,iBACjC,CAAED,MAAO,gBAAiBC,MAAO,iBACjC,CAAED,MAAO,SAAUC,MAAO,UAC1B,CAAED,MAAO,OAAQC,MAAO,QACxB,CAAED,MAAO,SAAUC,MAAO,UAC1B,CAAED,MAAO,YAAaC,MAAO,cAGf,SAASC,GAAS,WAChCC,EAAU,cACVC,EAAa,SACbC,EAAQ,QACRC,IAEA,MAAM,YAAEC,EAAW,QAAEC,GAAYL,EAE3BM,GAAkBC,EAAAA,EAAAA,UAAQ,IACxBJ,EAAQ,8BACZ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webpack://form-input-select/external window \"React\"","webpack://form-input-select/external window [\"wp\",\"blockEditor\"]","webpack://form-input-select/external window \"classnames\"","webpack://form-input-select/external window \"prcBlockUtils\"","webpack://form-input-select/external window \"prcControls\"","webpack://form-input-select/external window [\"wp\",\"i18n\"]","webpack://form-input-select/external window [\"wp\",\"components\"]","webpack://form-input-select/./src/controls.jsx","webpack://form-input-select/external window \"prcIcons\"","webpack://form-input-select/./src/index.js","webpack://form-input-select/./src/icon.jsx","webpack://form-input-select/./src/edit.jsx","webpack://form-input-select/webpack/bootstrap","webpack://form-input-select/webpack/runtime/hasOwnProperty shorthand","webpack://form-input-select/webpack/runtime/jsonp chunk loading","webpack://form-input-select/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcControls\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * External Dependencies\n */\nimport { Sorter } from '@prc/controls';\n\n/**\n * WordPress Dependencies\n */\nimport { useEffect, useMemo } from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, TextControl, ToggleControl } from '@wordpress/components';\n\n/**\n * Internal Dependencies\n */\n\nconst DEFAULT_OPTIONS = [\n\t{ label: 'North America', value: 'north-america' },\n\t{ label: 'South America', value: 'south-america' },\n\t{ label: 'Europe', value: 'europe' },\n\t{ label: 'Asia', value: 'asia' },\n\t{ label: 'Africa', value: 'africa' },\n\t{ label: 'Australia', value: 'australia' },\n];\n\nexport default function Controls({\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tcontext,\n}) {\n\tconst { placeholder, options } = attributes;\n\n\tconst sortableOptions = useMemo(() => {\n\t\treturn context['prc-block/sortable-options']\n\t\t\t? JSON.parse(context['prc-block/sortable-options'])\n\t\t\t: {};\n\t}, [context]);\n\n\tuseEffect(() => {\n\t\tif (options.length > 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst allSortableOptions = Object.keys(sortableOptions).map((key) => ({\n\t\t\tlabel: sortableOptions[key].name,\n\t\t\tname: sortableOptions[key].name,\n\t\t\tvalue: key,\n\t\t\tdisabled: false,\n\t\t}));\n\t\tif (allSortableOptions.length > 0) {\n\t\t\tsetAttributes({\n\t\t\t\toptions: allSortableOptions,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsetAttributes({ options: DEFAULT_OPTIONS });\n\t}, [options, sortableOptions]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ placeholder: newPlaceholder });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ disabled: val });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport './editor.scss';\nimport edit from './edit';\nimport icon from './icon';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { Icon } from '@prc/icons';\n\nexport default function () {\n\treturn ;\n}\n","/**\n * External Dependencies\n */\nimport classnames from 'classnames';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { Fragment, useState, useRef, useEffect } from 'react';\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n * @param {Object} props.context Context object with the block's context values.\n * @param {string} props.clientId Unique ID of the block.\n * @param {boolean} props.isSelected Whether or not the block is currently selected.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tisSelected,\n\tcontext,\n}) {\n\tconst { placeholder } = attributes;\n\n\tconst blockProps = useBlockProps({\n\t\tonChange: (event) => event.preventDefault(),\n\t});\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t{/** TODO: Listbox goes here, eventually... use isSelected to open */}\n\t\t\t
\n\t\t
\n\t);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t57: 0,\n\t350: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkform_input_select\"] = globalThis[\"webpackChunkform_input_select\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [350], () => (__webpack_require__(314)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","DEFAULT_OPTIONS","label","value","Controls","attributes","setAttributes","clientId","context","placeholder","options","sortableOptions","useMemo","JSON","parse","useEffect","length","allSortableOptions","Object","keys","map","key","name","disabled","createElement","InspectorControls","PanelBody","title","__","TextControl","onChange","newPlaceholder","ToggleControl","checked","help","val","Sorter","attribute","metadata","settings","icon","Icon","edit","isSelected","blockProps","useBlockProps","event","preventDefault","Fragment","className","type","role","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","every","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,GCA+BA,OAAmB,WCAnBA,OAAsB,cFAtBA,OAAW,GAAe,aGAzD,EAA+BA,OAAoB,YCAnD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAc,WCiBxDC,EAAkB,CACvB,CAAEC,MAAO,gBAAiBC,MAAO,iBACjC,CAAED,MAAO,gBAAiBC,MAAO,iBACjC,CAAED,MAAO,SAAUC,MAAO,UAC1B,CAAED,MAAO,OAAQC,MAAO,QACxB,CAAED,MAAO,SAAUC,MAAO,UAC1B,CAAED,MAAO,YAAaC,MAAO,cAGf,SAASC,GAAS,WAChCC,EAAU,cACVC,EAAa,SACbC,EAAQ,QACRC,IAEA,MAAM,YAAEC,EAAW,QAAEC,GAAYL,EAE3BM,GAAkBC,EAAAA,EAAAA,UAAQ,IACxBJ,EAAQ,8BACZK,KAAKC,MAAMN,EAAQ,+BACnB,CAAC,GACF,CAACA,IAqBJ,OAnBAO,EAAAA,EAAAA,YAAU,KACT,GAAIL,EAAQM,OAAS,EACpB,OAED,MAAMC,EAAqBC,OAAOC,KAAKR,GAAiBS,KAAKC,IAAG,CAC/DnB,MAAOS,EAAgBU,GAAKC,KAC5BA,KAAMX,EAAgBU,GAAKC,KAC3BnB,MAAOkB,EACPE,UAAU,MAEPN,EAAmBD,OAAS,EAC/BV,EAAc,CACbI,QAASO,IAIXX,EAAc,CAAEI,QAAST,GAAkB,GACzC,CAACS,EAASC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D,IAAIC,EAAuB,CAACC,EAA4BC,KACvD,IAGI9B,EAAU2B,GAHTlB,EAAUsB,EAAaC,GAAWF,EAGhBhB,EAAI,EAC3B,GAAGL,EAASwB,MAAMC,GAAgC,IAAxBR,EAAgBQ,KAAa,CACtD,IAAIlC,KAAY+B,EACZhC,EAAoBqB,EAAEW,EAAa/B,KACrCD,EAAoBO,EAAEN,GAAY+B,EAAY/B,IAGhD,GAAGgC,EAAS,IAAIxB,EAASwB,EAAQjC,EAClC,CAEA,IADG8B,GAA4BA,EAA2BC,GACrDhB,EAAIL,EAAShD,OAAQqD,IACzBa,EAAUlB,EAASK,GAChBf,EAAoBqB,EAAEM,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAO5B,EAAoBQ,EAAEC,EAAO,EAGjC2B,EAAqBC,WAA0C,8BAAIA,WAA0C,+BAAK,GACtHD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsBzC,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7FyC,EAAsBzC,EAAoBQ,EAAEiC,E","sources":["webpack://form-input-select/webpack/runtime/chunk loaded","webpack://form-input-select/external window [\"wp\",\"blocks\"]","webpack://form-input-select/external window \"React\"","webpack://form-input-select/external window [\"wp\",\"blockEditor\"]","webpack://form-input-select/external window \"classnames\"","webpack://form-input-select/external window \"prcBlockUtils\"","webpack://form-input-select/external window \"prcControls\"","webpack://form-input-select/external window [\"wp\",\"i18n\"]","webpack://form-input-select/external window [\"wp\",\"components\"]","webpack://form-input-select/./src/controls.jsx","webpack://form-input-select/external window \"prcIcons\"","webpack://form-input-select/./src/index.js","webpack://form-input-select/./src/icon.jsx","webpack://form-input-select/./src/edit.jsx","webpack://form-input-select/webpack/bootstrap","webpack://form-input-select/webpack/runtime/hasOwnProperty shorthand","webpack://form-input-select/webpack/runtime/jsonp chunk loading","webpack://form-input-select/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"classnames\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcBlockUtils\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcControls\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * External Dependencies\n */\nimport { Sorter } from '@prc/controls';\n\n/**\n * WordPress Dependencies\n */\nimport { useEffect, useMemo } from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, TextControl, ToggleControl } from '@wordpress/components';\n\n/**\n * Internal Dependencies\n */\n\nconst DEFAULT_OPTIONS = [\n\t{ label: 'North America', value: 'north-america' },\n\t{ label: 'South America', value: 'south-america' },\n\t{ label: 'Europe', value: 'europe' },\n\t{ label: 'Asia', value: 'asia' },\n\t{ label: 'Africa', value: 'africa' },\n\t{ label: 'Australia', value: 'australia' },\n];\n\nexport default function Controls({\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tcontext,\n}) {\n\tconst { placeholder, options } = attributes;\n\n\tconst sortableOptions = useMemo(() => {\n\t\treturn context['prc-block/sortable-options']\n\t\t\t? JSON.parse(context['prc-block/sortable-options'])\n\t\t\t: {};\n\t}, [context]);\n\n\tuseEffect(() => {\n\t\tif (options.length > 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst allSortableOptions = Object.keys(sortableOptions).map((key) => ({\n\t\t\tlabel: sortableOptions[key].name,\n\t\t\tname: sortableOptions[key].name,\n\t\t\tvalue: key,\n\t\t\tdisabled: false,\n\t\t}));\n\t\tif (allSortableOptions.length > 0) {\n\t\t\tsetAttributes({\n\t\t\t\toptions: allSortableOptions,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsetAttributes({ options: DEFAULT_OPTIONS });\n\t}, [options, sortableOptions]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ placeholder: newPlaceholder });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ disabled: val });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport './editor.scss';\nimport edit from './edit';\nimport icon from './icon';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { Icon } from '@prc/icons';\n\nexport default function () {\n\treturn ;\n}\n","/**\n * External Dependencies\n */\nimport classnames from 'classnames';\nimport { getBlockGapSupportValue } from '@prc/block-utils';\n\n/**\n * WordPress Dependencies\n */\nimport { Fragment, useState, useRef, useEffect } from 'react';\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n * @param {Object} props.context Context object with the block's context values.\n * @param {string} props.clientId Unique ID of the block.\n * @param {boolean} props.isSelected Whether or not the block is currently selected.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tisSelected,\n\tcontext,\n}) {\n\tconst { placeholder } = attributes;\n\n\tconst blockProps = useBlockProps({\n\t\tonChange: (event) => event.preventDefault(),\n\t});\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t{/** TODO: Listbox goes here, eventually... use isSelected to open */}\n\t\t\t
\n\t\t
\n\t);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t656: 0,\n\t564: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkform_input_select\"] = globalThis[\"webpackChunkform_input_select\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [564], () => (__webpack_require__(344)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","window","DEFAULT_OPTIONS","label","value","Controls","attributes","setAttributes","clientId","context","placeholder","options","sortableOptions","useMemo","JSON","parse","useEffect","length","allSortableOptions","Object","keys","map","key","name","disabled","createElement","InspectorControls","PanelBody","title","__","TextControl","onChange","newPlaceholder","ToggleControl","checked","help","val","Sorter","attribute","metadata","settings","icon","Icon","edit","isSelected","blockProps","useBlockProps","event","preventDefault","Fragment","className","type","role","registerBlockType","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","every","splice","r","o","obj","prop","prototype","hasOwnProperty","call","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","globalThis","forEach","bind","push","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/form-input-select/build/render.php b/blocks/form-input-select/build/render.php index e9cc6db41..042cd27c3 100644 --- a/blocks/form-input-select/build/render.php +++ b/blocks/form-input-select/build/render.php @@ -15,7 +15,7 @@ ); $input_disabled = array_key_exists( 'disabled', $attributes ) ? $attributes['disabled'] : false; $input_options = empty($input_options) && array_key_exists( 'prc-block/form-input-options', $block->context) ? $block->context['prc-block/form-input-options'] : $input_options; - +// Map the currently selected value to the options $input_options = array_map( function( $option ) use ( $input_value ) { $option['isSelected'] = $option['value'] === $input_value; return $option; @@ -28,8 +28,8 @@ 'type' => 'search', 'aria-controls' => $input_id.'-input', 'placeholder' => $input_placeholder, - 'data-wp-bind--value' => 'context.label', - 'data-wp-on--keyup' => 'actions.onKeyUp', + 'data-wp-bind--value' => 'context.label', // so, this can get confusing. The value is bound to the label, when set. + 'data-wp-on--keyup' => 'actions.onKeyUp', // filter the list when the input is interacted with via keyboard 'data-wp-on--focus' => 'actions.onOpen', // open the list when the input is focused 'data-wp-on--blur' => 'actions.onClose', // close the list when the input is blurred ) ); @@ -51,9 +51,8 @@ '
  • ', $option_attrs ); -// Generate the list of options from context.filteredOptions. $options_list = wp_sprintf( - '', + '', $option_template, ); @@ -67,7 +66,7 @@ 'targetNamespace' => $target_namespace, 'activeIndex' => 0, 'value' => $input_value, - 'label' => null, + 'label' => $input_placeholder, 'isOpen' => false, 'isHidden' => false, 'isDisabled' => $input_disabled, diff --git a/blocks/form-input-select/build/style-index.css.map b/blocks/form-input-select/build/style-index.css.map new file mode 100644 index 000000000..c0d6649b3 --- /dev/null +++ b/blocks/form-input-select/build/style-index.css.map @@ -0,0 +1 @@ +{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EAGC;AAFD;AAGC;EACC;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA,mDACC;AAJH;AAOC;EACC;EACA;EACA;EACA;EACA;EACA;AALF;AAQC;EAOC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAZF;AAcE;EACC;EACA;EACA;EACA;EACA;EACA;AAZH;AAaG;EACC;AAXJ;AAaG;EACC;EACA;AAXJ;AAaG;EAGC;EACA;EACA;AAbJ;AAiBC;EACC;AAfF;AAiBC;EACC;AAfF;AAkBC;EACC;UAAA;EACA;EACA;AAhBF;AAmBC;EACC;EACA;EACA;AAjBF,C","sources":["webpack://form-input-select/./src/style.scss"],"sourcesContent":["/**\n * The following styles get applied both on the front of your site\n * and in the editor.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-prc-block-form-input-select {\n\t// --border-color: rgba(0, 0, 0, 0.2);\n\t// --wp--custom--border-radius: 3px;\n\tposition: relative;\n\tinput {\n\t\tflex-grow: 1;\n\t\ttext-align: left;\n\t\tvertical-align: top;\n\t\t-webkit-appearance: none;\n\t\tpadding: 9px 13px; // cribbed from core/button styling.\n\t\tborder: 1px solid transparent;\n\t\t// border-color: var(--border-color);\n\t\t// border-radius: var(--wp--custom--border-radius);\n\t\tbox-shadow: inset 0 0 0 0 transparent;\n\t\tbox-sizing: border-box;\n\t\twidth: 100%;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\ttransition:\n\t\t\tcolor 0.1s ease,\n\t\t\tborder-color 0.1s ease;\n\t}\n\t&[required]:after {\n\t\tcontent: \"*\";\n\t\tcolor: red;\n\t\tfont-size: 1.1em;\n\t\tposition: absolute;\n\t\ttop: 5px;\n\t\tright: 5px;\n\t}\n\n\t.wp-block-prc-block-form-input-select__list {\n\t\t// write some css for a listbox\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup\n\n\t\t// The listbox is a container for a list of options, which can be collapsed or expanded.\n\t\tposition: absolute;\n\t\tdisplay: inline-block;\n\t\twidth: 100%;\n\t\tmax-height: 200px;\n\t\tborder: 1px solid #ccc;\n\t\tborder-radius: 1px;\n\t\tbox-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);\n\t\tbackground: var(--wp--preset--color--ui-white);\n\t\toverflow-y: auto;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\t// gap: var(--block-gap);\n\t\t.wp-block-prc-block-form-input-select__list-item {\n\t\t\tdisplay: block;\n\t\t\tposition: relative;\n\t\t\tcursor: pointer;\n\t\t\tlist-style: none;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tborder-bottom: 1px solid var(--wp--preset--color--ui-gray-light);\n\t\t\t&:last-of-type {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\t&:hover {\n\t\t\t\tbackground: var(--wp--preset--color--ui-gray-light);\n\t\t\t\tcolor: var(--wp--preset--color--ui-gray-dark);\n\t\t\t}\n\t\t\t&:active,\n\t\t\t&.is-selected,\n\t\t\t&[aria-selected=\"true\"] {\n\t\t\t\tbackground: var(--wp--preset--color--ui-gray-very-light);\n\t\t\t\tcolor: var(--wp--preset--color--ui-text-color);\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\t\t}\n\t}\n\t&:not(.is-open) > ul[role=\"listbox\"] {\n\t\tdisplay: none;\n\t}\n\t&.is-open > ul[role=\"listbox\"] {\n\t\tz-index: 99999;\n\t}\n\n\tbutton {\n\t\tappearance: none;\n\t\tborder: none;\n\t\tbackground: transparent;\n\t}\n\n\t.wp-block-prc-block-form-input-select__button {\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t\ttext-align: left;\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/form-input-select/build/view.asset.php b/blocks/form-input-select/build/view.asset.php index aff1a1f05..caa237750 100644 --- a/blocks/form-input-select/build/view.asset.php +++ b/blocks/form-input-select/build/view.asset.php @@ -1 +1 @@ - array('@wordpress/interactivity', 'wp-polyfill'), 'version' => '934cd3eaf0f9446eec70', 'type' => 'module'); + array('@wordpress/interactivity', 'wp-polyfill'), 'version' => '82fe916a807ce6bb6544', 'type' => 'module'); diff --git a/blocks/form-input-select/build/view.js b/blocks/form-input-select/build/view.js index d4805cee1..bcf831158 100644 --- a/blocks/form-input-select/build/view.js +++ b/blocks/form-input-select/build/view.js @@ -1,2 +1,2 @@ -import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(l={getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store},s={},t.d(s,l),s),{actions:n}=(0,o.store)("prc-block/form-input-select",{actions:{onOpen:()=>{(0,o.getContext)().isOpen=!0},onClose:(e=null)=>{null!==e&&e.preventDefault();const t=(0,o.getContext)();let n=!1;n||(n=!0,setTimeout((()=>{t.isOpen=!1,n=!1}),100))},onReset:()=>{const e=(0,o.getContext)();e.activeIndex=0,e.value="",e.label="",e.filteredOptions=e.options},getOptionByValue:e=>{console.log("getOptionByValue",e);const t=(0,o.getContext)(),{options:n}=t,l=n.find((t=>t.value===e));return l?{index:n.findIndex((e=>e.value===l.value)),...l}:null},moveThroughOptions:(e,t)=>{const n=(0,o.getContext)(),{activeIndex:l,filteredOptions:s}=n;let r=null;r=null===l||isNaN(l)?0:l+e,r<0&&(r=s.length-1),r>=s.length&&(r=0),s.forEach((e=>{e.isSelected=!1})),s[r].isSelected=!0,n.activeIndex=r,n.filteredOptions=s,console.log("moveThroughOptions",n,r,e)},setValueOnEnter:()=>{console.log("setting value on enter");const e=(0,o.getContext)(),{activeId:t,filteredOptions:n,options:l}=e;e.filteredOptions=l;const s=n[t];e.value=s.value,e.label=s.label,e.isOpen=!1},onKeyUp:e=>{e.preventDefault();const{value:t}=e.target,l=(0,o.getContext)(),{options:s}=l,{ref:r}=(0,o.getElement)();console.log("onKeyUp",r);const i=r.getAttribute("aria-controls");if(!i)return;if("Escape"===e.key)return n.onReset(),void(!0===l.isOpen&&r.blur());if("Enter"===e.key&&n.setValueOnEnter(i),40===e.keyCode&&"ArrowDown"===e.key)return void n.moveThroughOptions(1,i);if(38===e.keyCode&&"ArrowUp"===e.key)return void n.moveThroughOptions(-1,i);const a=s.filter((e=>{const{label:o}=e;return o.toLowerCase().includes(t.toLowerCase())}));a.length&&(l.filteredOptions=a)},onClick:e=>{e.preventDefault();const{ref:t}=(0,o.getElement)(),l=(0,o.getContext)(),{options:s}=l,r=(t.getAttribute("aria-controls"),t.getAttribute("data-ref-value")),{index:i,label:a,value:c}=n.getOptionByValue(r);l.activeIndex=i,l.label=a,l.value=c,console.log("form-input-select::onClick",l,i,a,c);const u=s;u.forEach((e=>{e.isSelected=!1})),u[i].isSelected=!0,l.filteredOptions=u,n.onClose()}},callbacks:{onInit:()=>{const e=(0,o.getContext)(),{options:t}=e;console.log("form-input-select -> onInit",e,t)},onValueChange:()=>{const{ref:e}=(0,o.getElement)(),t=(0,o.getContext)(),{targetNamespace:n,value:l}=t;if(l&&"prc-block/form-input-select"!==n){const{actions:s}=(0,o.store)(n);s.onSelectChange&&(console.log("onValueChange -> onSelectChange:",t,l,e),s.onSelectChange(l,e))}},getInputValue:()=>{const{ref:e}=(0,o.getElement)(),t=(0,o.getContext)(),{value:n}=t;return console.log("getInputValue",t,n,e),n||null}}});var l,s; +import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(l={getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store},r={},t.d(r,l),r),{actions:n}=(0,o.store)("prc-block/form-input-select",{actions:{onOpen:()=>{(0,o.getContext)().isOpen=!0},onClose:(e=null)=>{null!==e&&e.preventDefault();const t=(0,o.getContext)();let n=!1;n||(n=!0,setTimeout((()=>{t.isOpen=!1,n=!1}),100))},onReset:()=>{const e=(0,o.getContext)();e.activeIndex=0,e.value="",e.label="",e.filteredOptions=e.options},getOptionByValue:e=>{console.log("getOptionByValue",e);const t=(0,o.getContext)(),{options:n}=t,l=n.find((t=>t.value===e));return l?{index:n.findIndex((e=>e.value===l.value)),...l}:null},moveThroughOptions:(e,t)=>{const n=(0,o.getContext)(),{activeIndex:l,filteredOptions:r}=n;let i=null;i=null===l||isNaN(l)?0:l+e,i<0&&(i=r.length-1),i>=r.length&&(i=0),r.forEach((e=>{e.isSelected=!1})),r[i].isSelected=!0,n.activeIndex=i,n.filteredOptions=r,console.log("moveThroughOptions",n,i,e)},onKeyUp:e=>{e.preventDefault();const{value:t}=e.target,l=(0,o.getContext)(),{options:r}=l,{ref:i}=(0,o.getElement)(),s=i.getAttribute("aria-controls");if(!s)return;if("Escape"===e.key)return n.onReset(),void(!0===l.isOpen&&i.blur());if(e.key,40===e.keyCode&&"ArrowDown"===e.key)return void n.moveThroughOptions(1,s);if(38===e.keyCode&&"ArrowUp"===e.key)return void n.moveThroughOptions(-1,s);const a=r.filter((e=>{const{label:o}=e;return o.toLowerCase().includes(t.toLowerCase())}));a.length&&(l.filteredOptions=a)},onClick:e=>{e.preventDefault();const{ref:t}=(0,o.getElement)(),l=(0,o.getContext)(),{options:r}=l,i=(t.getAttribute("aria-controls"),t.getAttribute("data-ref-value")),{index:s,label:a,value:c}=n.getOptionByValue(i);l.activeIndex=s,l.label=a,l.value=c,console.log("form-input-select::onClick",l,s,a,c);const u=r;u.forEach((e=>{e.isSelected=!1})),u[s].isSelected=!0,l.filteredOptions=u,n.onClose()}},callbacks:{onInit:()=>{const e=(0,o.getContext)(),{options:t}=e;console.log("form-input-select -> onInit",e,t)},onValueChange:()=>{const{ref:e}=(0,o.getElement)(),t=(0,o.getContext)(),{targetNamespace:n,value:l}=t;if(l&&"prc-block/form-input-select"!==n){const{actions:r}=(0,o.store)(n);r.onSelectChange&&(console.log("onValueChange -> onSelectChange:",t,l,e),r.onSelectChange(l,e))}}}});var l,r; //# sourceMappingURL=view.js.map \ No newline at end of file diff --git a/blocks/form-input-select/build/view.js.map b/blocks/form-input-select/build/view.js.map index 0170941de..fb420ffca 100644 --- a/blocks/form-input-select/build/view.js.map +++ b/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U,GAAUL,EAElB,OADAU,QAAQC,IAAI,gBAAiBX,EAASK,EAAOyB,GACxCzB,GACG,IAEI,KDzMP,IAACjB,EACJE","sources":["webpack://form-input-select/webpack/bootstrap","webpack://form-input-select/webpack/runtime/define property getters","webpack://form-input-select/webpack/runtime/hasOwnProperty shorthand","webpack://form-input-select/external module \"@wordpress/interactivity\"","webpack://form-input-select/./src/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"getElement\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","/* eslint-disable @wordpress/no-unused-vars-before-return */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store('prc-block/form-input-select', {\n\tactions: {\n\t\tonOpen: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isOpen = true;\n\t\t},\n\t\tonClose: (event = null) => {\n\t\t\t// By default this runs on the on-blur directive on the input element\n\t\t\t// but we also use it as a shortcut to close the listbox on click,\n\t\t\t// so this is a quick check to see if we're using this as a shortcut or not.\n\t\t\tif (null !== event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tconst context = getContext();\n\t\t\t// Because the on-blur event fires before the click event we need to slow things down a bit, 100 ms should do it\n\t\t\tlet isRunning = false;\n\t\t\tif (!isRunning) {\n\t\t\t\tisRunning = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tcontext.isOpen = false;\n\t\t\t\t\tisRunning = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t},\n\t\tonReset: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.activeIndex = 0;\n\t\t\tcontext.value = '';\n\t\t\tcontext.label = '';\n\t\t\tcontext.filteredOptions = context.options;\n\t\t},\n\t\tgetOptionByValue: (value) => {\n\t\t\tconsole.log('getOptionByValue', value);\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\t\t\tconst selectedOption = options.find(\n\t\t\t\t(option) => option.value === value\n\t\t\t);\n\t\t\tif (!selectedOption) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// find the object in the options array that matches the value\n\t\t\t// then set the activeId to the index of that object\n\t\t\tconst index = options.findIndex(\n\t\t\t\t(option) => option.value === selectedOption.value\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tindex,\n\t\t\t\t...selectedOption,\n\t\t\t};\n\t\t},\n\t\tmoveThroughOptions: (direction, id) => {\n\t\t\tconst context = getContext();\n\t\t\tconst { activeIndex, filteredOptions } = context;\n\t\t\tlet nextActive = null;\n\t\t\tif (activeIndex === null || isNaN(activeIndex)) {\n\t\t\t\tnextActive = 0;\n\t\t\t} else {\n\t\t\t\tnextActive = activeIndex + direction;\n\t\t\t}\n\t\t\tif (nextActive < 0) {\n\t\t\t\tnextActive = filteredOptions.length - 1;\n\t\t\t}\n\t\t\tif (nextActive >= filteredOptions.length) {\n\t\t\t\tnextActive = 0;\n\t\t\t}\n\n\t\t\tfilteredOptions.forEach((option) => {\n\t\t\t\toption.isSelected = false;\n\t\t\t});\n\t\t\tfilteredOptions[nextActive].isSelected = true;\n\n\t\t\tcontext.activeIndex = nextActive;\n\t\t\tcontext.filteredOptions = filteredOptions;\n\t\t\tconsole.log('moveThroughOptions', context, nextActive, direction);\n\t\t},\n\t\tsetValueOnEnter: () => {\n\t\t\tconsole.log('setting value on enter');\n\t\t\tconst context = getContext();\n\t\t\tconst { activeId, filteredOptions, options } = context;\n\t\t\tcontext.filteredOptions = options;\n\n\t\t\tconst highlightedOption = filteredOptions[activeId];\n\t\t\tcontext.value = highlightedOption.value;\n\t\t\tcontext.label = highlightedOption.label;\n\t\t\tcontext.isOpen = false;\n\t\t},\n\t\tonKeyUp: (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst { value } = event.target;\n\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\t\t\tconst { ref } = getElement();\n\t\t\tconsole.log('onKeyUp', ref);\n\t\t\tconst id = ref.getAttribute('aria-controls');\n\t\t\tif (!id) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tactions.onReset();\n\t\t\t\tif (true === context.isOpen) {\n\t\t\t\t\tref.blur();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === 'Enter') {\n\t\t\t\tactions.setValueOnEnter(id);\n\t\t\t}\n\t\t\tif (event.keyCode === 40 && event.key === 'ArrowDown') {\n\t\t\t\tactions.moveThroughOptions(1, id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (event.keyCode === 38 && event.key === 'ArrowUp') {\n\t\t\t\tactions.moveThroughOptions(-1, id);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check if any of the options contain the value of the input\n\t\t\tconst matches = options.filter((option) => {\n\t\t\t\tconst { label } = option;\n\t\t\t\treturn label.toLowerCase().includes(value.toLowerCase());\n\t\t\t});\n\t\t\t// if there are matches set the filteredOptions to the matches\n\t\t\tif (matches.length) {\n\t\t\t\tcontext.filteredOptions = matches;\n\t\t\t}\n\t\t},\n\t\tonClick: (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst { ref } = getElement();\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\n\t\t\tconst id = ref.getAttribute('aria-controls');\n\t\t\tconst val = ref.getAttribute('data-ref-value');\n\t\t\tconst { index, label, value } = actions.getOptionByValue(val);\n\n\t\t\tcontext.activeIndex = index;\n\t\t\tcontext.label = label;\n\t\t\tcontext.value = value;\n\n\t\t\tconsole.log(\n\t\t\t\t'form-input-select::onClick',\n\t\t\t\tcontext,\n\t\t\t\tindex,\n\t\t\t\tlabel,\n\t\t\t\tvalue\n\t\t\t);\n\n\t\t\t// find any other isSelected and set to false and then set isSelected\n\t\t\t// on the clicked option\n\t\t\t// also, reset the filteredOptions to the original options now that we have a value\n\t\t\tconst filteredOptions = options;\n\t\t\tfilteredOptions.forEach((option) => {\n\t\t\t\toption.isSelected = false;\n\t\t\t});\n\t\t\tfilteredOptions[index].isSelected = true;\n\t\t\tcontext.filteredOptions = filteredOptions;\n\n\t\t\tactions.onClose();\n\t\t},\n\t},\n\tcallbacks: {\n\t\tonInit: () => {\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\t\t\tconsole.log('form-input-select -> onInit', context, options);\n\t\t},\n\t\tonValueChange: () => {\n\t\t\tconst { ref } = getElement();\n\t\t\tconst context = getContext();\n\t\t\tconst { targetNamespace, value } = context;\n\t\t\t// if the value is not empty and the targetNamespace is not the same as the current namespace\n\t\t\t// then hoist the value up to the targetNamespace\n\t\t\tif (value && 'prc-block/form-input-select' !== targetNamespace) {\n\t\t\t\tconst { actions: targetActions } = store(targetNamespace);\n\t\t\t\tif (targetActions.onSelectChange) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t'onValueChange -> onSelectChange:',\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tref\n\t\t\t\t\t);\n\t\t\t\t\ttargetActions.onSelectChange(value, ref);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetInputValue: () => {\n\t\t\tconst { ref } = getElement();\n\t\t\tconst context = getContext();\n\t\t\tconst { value } = context;\n\t\t\tconsole.log('getInputValue', context, value, ref);\n\t\t\tif (!value) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","actions","store","onOpen","getContext","isOpen","onClose","event","preventDefault","context","isRunning","setTimeout","onReset","activeIndex","value","label","filteredOptions","options","getOptionByValue","console","log","selectedOption","find","option","index","findIndex","moveThroughOptions","direction","id","nextActive","isNaN","length","forEach","isSelected","setValueOnEnter","activeId","highlightedOption","onKeyUp","target","ref","getElement","getAttribute","blur","keyCode","matches","filter","toLowerCase","includes","onClick","val","callbacks","onInit","onValueChange","targetNamespace","targetActions","onSelectChange","getInputValue"],"sourceRoot":""} +{"version":3,"file":"view.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICIlF,MAAM,GAJGI,EAI8B,CAAE,WAAgB,IAAOC,EAAwE,WAAG,WAAgB,IAAOA,EAAwE,WAAG,MAAW,IAAOA,EAAmE,OAH7TC,EAAI,CAAC,EAAGhB,EAAoBiB,EAAED,EAAGF,GAAWE,ICE3C,QAAEE,IAAYC,EAAAA,EAAAA,OAAM,8BAA+B,CACxDD,QAAS,CACRE,OAAQA,MACSC,EAAAA,EAAAA,cACRC,QAAS,CAAI,EAEtBC,QAASA,CAACC,EAAQ,QAIb,OAASA,GACZA,EAAMC,iBAEP,MAAMC,GAAUL,EAAAA,EAAAA,cAEhB,IAAIM,GAAY,EACXA,IACJA,GA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EACAsB,GAEDe,EAAcC,eAAetC,EAAOsB,GAEtC,MD9KK,IAACvC,EACJE","sources":["webpack://form-input-select/webpack/bootstrap","webpack://form-input-select/webpack/runtime/define property getters","webpack://form-input-select/webpack/runtime/hasOwnProperty shorthand","webpack://form-input-select/external module \"@wordpress/interactivity\"","webpack://form-input-select/./src/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), [\"getElement\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), [\"store\"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });","/* eslint-disable @wordpress/no-unused-vars-before-return */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store('prc-block/form-input-select', {\n\tactions: {\n\t\tonOpen: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.isOpen = true;\n\t\t},\n\t\tonClose: (event = null) => {\n\t\t\t// By default this runs on the on-blur directive on the input element\n\t\t\t// but we also use it as a shortcut to close the listbox on click,\n\t\t\t// so this is a quick check to see if we're using this as a shortcut or not.\n\t\t\tif (null !== event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tconst context = getContext();\n\t\t\t// Because the on-blur event fires before the click event we need to slow things down a bit, 100 ms should do it\n\t\t\tlet isRunning = false;\n\t\t\tif (!isRunning) {\n\t\t\t\tisRunning = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tcontext.isOpen = false;\n\t\t\t\t\tisRunning = false;\n\t\t\t\t}, 100);\n\t\t\t}\n\t\t},\n\t\tonReset: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.activeIndex = 0;\n\t\t\tcontext.value = '';\n\t\t\tcontext.label = '';\n\t\t\tcontext.filteredOptions = context.options;\n\t\t},\n\t\tgetOptionByValue: (value) => {\n\t\t\tconsole.log('getOptionByValue', value);\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\t\t\tconst selectedOption = options.find(\n\t\t\t\t(option) => option.value === value\n\t\t\t);\n\t\t\tif (!selectedOption) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// find the object in the options array that matches the value\n\t\t\t// then set the activeId to the index of that object\n\t\t\tconst index = options.findIndex(\n\t\t\t\t(option) => option.value === selectedOption.value\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tindex,\n\t\t\t\t...selectedOption,\n\t\t\t};\n\t\t},\n\t\tmoveThroughOptions: (direction, id) => {\n\t\t\tconst context = getContext();\n\t\t\tconst { activeIndex, filteredOptions } = context;\n\t\t\tlet nextActive = null;\n\t\t\tif (activeIndex === null || isNaN(activeIndex)) {\n\t\t\t\tnextActive = 0;\n\t\t\t} else {\n\t\t\t\tnextActive = activeIndex + direction;\n\t\t\t}\n\t\t\tif (nextActive < 0) {\n\t\t\t\tnextActive = filteredOptions.length - 1;\n\t\t\t}\n\t\t\tif (nextActive >= filteredOptions.length) {\n\t\t\t\tnextActive = 0;\n\t\t\t}\n\n\t\t\tfilteredOptions.forEach((option) => {\n\t\t\t\toption.isSelected = false;\n\t\t\t});\n\t\t\tfilteredOptions[nextActive].isSelected = true;\n\n\t\t\tcontext.activeIndex = nextActive;\n\t\t\tcontext.filteredOptions = filteredOptions;\n\t\t\tconsole.log('moveThroughOptions', context, nextActive, direction);\n\t\t},\n\t\tonKeyUp: (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst { value } = event.target;\n\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\t\t\tconst { ref } = getElement();\n\t\t\tconst id = ref.getAttribute('aria-controls');\n\t\t\tif (!id) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tactions.onReset();\n\t\t\t\tif (true === context.isOpen) {\n\t\t\t\t\tref.blur();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === 'Enter') {\n\t\t\t\t// actions.setValueOnEnter(id);\n\t\t\t}\n\t\t\tif (event.keyCode === 40 && event.key === 'ArrowDown') {\n\t\t\t\tactions.moveThroughOptions(1, id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (event.keyCode === 38 && event.key === 'ArrowUp') {\n\t\t\t\tactions.moveThroughOptions(-1, id);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check if any of the options contain the value of the input\n\t\t\tconst matches = options.filter((option) => {\n\t\t\t\tconst { label } = option;\n\t\t\t\treturn label.toLowerCase().includes(value.toLowerCase());\n\t\t\t});\n\t\t\t// if there are matches set the filteredOptions to the matches\n\t\t\tif (matches.length) {\n\t\t\t\tcontext.filteredOptions = matches;\n\t\t\t}\n\t\t},\n\t\tonClick: (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst { ref } = getElement();\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\n\t\t\tconst id = ref.getAttribute('aria-controls');\n\t\t\tconst val = ref.getAttribute('data-ref-value');\n\t\t\tconst { index, label, value } = actions.getOptionByValue(val);\n\n\t\t\tcontext.activeIndex = index;\n\t\t\tcontext.label = label;\n\t\t\tcontext.value = value;\n\n\t\t\tconsole.log('form-input-select::onClick', context, index, label, value);\n\n\t\t\t// find any other isSelected and set to false and then set isSelected\n\t\t\t// on the clicked option\n\t\t\t// also, reset the filteredOptions to the original options now that we have a value\n\t\t\tconst filteredOptions = options;\n\t\t\tfilteredOptions.forEach((option) => {\n\t\t\t\toption.isSelected = false;\n\t\t\t});\n\t\t\tfilteredOptions[index].isSelected = true;\n\t\t\tcontext.filteredOptions = filteredOptions;\n\n\t\t\tactions.onClose();\n\t\t},\n\t},\n\tcallbacks: {\n\t\tonInit: () => {\n\t\t\tconst context = getContext();\n\t\t\tconst { options } = context;\n\n\t\t\tconsole.log(\"form-input-select -> onInit\", context, options);\n\t\t},\n\t\tonValueChange: () => {\n\t\t\tconst { ref } = getElement();\n\t\t\tconst context = getContext();\n\t\t\tconst { targetNamespace, value } = context;\n\t\t\t// if the value is not empty and the targetNamespace is not the same as the current namespace\n\t\t\t// then hoist the value up to the targetNamespace\n\t\t\tif (value && 'prc-block/form-input-select' !== targetNamespace) {\n\t\t\t\tconst { actions: targetActions } = store(targetNamespace);\n\t\t\t\tif (targetActions.onSelectChange) {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t'onValueChange -> onSelectChange:',\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tref\n\t\t\t\t\t);\n\t\t\t\t\ttargetActions.onSelectChange(value, ref);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n});\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","x","d","actions","store","onOpen","getContext","isOpen","onClose","event","preventDefault","context","isRunning","setTimeout","onReset","activeIndex","value","label","filteredOptions","options","getOptionByValue","console","log","selectedOption","find","option","index","findIndex","moveThroughOptions","direction","id","nextActive","isNaN","length","forEach","isSelected","onKeyUp","target","ref","getElement","getAttribute","blur","keyCode","matches","filter","toLowerCase","includes","onClick","val","callbacks","onInit","onValueChange","targetNamespace","targetActions","onSelectChange"],"sourceRoot":""} \ No newline at end of file diff --git a/blocks/form-input-select/src/_view.js b/blocks/form-input-select/src/_view.js index 180584f48..bab2a90cc 100644 --- a/blocks/form-input-select/src/_view.js +++ b/blocks/form-input-select/src/_view.js @@ -221,6 +221,6 @@ const { actions } = store('prc-block/form-input-select', { targetState[id].value = ''; targetState[id].isOpen = false; } - } + }, }, }); diff --git a/blocks/form-input-select/src/block.json b/blocks/form-input-select/src/block.json index 5f5f679cd..7e31a98ca 100644 --- a/blocks/form-input-select/src/block.json +++ b/blocks/form-input-select/src/block.json @@ -29,6 +29,24 @@ }, "value": { "type": "string" + }, + "style": { + "type": "object", + "default": { + "border": { + "width": "1px", + "color": "#dadbdb", + "radius": "3px" + }, + "spacing": { + "padding": { + "top": "0.3rem", + "bottom": "0.3rem", + "left": "var:preset|spacing|20", + "right": "var:preset|spacing|20" + } + } + } } }, "supports": { @@ -64,21 +82,10 @@ "prc-facets/template/facetLabel", "prc-block/sortable-options" ], - "styles": [ - { - "name": "default", - "label": "Default", - "isDefault": true - }, - { - "name": "autocomplete", - "label": "Autcomplete" - } - ], "parent": ["prc-block/form-field"], "textdomain": "form-input-select", "editorScript": "file:./index.js", "style": "file:./style-index.css", "render": "file:./render.php", - "viewScriptModule": "file:./view.js" + "viewModule": "file:./view.js" } diff --git a/blocks/form-input-select/src/render.php b/blocks/form-input-select/src/render.php index e9cc6db41..042cd27c3 100644 --- a/blocks/form-input-select/src/render.php +++ b/blocks/form-input-select/src/render.php @@ -15,7 +15,7 @@ ); $input_disabled = array_key_exists( 'disabled', $attributes ) ? $attributes['disabled'] : false; $input_options = empty($input_options) && array_key_exists( 'prc-block/form-input-options', $block->context) ? $block->context['prc-block/form-input-options'] : $input_options; - +// Map the currently selected value to the options $input_options = array_map( function( $option ) use ( $input_value ) { $option['isSelected'] = $option['value'] === $input_value; return $option; @@ -28,8 +28,8 @@ 'type' => 'search', 'aria-controls' => $input_id.'-input', 'placeholder' => $input_placeholder, - 'data-wp-bind--value' => 'context.label', - 'data-wp-on--keyup' => 'actions.onKeyUp', + 'data-wp-bind--value' => 'context.label', // so, this can get confusing. The value is bound to the label, when set. + 'data-wp-on--keyup' => 'actions.onKeyUp', // filter the list when the input is interacted with via keyboard 'data-wp-on--focus' => 'actions.onOpen', // open the list when the input is focused 'data-wp-on--blur' => 'actions.onClose', // close the list when the input is blurred ) ); @@ -51,9 +51,8 @@ '
  • ', $option_attrs ); -// Generate the list of options from context.filteredOptions. $options_list = wp_sprintf( - '', + '', $option_template, ); @@ -67,7 +66,7 @@ 'targetNamespace' => $target_namespace, 'activeIndex' => 0, 'value' => $input_value, - 'label' => null, + 'label' => $input_placeholder, 'isOpen' => false, 'isHidden' => false, 'isDisabled' => $input_disabled, diff --git a/blocks/form-input-select/src/view.js b/blocks/form-input-select/src/view.js index 292a4ff65..2a361308c 100644 --- a/blocks/form-input-select/src/view.js +++ b/blocks/form-input-select/src/view.js @@ -77,17 +77,6 @@ const { actions } = store('prc-block/form-input-select', { context.filteredOptions = filteredOptions; console.log('moveThroughOptions', context, nextActive, direction); }, - setValueOnEnter: () => { - console.log('setting value on enter'); - const context = getContext(); - const { activeId, filteredOptions, options } = context; - context.filteredOptions = options; - - const highlightedOption = filteredOptions[activeId]; - context.value = highlightedOption.value; - context.label = highlightedOption.label; - context.isOpen = false; - }, onKeyUp: (event) => { event.preventDefault(); const { value } = event.target; @@ -95,7 +84,6 @@ const { actions } = store('prc-block/form-input-select', { const context = getContext(); const { options } = context; const { ref } = getElement(); - console.log('onKeyUp', ref); const id = ref.getAttribute('aria-controls'); if (!id) { return; @@ -110,7 +98,7 @@ const { actions } = store('prc-block/form-input-select', { } if (event.key === 'Enter') { - actions.setValueOnEnter(id); + // actions.setValueOnEnter(id); } if (event.keyCode === 40 && event.key === 'ArrowDown') { actions.moveThroughOptions(1, id); @@ -145,13 +133,7 @@ const { actions } = store('prc-block/form-input-select', { context.label = label; context.value = value; - console.log( - 'form-input-select::onClick', - context, - index, - label, - value - ); + console.log('form-input-select::onClick', context, index, label, value); // find any other isSelected and set to false and then set isSelected // on the clicked option @@ -170,7 +152,8 @@ const { actions } = store('prc-block/form-input-select', { onInit: () => { const context = getContext(); const { options } = context; - console.log('form-input-select -> onInit', context, options); + + console.log("form-input-select -> onInit", context, options); }, onValueChange: () => { const { ref } = getElement(); @@ -191,15 +174,5 @@ const { actions } = store('prc-block/form-input-select', { } } }, - getInputValue: () => { - const { ref } = getElement(); - const context = getContext(); - const { value } = context; - console.log('getInputValue', context, value, ref); - if (!value) { - return null; - } - return value; - }, }, }); diff --git a/blocks/form-input-text/build/index.asset.php b/blocks/form-input-text/build/index.asset.php index 4940afa75..16ba04419 100644 --- a/blocks/form-input-text/build/index.asset.php +++ b/blocks/form-input-text/build/index.asset.php @@ -1 +1 @@ - array('prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '99a7f7cf7b427ed945ef'); + array('prc-icons', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '68bcc0fafe85148fdc63'); diff --git a/blocks/form-input-text/build/index.js b/blocks/form-input-text/build/index.js index e62e48fd8..425b09753 100644 --- a/blocks/form-input-text/build/index.js +++ b/blocks/form-input-text/build/index.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t={152:()=>{const e=window.wp.blocks,t=window.React,r=window.wp.element,n=window.wp.blockEditor,a=window.wp.i18n,l=window.wp.components;function o({attributes:e,setAttributes:r}){const{placeholder:o,type:i}=e,p=e?.metadata?.name;return(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(l.PanelBody,{title:(0,a.__)("Form Input Field Settings")},(0,t.createElement)(l.SelectControl,{label:"Input Type",value:i,options:[{label:"Text",value:"text"},{label:"Text Area",value:"textarea"},{label:"Email",value:"email"},{label:"Password",value:"password"}],onChange:e=>{r({type:e})}}),(0,t.createElement)(l.TextControl,{label:"Input Name",value:p,onChange:t=>{r({metadata:{...e.metadata,name:t}})}}),(0,t.createElement)(l.TextControl,{label:"Input Placeholder",value:o,onChange:e=>{r({placeholder:e})}})))}const i=window.prcIcons,p=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/form-input-text","version":"0.1.0","title":"Input Text Field","description":"A primtive block for a text input field in a form.","category":"design","attributes":{"placeholder":{"type":"string","default":"Enter text..."},"type":{"type":"string","enum":["email","password","text","textarea","number"],"default":"text"},"value":{"type":"string"},"style":{"type":"object","default":{"typography":{"lineHeight":"1"}}}},"parent":["prc-block/form-field"],"supports":{"anchor":true,"html":false,"reusable":false,"inserter":false,"__experimentalBorder":{"color":true,"width":true},"spacing":{"padding":true,"margin":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"interactivity":true},"usesContext":["prc-block/form-field/required","prc-block/form-field/label","prc-block/form-input-target-namespace"],"textdomain":"form-input-text","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}'),{name:s}=p,u={icon:function(){return(0,t.createElement)(i.Icon,{icon:i.icons.faInputText,width:18,preserveAspectRatio:"xMidYMid meet"})},edit:function({attributes:e,setAttributes:a,context:l}){const i=l?.["prc-block/form-field-required"],{placeholder:p,type:s}=e,u=(0,n.useBlockProps)({placeholder:p,onChange:e=>e.preventDefault(),type:s,required:i});return(0,t.createElement)(r.Fragment,null,(0,t.createElement)(o,{attributes:e,setAttributes:a}),"textarea"!==s?(0,t.createElement)("input",{...u}):(0,t.createElement)("textarea",{...u}))}};(0,e.registerBlockType)(s,{...p,...u})}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,r,a,l)=>{if(!r){var o=1/0;for(u=0;u=l)&&Object.keys(n.O).every((e=>n.O[e](r[p])))?r.splice(p--,1):(i=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[r,a,l]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,l,[o,i,p]=r,s=0;if(o.some((t=>0!==e[t]))){for(a in i)n.o(i,a)&&(n.m[a]=i[a]);if(p)var u=p(n)}for(t&&t(r);sn(152)));a=n.O(a)})(); +(()=>{"use strict";var e,t={537:()=>{const e=window.wp.blocks,t=window.React,r=window.wp.element,n=window.wp.blockEditor,a=window.wp.i18n,l=window.wp.components;function o({attributes:e,setAttributes:r}){const{placeholder:o,type:i}=e,p=e?.metadata?.name;return(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(l.PanelBody,{title:(0,a.__)("Form Input Field Settings")},(0,t.createElement)(l.SelectControl,{label:"Input Type",value:i,options:[{label:"Text",value:"text"},{label:"Text Area",value:"textarea"},{label:"Email",value:"email"},{label:"Password",value:"password"}],onChange:e=>{r({type:e})}}),(0,t.createElement)(l.TextControl,{label:"Input Name",value:p,onChange:t=>{r({metadata:{...e.metadata,name:t}})}}),(0,t.createElement)(l.TextControl,{label:"Input Placeholder",value:o,onChange:e=>{r({placeholder:e})}})))}const i=window.prcIcons,p=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"prc-block/form-input-text","version":"0.1.0","title":"Input Text Field","description":"A primtive block for a text input field in a form.","category":"design","attributes":{"placeholder":{"type":"string","default":"Enter text..."},"type":{"type":"string","enum":["email","password","text","textarea","number"],"default":"text"},"value":{"type":"string"},"style":{"type":"object","default":{"typography":{"lineHeight":"1"}}}},"parent":["prc-block/form-field"],"supports":{"anchor":true,"html":false,"reusable":false,"inserter":false,"__experimentalBorder":{"color":true,"width":true},"spacing":{"padding":true,"margin":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true}},"interactivity":true},"usesContext":["prc-block/form-field/required","prc-block/form-field/label","prc-block/form-input-target-namespace"],"textdomain":"form-input-text","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}'),{name:u}=p,s={icon:function(){return(0,t.createElement)(i.Icon,{icon:"input-text"})},edit:function({attributes:e,setAttributes:a,context:l}){const i=l?.["prc-block/form-field-required"],{placeholder:p,type:u}=e,s=(0,n.useBlockProps)({placeholder:p,onChange:e=>e.preventDefault(),type:u,required:i});return(0,t.createElement)(r.Fragment,null,(0,t.createElement)(o,{attributes:e,setAttributes:a}),"textarea"!==u?(0,t.createElement)("input",{...s}):(0,t.createElement)("textarea",{...s}))}};(0,e.registerBlockType)(u,{...p,...s})}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,r,a,l)=>{if(!r){var o=1/0;for(s=0;s=l)&&Object.keys(n.O).every((e=>n.O[e](r[p])))?r.splice(p--,1):(i=!1,l0&&e[s-1][2]>l;s--)e[s]=e[s-1];e[s]=[r,a,l]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={826:0,431:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,l,[o,i,p]=r,u=0;if(o.some((t=>0!==e[t]))){for(a in i)n.o(i,a)&&(n.m[a]=i[a]);if(p)var s=p(n)}for(t&&t(r);un(537)));a=n.O(a)})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/blocks/form-input-text/build/index.js.map b/blocks/form-input-text/build/index.js.map index 238c01b76..31c7c8a60 100644 --- a/blocks/form-input-text/build/index.js.map +++ b/blocks/form-input-text/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"uBAAIA,E,YCAJ,MAAM,EAA+BC,OAAW,GAAU,OCApD,EAA+BA,OAAc,MCA7C,EAA+BA,OAAW,GAAW,Q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AASwD,GAAKxD,EAASwD,EAAI,GACrGxD,EAASwD,GAAK,CAACL,EAAUC,EAAIC,EAqBjB,Ea1BdZ,EAAoByB,EAAI,CAACC,EAAKC,IAAUR,OAAOS,UAAUC,eAAeC,KAAKJ,EAAKC,G,MCKlF,IAAII,EAAkB,CACrB,GAAI,EACJ,IAAK,GAaN/B,EAAoBQ,EAAEU,EAAKc,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BC,KACvD,IAGIlC,EAAU+B,GAHTtB,EAAU0B,EAAaC,GAAWF,EAGhBpB,EAAI,EAC3B,GAAGL,EAAS4B,MAAMC,GAAgC,IAAxBR,EAAgBQ,KAAa,CACtD,IAAItC,KAAYmC,EACZpC,EAAoByB,EAAEW,EAAanC,KACrCD,EAAoBO,EAAEN,GAAYmC,EAAYnC,IAGhD,GAAGoC,EAAS,IAAI5B,EAAS4B,EAAQrC,EAClC,CAEA,IADGkC,GAA4BA,EAA2BC,GACrDpB,EAAIL,EAASM,OAAQD,IACzBiB,EAAUtB,EAASK,GAChBf,EAAoByB,EAAEM,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOhC,EAAoBQ,EAAEC,EAAO,EAGjC+B,EAAqBC,WAAwC,4BAAIA,WAAwC,6BAAK,GAClHD,EAAmBE,QAAQT,EAAqBU,KAAK,KAAM,IAC3DH,EAAmBI,KAAOX,EAAqBU,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC9CvF,IAAIK,EAAsB7C,EAAoBQ,OAAEL,EAAW,CAAC,MAAM,IAAOH,EAAoB,OAC7F6C,EAAsB7C,EAAoBQ,EAAEqC,E","sources":["webpack://form-input-text/webpack/runtime/chunk loaded","webpack://form-input-text/external window [\"wp\",\"blocks\"]","webpack://form-input-text/external window \"React\"","webpack://form-input-text/external window [\"wp\",\"element\"]","webpack://form-input-text/external window [\"wp\",\"blockEditor\"]","webpack://form-input-text/external window [\"wp\",\"i18n\"]","webpack://form-input-text/external window [\"wp\",\"components\"]","webpack://form-input-text/./src/controls.jsx","webpack://form-input-text/external window \"prcIcons\"","webpack://form-input-text/./src/index.js","webpack://form-input-text/./src/icon.js","webpack://form-input-text/./src/edit.jsx","webpack://form-input-text/webpack/bootstrap","webpack://form-input-text/webpack/runtime/hasOwnProperty shorthand","webpack://form-input-text/webpack/runtime/jsonp chunk loading","webpack://form-input-text/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","/**\n * WordPress Dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, SelectControl, TextControl, ToggleControl } from '@wordpress/components';\n\n/**\n * Internal Dependencies\n */\n\nexport default function Controls({ attributes, setAttributes }) {\n\tconst { placeholder, type } = attributes;\n\tconst name = attributes?.metadata?.name;\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ type: newType });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ metadata: {...attributes.metadata, name: newName } });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t {\n\t\t\t\t\t\tsetAttributes({ placeholder: newPlaceholder });\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\n\t\t\n\t);\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"prcIcons\"];","/**\n * Registers a new block provided a unique name and an object defining its behavior.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\n\n/**\n * External Dependencies\n */\n\n/**\n * WordPress Dependencies\n */\nimport { registerBlockType } from '@wordpress/blocks';\n\n/**\n * Internal Dependencies\n */\n\n/**\n * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.\n * All files containing `style` keyword are bundled together. The code used\n * gets applied both to the front of your site and to the editor. All other files\n * get applied to the editor only.\n *\n * @see https://www.npmjs.com/package/@wordpress/scripts#using-css\n */\nimport './style.scss';\nimport edit from './edit';\nimport icon from './icon';\n\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nconst settings = {\n\ticon,\n\tedit,\n};\n\n/**\n * Every block starts by registering a new block type definition.\n *\n * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block\n */\nregisterBlockType(name, { ...metadata, ...settings });\n","/**\n * External Dependencies\n */\nimport { icons, Icon } from '@prc/icons';\n\nexport default function() {\n\treturn(\n\t\t\n\t);\n}\n","/**\n * WordPress Dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal Dependencies\n */\nimport Controls from './controls';\n\n/**\n * The edit function describes the structure of your block in the context of the\n * editor. This represents what the editor will render when the block is used.\n *\n * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit\n *\n * @param {Object} props Properties passed to the function.\n * @param {Object} props.attributes Available block attributes.\n * @param {Function} props.setAttributes Function that updates individual attributes.\n *\n * @return {WPElement} Element to render.\n */\nexport default function Edit({ attributes, setAttributes, context }) {\n\tconst isRequired = context?.['prc-block/form-field-required'];\n\tconst { placeholder, type } = attributes;\n\tconst blockProps = useBlockProps({\n\t\tplaceholder,\n\t\tonChange: (event) => event.preventDefault(),\n\t\ttype,\n\t\trequired: isRequired,\n\t});\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t{'textarea' !== type ? () : (