Просмотр исходного кода

Upgrade script from 15.0.0-RC1 to 15.0.0-RC2

Aleksandr Trofimov 4 недель назад
Родитель
Сommit
05466c74ce

+ 32 - 6
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/inc/classes/BxDolForm.php

@@ -1031,10 +1031,16 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
         $a = isset($this->aInputs[$sName]) ? $this->aInputs[$sName] : false;
         $oRv = null;
 
-        if ($a && isset($a['db']['pass']))
-            $oRv = $oChecker->get ($sName, $a['db']['pass'], isset($a['db']['params']) && $a['db']['params'] ? $a['db']['params'] : array());
+        if(($a['secret'] ?? false) && ($sValueInit = $a['value_init'] ?? false))
+            $a['db'] = array_merge($a['db'], [
+                'pass' => 'secret',
+                'params' => [$sValueInit]
+            ]);
+
+        if($a && isset($a['db']['pass']))
+            $oRv = $oChecker->get($sName, $a['db']['pass'], isset($a['db']['params']) && $a['db']['params'] ? $a['db']['params'] : array());
         else
-            $oRv =  $oChecker->get ($sName);
+            $oRv =  $oChecker->get($sName);
 
         // process comma separated string for api values
         if ($this->_bIsApi && isset($this->aInputs[$sName]['type']) && !empty($oRv) && is_string($oRv) && (in_array($this->aInputs[$sName]['type'], ['checkbox_set', 'files', 'select_multiple']) || in_array($sName, ['labels'])))
@@ -1583,9 +1589,17 @@ class BxDolFormChecker
 
         // get values from form description array
         foreach ($aInputs as $k => $a) {
-            if (!isset ($a['db']) || !BxDolForm::isVisible($a)) continue;
+            if (!isset ($a['db']) || !BxDolForm::isVisible($a)) 
+                continue;
+
+            if(($a['secret'] ?? false) && ($sValueInit = $a['value_init'] ?? false))
+                $a['db'] = array_merge($a['db'], [
+                    'pass' => 'secret',
+                    'params' => [$sValueInit]
+                ]);
+
             $sKey = str_replace('[]', '', $a['name']);
-            $valClean = $this->get ($sKey, $a['db']['pass'], !empty($a['db']['params']) ? $a['db']['params'] : array());
+            $valClean = $this->get($sKey, $a['db']['pass'], !empty($a['db']['params']) ? $a['db']['params'] : []);
             $aValsToUpdate[$sKey] = $valClean;
             $aInputs[$k]['db']['value'] = $valClean;
 
@@ -1666,6 +1680,9 @@ class BxDolFormChecker
                     $aInputs[$k]['value'] = call_user_func_array (array($this->_oChecker, $sMethod), !empty($a['db']['params']) ? array_merge(array($aValues[$k]), $a['db']['params']) : array ($aValues[$k]));
                 else
                     $aInputs[$k]['value'] = $aValues[$k];
+
+                if(($a['secret'] ?? false) && ($sValueInit = $aValues[$k] ?? false))
+                    $aInputs[$k]['value_init'] = $sValueInit;
             }
         }
     }
@@ -1937,7 +1954,16 @@ class BxDolFormCheckerHelper
         if (false === $iRet)
             return 0;
         return $iRet;
-    }    
+    }
+
+    static public function passSecret ($sValue, $sValueInit = false)
+    {
+        if($sValue !== false && $sValueInit !== false && strcmp(bx_gen_secret($sValueInit), $sValue) == 0)
+            $sValue = $sValueInit;
+
+        return $sValue;
+    }
+
     static public function passXss ($s)
     {
         if (is_array($s)) {

+ 2 - 2
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/plugins/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'unacms/una',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '344379798e52171230e8354e1bb9117350360360',
+        'reference' => '5722572d16e72855291dc1865e969d7fba11c3d7',
         'type' => 'library',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -705,7 +705,7 @@
         'unacms/una' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '344379798e52171230e8354e1bb9117350360360',
+            'reference' => '5722572d16e72855291dc1865e969d7fba11c3d7',
             'type' => 'library',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),

+ 21 - 22
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/plugins_public/bundle.js

@@ -24517,6 +24517,7 @@
 		if (!hasConnect) throw new Error("Connection adapter must provide either connect or both subscribe and send");
 		let activeBuffer = [];
 		let activeWaiters = [];
+		let activeSubscriber;
 		function push(chunk, runId) {
 			if (runId) chunkRunIds.set(chunk, runId);
 			const waiter = activeWaiters.shift();
@@ -24524,17 +24525,14 @@
 			else activeBuffer.push(chunk);
 		}
 		async function waitUntilSubscriberIdle(abortSignal) {
-			const idle = () => activeBuffer.length === 0 && (activeWaiters.length > 0 || abortSignal?.aborted);
+			const idle = () => activeSubscriber !== activeWaiters || activeBuffer.length === 0 && (activeWaiters.length > 0 || abortSignal?.aborted);
 			for (let i = 0; i < 16 && !abortSignal?.aborted; i++) {
 				if (idle()) return;
 				await Promise.resolve();
 			}
-			let macrotaskWaits = 0;
 			while (!abortSignal?.aborted) {
 				if (idle()) return;
 				await new Promise((resolve) => setTimeout(resolve, 0));
-				macrotaskWaits++;
-				if (activeWaiters.length === 0 && macrotaskWaits >= 32) return;
 			}
 		}
 		return {
@@ -24544,19 +24542,24 @@
 				activeBuffer = myBuffer;
 				activeWaiters = myWaiters;
 				return (async function* () {
-					while (!abortSignal?.aborted) {
-						let chunk;
-						const buffered = myBuffer.shift();
-						if (buffered !== void 0) chunk = buffered;
-						else chunk = await new Promise((resolve) => {
-							const onAbort = () => resolve(null);
-							myWaiters.push((c) => {
-								abortSignal?.removeEventListener("abort", onAbort);
-								resolve(c);
+					activeSubscriber = myWaiters;
+					try {
+						while (!abortSignal?.aborted) {
+							let chunk;
+							const buffered = myBuffer.shift();
+							if (buffered !== void 0) chunk = buffered;
+							else chunk = await new Promise((resolve) => {
+								const onAbort = () => resolve(null);
+								myWaiters.push((c) => {
+									abortSignal?.removeEventListener("abort", onAbort);
+									resolve(c);
+								});
+								abortSignal?.addEventListener("abort", onAbort, { once: true });
 							});
-							abortSignal?.addEventListener("abort", onAbort, { once: true });
-						});
-						if (chunk !== null) yield chunk;
+							if (chunk !== null) yield chunk;
+						}
+					} finally {
+						if (activeSubscriber === myWaiters) activeSubscriber = void 0;
 					}
 				})();
 			},
@@ -27648,7 +27651,7 @@
 		async sendMessage(content, body, sendOptions) {
 			this.mountDevtools();
 			if (typeof content === "string" && !content.trim()) return;
-			if (this.hasBlockingInterrupts()) throw new Error("ChatClient: cannot send normal input while pending interrupts exist. Use resumeInterrupts() instead.");
+			if (this.hasPendingInterrupts()) throw new Error("ChatClient: cannot send normal input while pending interrupts exist. Use resumeInterrupts() instead.");
 			const resolvedBody = {
 				...body,
 				...sendOptions?.body
@@ -27675,10 +27678,6 @@
 		hasPendingInterrupts() {
 			return this.interruptManager.getDescriptors().length > 0;
 		}
-		/** True while an interrupt batch owns the next user turn. */
-		hasBlockingInterrupts() {
-			return this.activeInterruptSubmission !== void 0 || this.hasPendingInterrupts();
-		}
 		/** True while a stream is active, a send is claiming the client, or the queue is draining. */
 		isSendBusy() {
 			return this.isLoading || this.sendInFlight || this.messageQueueDraining;
@@ -27770,7 +27769,7 @@
 		*/
 		async append(message) {
 			this.mountDevtools();
-			if (this.hasBlockingInterrupts()) throw new Error("ChatClient: cannot append normal input while pending interrupts exist. Use resumeInterrupts() instead.");
+			if (this.hasPendingInterrupts()) throw new Error("ChatClient: cannot append normal input while pending interrupts exist. Use resumeInterrupts() instead.");
 			const normalizedMessage = normalizeToUIMessage(message, generateMessageId);
 			if (normalizedMessage.role === "system") return;
 			const uiMessage = normalizedMessage;

+ 1 - 1
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/plugins_public/highlight/highlight.min.js

@@ -1,5 +1,5 @@
 /*!
-  Highlight.js v11.12.0 (git: 344379798e)
+  Highlight.js v11.12.0 (git: 5722572d16)
   (c) 2006-2026 Josh Goebel <hello@joshgoebel.com> and other contributors
   License: BSD-3-Clause
  */

+ 9 - 3
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/plugins_public/jush/jush.js

@@ -74,9 +74,13 @@ var jush = {
 		pos = 0;
 		highlighted = highlighted.replace(/([^&<]*)(?:(&[^;]+;)|(?:<[^>]+>)+|$)/g, (str, text, entity) => {
 			for (let i = text.length; i >= 0; i--) {
-				if (inject[pos + i]) {
-					str = str.slice(0, i) + inject[pos + i] + str.slice(i);
+				let tags = inject[pos + i];
+				if (tags) {
 					delete inject[pos + i];
+					if (str[i] == '<') { // the closing tags go before the tags of the highlighted code, the rest after them to nest properly
+						[, tags, inject[pos + i]] = /^((?:<\/[^>]+>)*)([\s\S]*)/.exec(tags);
+					}
+					str = str.slice(0, i) + tags + str.slice(i);
 				}
 			}
 			pos += text.length + (entity ? 1 : 0);
@@ -2013,7 +2017,9 @@ jush.textarea = (function () {
 		const sel = getSelection();
 		if (sel.rangeCount) {
 			const range = sel.getRangeAt(0);
-			return findPosition(pre, range.startContainer, range.startOffset);
+			if (pre.contains(range.startContainer)) { // a selection elsewhere would move to the end of pre
+				return findPosition(pre, range.startContainer, range.startOffset);
+			}
 		}
 	}
 

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/plugins_public/lucide/lucide.min.js


+ 1 - 1
upgrade/files/15.0.0.RC1-15.0.0.RC2/files/studio/template/css/page_columns.css

@@ -62,7 +62,7 @@ div.bx-std-page-columns-cnt {
 }
 .bx-std-page-column.bx-std-page-content div.bx-std-page-column-cnt {
     flex: 1 1 auto;
-    min-height: 0;
+    /* min-height: 0; */
     width: 100%;
     padding: 1px 0 1px 0.75rem; /* 12px from the sidebar column; 1px of room for the blocks' hairline ring inside the scroll box */
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов