vanilla-icon-picker
3 weeks ago
cptui-editor.asset.php
3 weeks ago
cptui-editor.js
3 weeks ago
cptui-editor.js.map
3 weeks ago
cptui-styles.css
3 weeks ago
cptui-styles.css.map
3 weeks ago
cptui-styles.min.css
3 weeks ago
cptui-styles.min.css.map
3 weeks ago
cptui.asset.php
3 weeks ago
cptui.js
3 weeks ago
cptui.js.map
3 weeks ago
cptui.min.js
3 weeks ago
cptui.min.js.map
3 weeks ago
dashicons.json
3 weeks ago
cptui-editor.js
120 lines
| 1 | /******/ (() => { // webpackBootstrap |
| 2 | /******/ "use strict"; |
| 3 | /******/ // The require scope |
| 4 | /******/ var __webpack_require__ = {}; |
| 5 | /******/ |
| 6 | /************************************************************************/ |
| 7 | /******/ /* webpack/runtime/compat get default export */ |
| 8 | /******/ (() => { |
| 9 | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| 10 | /******/ __webpack_require__.n = (module) => { |
| 11 | /******/ var getter = module && module.__esModule ? |
| 12 | /******/ () => (module['default']) : |
| 13 | /******/ () => (module); |
| 14 | /******/ __webpack_require__.d(getter, { a: getter }); |
| 15 | /******/ return getter; |
| 16 | /******/ }; |
| 17 | /******/ })(); |
| 18 | /******/ |
| 19 | /******/ /* webpack/runtime/define property getters */ |
| 20 | /******/ (() => { |
| 21 | /******/ // define getter functions for harmony exports |
| 22 | /******/ __webpack_require__.d = (exports, definition) => { |
| 23 | /******/ for(var key in definition) { |
| 24 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 25 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 26 | /******/ } |
| 27 | /******/ } |
| 28 | /******/ }; |
| 29 | /******/ })(); |
| 30 | /******/ |
| 31 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 32 | /******/ (() => { |
| 33 | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 34 | /******/ })(); |
| 35 | /******/ |
| 36 | /************************************************************************/ |
| 37 | |
| 38 | ;// external ["wp","plugins"] |
| 39 | const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; |
| 40 | ;// external ["wp","editor"] |
| 41 | const external_wp_editor_namespaceObject = window["wp"]["editor"]; |
| 42 | ;// external ["wp","data"] |
| 43 | const external_wp_data_namespaceObject = window["wp"]["data"]; |
| 44 | ;// external ["wp","element"] |
| 45 | const external_wp_element_namespaceObject = window["wp"]["element"]; |
| 46 | ;// external ["wp","components"] |
| 47 | const external_wp_components_namespaceObject = window["wp"]["components"]; |
| 48 | ;// external ["wp","i18n"] |
| 49 | const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
| 50 | ;// external ["wp","apiFetch"] |
| 51 | const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
| 52 | var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
| 53 | ;// external "ReactJSXRuntime" |
| 54 | const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
| 55 | ;// ./src/js/cptui-editor.js |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | const CPTUIProPanel = () => { |
| 65 | const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select('core/editor').getCurrentPostType(), []); |
| 66 | const [dismissed, setDismissed] = (0,external_wp_element_namespaceObject.useState)(false); |
| 67 | const [dismissing, setDismissing] = (0,external_wp_element_namespaceObject.useState)(false); |
| 68 | const config = window.cptuiProPanel || {}; |
| 69 | const allowedTypes = config.postTypes || []; |
| 70 | if (dismissed || !postType || !allowedTypes.includes(postType)) { |
| 71 | return null; |
| 72 | } |
| 73 | const handleDismiss = () => { |
| 74 | setDismissing(true); |
| 75 | external_wp_apiFetch_default()({ |
| 76 | path: '/cptui/v1/dismiss-pro-upsell', |
| 77 | method: 'POST' |
| 78 | }).then(() => { |
| 79 | setDismissed(true); |
| 80 | }).catch(() => { |
| 81 | setDismissing(false); |
| 82 | }); |
| 83 | }; |
| 84 | return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.PluginDocumentSettingPanel, { |
| 85 | name: "cptui-pro-callout", |
| 86 | title: (0,external_wp_i18n_namespaceObject.__)('Display with CPT UI Pro', 'custom-post-type-ui'), |
| 87 | className: "cptui-pro-panel", |
| 88 | children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
| 89 | style: { |
| 90 | marginTop: 0 |
| 91 | }, |
| 92 | children: (0,external_wp_i18n_namespaceObject.__)('CPT UI Pro adds a dedicated Gutenberg block for displaying this content anywhere on your site — pull and render this post type inside any block-editor post or page, no code required.', 'custom-post-type-ui') |
| 93 | }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
| 94 | style: { |
| 95 | display: 'flex', |
| 96 | alignItems: 'center', |
| 97 | gap: '12px', |
| 98 | flexWrap: 'wrap' |
| 99 | }, |
| 100 | children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
| 101 | variant: "primary", |
| 102 | href: config.proUrl, |
| 103 | target: "_blank", |
| 104 | rel: "noopener noreferrer", |
| 105 | children: (0,external_wp_i18n_namespaceObject.__)('Get CPT UI Pro', 'custom-post-type-ui') |
| 106 | }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
| 107 | variant: "link", |
| 108 | onClick: handleDismiss, |
| 109 | disabled: dismissing, |
| 110 | children: (0,external_wp_i18n_namespaceObject.__)('Dismiss', 'custom-post-type-ui') |
| 111 | })] |
| 112 | })] |
| 113 | }); |
| 114 | }; |
| 115 | (0,external_wp_plugins_namespaceObject.registerPlugin)('cptui-pro-panel', { |
| 116 | render: CPTUIProPanel |
| 117 | }); |
| 118 | /******/ })() |
| 119 | ; |
| 120 | //# sourceMappingURL=cptui-editor.js.map |