diff --git a/README.md b/README.md index bb97877..922e967 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ **Requires at least:** 5.3 **Requires PHP:** 7.0 **Tested up to:** 5.7 -**Stable tag:** 3.0.5 +**Stable tag:** 3.0.6 **License:** GPLv2 or later **License URI:** [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html) diff --git a/changelog.md b/changelog.md index f432b5c..d410135 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,12 @@ All notable changes to this project are documented in this file. ## Unreleased +## [3.0.6 - 2021-04-7](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.0.6) + +### Bug fixes + +- Fixed "Send to Telegram" flag not saved for block editor drafts. + ## [3.0.5 - 2021-04-1](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.0.5) ### Bug fixes diff --git a/composer.json b/composer.json index 008eb84..192cdbe 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wptelegram/core", - "version": "3.0.5", + "version": "3.0.6", "description": "Integrate your WordPress site perfectly with Telegram with full control.", "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "*", diff --git a/package.json b/package.json index 1bdeeb9..aaf91c5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wptelegram", "title": "WP Telegram", - "version": "3.0.5", + "version": "3.0.6", "description": "Integrate your WordPress site perfectly with Telegram with full control.", "repository": { "type": "git", diff --git a/src/README.txt b/src/README.txt index bd38f2b..afb354c 100644 --- a/src/README.txt +++ b/src/README.txt @@ -5,7 +5,7 @@ Tags: telegram, notifications, posts, channel, group Requires at least: 5.3 Tested up to: 5.7 Requires PHP: 7.0 -Stable tag: 3.0.5 +Stable tag: 3.0.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -141,6 +141,9 @@ Note: You can also contribute in translating this plugin into your local languag == Changelog == += 3.0.6 = +- Fixed "Send to Telegram" flag not saved for block editor drafts. + = 3.0.5 = - Fixed the issue of posts being sent from block editor regardless of the rules. - Fixed the issue of disabled Test Token button. @@ -173,8 +176,3 @@ Note: You can also contribute in translating this plugin into your local languag - Better support for block editor override settings - Fixed the YouTube links being stripped out from the content. - Minor fixes. - -== Upgrade Notice == - -= 1.3.0 = -* Goto WP Telegram Settings and just save the settings (Recommended) diff --git a/src/assets/asset-manifest.json b/src/assets/asset-manifest.json index 2d7cf38..7290b02 100644 --- a/src/assets/asset-manifest.json +++ b/src/assets/asset-manifest.json @@ -1,32 +1,32 @@ { - "files": { - "wptelegram--main.css": "/static/css/wptelegram--main.e6d57ba1.css", - "wptelegram--main.js": "/static/js/wptelegram--main.72cdef97.js", - "wptelegram--main.js.map": "/static/js/wptelegram--main.72cdef97.js.map", - "wptelegram--main.php": "/static/js/wptelegram--main.c9545eb6.asset.php", - "wptelegram--p2tg-classic.js": "/static/js/wptelegram--p2tg-classic.72b0b6b4.js", - "wptelegram--p2tg-classic.js.map": "/static/js/wptelegram--p2tg-classic.72b0b6b4.js.map", - "wptelegram--p2tg-classic.php": "/static/js/wptelegram--p2tg-classic.fdf3c943.asset.php", - "wptelegram--p2tg-gb.js": "/static/js/wptelegram--p2tg-gb.c13c1267.js", - "wptelegram--p2tg-gb.js.map": "/static/js/wptelegram--p2tg-gb.c13c1267.js.map", - "wptelegram--p2tg-gb.php": "/static/js/wptelegram--p2tg-gb.d3fca986.asset.php", - "static/css/wptelegram--main.e6d57ba1.css.map": "/static/css/wptelegram--main.e6d57ba1.css.map", - "static/js/wptelegram--main.72cdef97.js.LICENSE.txt": "/static/js/wptelegram--main.72cdef97.js.LICENSE.txt", - "static/js/wptelegram--p2tg-gb.c13c1267.js.LICENSE.txt": "/static/js/wptelegram--p2tg-gb.c13c1267.js.LICENSE.txt" - }, - "entrypoints": { - "wptelegram--main": [ - "static/css/wptelegram--main.e6d57ba1.css", - "static/js/wptelegram--main.72cdef97.js", - "static/js/wptelegram--main.c9545eb6.asset.php" - ], - "wptelegram--p2tg-classic": [ - "static/js/wptelegram--p2tg-classic.72b0b6b4.js", - "static/js/wptelegram--p2tg-classic.fdf3c943.asset.php" - ], - "wptelegram--p2tg-gb": [ - "static/js/wptelegram--p2tg-gb.c13c1267.js", - "static/js/wptelegram--p2tg-gb.d3fca986.asset.php" - ] - } -} \ No newline at end of file + "files": { + "wptelegram--main.css": "/static/css/wptelegram--main.e6d57ba1.css", + "wptelegram--main.js": "/static/js/wptelegram--main.72cdef97.js", + "wptelegram--main.js.map": "/static/js/wptelegram--main.72cdef97.js.map", + "wptelegram--main.php": "/static/js/wptelegram--main.c9545eb6.asset.php", + "wptelegram--p2tg-classic.js": "/static/js/wptelegram--p2tg-classic.72b0b6b4.js", + "wptelegram--p2tg-classic.js.map": "/static/js/wptelegram--p2tg-classic.72b0b6b4.js.map", + "wptelegram--p2tg-classic.php": "/static/js/wptelegram--p2tg-classic.fdf3c943.asset.php", + "wptelegram--p2tg-gb.js": "/static/js/wptelegram--p2tg-gb.cc62141f.js", + "wptelegram--p2tg-gb.js.map": "/static/js/wptelegram--p2tg-gb.cc62141f.js.map", + "wptelegram--p2tg-gb.php": "/static/js/wptelegram--p2tg-gb.2ccfe22f.asset.php", + "static/css/wptelegram--main.e6d57ba1.css.map": "/static/css/wptelegram--main.e6d57ba1.css.map", + "static/js/wptelegram--main.72cdef97.js.LICENSE.txt": "/static/js/wptelegram--main.72cdef97.js.LICENSE.txt", + "static/js/wptelegram--p2tg-gb.cc62141f.js.LICENSE.txt": "/static/js/wptelegram--p2tg-gb.cc62141f.js.LICENSE.txt" + }, + "entrypoints": { + "wptelegram--main": [ + "static/css/wptelegram--main.e6d57ba1.css", + "static/js/wptelegram--main.72cdef97.js", + "static/js/wptelegram--main.c9545eb6.asset.php" + ], + "wptelegram--p2tg-classic": [ + "static/js/wptelegram--p2tg-classic.72b0b6b4.js", + "static/js/wptelegram--p2tg-classic.fdf3c943.asset.php" + ], + "wptelegram--p2tg-gb": [ + "static/js/wptelegram--p2tg-gb.cc62141f.js", + "static/js/wptelegram--p2tg-gb.2ccfe22f.asset.php" + ] + } +} diff --git a/src/assets/static/js/wptelegram--p2tg-gb.d3fca986.asset.php b/src/assets/static/js/wptelegram--p2tg-gb.2ccfe22f.asset.php similarity index 58% rename from src/assets/static/js/wptelegram--p2tg-gb.d3fca986.asset.php rename to src/assets/static/js/wptelegram--p2tg-gb.2ccfe22f.asset.php index f3f336f..56cd9a2 100644 --- a/src/assets/static/js/wptelegram--p2tg-gb.d3fca986.asset.php +++ b/src/assets/static/js/wptelegram--p2tg-gb.2ccfe22f.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-media-utils', 'wp-plugins'), 'version' => '5c9ac4eacaecc8c4aeff032bf958b987'); \ No newline at end of file + array('react', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-media-utils', 'wp-plugins'), 'version' => '5908054fa8ee2641dfbbeb4fe22d5c9b'); \ No newline at end of file diff --git a/src/assets/static/js/wptelegram--p2tg-gb.c13c1267.js b/src/assets/static/js/wptelegram--p2tg-gb.c13c1267.js deleted file mode 100644 index 8878b47..0000000 --- a/src/assets/static/js/wptelegram--p2tg-gb.c13c1267.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see wptelegram--p2tg-gb.c13c1267.js.LICENSE.txt */ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=372)}({0:function(e,t){e.exports=window.React},1:function(e,t,n){"use strict";e.exports=n(167)},11:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(66);var i=n(90),o=n(55);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},116:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(43);function i(e){var t=function(e,t){if("object"!==Object(r.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Object(r.a)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(r.a)(t)?t:String(t)}},12:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},167:function(e,t,n){"use strict";n(168);var r=n(0),i=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,o={},s=null,u=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:s,ref:u,props:o,_owner:c.current}}t.jsx=s,t.jsxs=s},168:function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function c(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,a,l=c(e),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","/** @license React v17.0.2\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';require(\"object-assign\");var f=require(\"react\"),g=60103;exports.Fragment=60107;if(\"function\"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h(\"react.element\");exports.Fragment=h(\"react.fragment\")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=\"\"+k);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","(function() { module.exports = window[\"wp\"][\"data\"]; }());","import * as wpI18n from '@wordpress/i18n';\n\nlet TEXT_DOMAIN = '';\n\nconst createI18n = wpI18n.createI18n;\n\n// create i18n instance with translation data and text domain\nconst i18n = createI18n?.() || wpI18n;\n\nexport const setLocaleData = (data: any, domain: string) => {\n\tTEXT_DOMAIN = domain;\n\ti18n.setLocaleData(data, domain);\n};\n\nexport const __ = (text: string): string => {\n\treturn i18n.__(text, TEXT_DOMAIN);\n};\n\nexport const _n = (single: string, plural: string, number: number): string => {\n\treturn i18n._n(single, plural, number, TEXT_DOMAIN);\n};\n\nexport const _nx = (single: string, plural: string, number: number, context: string): string => {\n\treturn i18n._nx(single, plural, number, context, TEXT_DOMAIN);\n};\n\nexport const _x = (single: string, context: string): string => {\n\treturn i18n._x(single, context, TEXT_DOMAIN);\n};\n\nexport const isRTL = (): boolean => document.documentElement.dir === 'rtl';\n\nexport { sprintf } from '@wordpress/i18n';\n","(function() { module.exports = window[\"wp\"][\"plugins\"]; }());","(function() { module.exports = window[\"wp\"][\"editPost\"]; }());","(function() { module.exports = window[\"wp\"][\"compose\"]; }());","(function() { module.exports = window[\"wp\"][\"mediaUtils\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","import { SVG, Path } from '@wordpress/components';\n\nexport const GearIcon: React.FC = () => {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n};\n","export const __KEY__ = '_wptg_p2tg_';\n","import { compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\n\nimport { __KEY__ } from './constants';\nimport { DataShape, WithDataProps } from './types';\n\nconst DEFAULT_DATA: DataShape = {\n\tchannels: [],\n\tdelay: '0',\n\tdisable_notification: false,\n\tmessage_template: '',\n\toverride_switch: false,\n\tsend2tg: true,\n\t...window.wptelegram?.savedSettings,\n};\n\ntype WithData =

(component: React.ComponentType

) => React.ComponentType>;\n\nexport const withData: WithData = compose([\n\twithSelect(\n\t\t(select): Partial => {\n\t\t\tconst { isSavingPost, isPublishingPost, isEditedPostDirty, getEditedPostAttribute } = select('core/editor');\n\n\t\t\tconst savedData = getEditedPostAttribute(__KEY__);\n\n\t\t\treturn {\n\t\t\t\tdata: savedData || DEFAULT_DATA,\n\t\t\t\tisDirty: isEditedPostDirty(),\n\t\t\t\tisSaving: isSavingPost() || isPublishingPost(),\n\t\t\t\tsavedData,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch(\n\t\t(dispatch, _, { select }): Partial => {\n\t\t\tconst updateField: WithDataProps['updateField'] = (field) => {\n\t\t\t\treturn (value) => {\n\t\t\t\t\tconst { getEditedPostAttribute } = select('core/editor');\n\t\t\t\t\tconst { editPost } = dispatch('core/editor');\n\n\t\t\t\t\tconst data = getEditedPostAttribute(__KEY__) || DEFAULT_DATA;\n\n\t\t\t\t\teditPost({ [__KEY__]: { ...data, [field]: value } }, { undoIgnore: true });\n\t\t\t\t};\n\t\t\t};\n\t\t\treturn { updateField };\n\t\t}\n\t),\n]);\n","import { useCallback } from '@wordpress/element';\nimport { BaseControl, CheckboxControl } from '@wordpress/components';\n\nimport { __ } from '@wp-plugins/i18n';\n\nimport { withData } from './withData';\nimport { WithDataProps } from './types';\n\nconst allChannels = window.wptelegram?.uiData?.allChannels || [];\n\nexport const Channels: React.FC = ({ data, isDisabled, updateField }) => {\n\tconst onChange = useCallback(\n\t\t(channel) => () => {\n\t\t\tconst hasChannel = data.channels.indexOf(channel) !== -1;\n\t\t\tconst newChannels = hasChannel ? data.channels.filter((c) => c !== channel) : [...data.channels, channel];\n\t\t\tupdateField('channels')(newChannels);\n\t\t},\n\t\t[data.channels, updateField]\n\t);\n\n\treturn (\n\t\t\n\t\t\t

\n\t\t\t\t{allChannels.map((channel, index) => {\n\t\t\t\t\treturn (\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 withData(Channels);\n","import { useCallback } from '@wordpress/element';\nimport { BaseControl, Disabled, Flex, Button, Icon } from '@wordpress/components';\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { __ } from '@wp-plugins/i18n';\n\nimport { withData } from './withData';\nimport { WithDataProps } from './types';\n\nconst render: MediaUpload.Props['render'] = ({ open }) => (\n\t\n);\n\nconst allowedTypes = [];\n\nexport const Files: React.FC = ({ data, isDisabled, updateField }) => {\n\tconst onRemove = useCallback(\n\t\t(id) => () => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\tconst { [id]: _, ...files } = data.files;\n\t\t\tupdateField('files')(files);\n\t\t},\n\t\t[data.files, updateField]\n\t);\n\n\tconst onSelect = useCallback(\n\t\t(files: Array<{ id: number; url?: string }>) => {\n\t\t\tconst newFiles = files.reduce((acc, { id, url }) => ({ ...acc, [id]: url }), {});\n\t\t\tupdateField('files')(newFiles);\n\t\t},\n\t\t[updateField]\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t{Object.entries(data.files).map(([id, url], index) => {\n\t\t\t\t\t\tconst urlParts = url.split('/');\n\t\t\t\t\t\tconst name = urlParts[urlParts.length - 1];\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\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 withData(Files);\n","import type { CSSProperties } from 'react';\nimport { useCallback, useState } from '@wordpress/element';\nimport { ToggleControl, Button, Modal, TextControl, TextareaControl } from '@wordpress/components';\n\nimport { sprintf, __ } from '@wp-plugins/i18n';\n\nimport { GearIcon } from './GearIcon';\nimport { withData } from './withData';\nimport { WithDataProps } from './types';\nimport Channels from './Channels';\nimport Files from './Files';\n\nconst modalStyles: CSSProperties = {\n\twidth: '100%',\n\tmaxWidth: '650px',\n};\nconst bodyStyles: CSSProperties = {\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tjustifyContent: 'space-between',\n};\n\nconst buttonStyles: CSSProperties = {\n\twidth: '100%',\n\tjustifyContent: 'center',\n\tmarginTop: '2em',\n};\n\nconst separatorStyles: CSSProperties = {\n\theight: '1.5em',\n};\n\nexport const EditModal: React.FC = ({ data, updateField }) => {\n\tconst [isOpen, setOpen] = useState(false);\n\tconst openModal = useCallback(() => setOpen(true), []);\n\tconst closeModal = useCallback(() => setOpen(false), []);\n\n\tconst separator =
;\n\n\tconst onRequestClose = useCallback(\n\t\t(event) => {\n\t\t\t// Prevent modal close on media upload\n\t\t\tif (event.target.id === 'wptg-upload-media') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcloseModal();\n\t\t},\n\t\t[closeModal]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t}\n\t\t\t\tisSmall\n\t\t\t\tonClick={openModal}\n\t\t\t/>\n\t\t\t{isOpen && (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\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 withData(EditModal);\n","import { useEffect } from '@wordpress/element';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginPostStatusInfo } from '@wordpress/edit-post';\nimport { ToggleControl } from '@wordpress/components';\n\nimport { __ } from '@wp-plugins/i18n';\n\nimport EditModal from './EditModal';\nimport { WithDataProps } from './types';\nimport { withData } from './withData';\n\nconst PostToTelegram: React.FC = ({ data, isDirty, isSaving, savedData, updateField }) => {\n\tuseEffect(() => {\n\t\tif (isDirty && !isSaving && !savedData) {\n\t\t\tupdateField('send2tg')(data.send2tg);\n\t\t}\n\t}, [data.send2tg, isDirty, isSaving, savedData, updateField]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t \n\t\t\n\t);\n};\n\nregisterPlugin('wptelegram-post-to-telegram', {\n\ticon: null,\n\trender: withData(PostToTelegram),\n});\n","import defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","import arrayLikeToArray from \"@babel/runtime/helpers/esm/arrayLikeToArray\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import arrayWithHoles from \"@babel/runtime/helpers/esm/arrayWithHoles\";\nimport iterableToArrayLimit from \"@babel/runtime/helpers/esm/iterableToArrayLimit\";\nimport unsupportedIterableToArray from \"@babel/runtime/helpers/esm/unsupportedIterableToArray\";\nimport nonIterableRest from \"@babel/runtime/helpers/esm/nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","(function() { module.exports = window[\"wp\"][\"element\"]; }());","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/src/assets/static/js/wptelegram--p2tg-gb.cc62141f.js b/src/assets/static/js/wptelegram--p2tg-gb.cc62141f.js new file mode 100644 index 0000000..0df4299 --- /dev/null +++ b/src/assets/static/js/wptelegram--p2tg-gb.cc62141f.js @@ -0,0 +1,3 @@ +/*! For license information please see wptelegram--p2tg-gb.cc62141f.js.LICENSE.txt */ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=371)}({0:function(e,t){e.exports=window.React},1:function(e,t,n){"use strict";e.exports=n(167)},11:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},116:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(43);function i(e){var t=function(e,t){if("object"!==Object(r.a)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Object(r.a)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Object(r.a)(t)?t:String(t)}},14:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(66);var i=n(90),o=n(55);function c(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},167:function(e,t,n){"use strict";n(168);var r=n(0),i=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,o={},s=null,u=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:s,ref:u,props:o,_owner:c.current}}t.jsx=s,t.jsxs=s},168:function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function c(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,a,l=c(e),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport toPrimitive from \"@babel/runtime/helpers/esm/toPrimitive\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n\n return (hint === \"string\" ? String : Number)(input);\n}","import arrayWithoutHoles from \"@babel/runtime/helpers/esm/arrayWithoutHoles\";\nimport iterableToArray from \"@babel/runtime/helpers/esm/iterableToArray\";\nimport unsupportedIterableToArray from \"@babel/runtime/helpers/esm/unsupportedIterableToArray\";\nimport nonIterableSpread from \"@babel/runtime/helpers/esm/nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"@babel/runtime/helpers/esm/arrayLikeToArray\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","/** @license React v17.0.2\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';require(\"object-assign\");var f=require(\"react\"),g=60103;exports.Fragment=60107;if(\"function\"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h(\"react.element\");exports.Fragment=h(\"react.fragment\")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=\"\"+k);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","(function() { module.exports = window[\"wp\"][\"data\"]; }());","import * as wpI18n from '@wordpress/i18n';\n\nlet TEXT_DOMAIN = '';\n\nconst createI18n = wpI18n.createI18n;\n\n// create i18n instance with translation data and text domain\nconst i18n = createI18n?.() || wpI18n;\n\nexport const setLocaleData = (data: any, domain: string) => {\n\tTEXT_DOMAIN = domain;\n\ti18n.setLocaleData(data, domain);\n};\n\nexport const __ = (text: string): string => {\n\treturn i18n.__(text, TEXT_DOMAIN);\n};\n\nexport const _n = (single: string, plural: string, number: number): string => {\n\treturn i18n._n(single, plural, number, TEXT_DOMAIN);\n};\n\nexport const _nx = (single: string, plural: string, number: number, context: string): string => {\n\treturn i18n._nx(single, plural, number, context, TEXT_DOMAIN);\n};\n\nexport const _x = (single: string, context: string): string => {\n\treturn i18n._x(single, context, TEXT_DOMAIN);\n};\n\nexport const isRTL = (): boolean => document.documentElement.dir === 'rtl';\n\nexport { sprintf } from '@wordpress/i18n';\n","(function() { module.exports = window[\"wp\"][\"plugins\"]; }());","(function() { module.exports = window[\"wp\"][\"editPost\"]; }());","(function() { module.exports = window[\"wp\"][\"compose\"]; }());","(function() { module.exports = window[\"wp\"][\"mediaUtils\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","import { SVG, Path } from '@wordpress/components';\n\nexport const GearIcon: React.FC = () => {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n};\n","export const __KEY__ = '_wptg_p2tg_';\n","import { compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\n\nimport { __KEY__ } from './constants';\nimport { DataShape, WithDataProps } from './types';\n\nlet DEFAULT_DATA: DataShape = {\n\tchannels: [],\n\tdelay: '0',\n\tdisable_notification: false,\n\tmessage_template: '',\n\toverride_switch: false,\n\tsend2tg: true,\n\t...window.wptelegram?.savedSettings,\n};\n\ntype WithData =

(component: React.ComponentType

) => React.ComponentType>;\n\nexport const withData: WithData = compose([\n\twithSelect(\n\t\t(select): Partial => {\n\t\t\tconst { isSavingPost, isPublishingPost, isEditedPostDirty, getEditedPostAttribute } = select('core/editor');\n\n\t\t\tconst savedData = getEditedPostAttribute(__KEY__);\n\n\t\t\treturn {\n\t\t\t\tdata: savedData || DEFAULT_DATA,\n\t\t\t\tisDirty: isEditedPostDirty(),\n\t\t\t\tisSaving: isSavingPost() || isPublishingPost(),\n\t\t\t\tsavedData,\n\t\t\t};\n\t\t}\n\t),\n\twithDispatch(\n\t\t(dispatch, _, { select }): Partial => {\n\t\t\tconst updateField: WithDataProps['updateField'] = (field) => {\n\t\t\t\treturn (value) => {\n\t\t\t\t\tconst { getEditedPostAttribute } = select('core/editor');\n\t\t\t\t\tconst { editPost } = dispatch('core/editor');\n\n\t\t\t\t\tconst data = getEditedPostAttribute(__KEY__) || DEFAULT_DATA;\n\n\t\t\t\t\tconst newData = { ...data, [field]: value };\n\n\t\t\t\t\teditPost({ [__KEY__]: newData }, { undoIgnore: true });\n\n\t\t\t\t\t// Update default data to ensure re-renders don't reset the data\n\t\t\t\t\tDEFAULT_DATA = newData;\n\t\t\t\t};\n\t\t\t};\n\t\t\treturn { updateField };\n\t\t}\n\t),\n]);\n","import { useCallback } from '@wordpress/element';\nimport { BaseControl, CheckboxControl } from '@wordpress/components';\n\nimport { __ } from '@wp-plugins/i18n';\n\nimport { withData } from './withData';\nimport { WithDataProps } from './types';\n\nconst allChannels = window.wptelegram?.uiData?.allChannels || [];\n\nexport const Channels: React.FC = ({ data, isDisabled, updateField }) => {\n\tconst onChange = useCallback(\n\t\t(channel) => () => {\n\t\t\tconst hasChannel = data.channels.indexOf(channel) !== -1;\n\t\t\tconst newChannels = hasChannel ? data.channels.filter((c) => c !== channel) : [...data.channels, channel];\n\t\t\tupdateField('channels')(newChannels);\n\t\t},\n\t\t[data.channels, updateField]\n\t);\n\n\treturn (\n\t\t\n\t\t\t

\n\t\t\t\t{allChannels.map((channel, index) => {\n\t\t\t\t\treturn (\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 withData(Channels);\n","import { useCallback } from '@wordpress/element';\nimport { BaseControl, Disabled, Flex, Button, Icon } from '@wordpress/components';\nimport { MediaUpload } from '@wordpress/media-utils';\nimport { __ } from '@wp-plugins/i18n';\n\nimport { withData } from './withData';\nimport { WithDataProps } from './types';\n\nconst render: MediaUpload.Props['render'] = ({ open }) => (\n\t\n);\n\nconst allowedTypes = [];\n\nexport const Files: React.FC = ({ data, isDisabled, updateField }) => {\n\tconst onRemove = useCallback(\n\t\t(id) => () => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\tconst { [id]: _, ...files } = data.files;\n\t\t\tupdateField('files')(files);\n\t\t},\n\t\t[data.files, updateField]\n\t);\n\n\tconst onSelect = useCallback(\n\t\t(files: Array<{ id: number; url?: string }>) => {\n\t\t\tconst newFiles = files.reduce((acc, { id, url }) => ({ ...acc, [id]: url }), {});\n\t\t\tupdateField('files')(newFiles);\n\t\t},\n\t\t[updateField]\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t{Object.entries(data.files).map(([id, url], index) => {\n\t\t\t\t\t\tconst urlParts = url.split('/');\n\t\t\t\t\t\tconst name = urlParts[urlParts.length - 1];\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\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 withData(Files);\n","import type { CSSProperties } from 'react';\nimport { useCallback, useState } from '@wordpress/element';\nimport { ToggleControl, Button, Modal, TextControl, TextareaControl } from '@wordpress/components';\n\nimport { sprintf, __ } from '@wp-plugins/i18n';\n\nimport { GearIcon } from './GearIcon';\nimport { withData } from './withData';\nimport { WithDataProps } from './types';\nimport Channels from './Channels';\nimport Files from './Files';\n\nconst modalStyles: CSSProperties = {\n\twidth: '100%',\n\tmaxWidth: '650px',\n};\nconst bodyStyles: CSSProperties = {\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tjustifyContent: 'space-between',\n};\n\nconst buttonStyles: CSSProperties = {\n\twidth: '100%',\n\tjustifyContent: 'center',\n\tmarginTop: '2em',\n};\n\nconst separatorStyles: CSSProperties = {\n\theight: '1.5em',\n};\n\nexport const EditModal: React.FC = ({ data, updateField }) => {\n\tconst [isOpen, setOpen] = useState(false);\n\tconst openModal = useCallback(() => setOpen(true), []);\n\tconst closeModal = useCallback(() => setOpen(false), []);\n\n\tconst separator =
;\n\n\tconst onRequestClose = useCallback(\n\t\t(event) => {\n\t\t\t// Prevent modal close on media upload\n\t\t\tif (event.target.id === 'wptg-upload-media') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcloseModal();\n\t\t},\n\t\t[closeModal]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t}\n\t\t\t\tisSmall\n\t\t\t\tonClick={openModal}\n\t\t\t/>\n\t\t\t{isOpen && (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{separator}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\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 withData(EditModal);\n","import { useEffect } from '@wordpress/element';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginPostStatusInfo } from '@wordpress/edit-post';\nimport { ToggleControl } from '@wordpress/components';\n\nimport { __ } from '@wp-plugins/i18n';\n\nimport EditModal from './EditModal';\nimport { WithDataProps } from './types';\nimport { withData } from './withData';\n\nconst PostToTelegram: React.FC = ({ data, isDirty, isSaving, savedData, updateField }) => {\n\tuseEffect(() => {\n\t\tif (isDirty && !isSaving && !savedData) {\n\t\t\tupdateField('send2tg')(data.send2tg);\n\t\t}\n\t}, [data.send2tg, isDirty, isSaving, savedData, updateField]);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t \n\t\t\n\t);\n};\n\nregisterPlugin('wptelegram-post-to-telegram', {\n\ticon: null,\n\trender: withData(PostToTelegram),\n});\n","import defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","import arrayLikeToArray from \"@babel/runtime/helpers/esm/arrayLikeToArray\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import arrayWithHoles from \"@babel/runtime/helpers/esm/arrayWithHoles\";\nimport iterableToArrayLimit from \"@babel/runtime/helpers/esm/iterableToArrayLimit\";\nimport unsupportedIterableToArray from \"@babel/runtime/helpers/esm/unsupportedIterableToArray\";\nimport nonIterableRest from \"@babel/runtime/helpers/esm/nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","(function() { module.exports = window[\"wp\"][\"element\"]; }());","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/src/changelog.md b/src/changelog.md index f432b5c..d410135 100644 --- a/src/changelog.md +++ b/src/changelog.md @@ -4,6 +4,12 @@ All notable changes to this project are documented in this file. ## Unreleased +## [3.0.6 - 2021-04-7](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.0.6) + +### Bug fixes + +- Fixed "Send to Telegram" flag not saved for block editor drafts. + ## [3.0.5 - 2021-04-1](https://github.com/manzoorwanijk/wptelegram/releases/tag/v3.0.5) ### Bug fixes diff --git a/src/languages/wptelegram.pot b/src/languages/wptelegram.pot index c0b3960..045c650 100644 --- a/src/languages/wptelegram.pot +++ b/src/languages/wptelegram.pot @@ -4,11 +4,11 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wptelegram\n" -"POT-Creation-Date: 2021-03-31 20:35:08+00:00\n" +"POT-Creation-Date: 2021-04-06 20:29:34+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2021-04-1 20:35-330\n" +"PO-Revision-Date: 2021-04-7 20:29-330\n" "Last-Translator: WP Telegram\n" "Language-Team: WP Telegram\n" "Language: en_US\n" diff --git a/src/wptelegram.php b/src/wptelegram.php index 63aca83..3844ca8 100644 --- a/src/wptelegram.php +++ b/src/wptelegram.php @@ -10,7 +10,7 @@ * Plugin Name: WP Telegram * Plugin URI: https://t.me/WPTelegram * Description: Integrate your WordPress website perfectly with Telegram. Send posts automatically to Telegram when published or updated, whether to a Telegram Channel, Group or private chat, with full control. Get your email notifications on Telegram. - * Version: 3.0.5 + * Version: 3.0.6 * Author: Manzoor Wani * Author URI: https://manzoorwani.dev * License: GPL-2.0+ @@ -24,7 +24,7 @@ die; } -define( 'WPTELEGRAM_VER', '3.0.5' ); +define( 'WPTELEGRAM_VER', '3.0.6' ); defined( 'WPTELEGRAM_BASENAME' ) || define( 'WPTELEGRAM_BASENAME', plugin_basename( __FILE__ ) );