refactor: Cleanup git state - commit all staged changes
Major refactoring cleanup: - Add new controller architecture (class-controller-*.php) - Add new settings-v2 UI (views/settings-v2/) - Add new CSS architecture (agentic-sidebar.css, tokens) - Add esbuild build pipeline (scripts/build.js, package.json) - Add composer dependencies (vendor/) - Add frontend src directory (assets/js/src/index.jsx) - Add documentation files - Remove old/obsolete files (class-settings.php, old CSS) This commits all pending changes from previous refactoring efforts.
This commit is contained in:
21
vendor/jawira/plantuml-encoding/LICENSE.md
vendored
Normal file
21
vendor/jawira/plantuml-encoding/LICENSE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
===========
|
||||
|
||||
**Copyright (c) 2017-2021 Jawira Portugal**
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the “Software”), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
35
vendor/jawira/plantuml-encoding/composer.json
vendored
Normal file
35
vendor/jawira/plantuml-encoding/composer.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "jawira/plantuml-encoding",
|
||||
"description": "PlantUML encoding functions",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"PlantUML",
|
||||
"functions",
|
||||
"encoding",
|
||||
"encodep",
|
||||
"uml"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jawira Portugal",
|
||||
"homepage": "https://jawira.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.4",
|
||||
"ext-zlib": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^2"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/plantuml_functions.php"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
98
vendor/jawira/plantuml-encoding/src/plantuml_functions.php
vendored
Normal file
98
vendor/jawira/plantuml-encoding/src/plantuml_functions.php
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Jawira\PlantUml;
|
||||
|
||||
/**
|
||||
* Encodes a UML text description into a special encoding.
|
||||
*
|
||||
* @param string $puml PlantUml diagram code, expected to be UTF-8.
|
||||
*
|
||||
* @return string Encoded string
|
||||
* @throws \RuntimeException Error with gzdeflate()
|
||||
*/
|
||||
function encodep(string $puml): string
|
||||
{
|
||||
$compressed = gzdeflate($puml, 9);
|
||||
|
||||
if (false === $compressed) {
|
||||
throw new \RuntimeException('Error while compressing PlantUml diagram.');
|
||||
}
|
||||
|
||||
return encode64($compressed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $compressed Compressed string
|
||||
*
|
||||
* @return string Encoded string
|
||||
*/
|
||||
function encode64(string $compressed): string
|
||||
{
|
||||
$encoded = '';
|
||||
$length = mb_strlen($compressed, '8bit');
|
||||
for ($i = 0; $i < $length; $i += 3) {
|
||||
switch ($length) {
|
||||
case $i + 1:
|
||||
$encoded .= append3bytes(ord($compressed[$i]), 0, 0);
|
||||
break;
|
||||
case $i + 2:
|
||||
$encoded .= append3bytes(ord($compressed[$i]), ord($compressed[$i + 1]), 0);
|
||||
break;
|
||||
default:
|
||||
$encoded .= append3bytes(ord($compressed[$i]), ord($compressed[$i + 1]), ord($compressed[$i + 2]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $encoded;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $b1 First byte
|
||||
* @param int $b2 Second byte
|
||||
* @param int $b3 Third byte
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function append3bytes(int $b1, int $b2, int $b3): string
|
||||
{
|
||||
$c1 = $b1 >> 2;
|
||||
$c2 = (($b1 & 0x3) << 4) | ($b2 >> 4);
|
||||
$c3 = (($b2 & 0xF) << 2) | ($b3 >> 6);
|
||||
$c4 = $b3 & 0x3F;
|
||||
$r = encode6bit($c1 & 0x3F);
|
||||
$r .= encode6bit($c2 & 0x3F);
|
||||
$r .= encode6bit($c3 & 0x3F);
|
||||
$r .= encode6bit($c4 & 0x3F);
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $b
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function encode6bit(int $b): string
|
||||
{
|
||||
if ($b < 10) {
|
||||
return chr(48 + $b);
|
||||
}
|
||||
$b -= 10;
|
||||
if ($b < 26) {
|
||||
return chr(65 + $b);
|
||||
}
|
||||
$b -= 26;
|
||||
if ($b < 26) {
|
||||
return chr(97 + $b);
|
||||
}
|
||||
$b -= 26;
|
||||
if ($b === 0) {
|
||||
return '-';
|
||||
}
|
||||
if ($b === 1) {
|
||||
return '_';
|
||||
}
|
||||
|
||||
return '?';
|
||||
}
|
||||
Reference in New Issue
Block a user