From 54daa8609e71bbc53b8af2285b03d951f93d1122 Mon Sep 17 00:00:00 2001 From: DanielGherjavca Date: Fri, 27 Oct 2023 21:06:48 +0300 Subject: [PATCH 01/13] feat(ministry brands): handler in editor-client --- public/editor-client/src/config.ts | 6 +- public/editor-client/src/ekklesia/index.ts | 84 ++++++++++++++++++++++ public/editor-client/src/ekklesia/utils.ts | 64 +++++++++++++++++ public/editor-client/src/index.ts | 7 ++ public/editor-client/src/types/Ekklesia.ts | 57 +++++++++++++++ 5 files changed, 215 insertions(+), 3 deletions(-) create mode 100644 public/editor-client/src/ekklesia/index.ts create mode 100644 public/editor-client/src/ekklesia/utils.ts create mode 100644 public/editor-client/src/types/Ekklesia.ts diff --git a/public/editor-client/src/config.ts b/public/editor-client/src/config.ts index 95a32f3711..3b87cb5c21 100644 --- a/public/editor-client/src/config.ts +++ b/public/editor-client/src/config.ts @@ -51,6 +51,7 @@ interface API { fileUrl: string; templates: DefaultTemplates; openAIUrl?: string; + ekklesiaApiUrl?: string; } export interface Config { hash: string; @@ -111,9 +112,8 @@ const apiReader = parseStrict({ mPipe(Obj.readKey("templates"), Obj.read, templatesReader), throwOnNullish("Invalid API: templates") ), - openAIUrl: optional(pipe( - mPipe(Obj.readKey("openAIUrl"), Str.read), - )) + openAIUrl: optional(pipe(mPipe(Obj.readKey("openAIUrl"), Str.read))), + ekklesiaApiUrl: optional(mPipe(Obj.readKey("ekklesiaApiUrl"), Str.read)) }); const actionsReader = parseStrict({ diff --git a/public/editor-client/src/ekklesia/index.ts b/public/editor-client/src/ekklesia/index.ts new file mode 100644 index 0000000000..07c70b1e9e --- /dev/null +++ b/public/editor-client/src/ekklesia/index.ts @@ -0,0 +1,84 @@ +import { Config } from "config"; +import { ChoicesAsync, ChoicesSync } from "types/Choices"; +import { + EkklesiaFieldMap, + EkklesiaFields, + EkklesiaKeys, + EkklesiaParams +} from "types/Ekklesia"; +import { Response } from "types/Response"; +import { t } from "utils/i18n"; +import { getFields } from "./utils"; + +export const getEkklesiaFields = (config: Config) => ({ + async handler( + res: Response, + rej: Response, + keys: EkklesiaParams + ): Promise { + const { ekklesiaApiUrl } = config.api; + if (!ekklesiaApiUrl) { + if (process.env.NODE_ENV === "development") { + console.error("Missing Ekklesia api url!"); + } + res([{ value: "", title: t("None") }]); + return; + } + try { + const fields = await getFields(ekklesiaApiUrl, keys); + res(fields); + } catch (error) { + if (process.env.NODE_ENV === "development") { + console.error("Failed to load ekklesia fields 2"); + } + rej(t("Failed to load ekklesia fields")); + } + } +}); + +export const updateEkklesiaFields = (config: Config) => ({ + async handler( + res: Response, + rej: Response, + keys: { + fields: Array; + } + ): Promise { + const { ekklesiaApiUrl } = config.api; + + if (!ekklesiaApiUrl) { + if (process.env.NODE_ENV === "development") { + console.error("Missing Ekklesia api url!"); + } + rej(t("Missing Ekklesia api url!")); + return; + } + + const dataToChange: EkklesiaKeys = {}; + try { + for (const field of keys.fields) { + const choiches = await getFields(ekklesiaApiUrl, field.module); + + if (!choiches.length) continue; + + const updatedField = Object.keys(field.value).reduce((acc, key) => { + const value = field.value[key]; + const currentField = choiches.find( + (choice) => choice.value === value + ); + + if (!currentField) { + acc[key] = ""; + } + + return acc; + }, {} as EkklesiaKeys); + + Object.assign(dataToChange, updatedField); + } + res(Object.keys(dataToChange).length ? dataToChange : undefined); + } catch (error) { + rej(t("Failed to load ekklesia fields")); + } + } +}); diff --git a/public/editor-client/src/ekklesia/utils.ts b/public/editor-client/src/ekklesia/utils.ts new file mode 100644 index 0000000000..88f59ff865 --- /dev/null +++ b/public/editor-client/src/ekklesia/utils.ts @@ -0,0 +1,64 @@ +import { request } from "api/index"; +import { makeUrl } from "api/utils"; +import { ChoicesSync } from "types/Choices"; +import { + EkklesiaChoiceParamsWithSubKey, + EkklesiaFields, + EkklesiaParams, + EkklesiaParentsChilds, + EkklesiaResponse +} from "types/Ekklesia"; +import { t } from "utils/i18n"; +import { isObject } from "utils/reader/object"; +import { read as readString } from "utils/reader/string"; +import { Literal } from "utils/types"; + +export const requestFields = (url: string): Promise => { + return request(url).then((res) => res.json()); +}; + +export const fieldHaveParentsChildsKeys = ( + keys: Record | EkklesiaParentsChilds +): keys is EkklesiaParentsChilds => "childs" in keys && "parents" in keys; + +export const keysHaveSubkey = ( + keys: EkklesiaParams +): keys is EkklesiaChoiceParamsWithSubKey => "subKey" in keys; + +export const getOption = ( + obj: Record | undefined +): ChoicesSync => + isObject(obj) + ? [ + { title: t("None"), value: "" }, + ...Object.entries(obj).map(([key, value]) => { + return { + title: readString(value) ?? "", + value: key + }; + }) + ] + : []; + +export const getFields = async < + T extends keyof EkklesiaFields = keyof EkklesiaFields +>( + _url: string, + keys: EkklesiaParams +): Promise => { + const { key } = keys; + + const url = makeUrl(_url, { module: key }); + + const { data = {} } = await requestFields(url); + const field = data[key]; + + if (field && fieldHaveParentsChildsKeys(field)) { + if (keysHaveSubkey(keys)) { + return getOption(field[keys.subKey]); + } + return [{ value: "", title: t("None") }]; + } else { + return getOption(field); + } +}; diff --git a/public/editor-client/src/index.ts b/public/editor-client/src/index.ts index 3cfbfe57a0..ba4ed9302f 100644 --- a/public/editor-client/src/index.ts +++ b/public/editor-client/src/index.ts @@ -1,3 +1,4 @@ +import { getEkklesiaFields, updateEkklesiaFields } from "ekklesia/index"; import set from "lodash/set"; import {doAiRequest} from "./aiText"; import {autoSave} from "./autoSave"; @@ -54,6 +55,12 @@ const api = { searchCollectionItems, getCollectionItemsIds }, + modules: { + ekklesia: { + getEkklesiaFields: getEkklesiaFields(config), + updateEkklesiaFields: updateEkklesiaFields(config) + } + }, collectionTypes: { loadCollectionTypes }, diff --git a/public/editor-client/src/types/Ekklesia.ts b/public/editor-client/src/types/Ekklesia.ts new file mode 100644 index 0000000000..c45a23f9ef --- /dev/null +++ b/public/editor-client/src/types/Ekklesia.ts @@ -0,0 +1,57 @@ +import { Literal } from "utils/types"; + +export interface EkklesiaResponse { + data: Partial; +} + +export interface EkklesiaFields { + groups: Record; + events: Record; + series: Record; + recentSermons: Record; + smallgroups: Record; + forms: Record; + sermon: Record; + event: Record; + smallgroup: Record; + eventsLvl: EkklesiaParentsChilds; + smallgroupsLvl: EkklesiaParentsChilds; +} + +export interface EkklesiaParentsChilds { + parents: Record; + childs: Record; +} + +export interface EkklesiaChoiceParams< + T extends keyof EkklesiaFields = keyof EkklesiaFields +> { + key: T; +} + +export interface EkklesiaChoiceParamsWithSubKey< + T extends keyof EkklesiaFields = keyof EkklesiaFields +> extends EkklesiaChoiceParams { + subKey: keyof EkklesiaFields[T]; +} + +export type EkklesiaParams< + T extends keyof EkklesiaFields = keyof EkklesiaFields +> = EkklesiaFields[T] extends EkklesiaParentsChilds + ? EkklesiaChoiceParamsWithSubKey + : EkklesiaChoiceParams; + +export interface EkklesiaKeys { + [key: string]: string; +} + +export type EkklesiaFieldMap = { + [K in keyof EkklesiaFields]: EkklesiaModuleFields; +}; + +export interface EkklesiaModuleFields< + T extends keyof EkklesiaFields = keyof EkklesiaFields +> { + value: Record; + module: EkklesiaParams; +} From b555e1b9836d396ab4dd6b233cee388609651d64 Mon Sep 17 00:00:00 2001 From: zeleniucvladislav Date: Mon, 4 Mar 2024 13:53:41 +0200 Subject: [PATCH 02/13] feat(ministry brands): added extra for getEkklesiaFields added extra to updateEkklesiaFields --- public/editor-client/src/ekklesia/index.ts | 15 +++++++++++---- public/editor-client/src/ekklesia/utils.ts | 6 ++++-- public/editor-client/src/types/Ekklesia.ts | 4 ++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/public/editor-client/src/ekklesia/index.ts b/public/editor-client/src/ekklesia/index.ts index 07c70b1e9e..64aa1f75d8 100644 --- a/public/editor-client/src/ekklesia/index.ts +++ b/public/editor-client/src/ekklesia/index.ts @@ -1,6 +1,7 @@ import { Config } from "config"; import { ChoicesAsync, ChoicesSync } from "types/Choices"; import { + EkklesiaExtra, EkklesiaFieldMap, EkklesiaFields, EkklesiaKeys, @@ -14,7 +15,8 @@ export const getEkklesiaFields = (config: Config) => ({ async handler( res: Response, rej: Response, - keys: EkklesiaParams + keys: EkklesiaParams, + extra?: EkklesiaExtra ): Promise { const { ekklesiaApiUrl } = config.api; if (!ekklesiaApiUrl) { @@ -25,7 +27,7 @@ export const getEkklesiaFields = (config: Config) => ({ return; } try { - const fields = await getFields(ekklesiaApiUrl, keys); + const fields = await getFields(ekklesiaApiUrl, keys, extra); res(fields); } catch (error) { if (process.env.NODE_ENV === "development") { @@ -42,7 +44,8 @@ export const updateEkklesiaFields = (config: Config) => ({ rej: Response, keys: { fields: Array; - } + }, + extra?: EkklesiaExtra ): Promise { const { ekklesiaApiUrl } = config.api; @@ -57,7 +60,11 @@ export const updateEkklesiaFields = (config: Config) => ({ const dataToChange: EkklesiaKeys = {}; try { for (const field of keys.fields) { - const choiches = await getFields(ekklesiaApiUrl, field.module); + const choiches = await getFields( + ekklesiaApiUrl, + field.module, + extra + ); if (!choiches.length) continue; diff --git a/public/editor-client/src/ekklesia/utils.ts b/public/editor-client/src/ekklesia/utils.ts index 88f59ff865..2c696f4d9f 100644 --- a/public/editor-client/src/ekklesia/utils.ts +++ b/public/editor-client/src/ekklesia/utils.ts @@ -3,6 +3,7 @@ import { makeUrl } from "api/utils"; import { ChoicesSync } from "types/Choices"; import { EkklesiaChoiceParamsWithSubKey, + EkklesiaExtra, EkklesiaFields, EkklesiaParams, EkklesiaParentsChilds, @@ -44,11 +45,12 @@ export const getFields = async < T extends keyof EkklesiaFields = keyof EkklesiaFields >( _url: string, - keys: EkklesiaParams + keys: EkklesiaParams, + extra?: EkklesiaExtra ): Promise => { const { key } = keys; - const url = makeUrl(_url, { module: key }); + const url = makeUrl(_url, { module: key, ...extra }); const { data = {} } = await requestFields(url); const field = data[key]; diff --git a/public/editor-client/src/types/Ekklesia.ts b/public/editor-client/src/types/Ekklesia.ts index c45a23f9ef..6ebc5fc731 100644 --- a/public/editor-client/src/types/Ekklesia.ts +++ b/public/editor-client/src/types/Ekklesia.ts @@ -18,6 +18,10 @@ export interface EkklesiaFields { smallgroupsLvl: EkklesiaParentsChilds; } +export interface EkklesiaExtra { + find_group?: string; +} + export interface EkklesiaParentsChilds { parents: Record; childs: Record; From b28df81b66b346d9ab7cb80b2ca937cd96f29cb2 Mon Sep 17 00:00:00 2001 From: Zaharia Alexandru Date: Mon, 29 Jul 2024 13:04:01 +0300 Subject: [PATCH 03/13] fix: added port in asset urls --- editor/url-builder.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/url-builder.php b/editor/url-builder.php index 615ce742b7..aa8761b847 100644 --- a/editor/url-builder.php +++ b/editor/url-builder.php @@ -425,8 +425,13 @@ public function asset_url( $path = '' ) { $path = "/" . ltrim( $path, "/" ); } $urlInfo = parse_url( home_url( $path ) ); + $portPart = ""; + if(isset($urlInfo['port'])) + { + $portPart=":".$urlInfo['port']; + } - return "{$urlInfo['scheme']}://{$urlInfo['host']}{$path}"; + return "{$urlInfo['scheme']}://{$urlInfo['host']}{$portPart}{$path}"; } public function homeUrl( $path = '' ) { From 63fc1a548e7cb8ca105d128d99c565b3effcb61c Mon Sep 17 00:00:00 2001 From: Zaharia Alexandru Date: Fri, 2 Aug 2024 11:33:09 +0300 Subject: [PATCH 04/13] fix: Asset config path --- config.dev.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.dev.php b/config.dev.php index 60d842b4ca..1a19782e05 100755 --- a/config.dev.php +++ b/config.dev.php @@ -32,8 +32,8 @@ class Brizy_Config const TERMS_OF_SERVICE_URL = "https://www.brizy.io/terms-and-conditions"; const EDITOR_BUILD_PATH = BRIZY_PLUGIN_PATH.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'editor-build'.DIRECTORY_SEPARATOR.'dev'; - const EDITOR_BUILD_RELATIVE_PATH = 'public/editor-build/prod'; + const EDITOR_BUILD_RELATIVE_PATH = 'public/editor-build/dev'; const CLOUD_APP_KEY = 'YTVhMDEwMGUyNGE4OTQ5OWM2NTY3OGM3N2MxNzMzMTBjOWVlNTg0OGM0NWU1NGYzY2QxMGEzOWQ3NWNjMDk3Zg'; const CLOUD_ENDPOINT = 'http://www.brizysites.com'; const CLOUD_EDITOR_VERSIONS = '/api/versions'; From ff328de4fbcb938b46224470aba4179567216076 Mon Sep 17 00:00:00 2001 From: Artur Gunca Date: Fri, 2 Aug 2024 13:23:44 +0300 Subject: [PATCH 05/13] Removed unused vars from Default Templates --- config.dev.php | 8 ------ config.php | 8 ------ editor/editor/editor.php | 5 ---- public/editor-client/src/config.ts | 43 +++++++----------------------- 4 files changed, 9 insertions(+), 55 deletions(-) diff --git a/config.dev.php b/config.dev.php index 60d842b4ca..932d1c7d99 100755 --- a/config.dev.php +++ b/config.dev.php @@ -25,7 +25,6 @@ class Brizy_Config const PLATFORM_EMAIL = "admin@admin.com"; const UPGRADE_TO_PRO_URL = "https://www.brizy.io/pricing/?utm_source=wp-menu&utm_campaign=gopro&utm_medium=wp-dash/"; - const EDITOR_TEMPLEATES_URL = "https://e-t-cloud.b-cdn.net/1.3.3-beta2/"; const EDITOR_NEW_TEMPLEATES_URL = "https://phplaravel-1109775-4184176.cloudwaysapps.com/"; const SUPPORT_URL = "https://support.brizy.io"; const ABOUT_URL = "https://brizy.io"; @@ -74,8 +73,6 @@ class Brizy_Config // this file will be stored in uploads/brizy/ const PROJECT_STLYES_FILE_PATH = DIRECTORY_SEPARATOR.'project'.DIRECTORY_SEPARATOR.'styles.css'; - const TEMPLATES_URL = 'https://template-mk.b-cdn.net'; - static public function getCompilerUrls() { $host = self::getEnvValue('COMPILER_HOST'); @@ -140,11 +137,6 @@ static public function getUpgradeUrl() return apply_filters('brizy_upgrade_to_pro_url', self::UPGRADE_TO_PRO_URL); } - static public function getEditorTemplatesUrl($directories) - { - return apply_filters('brizy_editor_config_templates_url', self::EDITOR_TEMPLEATES_URL.$directories); - } - static public function getEditorNewTemplatesUrl($directories) { return apply_filters('brizy_editor_config_templates_url', self::EDITOR_NEW_TEMPLEATES_URL.$directories); diff --git a/config.php b/config.php index 213771d639..b5903fa47d 100755 --- a/config.php +++ b/config.php @@ -26,7 +26,6 @@ class Brizy_Config const PLATFORM_EMAIL = "admin@admin.com"; const UPGRADE_TO_PRO_URL = "https://www.brizy.io/pricing/?utm_source=wp-menu&utm_campaign=gopro&utm_medium=wp-dash/"; - const EDITOR_TEMPLEATES_URL = "https://e-t-cloud.b-cdn.net/1.3.3-beta2/"; const SUPPORT_URL = "https://support.brizy.io"; const ABOUT_URL = "https://www.brizy.io"; const TERMS_OF_SERVICE_URL = "https://www.brizy.io/terms-and-conditions"; @@ -73,8 +72,6 @@ class Brizy_Config // this file will be stored in uploads/brizy/ const PROJECT_STLYES_FILE_PATH = '/project/styles.css'; - const TEMPLATES_URL = 'https://template-mk.b-cdn.net'; - static public function getCompilerUrls() { return new Brizy_Admin_UrlIterator( @@ -128,11 +125,6 @@ static public function getUpgradeUrl() return apply_filters('brizy_upgrade_to_pro_url', self::UPGRADE_TO_PRO_URL); } - static public function getEditorTemplatesUrl($directories) - { - return apply_filters('brizy_editor_config_templates_url', self::EDITOR_TEMPLEATES_URL.$directories); - } - static public function getTermsOfServiceUrl() { return apply_filters('brizy_config_terms_of_service_url', self::TERMS_OF_SERVICE_URL); diff --git a/editor/editor/editor.php b/editor/editor/editor.php index 0715e04d88..f11fa0c8bf 100755 --- a/editor/editor/editor.php +++ b/editor/editor/editor.php @@ -413,10 +413,6 @@ private function getApiConfigFields($config, $context) 'fileUrl' => home_url('?'.Brizy_Editor::prefix('_attachment').'='), ], 'templates' => [ - 'kitsUrl' => Brizy_Config::getEditorTemplatesUrl('kits'), - 'layoutsUrl' => Brizy_Config::getEditorTemplatesUrl('layouts'), - 'popupsUrl' => Brizy_Config::getEditorTemplatesUrl('popups'), - 'storiesUrl' => Brizy_Config::getEditorTemplatesUrl('stories'), 'layoutsChunkUrl' => Brizy_Config::LAYOUTS_CHUNK_URL, 'layoutsPagesUrl' => Brizy_Config::LAYOUTS_PAGES_URL, 'layoutDataUrl' => Brizy_Config::LAYOUTS_PAGE_DATA_URL, @@ -428,7 +424,6 @@ private function getApiConfigFields($config, $context) 'storiesChunkUrl' => Brizy_Config::STORIES_CHUNK_URL, 'storiesPagesUrl' => Brizy_Config::STORIES_PAGES_URL, 'storiesDataUrl' => Brizy_Config::STORIES_DATA_URL, - 'templatesUrl' => Brizy_Config::TEMPLATES_URL, ], 'templatesImageUrl' => Brizy_Config::TEMPLATES_IMAGE_URL, ], diff --git a/public/editor-client/src/config.ts b/public/editor-client/src/config.ts index 6d5eb8e300..a7005e4b37 100644 --- a/public/editor-client/src/config.ts +++ b/public/editor-client/src/config.ts @@ -1,18 +1,14 @@ -import {readIconUrl} from "@/types/Icon"; -import {Arr, Bool, Obj, Str} from "@brizy/readers"; -import {match, mPipe, optional, parseStrict} from "fp-utilities"; -import {CollectionType} from "./types/Collections"; -import {ImagePatterns, PLUGIN_ENV} from "./types/global"; -import {pipe} from "./utils/fp/pipe"; -import {onNullish} from "./utils/onNullish"; -import {throwOnNullish} from "./utils/throwOnNullish"; -import {MValue} from "./utils/types"; +import { readIconUrl } from "@/types/Icon"; +import { Arr, Bool, Obj, Str } from "@brizy/readers"; +import { match, mPipe, optional, parseStrict } from "fp-utilities"; +import { CollectionType } from "./types/Collections"; +import { ImagePatterns, PLUGIN_ENV } from "./types/global"; +import { pipe } from "./utils/fp/pipe"; +import { onNullish } from "./utils/onNullish"; +import { throwOnNullish } from "./utils/throwOnNullish"; +import { MValue } from "./utils/types"; interface DefaultTemplates { - kitsUrl: string; - popupsUrl: string; - storiesUrl: string; - layoutsUrl: string; layoutDataUrl: string; layoutsChunkUrl: string; layoutsPagesUrl: string; @@ -24,7 +20,6 @@ interface DefaultTemplates { storiesChunkUrl: string; storiesPagesUrl: string; storiesDataUrl: string; - templatesUrl: string; } interface Actions { @@ -105,22 +100,6 @@ export interface Config { } const templatesReader = parseStrict, DefaultTemplates>({ - kitsUrl: pipe( - mPipe(Obj.readKey("kitsUrl"), Str.read), - throwOnNullish("Invalid API Config: kits") - ), - layoutsUrl: pipe( - mPipe(Obj.readKey("layoutsUrl"), Str.read), - throwOnNullish("Invalid API Config: layouts") - ), - popupsUrl: pipe( - mPipe(Obj.readKey("popupsUrl"), Str.read), - throwOnNullish("Invalid API Config: popups") - ), - storiesUrl: pipe( - mPipe(Obj.readKey("storiesUrl"), Str.read), - throwOnNullish("Invalid API Config: stories") - ), layoutDataUrl: pipe( mPipe(Obj.readKey("layoutDataUrl"), Str.read), throwOnNullish("Invalid API Config: layouts") @@ -164,10 +143,6 @@ const templatesReader = parseStrict, DefaultTemplates>({ storiesDataUrl: pipe( mPipe(Obj.readKey("storiesDataUrl"), Str.read), throwOnNullish("Invalid API Config: stories") - ), - templatesUrl: pipe( - mPipe(Obj.readKey("templatesUrl"), Str.read), - throwOnNullish("Invalid API Config: templates") ) }); From e8b018273a1ee297a87d7721255bea1e88e6897c Mon Sep 17 00:00:00 2001 From: Viorel Date: Wed, 14 Aug 2024 17:42:25 +0300 Subject: [PATCH 06/13] Send nonce on submit form when the user is authenticated --- content/providers/free-provider.php | 25 +++++++++++++++++++++++++ editor/editor/editor.php | 4 +--- editor/forms/api.php | 6 ++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/content/providers/free-provider.php b/content/providers/free-provider.php index 31f89dde4d..e9dbe70cf5 100644 --- a/content/providers/free-provider.php +++ b/content/providers/free-provider.php @@ -296,6 +296,31 @@ function () use (&$noticeHtml) { self::CONFIG_KEY_TEXT ) ); + + $this->registerPlaceholder( + new Brizy_Content_Placeholders_Simple( + '', + 'editor_nonce', + function ( Brizy_Content_Context $context, ContentPlaceholder $contentPlaceholder ) { + + $action = $contentPlaceholder->getAttribute( 'action' ); + $show = true; + + if ( $showFor = $contentPlaceholder->getAttribute( 'showfor' ) ) { + $show = false; + if ( 'authenticated_user' == $showFor && is_user_logged_in() ) { + $show = true; + } + } + + if ( ! $action || ! $show ) { + return ''; + } + + return wp_create_nonce( $action ); + } + ) + ); } private function filterData($property, $post) diff --git a/editor/editor/editor.php b/editor/editor/editor.php index f11fa0c8bf..b470522b8f 100755 --- a/editor/editor/editor.php +++ b/editor/editor/editor.php @@ -201,9 +201,7 @@ public function config($context = self::COMPILE_CONTEXT) 'mode' => $mode, 'integrations' => array( 'form' => array( - 'action' => '{{brizy_dc_ajax_url}}?action='.Brizy_Editor::prefix( - Brizy_Editor_Forms_Api::AJAX_SUBMIT_FORM - ), + 'action' => "{{brizy_dc_ajax_url}}?nonce={{editor_nonce showfor='authenticated_user' action='" . Brizy_Editor_API::nonce . "'}}&action=" . Brizy_Editor::prefix( Brizy_Editor_Forms_Api::AJAX_SUBMIT_FORM ), 'showIntegrations' => true, ), ), diff --git a/editor/forms/api.php b/editor/forms/api.php index ac9e0aac04..2171336ea8 100644 --- a/editor/forms/api.php +++ b/editor/forms/api.php @@ -195,6 +195,12 @@ public function delete_form() public function submit_form() { + if ( is_user_logged_in() ) { + if ( empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], Brizy_Editor_API::nonce ) ) { + $this->error( 401, 'Please refresh the page and try again.' ); + } + } + try { $manager = new Brizy_Editor_Forms_FormManager(Brizy_Editor_Project::get()); /** From 16c931659bd55632b48cf363727d846f45b16950 Mon Sep 17 00:00:00 2001 From: Zaharia Alexandru Date: Tue, 3 Sep 2024 14:12:14 +0300 Subject: [PATCH 07/13] fix. Upgraded content-placeholder lib --- composer.lock | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index 4219f1e180..63a7d0ab25 100644 --- a/composer.lock +++ b/composer.lock @@ -81,10 +81,10 @@ }, { "name": "bagrinsergiu/content-placeholder", - "version": "v2.0.19", + "version": "v2.x-dev", "source": { "type": "git", - "url": "git@github.com:bagrinsergiu/brizy-content-placeholder.git", + "url": "https://github.com/bagrinsergiu/brizy-content-placeholder.git", "reference": "77a0856476a28b3bb0a84f122d5a4c1563abd965" }, "dist": { @@ -114,6 +114,10 @@ "content", "placeholders" ], + "support": { + "source": "https://github.com/bagrinsergiu/brizy-content-placeholder/tree/v2.0.19", + "issues": "https://github.com/bagrinsergiu/brizy-content-placeholder/issues" + }, "time": "2024-03-25T08:02:17+00:00" }, { @@ -446,5 +450,5 @@ "php": ">=5.6" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.2.0" } From 36850b3e7abd665c61d27eeb3c46806b314229d2 Mon Sep 17 00:00:00 2001 From: Zaharia Alexandru Date: Tue, 3 Sep 2024 16:12:15 +0300 Subject: [PATCH 08/13] fix. Upgraded content-placeholder lib --- composer.json | 2 +- composer.lock | 1162 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 1069 insertions(+), 95 deletions(-) diff --git a/composer.json b/composer.json index 59cd51cee0..7eb3d9f982 100755 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "knplabs/gaufrette": "0.7", "bagrinsergiu/brizy-migration-utils": "^1.4", "bagrinsergiu/brizy-merge-page-assets": "dev-master", - "bagrinsergiu/content-placeholder": "^2.0.19", + "bagrinsergiu/content-placeholder": "v3.0.4", "enshrined/svg-sanitize": "^0.13", "select2/select2": "^4.0", "symfony/dotenv": "^3", diff --git a/composer.lock b/composer.lock index 63a7d0ab25..91a03e98b3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dc15a87513d94883c34cd88ae74bbd91", + "content-hash": "87d554b8c00628f13dd20e8bfd2c8f4b", "packages": [ { "name": "bagrinsergiu/brizy-merge-page-assets", @@ -81,153 +81,929 @@ }, { "name": "bagrinsergiu/content-placeholder", - "version": "v2.x-dev", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/bagrinsergiu/brizy-content-placeholder.git", - "reference": "77a0856476a28b3bb0a84f122d5a4c1563abd965" + "reference": "ea4b9b0c8e90828ea9bc67c3b0783fd1e256872a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bagrinsergiu/brizy-content-placeholder/zipball/77a0856476a28b3bb0a84f122d5a4c1563abd965", - "reference": "77a0856476a28b3bb0a84f122d5a4c1563abd965", + "url": "https://api.github.com/repos/bagrinsergiu/brizy-content-placeholder/zipball/ea4b9b0c8e90828ea9bc67c3b0783fd1e256872a", + "reference": "ea4b9b0c8e90828ea9bc67c3b0783fd1e256872a", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=7.1.0", + "phplrt/compiler": "^2.3.6", + "phplrt/lexer": "^2.3.6" }, "require-dev": { - "php": ">=7.1.0", + "php": ">=8", "phpspec/prophecy-phpunit": "^2", - "phpunit/phpunit": "^9.5.9" + "phpunit/phpunit": "^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "BrizyPlaceholders\\": "lib/", + "BrizyPlaceholdersTests\\": "tests/" + } + }, + "description": "Brizy content placeholders SDK", + "keywords": [ + "brizy", + "content", + "placeholders" + ], + "support": { + "source": "https://github.com/bagrinsergiu/brizy-content-placeholder/tree/v3.0.4", + "issues": "https://github.com/bagrinsergiu/brizy-content-placeholder/issues" + }, + "time": "2024-09-03T13:09:04+00:00" + }, + { + "name": "enshrined/svg-sanitize", + "version": "0.13.3", + "source": { + "type": "git", + "url": "https://github.com/darylldoyle/svg-sanitizer.git", + "reference": "bc66593f255b7d2613d8f22041180036979b6403" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/bc66593f255b7d2613d8f22041180036979b6403", + "reference": "bc66593f255b7d2613d8f22041180036979b6403", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*" + }, + "require-dev": { + "codeclimate/php-test-reporter": "^0.1.2", + "phpunit/phpunit": "^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "enshrined\\svgSanitize\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Daryll Doyle", + "email": "daryll@enshrined.co.uk" + } + ], + "description": "An SVG sanitizer for PHP", + "support": { + "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/develop" + }, + "time": "2020-01-20T01:34:17+00:00" + }, + { + "name": "knplabs/gaufrette", + "version": "v0.7.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/Gaufrette.git", + "reference": "a0627e91e8753f442eea6560cb347151cd306b2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/Gaufrette/zipball/a0627e91e8753f442eea6560cb347151cd306b2c", + "reference": "a0627e91e8753f442eea6560cb347151cd306b2c", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "conflict": { + "microsoft/windowsazure": "<0.4.3" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "~1.2", + "amazonwebservices/aws-sdk-for-php": "1.5.*", + "aws/aws-sdk-php": "^2.4.12||~3", + "doctrine/dbal": ">=2.3", + "dropbox-php/dropbox-php": "*", + "google/apiclient": "~1.1.3", + "league/flysystem": "~1.0", + "microsoft/azure-storage-blob": "^1.0", + "mikey179/vfsstream": "~1.2.0", + "mongodb/mongodb": "^1.1", + "phpseclib/phpseclib": "^2.0", + "phpspec/phpspec": "~2.4", + "phpunit/phpunit": "^5.6.8", + "rackspace/php-opencloud": "^1.9.2" + }, + "suggest": { + "ext-curl": "*", + "ext-fileinfo": "This extension is used to automatically detect the content-type of a file in the AwsS3, OpenCloud, AzureBlogStorage and GoogleCloudStorage adapters", + "ext-mbstring": "*", + "gaufrette/aws-s3-adapter": "to use AwsS3 adapter (supports SDK v2 and v3)", + "gaufrette/azure-blob-storage-adapter": "to use AzureBlobStorage adapter", + "gaufrette/doctrine-dbal-adapter": "to use DBAL adapter", + "gaufrette/flysystem-adapter": "to use Flysystem adapter", + "gaufrette/ftp-adapter": "to use Ftp adapter", + "gaufrette/gridfs-adapter": "to use GridFS adapter", + "gaufrette/in-memory-adapter": "to use InMemory adapter", + "gaufrette/local-adapter": "to use Local adapter", + "gaufrette/opencloud-adapter": "to use Opencloud adapter", + "gaufrette/phpseclib-sftp-adapter": "to use PhpseclibSftp adapter", + "gaufrette/zip-adapter": "to use Zip adapter", + "google/apiclient": "to use GoogleCloudStorage adapter", + "knplabs/knp-gaufrette-bundle": "to use with Symfony2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Gaufrette": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "The contributors", + "homepage": "http://github.com/knplabs/Gaufrette/contributors" + }, + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + } + ], + "description": "PHP library that provides a filesystem abstraction layer", + "homepage": "http://knplabs.com", + "keywords": [ + "abstraction", + "file", + "filesystem", + "media" + ], + "support": { + "issues": "https://github.com/KnpLabs/Gaufrette/issues", + "source": "https://github.com/KnpLabs/Gaufrette/tree/v0.7.0" + }, + "time": "2018-08-30T13:26:15+00:00" + }, + { + "name": "nikic/php-parser", + "version": "4.x-dev", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "8a21ec3182533ee6448a4efb8d238a4163b89297" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8a21ec3182533ee6448a4efb8d238a4163b89297", + "reference": "8a21ec3182533ee6448a4efb8d238a4163b89297", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.1" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/4.x" + }, + "time": "2024-08-11T14:55:47+00:00" + }, + { + "name": "phplrt/ast-contracts", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/ast-contracts.git", + "reference": "abe4ce0a5e418adbd85365c7b974daabb7406a86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/ast-contracts/zipball/abe4ce0a5e418adbd85365c7b974daabb7406a86", + "reference": "abe4ce0a5e418adbd85365c7b974daabb7406a86", + "shasum": "" + }, + "require": { + "php": ">=7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Phplrt\\Contracts\\Ast\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "A set of phplrt ast abstractions", + "homepage": "https://github.com/phplrt", + "keywords": [ + "abstractions", + "ast", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards", + "tree" + ], + "support": { + "issues": "https://github.com/phplrt/ast-contracts/issues", + "source": "https://github.com/phplrt/ast-contracts" + }, + "time": "2019-12-06T17:22:07+00:00" + }, + { + "name": "phplrt/compiler", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/compiler.git", + "reference": "49eabc93d5963457b884cbbd6a6c6d4ffdf699b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/compiler/zipball/49eabc93d5963457b884cbbd6a6c6d4ffdf699b9", + "reference": "49eabc93d5963457b884cbbd6a6c6d4ffdf699b9", + "shasum": "" + }, + "require": { + "nikic/php-parser": "~4.3", + "php": ">=7.1.3", + "phplrt/grammar": "^2.3.6", + "phplrt/lexer": "^2.3.6", + "phplrt/parser": "^2.3.6", + "phplrt/position": "^2.3.6", + "phplrt/visitor": "^2.3.6", + "symfony/polyfill-php73": "~1.12", + "zendframework/zend-code": "~3.0" + }, + "require-dev": { + "symfony/var-dumper": "^4.0|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Phplrt\\Compiler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "The phplrt compiler package.", + "homepage": "https://github.com/phplrt", + "keywords": [ + "builder", + "compiler", + "grammar", + "language" + ], + "support": { + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/compiler" + }, + "time": "2019-12-16T21:19:00+00:00" + }, + { + "name": "phplrt/grammar", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/grammar.git", + "reference": "11a21a910bc6c5885ab4e097a66eb1ea6f4c7d24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/grammar/zipball/11a21a910bc6c5885ab4e097a66eb1ea6f4c7d24", + "reference": "11a21a910bc6c5885ab4e097a66eb1ea6f4c7d24", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "phplrt/grammar-contracts": "^2.3.6" + }, + "provide": { + "phplrt/grammar-contracts-implementation": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "files": [ + "src/polyfill.php" + ], + "psr-4": { + "Phplrt\\Grammar\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "The phplrt grammar package.", + "homepage": "https://github.com/phplrt", + "keywords": [ + "asserts", + "grammar", + "parser", + "rules" + ], + "support": { + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/grammar" + }, + "abandoned": "phplrt/parser", + "time": "2019-12-16T21:19:00+00:00" + }, + { + "name": "phplrt/grammar-contracts", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/grammar-contracts.git", + "reference": "b656d52ccd9aab7aa2a262f6778660988a158d0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/grammar-contracts/zipball/b656d52ccd9aab7aa2a262f6778660988a158d0b", + "reference": "b656d52ccd9aab7aa2a262f6778660988a158d0b", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "phplrt/lexer-contracts": "^2.3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Phplrt\\Contracts\\Grammar\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "A set of phplrt grammar abstractions", + "homepage": "https://github.com/phplrt", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "grammar", + "interfaces", + "interoperability", + "rules", + "standards" + ], + "support": { + "issues": "https://github.com/phplrt/grammar-contracts/issues", + "source": "https://github.com/phplrt/grammar-contracts" + }, + "abandoned": "phplrt/parser", + "time": "2019-12-16T21:19:00+00:00" + }, + { + "name": "phplrt/lexer", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/lexer.git", + "reference": "c67c2d8033783f6b47171b1a75bc6f61b7557b4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/lexer/zipball/c67c2d8033783f6b47171b1a75bc6f61b7557b4d", + "reference": "c67c2d8033783f6b47171b1a75bc6f61b7557b4d", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-pcre": "*", + "ext-spl": "*", + "php": ">=7.1.3", + "phplrt/lexer-contracts": "^2.3.6", + "phplrt/source": "^2.3.6", + "symfony/polyfill-php73": "~1.12" + }, + "provide": { + "phplrt/lexer-contracts-implementation": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Phplrt\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "The phplrt lexer library that can be used for scanners implementation using PCRE", + "homepage": "https://github.com/phplrt", + "keywords": [ + "lexer", + "parsing", + "regex", + "scanner", + "stream", + "token", + "tokenizer" + ], + "support": { + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/lexer" + }, + "time": "2019-12-16T21:19:00+00:00" + }, + { + "name": "phplrt/lexer-contracts", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/lexer-contracts.git", + "reference": "06388465a2dea80a8b7bc71bfe759c3a6a972fee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/lexer-contracts/zipball/06388465a2dea80a8b7bc71bfe759c3a6a972fee", + "reference": "06388465a2dea80a8b7bc71bfe759c3a6a972fee", + "shasum": "" + }, + "require": { + "php": ">=7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Phplrt\\Contracts\\Lexer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "A set of phplrt lexer abstractions", + "homepage": "https://github.com/phplrt", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "lexer", + "parsing", + "regex", + "standards", + "stream", + "token", + "tokenizer" + ], + "support": { + "issues": "https://github.com/phplrt/lexer-contracts/issues", + "source": "https://github.com/phplrt/lexer-contracts" + }, + "time": "2019-12-06T17:22:07+00:00" + }, + { + "name": "phplrt/parser", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/parser.git", + "reference": "4aa5bb92e42f77788afaf14b893475b619cc477c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/parser/zipball/4aa5bb92e42f77788afaf14b893475b619cc477c", + "reference": "4aa5bb92e42f77788afaf14b893475b619cc477c", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "phplrt/ast-contracts": "^2.3.6", + "phplrt/grammar-contracts": "^2.3.6", + "phplrt/lexer-contracts": "^2.3.6", + "phplrt/parser-contracts": "^2.3.6", + "phplrt/source": "^2.3.6", + "symfony/polyfill-php73": "~1.12" + }, + "provide": { + "phplrt/parser-contracts-implementation": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "files": [ + "src/polyfill.php" + ], + "psr-4": { + "Phplrt\\Parser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "The phplrt Parser package.", + "homepage": "https://github.com/phplrt", + "keywords": [ + "language", + "ll1", + "llk", + "lr", + "parser", + "php", + "slr" + ], + "support": { + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/parser" + }, + "time": "2019-12-16T21:19:00+00:00" + }, + { + "name": "phplrt/parser-contracts", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/parser-contracts.git", + "reference": "d9b7f3eb3b46806a30527c04efb28931b1e89de0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/parser-contracts/zipball/d9b7f3eb3b46806a30527c04efb28931b1e89de0", + "reference": "d9b7f3eb3b46806a30527c04efb28931b1e89de0", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "phplrt/ast-contracts": "^2.3.6", + "phplrt/lexer-contracts": "^2.3.6", + "phplrt/source-contracts": "^2.3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Phplrt\\Contracts\\Parser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "A set of phplrt parser abstractions", + "homepage": "https://github.com/phplrt", + "keywords": [ + "abstractions", + "analysis", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "language", + "parser", + "php", + "standards", + "syntax" + ], + "support": { + "issues": "https://github.com/phplrt/parser-contracts/issues", + "source": "https://github.com/phplrt/parser-contracts" + }, + "time": "2019-12-16T21:19:00+00:00" + }, + { + "name": "phplrt/position", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/position.git", + "reference": "d4000629d1e2b556336272748118e819cbaf798c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/position/zipball/d4000629d1e2b556336272748118e819cbaf798c", + "reference": "d4000629d1e2b556336272748118e819cbaf798c", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "phplrt/source": "^2.3.6" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, "autoload": { "psr-4": { - "BrizyPlaceholders\\": "lib/", - "BrizyPlaceholdersTests\\": "tests/" + "Phplrt\\Position\\": "src" } }, - "description": "Brizy content placeholders SDK", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "The phplrt position package.", + "homepage": "https://github.com/phplrt", "keywords": [ - "brizy", - "content", - "placeholders" + "analyzing", + "column", + "input", + "line", + "offset", + "position", + "utils", + "visualization" ], "support": { - "source": "https://github.com/bagrinsergiu/brizy-content-placeholder/tree/v2.0.19", - "issues": "https://github.com/bagrinsergiu/brizy-content-placeholder/issues" + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/position" }, - "time": "2024-03-25T08:02:17+00:00" + "time": "2019-12-16T21:19:00+00:00" }, { - "name": "enshrined/svg-sanitize", - "version": "0.13.3", + "name": "phplrt/source", + "version": "2.3.6", "source": { "type": "git", - "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "bc66593f255b7d2613d8f22041180036979b6403" + "url": "https://github.com/phplrt/source.git", + "reference": "1877a3ce05ad8a49701a3b82d67486a6e71089cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/bc66593f255b7d2613d8f22041180036979b6403", - "reference": "bc66593f255b7d2613d8f22041180036979b6403", + "url": "https://api.github.com/repos/phplrt/source/zipball/1877a3ce05ad8a49701a3b82d67486a6e71089cd", + "reference": "1877a3ce05ad8a49701a3b82d67486a6e71089cd", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*" + "php": ">=7.1.3", + "phplrt/source-contracts": "^2.3.6" + }, + "provide": { + "phplrt/source-contracts-implementation": "~2.3" }, "require-dev": { - "codeclimate/php-test-reporter": "^0.1.2", - "phpunit/phpunit": "^6" + "psr/http-message": "~1.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } + }, "autoload": { "psr-4": { - "enshrined\\svgSanitize\\": "src" + "Phplrt\\Source\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-or-later" + "MIT" ], "authors": [ { - "name": "Daryll Doyle", - "email": "daryll@enshrined.co.uk" + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" } ], - "description": "An SVG sanitizer for PHP", + "description": "The phplrt sources package", + "homepage": "https://github.com/phplrt", + "keywords": [ + "abstraction", + "directory", + "file", + "file system", + "fs", + "reader" + ], "support": { - "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", - "source": "https://github.com/darylldoyle/svg-sanitizer/tree/develop" + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/source" }, - "time": "2020-01-20T01:34:17+00:00" + "time": "2019-12-16T21:19:00+00:00" }, { - "name": "knplabs/gaufrette", - "version": "v0.7.0", + "name": "phplrt/source-contracts", + "version": "2.3.6", "source": { "type": "git", - "url": "https://github.com/KnpLabs/Gaufrette.git", - "reference": "a0627e91e8753f442eea6560cb347151cd306b2c" + "url": "https://github.com/phplrt/source-contracts.git", + "reference": "2515b42ba217865f11cf2393ccf4dcb50e10398f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/Gaufrette/zipball/a0627e91e8753f442eea6560cb347151cd306b2c", - "reference": "a0627e91e8753f442eea6560cb347151cd306b2c", + "url": "https://api.github.com/repos/phplrt/source-contracts/zipball/2515b42ba217865f11cf2393ccf4dcb50e10398f", + "reference": "2515b42ba217865f11cf2393ccf4dcb50e10398f", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.1.3" }, - "conflict": { - "microsoft/windowsazure": "<0.4.3" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4.x-dev" + } }, - "require-dev": { - "akeneo/phpspec-skip-example-extension": "~1.2", - "amazonwebservices/aws-sdk-for-php": "1.5.*", - "aws/aws-sdk-php": "^2.4.12||~3", - "doctrine/dbal": ">=2.3", - "dropbox-php/dropbox-php": "*", - "google/apiclient": "~1.1.3", - "league/flysystem": "~1.0", - "microsoft/azure-storage-blob": "^1.0", - "mikey179/vfsstream": "~1.2.0", - "mongodb/mongodb": "^1.1", - "phpseclib/phpseclib": "^2.0", - "phpspec/phpspec": "~2.4", - "phpunit/phpunit": "^5.6.8", - "rackspace/php-opencloud": "^1.9.2" + "autoload": { + "psr-4": { + "Phplrt\\Contracts\\Source\\": "src/" + } }, - "suggest": { - "ext-curl": "*", - "ext-fileinfo": "This extension is used to automatically detect the content-type of a file in the AwsS3, OpenCloud, AzureBlogStorage and GoogleCloudStorage adapters", - "ext-mbstring": "*", - "gaufrette/aws-s3-adapter": "to use AwsS3 adapter (supports SDK v2 and v3)", - "gaufrette/azure-blob-storage-adapter": "to use AzureBlobStorage adapter", - "gaufrette/doctrine-dbal-adapter": "to use DBAL adapter", - "gaufrette/flysystem-adapter": "to use Flysystem adapter", - "gaufrette/ftp-adapter": "to use Ftp adapter", - "gaufrette/gridfs-adapter": "to use GridFS adapter", - "gaufrette/in-memory-adapter": "to use InMemory adapter", - "gaufrette/local-adapter": "to use Local adapter", - "gaufrette/opencloud-adapter": "to use Opencloud adapter", - "gaufrette/phpseclib-sftp-adapter": "to use PhpseclibSftp adapter", - "gaufrette/zip-adapter": "to use Zip adapter", - "google/apiclient": "to use GoogleCloudStorage adapter", - "knplabs/knp-gaufrette-bundle": "to use with Symfony2" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" + } + ], + "description": "A set of phplrt source abstractions", + "homepage": "https://github.com/phplrt", + "keywords": [ + "disk", + "file", + "io", + "read", + "source" + ], + "support": { + "issues": "https://github.com/phplrt/source-contracts/issues", + "source": "https://github.com/phplrt/source-contracts" + }, + "time": "2019-12-06T17:22:07+00:00" + }, + { + "name": "phplrt/visitor", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/phplrt/visitor.git", + "reference": "bb70d3765835a21825249727701319e897fa3062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phplrt/visitor/zipball/bb70d3765835a21825249727701319e897fa3062", + "reference": "bb70d3765835a21825249727701319e897fa3062", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "phplrt/ast-contracts": "^2.3.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.7.x-dev" + "dev-master": "2.4.x-dev" } }, "autoload": { - "psr-0": { - "Gaufrette": "src/" + "psr-4": { + "Phplrt\\Visitor\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -236,27 +1012,23 @@ ], "authors": [ { - "name": "The contributors", - "homepage": "http://github.com/knplabs/Gaufrette/contributors" - }, - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" + "name": "Kirill Nesmeyanov", + "email": "nesk@xakep.ru" } ], - "description": "PHP library that provides a filesystem abstraction layer", - "homepage": "http://knplabs.com", + "description": "The phplrt visitor package", + "homepage": "https://github.com/phplrt", "keywords": [ - "abstraction", - "file", - "filesystem", - "media" + "ast", + "traverser", + "tree", + "visitor" ], "support": { - "issues": "https://github.com/KnpLabs/Gaufrette/issues", - "source": "https://github.com/KnpLabs/Gaufrette/tree/v0.7.0" + "issues": "https://github.com/phplrt/phplrt/issues", + "source": "https://github.com/phplrt/visitor" }, - "time": "2018-08-30T13:26:15+00:00" + "time": "2019-12-16T21:19:00+00:00" }, { "name": "select2/select2", @@ -379,6 +1151,83 @@ ], "time": "2020-10-24T10:57:07+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, { "name": "tburry/pquery", "version": "dev-master", @@ -435,6 +1284,131 @@ "source": "https://github.com/tburry/pquery/tree/master" }, "time": "2016-03-23T18:57:26+00:00" + }, + { + "name": "zendframework/zend-code", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "6425335347966b773d85f7c65661c053ad0acb99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/6425335347966b773d85f7c65661c053ad0acb99", + "reference": "6425335347966b773d85f7c65661c053ad0acb99", + "shasum": "" + }, + "require": { + "php": "^7.1", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, + "require-dev": { + "doctrine/annotations": "^1.7", + "ext-phar": "*", + "phpunit/phpunit": "^7.5.16 || ^8.4", + "zendframework/zend-coding-standard": "^1.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4.x-dev", + "dev-develop": "3.5.x-dev", + "dev-dev-4.0": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Extensions to the PHP Reflection API, static code scanning, and code generation", + "keywords": [ + "ZendFramework", + "code", + "zf" + ], + "support": { + "chat": "https://zendframework-slack.herokuapp.com", + "docs": "https://docs.zendframework.com/zend-code/", + "forum": "https://discourse.zendframework.com/c/questions/components", + "issues": "https://github.com/zendframework/zend-code/issues", + "rss": "https://github.com/zendframework/zend-code/releases.atom", + "source": "https://github.com/zendframework/zend-code" + }, + "abandoned": "laminas/laminas-code", + "time": "2019-12-10T19:36:27+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "3ad808d60d0df54e16440a71fb9c8a33988e4d78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/3ad808d60d0df54e16440a71fb9c8a33988e4d78", + "reference": "3ad808d60d0df54e16440a71fb9c8a33988e4d78", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "container-interop/container-interop": "^1.1.0", + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "support": { + "issues": "https://github.com/zendframework/zend-eventmanager/issues", + "source": "https://github.com/zendframework/zend-eventmanager/tree/develop" + }, + "abandoned": "laminas/laminas-eventmanager", + "time": "2019-10-18T07:10:41+00:00" } ], "packages-dev": [], From f937103215f867022a7b21d17ae78e1aa9f92f36 Mon Sep 17 00:00:00 2001 From: Zaharia Alexandru Date: Wed, 4 Sep 2024 10:50:16 +0300 Subject: [PATCH 09/13] fix: global block rule matching --- admin/blocks/main.php | 14 +++++++------- brizy.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/admin/blocks/main.php b/admin/blocks/main.php index 13c864d603..bde8b36722 100644 --- a/admin/blocks/main.php +++ b/admin/blocks/main.php @@ -222,15 +222,15 @@ public function getMatchingBrizyBlocks($wpPost = null) } else { $template = Brizy_Admin_Templates::instance()->getTemplateForCurrentPage(); - if ($template) { + if ($template) { $ruleMatches = $this->getTemplateRuleMatches($template->getWpPost()); + } else { + $ruleMatches[] = [ + 'applyFor' => Brizy_Admin_Rule::POSTS, + 'entityType' => $wpPost->post_type, + 'entityValues' => [$wpPost->ID], + ]; } - -// $ruleMatches[] = [ -// 'applyFor' => Brizy_Admin_Rule::POSTS, -// 'entityType' => $wpPost->post_type, -// 'entityValues' => [$wpPost->ID], -// ]; } $matching_blocks = $this->findMatchingBlocks($ruleMatches); diff --git a/brizy.php b/brizy.php index 96b07fb876..7a2629668c 100755 --- a/brizy.php +++ b/brizy.php @@ -17,7 +17,7 @@ $_SERVER['HTTPS'] = 'on'; } -define('BRIZY_DEVELOPMENT', true); +define('BRIZY_DEVELOPMENT', true ); define('BRIZY_LOG', false); define('BRIZY_VERSION', '2.5.3'); define('BRIZY_MINIMUM_PRO_VERSION', '2.5.0'); From 6ba6fe99cf78626d5e9d54a54efe72f4e8b51d2f Mon Sep 17 00:00:00 2001 From: nicolaisirghi Date: Mon, 9 Sep 2024 11:04:43 +0300 Subject: [PATCH 10/13] feat(lottie): added dotlottie player --- public/editor-client/src/customFile/addFile.ts | 2 +- public/editor-client/src/customFile/lottieFile.ts | 2 ++ public/editor-client/src/customFile/utils.ts | 14 ++++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/public/editor-client/src/customFile/addFile.ts b/public/editor-client/src/customFile/addFile.ts index a8ba1ff45a..2f98533f95 100644 --- a/public/editor-client/src/customFile/addFile.ts +++ b/public/editor-client/src/customFile/addFile.ts @@ -47,7 +47,7 @@ export const addFile: AddFileData = { .then((res) => res.blob()) .then((blob) => { const file = new File([blob], filename, { type: mimeType }); - validateByComponent(file, componentId) + validateByComponent(file, componentId, url) .then(() => handleGetAttachmentById(res, attachment)) .catch((e) => rej(e.message)); }); diff --git a/public/editor-client/src/customFile/lottieFile.ts b/public/editor-client/src/customFile/lottieFile.ts index 761491906e..334e7207a2 100644 --- a/public/editor-client/src/customFile/lottieFile.ts +++ b/public/editor-client/src/customFile/lottieFile.ts @@ -55,3 +55,5 @@ export const validateLottie = (file: File): Promise => fileReader.readAsText(file); }); + +export const isLottieFile = (file: string): boolean => /\.lottie$/i.test(file); diff --git a/public/editor-client/src/customFile/utils.ts b/public/editor-client/src/customFile/utils.ts index 95f74b40ea..2df9741244 100644 --- a/public/editor-client/src/customFile/utils.ts +++ b/public/editor-client/src/customFile/utils.ts @@ -2,15 +2,21 @@ import { Model } from "backbone"; import { getAttachmentById } from "../api"; import { UploadData } from "../types/File"; import { Response } from "../types/Response"; -import { validateLottie } from "./lottieFile"; +import { isLottieFile, validateLottie } from "./lottieFile"; export const validateByComponent = ( file: File, - componentId: string + componentId: string, + url: string ): Promise => { switch (componentId) { - case "Lottie": - return validateLottie(file); + case "Lottie": { + // we should validate only json lottie files + if (!isLottieFile(url)) { + return validateLottie(file); + } + return Promise.resolve(); + } default: return Promise.resolve(); } From 36861212f58ef57231c6db887c9e683f1c23eb12 Mon Sep 17 00:00:00 2001 From: Viorel Date: Wed, 21 Feb 2024 10:56:40 +0200 Subject: [PATCH 11/13] Editor config key multilanguage to false --- editor/editor/editor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/editor/editor.php b/editor/editor/editor.php index e624f6c442..1f166481a7 100755 --- a/editor/editor/editor.php +++ b/editor/editor/editor.php @@ -201,6 +201,7 @@ public function config($context = self::COMPILE_CONTEXT) 'imageSizes' => $this->getImgSizes(), 'moduleGroups' => [], 'l10n' => $this->getTexts(), + 'multilanguage' => false ); $manager = new Brizy_Editor_Accounts_ServiceAccountManager(Brizy_Editor_Project::get()); From 9224bcd4465ad6908fa7d4e7f6276bf2ce844b3d Mon Sep 17 00:00:00 2001 From: Viorel Date: Wed, 18 Sep 2024 14:26:52 +0300 Subject: [PATCH 12/13] update composer --- composer.lock | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/composer.lock b/composer.lock index 8abe537c81..ca14b0c17b 100644 --- a/composer.lock +++ b/composer.lock @@ -11,7 +11,7 @@ "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/bagrinsergiu/brizy-merge-page-assets.git", + "url": "git@github.com:bagrinsergiu/brizy-merge-page-assets.git", "reference": "61eea2244cb34ff8666b802aafa74f74dec869da" }, "dist": { @@ -40,10 +40,6 @@ "brizy", "brizy merge assets" ], - "support": { - "source": "https://github.com/bagrinsergiu/brizy-merge-page-assets/tree/master", - "issues": "https://github.com/bagrinsergiu/brizy-merge-page-assets/issues" - }, "time": "2022-09-27T14:56:05+00:00" }, { @@ -51,7 +47,7 @@ "version": "1.5.4", "source": { "type": "git", - "url": "https://github.com/bagrinsergiu/brizy-migration-utils.git", + "url": "git@github.com:bagrinsergiu/brizy-migration-utils.git", "reference": "81523e89975e56d192bb3a5622ddbe1d06e10809" }, "dist": { @@ -81,10 +77,6 @@ } ], "description": "Data migration utils", - "support": { - "source": "https://github.com/bagrinsergiu/brizy-migration-utils/tree/1.5.4", - "issues": "https://github.com/bagrinsergiu/brizy-migration-utils/issues" - }, "time": "2022-07-08T10:43:38+00:00" }, { @@ -92,13 +84,13 @@ "version": "v3.x-dev", "source": { "type": "git", - "url": "https://github.com/bagrinsergiu/brizy-content-placeholder.git", - "reference": "ea4b9b0c8e90828ea9bc67c3b0783fd1e256872a" + "url": "git@github.com:bagrinsergiu/brizy-content-placeholder.git", + "reference": "affd80ac76efac29ce0ee6baa0bfa7314f264612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bagrinsergiu/brizy-content-placeholder/zipball/ea4b9b0c8e90828ea9bc67c3b0783fd1e256872a", - "reference": "ea4b9b0c8e90828ea9bc67c3b0783fd1e256872a", + "url": "https://api.github.com/repos/bagrinsergiu/brizy-content-placeholder/zipball/affd80ac76efac29ce0ee6baa0bfa7314f264612", + "reference": "affd80ac76efac29ce0ee6baa0bfa7314f264612", "shasum": "" }, "require": { @@ -124,11 +116,7 @@ "content", "placeholders" ], - "support": { - "source": "https://github.com/bagrinsergiu/brizy-content-placeholder/tree/v3.0.4", - "issues": "https://github.com/bagrinsergiu/brizy-content-placeholder/issues" - }, - "time": "2024-09-03T13:09:04+00:00" + "time": "2024-09-17T12:13:44+00:00" }, { "name": "enshrined/svg-sanitize", @@ -274,12 +262,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8a21ec3182533ee6448a4efb8d238a4163b89297" + "reference": "0ed4c8949a32986043e977dbe14776c14d644c45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8a21ec3182533ee6448a4efb8d238a4163b89297", - "reference": "8a21ec3182533ee6448a4efb8d238a4163b89297", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ed4c8949a32986043e977dbe14776c14d644c45", + "reference": "0ed4c8949a32986043e977dbe14776c14d644c45", "shasum": "" }, "require": { @@ -322,7 +310,7 @@ "issues": "https://github.com/nikic/PHP-Parser/issues", "source": "https://github.com/nikic/PHP-Parser/tree/4.x" }, - "time": "2024-08-11T14:55:47+00:00" + "time": "2024-09-17T19:36:00+00:00" }, { "name": "phplrt/ast-contracts", @@ -1432,5 +1420,5 @@ "php": ">=5.6" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } From 28fb2afd607bb712027919e5efc7e692af834dcb Mon Sep 17 00:00:00 2001 From: zeleniucvladislav Date: Thu, 19 Sep 2024 10:20:33 +0300 Subject: [PATCH 13/13] fix(ekklesia): brizy readers error --- public/editor-client/src/ekklesia/utils.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/editor-client/src/ekklesia/utils.ts b/public/editor-client/src/ekklesia/utils.ts index 2c696f4d9f..17cd0a7fc3 100644 --- a/public/editor-client/src/ekklesia/utils.ts +++ b/public/editor-client/src/ekklesia/utils.ts @@ -1,3 +1,4 @@ +import { Obj, Str } from "@brizy/readers"; import { request } from "api/index"; import { makeUrl } from "api/utils"; import { ChoicesSync } from "types/Choices"; @@ -10,8 +11,6 @@ import { EkklesiaResponse } from "types/Ekklesia"; import { t } from "utils/i18n"; -import { isObject } from "utils/reader/object"; -import { read as readString } from "utils/reader/string"; import { Literal } from "utils/types"; export const requestFields = (url: string): Promise => { @@ -29,12 +28,12 @@ export const keysHaveSubkey = ( export const getOption = ( obj: Record | undefined ): ChoicesSync => - isObject(obj) + Obj.isObject(obj) ? [ { title: t("None"), value: "" }, ...Object.entries(obj).map(([key, value]) => { return { - title: readString(value) ?? "", + title: Str.read(value) ?? "", value: key }; })