Changeset 3475230
- Timestamp:
- 03/05/2026 07:48:49 AM (3 weeks ago)
- Location:
- easy-docs
- Files:
-
- 75 added
- 19 edited
-
tags/1.4.1 (added)
-
tags/1.4.1/LICENSE (added)
-
tags/1.4.1/README.txt (added)
-
tags/1.4.1/admin (added)
-
tags/1.4.1/admin/class-easy-docs.php (added)
-
tags/1.4.1/admin/css (added)
-
tags/1.4.1/admin/css/admin-rtl.css (added)
-
tags/1.4.1/admin/css/admin.css (added)
-
tags/1.4.1/admin/css/editor-styles-rtl.css (added)
-
tags/1.4.1/admin/css/editor-styles.css (added)
-
tags/1.4.1/admin/images (added)
-
tags/1.4.1/admin/images/icons.svg (added)
-
tags/1.4.1/admin/inc (added)
-
tags/1.4.1/admin/inc/class-admin-ajax.php (added)
-
tags/1.4.1/admin/inc/class-admin-page.php (added)
-
tags/1.4.1/admin/inc/class-misc-actions.php (added)
-
tags/1.4.1/admin/js (added)
-
tags/1.4.1/admin/js/admin.build.js (added)
-
tags/1.4.1/admin/js/admin.build.js.LICENSE.txt (added)
-
tags/1.4.1/admin/js/admin.js (added)
-
tags/1.4.1/admin/js/mce (added)
-
tags/1.4.1/admin/js/mce/code (added)
-
tags/1.4.1/admin/js/mce/code/plugin.js (added)
-
tags/1.4.1/admin/js/mce/table (added)
-
tags/1.4.1/admin/js/mce/table/plugin.js (added)
-
tags/1.4.1/admin/js/mce/table/plugin.min.js (added)
-
tags/1.4.1/admin/js/partials (added)
-
tags/1.4.1/admin/js/partials/config.js (added)
-
tags/1.4.1/admin/js/partials/editor.js (added)
-
tags/1.4.1/admin/js/partials/explorer.js (added)
-
tags/1.4.1/admin/js/partials/library.js (added)
-
tags/1.4.1/admin/js/partials/markup.js (added)
-
tags/1.4.1/admin/js/partials/sets.js (added)
-
tags/1.4.1/admin/js/partials/stats.js (added)
-
tags/1.4.1/admin/templates (added)
-
tags/1.4.1/admin/templates/easy-docs-admin.php (added)
-
tags/1.4.1/admin/templates/easy-docs-notifications.php (added)
-
tags/1.4.1/admin/templates/easy-docs-sets.php (added)
-
tags/1.4.1/admin/templates/easy-docs-stats.php (added)
-
tags/1.4.1/admin/templates/header.php (added)
-
tags/1.4.1/admin/templates/parts (added)
-
tags/1.4.1/credits.txt (added)
-
tags/1.4.1/easy-docs.php (added)
-
tags/1.4.1/front (added)
-
tags/1.4.1/front/class-easy-docs.php (added)
-
tags/1.4.1/front/css (added)
-
tags/1.4.1/front/images (added)
-
tags/1.4.1/front/images/icons.svg (added)
-
tags/1.4.1/front/inc (added)
-
tags/1.4.1/front/inc/class-front-ajax.php (added)
-
tags/1.4.1/front/inc/class-front-page.php (added)
-
tags/1.4.1/front/inc/class-render.php (added)
-
tags/1.4.1/front/js (added)
-
tags/1.4.1/front/js/front.build.js (added)
-
tags/1.4.1/front/js/front.js (added)
-
tags/1.4.1/front/js/partials (added)
-
tags/1.4.1/front/js/partials/config.js (added)
-
tags/1.4.1/front/js/partials/easydocs.js (added)
-
tags/1.4.1/front/js/partials/library.js (added)
-
tags/1.4.1/front/js/partials/templates.js (added)
-
tags/1.4.1/front/templates (added)
-
tags/1.4.1/front/templates/welcome.php (added)
-
tags/1.4.1/includes (added)
-
tags/1.4.1/includes/core (added)
-
tags/1.4.1/includes/core/class-object-cache.php (added)
-
tags/1.4.1/includes/core/class-persistent-cache.php (added)
-
tags/1.4.1/includes/core/class-singleton.php (added)
-
tags/1.4.1/includes/functions (added)
-
tags/1.4.1/includes/functions/class-escape.php (added)
-
tags/1.4.1/includes/functions/class-getters.php (added)
-
tags/1.4.1/includes/functions/class-is.php (added)
-
tags/1.4.1/includes/functions/class-markup.php (added)
-
tags/1.4.1/includes/functions/class-sanitize.php (added)
-
tags/1.4.1/lang (added)
-
tags/1.4.1/lang/easy-docs.pot (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/css/admin-rtl.css (modified) (24 diffs)
-
trunk/admin/css/admin.css (modified) (22 diffs)
-
trunk/admin/css/editor-styles-rtl.css (modified) (1 diff)
-
trunk/admin/css/editor-styles.css (modified) (1 diff)
-
trunk/admin/inc/class-admin-page.php (modified) (1 diff)
-
trunk/admin/js/admin.build.js (modified) (1 diff)
-
trunk/admin/js/partials/editor.js (modified) (5 diffs)
-
trunk/admin/js/partials/explorer.js (modified) (11 diffs)
-
trunk/admin/js/partials/library.js (modified) (1 diff)
-
trunk/admin/js/partials/sets.js (modified) (2 diffs)
-
trunk/admin/js/partials/stats.js (modified) (2 diffs)
-
trunk/admin/templates/easy-docs-admin.php (modified) (3 diffs)
-
trunk/admin/templates/easy-docs-sets.php (modified) (1 diff)
-
trunk/admin/templates/easy-docs-stats.php (modified) (2 diffs)
-
trunk/admin/templates/header.php (modified) (1 diff)
-
trunk/easy-docs.php (modified) (2 diffs)
-
trunk/front/js/front.build.js (modified) (1 diff)
-
trunk/includes/functions/class-markup.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-docs/trunk/README.txt
r3246256 r3475230 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.4 7 Stable tag: 1.4. 07 Stable tag: 1.4.1 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 78 78 79 79 == Changelog == 80 = 1.4.1 = 81 * Modify: Front and Backend design Improvements. 82 80 83 = 1.4.0 = 81 84 * Modify: In admin explorer, clicking outside the input will also create the outline or doc. -
easy-docs/trunk/admin/css/admin-rtl.css
r3240911 r3475230 534 534 } 535 535 536 .top-\[40\%\] {537 top: 40%;538 }539 540 536 .top-\[60px\] { 541 537 top: 60px; … … 552 548 .m-1 { 553 549 margin: 0.25rem; 554 }555 556 .m-auto {557 margin: auto;558 550 } 559 551 … … 563 555 } 564 556 565 .mx-4 {566 margin-left: 1rem;567 margin-right: 1rem;568 }569 570 .mx-8 {571 margin-left: 2rem;572 margin-right: 2rem;573 }574 575 557 .my-1 { 576 558 margin-top: 0.25rem; … … 602 584 } 603 585 604 .me-2 { 605 -webkit-margin-end: 0.5rem; 606 margin-inline-end: 0.5rem; 586 .mb-5 { 587 margin-bottom: 1.25rem; 607 588 } 608 589 … … 655 636 } 656 637 657 .mt-2 {658 margin-top: 0.5rem;659 }660 661 638 .box-border { 662 639 box-sizing: border-box; … … 695 672 } 696 673 697 .h-full {698 height: 100%;699 }700 701 674 .h-screen { 702 675 height: 100vh; … … 707 680 } 708 681 709 .w-1\/5 {710 width: 20%;711 }712 713 .w-3\/4 {714 width: 75%;715 }716 717 682 .w-7 { 718 683 width: 1.75rem; 719 684 } 720 685 721 .w-8\/12 {722 width: 66.666667%;723 }724 725 686 .w-\[540px\] { 726 687 width: 540px; … … 735 696 } 736 697 737 .min-w-\[300px\] {738 min-width: 300px;739 }740 741 698 .max-w-52 { 742 699 max-width: 13rem; 743 700 } 744 701 745 .max-w-\[1060px\] {746 max-width: 1060px;747 }748 749 702 .max-w-full { 750 703 max-width: 100%; … … 755 708 } 756 709 757 .flex-shrink-0 {758 flex-shrink: 0;759 }760 761 710 .-translate-x-1\/2 { 762 711 --tw-translate-x: -50%; 763 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));764 }765 766 .-translate-y-1\/2 {767 --tw-translate-y: -50%;768 712 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 769 713 } … … 808 752 } 809 753 810 .space-x-4 > :not([hidden]) ~ :not([hidden]) {811 --tw-space-x-reverse: 0;812 }813 814 [dir="ltr"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {815 margin-right: calc(1rem * var(--tw-space-x-reverse));816 margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));817 }818 819 [dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {820 margin-left: calc(1rem * var(--tw-space-x-reverse));821 margin-right: calc(1rem * calc(1 - var(--tw-space-x-reverse)));822 }823 824 754 .overflow-y-auto { 825 755 overflow-y: auto; … … 856 786 } 857 787 858 [dir="ltr"] .border-l {859 border-left-width: 1px;860 }861 862 [dir="rtl"] .border-l {863 border-right-width: 1px;864 }865 866 788 .border-t-0 { 867 789 border-top-width: 0px; … … 883 805 } 884 806 885 .bg-blue-700 {886 --tw-bg-opacity: 1;887 background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));888 }889 890 807 .bg-gray-100 { 891 808 --tw-bg-opacity: 1; … … 893 810 } 894 811 895 .bg-gray-200 {896 --tw-bg-opacity: 1;897 background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));898 }899 900 .bg-gray-50 {901 --tw-bg-opacity: 1;902 background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));903 }904 905 812 .bg-lime-700 { 906 813 --tw-bg-opacity: 1; … … 925 832 } 926 833 927 .p-10 {928 padding: 2.5rem;929 }930 931 834 .p-4 { 932 835 padding: 1rem; 933 }934 935 .p-8 {936 padding: 2rem;937 836 } 938 837 … … 957 856 } 958 857 959 .px-5 {960 padding-left: 1.25rem;961 padding-right: 1.25rem;962 }963 964 858 .px-6 { 965 859 padding-left: 1.5rem; … … 977 871 } 978 872 979 .py-2\.5 {980 padding-top: 0.625rem;981 padding-bottom: 0.625rem;982 }983 984 873 .py-4 { 985 874 padding-top: 1rem; … … 1043 932 } 1044 933 1045 [dir="ltr"] .text-right {1046 text-align: right;1047 }1048 1049 [dir="rtl"] .text-right {1050 text-align: left;1051 }1052 1053 934 .\!text-base { 1054 935 font-size: 1rem !important; … … 1071 952 } 1072 953 1073 .text-xl {1074 font-size: 1.25rem;1075 line-height: 1.75rem;1076 }1077 1078 954 .font-bold { 1079 955 font-weight: 700; 1080 956 } 1081 957 1082 .font-medium {1083 font-weight: 500;1084 }1085 1086 958 .font-semibold { 1087 959 font-weight: 600; … … 1090 962 .italic { 1091 963 font-style: italic; 1092 }1093 1094 .text-blue-500 {1095 --tw-text-opacity: 1;1096 color: rgb(59 130 246 / var(--tw-text-opacity, 1));1097 964 } 1098 965 … … 1112 979 } 1113 980 1114 .text-gray-900 {1115 --tw-text-opacity: 1;1116 color: rgb(17 24 39 / var(--tw-text-opacity, 1));1117 }1118 1119 981 .text-lime-600 { 1120 982 --tw-text-opacity: 1; … … 1135 997 --tw-text-opacity: 1; 1136 998 color: rgb(71 85 105 / var(--tw-text-opacity, 1)); 1137 }1138 1139 .text-white {1140 --tw-text-opacity: 1;1141 color: rgb(255 255 255 / var(--tw-text-opacity, 1));1142 }1143 1144 .shadow {1145 --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);1146 --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);1147 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);1148 999 } 1149 1000 … … 1345 1196 } 1346 1197 1198 .toplevel_page_easy-docs-admin, 1199 .easy-docs_page_easy-docs-stats, 1200 .easy-docs_page_easy-docs-sets { 1201 background: #f3f3f3; 1202 } 1203 1204 .toplevel_page_easy-docs-admin .easy-docs.admin-page, 1205 .easy-docs_page_easy-docs-stats .easy-docs.admin-page, 1206 .easy-docs_page_easy-docs-sets .easy-docs.admin-page { 1207 min-height: calc(100vh - 32px); 1208 } 1209 1210 .easy-docs-topbar { 1211 align-items: center; 1212 border-bottom: 1px solid #d8dce2; 1213 box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08); 1214 display: flex; 1215 justify-content: space-between; 1216 padding: 14px 18px; 1217 } 1218 1219 [dir="ltr"] .easy-docs-topbar { 1220 background: linear-gradient(120deg, #fbfdff, #eef3f9); 1221 } 1222 1223 [dir="rtl"] .easy-docs-topbar { 1224 background: linear-gradient(-120deg, #fbfdff, #eef3f9); 1225 } 1226 1227 .easy-docs-topbar__brand { 1228 color: #5f6b7a; 1229 } 1230 1231 .easy-docs-topbar__title { 1232 color: #1f2328; 1233 font-size: 21px; 1234 font-weight: 700; 1235 line-height: 1.2; 1236 margin: 0; 1237 } 1238 1239 .easy-docs-topbar__subtitle { 1240 font-size: 12px; 1241 margin: 2px 0 0; 1242 } 1243 1244 .easy-docs-topbar__nav { 1245 align-items: center; 1246 display: flex; 1247 gap: 8px; 1248 margin: 0; 1249 } 1250 1251 .easy-docs-topbar__link { 1252 background: #f7f9fc; 1253 border: 1px solid #d2d8e2; 1254 border-radius: 8px; 1255 color: #2f3742; 1256 display: inline-flex; 1257 font-size: 12px; 1258 font-weight: 600; 1259 line-height: 1; 1260 padding: 8px 12px; 1261 } 1262 1263 .easy-docs-topbar__link:hover { 1264 background: #eef5ff; 1265 color: #005fb8; 1266 } 1267 1268 .easy-docs-topbar__link.is-active { 1269 background: #0078d4; 1270 border-color: #0078d4; 1271 color: #ffffff; 1272 } 1273 1274 .easy-docs-workspace { 1275 background: #f3f3f3; 1276 color: #1f2328; 1277 min-height: calc(100vh - 70px); 1278 } 1279 1280 .easy-docs-layout { 1281 border-top: 1px solid #dfe3e8; 1282 display: flex; 1283 min-height: calc(100vh - 118px); 1284 position: relative; 1285 } 1286 1287 .easy-docs-explorer { 1288 background: #f8f8f8; 1289 display: flex; 1290 flex-direction: column; 1291 min-width: 300px; 1292 width: 300px; 1293 } 1294 1295 [dir="ltr"] .easy-docs-explorer { 1296 border-right: 1px solid #d7dbe2; 1297 } 1298 1299 [dir="rtl"] .easy-docs-explorer { 1300 border-left: 1px solid #d7dbe2; 1301 } 1302 1303 .easy-docs-pane-head { 1304 align-items: flex-start; 1305 border-bottom: 1px solid #dfe3e8; 1306 display: flex; 1307 gap: 8px; 1308 justify-content: space-between; 1309 padding: 8px 14px; 1310 } 1311 1312 .easy-docs-pane-title { 1313 color: #1f2328; 1314 font-size: 12px; 1315 font-weight: 700; 1316 letter-spacing: 0.08em; 1317 margin: 0; 1318 text-transform: uppercase; 1319 } 1320 1321 .easy-docs-pane-meta { 1322 color: #586376; 1323 font-size: 12px; 1324 margin: 2px 0 0; 1325 } 1326 1327 .easy-docs-explorer-actions { 1328 align-items: center; 1329 display: flex; 1330 gap: 4px; 1331 } 1332 1333 .easy-docs-explorer-actions .tt-btn { 1334 color: #3f4b5c; 1335 } 1336 1337 .easy-docs-explorer-actions .tt-btn:hover { 1338 background: rgba(0, 120, 212, 0.1); 1339 } 1340 1341 .easy-docs-content { 1342 background: #ffffff; 1343 display: flex; 1344 flex: 1; 1345 flex-direction: column; 1346 min-width: 0; 1347 } 1348 1349 .easy-docs-info { 1350 align-items: center; 1351 background: #f9fafc; 1352 border-bottom: 1px solid #e2e5ea; 1353 color: #1f2328; 1354 display: flex; 1355 justify-content: flex-end; 1356 min-height: 45px; 1357 padding: 8px 14px; 1358 } 1359 1360 .easy-docs-tabs { 1361 align-items: center; 1362 background: #f3f3f3; 1363 border-bottom: 1px solid #dde1e7; 1364 display: flex; 1365 min-height: 42px; 1366 overflow-x: auto; 1367 padding: 0 8px; 1368 } 1369 1370 .easy-docs-tabs .docs-tab { 1371 background: #eceff4; 1372 border: 1px solid #d5dbe5; 1373 border-bottom: none; 1374 border-radius: 8px 8px 0 0; 1375 margin-top: 6px; 1376 } 1377 1378 .easy-docs-tabs .docs-tab.active-tab { 1379 background: #ffffff; 1380 border-color: #cfd7e3; 1381 } 1382 1383 .easy-docs-editor-shell { 1384 background: #ffffff; 1385 flex: 1; 1386 padding: 14px; 1387 } 1388 1389 .easy-docs-tab-content { 1390 height: 100%; 1391 min-height: 540px; 1392 position: relative; 1393 width: 100%; 1394 } 1395 1396 .easy-docs-welcome-state { 1397 border: 1px dashed #ccdae9; 1398 border-radius: 12px; 1399 max-width: 860px; 1400 padding: 24px 28px; 1401 position: absolute; 1402 top: 40%; 1403 width: calc(100% - 40px); 1404 } 1405 1406 [dir="ltr"] .easy-docs-welcome-state { 1407 background: linear-gradient(145deg, #ffffff, #f3f8ff); 1408 left: 50%; 1409 transform: translate(-50%, -50%); 1410 } 1411 1412 [dir="rtl"] .easy-docs-welcome-state { 1413 background: linear-gradient(-145deg, #ffffff, #f3f8ff); 1414 right: 50%; 1415 transform: translate(50%, -50%); 1416 } 1417 1418 .easy-docs-welcome-state li { 1419 color: #556274; 1420 margin-bottom: 8px; 1421 } 1422 1423 .easy-docs-welcome-state li:hover { 1424 color: #1f2328; 1425 } 1426 1427 .easy-docs-editor-layout { 1428 display: flex; 1429 gap: 18px; 1430 } 1431 1432 .easy-docs-editor-main { 1433 flex: 1; 1434 min-width: 0; 1435 } 1436 1437 .easy-docs-editor-aside { 1438 background: #f8fafe; 1439 border: 1px solid #dbe2ec; 1440 border-radius: 12px; 1441 min-width: 220px; 1442 padding: 16px; 1443 width: 240px; 1444 } 1445 1446 .easy-docs-save-btn { 1447 align-items: center; 1448 background: #0e639c; 1449 border-radius: 8px; 1450 color: #ffffff; 1451 display: inline-flex; 1452 font-size: 13px; 1453 font-weight: 600; 1454 gap: 4px; 1455 padding: 10px 14px; 1456 } 1457 1458 .easy-docs-save-btn:hover { 1459 background: #1177bb; 1460 } 1461 1462 .easy-docs-save-btn:disabled { 1463 background: #e6ebf2; 1464 color: #8b96a6; 1465 cursor: not-allowed; 1466 } 1467 1468 .easy-docs-settings-wrap { 1469 padding: 24px; 1470 } 1471 1472 .easy-docs-settings-card { 1473 background: #ffffff; 1474 border: 1px solid #dde3ec; 1475 border-radius: 14px; 1476 box-shadow: 0 8px 28px rgba(30, 41, 59, 0.08); 1477 margin: 0 auto; 1478 max-width: 1060px; 1479 padding: 24px; 1480 } 1481 1482 .easy-docs-stats-content { 1483 padding: 14px; 1484 } 1485 1486 #easy-context-menu { 1487 background: #ffffff; 1488 border: 1px solid #d9dee7 !important; 1489 border-radius: 10px !important; 1490 box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); 1491 min-width: 210px; 1492 } 1493 1494 #easy-context-menu li { 1495 color: #1f2328; 1496 margin: 0; 1497 } 1498 1499 #docs-overlay { 1500 background: rgba(15, 23, 42, 0.16); 1501 } 1502 1503 #docs-overlay .easy-docs-modal-content { 1504 background: #ffffff; 1505 color: #1f2328; 1506 border: 1px solid #d9e0ea; 1507 border-radius: 12px; 1508 box-shadow: 0 16px 35px rgba(15, 23, 42, 0.15); 1509 top: 80px; 1510 } 1511 1512 .easy-docs-explorer .docs-outline-item > span:hover { 1513 background: #edf3fb !important; 1514 } 1515 1516 .easy-docs-explorer .docs-outline-item.active-item > span { 1517 background: rgba(0, 120, 212, 0.14) !important; 1518 } 1519 1520 .easy-docs-explorer .docs-outline-item.active-item .docs-outline-label { 1521 color: #222; 1522 } 1523 1524 #docs-outline > li.docs-folder { 1525 background: #fff; 1526 border: 1px solid #e6e6e6; 1527 border-radius: 8px; 1528 margin: 8px 10px; 1529 position: relative; 1530 } 1531 1532 #docs-outline > li.docs-folder::after { 1533 background: #e9f4ff; 1534 border: 1px solid #bdd8f6; 1535 border-radius: 10px; 1536 color: #222; 1537 content: "PROJECT"; 1538 font-size: 10px; 1539 font-weight: 700; 1540 letter-spacing: 0.08em; 1541 padding: 2px 7px; 1542 position: absolute; 1543 text-transform: uppercase; 1544 top: 8px; 1545 } 1546 1547 [dir="ltr"] #docs-outline > li.docs-folder::after { 1548 right: 10px; 1549 } 1550 1551 [dir="rtl"] #docs-outline > li.docs-folder::after { 1552 left: 10px; 1553 } 1554 1555 [dir="ltr"] #docs-outline > li.docs-folder > span > span { 1556 border-left: 3px solid #222; 1557 padding-left: 8px; 1558 } 1559 1560 [dir="rtl"] #docs-outline > li.docs-folder > span > span { 1561 border-right: 3px solid #222; 1562 padding-right: 8px; 1563 } 1564 1565 .easy-docs-tabs .docs-tab-label { 1566 color: #1f2328 !important; 1567 } 1568 1569 .easy-docs-explorer .docs-outline-label { 1570 color: #1f2328; 1571 } 1572 1573 .easy-docs-explorer .icon-file-text { 1574 color: #0e639c; 1575 } 1576 1577 .easy-docs-explorer .icon-right { 1578 color: #6b7280; 1579 } 1580 1581 .easy-docs-info a { 1582 color: #0078d4; 1583 } 1584 1585 #easy-context-menu li:hover { 1586 background: #edf3fb !important; 1587 } 1588 1589 #easy-context-menu li.text-red-600 { 1590 color: #c93838 !important; 1591 } 1592 1593 .easy-docs-editor-main .wp-editor-wrap { 1594 background: #ffffff; 1595 border: 1px solid #d9e0ea; 1596 border-radius: 10px; 1597 overflow: hidden; 1598 } 1599 1600 .easy-docs-editor-main .wp-editor-tools { 1601 background: #f3f6fb; 1602 padding: 6px 8px 0; 1603 } 1604 1605 .easy-docs-editor-main .wp-switch-editor { 1606 background: #e8edf5; 1607 border: 1px solid #ced7e3; 1608 border-bottom: none; 1609 color: #2f3742; 1610 } 1611 1612 [dir="ltr"] .easy-docs-editor-main .wp-switch-editor.switch-tmce { 1613 margin-left: 6px; 1614 } 1615 1616 [dir="rtl"] .easy-docs-editor-main .wp-switch-editor.switch-tmce { 1617 margin-right: 6px; 1618 } 1619 1620 .easy-docs-editor-main .wp-editor-wrap.tmce-active .switch-tmce, 1621 .easy-docs-editor-main .wp-editor-wrap.html-active .switch-html { 1622 background: #ffffff; 1623 color: #0078d4; 1624 font-weight: 600; 1625 } 1626 1627 .easy-docs-editor-main .mce-toolbar-grp, 1628 .easy-docs-editor-main .quicktags-toolbar { 1629 background: #f9fbff !important; 1630 border-bottom: 1px solid #d9e0ea !important; 1631 } 1632 1633 .easy-docs-editor-main .mce-top-part::before { 1634 box-shadow: none; 1635 } 1636 1637 .easy-docs-editor-main .mce-container, 1638 .easy-docs-editor-main .mce-panel, 1639 .easy-docs-editor-main .mce-btn { 1640 background: transparent !important; 1641 } 1642 1643 .easy-docs-editor-main .mce-btn:hover { 1644 background: #edf3fb !important; 1645 } 1646 1647 .easy-docs-editor-main .mce-edit-area iframe { 1648 background: #ffffff; 1649 } 1650 1651 .easy-docs-editor-main textarea.wp-editor-area { 1652 background: #ffffff; 1653 border: none !important; 1654 color: #1f2328; 1655 min-height: 460px; 1656 } 1657 1347 1658 .hover\:cursor-pointer:hover { 1348 1659 cursor: pointer; 1349 }1350 1351 .hover\:bg-blue-800:hover {1352 --tw-bg-opacity: 1;1353 background-color: rgb(30 64 175 / var(--tw-bg-opacity, 1));1354 1660 } 1355 1661 … … 1368 1674 } 1369 1675 1370 .hover\:text-blue-700:hover {1371 --tw-text-opacity: 1;1372 color: rgb(29 78 216 / var(--tw-text-opacity, 1));1373 }1374 1375 .hover\:text-gray-800:hover {1376 --tw-text-opacity: 1;1377 color: rgb(31 41 55 / var(--tw-text-opacity, 1));1378 }1379 1380 1676 .hover\:text-red-400:hover { 1381 1677 --tw-text-opacity: 1; … … 1383 1679 } 1384 1680 1385 .disabled\:cursor-not-allowed:disabled { 1386 cursor: not-allowed; 1387 } 1388 1389 .disabled\:bg-gray-100:disabled { 1390 --tw-bg-opacity: 1; 1391 background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); 1392 } 1393 1394 .disabled\:text-gray-400:disabled { 1395 --tw-text-opacity: 1; 1396 color: rgb(156 163 175 / var(--tw-text-opacity, 1)); 1397 } 1398 1399 .disabled\:hover\:bg-gray-100:hover:disabled { 1400 --tw-bg-opacity: 1; 1401 background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); 1402 } 1403 1404 @media (prefers-color-scheme: dark) { 1405 .dark\:bg-blue-600 { 1406 --tw-bg-opacity: 1; 1407 background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1)); 1681 @media (max-width: 1100px) { 1682 .easy-docs-layout { 1683 flex-direction: column; 1408 1684 } 1409 1685 1410 . dark\:hover\:bg-blue-700:hover {1411 --tw-bg-opacity: 1;1412 background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));1686 .easy-docs-explorer { 1687 min-width: 0; 1688 width: 100%; 1413 1689 } 1414 } 1690 1691 .easy-docs-editor-layout { 1692 flex-direction: column; 1693 } 1694 1695 .easy-docs-editor-aside { 1696 width: 100%; 1697 } 1698 } -
easy-docs/trunk/admin/css/admin.css
r3240911 r3475230 522 522 left: 50%; 523 523 } 524 .top-\[40\%\] {525 top: 40%;526 }527 524 .top-\[60px\] { 528 525 top: 60px; … … 536 533 .m-1 { 537 534 margin: 0.25rem; 538 }539 .m-auto {540 margin: auto;541 535 } 542 536 .mx-1 { … … 544 538 margin-right: 0.25rem; 545 539 } 546 .mx-4 {547 margin-left: 1rem;548 margin-right: 1rem;549 }550 .mx-8 {551 margin-left: 2rem;552 margin-right: 2rem;553 }554 540 .my-1 { 555 541 margin-top: 0.25rem; … … 571 557 margin-bottom: 1rem; 572 558 } 573 .me-2 { 574 -webkit-margin-end: 0.5rem; 575 margin-inline-end: 0.5rem; 559 .mb-5 { 560 margin-bottom: 1.25rem; 576 561 } 577 562 .ml-2 { … … 593 578 margin-right: 0.5rem; 594 579 } 595 .mt-2 {596 margin-top: 0.5rem;597 }598 580 .box-border { 599 581 box-sizing: border-box; … … 623 605 height: 500px; 624 606 } 625 .h-full {626 height: 100%;627 }628 607 .h-screen { 629 608 height: 100vh; … … 632 611 min-height: 100vh; 633 612 } 634 .w-1\/5 {635 width: 20%;636 }637 .w-3\/4 {638 width: 75%;639 }640 613 .w-7 { 641 614 width: 1.75rem; 642 615 } 643 .w-8\/12 {644 width: 66.666667%;645 }646 616 .w-\[540px\] { 647 617 width: 540px; … … 653 623 min-width: 8rem; 654 624 } 655 .min-w-\[300px\] {656 min-width: 300px;657 }658 625 .max-w-52 { 659 626 max-width: 13rem; 660 627 } 661 .max-w-\[1060px\] {662 max-width: 1060px;663 }664 628 .max-w-full { 665 629 max-width: 100%; … … 667 631 .flex-1 { 668 632 flex: 1 1 0%; 669 }670 .flex-shrink-0 {671 flex-shrink: 0;672 633 } 673 634 .-translate-x-1\/2 { … … 675 636 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); 676 637 } 677 .-translate-y-1\/2 {678 --tw-translate-y: -50%;679 transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));680 }681 638 .rotate-90 { 682 639 --tw-rotate: 90deg; … … 709 666 .justify-between { 710 667 justify-content: space-between; 711 }712 .space-x-4 > :not([hidden]) ~ :not([hidden]) {713 --tw-space-x-reverse: 0;714 margin-right: calc(1rem * var(--tw-space-x-reverse));715 margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));716 668 } 717 669 .overflow-y-auto { … … 741 693 border-bottom-width: 1px; 742 694 } 743 .border-l {744 border-left-width: 1px;745 }746 695 .border-t-0 { 747 696 border-top-width: 0px; … … 759 708 border-color: rgb(209 213 219 / var(--tw-border-opacity, 1)); 760 709 } 761 .bg-blue-700 {762 --tw-bg-opacity: 1;763 background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));764 }765 710 .bg-gray-100 { 766 711 --tw-bg-opacity: 1; 767 712 background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); 768 713 } 769 .bg-gray-200 {770 --tw-bg-opacity: 1;771 background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));772 }773 .bg-gray-50 {774 --tw-bg-opacity: 1;775 background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));776 }777 714 .bg-lime-700 { 778 715 --tw-bg-opacity: 1; … … 792 729 padding: 0px; 793 730 } 794 .p-10 {795 padding: 2.5rem;796 }797 731 .p-4 { 798 732 padding: 1rem; 799 }800 .p-8 {801 padding: 2rem;802 733 } 803 734 .\!px-4 { … … 817 748 padding-right: 1rem; 818 749 } 819 .px-5 {820 padding-left: 1.25rem;821 padding-right: 1.25rem;822 }823 750 .px-6 { 824 751 padding-left: 1.5rem; … … 833 760 padding-bottom: 0.5rem; 834 761 } 835 .py-2\.5 {836 padding-top: 0.625rem;837 padding-bottom: 0.625rem;838 }839 762 .py-4 { 840 763 padding-top: 1rem; … … 862 785 padding-right: 0.5rem; 863 786 } 864 .text-right {865 text-align: right;866 }867 787 .\!text-base { 868 788 font-size: 1rem !important; … … 881 801 line-height: 1.25rem; 882 802 } 883 .text-xl {884 font-size: 1.25rem;885 line-height: 1.75rem;886 }887 803 .font-bold { 888 804 font-weight: 700; 889 805 } 890 .font-medium {891 font-weight: 500;892 }893 806 .font-semibold { 894 807 font-weight: 600; … … 896 809 .italic { 897 810 font-style: italic; 898 }899 .text-blue-500 {900 --tw-text-opacity: 1;901 color: rgb(59 130 246 / var(--tw-text-opacity, 1));902 811 } 903 812 .text-gray-400 { … … 913 822 color: rgb(31 41 55 / var(--tw-text-opacity, 1)); 914 823 } 915 .text-gray-900 {916 --tw-text-opacity: 1;917 color: rgb(17 24 39 / var(--tw-text-opacity, 1));918 }919 824 .text-lime-600 { 920 825 --tw-text-opacity: 1; … … 932 837 --tw-text-opacity: 1; 933 838 color: rgb(71 85 105 / var(--tw-text-opacity, 1)); 934 }935 .text-white {936 --tw-text-opacity: 1;937 color: rgb(255 255 255 / var(--tw-text-opacity, 1));938 }939 .shadow {940 --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);941 --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);942 box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);943 839 } 944 840 .shadow-lg { … … 1083 979 visibility: visible; 1084 980 } 981 982 .toplevel_page_easy-docs-admin, 983 .easy-docs_page_easy-docs-stats, 984 .easy-docs_page_easy-docs-sets { 985 background: #f3f3f3; 986 } 987 .toplevel_page_easy-docs-admin .easy-docs.admin-page, 988 .easy-docs_page_easy-docs-stats .easy-docs.admin-page, 989 .easy-docs_page_easy-docs-sets .easy-docs.admin-page { 990 min-height: calc(100vh - 32px); 991 } 992 993 .easy-docs-topbar { 994 align-items: center; 995 background: linear-gradient(120deg, #fbfdff, #eef3f9); 996 border-bottom: 1px solid #d8dce2; 997 box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08); 998 display: flex; 999 justify-content: space-between; 1000 padding: 14px 18px; 1001 } 1002 1003 .easy-docs-topbar__brand { 1004 color: #5f6b7a; 1005 } 1006 1007 .easy-docs-topbar__title { 1008 color: #1f2328; 1009 font-size: 21px; 1010 font-weight: 700; 1011 line-height: 1.2; 1012 margin: 0; 1013 } 1014 1015 .easy-docs-topbar__subtitle { 1016 font-size: 12px; 1017 margin: 2px 0 0; 1018 } 1019 1020 .easy-docs-topbar__nav { 1021 align-items: center; 1022 display: flex; 1023 gap: 8px; 1024 margin: 0; 1025 } 1026 1027 .easy-docs-topbar__link { 1028 background: #f7f9fc; 1029 border: 1px solid #d2d8e2; 1030 border-radius: 8px; 1031 color: #2f3742; 1032 display: inline-flex; 1033 font-size: 12px; 1034 font-weight: 600; 1035 line-height: 1; 1036 padding: 8px 12px; 1037 } 1038 1039 .easy-docs-topbar__link:hover { 1040 background: #eef5ff; 1041 color: #005fb8; 1042 } 1043 1044 .easy-docs-topbar__link.is-active { 1045 background: #0078d4; 1046 border-color: #0078d4; 1047 color: #ffffff; 1048 } 1049 1050 .easy-docs-workspace { 1051 background: #f3f3f3; 1052 color: #1f2328; 1053 min-height: calc(100vh - 70px); 1054 } 1055 1056 .easy-docs-layout { 1057 border-top: 1px solid #dfe3e8; 1058 display: flex; 1059 min-height: calc(100vh - 118px); 1060 position: relative; 1061 } 1062 1063 .easy-docs-explorer { 1064 background: #f8f8f8; 1065 border-right: 1px solid #d7dbe2; 1066 display: flex; 1067 flex-direction: column; 1068 min-width: 300px; 1069 width: 300px; 1070 } 1071 1072 .easy-docs-pane-head { 1073 align-items: flex-start; 1074 border-bottom: 1px solid #dfe3e8; 1075 display: flex; 1076 gap: 8px; 1077 justify-content: space-between; 1078 padding: 8px 14px; 1079 } 1080 1081 .easy-docs-pane-title { 1082 color: #1f2328; 1083 font-size: 12px; 1084 font-weight: 700; 1085 letter-spacing: 0.08em; 1086 margin: 0; 1087 text-transform: uppercase; 1088 } 1089 1090 .easy-docs-pane-meta { 1091 color: #586376; 1092 font-size: 12px; 1093 margin: 2px 0 0; 1094 } 1095 1096 .easy-docs-explorer-actions { 1097 align-items: center; 1098 display: flex; 1099 gap: 4px; 1100 } 1101 1102 .easy-docs-explorer-actions .tt-btn { 1103 color: #3f4b5c; 1104 } 1105 1106 .easy-docs-explorer-actions .tt-btn:hover { 1107 background: rgba(0, 120, 212, 0.1); 1108 } 1109 1110 .easy-docs-content { 1111 background: #ffffff; 1112 display: flex; 1113 flex: 1; 1114 flex-direction: column; 1115 min-width: 0; 1116 } 1117 1118 .easy-docs-info { 1119 align-items: center; 1120 background: #f9fafc; 1121 border-bottom: 1px solid #e2e5ea; 1122 color: #1f2328; 1123 display: flex; 1124 justify-content: flex-end; 1125 min-height: 45px; 1126 padding: 8px 14px; 1127 } 1128 1129 .easy-docs-tabs { 1130 align-items: center; 1131 background: #f3f3f3; 1132 border-bottom: 1px solid #dde1e7; 1133 display: flex; 1134 min-height: 42px; 1135 overflow-x: auto; 1136 padding: 0 8px; 1137 } 1138 1139 .easy-docs-tabs .docs-tab { 1140 background: #eceff4; 1141 border: 1px solid #d5dbe5; 1142 border-bottom: none; 1143 border-radius: 8px 8px 0 0; 1144 margin-top: 6px; 1145 } 1146 1147 .easy-docs-tabs .docs-tab.active-tab { 1148 background: #ffffff; 1149 border-color: #cfd7e3; 1150 } 1151 1152 .easy-docs-editor-shell { 1153 background: #ffffff; 1154 flex: 1; 1155 padding: 14px; 1156 } 1157 1158 .easy-docs-tab-content { 1159 height: 100%; 1160 min-height: 540px; 1161 position: relative; 1162 width: 100%; 1163 } 1164 1165 .easy-docs-welcome-state { 1166 background: linear-gradient(145deg, #ffffff, #f3f8ff); 1167 border: 1px dashed #ccdae9; 1168 border-radius: 12px; 1169 left: 50%; 1170 max-width: 860px; 1171 padding: 24px 28px; 1172 position: absolute; 1173 top: 40%; 1174 transform: translate(-50%, -50%); 1175 width: calc(100% - 40px); 1176 } 1177 1178 .easy-docs-welcome-state li { 1179 color: #556274; 1180 margin-bottom: 8px; 1181 } 1182 1183 .easy-docs-welcome-state li:hover { 1184 color: #1f2328; 1185 } 1186 1187 .easy-docs-editor-layout { 1188 display: flex; 1189 gap: 18px; 1190 } 1191 1192 .easy-docs-editor-main { 1193 flex: 1; 1194 min-width: 0; 1195 } 1196 1197 .easy-docs-editor-aside { 1198 background: #f8fafe; 1199 border: 1px solid #dbe2ec; 1200 border-radius: 12px; 1201 min-width: 220px; 1202 padding: 16px; 1203 width: 240px; 1204 } 1205 1206 .easy-docs-save-btn { 1207 align-items: center; 1208 background: #0e639c; 1209 border-radius: 8px; 1210 color: #ffffff; 1211 display: inline-flex; 1212 font-size: 13px; 1213 font-weight: 600; 1214 gap: 4px; 1215 padding: 10px 14px; 1216 } 1217 1218 .easy-docs-save-btn:hover { 1219 background: #1177bb; 1220 } 1221 1222 .easy-docs-save-btn:disabled { 1223 background: #e6ebf2; 1224 color: #8b96a6; 1225 cursor: not-allowed; 1226 } 1227 1228 .easy-docs-settings-wrap { 1229 padding: 24px; 1230 } 1231 1232 .easy-docs-settings-card { 1233 background: #ffffff; 1234 border: 1px solid #dde3ec; 1235 border-radius: 14px; 1236 box-shadow: 0 8px 28px rgba(30, 41, 59, 0.08); 1237 margin: 0 auto; 1238 max-width: 1060px; 1239 padding: 24px; 1240 } 1241 1242 .easy-docs-stats-content { 1243 padding: 14px; 1244 } 1245 1246 #easy-context-menu { 1247 background: #ffffff; 1248 border: 1px solid #d9dee7 !important; 1249 border-radius: 10px !important; 1250 box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); 1251 min-width: 210px; 1252 } 1253 1254 #easy-context-menu li { 1255 color: #1f2328; 1256 margin: 0; 1257 } 1258 1259 #docs-overlay { 1260 background: rgba(15, 23, 42, 0.16); 1261 } 1262 1263 #docs-overlay .easy-docs-modal-content { 1264 background: #ffffff; 1265 color: #1f2328; 1266 border: 1px solid #d9e0ea; 1267 border-radius: 12px; 1268 box-shadow: 0 16px 35px rgba(15, 23, 42, 0.15); 1269 top: 80px; 1270 } 1271 1272 .easy-docs-explorer .docs-outline-item > span:hover { 1273 background: #edf3fb !important; 1274 } 1275 1276 .easy-docs-explorer .docs-outline-item.active-item > span { 1277 background: rgba(0, 120, 212, 0.14) !important; 1278 } 1279 1280 .easy-docs-explorer .docs-outline-item.active-item .docs-outline-label { 1281 color: #222; 1282 } 1283 1284 #docs-outline > li.docs-folder { 1285 background: #fff; 1286 border: 1px solid #e6e6e6; 1287 border-radius: 8px; 1288 margin: 8px 10px; 1289 position: relative; 1290 } 1291 1292 #docs-outline > li.docs-folder::after { 1293 background: #e9f4ff; 1294 border: 1px solid #bdd8f6; 1295 border-radius: 10px; 1296 color: #222; 1297 content: "PROJECT"; 1298 font-size: 10px; 1299 font-weight: 700; 1300 letter-spacing: 0.08em; 1301 padding: 2px 7px; 1302 position: absolute; 1303 right: 10px; 1304 text-transform: uppercase; 1305 top: 8px; 1306 } 1307 1308 #docs-outline > li.docs-folder > span > span { 1309 border-left: 3px solid #222; 1310 padding-left: 8px; 1311 } 1312 1313 .easy-docs-tabs .docs-tab-label { 1314 color: #1f2328 !important; 1315 } 1316 1317 .easy-docs-explorer .docs-outline-label { 1318 color: #1f2328; 1319 } 1320 1321 .easy-docs-explorer .icon-file-text { 1322 color: #0e639c; 1323 } 1324 1325 .easy-docs-explorer .icon-right { 1326 color: #6b7280; 1327 } 1328 1329 .easy-docs-info a { 1330 color: #0078d4; 1331 } 1332 1333 #easy-context-menu li:hover { 1334 background: #edf3fb !important; 1335 } 1336 1337 #easy-context-menu li.text-red-600 { 1338 color: #c93838 !important; 1339 } 1340 1341 .easy-docs-editor-main .wp-editor-wrap { 1342 background: #ffffff; 1343 border: 1px solid #d9e0ea; 1344 border-radius: 10px; 1345 overflow: hidden; 1346 } 1347 1348 .easy-docs-editor-main .wp-editor-tools { 1349 background: #f3f6fb; 1350 padding: 6px 8px 0; 1351 } 1352 1353 .easy-docs-editor-main .wp-switch-editor { 1354 background: #e8edf5; 1355 border: 1px solid #ced7e3; 1356 border-bottom: none; 1357 color: #2f3742; 1358 } 1359 1360 .easy-docs-editor-main .wp-switch-editor.switch-tmce { 1361 margin-left: 6px; 1362 } 1363 1364 .easy-docs-editor-main .wp-editor-wrap.tmce-active .switch-tmce, 1365 .easy-docs-editor-main .wp-editor-wrap.html-active .switch-html { 1366 background: #ffffff; 1367 color: #0078d4; 1368 font-weight: 600; 1369 } 1370 1371 .easy-docs-editor-main .mce-toolbar-grp, 1372 .easy-docs-editor-main .quicktags-toolbar { 1373 background: #f9fbff !important; 1374 border-bottom: 1px solid #d9e0ea !important; 1375 } 1376 1377 .easy-docs-editor-main .mce-top-part::before { 1378 box-shadow: none; 1379 } 1380 1381 .easy-docs-editor-main .mce-container, 1382 .easy-docs-editor-main .mce-panel, 1383 .easy-docs-editor-main .mce-btn { 1384 background: transparent !important; 1385 } 1386 1387 .easy-docs-editor-main .mce-btn:hover { 1388 background: #edf3fb !important; 1389 } 1390 1391 .easy-docs-editor-main .mce-edit-area iframe { 1392 background: #ffffff; 1393 } 1394 1395 .easy-docs-editor-main textarea.wp-editor-area { 1396 background: #ffffff; 1397 border: none !important; 1398 color: #1f2328; 1399 min-height: 460px; 1400 } 1401 1085 1402 .hover\:cursor-pointer:hover { 1086 1403 cursor: pointer; 1087 1404 } 1088 .hover\:bg-blue-800:hover { 1089 --tw-bg-opacity: 1; 1090 background-color: rgb(30 64 175 / var(--tw-bg-opacity, 1)); 1091 } 1405 1092 1406 .hover\:bg-gray-200:hover { 1093 1407 --tw-bg-opacity: 1; 1094 1408 background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1)); 1095 1409 } 1410 1096 1411 .hover\:bg-gray-300:hover { 1097 1412 --tw-bg-opacity: 1; 1098 1413 background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1)); 1099 1414 } 1415 1100 1416 .hover\:bg-gray-400\/20:hover { 1101 1417 background-color: rgb(156 163 175 / 0.2); 1102 1418 } 1103 .hover\:text-blue-700:hover { 1104 --tw-text-opacity: 1; 1105 color: rgb(29 78 216 / var(--tw-text-opacity, 1)); 1106 } 1107 .hover\:text-gray-800:hover { 1108 --tw-text-opacity: 1; 1109 color: rgb(31 41 55 / var(--tw-text-opacity, 1)); 1110 } 1419 1111 1420 .hover\:text-red-400:hover { 1112 1421 --tw-text-opacity: 1; 1113 1422 color: rgb(248 113 113 / var(--tw-text-opacity, 1)); 1114 1423 } 1115 .disabled\:cursor-not-allowed:disabled { 1116 cursor: not-allowed; 1117 } 1118 .disabled\:bg-gray-100:disabled { 1119 --tw-bg-opacity: 1; 1120 background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); 1121 } 1122 .disabled\:text-gray-400:disabled { 1123 --tw-text-opacity: 1; 1124 color: rgb(156 163 175 / var(--tw-text-opacity, 1)); 1125 } 1126 .disabled\:hover\:bg-gray-100:hover:disabled { 1127 --tw-bg-opacity: 1; 1128 background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1)); 1129 } 1130 @media (prefers-color-scheme: dark) { 1131 1132 .dark\:bg-blue-600 { 1133 --tw-bg-opacity: 1; 1134 background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1)); 1424 1425 @media (max-width: 1100px) { 1426 .easy-docs-layout { 1427 flex-direction: column; 1135 1428 } 1136 1137 .dark\:hover\:bg-blue-700:hover { 1138 --tw-bg-opacity: 1; 1139 background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1)); 1429 .easy-docs-explorer { 1430 min-width: 0; 1431 width: 100%; 1140 1432 } 1141 } 1433 .easy-docs-editor-layout { 1434 flex-direction: column; 1435 } 1436 .easy-docs-editor-aside { 1437 width: 100%; 1438 } 1439 } -
easy-docs/trunk/admin/css/editor-styles-rtl.css
r3217183 r3475230 1 @charset "UTF-8";2 3 1 .docs-post-content { 4 font-size: 1rem; 5 line-height: 1.5; 6 background-color: #ffffff; 2 --docs-text: #1f2937; 3 --docs-heading: #0f172a; 4 --docs-muted: #64748b; 5 --docs-link: #0b63ce; 6 --docs-link-hover: #084b9a; 7 --docs-border: #dbe4ee; 8 --docs-border-strong: #c7d5e4; 9 --docs-surface: #f8fbff; 10 --docs-surface-alt: #f1f5fb; 11 --docs-code-bg: #f4f7fc; 12 --docs-code-border: #d7e1ee; 13 --docs-pre-bg: #0b1220; 14 --docs-pre-border: #1d2a3c; 15 --docs-pre-text: #dce7f6; 16 --docs-quote-accent: #3b82f6; 17 color: var(--docs-text); 18 font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; 19 font-size: clamp(0.98rem, 0.15vw + 0.95rem, 1.04rem); 7 20 font-weight: 400; 8 /* Links */ 9 /* Lists */ 10 /* Ordered list (ol) styles */ 11 /* Nested lists for better indentation */ 12 /* Add custom bullets for unordered lists */ 13 /* Code */ 14 /* Table */ 15 } 16 17 .docs-post-content h6, .docs-post-content h5, .docs-post-content h4, .docs-post-content h3, .docs-post-content h2, .docs-post-content h1 { 18 margin: 0 0 1.5rem; 19 font-weight: inherit; 21 line-height: 1.72; 22 text-rendering: optimizeLegibility; 23 word-wrap: break-word; 24 -moz-osx-font-smoothing: grayscale; 25 } 26 27 .docs-post-content > *:last-child { 28 margin-bottom: 0; 29 } 30 31 .docs-post-content p, 32 .docs-post-content ul, 33 .docs-post-content ol, 34 .docs-post-content dl, 35 .docs-post-content table, 36 .docs-post-content pre, 37 .docs-post-content blockquote, 38 .docs-post-content figure, 39 .docs-post-content details, 40 .docs-post-content .wp-block-embed, 41 .docs-post-content .wp-block-image, 42 .docs-post-content .wp-block-table { 43 margin: 0 0 1.35rem; 44 } 45 46 .docs-post-content p:empty { 47 line-height: 0; 48 margin: 0; 49 padding: 0; 50 } 51 52 .docs-post-content p > br:only-child { 53 display: none; 54 } 55 56 .docs-post-content h5, 57 .docs-post-content h6, .docs-post-content h4, .docs-post-content h3, .docs-post-content h2, .docs-post-content h1 { 58 color: var(--docs-heading); 59 font-weight: 700; 60 letter-spacing: -0.02em; 61 line-height: 1.24; 62 margin: 2rem 0 0.85rem; 63 scroll-margin-top: 90px; 20 64 } 21 65 22 66 .docs-post-content h1 { 23 font-size: 1.667rem; 24 line-height: 1.2; 67 font-size: clamp(1.72rem, 1.1vw + 1.38rem, 2.22rem); 68 margin-top: 0; 69 padding-bottom: 0.45rem; 70 border-bottom: 1px solid var(--docs-border); 25 71 } 26 72 27 73 .docs-post-content h2 { 28 font-size: 1.667rem; 29 line-height: 1.2; 74 font-size: clamp(1.38rem, 0.9vw + 1.08rem, 1.78rem); 75 margin-top: 2.2rem; 76 padding-bottom: 0.35rem; 77 border-bottom: 1px solid var(--docs-border); 30 78 } 31 79 32 80 .docs-post-content h3 { 33 font-size: 1.333rem;34 line-height: 1.2;81 font-size: clamp(1.2rem, 0.58vw + 1.01rem, 1.44rem); 82 margin-top: 1.95rem; 35 83 } 36 84 37 85 .docs-post-content h4 { 38 font-size: 1.128em; 86 font-size: 1.08rem; 87 margin-top: 1.75rem; 88 } 89 90 .docs-post-content h5, 91 .docs-post-content h6 { 92 font-size: 0.96rem; 93 letter-spacing: -0.01em; 94 margin-top: 1.55rem; 95 } 96 97 .docs-post-content a { 98 color: var(--docs-link); 39 99 font-weight: 500; 40 line-height: 1.329787234;41 }42 43 .docs-post-content h5 {44 font-size: 1rem;45 line-height: 1.5;46 }47 48 .docs-post-content h6 {49 font-size: 0.8865rem;50 line-height: 1.6920473773;51 }52 53 .docs-post-content a {54 color: #4381b5;55 100 text-decoration: underline; 101 -webkit-text-decoration-color: rgba(11, 99, 206, 0.35); 102 text-decoration-color: rgba(11, 99, 206, 0.35); 103 text-decoration-thickness: 0.08em; 104 text-underline-offset: 0.16em; 105 transition: color 0.16s ease, -webkit-text-decoration-color 0.16s ease; 106 transition: color 0.16s ease, text-decoration-color 0.16s ease; 107 transition: color 0.16s ease, text-decoration-color 0.16s ease, -webkit-text-decoration-color 0.16s ease; 56 108 } 57 109 58 110 .docs-post-content a:hover { 59 text-decoration: underline; 111 color: var(--docs-link-hover); 112 -webkit-text-decoration-color: rgba(8, 75, 154, 0.6); 113 text-decoration-color: rgba(8, 75, 154, 0.6); 60 114 } 61 115 62 116 .docs-post-content a:focus { 63 outline: thin dotted; 64 outline-offset: -0.05em; 65 } 66 67 .docs-post-content ol, .docs-post-content ul { 68 margin: 1em 0; 69 } 70 71 [dir="ltr"] .docs-post-content ol, [dir="ltr"] .docs-post-content ul { 72 padding-left: 1em; 73 } 74 75 [dir="rtl"] .docs-post-content ol, [dir="rtl"] .docs-post-content ul { 76 padding-right: 1em; 117 outline: 2px solid rgba(59, 130, 246, 0.35); 118 outline-offset: 2px; 119 } 120 121 .docs-post-content strong { 122 color: #111827; 123 font-weight: 700; 124 } 125 126 .docs-post-content em { 127 color: #334155; 128 } 129 130 [dir="ltr"] .docs-post-content ul, 131 [dir="ltr"] .docs-post-content ol { 132 padding-left: 1.5em; 133 } 134 135 [dir="rtl"] .docs-post-content ul, 136 [dir="rtl"] .docs-post-content ol { 137 padding-right: 1.5em; 138 } 139 140 .docs-post-content li + li { 141 margin-top: 0.35rem; 142 } 143 144 .docs-post-content ul { 145 list-style-type: disc; 146 } 147 148 .docs-post-content ul ::marker { 149 color: #55789f; 77 150 } 78 151 79 152 .docs-post-content ol { 80 153 list-style-type: decimal; 81 line-height: 1.5; 82 } 83 84 .docs-post-content ol li { 85 margin-bottom: 0.5em; 86 } 87 88 .docs-post-content ul { 89 list-style-type: disc; 90 line-height: 1.5; 91 } 92 93 .docs-post-content ul li { 94 margin-bottom: 0.5em; 95 } 96 97 .docs-post-content ol ol, .docs-post-content ul ul, .docs-post-content ol ul, .docs-post-content ul ol { 98 margin-top: 0.5em; 99 margin-bottom: 0.5em; 100 } 101 102 .docs-post-content ul.custom-bullets { 103 list-style-type: none; /* Align with parent */ 104 } 105 106 [dir="ltr"] .docs-post-content ul.custom-bullets { /* Remove default bullets */ 107 padding-left: 0; 108 } 109 110 [dir="rtl"] .docs-post-content ul.custom-bullets { 111 padding-right: 0; 112 } 113 114 .docs-post-content ul.custom-bullets li::before { 115 content: "•"; /* Custom bullet character */ 116 color: #007BFF; /* Blue bullet color */ 117 font-size: 1.2em; 118 display: inline-block; 119 width: 1em; 120 } 121 122 [dir="ltr"] .docs-post-content ul.custom-bullets li::before { 123 margin-left: -1em; 124 } 125 126 [dir="rtl"] .docs-post-content ul.custom-bullets li::before { 127 margin-right: -1em; 128 } 129 130 .docs-post-content p { 131 margin: 0 0 1.5rem; 154 } 155 156 .docs-post-content ol ::marker { 157 color: #49668a; 158 font-weight: 600; 159 } 160 161 .docs-post-content ul ul { 162 list-style-type: circle; 163 } 164 165 .docs-post-content ul ul ul { 166 list-style-type: square; 167 } 168 169 .docs-post-content li > ul, 170 .docs-post-content li > ol { 171 margin-top: 0.45rem; 172 margin-bottom: 0.2rem; 132 173 } 133 174 134 175 .docs-post-content hr { 176 border: 0; 177 height: 1px; 178 margin: 2rem 0; 135 179 overflow: visible; 136 height: 1px; 137 margin-bottom: 1.5rem; 138 border: 0; 139 background-color: #E6E6E6; 180 } 181 182 [dir="ltr"] .docs-post-content hr { 183 background: linear-gradient(90deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.6), rgba(148, 163, 184, 0.1)); 184 } 185 186 [dir="rtl"] .docs-post-content hr { 187 background: linear-gradient(-90deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.6), rgba(148, 163, 184, 0.1)); 188 } 189 190 .docs-post-content img { 191 border: 1px solid var(--docs-border); 192 border-radius: 12px; 193 height: auto; 194 max-width: 100%; 140 195 } 141 196 142 197 .docs-post-content figure { 143 margin: 0; 198 margin-left: 0; 199 margin-right: 0; 200 } 201 202 .docs-post-content figcaption, 203 .docs-post-content .wp-caption-text { 204 color: var(--docs-muted); 205 font-size: 0.88rem; 206 margin-top: 0.45rem; 207 text-align: center; 208 } 209 210 .docs-post-content .wp-caption { 211 margin: 0 0 1.35rem; 212 max-width: 100%; 213 } 214 215 .docs-post-content blockquote { 216 border: 1px solid var(--docs-border); 217 color: #334155; 218 margin: 1.65rem 0; 219 } 220 221 [dir="ltr"] .docs-post-content blockquote { 222 background: linear-gradient(180deg, #f8fbff, #f3f8ff); 223 border-left: 4px solid var(--docs-quote-accent); 224 border-radius: 0 12px 12px 0; 225 padding: 0.95rem 1.1rem 0.95rem 1rem; 226 } 227 228 [dir="rtl"] .docs-post-content blockquote { 229 background: linear-gradient(-180deg, #f8fbff, #f3f8ff); 230 border-right: 4px solid var(--docs-quote-accent); 231 border-radius: 12px 0 0 12px; 232 padding: 0.95rem 1rem 0.95rem 1.1rem; 233 } 234 235 .docs-post-content blockquote p:last-child { 236 margin-bottom: 0; 237 } 238 239 .docs-post-content blockquote cite { 240 color: var(--docs-muted); 241 display: block; 242 font-size: 0.86rem; 243 font-style: normal; 244 font-weight: 600; 245 margin-top: 0.6rem; 144 246 } 145 247 146 248 .docs-post-content code, 249 .docs-post-content kbd, 250 .docs-post-content samp { 251 background: var(--docs-code-bg); 252 border: 1px solid var(--docs-code-border); 253 border-radius: 6px; 254 color: #112237; 255 font-family: "Andale Mono", AndaleMono, "Lucida Console", monospace; 256 font-size: 0.84em; 257 padding: 0.14em 0.38em; 258 } 259 260 .docs-post-content kbd { 261 border-bottom-width: 2px; 262 box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.14); 263 font-weight: 700; 264 } 265 147 266 .docs-post-content pre { 148 font-family: inherit; 149 font-size: 0.8865rem; 150 line-height: 1.6920473773; 151 } 152 153 .docs-post-content pre { 154 background-color: inherit; 155 color: inherit; 156 margin: 0 0 1.5rem; 267 background: var(--docs-pre-bg); 268 border: 1px solid var(--docs-pre-border); 269 border-radius: 12px; 270 color: var(--docs-pre-text); 271 font-family: "Andale Mono", AndaleMono, "Lucida Console", monospace; 272 font-size: 0.88rem; 273 line-height: 1.72; 274 margin: 0 0 1.35rem; 157 275 max-width: 100%; 158 276 overflow: auto; 159 padding: 1 .5em;277 padding: 1em 1.15em; 160 278 white-space: pre; 161 white-space: pre-wrap; 162 word-wrap: break-word; 163 } 164 165 .docs-post-content code { 166 background-color: inherit; 279 } 280 281 .docs-post-content pre code { 282 background: transparent; 283 border: 0; 167 284 color: inherit; 168 padding: 0.125em 0.25em; 285 font-size: inherit; 286 padding: 0; 169 287 } 170 288 171 289 .docs-post-content table { 172 font-size: 0.8865rem; 173 line-height: 1.6920473773; 290 border: 1px solid var(--docs-border-strong); 291 border-collapse: separate; 292 border-radius: 12px; 293 border-spacing: 0; 294 display: block; 295 overflow-x: auto; 296 width: 100%; 297 } 298 299 .docs-post-content table thead th { 300 background: #f5f9ff; 301 color: var(--docs-heading); 302 font-weight: 700; 303 letter-spacing: 0.01em; 304 position: -webkit-sticky; 305 position: sticky; 306 top: 0; 307 z-index: 1; 308 } 309 310 .docs-post-content table th, 311 .docs-post-content table td { 312 border-bottom: 1px solid var(--docs-border); 313 min-width: 120px; 314 padding: 0.62em 0.84em; 315 vertical-align: top; 316 white-space: normal; 317 } 318 319 [dir="ltr"] .docs-post-content table th, 320 [dir="ltr"] .docs-post-content table td { 321 text-align: left; 322 } 323 324 [dir="rtl"] .docs-post-content table th, 325 [dir="rtl"] .docs-post-content table td { 326 text-align: right; 327 } 328 329 .docs-post-content table tbody tr:nth-child(even) { 330 background: var(--docs-surface); 331 } 332 333 .docs-post-content table tbody tr:hover { 334 background: var(--docs-surface-alt); 335 } 336 337 .docs-post-content table tr:last-child td { 338 border-bottom: 0; 339 } 340 341 .docs-post-content dl { 342 border: 1px solid var(--docs-border); 343 border-radius: 10px; 174 344 overflow: hidden; 175 border-spacing: 0; 176 border-collapse: separate; 345 } 346 347 .docs-post-content dl dt, 348 .docs-post-content dl dd { 349 margin: 0; 350 padding: 0.68rem 0.85rem; 351 } 352 353 .docs-post-content dl dt { 354 background: #f8fbff; 355 color: var(--docs-heading); 356 font-weight: 700; 357 } 358 359 .docs-post-content dl dd + dt { 360 border-top: 1px solid var(--docs-border); 361 } 362 363 .docs-post-content abbr[title] { 364 cursor: help; 365 -webkit-text-decoration: underline dotted; 366 text-decoration: underline dotted; 367 text-decoration-thickness: 0.08em; 368 } 369 370 .docs-post-content mark { 371 background: #fef3c7; 372 border-radius: 3px; 373 color: #2f2200; 374 padding: 0.05em 0.2em; 375 } 376 377 .docs-post-content sub, 378 .docs-post-content sup { 379 font-size: 0.75em; 380 line-height: 0; 381 position: relative; 382 vertical-align: baseline; 383 } 384 385 .docs-post-content sup { 386 top: -0.45em; 387 } 388 389 .docs-post-content sub { 390 bottom: -0.2em; 391 } 392 393 .docs-post-content details { 394 background: #f8fbff; 395 border: 1px solid var(--docs-border); 396 border-radius: 10px; 397 overflow: hidden; 398 } 399 400 .docs-post-content details summary { 401 cursor: pointer; 402 color: var(--docs-heading); 403 font-weight: 600; 404 padding: 0.72rem 0.88rem; 405 } 406 407 .docs-post-content details > *:not(summary) { 408 margin: 0; 409 padding: 0.25rem 0.88rem 0.85rem; 410 } 411 412 .docs-post-content embed, 413 .docs-post-content object, 414 .docs-post-content iframe, 415 .docs-post-content video { 416 background: #000; 417 border: 0; 418 border-radius: 0; 419 display: block; 420 margin-bottom: 1.35rem; 421 max-width: 100%; 177 422 width: 100%; 178 margin-bottom: 1.5rem; 179 border: 1px solid #E6E6E6; 180 border-radius: 8px; 181 } 182 183 .docs-post-content table td, 184 .docs-post-content table th { 185 padding: 0.5em 1em; 186 } 187 188 [dir="ltr"] .docs-post-content table td, 189 [dir="ltr"] .docs-post-content table th { 190 text-align: left; 191 } 192 193 [dir="rtl"] .docs-post-content table td, 194 [dir="rtl"] .docs-post-content table th { 195 text-align: right; 196 } 197 198 .docs-post-content table tr { 199 background-color: transparent; 200 } 201 202 .docs-post-content table tr:nth-of-type(2n) { 203 background-color: rgba(218, 202, 251, 0.2); 204 } 205 206 .docs-post-content p:empty { 207 margin: 0; 208 padding: 0; 209 line-height: 0; 210 } 211 212 .docs-post-content blockquote { 213 font-size: 1rem; 214 margin: 30px auto; 215 color: #555555; 216 line-height: 1.6; 217 position: relative; 218 } 219 220 [dir="ltr"] .docs-post-content blockquote { 221 padding: 1.2em 30px 1.2em 45px; 222 } 223 224 [dir="rtl"] .docs-post-content blockquote { 225 padding: 1.2em 45px 1.2em 30px; 226 } 227 228 .docs-post-content blockquote::before { 229 font-family: Arial; 230 content: "“"; 231 color: inherit; 232 font-size: 4em; 233 position: absolute; 234 top: -10px; 235 } 236 237 [dir="ltr"] .docs-post-content blockquote::before { 238 left: 10px; 239 } 240 241 [dir="rtl"] .docs-post-content blockquote::before { 242 right: 10px; 243 } 244 245 .docs-post-content blockquote::after { 246 content: ""; 247 } 248 249 .docs-post-content blockquote cite { 250 display: block; 251 color: #333333; 252 font-style: normal; 253 font-weight: bold; 254 margin-top: 1em; 255 } 256 257 @media only screen and (min-width: 1024px){ 258 .docs-post-content h1 { 259 font-size: 2.25rem; 260 line-height: 1.2; 261 } 262 } 423 } 424 425 .docs-post-content .wp-block-embed, 426 .docs-post-content .wp-block-embed__wrapper { 427 max-width: 100%; 428 } 429 430 .docs-post-content iframe[src*="youtube.com"], 431 .docs-post-content iframe[src*="youtu.be"], 432 .docs-post-content iframe[src*="vimeo.com"], 433 .docs-post-content .wp-block-embed-youtube iframe, 434 .docs-post-content .wp-block-embed-vimeo iframe { 435 aspect-ratio: 16/9; 436 box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14); 437 height: auto; 438 } 439 440 .docs-post-content table, 441 .docs-post-content pre, 442 .docs-post-content blockquote, 443 .docs-post-content details, 444 .docs-post-content img, 445 .docs-post-content iframe, 446 .docs-post-content video { 447 box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); 448 } -
easy-docs/trunk/admin/css/editor-styles.css
r3217183 r3475230 1 @charset "UTF-8";2 1 .docs-post-content { 3 font-size: 1rem; 4 line-height: 1.5; 5 background-color: #ffffff; 2 --docs-text: #1f2937; 3 --docs-heading: #0f172a; 4 --docs-muted: #64748b; 5 --docs-link: #0b63ce; 6 --docs-link-hover: #084b9a; 7 --docs-border: #dbe4ee; 8 --docs-border-strong: #c7d5e4; 9 --docs-surface: #f8fbff; 10 --docs-surface-alt: #f1f5fb; 11 --docs-code-bg: #f4f7fc; 12 --docs-code-border: #d7e1ee; 13 --docs-pre-bg: #0b1220; 14 --docs-pre-border: #1d2a3c; 15 --docs-pre-text: #dce7f6; 16 --docs-quote-accent: #3b82f6; 17 color: var(--docs-text); 18 font-family: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; 19 font-size: clamp(0.98rem, 0.15vw + 0.95rem, 1.04rem); 6 20 font-weight: 400; 7 /* Links */ 8 /* Lists */ 9 /* Ordered list (ol) styles */ 10 /* Nested lists for better indentation */ 11 /* Add custom bullets for unordered lists */ 12 /* Code */ 13 /* Table */ 14 } 15 .docs-post-content h6, .docs-post-content h5, .docs-post-content h4, .docs-post-content h3, .docs-post-content h2, .docs-post-content h1 { 16 margin: 0 0 1.5rem; 17 font-weight: inherit; 21 line-height: 1.72; 22 text-rendering: optimizeLegibility; 23 word-wrap: break-word; 24 -moz-osx-font-smoothing: grayscale; 25 } 26 .docs-post-content > *:last-child { 27 margin-bottom: 0; 28 } 29 .docs-post-content p, 30 .docs-post-content ul, 31 .docs-post-content ol, 32 .docs-post-content dl, 33 .docs-post-content table, 34 .docs-post-content pre, 35 .docs-post-content blockquote, 36 .docs-post-content figure, 37 .docs-post-content details, 38 .docs-post-content .wp-block-embed, 39 .docs-post-content .wp-block-image, 40 .docs-post-content .wp-block-table { 41 margin: 0 0 1.35rem; 42 } 43 .docs-post-content p:empty { 44 line-height: 0; 45 margin: 0; 46 padding: 0; 47 } 48 .docs-post-content p > br:only-child { 49 display: none; 50 } 51 .docs-post-content h5, 52 .docs-post-content h6, .docs-post-content h4, .docs-post-content h3, .docs-post-content h2, .docs-post-content h1 { 53 color: var(--docs-heading); 54 font-weight: 700; 55 letter-spacing: -0.02em; 56 line-height: 1.24; 57 margin: 2rem 0 0.85rem; 58 scroll-margin-top: 90px; 18 59 } 19 60 .docs-post-content h1 { 20 font-size: 1.667rem; 21 line-height: 1.2; 61 font-size: clamp(1.72rem, 1.1vw + 1.38rem, 2.22rem); 62 margin-top: 0; 63 padding-bottom: 0.45rem; 64 border-bottom: 1px solid var(--docs-border); 22 65 } 23 66 .docs-post-content h2 { 24 font-size: 1.667rem; 25 line-height: 1.2; 67 font-size: clamp(1.38rem, 0.9vw + 1.08rem, 1.78rem); 68 margin-top: 2.2rem; 69 padding-bottom: 0.35rem; 70 border-bottom: 1px solid var(--docs-border); 26 71 } 27 72 .docs-post-content h3 { 28 font-size: 1.333rem;29 line-height: 1.2;73 font-size: clamp(1.2rem, 0.58vw + 1.01rem, 1.44rem); 74 margin-top: 1.95rem; 30 75 } 31 76 .docs-post-content h4 { 32 font-size: 1.128em; 77 font-size: 1.08rem; 78 margin-top: 1.75rem; 79 } 80 .docs-post-content h5, 81 .docs-post-content h6 { 82 font-size: 0.96rem; 83 letter-spacing: -0.01em; 84 margin-top: 1.55rem; 85 } 86 .docs-post-content a { 87 color: var(--docs-link); 33 88 font-weight: 500; 34 line-height: 1.329787234;35 }36 .docs-post-content h5 {37 font-size: 1rem;38 line-height: 1.5;39 }40 .docs-post-content h6 {41 font-size: 0.8865rem;42 line-height: 1.6920473773;43 }44 .docs-post-content a {45 color: #4381b5;46 89 text-decoration: underline; 90 text-decoration-color: rgba(11, 99, 206, 0.35); 91 text-decoration-thickness: 0.08em; 92 text-underline-offset: 0.16em; 93 transition: color 0.16s ease, text-decoration-color 0.16s ease; 47 94 } 48 95 .docs-post-content a:hover { 49 text-decoration: underline; 96 color: var(--docs-link-hover); 97 text-decoration-color: rgba(8, 75, 154, 0.6); 50 98 } 51 99 .docs-post-content a:focus { 52 outline: thin dotted; 53 outline-offset: -0.05em; 54 } 55 .docs-post-content ol, .docs-post-content ul { 56 margin: 1em 0; 57 padding-left: 1em; 100 outline: 2px solid rgba(59, 130, 246, 0.35); 101 outline-offset: 2px; 102 } 103 .docs-post-content strong { 104 color: #111827; 105 font-weight: 700; 106 } 107 .docs-post-content em { 108 color: #334155; 109 } 110 .docs-post-content ul, 111 .docs-post-content ol { 112 padding-left: 1.5em; 113 } 114 .docs-post-content li + li { 115 margin-top: 0.35rem; 116 } 117 .docs-post-content ul { 118 list-style-type: disc; 119 } 120 .docs-post-content ul ::marker { 121 color: #55789f; 58 122 } 59 123 .docs-post-content ol { 60 124 list-style-type: decimal; 61 line-height: 1.5; 62 } 63 .docs-post-content ol li { 64 margin-bottom: 0.5em; 65 } 66 .docs-post-content ul { 67 list-style-type: disc; 68 line-height: 1.5; 69 } 70 .docs-post-content ul li { 71 margin-bottom: 0.5em; 72 } 73 .docs-post-content ol ol, .docs-post-content ul ul, .docs-post-content ol ul, .docs-post-content ul ol { 74 margin-top: 0.5em; 75 margin-bottom: 0.5em; 76 } 77 .docs-post-content ul.custom-bullets { 78 list-style-type: none; /* Remove default bullets */ 79 padding-left: 0; /* Align with parent */ 80 } 81 .docs-post-content ul.custom-bullets li::before { 82 content: "•"; /* Custom bullet character */ 83 color: #007BFF; /* Blue bullet color */ 84 font-size: 1.2em; 85 display: inline-block; 86 width: 1em; 87 margin-left: -1em; 88 } 89 .docs-post-content p { 90 margin: 0 0 1.5rem; 125 } 126 .docs-post-content ol ::marker { 127 color: #49668a; 128 font-weight: 600; 129 } 130 .docs-post-content ul ul { 131 list-style-type: circle; 132 } 133 .docs-post-content ul ul ul { 134 list-style-type: square; 135 } 136 .docs-post-content li > ul, 137 .docs-post-content li > ol { 138 margin-top: 0.45rem; 139 margin-bottom: 0.2rem; 91 140 } 92 141 .docs-post-content hr { 142 background: linear-gradient(90deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.6), rgba(148, 163, 184, 0.1)); 143 border: 0; 144 height: 1px; 145 margin: 2rem 0; 93 146 overflow: visible; 94 height: 1px; 95 margin-bottom: 1.5rem; 147 } 148 .docs-post-content img { 149 border: 1px solid var(--docs-border); 150 border-radius: 12px; 151 height: auto; 152 max-width: 100%; 153 } 154 .docs-post-content figure { 155 margin-left: 0; 156 margin-right: 0; 157 } 158 .docs-post-content figcaption, 159 .docs-post-content .wp-caption-text { 160 color: var(--docs-muted); 161 font-size: 0.88rem; 162 margin-top: 0.45rem; 163 text-align: center; 164 } 165 .docs-post-content .wp-caption { 166 margin: 0 0 1.35rem; 167 max-width: 100%; 168 } 169 .docs-post-content blockquote { 170 background: linear-gradient(180deg, #f8fbff, #f3f8ff); 171 border: 1px solid var(--docs-border); 172 border-left: 4px solid var(--docs-quote-accent); 173 border-radius: 0 12px 12px 0; 174 color: #334155; 175 margin: 1.65rem 0; 176 padding: 0.95rem 1.1rem 0.95rem 1rem; 177 } 178 .docs-post-content blockquote p:last-child { 179 margin-bottom: 0; 180 } 181 .docs-post-content blockquote cite { 182 color: var(--docs-muted); 183 display: block; 184 font-size: 0.86rem; 185 font-style: normal; 186 font-weight: 600; 187 margin-top: 0.6rem; 188 } 189 .docs-post-content code, 190 .docs-post-content kbd, 191 .docs-post-content samp { 192 background: var(--docs-code-bg); 193 border: 1px solid var(--docs-code-border); 194 border-radius: 6px; 195 color: #112237; 196 font-family: "Andale Mono", AndaleMono, "Lucida Console", monospace; 197 font-size: 0.84em; 198 padding: 0.14em 0.38em; 199 } 200 .docs-post-content kbd { 201 border-bottom-width: 2px; 202 box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.14); 203 font-weight: 700; 204 } 205 .docs-post-content pre { 206 background: var(--docs-pre-bg); 207 border: 1px solid var(--docs-pre-border); 208 border-radius: 12px; 209 color: var(--docs-pre-text); 210 font-family: "Andale Mono", AndaleMono, "Lucida Console", monospace; 211 font-size: 0.88rem; 212 line-height: 1.72; 213 margin: 0 0 1.35rem; 214 max-width: 100%; 215 overflow: auto; 216 padding: 1em 1.15em; 217 white-space: pre; 218 } 219 .docs-post-content pre code { 220 background: transparent; 96 221 border: 0; 97 background-color: #E6E6E6; 98 } 99 .docs-post-content figure { 222 color: inherit; 223 font-size: inherit; 224 padding: 0; 225 } 226 .docs-post-content table { 227 border: 1px solid var(--docs-border-strong); 228 border-collapse: separate; 229 border-radius: 12px; 230 border-spacing: 0; 231 display: block; 232 overflow-x: auto; 233 width: 100%; 234 } 235 .docs-post-content table thead th { 236 background: #f5f9ff; 237 color: var(--docs-heading); 238 font-weight: 700; 239 letter-spacing: 0.01em; 240 position: sticky; 241 top: 0; 242 z-index: 1; 243 } 244 .docs-post-content table th, 245 .docs-post-content table td { 246 border-bottom: 1px solid var(--docs-border); 247 min-width: 120px; 248 padding: 0.62em 0.84em; 249 text-align: left; 250 vertical-align: top; 251 white-space: normal; 252 } 253 .docs-post-content table tbody tr:nth-child(even) { 254 background: var(--docs-surface); 255 } 256 .docs-post-content table tbody tr:hover { 257 background: var(--docs-surface-alt); 258 } 259 .docs-post-content table tr:last-child td { 260 border-bottom: 0; 261 } 262 .docs-post-content dl { 263 border: 1px solid var(--docs-border); 264 border-radius: 10px; 265 overflow: hidden; 266 } 267 .docs-post-content dl dt, 268 .docs-post-content dl dd { 100 269 margin: 0; 101 } 102 .docs-post-content code, 103 .docs-post-content pre { 104 font-family: inherit; 105 font-size: 0.8865rem; 106 line-height: 1.6920473773; 107 } 108 .docs-post-content pre { 109 background-color: inherit; 110 color: inherit; 111 margin: 0 0 1.5rem; 112 max-width: 100%; 113 overflow: auto; 114 padding: 1.5em; 115 white-space: pre; 116 white-space: pre-wrap; 117 word-wrap: break-word; 118 } 119 .docs-post-content code { 120 background-color: inherit; 121 color: inherit; 122 padding: 0.125em 0.25em; 123 } 124 .docs-post-content table { 125 font-size: 0.8865rem; 126 line-height: 1.6920473773; 270 padding: 0.68rem 0.85rem; 271 } 272 .docs-post-content dl dt { 273 background: #f8fbff; 274 color: var(--docs-heading); 275 font-weight: 700; 276 } 277 .docs-post-content dl dd + dt { 278 border-top: 1px solid var(--docs-border); 279 } 280 .docs-post-content abbr[title] { 281 cursor: help; 282 text-decoration: underline dotted; 283 text-decoration-thickness: 0.08em; 284 } 285 .docs-post-content mark { 286 background: #fef3c7; 287 border-radius: 3px; 288 color: #2f2200; 289 padding: 0.05em 0.2em; 290 } 291 .docs-post-content sub, 292 .docs-post-content sup { 293 font-size: 0.75em; 294 line-height: 0; 295 position: relative; 296 vertical-align: baseline; 297 } 298 .docs-post-content sup { 299 top: -0.45em; 300 } 301 .docs-post-content sub { 302 bottom: -0.2em; 303 } 304 .docs-post-content details { 305 background: #f8fbff; 306 border: 1px solid var(--docs-border); 307 border-radius: 10px; 127 308 overflow: hidden; 128 border-spacing: 0; 129 border-collapse: separate; 309 } 310 .docs-post-content details summary { 311 cursor: pointer; 312 color: var(--docs-heading); 313 font-weight: 600; 314 padding: 0.72rem 0.88rem; 315 } 316 .docs-post-content details > *:not(summary) { 317 margin: 0; 318 padding: 0.25rem 0.88rem 0.85rem; 319 } 320 .docs-post-content embed, 321 .docs-post-content object, 322 .docs-post-content iframe, 323 .docs-post-content video { 324 background: #000; 325 border: 0; 326 border-radius: 0; 327 display: block; 328 margin-bottom: 1.35rem; 329 max-width: 100%; 130 330 width: 100%; 131 margin-bottom: 1.5rem; 132 border: 1px solid #E6E6E6; 133 border-radius: 8px; 134 } 135 .docs-post-content table td, 136 .docs-post-content table th { 137 padding: 0.5em 1em; 138 text-align: left; 139 } 140 .docs-post-content table tr { 141 background-color: transparent; 142 } 143 .docs-post-content table tr:nth-of-type(2n) { 144 background-color: rgba(218, 202, 251, 0.2); 145 } 146 .docs-post-content p:empty { 147 margin: 0; 148 padding: 0; 149 line-height: 0; 150 } 151 .docs-post-content blockquote { 152 font-size: 1rem; 153 margin: 30px auto; 154 color: #555555; 155 padding: 1.2em 30px 1.2em 45px; 156 line-height: 1.6; 157 position: relative; 158 } 159 .docs-post-content blockquote::before { 160 font-family: Arial; 161 content: "“"; 162 color: inherit; 163 font-size: 4em; 164 position: absolute; 165 left: 10px; 166 top: -10px; 167 } 168 .docs-post-content blockquote::after { 169 content: ""; 170 } 171 .docs-post-content blockquote cite { 172 display: block; 173 color: #333333; 174 font-style: normal; 175 font-weight: bold; 176 margin-top: 1em; 177 } 178 @media only screen and (min-width: 1024px){ 179 .docs-post-content h1 { 180 font-size: 2.25rem; 181 line-height: 1.2; 182 } 183 } 331 } 332 .docs-post-content .wp-block-embed, 333 .docs-post-content .wp-block-embed__wrapper { 334 max-width: 100%; 335 } 336 .docs-post-content iframe[src*="youtube.com"], 337 .docs-post-content iframe[src*="youtu.be"], 338 .docs-post-content iframe[src*="vimeo.com"], 339 .docs-post-content .wp-block-embed-youtube iframe, 340 .docs-post-content .wp-block-embed-vimeo iframe { 341 aspect-ratio: 16/9; 342 box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14); 343 height: auto; 344 } 345 .docs-post-content table, 346 .docs-post-content pre, 347 .docs-post-content blockquote, 348 .docs-post-content details, 349 .docs-post-content img, 350 .docs-post-content iframe, 351 .docs-post-content video { 352 box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); 353 } 354 355 /*# sourceMappingURL=editor-styles.css.map */ -
easy-docs/trunk/admin/inc/class-admin-page.php
r3240911 r3475230 221 221 'shortcode' => esc_html__( 'Display Shortcode', 'easy-docs' ), 222 222 'select_doc' => esc_html__( 'Select a Doc to Insert', 'easy-docs' ), 223 'search_docs' => esc_html__( 'Search Docs', 'easy-docs' ) 223 'search_docs' => esc_html__( 'Search Docs', 'easy-docs' ), 224 'unsaved_close' => esc_html__( 'There are unsaved changes. Are you sure you want to close this tab?', 'easy-docs' ), 225 'unsaved_leave' => esc_html__( 'You have unsaved changes. Are you sure you want to leave this page?', 'easy-docs' ), 226 'save_failed' => esc_html__( 'Unable to save document. Please try again.', 'easy-docs' ), 227 'load_failed' => esc_html__( 'Unable to load the selected document.', 'easy-docs' ), 228 'delete_project_confirm' => esc_html__( 'Delete this project and all its outlines/documents? This cannot be undone.', 'easy-docs' ), 229 'delete_outline_confirm' => esc_html__( 'Delete this outline and all nested content? This cannot be undone.', 'easy-docs' ), 230 'delete_doc_confirm' => esc_html__( 'Delete this document permanently? This cannot be undone.', 'easy-docs' ) 224 231 ); 225 232 } -
easy-docs/trunk/admin/js/admin.build.js
r3246256 r3475230 1 (()=>{"use strict";const t=class{constructor(){}static get_icon(t,e=""){return'<svg class="icon icon-'.concat(t," ").concat(e,'" aria-hidden="true" role="img" focusable="false"><use href="#icon-').concat(t,'" xlink:href="#icon-').concat(t,'"></use></svg>')}static normalize_html(t){const e=document.createElement("div");return e.innerHTML=t,e.innerHTML.replace(/\s+/g," ").trim()}},e=window.Easy_Docs_Admin_Data||{},s={ajaxUrl:e.ajaxUrl,security:e.security,posts:e.posts,i18n:e.i18n};class i{constructor(t,e=document){this.elements="string"==typeof t?this.get(t,e):[t]} static async sendAjaxRequest(t,e,s=console.error){const i=new URLSearchParams(e);try{const e=await fetch(t,{method:"POST",body:i,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if(!e.ok)throw new Error("Network response was not ok");return await e.json()}catch(t){return s(t.message),null}}static template(t,e){return t.replace(/\{\{(\w+)\}\}/g,((t,s)=>e[s]||""))}static strToHTML(t){const e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}}const o=(t,e=document)=>new i(t,e);Object.getOwnPropertyNames(i).forEach((t=>{"function"==typeof i[t]&&"prototype"!==t&&(o[t]=i[t])}));const c=class{constructor(t){this.contextItem=!1,this.pasteItem=!1,this.pasteContext=!1,this.editor=t,this.outline=document.querySelector("#docs-outline"),this.outline&&(this.actionBtns=document.querySelector("#docs-explorer-actions"),this.addOutlineBtn=document.querySelector("#easy-add-outline"),this.addDocBtn=document.querySelector("#easy-add-doc"),this.insertDocBtn=document.querySelector("#easy-insert-doc"),this.unlinkBtn=document.querySelector("#easy-remove-doc"),this.delBtn=document.querySelector("#easy-delete-doc"),this.collapseBtn=document.querySelector("#easy-collapse-all"),this.menu=document.querySelector("#easy-context-menu"),this.modal=document.querySelector("#docs-overlay"),this.docsInfo=document.querySelector("#docs-info"),this.currentProject=null,this.isModalOpen=!1,this.activeItem=null,this.setup(),this.events())}setup(){this.outline&&this.docsInfo&&this.docsInfo.querySelectorAll(".easy-docs-message").forEach((t=>{t.classList.add("hidden"),(!this.outline.firstElementChild&&t.classList.contains("easy-docs-info-welcome")||this.outline.firstElementChild&&t.classList.contains("easy-docs-info-wb"))&&t.classList.remove("hidden")}))}events(){const t=this;this.outline&&(this.outline.addEventListener("click",(e=>{if(e.target.classList.contains("docs-input"))return;const s=e.target.closest(".docs-outline-item");s&&!s.classList.contains("new-item")&&(s.classList.contains("docs-post")&&"easydocs-welcome"!==s.textContent?t.unlinkBtn&&(t.unlinkBtn.classList.remove("cursor-not-allowed","text-gray-400"),t.unlinkBtn.classList.add("cursor-pointer","hover:bg-gray-400/20")):t.unlinkBtn&&(t.unlinkBtn.classList.add("cursor-not-allowed","text-gray-400"),t.unlinkBtn.classList.remove("cursor-pointer","hover:bg-gray-400/20")),e.preventDefault(),e.stopPropagation(),t.activateListItem(s),t.updateCurrentProject(s))})),this.outline.addEventListener("contextmenu",(t=>{const e=t.target.closest(".docs-outline-item"),s=!!this.menu&&this.menu.querySelector(".paste-inside"),i=!!this.menu&&this.menu.querySelector(".unlink-doc");e&&(e.classList.contains("docs-post")&&"easydocs-welcome"!==e.textContent?(s&&s.classList.add("hidden"),i&&(i.classList.remove("cursor-not-allowed","text-gray-400"),i.classList.add("cursor-pointer","hover:bg-gray-200"))):(s&&s.classList.remove("hidden"),i&&(i.classList.add("cursor-not-allowed","text-gray-400"),i.classList.remove("cursor-pointer","hover:bg-gray-200"))),t.preventDefault(),this.contextItem=e,this.menu&&(this.menu.style.display="block",this.menu.style.left=t.clientX+"px",this.menu.style.top=t.clientY+"px"))})),this.docsInfo&&this.docsInfo.querySelector(".easy-docs-shortcopy").addEventListener("click",(e=>{e.preventDefault();const s=t.docsInfo.querySelector(".easy-docs-shortcode").textContent;s&&navigator.clipboard.writeText(s).then((()=>{const t=this.docsInfo.querySelector("#copy-indicator");t&&(t.classList.remove("hidden"),setTimeout((()=>{t.classList.add("hidden")}),1e3))})).catch((t=>{console.error("Failed to copy text: ",t)}))})),document.addEventListener("click",(function(e){const s=e.target;t.menu&&s!==t.menu&&!t.menu.contains(s)&&(t.menu.style.display="none",t.contextItem=!1,!t.activeItem||s===t.outline||t.outline.contains(s)||s===t.actionBtns||t.actionBtns.contains(s)||(t.activeItem.classList.remove("active-item"),t.activeItem.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10"))),t.activeItem=null))})),this.menu&&this.menu.addEventListener("click",(function(e){const s=e.target;if("LI"!==s.nodeName)return void(t.contextItem=!1);if(!t.contextItem)return;const i=s.getAttribute("data-attr");t.menu.style.display="none","delete"===i?t.deleteOutlineItem(t.contextItem):"create-doc"===i?t.addOutlineItem("post",t.contextItem):"insert-doc"===i?t.showDocsList(t.contextItem):"unlink-doc"===i?t.unlinkDocument(t.contextItem):"create-outline"===i?t.addOutlineItem("folder",t.contextItem):"rename"===i?t.renameOutlineItem(t.contextItem):"cut"===i?t.cutcopyOutlineItem(t.contextItem,"cut"):"copy"===i?t.cutcopyOutlineItem(t.contextItem,"copy"):"paste-before"===i?t.pasteOutlineItem(t.contextItem,"insert_before"):"paste-after"===i?t.pasteOutlineItem(t.contextItem,"insert_after"):"paste-inside"===i&&t.pasteOutlineItem(t.contextItem,"inside")})),this.addOutlineBtn&&this.addOutlineBtn.addEventListener("click",(()=>{this.addOutlineItem("folder")})),this.addDocBtn&&this.addDocBtn.addEventListener("click",(()=>{this.addOutlineItem("post")})),this.insertDocBtn&&this.insertDocBtn.addEventListener("click",(()=>{this.showDocsList()})),this.unlinkBtn&&this.unlinkBtn.addEventListener("click",(()=>{this.unlinkDocument()})),this.delBtn&&this.delBtn.addEventListener("click",(()=>{this.deleteOutlineItem()})),this.collapseBtn&&this.collapseBtn.addEventListener("click",(()=>{this.collapseAll()})),this.modal&&(this.modal.addEventListener("click",(t=>{this.isModalOpen&&!t.target.closest(".easy-docs-modal-content")&&this.toggleModal()})),this.modal.addEventListener("keydown",(t=>{"Escape"===t.key&&this.toggleModal()}))))}updateCurrentProject(t){if(this.currentProject&&(this.currentProject===t||this.currentProject.contains(t)))return;let e=t.closest(".docs-outline-item");for(;e&&e.parentElement!==this.outline;)e=e.parentElement;e&&e.classList.contains("docs-folder")?this.currentProject=e:this.currentProject=null;const s=this.currentProject?this.currentProject.querySelector(".docs-outline-label"):null,i=s?s.textContent.trim():"",o=i?i.toLowerCase().replace(/[^a-z0-9]+/g,""):"";this.showMessage(i,o)}showMessage(t,e){t?this.docsInfo&&this.docsInfo.querySelectorAll(".easy-docs-message").forEach((t=>{if(t.classList.contains("easy-docs-info-project")){t.classList.remove("hidden");const i=s.i18n;t.querySelector("span").innerHTML="".concat(i.shortcode,': <strong class="easy-docs-shortcode">[easydocs doc="').concat(e,'"]</strong>')}else t.classList.add("hidden")})):this.docsInfo&&this.docsInfo.querySelectorAll(".easy-docs-message").forEach((t=>{t.classList.contains("easy-docs-info-wb")?t.classList.remove("hidden"):t.classList.add("hidden")}))}showDocsList(t=!1){if(this.toggleModal(),!this.isModalOpen)return;const e=s.posts,i=s.i18n,o=Object.keys(e),c=this.modal.querySelector(".easy-docs-modal-content");if(0===o.length)return void(c.innerHTML="No posts found");const n='<p class="mb-2 font-bold text-base">'.concat(i.select_doc,'</p>\n\t\t<div class="mb-1"><input type="text" class="easy-docs-modal-search w-full !border-gray-300" placeholder="').concat(i.search_docs,'..."></div>\n\t\t<ul class="easy-docs-all-docs border border-gray-300 rounded">\n\t\t\t').concat(o.map((t=>{const s=e[t];return s&&"easydocs-welcome"!==s.title?'<li class="mb-0" data-term="'.concat(s.title.toLowerCase(),'"><a class="easy-select-doc block max-w-full px-2 py-1 border-b border-gray-300" href="#" data-postid=').concat(s.id,">").concat(s.title,"</a></li>"):""})).join(""),"\n\t\t</ul>");c.innerHTML=n,c.querySelector(".easy-docs-modal-search").focus();const a=c.querySelector(".easy-docs-modal-search"),r=c.querySelector(".easy-docs-all-docs");["keyup","paste"].forEach((t=>{a.addEventListener(t,(t=>{const e=t.target.value.toLowerCase();r.querySelectorAll("li").forEach((t=>{const s=t.getAttribute("data-term");!e||s.includes(e)?t.style.display="block":t.style.display="none"}))}))})),r.addEventListener("click",(e=>{e.target.classList.contains("easy-select-doc")&&(e.preventDefault(),this.insertDoc(e.target.dataset.postid,e.target.textContent,t))}))}insertDoc(e,s,i){this.toggleModal(),i||(i=this.outline.querySelector(".active-item"));const o=i?i.closest(".docs-folder"):null;let c=o?o.querySelector("ul"):null;if(c||(c=this.outline),i&&i.classList.contains("docs-folder")){const t=i.querySelector("ul");if(t){t.classList.remove("hidden");const e=i.querySelector(".icon-right");e&&e.classList.add("rotate-90")}}const n=o?o.querySelector("span.truncate"):null;let a=n?n.className.match(/pl-\d+/):null,r="pl-4";if(a){let t=parseInt(a[0].replace("pl-",""));r="pl-".concat(t+2)}let l="";const d=document.createElement("li");d.classList.add("docs-outline-item","docs-post","mb-0","hover:cursor-pointer","new-item"),d.setAttribute("data-id",e),l='<span class="mr-1 text-slate-400">'.concat(t.get_icon("file-text")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>"),d.innerHTML='\n\t\t\t<span class="block hover:bg-gray-300">\n\t\t\t\t<span class="block truncate py-1 text-sm pr-2 '.concat(r,'">\n\t\t\t\t\t').concat(l,'<span class="docs-outline-label">').concat(s,"</span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t"),c.classList.remove("hidden"),c.appendChild(d),d.classList.remove("new-item"),this.updateOutline(d)}toggleModal(){if(this.modal)if(this.modal.classList.contains("hidden"))this.modal.classList.remove("hidden"),this.isModalOpen=!0;else{const t=this.modal.querySelector(".easy-docs-modal-content");this.modal.classList.add("hidden"),this.isModalOpen=!1,t&&(t.innerHTML="")}}addOutlineItem(e,s=!1){s||(s=this.outline.querySelector(".active-item"));const i=s?s.closest(".docs-folder"):null;let o=i?i.querySelector("ul"):null;if(o||(o=this.outline),s&&s.classList.contains("docs-folder")){const t=s.querySelector("ul");if(t){t.classList.remove("hidden");const e=s.querySelector(".icon-right");e&&e.classList.add("rotate-90")}}const c=i?i.querySelector("span.truncate"):null;let n=c?c.className.match(/pl-\d+/):null,a="pl-4";if(n){let t=parseInt(n[0].replace("pl-",""));a="pl-".concat(t+2)}let r="",l="";const d="folder"===e?"docs-folder":"docs-post",u=document.createElement("li");u.classList.add("docs-outline-item",d,"mb-0","hover:cursor-pointer","new-item"),"folder"===e?(r='<span class="mr-1 text-slate-600">'.concat(t.get_icon("right")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>"),l='<ul class="hidden"></ul>'):"post"===e&&(r='<span class="mr-1 text-slate-400">'.concat(t.get_icon("file-text")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>")),u.innerHTML='\n\t\t\t<span class="block hover:bg-gray-300" href="#">\n\t\t\t\t<span class="block truncate py-1 text-sm pr-2 '.concat(a,'">\n\t\t\t\t\t').concat(r,'<input type="text" class="docs-input w-full text-slate-600 box-border" style="width: calc( 100% - 16px - 0.25rem );">\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t').concat(l,"\n\t\t\t"),o.classList.remove("hidden"),o.appendChild(u);const h=u.querySelector(".docs-input");h.focus(),h.addEventListener("blur",(()=>{this.handleFolderInput(u)}));const m=t=>{"Enter"===t.key||"Tab"===t.key?(u.classList.remove("new-item"),u.removeEventListener("keydown",m),this.handleFolderInput(u)):"Escape"===t.key&&u.remove()};u.addEventListener("keydown",m)}renameOutlineItem(t){if(!t)return;const e=t.querySelector(".docs-outline-label");if(!e)return;const s=e.textContent.trim();e.innerHTML='<input type="text" class="docs-input w-full text-slate-600 box-border" style="width: calc( 100% - 16px - 0.25rem );" value="'.concat(s,'">');const i=e.querySelector(".docs-input");i.focus(),i.addEventListener("blur",(()=>{e.innerHTML="".concat(s)})),i.addEventListener("keydown",(i=>{"Enter"===i.key||"Tab"===i.key?this.handleRenameInput(t,s):"Escape"===i.key&&(e.innerHTML="".concat(s))}))}unlinkDocument(t=!1){t||(t=this.outline.querySelector(".active-item")),t&&t.classList.contains("docs-post")&&(t.remove(),this.updateOutline())}deleteOutlineItem(t=!1){if(t||(t=this.outline.querySelector(".active-item")),t){let e=[];const s=this.currentProject&&this.currentProject===t;t.classList.contains("docs-post")?e=[t.getAttribute("data-id")]:t.querySelectorAll(".docs-post").forEach((t=>{e.push(t.getAttribute("data-id"))})),t.remove(),e.length>0?this.deletePost(e):this.updateOutline(),s&&(this.currentProject=null,this.setup())}}collapseAll(){const t=this.outline.querySelector(".active-item");t&&(t.classList.remove("active-item"),t.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),this.outline.querySelectorAll("ul").forEach((t=>{t.classList.add("hidden")})),this.outline.querySelectorAll(".rotate-90").forEach((t=>{t.classList.remove("rotate-90")}))}activateListItem(t){this.activeItem=t;const e=t.querySelector("span");if(e){const s=this.outline.querySelector(".active-item");s&&(s.classList.remove("active-item"),s.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),t.classList.add("active-item"),e.classList.add("bg-lime-700/10")}const s=t.querySelector("ul");if(s){const e=t.querySelector(".icon-right");e&&e.classList.toggle("rotate-90"),s.classList.toggle("hidden")}}cutcopyOutlineItem(t,e){this.pasteItem&&(this.pasteItem.classList.remove("text-gray-400"),this.pasteItem=!1),t&&(this.pasteContext=e,this.pasteItem=t,this.menu.querySelectorAll(".cutcopy-context").forEach((t=>{t.classList.remove("cursor-not-allowed","text-gray-400"),t.classList.add("cursor-pointer","hover:bg-gray-200","paste-context")})),"cut"===e&&t.classList.add("text-gray-400"))}pasteOutlineItem(t,e){if(!t||!this.pasteContext||!this.pasteItem)return;this.pasteItem.classList.remove("text-gray-400"),"copy"===this.pasteContext&&(this.pasteItem=this.pasteItem.cloneNode(!0));const s=t.querySelector(".block.truncate");let i=4;if(s){const t=s.className.match(/pl-\d+/);t&&(i=parseInt(t[0].replace("pl-","")))}"insert_before"===e?(this.adjustPadding(this.pasteItem,i),t.parentNode.insertBefore(this.pasteItem,t)):"insert_after"===e?(this.adjustPadding(this.pasteItem,i),t.nextSibling?t.parentNode.insertBefore(this.pasteItem,t.nextSibling):t.parentNode.appendChild(this.pasteItem)):"inside"===e&&(this.adjustPadding(this.pasteItem,i+2),t.querySelector("ul").appendChild(this.pasteItem)),"cut"===this.pasteContext&&(this.pasteContext=!1,this.pasteItem=!1,this.menu.querySelectorAll(".paste-context").forEach((t=>{t.classList.add("cursor-not-allowed","text-gray-400"),t.classList.remove("cursor-pointer","hover:bg-gray-200","paste-context")}))),this.updateOutline()}parseOutlineList(t){const e={};let s=0;return t.querySelectorAll(":scope > li").forEach((t=>{const i=t.querySelector("span:first-of-type"),o=i?i.textContent.trim():"",c=t.querySelector("ul");if(c)e[o]=this.parseOutlineList(c);else{const i=parseInt(t.getAttribute("data-id"),10);e["EasyDocs_"+s]=i,s++}})),e}async handleFolderInput(e){const s=e.querySelector(".docs-input"),i=s.value.trim();if(i)if(s.outerHTML='<span class="docs-outline-label">'.concat(i,"</span>"),e.classList.contains("docs-folder")){if(await this.updateOutline(e),e.parentElement&&"docs-outline"===e.parentElement.id){const s=e.querySelector("ul");if(s){s.classList.remove("hidden");const i=e.querySelector(".icon-right");i&&i.classList.add("rotate-90");const o=document.createElement("li");o.classList.add("docs-outline-item","docs-post","mb-0","hover:cursor-pointer","new-item");const c='<span class="mr-1 text-slate-400">'.concat(t.get_icon("file-text")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>");o.innerHTML='\n\t\t\t\t\t\t\t<span class="block hover:bg-gray-300">\n\t\t\t\t\t\t\t\t<span class="block truncate py-1 text-sm pr-2 pl-6">\n\t\t\t\t\t\t\t\t\t'.concat(c,"<span>easydocs-welcome</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t"),s.classList.remove("hidden"),s.appendChild(o),o.classList.remove("new-item"),this.createNewDocument(o,"easydocs-welcome")}}}else e.classList.contains("docs-post")&&this.createNewDocument(e,i);else e.remove()}handleRenameInput(t,e){const s=t.querySelector(".docs-input").value.trim();s&&s!==e?(t.querySelector(".docs-outline-label").innerHTML="".concat(s),t.classList.contains("docs-folder")?this.updateOutline(t):t.classList.contains("docs-post")&&this.renameDocument(t,s)):t.querySelector(".docs-outline-label").innerHTML="".concat(e)}adjustPadding(t,e){const s=t.querySelector(".block.truncate");if(s){const t=s.className.match(/pl-\d+/);t&&(s.classList.remove(t[0]),s.classList.add("pl-".concat(e)))}const i=t.querySelector("ul");i&&i.querySelectorAll(":scope > li").forEach((t=>{this.adjustPadding(t,e+2)}))}async updateOutline(t=!1){const e=this.parseOutlineList(this.outline),i={action:"easy_docs_update_outline",security:s.security,outline:JSON.stringify(e)};this.addDocBtn.disabled=!0,this.insertDocBtn.disabled=!0,this.addOutlineBtn.disabled=!0,this.delBtn.disabled=!0,t&&(t.classList.contains("docs-folder")&&t.querySelector(".icon-right").classList.add("easyhide"),t.querySelector(".icon-loading").classList.remove("easyhide")),(await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this))).success?(this.addDocBtn.disabled=!1,this.insertDocBtn.disabled=!1,this.addOutlineBtn.disabled=!1,this.delBtn.disabled=!1,t&&(t.classList.contains("docs-folder")?t.querySelector(".icon-right").classList.remove("easyhide"):t.classList.contains("docs-post")&&t.querySelector(".icon-file-text").classList.remove("easyhide"),t.querySelector(".icon-loading").classList.add("easyhide"))):(this.addDocBtn.disabled=!1,this.insertDocBtn.disabled=!1,this.addOutlineBtn.disabled=!1,this.delBtn.disabled=!1,t&&t.remove())}async createNewDocument(t,e){if(!t||!e)return;const i={action:"easy_docs_create_document",security:s.security,postTitle:e};this.addDocBtn.disabled=!0,this.insertDocBtn.disabled=!0,this.addOutlineBtn.disabled=!0,t.querySelector(".icon-file-text").classList.add("easyhide"),t.querySelector(".icon-loading").classList.remove("easyhide");const c=await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this));if(c.success){const e=c.data.id;t.setAttribute("data-id",e),this.updateOutline(t)}else this.addDocBtn.disabled=!1,this.insertDocBtn.disabled=!1,this.addOutlineBtn.disabled=!1,t.remove()}async renameDocument(t,e){if(!t||!e)return;t.querySelector(".icon-file-text").classList.add("easyhide"),t.querySelector(".icon-loading").classList.remove("easyhide");const i={action:"easy_docs_rename_document",security:s.security,postId:t.getAttribute("data-id"),postTitle:e};(await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this))).success&&this.updateOutline(t)}async deletePost(t){const e={action:"easy_docs_delete_document",security:s.security,postIds:JSON.stringify(t)};(await o.sendAjaxRequest(s.ajaxUrl,e,this.handleError.bind(this))).success&&(this.updateOutline(),t.forEach((t=>{this.editor.closeTab(t,!0)})))}handleError(t){console.log(t)}},n=class{constructor(){this.isFresh=!0,this.activeEditor=!1,this.isInitiated=!1,this.isSettingContent=!1,this.editorData={},this.outline=document.querySelector("#docs-outline"),this.outline&&(this.tabs=document.querySelector("#docs-tabs"),this.tabContent=document.querySelector("#docs-tab-content"),this.saveDocBtn=document.querySelector("#easy-save-doc"),this.events())}events(){const t=this;this.outline&&this.outline.addEventListener("click",(e=>{if(e.target.classList.contains("docs-input"))return;const s=e.target.closest(".docs-outline-item");s&&s.classList.contains("docs-post")&&t.openEditor(s)})),this.tabs&&this.tabs.addEventListener("click",(e=>{if(e.target.closest(".docs-tab-label")){e.preventDefault();const s=e.target.closest(".docs-tab");if(s.classList.contains("active-tab"))return;const i=s.getAttribute("data-id");t.activateEditor(i)}else if(e.target.closest(".docs-tab-close")){e.preventDefault();const s=e.target.closest(".docs-tab").getAttribute("data-id");t.closeTab(s)}})),this.saveDocBtn&&this.saveDocBtn.addEventListener("click",(e=>{t.saveDocument()}))}initiateEditor(){const t=this.tabContent.querySelector(".dpc-welcome"),e=this.tabContent.querySelector(".dpc-editor");t&&e&&(t.classList.add("hidden"),e.classList.remove("sr-only"))}resetEditor(){const t=this.tabContent.querySelector(".dpc-welcome"),e=this.tabContent.querySelector(".dpc-editor");t&&e&&(t.classList.remove("hidden"),e.classList.add("sr-only")),this.isFresh=!0,this.activeEditor=!1}openEditor(t){const e=t.getAttribute("data-id");if(!e)return;const s="docs-tab-".concat(e);s!==this.activeEditor&&(this.tabs&&this.tabs.querySelector("#".concat(s))?this.activateEditor(e):this.createNewTab(e,"easydocs-welcome"===t.textContent.trim()))}activateEditor(t){const e="docs-tab-".concat(t),s=!!this.tabs&&this.tabs.querySelector("#".concat(e)),i=this.editorData?.[e]?.[0]??"";s&&(this.tabs.querySelectorAll(".active-tab").forEach((t=>t.classList.remove("active-tab","bg-gray-100"))),s.classList.add("active-tab","bg-gray-100"),this.activeEditor!==e&&this.modifyEditorContent(t,i))}closeTab(t,e){const s="docs-tab-".concat(t),i=!!this.tabs&&this.tabs.querySelector("#".concat(s));if(i){if(this.editorData[s][1]&&!e&&!confirm("There are unsaved changes. Are you sure you want to close?"))return;if(i.remove(),this.activeEditor===s){const t=!!this.tabs&&this.tabs.querySelector(".docs-tab");t?this.activateEditor(t.getAttribute("data-id")):this.resetEditor()}}}async createNewTab(e,i){const c={action:"easy_docs_get_document",security:s.security,postId:e},n=await o.sendAjaxRequest(s.ajaxUrl,c,this.handleError.bind(this));if(!n.success||!n.data)return;const a=n.data.title;let r=n.data.content;if(r)r=t.normalize_html(r);else if(i){const t=s.i18n;r="<h3>".concat(t.welcome[0],"</h3><p>").concat(t.welcome[1],"</p><p><b><i>").concat(t.welcome[2],"</i></b></p><p>").concat(t.welcome[3],"</p>")}const l=document.createElement("div");if(l.id="docs-tab-".concat(e),l.setAttribute("data-id",e),l.classList.add("docs-tab","flex","items-center","m-1","mr-0","cursor-pointer","min-w-32","max-w-52","justify-between"),l.innerHTML='<a href="#" class="docs-tab-label text-gray-500 text-sm truncate px-4 py-2">'.concat(a,'</a><a href="#" class="docs-tab-close px-4 py-2 text-gray-500 hover:text-red-400">').concat(t.get_icon("close","tab-close"),"</a>"),this.tabs&&(this.tabs.appendChild(l),this.editorData["docs-tab-".concat(e)]=[r,!1],this.modifyEditorContent(e,r),this.activateEditor(e),this.isFresh&&(this.initiateEditor(),this.isFresh=!1),!this.isInitiated)){const t=tinymce.get("docs-post-content");t&&(t.on("change",(()=>{this.isSettingContent||(this.editorData[this.activeEditor][1]=!0)})),this.isInitiated=!0)}}async saveDocument(){const{content:t,isDirty:e}=this.editorData[this.activeEditor],i="docs-post-content",c=this.tabContent.querySelector("#".concat(i));if(!c)return;let n="";if("text"==(null===c.offsetParent?"visual":"text"))n=c.value;else{const t=tinymce.get(i);if(!t)return;n=t.getContent()}const a=this.activeEditor.replace("docs-tab-","");if(n===t)return;this.saveDocBtn.disabled=!0;const r={action:"easy_docs_update_document",security:s.security,postId:a,content:n};(await o.sendAjaxRequest(s.ajaxUrl,r,this.handleError.bind(this))).success&&(this.saveDocBtn.disabled=!1,this.editorData[this.activeEditor][0]=n,this.editorData[this.activeEditor][1]=!1)}modifyEditorContent(t,e){const s="docs-post-content",i=document.getElementById(s),o=tinymce.get(s),c=null!==i.offsetParent;if(this.activeEditor&&tinymce.activeEditor&&this.editorData[this.activeEditor][1])if(c){const t=i.value;this.editorData[this.activeEditor]=[t,!0]}else{o.save();const t=o.getContent();this.editorData[this.activeEditor]=[t,!0]}this.isSettingContent=!0,c?i.value=e:o.setContent(e),this.isSettingContent=!1,this.activeEditor="docs-tab-".concat(t)}handleError(t){console.log(t)}},a=class{constructor(){this.outline=document.querySelector("#docs-stats-filter-outline"),this.outline&&(this.table=document.querySelector("#easydocs-stats-table"),this.collapseBtn=document.querySelector("#easy-collapse-all"),this.activeItem=null,this.events())}events(){const t=this;this.outline.addEventListener("click",(e=>{const s=e.target.closest(".docs-outline-item");s&&(e.preventDefault(),e.stopPropagation(),t.activateListItem(s),t.filterList(s))})),this.collapseBtn&&this.collapseBtn.addEventListener("click",(()=>{this.collapseAll()})),this.table&&this.table.querySelectorAll(".easydocs-table-sort").forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-column");this.sortTable(e)}))}))}collapseAll(){const t=this.outline.querySelector(".active-item");t&&(t.classList.remove("active-item"),t.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),this.outline.querySelectorAll("ul").forEach((t=>{t.classList.add("hidden")})),this.outline.querySelectorAll(".rotate-90").forEach((t=>{t.classList.remove("rotate-90")})),this.table.querySelectorAll(".easydocs-stats-items tr").forEach((t=>{t.classList.remove("hidden")}))}activateListItem(t){this.activeItem=t;const e=t.querySelector("span");if(e){const s=this.outline.querySelector(".active-item");s&&(s.classList.remove("active-item"),s.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),t.classList.add("active-item"),e.classList.add("bg-lime-700/10")}const s=t.querySelector("ul");if(s){const e=t.querySelector(".icon-right");e&&e.classList.toggle("rotate-90"),s.classList.toggle("hidden")}}filterList(t){let e=t.getAttribute("data_ids");e=e.split(","),e.length>0?this.table.querySelectorAll(".easydocs-stats-items tr").forEach((t=>{const s=t.getAttribute("data-id");e.indexOf(s)>-1?t.classList.remove("hidden"):t.classList.add("hidden")})):this.table.querySelectorAll(".easydocs-stats-items tr").forEach((t=>{t.classList.add("hidden")}))}sortTable(t){t=parseInt(t);const e=this.table.querySelector("tbody"),s=Array.from(e.querySelectorAll("tr")),i="desc"===this.table.dataset.sortOrder?"asc":"desc";this.table.dataset.sortOrder=i,s.sort(((e,s)=>{const o=e.querySelector("td:nth-child(".concat(t,")")).textContent.trim(),c=s.querySelector("td:nth-child(".concat(t,")")).textContent.trim();return 2!==t&&3!==t&&4!==t||isNaN(parseFloat(o))||isNaN(parseFloat(c))?(console.log(t),"asc"===i?o.localeCompare(c):c.localeCompare(o)):function(t,e){const s=parseFloat(t),o=parseFloat(e);return"asc"===i?s-o:o-s}(o,c)})),s.forEach((t=>e.appendChild(t)))}handleError(t){console.log(t)}},r=class{constructor(){this.settings=document.querySelector("#easydocs-settings"),this.settings&&(this.form=this.settings.querySelector("#easydocs-admin-settings"),this.submit=this.settings.querySelector("#easydocs-admin-settings_save"),this.events())}events(){this.submit&&this.submit.addEventListener("click",(t=>{const e=this.form.querySelectorAll(".easydocs-option"),s={};e.forEach((t=>{let e;const i=t.querySelector("input, select"),o=t.getAttribute("data-setting");o&&i&&(e="checkbox"===i.type?i.checked?"yes":"no":i.value,s[o]=e)})),this.submit.disabled=!0,this.sendSettings(s)}))}async sendSettings(t){const e={action:"easy_docs_update_settings",security:s.security,settings:JSON.stringify(t)},i=await o.sendAjaxRequest(s.ajaxUrl,e,this.handleError.bind(this));this.submit.disabled=!1,i.success&&location.reload()}handleError(t){console.log(t)}};document.addEventListener("DOMContentLoaded",(()=>{const t=new n;new c(t),new a,new r}))})();1 (()=>{"use strict";const t=class{constructor(){}static get_icon(t,e=""){return'<svg class="icon icon-'.concat(t," ").concat(e,'" aria-hidden="true" role="img" focusable="false"><use href="#icon-').concat(t,'" xlink:href="#icon-').concat(t,'"></use></svg>')}static normalize_html(t){const e=document.createElement("div");return e.innerHTML=t,e.innerHTML.replace(/\s+/g," ").trim()}},e=window.Easy_Docs_Admin_Data||{},s={ajaxUrl:e.ajaxUrl,security:e.security,posts:e.posts,i18n:e.i18n};class i{constructor(t,e=document){this.elements="string"==typeof t?this.get(t,e):[t]}get(t,e=document){return Array.from(e.querySelectorAll(t))}static async sendAjaxRequest(t,e,s=console.error){const i=new URLSearchParams(e);try{const e=await fetch(t,{method:"POST",body:i,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if(!e.ok)throw new Error("Network response was not ok");return await e.json()}catch(t){return s(t.message),null}}static template(t,e){return t.replace(/\{\{(\w+)\}\}/g,((t,s)=>e[s]||""))}static strToHTML(t){const e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}}const o=(t,e=document)=>new i(t,e);Object.getOwnPropertyNames(i).forEach((t=>{"function"==typeof i[t]&&"prototype"!==t&&(o[t]=i[t])}));const n=class{constructor(t){this.contextItem=!1,this.pasteItem=!1,this.pasteContext=!1,this.editor=t,this.outline=document.querySelector("#docs-outline"),this.outline&&(this.actionBtns=document.querySelector("#docs-explorer-actions"),this.addOutlineBtn=document.querySelector("#easy-add-outline"),this.addDocBtn=document.querySelector("#easy-add-doc"),this.insertDocBtn=document.querySelector("#easy-insert-doc"),this.unlinkBtn=document.querySelector("#easy-remove-doc"),this.delBtn=document.querySelector("#easy-delete-doc"),this.collapseBtn=document.querySelector("#easy-collapse-all"),this.menu=document.querySelector("#easy-context-menu"),this.modal=document.querySelector("#docs-overlay"),this.docsInfo=document.querySelector("#docs-info"),this.currentProject=null,this.isModalOpen=!1,this.activeItem=null,this.setup(),this.events())}setup(){this.outline&&this.docsInfo&&this.docsInfo.querySelectorAll(".easy-docs-message").forEach((t=>{t.classList.add("hidden"),(!this.outline.firstElementChild&&t.classList.contains("easy-docs-info-welcome")||this.outline.firstElementChild&&t.classList.contains("easy-docs-info-wb"))&&t.classList.remove("hidden")}))}events(){const t=this;this.outline&&(this.outline.addEventListener("click",(e=>{if(e.target.classList.contains("docs-input"))return;const s=e.target.closest(".docs-outline-item");s&&!s.classList.contains("new-item")&&(s.classList.contains("docs-post")&&"easydocs-welcome"!==s.textContent?t.unlinkBtn&&(t.unlinkBtn.classList.remove("cursor-not-allowed","text-gray-400"),t.unlinkBtn.classList.add("cursor-pointer","hover:bg-gray-400/20")):t.unlinkBtn&&(t.unlinkBtn.classList.add("cursor-not-allowed","text-gray-400"),t.unlinkBtn.classList.remove("cursor-pointer","hover:bg-gray-400/20")),e.preventDefault(),e.stopPropagation(),t.activateListItem(s),t.updateCurrentProject(s))})),this.outline.addEventListener("contextmenu",(t=>{const e=t.target.closest(".docs-outline-item"),s=!!this.menu&&this.menu.querySelector(".paste-inside"),i=!!this.menu&&this.menu.querySelector(".unlink-doc");e&&(e.classList.contains("docs-post")&&"easydocs-welcome"!==e.textContent?(s&&s.classList.add("hidden"),i&&(i.classList.remove("cursor-not-allowed","text-gray-400"),i.classList.add("cursor-pointer","hover:bg-gray-200"))):(s&&s.classList.remove("hidden"),i&&(i.classList.add("cursor-not-allowed","text-gray-400"),i.classList.remove("cursor-pointer","hover:bg-gray-200"))),t.preventDefault(),this.contextItem=e,this.menu&&(this.menu.style.display="block",this.menu.style.left=t.clientX+"px",this.menu.style.top=t.clientY+"px"))})),this.docsInfo&&this.docsInfo.querySelector(".easy-docs-shortcopy").addEventListener("click",(e=>{e.preventDefault();const s=t.docsInfo.querySelector(".easy-docs-shortcode");if(!s)return;const i=s.textContent;i&&navigator.clipboard.writeText(i).then((()=>{const t=this.docsInfo.querySelector("#copy-indicator");t&&(t.classList.remove("hidden"),setTimeout((()=>{t.classList.add("hidden")}),1e3))})).catch((t=>{console.error("Failed to copy text: ",t)}))})),document.addEventListener("click",(function(e){const s=e.target;t.menu&&s!==t.menu&&!t.menu.contains(s)&&(t.menu.style.display="none",t.contextItem=!1,!t.activeItem||s===t.outline||t.outline.contains(s)||s===t.actionBtns||t.actionBtns.contains(s)||(t.activeItem.classList.remove("active-item"),t.activeItem.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10"))),t.activeItem=null))})),this.menu&&this.menu.addEventListener("click",(function(e){const s=e.target.closest("li[data-attr]");if(!s)return void(t.contextItem=!1);if(!t.contextItem)return;const i=s.getAttribute("data-attr");t.menu.style.display="none","delete"===i?t.deleteOutlineItem(t.contextItem):"create-doc"===i?t.addOutlineItem("post",t.contextItem):"insert-doc"===i?t.showDocsList(t.contextItem):"unlink-doc"===i?t.unlinkDocument(t.contextItem):"create-outline"===i?t.addOutlineItem("folder",t.contextItem):"rename"===i?t.renameOutlineItem(t.contextItem):"cut"===i?t.cutcopyOutlineItem(t.contextItem,"cut"):"copy"===i?t.cutcopyOutlineItem(t.contextItem,"copy"):"paste-before"===i?t.pasteOutlineItem(t.contextItem,"insert_before"):"paste-after"===i?t.pasteOutlineItem(t.contextItem,"insert_after"):"paste-inside"===i&&t.pasteOutlineItem(t.contextItem,"inside")})),this.addOutlineBtn&&this.addOutlineBtn.addEventListener("click",(()=>{this.addOutlineItem("folder")})),this.addDocBtn&&this.addDocBtn.addEventListener("click",(()=>{this.addOutlineItem("post")})),this.insertDocBtn&&this.insertDocBtn.addEventListener("click",(()=>{this.showDocsList()})),this.unlinkBtn&&this.unlinkBtn.addEventListener("click",(()=>{this.unlinkDocument()})),this.delBtn&&this.delBtn.addEventListener("click",(()=>{this.deleteOutlineItem()})),this.collapseBtn&&this.collapseBtn.addEventListener("click",(()=>{this.collapseAll()})),this.modal&&(this.modal.addEventListener("click",(t=>{this.isModalOpen&&!t.target.closest(".easy-docs-modal-content")&&this.toggleModal()})),this.modal.addEventListener("keydown",(t=>{"Escape"===t.key&&this.toggleModal()}))))}updateCurrentProject(t){if(this.currentProject&&(this.currentProject===t||this.currentProject.contains(t)))return;let e=t.closest(".docs-outline-item");for(;e&&e.parentElement!==this.outline;)e=e.parentElement;e&&e.classList.contains("docs-folder")?this.currentProject=e:this.currentProject=null;const s=this.currentProject?this.currentProject.querySelector(".docs-outline-label"):null,i=s?s.textContent.trim():"",o=i?i.toLowerCase().replace(/[^a-z0-9]+/g,""):"";this.showMessage(i,o)}showMessage(t,e){t?this.docsInfo&&this.docsInfo.querySelectorAll(".easy-docs-message").forEach((t=>{if(t.classList.contains("easy-docs-info-project")){t.classList.remove("hidden");const i=s.i18n;t.querySelector("span").innerHTML="".concat(i.shortcode,': <strong class="easy-docs-shortcode">[easydocs doc="').concat(e,'"]</strong>')}else t.classList.add("hidden")})):this.docsInfo&&this.docsInfo.querySelectorAll(".easy-docs-message").forEach((t=>{t.classList.contains("easy-docs-info-wb")?t.classList.remove("hidden"):t.classList.add("hidden")}))}showDocsList(t=!1){if(this.toggleModal(),!this.isModalOpen)return;const e=s.posts||{},i=s.i18n,o=Object.keys(e),n=this.modal.querySelector(".easy-docs-modal-content");if(0===o.length)return void(n.innerHTML="No posts found");const a='<p class="mb-2 font-bold text-base">'.concat(i.select_doc,'</p>\n\t\t<div class="mb-1"><input type="text" class="easy-docs-modal-search w-full !border-gray-300" placeholder="').concat(i.search_docs,'..."></div>\n\t\t<ul class="easy-docs-all-docs border border-gray-300 rounded">\n\t\t\t').concat(o.map((t=>{const s=e[t];return s&&"easydocs-welcome"!==s.title?'<li class="mb-0" data-term="'.concat(s.title.toLowerCase(),'"><a class="easy-select-doc block max-w-full px-2 py-1 border-b border-gray-300" href="#" data-postid=').concat(s.id,">").concat(s.title,"</a></li>"):""})).join(""),"\n\t\t</ul>");n.innerHTML=a,n.querySelector(".easy-docs-modal-search").focus();const c=n.querySelector(".easy-docs-modal-search"),r=n.querySelector(".easy-docs-all-docs");["keyup","paste"].forEach((t=>{c.addEventListener(t,(t=>{const e=t.target.value.toLowerCase();r.querySelectorAll("li").forEach((t=>{const s=t.getAttribute("data-term");!e||s.includes(e)?t.style.display="block":t.style.display="none"}))}))})),r.addEventListener("click",(e=>{e.target.classList.contains("easy-select-doc")&&(e.preventDefault(),this.insertDoc(e.target.dataset.postid,e.target.textContent,t))}))}insertDoc(e,s,i){this.toggleModal(),i||(i=this.outline.querySelector(".active-item"));const o=i?i.closest(".docs-folder"):null;let n=o?o.querySelector("ul"):null;if(n||(n=this.outline),i&&i.classList.contains("docs-folder")){const t=i.querySelector("ul");if(t){t.classList.remove("hidden");const e=i.querySelector(".icon-right");e&&e.classList.add("rotate-90")}}const a=o?o.querySelector("span.truncate"):null;let c=a?a.className.match(/pl-\d+/):null,r="pl-4";if(c){let t=parseInt(c[0].replace("pl-",""));r="pl-".concat(t+2)}let l="";const d=document.createElement("li");d.classList.add("docs-outline-item","docs-post","mb-0","hover:cursor-pointer","new-item"),d.setAttribute("data-id",e),l='<span class="mr-1 text-slate-400">'.concat(t.get_icon("file-text")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>"),d.innerHTML='\n\t\t\t<span class="block hover:bg-gray-300">\n\t\t\t\t<span class="block truncate py-2 text-sm pr-2 '.concat(r,'">\n\t\t\t\t\t').concat(l,'<span class="docs-outline-label">').concat(s,"</span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t"),n.classList.remove("hidden"),n.appendChild(d),d.classList.remove("new-item"),this.updateOutline(d)}toggleModal(){if(this.modal)if(this.modal.classList.contains("hidden"))this.modal.classList.remove("hidden"),this.isModalOpen=!0;else{const t=this.modal.querySelector(".easy-docs-modal-content");this.modal.classList.add("hidden"),this.isModalOpen=!1,t&&(t.innerHTML="")}}addOutlineItem(e,s=!1){s||(s=this.outline.querySelector(".active-item"));const i=s?s.closest(".docs-folder"):null;let o=i?i.querySelector("ul"):null;if(o||(o=this.outline),s&&s.classList.contains("docs-folder")){const t=s.querySelector("ul");if(t){t.classList.remove("hidden");const e=s.querySelector(".icon-right");e&&e.classList.add("rotate-90")}}const n=i?i.querySelector("span.truncate"):null;let a=n?n.className.match(/pl-\d+/):null,c="pl-4";if(a){let t=parseInt(a[0].replace("pl-",""));c="pl-".concat(t+2)}let r="",l="";const d="folder"===e?"docs-folder":"docs-post",u=document.createElement("li");u.classList.add("docs-outline-item",d,"mb-0","hover:cursor-pointer","new-item"),"folder"===e?(r='<span class="mr-1 text-slate-600">'.concat(t.get_icon("right")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>"),l='<ul class="hidden"></ul>'):"post"===e&&(r='<span class="mr-1 text-slate-400">'.concat(t.get_icon("file-text")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>")),u.innerHTML='\n\t\t\t<span class="block hover:bg-gray-300" href="#">\n\t\t\t\t<span class="block truncate py-2 text-sm pr-2 '.concat(c,'">\n\t\t\t\t\t').concat(r,'<input type="text" class="docs-input w-full text-slate-600 box-border" style="width: calc( 100% - 16px - 0.25rem );">\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t').concat(l,"\n\t\t\t"),o.classList.remove("hidden"),o.appendChild(u);const h=u.querySelector(".docs-input");h.focus(),h.addEventListener("blur",(()=>{this.handleFolderInput(u)}));const m=t=>{"Enter"===t.key||"Tab"===t.key?(u.classList.remove("new-item"),u.removeEventListener("keydown",m),this.handleFolderInput(u)):"Escape"===t.key&&u.remove()};u.addEventListener("keydown",m)}renameOutlineItem(t){if(!t)return;const e=t.querySelector(".docs-outline-label");if(!e)return;const s=e.textContent.trim();e.innerHTML='<input type="text" class="docs-input w-full text-slate-600 box-border" style="width: calc( 100% - 16px - 0.25rem );" value="'.concat(s,'">');const i=e.querySelector(".docs-input");i.focus(),i.addEventListener("blur",(()=>{e.innerHTML="".concat(s)})),i.addEventListener("keydown",(i=>{"Enter"===i.key||"Tab"===i.key?this.handleRenameInput(t,s):"Escape"===i.key&&(e.innerHTML="".concat(s))}))}unlinkDocument(t=!1){t||(t=this.outline.querySelector(".active-item")),t&&t.classList.contains("docs-post")&&(t.remove(),this.updateOutline())}deleteOutlineItem(t=!1){if(t||(t=this.outline.querySelector(".active-item")),t){const e=s.i18n||{},i=t.classList.contains("docs-post"),o=t.classList.contains("docs-folder")&&t.parentElement&&"docs-outline"===t.parentElement.id;let n=e.delete_outline_confirm||"Delete this outline and all nested content? This cannot be undone.";if(i?n=e.delete_doc_confirm||"Delete this document permanently? This cannot be undone.":o&&(n=e.delete_project_confirm||"Delete this project and all its outlines/documents? This cannot be undone."),!window.confirm(n))return;let a=[];const c=this.currentProject&&this.currentProject===t;t.classList.contains("docs-post")?a=[t.getAttribute("data-id")]:t.querySelectorAll(".docs-post").forEach((t=>{a.push(t.getAttribute("data-id"))})),t.remove(),a.length>0?this.deletePost(a):this.updateOutline(),c&&(this.currentProject=null,this.setup())}}collapseAll(){const t=this.outline.querySelector(".active-item");t&&(t.classList.remove("active-item"),t.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),this.outline.querySelectorAll("ul").forEach((t=>{t.classList.add("hidden")})),this.outline.querySelectorAll(".rotate-90").forEach((t=>{t.classList.remove("rotate-90")}))}activateListItem(t){this.activeItem=t;const e=t.querySelector("span");if(e){const s=this.outline.querySelector(".active-item");s&&(s.classList.remove("active-item"),s.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),t.classList.add("active-item"),e.classList.add("bg-lime-700/10")}const s=t.querySelector("ul");if(s){const e=t.querySelector(".icon-right");e&&e.classList.toggle("rotate-90"),s.classList.toggle("hidden")}}cutcopyOutlineItem(t,e){this.pasteItem&&(this.pasteItem.classList.remove("text-gray-400"),this.pasteItem=!1),t&&(this.pasteContext=e,this.pasteItem=t,this.menu.querySelectorAll(".cutcopy-context").forEach((t=>{t.classList.remove("cursor-not-allowed","text-gray-400"),t.classList.add("cursor-pointer","hover:bg-gray-200","paste-context")})),"cut"===e&&t.classList.add("text-gray-400"))}pasteOutlineItem(t,e){if(!t||!this.pasteContext||!this.pasteItem)return;this.pasteItem.classList.remove("text-gray-400"),"copy"===this.pasteContext&&(this.pasteItem=this.pasteItem.cloneNode(!0));const s=t.querySelector(".block.truncate");let i=4;if(s){const t=s.className.match(/pl-\d+/);t&&(i=parseInt(t[0].replace("pl-","")))}"insert_before"===e?(this.adjustPadding(this.pasteItem,i),t.parentNode.insertBefore(this.pasteItem,t)):"insert_after"===e?(this.adjustPadding(this.pasteItem,i),t.nextSibling?t.parentNode.insertBefore(this.pasteItem,t.nextSibling):t.parentNode.appendChild(this.pasteItem)):"inside"===e&&(this.adjustPadding(this.pasteItem,i+2),t.querySelector("ul").appendChild(this.pasteItem)),"cut"===this.pasteContext&&(this.pasteContext=!1,this.pasteItem=!1,this.menu.querySelectorAll(".paste-context").forEach((t=>{t.classList.add("cursor-not-allowed","text-gray-400"),t.classList.remove("cursor-pointer","hover:bg-gray-200","paste-context")}))),this.updateOutline()}parseOutlineList(t){const e={};let s=0;return t.querySelectorAll(":scope > li").forEach((t=>{const i=t.querySelector("span:first-of-type"),o=i?i.textContent.trim():"",n=t.querySelector("ul");if(n)e[o]=this.parseOutlineList(n);else{const i=parseInt(t.getAttribute("data-id"),10);e["EasyDocs_"+s]=i,s++}})),e}async handleFolderInput(e){const s=e.querySelector(".docs-input"),i=s.value.trim();if(i)if(s.outerHTML='<span class="docs-outline-label">'.concat(i,"</span>"),e.classList.contains("docs-folder")){if(await this.updateOutline(e),e.parentElement&&"docs-outline"===e.parentElement.id){const s=e.querySelector("ul");if(s){s.classList.remove("hidden");const i=e.querySelector(".icon-right");i&&i.classList.add("rotate-90");const o=document.createElement("li");o.classList.add("docs-outline-item","docs-post","mb-0","hover:cursor-pointer","new-item");const n='<span class="mr-1 text-slate-400">'.concat(t.get_icon("file-text")).concat(t.get_icon("loading","animate-spin easyhide"),"</span>");o.innerHTML='\n\t\t\t\t\t\t\t<span class="block hover:bg-gray-300">\n\t\t\t\t\t\t\t\t<span class="block truncate py-2 text-sm pr-2 pl-6">\n\t\t\t\t\t\t\t\t\t'.concat(n,"<span>easydocs-welcome</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t"),s.classList.remove("hidden"),s.appendChild(o),o.classList.remove("new-item"),this.createNewDocument(o,"easydocs-welcome")}}}else e.classList.contains("docs-post")&&this.createNewDocument(e,i);else e.remove()}handleRenameInput(t,e){const s=t.querySelector(".docs-input").value.trim();s&&s!==e?(t.querySelector(".docs-outline-label").innerHTML="".concat(s),t.classList.contains("docs-folder")?this.updateOutline(t):t.classList.contains("docs-post")&&this.renameDocument(t,s)):t.querySelector(".docs-outline-label").innerHTML="".concat(e)}adjustPadding(t,e){const s=t.querySelector(".block.truncate");if(s){const t=s.className.match(/pl-\d+/);t&&(s.classList.remove(t[0]),s.classList.add("pl-".concat(e)))}const i=t.querySelector("ul");i&&i.querySelectorAll(":scope > li").forEach((t=>{this.adjustPadding(t,e+2)}))}async updateOutline(t=!1){const e=this.parseOutlineList(this.outline),i={action:"easy_docs_update_outline",security:s.security,outline:JSON.stringify(e)};this.addDocBtn.disabled=!0,this.insertDocBtn.disabled=!0,this.addOutlineBtn.disabled=!0,this.delBtn.disabled=!0,t&&(t.classList.contains("docs-folder")&&t.querySelector(".icon-right").classList.add("easyhide"),t.querySelector(".icon-loading").classList.remove("easyhide"));const n=await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this));n&&n.success?(this.addDocBtn.disabled=!1,this.insertDocBtn.disabled=!1,this.addOutlineBtn.disabled=!1,this.delBtn.disabled=!1,t&&(t.classList.contains("docs-folder")?t.querySelector(".icon-right").classList.remove("easyhide"):t.classList.contains("docs-post")&&t.querySelector(".icon-file-text").classList.remove("easyhide"),t.querySelector(".icon-loading").classList.add("easyhide"))):(this.addDocBtn.disabled=!1,this.insertDocBtn.disabled=!1,this.addOutlineBtn.disabled=!1,this.delBtn.disabled=!1,t&&t.remove())}async createNewDocument(t,e){if(!t||!e)return;const i={action:"easy_docs_create_document",security:s.security,postTitle:e};this.addDocBtn.disabled=!0,this.insertDocBtn.disabled=!0,this.addOutlineBtn.disabled=!0,t.querySelector(".icon-file-text").classList.add("easyhide"),t.querySelector(".icon-loading").classList.remove("easyhide");const n=await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this));if(n&&n.success){const e=n.data.id;t.setAttribute("data-id",e),this.updateOutline(t)}else this.addDocBtn.disabled=!1,this.insertDocBtn.disabled=!1,this.addOutlineBtn.disabled=!1,t.remove()}async renameDocument(t,e){if(!t||!e)return;t.querySelector(".icon-file-text").classList.add("easyhide"),t.querySelector(".icon-loading").classList.remove("easyhide");const i={action:"easy_docs_rename_document",security:s.security,postId:t.getAttribute("data-id"),postTitle:e},n=await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this));n&&n.success&&this.updateOutline(t)}async deletePost(t){const e={action:"easy_docs_delete_document",security:s.security,postIds:JSON.stringify(t)},i=await o.sendAjaxRequest(s.ajaxUrl,e,this.handleError.bind(this));i&&i.success&&(this.updateOutline(),t.forEach((t=>{this.editor.closeTab(t,!0)})))}handleError(t){console.log(t)}},a=class{constructor(){this.isFresh=!0,this.activeEditor=null,this.isProgrammaticUpdate=!1,this.editorData={},this.tabLoadRequests={},this.editorId="docs-post-content",this.outline=document.querySelector("#docs-outline"),this.outline&&(this.tabs=document.querySelector("#docs-tabs"),this.tabContent=document.querySelector("#docs-tab-content"),this.saveDocBtn=document.querySelector("#easy-save-doc"),this.editorElement=document.getElementById(this.editorId),this.editorWrap=document.getElementById("wp-".concat(this.editorId,"-wrap")),this.events(),this.bindEditorEvents(),this.updateSaveButtonState())}getI18nValue(t,e=""){return s.i18n&&"string"==typeof s.i18n[t]?s.i18n[t]:e}getTabId(t){return"docs-tab-".concat(t)}getTinyEditor(){return window.tinymce&&"function"==typeof window.tinymce.get?window.tinymce.get(this.editorId):null}isTextModeActive(){return this.editorWrap?this.editorWrap.classList.contains("html-active"):!!this.editorElement&&null!==this.editorElement.offsetParent}getCurrentEditorContent(){if(!this.editorElement)return"";if(this.isTextModeActive())return this.editorElement.value;const t=this.getTinyEditor();return t?t.getContent():this.editorElement.value}setEditorContent(t=""){const e="string"==typeof t?t:"",s=this.getTinyEditor();this.isProgrammaticUpdate=!0,this.editorElement&&(this.editorElement.value=e),s&&(s.setContent(e),"function"==typeof s.setDirty&&s.setDirty(!1),s.undoManager&&"function"==typeof s.undoManager.clear&&s.undoManager.clear(),"function"==typeof s.save&&s.save()),this.isProgrammaticUpdate=!1}persistActiveEditorDraft(){if(!this.activeEditor)return;const t=this.editorData[this.activeEditor];if(!t)return;const e=this.getCurrentEditorContent();t.draftContent=e,t.dirty=e!==t.savedContent}hasUnsavedChanges(){return Object.values(this.editorData).some((t=>t&&t.dirty))}handleBeforeUnload(t){if(this.persistActiveEditorDraft(),!this.hasUnsavedChanges())return;const e=this.getI18nValue("unsaved_leave","You have unsaved changes. Are you sure you want to leave this page?");return t.preventDefault(),t.returnValue=e,e}handleKeyboardSave(t){(t.ctrlKey||t.metaKey)&&"s"===t.key.toLowerCase()&&this.activeEditor&&(t.preventDefault(),this.saveDocument())}bindEditorEvents(){window.addEventListener("beforeunload",this.handleBeforeUnload.bind(this)),document.addEventListener("keydown",this.handleKeyboardSave.bind(this)),this.editorElement&&this.editorElement.addEventListener("input",(()=>{if(this.isProgrammaticUpdate||!this.activeEditor)return;const t=this.editorData[this.activeEditor];t&&(t.draftContent=this.editorElement.value,t.dirty=t.draftContent!==t.savedContent,this.updateSaveButtonState())})),this.bindTinyMceEditor(),[document.getElementById("".concat(this.editorId,"-tmce")),document.getElementById("".concat(this.editorId,"-html"))].forEach((t=>{t&&t.addEventListener("click",(()=>{window.setTimeout((()=>{this.persistActiveEditorDraft(),this.updateSaveButtonState()}),0)}))}))}bindTinyMceEditor(){const t=t=>{t&&t.id===this.editorId&&!t.__easyDocsBound&&(t.__easyDocsBound=!0,t.on("input change undo redo keyup",(()=>{if(this.isProgrammaticUpdate||!this.activeEditor)return;const e=this.editorData[this.activeEditor];e&&(e.draftContent=t.getContent(),e.dirty=e.draftContent!==e.savedContent,this.updateSaveButtonState())})))};t(this.getTinyEditor()),window.tinymce&&"function"==typeof window.tinymce.on&&window.tinymce.on("AddEditor",(e=>{e&&e.editor&&t(e.editor)}))}events(){this.outline&&this.outline.addEventListener("click",(t=>{if(t.target.classList.contains("docs-input"))return;const e=t.target.closest(".docs-outline-item");e&&e.classList.contains("docs-post")&&this.openEditor(e)})),this.tabs&&this.tabs.addEventListener("click",(t=>{if(t.target.closest(".docs-tab-label")){t.preventDefault();const e=t.target.closest(".docs-tab");if(!e||e.classList.contains("active-tab"))return;const s=e.getAttribute("data-id");this.activateEditor(s)}else if(t.target.closest(".docs-tab-close")){t.preventDefault();const e=t.target.closest(".docs-tab");if(!e)return;const s=e.getAttribute("data-id");this.closeTab(s)}})),this.saveDocBtn&&this.saveDocBtn.addEventListener("click",(()=>{this.saveDocument()}))}initiateEditor(){const t=this.tabContent?this.tabContent.querySelector(".dpc-welcome"):null,e=this.tabContent?this.tabContent.querySelector(".dpc-editor"):null;t&&e&&(t.classList.add("hidden"),e.classList.remove("sr-only"))}resetEditor(){const t=this.tabContent?this.tabContent.querySelector(".dpc-welcome"):null,e=this.tabContent?this.tabContent.querySelector(".dpc-editor"):null;t&&e&&(t.classList.remove("hidden"),e.classList.add("sr-only")),this.isFresh=!0,this.activeEditor=null,this.setEditorContent(""),this.updateSaveButtonState()}openEditor(t){const e=t.getAttribute("data-id");if(!e)return;const s=this.getTabId(e);s!==this.activeEditor&&(this.tabs&&this.tabs.querySelector("#".concat(s))?this.activateEditor(e):this.createNewTab(e,"easydocs-welcome"===t.textContent.trim()))}activateEditor(t){const e=this.getTabId(t),s=this.tabs?this.tabs.querySelector("#".concat(e)):null,i=this.editorData[e];s&&i&&(this.persistActiveEditorDraft(),this.tabs&&this.tabs.querySelectorAll(".active-tab").forEach((t=>{t.classList.remove("active-tab","bg-gray-100")})),s.classList.add("active-tab","bg-gray-100"),this.activeEditor=e,this.setEditorContent(i.draftContent),this.updateSaveButtonState())}closeTab(t,e=!1){const s=this.getTabId(t),i=this.tabs?this.tabs.querySelector("#".concat(s)):null,o=this.editorData[s];if(i){if(this.activeEditor===s&&this.persistActiveEditorDraft(),o&&o.dirty&&!e){const t=this.getI18nValue("unsaved_close","There are unsaved changes. Are you sure you want to close this tab?");if(!window.confirm(t))return}if(i.remove(),delete this.editorData[s],delete this.tabLoadRequests[s],this.activeEditor===s){this.activeEditor=null;const t=this.tabs?this.tabs.querySelector(".docs-tab"):null;t?this.activateEditor(t.getAttribute("data-id")):this.resetEditor()}this.updateSaveButtonState()}}async createNewTab(e,i){const n=this.getTabId(e);if(this.tabLoadRequests[n])return await this.tabLoadRequests[n],void this.activateEditor(e);const a=(async()=>{const a={action:"easy_docs_get_document",security:s.security,postId:e},c=await o.sendAjaxRequest(s.ajaxUrl,a,this.handleError.bind(this));if(!c||!c.success||!c.data){const t=this.getI18nValue("load_failed","Unable to load the selected document.");return void this.handleError(t)}const r=c.data.title;let l=c.data.content||"";if(!l&&i){const t=s.i18n;l="<h3>".concat(t.welcome[0],"</h3><p>").concat(t.welcome[1],"</p><p><b><i>").concat(t.welcome[2],"</i></b></p><p>").concat(t.welcome[3],"</p>")}if(this.tabs&&!this.tabs.querySelector("#".concat(n))){const s=document.createElement("div");s.id=n,s.setAttribute("data-id",e),s.classList.add("docs-tab","flex","items-center","m-1","mr-0","mb-0","cursor-pointer","min-w-32","max-w-52","justify-between"),s.innerHTML='<a href="#" class="docs-tab-label text-gray-500 text-sm truncate px-4 py-2">'.concat(r,'</a><a href="#" class="docs-tab-close px-4 py-2 text-gray-500 hover:text-red-400">').concat(t.get_icon("close","tab-close"),"</a>"),this.tabs.appendChild(s)}this.editorData[n]={postId:e,title:r,savedContent:l,draftContent:l,dirty:!1,saving:!1},this.isFresh&&(this.initiateEditor(),this.isFresh=!1),this.activateEditor(e)})();this.tabLoadRequests[n]=a,await a,delete this.tabLoadRequests[n]}updateSaveButtonState(){if(!this.saveDocBtn)return;if(!this.activeEditor||!this.editorData[this.activeEditor])return void(this.saveDocBtn.disabled=!0);const t=this.editorData[this.activeEditor];this.saveDocBtn.disabled=!t.dirty||t.saving}async saveDocument(){if(!this.activeEditor)return;this.persistActiveEditorDraft();const t=this.editorData[this.activeEditor];if(!t||!t.dirty||t.saving)return void this.updateSaveButtonState();const e=t.postId;t.saving=!0,this.updateSaveButtonState();const i={action:"easy_docs_update_document",security:s.security,postId:e,content:t.draftContent},n=await o.sendAjaxRequest(s.ajaxUrl,i,this.handleError.bind(this));if(t.saving=!1,!n||!n.success){const t=this.getI18nValue("save_failed","Unable to save document. Please try again.");return this.handleError(t),void this.updateSaveButtonState()}t.savedContent=t.draftContent,t.dirty=!1;const a=this.getTinyEditor();a&&this.activeEditor===this.getTabId(e)&&"function"==typeof a.setDirty&&a.setDirty(!1),this.updateSaveButtonState()}handleError(t){console.log(t)}},c=class{constructor(){this.outline=document.querySelector("#docs-stats-filter-outline"),this.outline&&(this.table=document.querySelector("#easydocs-stats-table"),this.collapseBtn=document.querySelector("#easy-collapse-all"),this.activeItem=null,this.events())}events(){const t=this;this.outline.addEventListener("click",(e=>{const s=e.target.closest(".docs-outline-item");s&&(e.preventDefault(),e.stopPropagation(),t.activateListItem(s),t.filterList(s))})),this.collapseBtn&&this.collapseBtn.addEventListener("click",(()=>{this.collapseAll()})),this.table&&this.table.querySelectorAll(".easydocs-table-sort").forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-column");this.sortTable(e)}))}))}collapseAll(){const t=this.outline.querySelector(".active-item");t&&(t.classList.remove("active-item"),t.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),this.outline.querySelectorAll("ul").forEach((t=>{t.classList.add("hidden")})),this.outline.querySelectorAll(".rotate-90").forEach((t=>{t.classList.remove("rotate-90")})),this.table.querySelectorAll(".easydocs-stats-items tr").forEach((t=>{t.classList.remove("hidden")}))}activateListItem(t){this.activeItem=t;const e=t.querySelector("span");if(e){const s=this.outline.querySelector(".active-item");s&&(s.classList.remove("active-item"),s.querySelectorAll(".bg-lime-700\\/10").forEach((t=>t.classList.remove("bg-lime-700/10")))),t.classList.add("active-item"),e.classList.add("bg-lime-700/10")}const s=t.querySelector("ul");if(s){const e=t.querySelector(".icon-right");e&&e.classList.toggle("rotate-90"),s.classList.toggle("hidden")}}filterList(t){let e=t.getAttribute("data_ids");e=e.split(","),e.length>0?this.table.querySelectorAll(".easydocs-stats-items tr").forEach((t=>{const s=t.getAttribute("data-id");e.indexOf(s)>-1?t.classList.remove("hidden"):t.classList.add("hidden")})):this.table.querySelectorAll(".easydocs-stats-items tr").forEach((t=>{t.classList.add("hidden")}))}sortTable(t){t=parseInt(t,10);const e=this.table.querySelector("tbody");if(!e)return;const s=Array.from(e.querySelectorAll("tr")),i="desc"===this.table.dataset.sortOrder?"asc":"desc";this.table.dataset.sortOrder=i,s.sort(((e,s)=>{const o=e.querySelector("td:nth-child(".concat(t,")")).textContent.trim(),n=s.querySelector("td:nth-child(".concat(t,")")).textContent.trim();return 2!==t&&3!==t&&4!==t||isNaN(parseFloat(o))||isNaN(parseFloat(n))?"asc"===i?o.localeCompare(n):n.localeCompare(o):function(t,e){const s=parseFloat(t),o=parseFloat(e);return"asc"===i?s-o:o-s}(o,n)})),s.forEach((t=>e.appendChild(t)))}handleError(t){console.log(t)}},r=class{constructor(){this.settings=document.querySelector("#easydocs-settings"),this.settings&&(this.form=this.settings.querySelector("#easydocs-admin-settings"),this.submit=this.settings.querySelector("#easydocs-admin-settings_save"),this.events())}events(){this.submit&&this.submit.addEventListener("click",(t=>{t.preventDefault();const e=this.form.querySelectorAll(".easydocs-option"),s={};e.forEach((t=>{let e;const i=t.querySelector("input, select"),o=t.getAttribute("data-setting");o&&i&&(e="checkbox"===i.type?i.checked?"yes":"no":i.value,s[o]=e)})),this.submit.disabled=!0,this.sendSettings(s)}))}async sendSettings(t){const e={action:"easy_docs_update_settings",security:s.security,settings:JSON.stringify(t)},i=await o.sendAjaxRequest(s.ajaxUrl,e,this.handleError.bind(this));this.submit.disabled=!1,i&&i.success&&location.reload()}handleError(t){console.log(t)}};document.addEventListener("DOMContentLoaded",(()=>{const t=new a;new n(t),new c,new r}))})(); -
easy-docs/trunk/admin/js/partials/editor.js
r3240911 r3475230 5 5 class Editor { 6 6 constructor() { 7 8 7 this.isFresh = true; 9 this.activeEditor = false; 10 this.isInitiated = false; 11 this.isSettingContent = false; 8 this.activeEditor = null; 9 this.isProgrammaticUpdate = false; 12 10 this.editorData = {}; 11 this.tabLoadRequests = {}; 12 this.editorId = 'docs-post-content'; 13 13 14 this.outline = document.querySelector('#docs-outline'); 14 if (! this.outline) return; 15 if (!this.outline) { 16 return; 17 } 18 15 19 this.tabs = document.querySelector('#docs-tabs'); 16 20 this.tabContent = document.querySelector('#docs-tab-content'); 17 21 this.saveDocBtn = document.querySelector('#easy-save-doc'); 22 this.editorElement = document.getElementById(this.editorId); 23 this.editorWrap = document.getElementById(`wp-${this.editorId}-wrap`); 24 18 25 this.events(); 26 this.bindEditorEvents(); 27 this.updateSaveButtonState(); 28 } 29 30 getI18nValue(key, fallback = '') { 31 if (config.i18n && typeof config.i18n[key] === 'string') { 32 return config.i18n[key]; 33 } 34 return fallback; 35 } 36 37 getTabId(postId) { 38 return `docs-tab-${postId}`; 39 } 40 41 getTinyEditor() { 42 if (!window.tinymce || typeof window.tinymce.get !== 'function') { 43 return null; 44 } 45 return window.tinymce.get(this.editorId); 46 } 47 48 isTextModeActive() { 49 if (!this.editorWrap) { 50 return this.editorElement ? this.editorElement.offsetParent !== null : false; 51 } 52 return this.editorWrap.classList.contains('html-active'); 53 } 54 55 getCurrentEditorContent() { 56 if (!this.editorElement) { 57 return ''; 58 } 59 60 if (this.isTextModeActive()) { 61 return this.editorElement.value; 62 } 63 64 const editor = this.getTinyEditor(); 65 if (editor) { 66 return editor.getContent(); 67 } 68 69 return this.editorElement.value; 70 } 71 72 setEditorContent(content = '') { 73 const nextContent = typeof content === 'string' ? content : ''; 74 const editor = this.getTinyEditor(); 75 76 this.isProgrammaticUpdate = true; 77 78 if (this.editorElement) { 79 this.editorElement.value = nextContent; 80 } 81 82 if (editor) { 83 editor.setContent(nextContent); 84 if (typeof editor.setDirty === 'function') { 85 editor.setDirty(false); 86 } 87 if (editor.undoManager && typeof editor.undoManager.clear === 'function') { 88 editor.undoManager.clear(); 89 } 90 if (typeof editor.save === 'function') { 91 editor.save(); 92 } 93 } 94 95 this.isProgrammaticUpdate = false; 96 } 97 98 persistActiveEditorDraft() { 99 if (!this.activeEditor) { 100 return; 101 } 102 103 const state = this.editorData[this.activeEditor]; 104 if (!state) { 105 return; 106 } 107 108 const currentContent = this.getCurrentEditorContent(); 109 state.draftContent = currentContent; 110 state.dirty = currentContent !== state.savedContent; 111 } 112 113 hasUnsavedChanges() { 114 return Object.values(this.editorData).some((state) => state && state.dirty); 115 } 116 117 handleBeforeUnload(event) { 118 this.persistActiveEditorDraft(); 119 if (!this.hasUnsavedChanges()) { 120 return; 121 } 122 123 const message = this.getI18nValue('unsaved_leave', 'You have unsaved changes. Are you sure you want to leave this page?'); 124 event.preventDefault(); 125 event.returnValue = message; 126 return message; 127 } 128 129 handleKeyboardSave(event) { 130 const isSaveShortcut = (event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's'; 131 if (!isSaveShortcut) { 132 return; 133 } 134 135 if (!this.activeEditor) { 136 return; 137 } 138 139 event.preventDefault(); 140 this.saveDocument(); 141 } 142 143 bindEditorEvents() { 144 window.addEventListener('beforeunload', this.handleBeforeUnload.bind(this)); 145 document.addEventListener('keydown', this.handleKeyboardSave.bind(this)); 146 147 if (this.editorElement) { 148 this.editorElement.addEventListener('input', () => { 149 if (this.isProgrammaticUpdate || !this.activeEditor) { 150 return; 151 } 152 153 const state = this.editorData[this.activeEditor]; 154 if (!state) { 155 return; 156 } 157 158 state.draftContent = this.editorElement.value; 159 state.dirty = state.draftContent !== state.savedContent; 160 this.updateSaveButtonState(); 161 }); 162 } 163 164 this.bindTinyMceEditor(); 165 166 const visualTab = document.getElementById(`${this.editorId}-tmce`); 167 const textTab = document.getElementById(`${this.editorId}-html`); 168 169 [visualTab, textTab].forEach((tabSwitch) => { 170 if (!tabSwitch) { 171 return; 172 } 173 174 tabSwitch.addEventListener('click', () => { 175 window.setTimeout(() => { 176 this.persistActiveEditorDraft(); 177 this.updateSaveButtonState(); 178 }, 0); 179 }); 180 }); 181 } 182 183 bindTinyMceEditor() { 184 const attachTinyListeners = (editor) => { 185 if (!editor || editor.id !== this.editorId || editor.__easyDocsBound) { 186 return; 187 } 188 189 editor.__easyDocsBound = true; 190 const syncFromVisualEditor = () => { 191 if (this.isProgrammaticUpdate || !this.activeEditor) { 192 return; 193 } 194 195 const state = this.editorData[this.activeEditor]; 196 if (!state) { 197 return; 198 } 199 200 state.draftContent = editor.getContent(); 201 state.dirty = state.draftContent !== state.savedContent; 202 this.updateSaveButtonState(); 203 }; 204 205 editor.on('input change undo redo keyup', syncFromVisualEditor); 206 }; 207 208 attachTinyListeners(this.getTinyEditor()); 209 210 if (window.tinymce && typeof window.tinymce.on === 'function') { 211 window.tinymce.on('AddEditor', (event) => { 212 if (!event || !event.editor) { 213 return; 214 } 215 attachTinyListeners(event.editor); 216 }); 217 } 19 218 } 20 219 21 220 events() { 22 const _this = this; 23 if ( this.outline ) { 221 if (this.outline) { 24 222 this.outline.addEventListener('click', (event) => { 25 223 if (event.target.classList.contains('docs-input')) { 26 224 return; 27 225 } 226 28 227 const target = event.target.closest('.docs-outline-item'); 29 if ( ! target || ! target.classList.contains('docs-post')) {30 return; 31 } 32 33 _this.openEditor(target);34 }); 35 } 36 37 if ( this.tabs) {228 if (!target || !target.classList.contains('docs-post')) { 229 return; 230 } 231 232 this.openEditor(target); 233 }); 234 } 235 236 if (this.tabs) { 38 237 this.tabs.addEventListener('click', (event) => { 39 if ( event.target.closest('.docs-tab-label')) {238 if (event.target.closest('.docs-tab-label')) { 40 239 event.preventDefault(); 41 240 const tab = event.target.closest('.docs-tab'); 42 if ( tab.classList.contains('active-tab')) {241 if (!tab || tab.classList.contains('active-tab')) { 43 242 return; 44 243 } 244 45 245 const postId = tab.getAttribute('data-id'); 46 _this.activateEditor(postId);47 } else if ( event.target.closest('.docs-tab-close')) {246 this.activateEditor(postId); 247 } else if (event.target.closest('.docs-tab-close')) { 48 248 event.preventDefault(); 49 249 const tab = event.target.closest('.docs-tab'); 250 if (!tab) { 251 return; 252 } 253 50 254 const postId = tab.getAttribute('data-id'); 51 _this.closeTab(postId);52 } 53 }); 54 } 55 56 if ( this.saveDocBtn) {57 this.saveDocBtn.addEventListener('click', ( event) => {58 _this.saveDocument();255 this.closeTab(postId); 256 } 257 }); 258 } 259 260 if (this.saveDocBtn) { 261 this.saveDocBtn.addEventListener('click', () => { 262 this.saveDocument(); 59 263 }); 60 264 } … … 62 266 63 267 initiateEditor() { 64 const welcomeContent = this.tabContent .querySelector('.dpc-welcome');65 const editor = this.tabContent .querySelector('.dpc-editor');268 const welcomeContent = this.tabContent ? this.tabContent.querySelector('.dpc-welcome') : null; 269 const editor = this.tabContent ? this.tabContent.querySelector('.dpc-editor') : null; 66 270 if (welcomeContent && editor) { 67 271 welcomeContent.classList.add('hidden'); … … 71 275 72 276 resetEditor() { 73 const welcomeContent = this.tabContent.querySelector('.dpc-welcome'); 74 const editor = this.tabContent.querySelector('.dpc-editor'); 277 const welcomeContent = this.tabContent ? this.tabContent.querySelector('.dpc-welcome') : null; 278 const editor = this.tabContent ? this.tabContent.querySelector('.dpc-editor') : null; 279 75 280 if (welcomeContent && editor) { 76 281 welcomeContent.classList.remove('hidden'); 77 282 editor.classList.add('sr-only'); 78 283 } 284 79 285 this.isFresh = true; 80 this.activeEditor = false; 286 this.activeEditor = null; 287 this.setEditorContent(''); 288 this.updateSaveButtonState(); 81 289 } 82 290 83 291 openEditor(post) { 84 292 const postId = post.getAttribute('data-id'); 85 if ( ! postId ) return; 86 const tabId = `docs-tab-${postId}`; 87 88 // Check if tab already active. 89 if ( tabId === this.activeEditor ) { 90 return; 91 } 92 93 const tab = this.tabs ? this.tabs.querySelector(`#${tabId}`) : false; 94 if ( tab ) { 293 if (!postId) { 294 return; 295 } 296 297 const tabId = this.getTabId(postId); 298 299 if (tabId === this.activeEditor) { 300 return; 301 } 302 303 const tab = this.tabs ? this.tabs.querySelector(`#${tabId}`) : null; 304 if (tab) { 95 305 this.activateEditor(postId); 96 } else { 97 this.createNewTab(postId, 'easydocs-welcome' === post.textContent.trim()); 98 } 306 return; 307 } 308 309 this.createNewTab(postId, 'easydocs-welcome' === post.textContent.trim()); 99 310 } 100 311 101 312 activateEditor(postId) { 102 const tabId = `docs-tab-${postId}`; 103 const tab = this.tabs ? this.tabs.querySelector(`#${tabId}`) : false; 104 const postContent = this.editorData?.[tabId]?.[0] ?? ''; 105 if ( ! tab ) return; 106 this.tabs.querySelectorAll('.active-tab').forEach(tab => tab.classList.remove('active-tab', 'bg-gray-100')); 313 const tabId = this.getTabId(postId); 314 const tab = this.tabs ? this.tabs.querySelector(`#${tabId}`) : null; 315 const state = this.editorData[tabId]; 316 317 if (!tab || !state) { 318 return; 319 } 320 321 this.persistActiveEditorDraft(); 322 323 if (this.tabs) { 324 this.tabs.querySelectorAll('.active-tab').forEach((item) => { 325 item.classList.remove('active-tab', 'bg-gray-100'); 326 }); 327 } 328 107 329 tab.classList.add('active-tab', 'bg-gray-100'); 108 if ( this.activeEditor !== tabId ) { 109 this.modifyEditorContent(postId, postContent); 110 } 111 } 112 113 closeTab(postId, force) { 114 const tabId = `docs-tab-${postId}`; 115 const tab = this.tabs ? this.tabs.querySelector(`#${tabId}`) : false; 116 if ( ! tab ) return; 117 if ( this.editorData[tabId][1] && ! force ) { 118 const confirmClose = confirm('There are unsaved changes. Are you sure you want to close?'); 119 if ( ! confirmClose ) return; 120 } 330 this.activeEditor = tabId; 331 332 this.setEditorContent(state.draftContent); 333 this.updateSaveButtonState(); 334 } 335 336 closeTab(postId, force = false) { 337 const tabId = this.getTabId(postId); 338 const tab = this.tabs ? this.tabs.querySelector(`#${tabId}`) : null; 339 const state = this.editorData[tabId]; 340 341 if (!tab) { 342 return; 343 } 344 345 if (this.activeEditor === tabId) { 346 this.persistActiveEditorDraft(); 347 } 348 349 if (state && state.dirty && !force) { 350 const message = this.getI18nValue('unsaved_close', 'There are unsaved changes. Are you sure you want to close this tab?'); 351 if (!window.confirm(message)) { 352 return; 353 } 354 } 355 121 356 tab.remove(); 122 if ( this.activeEditor === tabId ) { 123 const nextTab = this.tabs ? this.tabs.querySelector('.docs-tab') : false; 124 if ( nextTab ) { 357 delete this.editorData[tabId]; 358 delete this.tabLoadRequests[tabId]; 359 360 if (this.activeEditor === tabId) { 361 this.activeEditor = null; 362 const nextTab = this.tabs ? this.tabs.querySelector('.docs-tab') : null; 363 if (nextTab) { 125 364 this.activateEditor(nextTab.getAttribute('data-id')); 126 365 } else { … … 128 367 } 129 368 } 369 370 this.updateSaveButtonState(); 130 371 } 131 372 132 373 async createNewTab(postId, isWelcome) { 133 const data = { 134 action: 'easy_docs_get_document', 135 security: config.security, 136 postId, 137 }; 138 139 const post = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 140 if ( ! post.success || ! post.data ) return; 141 const postTitle = post.data.title; 142 let postContent = post.data.content; 143 if (postContent) { 144 postContent = Markup.normalize_html(postContent); 145 } else { 146 if (isWelcome) { 374 const tabId = this.getTabId(postId); 375 376 if (this.tabLoadRequests[tabId]) { 377 await this.tabLoadRequests[tabId]; 378 this.activateEditor(postId); 379 return; 380 } 381 382 const loadTask = (async () => { 383 const data = { 384 action: 'easy_docs_get_document', 385 security: config.security, 386 postId, 387 }; 388 389 const post = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 390 if (!post || !post.success || !post.data) { 391 const errorMessage = this.getI18nValue('load_failed', 'Unable to load the selected document.'); 392 this.handleError(errorMessage); 393 return; 394 } 395 396 const postTitle = post.data.title; 397 let postContent = post.data.content || ''; 398 399 if (!postContent && isWelcome) { 147 400 const i18n = config.i18n; 148 401 postContent = `<h3>${i18n.welcome[0]}</h3><p>${i18n.welcome[1]}</p><p><b><i>${i18n.welcome[2]}</i></b></p><p>${i18n.welcome[3]}</p>`; 149 402 } 150 } 151 const tab = document.createElement('div'); 152 tab.id = `docs-tab-${postId}`; 153 tab.setAttribute('data-id', postId); 154 tab.classList.add('docs-tab', 'flex', 'items-center', 'm-1', 'mr-0', 'cursor-pointer', 'min-w-32', 'max-w-52', 'justify-between'); 155 tab.innerHTML = `<a href="#" class="docs-tab-label text-gray-500 text-sm truncate px-4 py-2">${postTitle}</a><a href="#" class="docs-tab-close px-4 py-2 text-gray-500 hover:text-red-400">${Markup.get_icon('close', 'tab-close')}</a>`; 156 if ( ! this.tabs ) return; 157 this.tabs.appendChild(tab); 158 this.editorData[`docs-tab-${postId}`] = [postContent, false]; 159 this.modifyEditorContent(postId, postContent); 160 this.activateEditor(postId); 161 if (this.isFresh) { 162 this.initiateEditor(); 163 this.isFresh = false; 164 } 165 if ( ! this.isInitiated ) { 166 const editor = tinymce.get('docs-post-content'); 167 if ( editor ) { 168 editor.on('change', () => { 169 if ( ! this.isSettingContent ) { 170 this.editorData[this.activeEditor][1] = true; 171 } 172 }); 173 this.isInitiated = true; 174 } 175 } 403 404 if (this.tabs && !this.tabs.querySelector(`#${tabId}`)) { 405 const tab = document.createElement('div'); 406 tab.id = tabId; 407 tab.setAttribute('data-id', postId); 408 tab.classList.add('docs-tab', 'flex', 'items-center', 'm-1', 'mr-0', 'mb-0', 'cursor-pointer', 'min-w-32', 'max-w-52', 'justify-between'); 409 tab.innerHTML = `<a href="#" class="docs-tab-label text-gray-500 text-sm truncate px-4 py-2">${postTitle}</a><a href="#" class="docs-tab-close px-4 py-2 text-gray-500 hover:text-red-400">${Markup.get_icon('close', 'tab-close')}</a>`; 410 this.tabs.appendChild(tab); 411 } 412 413 this.editorData[tabId] = { 414 postId, 415 title: postTitle, 416 savedContent: postContent, 417 draftContent: postContent, 418 dirty: false, 419 saving: false, 420 }; 421 422 if (this.isFresh) { 423 this.initiateEditor(); 424 this.isFresh = false; 425 } 426 427 this.activateEditor(postId); 428 })(); 429 430 this.tabLoadRequests[tabId] = loadTask; 431 await loadTask; 432 delete this.tabLoadRequests[tabId]; 433 } 434 435 updateSaveButtonState() { 436 if (!this.saveDocBtn) { 437 return; 438 } 439 440 if (!this.activeEditor || !this.editorData[this.activeEditor]) { 441 this.saveDocBtn.disabled = true; 442 return; 443 } 444 445 const state = this.editorData[this.activeEditor]; 446 this.saveDocBtn.disabled = !state.dirty || state.saving; 176 447 } 177 448 178 449 async saveDocument() { 179 const {content, isDirty} = this.editorData[this.activeEditor]; 180 const editorId = 'docs-post-content'; 181 const editorElement = this.tabContent.querySelector(`#${editorId}`); 182 if ( ! editorElement ) return; 183 const activeTab = editorElement.offsetParent === null ? 'visual' : 'text'; 184 let newContent = '' 185 if ( activeTab === 'text' ) { 186 newContent = editorElement.value; 187 } else { 188 const editor = tinymce.get(editorId); 189 if (editor) { 190 newContent = editor.getContent(); 191 } else { 192 return; 193 } 194 } 195 const postId = this.activeEditor.replace('docs-tab-', ''); 196 if ( newContent === content ) { 197 return; 198 } 199 200 this.saveDocBtn.disabled = true; 450 if (!this.activeEditor) { 451 return; 452 } 453 454 this.persistActiveEditorDraft(); 455 456 const state = this.editorData[this.activeEditor]; 457 if (!state || !state.dirty || state.saving) { 458 this.updateSaveButtonState(); 459 return; 460 } 461 462 const postId = state.postId; 463 state.saving = true; 464 this.updateSaveButtonState(); 465 201 466 const data = { 202 467 action: 'easy_docs_update_document', 203 468 security: config.security, 204 469 postId, 205 content: newContent,470 content: state.draftContent, 206 471 }; 472 207 473 const status = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 208 if ( status.success ) { 209 this.saveDocBtn.disabled = false; 210 this.editorData[this.activeEditor][0] = newContent; 211 this.editorData[this.activeEditor][1] = false; 212 } 213 } 214 215 modifyEditorContent(postId, postContent) { 216 const editorId = 'docs-post-content'; 217 const editorElement = document.getElementById(editorId); 218 const editor = tinymce.get(editorId); 219 220 // Function to determine if "Text" tab is active 221 const isTextTabActive = editorElement.offsetParent !== null; 222 223 // Save current tab data 224 if (this.activeEditor && tinymce.activeEditor) { 225 if (this.editorData[this.activeEditor][1]) { 226 if (!isTextTabActive) { 227 // Visual (TinyMCE) tab is active, save content from TinyMCE 228 editor.save(); 229 const editor_data = editor.getContent(); 230 this.editorData[this.activeEditor] = [editor_data, true]; 231 } else { 232 // Text tab is active, save content from the textarea 233 const editor_data = editorElement.value; 234 this.editorData[this.activeEditor] = [editor_data, true]; 235 } 236 } 237 } 238 239 // Set the content for the current tab 240 this.isSettingContent = true; 241 if (!isTextTabActive) { 242 // Visual (TinyMCE) tab is active, set content using TinyMCE 243 editor.setContent(postContent); 244 } else { 245 // Text tab is active, set content in the textarea 246 editorElement.value = postContent; 247 } 248 this.isSettingContent = false; 249 250 // Update active editor reference 251 this.activeEditor = `docs-tab-${postId}`; 252 474 475 state.saving = false; 476 477 if (!status || !status.success) { 478 const errorMessage = this.getI18nValue('save_failed', 'Unable to save document. Please try again.'); 479 this.handleError(errorMessage); 480 this.updateSaveButtonState(); 481 return; 482 } 483 484 state.savedContent = state.draftContent; 485 state.dirty = false; 486 487 const editor = this.getTinyEditor(); 488 if (editor && this.activeEditor === this.getTabId(postId) && typeof editor.setDirty === 'function') { 489 editor.setDirty(false); 490 } 491 492 this.updateSaveButtonState(); 253 493 } 254 494 … … 258 498 } 259 499 260 export default Editor 500 export default Editor; -
easy-docs/trunk/admin/js/partials/explorer.js
r3246256 r3475230 123 123 e.preventDefault(); 124 124 const shortcode = _this.docsInfo.querySelector('.easy-docs-shortcode'); 125 if ( ! shortcode ) return; 125 126 const text = shortcode.textContent; 126 127 if (text) { … … 161 162 if ( this.menu ) { 162 163 this.menu.addEventListener('click', function(event) { 163 const target = event.target ;164 165 if ( target.nodeName !== 'LI') {164 const target = event.target.closest('li[data-attr]'); 165 166 if ( ! target ) { 166 167 _this.contextItem = false; 167 168 return; … … 303 304 this.toggleModal(); 304 305 if (! this.isModalOpen) return; 305 const docsList = config.posts ;306 const docsList = config.posts || {}; 306 307 const i18n = config.i18n; 307 308 const docsKeys = Object.keys(docsList); … … 400 401 newItem.innerHTML = ` 401 402 <span class="block hover:bg-gray-300"> 402 <span class="block truncate py- 1text-sm pr-2 ${newPaddingClass}">403 <span class="block truncate py-2 text-sm pr-2 ${newPaddingClass}"> 403 404 ${spanMarkup}<span class="docs-outline-label">${title}</span> 404 405 </span> … … 479 480 newItem.innerHTML = ` 480 481 <span class="block hover:bg-gray-300" href="#"> 481 <span class="block truncate py- 1text-sm pr-2 ${newPaddingClass}">482 <span class="block truncate py-2 text-sm pr-2 ${newPaddingClass}"> 482 483 ${spanMarkup}<input type="text" class="docs-input w-full text-slate-600 box-border" style="width: calc( 100% - 16px - 0.25rem );"> 483 484 </span> … … 548 549 } 549 550 if ( activeItem ) { 551 const i18n = config.i18n || {}; 552 const isPost = activeItem.classList.contains('docs-post'); 553 const isTopLevelFolder = activeItem.classList.contains('docs-folder') && activeItem.parentElement && 'docs-outline' === activeItem.parentElement.id; 554 let confirmMessage = i18n.delete_outline_confirm || 'Delete this outline and all nested content? This cannot be undone.'; 555 556 if (isPost) { 557 confirmMessage = i18n.delete_doc_confirm || 'Delete this document permanently? This cannot be undone.'; 558 } else if (isTopLevelFolder) { 559 confirmMessage = i18n.delete_project_confirm || 'Delete this project and all its outlines/documents? This cannot be undone.'; 560 } 561 562 if ( ! window.confirm(confirmMessage) ) { 563 return; 564 } 565 550 566 let postIds = []; 551 567 const isProject = this.currentProject && this.currentProject === activeItem; … … 718 734 newIndex.innerHTML = ` 719 735 <span class="block hover:bg-gray-300"> 720 <span class="block truncate py- 1text-sm pr-2 pl-6">736 <span class="block truncate py-2 text-sm pr-2 pl-6"> 721 737 ${spanMarkup}<span>easydocs-welcome</span> 722 738 </span> … … 790 806 791 807 const status = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 792 if ( status .success ) {808 if ( status && status.success ) { 793 809 this.addDocBtn.disabled = false; 794 810 this.insertDocBtn.disabled = false; … … 828 844 829 845 const status = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 830 if ( status .success ) {846 if ( status && status.success ) { 831 847 const id = status.data.id; 832 848 newItem.setAttribute('data-id', id); … … 851 867 }; 852 868 const status = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 853 if ( status .success ) {869 if ( status && status.success ) { 854 870 this.updateOutline(newItem); 855 871 } … … 863 879 }; 864 880 const status = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 865 if ( status .success ) {881 if ( status && status.success ) { 866 882 this.updateOutline(); 867 883 postIds.forEach(id => { -
easy-docs/trunk/admin/js/partials/library.js
r3217183 r3475230 2 2 constructor(selector, context = document) { 3 3 this.elements = typeof selector === 'string' ? this.get(selector, context) : [selector]; 4 } 5 6 get(selector, context = document) { 7 return Array.from(context.querySelectorAll(selector)); 4 8 } 5 9 -
easy-docs/trunk/admin/js/partials/sets.js
r3240911 r3475230 20 20 if (this.submit) { 21 21 this.submit.addEventListener( 'click', (event) => { 22 event.preventDefault(); 22 23 const settings = this.form.querySelectorAll('.easydocs-option'); 23 24 const values = {}; … … 48 49 const status = await _$.sendAjaxRequest(config.ajaxUrl, data, this.handleError.bind(this)); 49 50 this.submit.disabled = false; 50 if (status .success) {51 if (status && status.success) { 51 52 location.reload(); 52 53 } -
easy-docs/trunk/admin/js/partials/stats.js
r3240911 r3475230 112 112 113 113 sortTable(column) { 114 column = parseInt(column );114 column = parseInt(column, 10); 115 115 const tbody = this.table.querySelector('tbody'); 116 if ( ! tbody ) return; 116 117 const rows = Array.from(tbody.querySelectorAll('tr')); 117 118 … … 137 138 if ((column === 2 || column === 3 || column === 4) && !isNaN(parseFloat(contentA)) && !isNaN(parseFloat(contentB))) { 138 139 return compareNumbers(contentA, contentB); 139 } else {140 console.log(column);141 140 } 142 141 -
easy-docs/trunk/admin/templates/easy-docs-admin.php
r3240911 r3475230 17 17 $outline = Getters::docs_outlines(); 18 18 ?> 19 <div class=" bg-gray-100 text-gray-900 h-full">20 <div class=" flex relative h-full">19 <div class="easy-docs-workspace"> 20 <div class="easy-docs-layout"> 21 21 <!-- Sidebar --> 22 < div id="docs-explorer" class="min-w-[300px] w-1/5 bg-gray-200 text-gray-800 flex-shrink-0">23 <div class=" px-4 py-2">24 <div id="docs-explorer-actions" class=" flex">25 <button id="easy-add-outline" class="w-7 h-7 mr-2 rounded-lg hover:bg-gray-400/20tt-btn" data-tooltip="Add Outline">22 <aside id="docs-explorer" class="easy-docs-explorer"> 23 <div class="easy-docs-pane-head"> 24 <div id="docs-explorer-actions" class="easy-docs-explorer-actions w-full"> 25 <button id="easy-add-outline" class="w-7 h-7 rounded-lg tt-btn" data-tooltip="Add Outline"> 26 26 <?php Markup::the_icon( 'folder-add' ); ?> 27 27 </button> 28 <button id="easy-add-doc" class="w-7 h-7 mr-2 rounded-lg hover:bg-gray-400/20tt-btn" data-tooltip="Add Document">28 <button id="easy-add-doc" class="w-7 h-7 rounded-lg tt-btn" data-tooltip="Add Document"> 29 29 <?php Markup::the_icon( 'document-add' ); ?> 30 30 </button> 31 <button id="easy-insert-doc" class="w-7 h-7 mr-2 rounded-lg hover:bg-gray-400/20tt-btn" data-tooltip="Link Existing Document">31 <button id="easy-insert-doc" class="w-7 h-7 rounded-lg tt-btn" data-tooltip="Link Existing Document"> 32 32 <?php Markup::the_icon( 'document-link' ); ?> 33 33 </button> 34 <button id="easy-remove-doc" class="w-7 h-7 mr-2rounded-lg tt-btn cursor-not-allowed text-gray-400" data-tooltip="Unlink Document">34 <button id="easy-remove-doc" class="w-7 h-7 rounded-lg tt-btn cursor-not-allowed text-gray-400" data-tooltip="Unlink Document"> 35 35 <?php Markup::the_icon( 'document-unlink' ); ?> 36 36 </button> 37 <button id="easy-delete-doc" class="w-7 h-7 rounded-lg hover:bg-gray-400/20tt-btn" data-tooltip="Delete">37 <button id="easy-delete-doc" class="w-7 h-7 rounded-lg tt-btn" data-tooltip="Delete"> 38 38 <?php Markup::the_icon( 'trash' ); ?> 39 39 </button> 40 <button id="easy-collapse-all" class="w-7 h-7 rounded-lg ml-auto hover:bg-gray-400/20 tt-btn" data-tooltip="Collapse All">40 <button id="easy-collapse-all" class="w-7 h-7 rounded-lg tt-btn ml-auto" data-tooltip="Collapse All"> 41 41 <?php Markup::the_icon( 'collapse-all' ); ?> 42 42 </button> … … 61 61 </ul> 62 62 </div> 63 </ div>63 </aside> 64 64 65 65 <!-- Content Area --> 66 < div id="docs-content" class="flex-1 flex flex-col">67 <div id="docs-info" class="easy-docs-info bg-gray-200 px-4 py-1 text-sm text-right">66 <section id="docs-content" class="easy-docs-content"> 67 <div id="docs-info" class="easy-docs-info"> 68 68 <span class="easy-docs-message easy-docs-info-welcome hidden"><?php esc_html_e( 'Welcome to Easy Docs! Need help to ', 'easy-docs' ); ?><a href="https://easyprolabs.com/easy-docs-docs/" target="_blank"><?php esc_html_e( 'Get Started?', 'easy-docs' ); ?></a></span> 69 69 <span class="easy-docs-message easy-docs-info-wb hidden"><?php esc_html_e( 'Select a Project from Left Sidebar to Get Started. ', 'easy-docs' ); ?><a href="https://easyprolabs.com/easy-docs-docs/" target="_blank"><?php esc_html_e( 'Need Help?', 'easy-docs' ); ?></a></span> 70 70 <span class="easy-docs-message easy-docs-info-project hidden relative"><span></span><a class="easy-docs-shortcopy ml-3 text-sm" href="#"><?php esc_html_e( 'Copy Shortcode', 'easy-docs' ); ?></a><span id="copy-indicator" class="copy-indicator ml-2 hidden"><?php esc_html_e( 'Copied!', 'easy-docs' ); ?></span><a class="ml-3 text-sm" href="https://easyprolabs.com/easy-docs-docs/" target="_blank"><?php esc_html_e( 'Need Help?', 'easy-docs' ); ?></a></span> 71 71 </div> 72 <div id="docs-tabs" class=" relative flex items-center bg-white"></div>72 <div id="docs-tabs" class="easy-docs-tabs"></div> 73 73 <!-- Tab Content --> 74 <div class=" p-4 bg-white flex-1">75 <div id="docs-tab-content" class=" w-full h-full mx-4 mt-2 relative min-h-screen">76 <div class="dpc-welcome absolute top-[40%] left-1/2 transform -translate-x-1/2 -translate-y-1/2">74 <div class="easy-docs-editor-shell"> 75 <div id="docs-tab-content" class="easy-docs-tab-content"> 76 <div class="dpc-welcome easy-docs-welcome-state"> 77 77 <ul class="text-sm"> 78 <li class="text-gray-400 hover:text-gray-800 mb-2">Click<?php Markup::the_icon( 'folder-add', 'mx-1' ); ?>to Create your first documentation project</li>79 <li class="text-gray-400 hover:text-gray-800 mb-2">Use<?php Markup::the_icon( 'folder-add', 'mx-1' ); ?>and<?php Markup::the_icon( 'document-add', 'mx-1' ); ?>to create outline(folder) and document for your project.</li>80 <li class="text-gray-400 hover:text-gray-800 mb-2">Use<?php Markup::the_icon( 'document-link', 'mx-1' ); ?>to Insert an existing document under seleted outline</li>81 <li class="text-gray-400 hover:text-gray-800 mb-2">Use<?php Markup::the_icon( 'document-unlink', 'mx-1' ); ?>to remove document from the project without deleting it.</li>82 <li class="text-gray-400 hover:text-gray-800 mb-2">Click<?php Markup::the_icon( 'trash', 'mx-1' ); ?>to Delete selected outline or document</li>78 <li>Click<?php Markup::the_icon( 'folder-add', 'mx-1' ); ?>to create your first documentation project.</li> 79 <li>Use<?php Markup::the_icon( 'folder-add', 'mx-1' ); ?>and<?php Markup::the_icon( 'document-add', 'mx-1' ); ?>to create outlines and docs inside projects.</li> 80 <li>Use<?php Markup::the_icon( 'document-link', 'mx-1' ); ?>to link an existing document under a selected outline.</li> 81 <li>Use<?php Markup::the_icon( 'document-unlink', 'mx-1' ); ?>to unlink a document without deleting it from database.</li> 82 <li>Click<?php Markup::the_icon( 'trash', 'mx-1' ); ?>to delete selected outline or document.</li> 83 83 </ul> 84 84 </div> 85 85 <div class="dpc-editor sr-only"> 86 <div class="flex"> 87 <div class="w-8/12"><?php wp_editor( '', 'docs-post-content', array( 'textarea_rows' => 25 ) ); ?></div> 88 <div class="mx-8 p-8 border-l border-gray-300 flex-1"> 89 <button id="easy-save-doc" class="disabled:cursor-not-allowed disabled:bg-gray-100 disabled:hover:bg-gray-100 disabled:text-gray-400 text-white bg-blue-700 hover:bg-blue-800 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700"><span class="mr-2 text-base"><?php Markup::the_icon( 'save' ); ?></span><span>Save Changes</span></button> 86 <div class="easy-docs-editor-layout"> 87 <div class="easy-docs-editor-main"><?php wp_editor( '', 'docs-post-content', array( 'textarea_rows' => 25 ) ); ?></div> 88 <aside class="easy-docs-editor-aside"> 89 <p class="easy-docs-pane-title mb-2"><?php esc_html_e( 'Publish', 'easy-docs' ); ?></p> 90 <p class="easy-docs-pane-meta mb-5"><?php esc_html_e( 'Save your active tab changes', 'easy-docs' ); ?></p> 91 <button id="easy-save-doc" class="easy-docs-save-btn"> 92 <span class="mr-2 text-base"><?php Markup::the_icon( 'save' ); ?></span> 93 <span><?php esc_html_e( 'Save Changes', 'easy-docs' ); ?></span> 94 </button> 90 95 </div> 91 96 </div> … … 93 98 </div> 94 99 </div> 95 </ div>100 </section> 96 101 97 102 <!-- Overlay --> -
easy-docs/trunk/admin/templates/easy-docs-sets.php
r3240911 r3475230 17 17 $settings = Get::admin_settings(); 18 18 ?> 19 <div class=" bg-gray-100 text-gray-900 h-full">20 <div class=" h-full p-10">21 <div id="easydocs-settings" class=" m-auto w-3/4 max-w-[1060px] bg-white text-gray-800 p-10">19 <div class="easy-docs-workspace"> 20 <div class="easy-docs-settings-wrap"> 21 <div id="easydocs-settings" class="easy-docs-settings-card"> 22 22 <?php echo Markup::render_form_fields( 'easydocs-admin-settings', $settings ); ?> 23 23 </div> -
easy-docs/trunk/admin/templates/easy-docs-stats.php
r3240911 r3475230 17 17 $outline = Getters::docs_outlines(); 18 18 ?> 19 <div class=" bg-gray-100 text-gray-900 h-full">20 <div class=" flex relative h-full">19 <div class="easy-docs-workspace"> 20 <div class="easy-docs-layout"> 21 21 <!-- Sidebar --> 22 <div id="docs-stats-filter" class="min-w-[300px] w-1/5 bg-gray-200 text-gray-800 flex-shrink-0"> 23 <div class="px-4 py-2"> 24 <div id="docs-stats-filter-actions" class="flex"> 25 <div><span class="font-semibold text-base"><?php esc_html_e( 'Document Filter', 'easy-docs' ); ?></span></div> 26 <button id="easy-collapse-all" class="w-7 h-7 rounded-lg ml-auto hover:bg-gray-400/20 tt-btn" data-tooltip="Collapse All"> 22 <aside id="docs-stats-filter" class="easy-docs-explorer"> 23 <div class="easy-docs-pane-head"> 24 <div> 25 <p class="easy-docs-pane-title"><?php esc_html_e( 'Document Filter', 'easy-docs' ); ?></p> 26 <p class="easy-docs-pane-meta"><?php esc_html_e( 'Filter statistics by project', 'easy-docs' ); ?></p> 27 </div> 28 <div id="docs-stats-filter-actions" class="easy-docs-explorer-actions"> 29 <button id="easy-collapse-all" class="w-7 h-7 rounded-lg ml-auto tt-btn" data-tooltip="Collapse All"> 27 30 <?php Markup::the_icon( 'collapse-all' ); ?> 28 31 </button> … … 30 33 </div> 31 34 <?php echo Markup::docs_outline_stats( $outline, 2, true ); // docs_outline() returns escaped HTML markup.?> 32 </ div>35 </aside> 33 36 34 37 <!-- Content Area --> 35 < div id="docs-stats-table" class="flex-1 flex flex-col">38 <section id="docs-stats-table" class="easy-docs-content easy-docs-stats-content"> 36 39 <?php do_action( 'easy_docs_stats_table' ); ?> 37 </ div>40 </section> 38 41 </div> 39 42 </div> -
easy-docs/trunk/admin/templates/header.php
r3217183 r3475230 13 13 ?> 14 14 15 <div class="bg-gray-50 p-4 flex justify-between items-center shadow"> 16 <h1 class="text-xl font-bold"><?php esc_html_e( 'Easy Docs', 'easy-docs' ); ?></h1> 17 <ul class="flex space-x-4"> 15 <div class="easy-docs-topbar"> 16 <div class="easy-docs-topbar__brand"> 17 <h1 class="easy-docs-topbar__title"><?php esc_html_e( 'Easy Docs', 'easy-docs' ); ?></h1> 18 <p class="easy-docs-topbar__subtitle"><?php esc_html_e( 'Documentation Workspace', 'easy-docs' ); ?></p> 19 </div> 20 <ul class="easy-docs-topbar__nav"> 18 21 <?php 19 22 foreach ( $this->get_submenu_pages() as $slug => $label ) { 23 $is_active = ( $this->current_page === $slug ) ? 'is-active' : ''; 20 24 printf( 21 '<li><a href="%1$s" class=" text-sm font-bold text-blue-500 hover:text-blue-700"><span>%2$s</span></a></li>',25 '<li><a href="%1$s" class="easy-docs-topbar__link %3$s"><span>%2$s</span></a></li>', 22 26 esc_url( wp_nonce_url( admin_url( 'admin.php?page=' . $slug ) , 'easy_docs_admin_nonce' ) ), 23 esc_html( $label ) 27 esc_html( $label ), 28 esc_attr( $is_active ) 24 29 ); 25 30 } -
easy-docs/trunk/easy-docs.php
r3246256 r3475230 15 15 * Plugin URI: https://easyprolabs.com/easy-docs 16 16 * Description: Create simple ajax documentation for your product 17 * Version: 1.4. 017 * Version: 1.4.1 18 18 * Author: easyprolabs 19 19 * Author URI: https://easyprolabs.com … … 30 30 31 31 // Currently plugin version. 32 define( 'EASY_DOCS_VERSION', '1.4. 0' );32 define( 'EASY_DOCS_VERSION', '1.4.1' ); 33 33 34 34 // Define plugin constants. -
easy-docs/trunk/front/js/front.build.js
r3240911 r3475230 1 (()=>{"use strict";var e={298:(e,t,o)=>{o.d(t,{A:()=> a});var n=o(601),i=o.n(n),r=o(314),s=o.n(r)()(i());s.push([e.id,'.easy-docs-wrapper{font-family:inherit}.easy-docs-sidebar::-webkit-scrollbar,.easy-docs-content::-webkit-scrollbar{width:3px;height:3px}.easy-docs-sidebar::-webkit-scrollbar-track,.easy-docs-content::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}.easy-docs-sidebar::-webkit-scrollbar-thumb,.easy-docs-content::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px}.easy-docs-sidebar::-webkit-scrollbar-thumb:hover,.easy-docs-content::-webkit-scrollbar-thumb:hover{background-color:#555}.easy-docs-sidebar .scroll-container,.easy-docs-content .scroll-container{scrollbar-width:thin;scrollbar-color:#888 #f1f1f1}.easy-docs-post-content{font-size:.9rem;line-height:1.5;background-color:#fff;font-weight:400;word-wrap:break-word;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}.easy-docs-post-content h6,.easy-docs-post-content h5,.easy-docs-post-content h4,.easy-docs-post-content h3,.easy-docs-post-content h2,.easy-docs-post-content h1{margin:0 0 1.5rem;font-weight:inherit}.easy-docs-post-content h1{font-size:1.667rem;line-height:1.2}@media only screen and (min-width: 1024px){.easy-docs-post-content h1{font-size:2.25rem;line-height:1.2}}.easy-docs-post-content h2{font-size:1.667rem;line-height:1.2}.easy-docs-post-content h3{font-size:1.333rem;line-height:1.2}.easy-docs-post-content h4{font-size:1.128em;font-weight:500;line-height:1.329787234}.easy-docs-post-content h5{font-size:1rem;line-height:1.5}.easy-docs-post-content h6{font-size:.8865rem;line-height:1.6920473773}.easy-docs-post-content a{color:#4381b5;text-decoration:underline}.easy-docs-post-content a:hover{text-decoration:underline}.easy-docs-post-content a:focus{outline:thin dotted;outline-offset:-0.05em}.easy-docs-post-content ol,.easy-docs-post-content ul{margin:1em 0;padding-left:1em}.easy-docs-post-content ol{list-style-type:decimal;line-height:1.5}.easy-docs-post-content ol li{margin-bottom:.5em}.easy-docs-post-content ul{list-style-type:disc;line-height:1.5}.easy-docs-post-content ul li{margin-bottom:.5em}.easy-docs-post-content ol ol,.easy-docs-post-content ul ul,.easy-docs-post-content ol ul,.easy-docs-post-content ul ol{margin-top:.5em;margin-bottom:.5em}.easy-docs-post-content ul.custom-bullets{list-style-type:none;padding-left:0}.easy-docs-post-content ul.custom-bullets li::before{content:"•";color:#007bff;font-size:1.2em;display:inline-block;width:1em;margin-left:-1em}.easy-docs-post-content p{margin:0 0 1.5rem}.easy-docs-post-content hr{overflow:visible;height:1px;margin-bottom:1.5rem;border:0;background-color:#e6e6e6}.easy-docs-post-content figure{margin:0}.easy-docs-post-content code,.easy-docs-post-content pre{font-family:"Andale Mono",AndaleMono,"Lucida Console",monospace;font-size:.8865rem;line-height:1.6920473773}.easy-docs-post-content code p:last-of-type,.easy-docs-post-content pre p:last-of-type{margin-bottom:0}.easy-docs-post-content pre{background-color:#f5f5f5;margin:0 0 1.5rem;max-width:100%;overflow:auto;padding:1.5em;white-space:pre;white-space:pre-wrap;word-wrap:break-word}.easy-docs-post-content code{background-color:#f5f5f5;padding:.125em .25em}.easy-docs-post-content table{font-size:.8865rem;line-height:1.6920473773;overflow:hidden;border-spacing:0;border-collapse:separate;width:100%;margin-bottom:1.5rem;border:1px solid #e6e6e6;border-radius:8px}.easy-docs-post-content table td,.easy-docs-post-content table th{padding:.5em 1em;text-align:left}.easy-docs-post-content table tr{background-color:rgba(0,0,0,0)}.easy-docs-post-content table tr:nth-of-type(2n){background-color:rgba(218,202,251,.2)}.easy-docs-post-content p:empty{margin:0;padding:0;line-height:0}.easy-docs-post-content p>br:only-child{display:none}.easy-docs-post-content blockquote{font-size:1rem;margin:30px auto;color:#555;padding:1.2em 30px 1.2em 45px;line-height:1.6;position:relative}.easy-docs-post-content blockquote::before{font-family:Arial;content:"“";color:inherit;font-size:4em;position:absolute;left:10px;top:-10px}.easy-docs-post-content blockquote::after{content:""}.easy-docs-post-content blockquote cite{display:block;color:#333;font-style:normal;font-weight:bold;margin-top:1em}.easy-docs-main-wrapper{position:relative;margin:1.5rem 0}.easy-docs-main-wrapper.wider-docs{width:100%;max-width:100%}.easy-docs-wrapper{position:relative}.wider-docs .easy-docs-wrapper{width:100%;max-width:100%;display:flex;justify-content:space-between}.easy-docs-header{background-color:#fff !important;border:1px solid #e6e6e6;margin-bottom:1px;position:relative;z-index:1}.wider-docs .easy-docs-header{display:none}.easy-docs-search-wrapper{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;z-index:999}.easy-docs-sidebar{width:calc(100% - 2px);visibility:hidden;position:absolute;top:43px;bottom:0;left:1px;background-color:#fff;z-index:99;padding:.75rem;transition:width .3s ease-in-out,visibility 0s ease-in-out .2s}.easy-docs-sidebar .easy-docs-outline{visibility:hidden}.sidebar-open:not(.wider-docs) .easy-docs-sidebar{border:1px solid #e6e6e6;border-width:1px 1px 1px 0;max-width:320px;visibility:visible;transition:visible .3s ease-in-out}.sidebar-open:not(.wider-docs) .easy-docs-sidebar .easy-docs-outline{visibility:visible;transition:visibility .15s ease-in-out .2s}.wider-docs .easy-docs-sidebar{visibility:visible;min-width:300px;position:static;background-color:rgba(0,0,0,0);padding:0;width:25%;flex-basis:25%;box-shadow:none}.wider-docs .easy-docs-sidebar .easy-docs-outline{visibility:visible}.easy-docs-content{width:100%;min-height:70vh;box-shadow:-19px -22px 49px -19px rgba(0,0,0,.1);border:1px solid #e6e6e6;padding:0}.wider-docs .easy-docs-content{width:calc(75% - 3em);flex-basis:calc(75% - 3em);height:100%}.easy-docs-content-header{display:flex;align-items:center;border-bottom:1px solid #e6e6e6}.easy-docs-content-header .easy-docs-copy-btn{position:relative;font-size:24px;width:40px;height:40px;margin-left:auto}.easy-docs-content-header .easy-docs-copy-btn .icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.wider-docs .easy-docs-content-header{padding:10px 10px 0 0;border-width:0}.wider-docs .easy-docs-content-header .easy-docs-sidebar-btn{display:none}.easy-docs-main-content,.easy-docs-content-footer{max-width:calc(640px + 1.5em);padding:1.5em;margin:0 auto}.wider-docs .easy-docs-main-content,.wider-docs .easy-docs-content-footer{max-width:640px;padding:1.5em 0}.easy-docs-content-footer{border-top:1px solid #e6e6e6;color:#969696}.wider-docs .easy-docs-content-footer{padding-bottom:3em}.easy-docs-helpful{margin-left:10px}.easy-docs-helpful.easy-docs-yes{color:green}.easy-docs-helpful.easy-docs-no{color:red}.easy-docs-copy-msg{display:none}.easy-docs-copy-btn.easy-link-copied .easy-docs-copy-msg{font-size:14px;position:absolute;z-index:1;bottom:100%;left:50%;display:block;visibility:visible;width:90px;margin-left:-35px;padding:5px;animation-name:hideMethod;animation-duration:.5s;animation-delay:1s;text-align:center;opacity:1;color:#fff;border-radius:6px;background-color:#555;animation-fill-mode:forwards}.screen-reader-text{position:absolute !important;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px}.screen-reader-text:focus{font-weight:bold;z-index:100000;top:5px;left:5px;display:block;clip:auto !important;width:auto;height:auto;padding:15px 23px 14px;text-decoration:none;color:#21759b;border-radius:3px;background-color:#f1f1f1;box-shadow:0 0 2px 2px rgba(0,0,0,.6);font-size:.7559rem;line-height:1.9843894695}@media only screen and (min-width: 1024px){.screen-reader-text:focus{font-size:.851rem;line-height:1.7626321974}}.alignleft{float:left;margin:.375rem 1.5rem .75rem 0}.alignright{float:right;margin:.375rem 0 .75rem 1.5rem}.aligncenter{clear:both;display:block;margin:0 auto 1.5rem}.alignnone{float:none;margin:0 auto 1.5rem}p .alignnone{margin:0}img{height:auto;max-width:100%;vertical-align:middle}a:hover>img,a:focus>img{opacity:.8}embed,iframe,object,video{margin-bottom:1.5em;max-width:100%;vertical-align:middle}p>embed,figure embed,p>iframe,figure iframe,p>object,figure object,p>video,figure video{margin-bottom:0}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.responsive-video{position:relative;border:1px solid #ddd;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;background:#000;margin-bottom:1.5rem}.responsive-video iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;margin:0}@keyframes hideMethod{from{opacity:1;visibility:visible}to{opacity:0;visibility:hidden}}.icon{position:relative;top:-0.0625em;display:inline-block;width:1em !important;height:1em !important;vertical-align:middle;stroke-width:0;stroke:currentColor;fill:currentColor;background-color:rgba(0,0,0,0) !important}.easy-docs-feedback-form label{display:block;color:currentColor}.easy-docs-content-title{font-size:2.25rem;line-height:1.1;font-weight:600;margin-bottom:1.5rem;padding-bottom:1.5rem;border-bottom:1px solid #e6e6e6}.easy-docs-content-title:empty{display:none}.easy-docs-toc{padding:1.5rem;background-color:#f7f7f7;font-size:1rem;margin-bottom:1rem}.easy-docs-toc li{padding-left:0;margin-top:.25rem}.easy-docs-toc li li{padding-left:1rem}.easy-docs-toc li li li{padding-left:2rem}.easy-docs-toc a{color:#4381b5;text-decoration:underline}.easy-docs-outline{font-size:15px}.easy-docs-outline ul a{padding:.1rem .5rem .1rem 0}.easy-docs-outline ul ul a{padding-left:1rem}.easy-docs-outline ul ul ul a{padding-left:1.75rem}.easy-docs-outline ul ul ul ul a{padding-left:2.5rem}.easy-docs-outline ul ul{display:none}.easy-docs-outline ul li.active>ul{display:block}.easy-docs-outline li>a{display:block;margin:.5rem 0}.easy-docs-outline li.doc-post>a{margin:.25rem 0;padding-top:.25rem;padding-bottom:.25rem}.easy-docs-outline .doc-folder{border-bottom:1px solid #e6e6e6}.easy-docs-outline .doc-folder .doc-folder{border-bottom:none}.easy-docs-outline .doc-folder>a{font-weight:bold;font-size:1em}.easy-docs-outline .doc-folder>a .icon{transition:transform .1s ease-in-out}.easy-docs-outline .doc-folder.active>a .icon{transform:rotate(90deg)}.easy-docs-outline .doc-post>a{font-size:1em}.easy-docs-outline .doc-post.active{background-color:#f7f7f7}.easy-docs-search-btn{margin-bottom:1rem;width:100%;color:#666;border:1px solid #ddd;border-radius:2px;padding:5px 10px;text-align:left;display:flex;align-items:center}.easy-docs-search-btn .icon{order:1;margin-left:auto;font-size:14px}.toggle-btn{margin-top:2px;z-index:299;background-color:rgba(0,0,0,0);box-shadow:none;border-width:0;outline-offset:-0.05em;padding:0;color:currentColor;vertical-align:top;transition:none;display:flex;align-items:center;font-size:18px}.toggle-btn:hover,.toggle-btn:focus,.toggle-btn.toggled-btn{background-color:rgba(0,0,0,0);box-shadow:none;border-width:0;color:currentColor}.toggle-btn:focus{outline-color:#969696}.toggle-btn .menu-icon{display:inline-block;position:relative;height:40px;width:40px}.toggle-btn .menu-icon:before,.toggle-btn .menu-icon:after{content:"";display:block}.toggle-btn .menu-icon:before,.toggle-btn .menu-icon .bar,.toggle-btn .menu-icon:after{position:absolute;right:10px;width:20px;height:2px;background-color:#262626;transition:.25s ease-in-out}.toggle-btn .menu-icon:before{top:12px;transform-origin:0 0}.toggle-btn .menu-icon .bar{top:18px;transform-origin:0 50%}.toggle-btn .menu-icon:after{top:24px;transform-origin:0 100%}.toggle-btn.toggled-on .menu-icon:before{transform:rotate(45deg) scaleX(1.05);right:7px}.toggle-btn.toggled-on .menu-icon:after{transform:rotate(-45deg) scaleX(1.05);top:26px;right:7px}.toggle-btn.toggled-on .menu-icon .bar{transform:scaleX(0);opacity:0}*, ::before, ::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*\n! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}::before,\n::after {\n --tw-content: \'\';\n}/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/html,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: inherit; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/body {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/hr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}/*\nRemove the default font size and weight for headings.\n*/h1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/a {\n color: inherit;\n text-decoration: inherit;\n}/*\nAdd the correct font weight in Edge and Safari.\n*/b,\nstrong {\n font-weight: bolder;\n}/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/code,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}/*\nAdd the correct font size in all browsers.\n*/small {\n font-size: 80%;\n}/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/sub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}sub {\n bottom: -0.25em;\n}sup {\n top: -0.5em;\n}/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/table {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/button,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/button,\nselect {\n text-transform: none;\n}/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/button,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}/*\nUse the modern Firefox focus style for all focusable elements.\n*/:-moz-focusring {\n outline: auto;\n}/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/:-moz-ui-invalid {\n box-shadow: none;\n}/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/progress {\n vertical-align: baseline;\n}/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/::-webkit-search-decoration {\n -webkit-appearance: none;\n}/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}/*\nAdd the correct display in Chrome and Safari.\n*/summary {\n display: list-item;\n}/*\nRemoves the default spacing and border for appropriate elements.\n*/blockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}fieldset {\n margin: 0;\n padding: 0;\n}legend {\n padding: 0;\n}ol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}/*\nReset default styling for dialogs.\n*/dialog {\n padding: 0;\n}/*\nPrevent resizing textareas horizontally by default.\n*/textarea {\n resize: vertical;\n}/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/input::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}/*\nSet the default cursor for buttons.\n*/button,\n[role="button"] {\n cursor: pointer;\n}/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/:disabled {\n cursor: default;\n}/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/img,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/img,\nvideo {\n max-width: 100%;\n height: auto;\n}/* Make elements with the HTML hidden attribute stay hidden by default */[hidden]:where(:not([hidden="until-found"])) {\n display: none;\n}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-4{left:1rem}.right-2{right:0.5rem}.top-1\\/2{top:50%}.mx-auto{margin-left:auto;margin-right:auto}.\\!mr-3{margin-right:0.75rem !important}.mb-0{margin-bottom:0px}.mb-1{margin-bottom:0.25rem}.mb-2{margin-bottom:0.5rem}.mb-3{margin-bottom:0.75rem}.mb-4{margin-bottom:1rem}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mt-1{margin-top:0.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:0.5rem}.mt-5{margin-top:1.25rem}.block{display:block}.inline-block{display:inline-block}.hidden{display:none}.h-8{height:2rem}.max-h-96{max-height:24rem}.w-3\\/4{width:75%}.w-8{width:2rem}.w-full{width:100%}.-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:0.25rem}.rounded-lg{border-radius:0.5rem}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.\\!border-gray-300{--tw-border-opacity:1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1)) !important}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-900\\/10{border-color:rgb(15 23 42 / 0.1)}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.\\!p-2{padding:0.5rem !important}.p-10{padding:2.5rem}.p-2{padding:0.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.\\!px-4{padding-left:1rem !important;padding-right:1rem !important}.\\!py-2{padding-top:0.5rem !important;padding-bottom:0.5rem !important}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.py-3{padding-top:0.75rem;padding-bottom:0.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:0.5rem}.pr-2{padding-right:0.5rem}.text-center{text-align:center}.\\!text-base{font-size:16px !important;line-height:28px !important}.text-base{font-size:16px;line-height:28px}.text-lg{font-size:20px;line-height:30px}.text-sm{font-size:15px;line-height:22px}.text-xl{font-size:24px;line-height:32px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.\\!outline{outline-style:solid !important}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.ring-slate-900\\/10{--tw-ring-color:rgb(15 23 42 / 0.1)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\\:bg-slate-100\\/50:hover{background-color:rgb(241 245 249 / 0.5)}.focus\\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.focus\\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246 / var(--tw-ring-opacity, 1))}',""]);const a=s},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",n=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),n&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),n&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,n,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var d=0;d<e.length;d++){var l=[].concat(e[d]);n&&s[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),o&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=o):l[2]=o),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={id:n,exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);class n{constructor(e,t=document){this.elements="string"==typeof e?this.get(e,t):[e]}static async sendAjaxRequest(e,t,o=console.error){const n=new URLSearchParams(t);try{const t=await fetch(e,{method:"POST",body:n,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if(!t.ok)throw new Error("Network response was not ok");return await t.json()}catch(e){return o(e.message),null}}static template(e,t){return e.replace(/\{\{(\w+)\}\}/g,((e,o)=>t[o]||""))}static strToHTML(e){const t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}static escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">")}static get_icon(e,t=""){const o=document.querySelector("#icon-".concat(e)),n=o.getAttribute("viewBox")||"0 0 24 24";return'<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-'.concat(e," ").concat(t,'" aria-hidden="true" role="img" focusable="false" viewBox="').concat(n,'">').concat(o.innerHTML,"</svg>")}}const i=(e,t=document)=>new n(e,t);Object.getOwnPropertyNames(n).forEach((e=>{"function"==typeof n[e]&&"prototype"!==e&&(i[e]=n[e])}));const r=new function(){this.data=window.Easy_Docs_Front_Data||{},this.store={}};var s=o(298);function a(e){return e.split("\n").map((e=>e.trim())).filter((e=>e)).join("")}const c=new WeakMap;class d extends HTMLElement{constructor(){super(),c.set(this,this.attachShadow({mode:"closed"})),this.wrapper=null,this.isModalOpen=!0,this.prevSearchTerm="",this.isSearchOpen=!1,this.serverSearchDelay=null}connectedCallback(){c.get(this);const e=document.createElement("style");e.innerHTML=s.A,c.get(this).append(e),this.render(),this.styleUpdate(),this.events(),this.dispatchEvent(new CustomEvent("EasyDocsLoaded",{bubbles:!0,composed:!0,detail:{instance:this,root:c.get(this)}}))}render(){const e=this.getAttribute("id"),t=this.getAttribute("outline");if(!e||!t)return;const o=r.data,n=o?.outline||{},s=n[t]?.outline||{},d=o?.docs||{},l=this.getWelcomeIdFromUrl();let p=l||0;const h=Object.keys(s).filter((e=>e.startsWith("EasyDocs_")));if(h.length>0)for(let e=0;e<h.length;e++){const t=s[h[e]];if(d["id-"+t]){let o=d["id-"+t].title||"";if(o=o.toLowerCase(),"easydocs-welcome"===o){p=0===p?t:p,delete s[h[e]];break}}}const g=n[t]?.content||"",m=this.renderOutline(s,!0);if(l){let e=m.querySelector('[data-id="'.concat(l,'"]'));for(;e&&!e.classList.contains("docs-outline");)e.classList.contains("docs-outline-item")&&e.classList.add("active"),e=e.parentElement}const u=this.renderDefault(g,p),b=this.renderSearch(),f=document.createElement("div"),w=document.createElement("div"),y=document.createElement("div"),v=document.createElement("div");y.classList.add("easy-docs-sidebar"),v.classList.add("easy-docs-content"),y.append(m),v.append(function(){const e=r?.data?.i18n||{};return i.strToHTML(a('\n <div class="easy-docs-content-header">\n <button type="button" class="easy-docs-sidebar-btn toggle-btn" title="'.concat(e.browseDocs,'"><span class="menu-icon"><span class="bar"></span></span></button>\n <button type="button" class="easy-docs-copy-btn" title="').concat(e.copyLink,'">').concat(i.get_icon("copy-link"),'<span class="easy-docs-copy-msg">').concat(e.copiedMsg,"</span></button>\n </div>\n ")))}(),u),w.classList.add("easy-docs-wrapper"),w.append(b,y,v),f.classList.add("easy-docs-main-wrapper"),f.append(w),c.get(this).append(f),this.wrapper=f}events(){const e=c.get(this),t=e.querySelector(".easy-docs-outline"),o=e.querySelector(".easy-docs-main-content"),n=e.querySelector(".easy-docs-search-btn"),r=e.querySelector(".docs-search-input"),s=e.querySelector(".docs-search-close"),a=e.querySelector(".docs-search-results"),d=e.querySelector(".easy-docs-sidebar-btn"),l=e.querySelector(".easy-docs-copy-btn");this.wrapper&&window.addEventListener("resize",(()=>{setTimeout(this.styleUpdate.bind(this),100)})),t&&t.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest(".docs-outline-item");t&&this.filterPosts(t)})),o&&o.addEventListener("click",(e=>{const n=e.target;if(n.classList.contains("post-outline")){e.preventDefault();const t=n.getAttribute("data-id"),i=o.querySelector("#".concat(t));i&&i.scrollIntoView({behavior:"smooth",block:"start"})}else if("a"===n.tagName.toLowerCase()){const o=parseInt(n.getAttribute("data-post-id"));if(o&&t){let n=t.querySelector('[data-id="'.concat(o,'"]'));if(n)for(e.preventDefault(),this.fetchPost(o),t.querySelectorAll(".docs-outline-item.active").forEach((e=>{e.classList.remove("active")}));n&&!n.classList.contains("docs-outline");)n.classList.contains("docs-outline-item")&&n.classList.add("active"),n=n.parentElement}}})),d&&d.addEventListener("click",(e=>{e.preventDefault(),this.toggleSidebar()})),n&&n.addEventListener("click",(e=>{e.preventDefault(),this.searchInit()})),document.addEventListener("keydown",(e=>{"Escape"!==e.key&&27!==e.keyCode||this.isSearchOpen&&this.searchClose()})),s&&s.addEventListener("click",(e=>{e.preventDefault(),this.isSearchOpen&&this.searchClose()})),l&&l.addEventListener("click",(e=>{if(l.classList.contains("easy-link-copied")||!o)return;const t=o.getAttribute("post-id");if(!t)return;let n=new URL(window.location.href);n.searchParams.set("easyDocId",t),navigator.clipboard.writeText(n.toString()).then((()=>{l.classList.add("easy-link-copied"),setTimeout((()=>{l.classList.remove("easy-link-copied")}),1e3)})).catch((e=>{console.error("Failed to copy URL: ",e)}))})),r&&["keyup","paste"].forEach((e=>{r.addEventListener(e,(e=>{e.preventDefault(),this.searchDocs(r)}))})),a&&a.addEventListener("click",(o=>{o.preventDefault();const n=o.target.closest(".docs-search-item");if(n){const o=n.getAttribute("data-id");if(!o)return;let r=t.querySelector('[data-id="'.concat(o,'"]'));for(this.searchClose(),this.toggleSidebar(),e.querySelector(".easy-docs-main-content").innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(i.get_icon("spinners","text-xl"),"</div>"),this.fetchPost(o),t.querySelectorAll(".docs-outline-item.active").forEach((e=>{e.classList.remove("active")}));r&&!r.classList.contains("docs-outline");)r.classList.contains("docs-outline-item")&&r.classList.add("active"),r=r.parentElement}}))}styleUpdate(){if(!this.wrapper)return;const e=parseFloat(getComputedStyle(this.wrapper).width);this.wrapper.classList.remove("wider-docs","medium-docs","narrow-docs"),this.wrapper.classList.add(this.getWidthClass(e))}getWidthClass(e){return e>1024?"wider-docs":e>720?"medium-docs":"narrow-docs"}toggleSidebar(){const e=c.get(this).querySelector(".easy-docs-sidebar-btn");this.wrapper&&this.wrapper.classList.contains("wider-docs")||e&&(this.wrapper.classList.toggle("sidebar-open"),e.classList.toggle("toggled-on"))}renderOutline(e,t){if(!e||0===Object.keys(e).length)return"";let o=document.createElement("ul");if(Object.keys(e).forEach((t=>{const n=e[t];if(t.startsWith("EasyDocs_"))o=this.addPostsToOutline(n,o);else{const n=document.createElement("li");n.classList.add("docs-outline-item","doc-folder");let r=t;n.innerHTML='<a href="#" class="easy-docs-outline-link">'.concat(i.get_icon("right","mr-2")).concat(r,"</a>");const s=e[t],a=this.renderOutline(s,!1);""!==a&&n.appendChild(a),o.appendChild(n)}})),t){const e=document.createElement("div"),t=r?.data?.i18n||{},n='<button type="button" class="easy-docs-search-btn">'.concat(i.get_icon("search")).concat(t.search,"</button>");return e.classList.add("easy-docs-outline"),e.append(i.strToHTML(n),o),e}return o}addPostsToOutline(e,t){const o=document.createElement("li");o.classList.add("docs-outline-item","doc-post"),o.setAttribute("data-id",e);const n=(r.data?.docs||{})["id-".concat(e)]||"";return n?(o.innerHTML='<a href="'.concat(n.url,'" class="easy-docs-post-link">').concat(i.get_icon("file-text","mr-2")).concat(n.title,"</a>"),t.appendChild(o),t):t}renderDefault(e,t){const o=document.createElement("div");return o.classList.add("easy-docs-main-content"),t?(o.innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(i.get_icon("spinners","text-xl"),"</div>"),this.fetchPost(t),o):(o.innerHTML=e,o)}getWelcomeIdFromUrl(){const e=new URLSearchParams(window.location.search).get("easyDocId"),t=parseInt(e,10);return!isNaN(t)&&Number.isInteger(t)?t:null}renderSearch(){const e=document.createElement("div"),t=document.createElement("div");return t.innerHTML='<div class="relative"><span class="absolute left-4 top-1/2 -translate-y-1/2 text-slate-400">'.concat(i.get_icon("search"),'</span><input type="text" class="docs-search-input w-full py-3 px-10 outline-none" placeholder="Search..."><button class="docs-search-close absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 text-lg border border-slate-300 rounded">').concat(i.get_icon("esc"),'</button></div><div class="docs-search-results p-4 border-t border-gray-200"><ul class="docs-search-results-list p-5"></ul></div>'),t.classList.add("docs-search-results-wrapper","mx-auto","mt-5","w-3/4","bg-white","rounded-md","ring-1","ring-slate-900/10","rounded-lg","max-h-96","overflow-y-auto"),e.append(t),e.classList.add("easy-docs-search-wrapper","hidden"),e}generateArticleOutline(e){const t=document.createElement("div");t.className="article-outline";const o=document.createElement("div");o.innerHTML=e,e=o;const n=document.createElement("ul");n.className="text-sm",t.appendChild(n);let i=0,r=n,s=null;const a=e.querySelectorAll("h1, h2, h3, h4, h5, h6");return 0===a.length?{article:e,outline:null}:(a.forEach((e=>{!function(e){const t=parseInt(e.tagName[1]),o=document.createElement("li");o.className="outline-item";const n=document.createElement("a");n.classList.add("block","post-outline");const a=e.id||"h-"+e.textContent.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"");if(e.id=a,n.setAttribute("data-id",a),n.href="#".concat(a),n.textContent=e.textContent,o.appendChild(n),0===i)r.appendChild(o);else if(t>i){const e=document.createElement("ul");s&&s.appendChild(e),e.appendChild(o),r=e}else if(t<i){let e=i-t;for(;e--;)r=r.parentElement.closest("ul");r.appendChild(o)}else r.appendChild(o);i=t,s=o}(e)})),{article:e,outline:t})}searchInit(){this.isSearchOpen=!0;const e=c.get(this),t=e.querySelector(".easy-docs-search-wrapper"),o=e.querySelector(".docs-search-input");t&&t.classList.remove("hidden"),o&&o.focus()}searchClose(){this.isSearchOpen=!1;const e=c.get(this),t=e.querySelector(".easy-docs-search-wrapper"),o=e.querySelector(".docs-search-input"),n=e.querySelector(".docs-search-results-list");t&&t.classList.add("hidden"),o&&(o.value=""),n&&(n.innerHTML="")}searchDocs(e){const t=c.get(this);let o=e.value;this.prevSearchTerm!==o&&(this.prevSearchTerm=o,clearTimeout(this.serverSearchDelay),this.serverSearchDelay=setTimeout(function(){if(o=o.trim().toLowerCase(),o){const e=t.querySelector(".docs-search-results-list");e&&(e.innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(i.get_icon("spinners","text-xl"),"</div>")),this.fetchSearchResults(o)}}.bind(this),300))}async fetchSearchResults(e){const t=c.get(this).querySelector(".docs-search-results-list"),o=this.getAttribute("outline"),n={security:r.data.security,action:"easy_docs_search",s:e,outline:o},s=await i.sendAjaxRequest(r.data.ajaxUrl,n,this.handleError.bind(this));s&&(!s.success&&s.data?t.innerHTML="".concat(s.data):s.success&&(t.innerHTML="",Object.keys(s.data).forEach((e=>{const o=s.data[e];if(!o)return;const n=document.createElement("li");n.classList.add("docs-search-item","rounded-md","ring-1","ring-slate-900/10","rounded-lg","p-4","cursor-pointer","mb-3","hover:bg-slate-100/50"),n.setAttribute("data-id",o.id),n.innerHTML='<a class="docs-search-item-link block" href="#" data-id="'.concat(o.id,'"><span class="block text-lg font-bold pb-2 border-b border-slate-900/10 mb-2">').concat(o.title,"</span><span>").concat(o.snippet,"</a>"),t.appendChild(n)}))))}async fetchPost(e){if(!e)return;const t=r.data?.docs?.["id-".concat(e)];if(!t)return;const o={security:r.data.security,action:"easy_docs_get_doc",id:e},n=r?.data?.i18n||{},s=r?.store||{};let d="";if(s[e])d=s[e];else{const t=await i.sendAjaxRequest(r.data.ajaxUrl,o,this.handleError.bind(this));if(!t.success)return;d=t.data?t.data:"",s[e]=d}const l=t.title&&"easydocs-welcome"!==t.title?t.title:"",p=c.get(this).querySelector(".easy-docs-main-content");let h="";if(d)if("easydocs-welcome"!==t.title){const e=this.generateArticleOutline(d);h=e.outline,d=e.article}else d=i.strToHTML("<div>".concat(d,"</div>"));const g=h?'<div class="easy-docs-toc"><span class="easy-docs-toc-heading">'.concat(n.toc,"</span>").concat(h.outerHTML,"</div>"):"";p.innerHTML='<div class="easy-docs-content-title">'.concat(l,"</div>").concat(g,'<div class="easy-docs-post-content">').concat(d?d.innerHTML:"","</div>"),r.data.isPremium&&"yes"===r.data.feedback&&"easydocs-welcome"!==t.title&&p.append(function(){const e=r?.data?.i18n||{};return i.strToHTML(a('\n <div class="easy-docs-content-footer">\n <div class="easy-docs-content-feedback">\n <span>'.concat(e.isHelpful,'</span>\n <span>\n <a href="#" class="easy-docs-helpful easy-docs-yes">').concat(e.yes,'</a>\n <a href="#" class="easy-docs-helpful easy-docs-no">').concat(e.no,"</a>\n </span>\n </div>\n </div>\n ")))}()),p.setAttribute("post-id",e)}filterPosts(e){if(e.classList.contains("active"))e.classList.contains("doc-folder")&&(e.querySelectorAll(".doc-folder.active").forEach((e=>{e.classList.remove("active")})),e.classList.remove("active"));else{if(!e.classList.contains("doc-folder")){const t=e.getAttribute("data-id"),o=c.get(this).querySelector(".doc-post.active");o&&o.classList.remove("active"),this.toggleSidebar(),t&&(c.get(this).querySelector(".easy-docs-main-content").innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(i.get_icon("spinners","text-xl"),"</div>"),this.fetchPost(t))}e.classList.add("active")}}handleError(e){console.log(e)}}const l=d;new class{constructor(){"customElements"in window&&customElements.define("easy-docs",l)}}})();1 (()=>{"use strict";var e={298:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(601),s=o.n(n),r=o(314),a=o.n(r)()(s());a.push([e.id,'.easy-docs-wrapper{font-family:inherit}.easy-docs-sidebar::-webkit-scrollbar,.easy-docs-content::-webkit-scrollbar{width:3px;height:3px}.easy-docs-sidebar::-webkit-scrollbar-track,.easy-docs-content::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}.easy-docs-sidebar::-webkit-scrollbar-thumb,.easy-docs-content::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px}.easy-docs-sidebar::-webkit-scrollbar-thumb:hover,.easy-docs-content::-webkit-scrollbar-thumb:hover{background-color:#555}.easy-docs-sidebar .scroll-container,.easy-docs-content .scroll-container{scrollbar-width:thin;scrollbar-color:#888 #f1f1f1}.easy-docs-post-content{--docs-text: #1f2937;--docs-heading: #0f172a;--docs-muted: #64748b;--docs-link: #0b63ce;--docs-link-hover: #084b9a;--docs-border: #dbe4ee;--docs-border-strong: #c7d5e4;--docs-surface: #f8fbff;--docs-surface-alt: #f1f5fb;--docs-code-bg: #f4f7fc;--docs-code-border: #d7e1ee;--docs-pre-bg: #0b1220;--docs-pre-border: #1d2a3c;--docs-pre-text: #dce7f6;--docs-quote-accent: #3b82f6;color:var(--docs-text);font-family:inherit;font-size:17px;font-weight:400;line-height:1.72;text-rendering:optimizeLegibility;word-wrap:break-word;-moz-osx-font-smoothing:grayscale}.easy-docs-post-content>*:last-child{margin-bottom:0}.easy-docs-post-content p,.easy-docs-post-content ul,.easy-docs-post-content ol,.easy-docs-post-content dl,.easy-docs-post-content table,.easy-docs-post-content pre,.easy-docs-post-content blockquote,.easy-docs-post-content figure,.easy-docs-post-content details,.easy-docs-post-content .wp-block-embed,.easy-docs-post-content .wp-block-image,.easy-docs-post-content .wp-block-table{margin:0 0 1.35rem}.easy-docs-post-content p:empty{line-height:0;margin:0;padding:0}.easy-docs-post-content p>br:only-child{display:none}.easy-docs-post-content h5,.easy-docs-post-content h6,.easy-docs-post-content h4,.easy-docs-post-content h3,.easy-docs-post-content h2,.easy-docs-post-content h1{color:var(--docs-heading);font-weight:700;letter-spacing:-0.02em;line-height:1.24;margin:2rem 0 .85rem;scroll-margin-top:90px}.easy-docs-post-content h1{font-size:clamp(1.72em,1.1vw + 1.38em,2.22em);margin-top:0;padding-bottom:.45em;border-bottom:1px solid var(--docs-border)}.easy-docs-post-content h2{font-size:clamp(1.38em,.9vw + 1.08em,1.78em);margin-top:2.2em;padding-bottom:.35em;border-bottom:1px solid var(--docs-border)}.easy-docs-post-content h3{font-size:clamp(1.2em,.58vw + 1.01em,1.44em);margin-top:1.95em}.easy-docs-post-content h4{font-size:1.08em;margin-top:1.75em}.easy-docs-post-content h5,.easy-docs-post-content h6{font-size:.96em;letter-spacing:-0.01em;margin-top:1.55em}.easy-docs-post-content a{color:var(--docs-link);font-weight:500;text-decoration:underline;-webkit-text-decoration-color:rgba(11,99,206,.35);text-decoration-color:rgba(11,99,206,.35);text-decoration-thickness:.08em;text-underline-offset:.16em;transition:color .16s ease,-webkit-text-decoration-color .16s ease;transition:color .16s ease,text-decoration-color .16s ease;transition:color .16s ease,text-decoration-color .16s ease,-webkit-text-decoration-color .16s ease}.easy-docs-post-content a:hover{color:var(--docs-link-hover);-webkit-text-decoration-color:rgba(8,75,154,.6);text-decoration-color:rgba(8,75,154,.6)}.easy-docs-post-content a:focus{outline:2px solid rgba(59,130,246,.35);outline-offset:2px}.easy-docs-post-content strong{color:#111827;font-weight:700}.easy-docs-post-content em{color:#334155}.easy-docs-post-content ul,.easy-docs-post-content ol{padding-left:1.5em}.easy-docs-post-content li+li{margin-top:.35em}.easy-docs-post-content ul{list-style-type:disc}.easy-docs-post-content ul ::marker{color:#55789f}.easy-docs-post-content ol{list-style-type:decimal}.easy-docs-post-content ol ::marker{color:#49668a;font-weight:600}.easy-docs-post-content ul ul{list-style-type:circle}.easy-docs-post-content ul ul ul{list-style-type:square}.easy-docs-post-content li>ul,.easy-docs-post-content li>ol{margin-top:.45em;margin-bottom:.2em}.easy-docs-post-content hr{background:linear-gradient(90deg, rgba(148, 163, 184, 0.1), rgba(148, 163, 184, 0.6), rgba(148, 163, 184, 0.1));border:0;height:1px;margin:2em 0;overflow:visible}.easy-docs-post-content img{border:1px solid var(--docs-border);border-radius:12px;height:auto;max-width:100%}.easy-docs-post-content figure{margin-left:0;margin-right:0}.easy-docs-post-content figcaption,.easy-docs-post-content .wp-caption-text{color:var(--docs-muted);font-size:.88em;margin-top:.45em;text-align:center}.easy-docs-post-content .wp-caption{margin:0 0 1.35em;max-width:100%}.easy-docs-post-content blockquote{background:linear-gradient(180deg, #f8fbff, #f3f8ff);border:1px solid var(--docs-border);border-left:4px solid var(--docs-quote-accent);border-radius:0 12px 12px 0;color:#334155;margin:1.65em 0;padding:.95em 1.1em .95em 1em}.easy-docs-post-content blockquote p:last-child{margin-bottom:0}.easy-docs-post-content blockquote cite{color:var(--docs-muted);display:block;font-size:.86em;font-style:normal;font-weight:600;margin-top:.6em}.easy-docs-post-content code,.easy-docs-post-content kbd,.easy-docs-post-content samp{background:var(--docs-code-bg);border:1px solid var(--docs-code-border);border-radius:6px;color:#112237;font-family:"Andale Mono",AndaleMono,"Lucida Console",monospace;font-size:.84em;padding:.14em .38em}.easy-docs-post-content kbd{border-bottom-width:2px;box-shadow:inset 0 -1px 0 rgba(15,23,42,.14);font-weight:700}.easy-docs-post-content pre{background:var(--docs-pre-bg);border:1px solid var(--docs-pre-border);border-radius:12px;color:var(--docs-pre-text);font-family:"Andale Mono",AndaleMono,"Lucida Console",monospace;font-size:.88em;line-height:1.72;margin:0 0 1.35em;max-width:100%;overflow:auto;padding:1em 1.15em;white-space:pre}.easy-docs-post-content pre code{background:rgba(0,0,0,0);border:0;color:inherit;font-size:inherit;padding:0}.easy-docs-post-content table{border:1px solid var(--docs-border-strong);border-collapse:separate;border-radius:12px;border-spacing:0;display:block;overflow-x:auto;width:100%}.easy-docs-post-content table thead th{background:#f5f9ff;color:var(--docs-heading);font-weight:700;letter-spacing:.01em;position:-webkit-sticky;position:sticky;top:0;z-index:1}.easy-docs-post-content table th,.easy-docs-post-content table td{border-bottom:1px solid var(--docs-border);min-width:120px;padding:.62em .84em;text-align:left;vertical-align:top;white-space:normal}.easy-docs-post-content table tbody tr:nth-child(even){background:var(--docs-surface)}.easy-docs-post-content table tbody tr:hover{background:var(--docs-surface-alt)}.easy-docs-post-content table tr:last-child td{border-bottom:0}.easy-docs-post-content dl{border:1px solid var(--docs-border);border-radius:10px;overflow:hidden}.easy-docs-post-content dl dt,.easy-docs-post-content dl dd{margin:0;padding:.68rem .85rem}.easy-docs-post-content dl dt{background:#f8fbff;color:var(--docs-heading);font-weight:700}.easy-docs-post-content dl dd+dt{border-top:1px solid var(--docs-border)}.easy-docs-post-content abbr[title]{cursor:help;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;text-decoration-thickness:.08em}.easy-docs-post-content mark{background:#fef3c7;border-radius:3px;color:#2f2200;padding:.05em .2em}.easy-docs-post-content sub,.easy-docs-post-content sup{font-size:.75em;line-height:0;position:relative;vertical-align:baseline}.easy-docs-post-content sup{top:-0.45em}.easy-docs-post-content sub{bottom:-0.2em}.easy-docs-post-content details{background:#f8fbff;border:1px solid var(--docs-border);border-radius:10px;overflow:hidden}.easy-docs-post-content details summary{cursor:pointer;color:var(--docs-heading);font-weight:600;padding:.72rem .88rem}.easy-docs-post-content details>*:not(summary){margin:0;padding:.25rem .88rem .85rem}.easy-docs-post-content embed,.easy-docs-post-content object,.easy-docs-post-content iframe,.easy-docs-post-content video{background:#000;border:0;border-radius:0;display:block;margin-bottom:1.35rem;max-width:100%;width:100%}.easy-docs-post-content .wp-block-embed,.easy-docs-post-content .wp-block-embed__wrapper{max-width:100%}.easy-docs-post-content iframe[src*="youtube.com"],.easy-docs-post-content iframe[src*="youtu.be"],.easy-docs-post-content iframe[src*="vimeo.com"],.easy-docs-post-content .wp-block-embed-youtube iframe,.easy-docs-post-content .wp-block-embed-vimeo iframe{aspect-ratio:16/9;box-shadow:0 12px 24px rgba(15,23,42,.14);height:auto}.easy-docs-post-content table,.easy-docs-post-content pre,.easy-docs-post-content blockquote,.easy-docs-post-content details,.easy-docs-post-content img,.easy-docs-post-content iframe,.easy-docs-post-content video{box-shadow:0 1px 2px rgba(15,23,42,.04)}.easy-docs-main-wrapper{position:relative;margin:1.5rem 0}.easy-docs-main-wrapper.wider-docs{width:100%;max-width:100%}.easy-docs-wrapper{position:relative}.wider-docs .easy-docs-wrapper{width:100%;max-width:100%;display:flex;justify-content:space-between}.easy-docs-header{background-color:#fff !important;border:1px solid #e6e6e6;margin-bottom:1px;position:relative;z-index:1}.wider-docs .easy-docs-header{display:none}.easy-docs-search-wrapper{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;z-index:999}.easy-docs-sidebar{width:calc(100% - 2px);visibility:hidden;position:absolute;top:43px;bottom:0;left:1px;background-color:#fff;z-index:99;padding:.75rem;transition:width .3s ease-in-out,visibility 0s ease-in-out .2s}.easy-docs-sidebar .easy-docs-outline{visibility:hidden}.sidebar-open:not(.wider-docs) .easy-docs-sidebar{border:1px solid #e6e6e6;border-width:1px 1px 1px 0;max-width:320px;visibility:visible;transition:visible .3s ease-in-out}.sidebar-open:not(.wider-docs) .easy-docs-sidebar .easy-docs-outline{visibility:visible;transition:visibility .15s ease-in-out .2s}.wider-docs .easy-docs-sidebar{visibility:visible;min-width:300px;position:static;background-color:rgba(0,0,0,0);padding:0;width:25%;flex-basis:25%;box-shadow:none;z-index:4}.wider-docs .easy-docs-sidebar .easy-docs-outline{visibility:visible}.easy-docs-content{width:100%;min-height:70vh;box-shadow:-19px -22px 49px -19px rgba(0,0,0,.1);border:1px solid #e6e6e6;padding:0}.wider-docs .easy-docs-content{width:calc(75% - 3em);flex-basis:calc(75% - 3em);height:100%}.easy-docs-content-header{display:flex;align-items:center;border-bottom:1px solid #e6e6e6}.easy-docs-content-header .easy-docs-copy-btn{position:relative;font-size:24px;width:40px;height:40px;margin-left:auto}.easy-docs-content-header .easy-docs-copy-btn .icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.wider-docs .easy-docs-content-header{padding:10px 10px 0 0;border-width:0}.wider-docs .easy-docs-content-header .easy-docs-sidebar-btn{display:none}.easy-docs-main-content,.easy-docs-content-footer{max-width:calc(680px + 1.5em);padding:1.5em;margin:0 auto}.wider-docs .easy-docs-main-content,.wider-docs .easy-docs-content-footer{max-width:680px;padding:1.5em 0}.easy-docs-content-footer{margin-top:1.5rem;border-top:1px solid #e6e6e6;color:#969696}.wider-docs .easy-docs-content-footer{padding-bottom:3em}.easy-docs-helpful{margin-left:10px}.easy-docs-helpful.easy-docs-yes{color:green}.easy-docs-helpful.easy-docs-no{color:red}.easy-docs-copy-msg{display:none}.easy-docs-copy-btn.easy-link-copied .easy-docs-copy-msg{font-size:14px;position:absolute;z-index:1;bottom:100%;left:50%;display:block;visibility:visible;width:90px;margin-left:-35px;padding:5px;animation-name:hideMethod;animation-duration:.5s;animation-delay:1s;text-align:center;opacity:1;color:#fff;border-radius:6px;background-color:#555;animation-fill-mode:forwards}.screen-reader-text{position:absolute !important;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px}.screen-reader-text:focus{font-weight:bold;z-index:100000;top:5px;left:5px;display:block;clip:auto !important;width:auto;height:auto;padding:15px 23px 14px;text-decoration:none;color:#21759b;border-radius:3px;background-color:#f1f1f1;box-shadow:0 0 2px 2px rgba(0,0,0,.6);font-size:.7559rem;line-height:1.9843894695}@media only screen and (min-width: 1024px){.screen-reader-text:focus{font-size:.851rem;line-height:1.7626321974}}.alignleft{float:left;margin:.375rem 1.5rem .75rem 0}.alignright{float:right;margin:.375rem 0 .75rem 1.5rem}.aligncenter{clear:both;display:block;margin:0 auto 1.5rem}.alignnone{float:none;margin:0 auto 1.5rem}p .alignnone{margin:0}img{height:auto;max-width:100%;vertical-align:middle}a:hover>img,a:focus>img{opacity:.8}embed,iframe,object,video{margin-bottom:1.5em;max-width:100%;vertical-align:middle}p>embed,figure embed,p>iframe,figure iframe,p>object,figure object,p>video,figure video{margin-bottom:0}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.responsive-video{position:relative;border:1px solid #ddd;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;background:#000;margin-bottom:1.5rem}.responsive-video iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;margin:0}@keyframes hideMethod{from{opacity:1;visibility:visible}to{opacity:0;visibility:hidden}}.icon{position:relative;top:-0.0625em;display:inline-block;width:1em !important;height:1em !important;vertical-align:middle;stroke-width:0;stroke:currentColor;fill:currentColor;background-color:rgba(0,0,0,0) !important}.easy-docs-feedback-form label{display:block;color:currentColor}.easy-docs-content-title{font-size:2.25rem;line-height:1.1;font-weight:600;margin-bottom:1.5rem;padding-bottom:1.5rem;border-bottom:1px solid #e6e6e6}.easy-docs-content-title:empty{display:none}.easy-docs-toc{padding:1.5rem;background-color:#f7f7f7;font-size:1rem;margin-bottom:1rem}.easy-docs-toc li{padding-left:0;margin-top:.25rem}.easy-docs-toc li li{padding-left:1rem}.easy-docs-toc li li li{padding-left:2rem}.easy-docs-toc a{color:#4381b5;text-decoration:underline}.easy-docs-outline{font-size:15px}.easy-docs-outline ul a{padding:.1rem .5rem .1rem 0}.easy-docs-outline ul ul a{padding-left:1rem}.easy-docs-outline ul ul ul a{padding-left:1.75rem}.easy-docs-outline ul ul ul ul a{padding-left:2.5rem}.easy-docs-outline ul ul{display:none}.easy-docs-outline ul li.active>ul{display:block}.easy-docs-outline li>a{display:block;margin:.5rem 0}.easy-docs-outline li.doc-post>a{margin:.25rem 0;padding-top:.25rem;padding-bottom:.25rem}.easy-docs-outline .doc-folder{border-bottom:1px solid #e6e6e6}.easy-docs-outline .doc-folder .doc-folder{border-bottom:none}.easy-docs-outline .doc-folder>a{font-weight:bold;font-size:1em}.easy-docs-outline .doc-folder>a .icon{transition:transform .1s ease-in-out}.easy-docs-outline .doc-folder.active>a .icon{transform:rotate(90deg)}.easy-docs-outline .doc-post>a{font-size:1em}.easy-docs-outline .doc-post.active{background-color:#f7f7f7}.easy-docs-search-btn{margin-bottom:1rem;width:100%;color:#666;border:1px solid #ddd;border-radius:2px;padding:5px 10px;text-align:left;display:flex;align-items:center}.easy-docs-search-btn .icon{order:1;margin-left:auto;font-size:14px}.toggle-btn{margin-top:2px;z-index:299;background-color:rgba(0,0,0,0);box-shadow:none;border-width:0;outline-offset:-0.05em;padding:0;color:currentColor;vertical-align:top;transition:none;display:flex;align-items:center;font-size:18px}.toggle-btn:hover,.toggle-btn:focus,.toggle-btn.toggled-btn{background-color:rgba(0,0,0,0);box-shadow:none;border-width:0;color:currentColor}.toggle-btn:focus{outline-color:#969696}.toggle-btn .menu-icon{display:inline-block;position:relative;height:40px;width:40px}.toggle-btn .menu-icon:before,.toggle-btn .menu-icon:after{content:"";display:block}.toggle-btn .menu-icon:before,.toggle-btn .menu-icon .bar,.toggle-btn .menu-icon:after{position:absolute;right:10px;width:20px;height:2px;background-color:#262626;transition:.25s ease-in-out}.toggle-btn .menu-icon:before{top:12px;transform-origin:0 0}.toggle-btn .menu-icon .bar{top:18px;transform-origin:0 50%}.toggle-btn .menu-icon:after{top:24px;transform-origin:0 100%}.toggle-btn.toggled-on .menu-icon:before{transform:rotate(45deg) scaleX(1.05);right:7px}.toggle-btn.toggled-on .menu-icon:after{transform:rotate(-45deg) scaleX(1.05);top:26px;right:7px}.toggle-btn.toggled-on .menu-icon .bar{transform:scaleX(0);opacity:0}*, ::before, ::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*\n! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}::before,\n::after {\n --tw-content: \'\';\n}/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n6. Use the user\'s configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/html,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: inherit; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/body {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/hr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}/*\nRemove the default font size and weight for headings.\n*/h1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/a {\n color: inherit;\n text-decoration: inherit;\n}/*\nAdd the correct font weight in Edge and Safari.\n*/b,\nstrong {\n font-weight: bolder;\n}/*\n1. Use the user\'s configured `mono` font-family by default.\n2. Use the user\'s configured `mono` font-feature-settings by default.\n3. Use the user\'s configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/code,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}/*\nAdd the correct font size in all browsers.\n*/small {\n font-size: 80%;\n}/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/sub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}sub {\n bottom: -0.25em;\n}sup {\n top: -0.5em;\n}/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/table {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/button,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/button,\nselect {\n text-transform: none;\n}/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/button,\ninput:where([type=\'button\']),\ninput:where([type=\'reset\']),\ninput:where([type=\'submit\']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}/*\nUse the modern Firefox focus style for all focusable elements.\n*/:-moz-focusring {\n outline: auto;\n}/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/:-moz-ui-invalid {\n box-shadow: none;\n}/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/progress {\n vertical-align: baseline;\n}/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/::-webkit-search-decoration {\n -webkit-appearance: none;\n}/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}/*\nAdd the correct display in Chrome and Safari.\n*/summary {\n display: list-item;\n}/*\nRemoves the default spacing and border for appropriate elements.\n*/blockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}fieldset {\n margin: 0;\n padding: 0;\n}legend {\n padding: 0;\n}ol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}/*\nReset default styling for dialogs.\n*/dialog {\n padding: 0;\n}/*\nPrevent resizing textareas horizontally by default.\n*/textarea {\n resize: vertical;\n}/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/input::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}/*\nSet the default cursor for buttons.\n*/button,\n[role="button"] {\n cursor: pointer;\n}/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/:disabled {\n cursor: default;\n}/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/img,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/img,\nvideo {\n max-width: 100%;\n height: auto;\n}/* Make elements with the HTML hidden attribute stay hidden by default */[hidden]:where(:not([hidden="until-found"])) {\n display: none;\n}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-4{left:1rem}.right-2{right:0.5rem}.top-1\\/2{top:50%}.mx-auto{margin-left:auto;margin-right:auto}.\\!mr-3{margin-right:0.75rem !important}.mb-0{margin-bottom:0px}.mb-1{margin-bottom:0.25rem}.mb-2{margin-bottom:0.5rem}.mb-3{margin-bottom:0.75rem}.mb-4{margin-bottom:1rem}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mt-1{margin-top:0.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:0.5rem}.mt-5{margin-top:1.25rem}.block{display:block}.inline-block{display:inline-block}.hidden{display:none}.h-8{height:2rem}.max-h-96{max-height:24rem}.w-3\\/4{width:75%}.w-8{width:2rem}.w-full{width:100%}.-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:0.25rem}.rounded-lg{border-radius:0.5rem}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.\\!border-gray-300{--tw-border-opacity:1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1)) !important}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-900\\/10{border-color:rgb(15 23 42 / 0.1)}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.\\!p-2{padding:0.5rem !important}.p-10{padding:2.5rem}.p-2{padding:0.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.\\!px-4{padding-left:1rem !important;padding-right:1rem !important}.\\!py-2{padding-top:0.5rem !important;padding-bottom:0.5rem !important}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.py-3{padding-top:0.75rem;padding-bottom:0.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:0.5rem}.pr-2{padding-right:0.5rem}.text-center{text-align:center}.\\!text-base{font-size:16px !important;line-height:28px !important}.text-base{font-size:16px;line-height:28px}.text-lg{font-size:20px;line-height:30px}.text-sm{font-size:15px;line-height:22px}.text-xl{font-size:24px;line-height:32px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.\\!outline{outline-style:solid !important}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.ring-slate-900\\/10{--tw-ring-color:rgb(15 23 42 / 0.1)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\\:bg-slate-100\\/50:hover{background-color:rgb(241 245 249 / 0.5)}.focus\\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.focus\\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246 / var(--tw-ring-opacity, 1))}',""]);const i=a},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",n=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),n&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),n&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,n,s,r){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(a[c]=!0)}for(var d=0;d<e.length;d++){var l=[].concat(e[d]);n&&a[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),o&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=o):l[2]=o),s&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=s):l[4]="".concat(s)),t.push(l))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function o(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={id:n,exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);class n{constructor(e,t=document){this.elements="string"==typeof e?this.get(e,t):[e]}static async sendAjaxRequest(e,t,o=console.error){const n=new URLSearchParams(t);try{const t=await fetch(e,{method:"POST",body:n,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if(!t.ok)throw new Error("Network response was not ok");return await t.json()}catch(e){return o(e.message),null}}static template(e,t){return e.replace(/\{\{(\w+)\}\}/g,((e,o)=>t[o]||""))}static strToHTML(e){const t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}static escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">")}static get_icon(e,t=""){const o=document.querySelector("#icon-".concat(e)),n=o.getAttribute("viewBox")||"0 0 24 24";return'<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-'.concat(e," ").concat(t,'" aria-hidden="true" role="img" focusable="false" viewBox="').concat(n,'">').concat(o.innerHTML,"</svg>")}}const s=(e,t=document)=>new n(e,t);Object.getOwnPropertyNames(n).forEach((e=>{"function"==typeof n[e]&&"prototype"!==e&&(s[e]=n[e])}));const r=new function(){this.data=window.Easy_Docs_Front_Data||{},this.store={}};var a=o(298);function i(e){return e.split("\n").map((e=>e.trim())).filter((e=>e)).join("")}const c=new WeakMap;class d extends HTMLElement{constructor(){super(),c.set(this,this.attachShadow({mode:"closed"})),this.wrapper=null,this.isModalOpen=!0,this.prevSearchTerm="",this.isSearchOpen=!1,this.serverSearchDelay=null}connectedCallback(){c.get(this);const e=document.createElement("style");e.innerHTML=a.A,c.get(this).append(e),this.render(),this.styleUpdate(),this.events(),this.dispatchEvent(new CustomEvent("EasyDocsLoaded",{bubbles:!0,composed:!0,detail:{instance:this,root:c.get(this)}}))}render(){const e=this.getAttribute("id"),t=this.getAttribute("outline");if(!e||!t)return;const o=r.data,n=o?.outline||{},a=n[t]?.outline||{},d=o?.docs||{},l=this.getWelcomeIdFromUrl();let p=l||0;const m=Object.keys(a).filter((e=>e.startsWith("EasyDocs_")));if(m.length>0)for(let e=0;e<m.length;e++){const t=a[m[e]];if(d["id-"+t]){let o=d["id-"+t].title||"";if(o=o.toLowerCase(),"easydocs-welcome"===o){p=0===p?t:p,delete a[m[e]];break}}}const b=n[t]?.content||"",h=this.renderOutline(a,!0);if(l){let e=h.querySelector('[data-id="'.concat(l,'"]'));for(;e&&!e.classList.contains("docs-outline");)e.classList.contains("docs-outline-item")&&e.classList.add("active"),e=e.parentElement}const g=this.renderDefault(b,p),u=this.renderSearch(),f=document.createElement("div"),y=document.createElement("div"),w=document.createElement("div"),x=document.createElement("div");w.classList.add("easy-docs-sidebar"),x.classList.add("easy-docs-content"),w.append(h),x.append(function(){const e=r?.data?.i18n||{};return s.strToHTML(i('\n <div class="easy-docs-content-header">\n <button type="button" class="easy-docs-sidebar-btn toggle-btn" title="'.concat(e.browseDocs,'"><span class="menu-icon"><span class="bar"></span></span></button>\n <button type="button" class="easy-docs-copy-btn" title="').concat(e.copyLink,'">').concat(s.get_icon("copy-link"),'<span class="easy-docs-copy-msg">').concat(e.copiedMsg,"</span></button>\n </div>\n ")))}(),g),y.classList.add("easy-docs-wrapper"),y.append(u,w,x),f.classList.add("easy-docs-main-wrapper"),f.append(y),c.get(this).append(f),this.wrapper=f}events(){const e=c.get(this),t=e.querySelector(".easy-docs-outline"),o=e.querySelector(".easy-docs-main-content"),n=e.querySelector(".easy-docs-search-btn"),r=e.querySelector(".docs-search-input"),a=e.querySelector(".docs-search-close"),i=e.querySelector(".docs-search-results"),d=e.querySelector(".easy-docs-sidebar-btn"),l=e.querySelector(".easy-docs-copy-btn");this.wrapper&&window.addEventListener("resize",(()=>{setTimeout(this.styleUpdate.bind(this),100)})),t&&t.addEventListener("click",(e=>{e.preventDefault();const t=e.target.closest(".docs-outline-item");t&&this.filterPosts(t)})),o&&o.addEventListener("click",(e=>{const n=e.target;if(n.classList.contains("post-outline")){e.preventDefault();const t=n.getAttribute("data-id"),s=o.querySelector("#".concat(t));s&&s.scrollIntoView({behavior:"smooth",block:"start"})}else if("a"===n.tagName.toLowerCase()){const o=parseInt(n.getAttribute("data-post-id"));if(o&&t){let n=t.querySelector('[data-id="'.concat(o,'"]'));if(n)for(e.preventDefault(),this.fetchPost(o),t.querySelectorAll(".docs-outline-item.active").forEach((e=>{e.classList.remove("active")}));n&&!n.classList.contains("docs-outline");)n.classList.contains("docs-outline-item")&&n.classList.add("active"),n=n.parentElement}}})),d&&d.addEventListener("click",(e=>{e.preventDefault(),this.toggleSidebar()})),n&&n.addEventListener("click",(e=>{e.preventDefault(),this.searchInit()})),document.addEventListener("keydown",(e=>{"Escape"!==e.key&&27!==e.keyCode||this.isSearchOpen&&this.searchClose()})),a&&a.addEventListener("click",(e=>{e.preventDefault(),this.isSearchOpen&&this.searchClose()})),l&&l.addEventListener("click",(e=>{if(l.classList.contains("easy-link-copied")||!o)return;const t=o.getAttribute("post-id");if(!t)return;let n=new URL(window.location.href);n.searchParams.set("easyDocId",t),navigator.clipboard.writeText(n.toString()).then((()=>{l.classList.add("easy-link-copied"),setTimeout((()=>{l.classList.remove("easy-link-copied")}),1e3)})).catch((e=>{console.error("Failed to copy URL: ",e)}))})),r&&["keyup","paste"].forEach((e=>{r.addEventListener(e,(e=>{e.preventDefault(),this.searchDocs(r)}))})),i&&i.addEventListener("click",(o=>{o.preventDefault();const n=o.target.closest(".docs-search-item");if(n){const o=n.getAttribute("data-id");if(!o)return;let r=t.querySelector('[data-id="'.concat(o,'"]'));for(this.searchClose(),this.toggleSidebar(),e.querySelector(".easy-docs-main-content").innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(s.get_icon("spinners","text-xl"),"</div>"),this.fetchPost(o),t.querySelectorAll(".docs-outline-item.active").forEach((e=>{e.classList.remove("active")}));r&&!r.classList.contains("docs-outline");)r.classList.contains("docs-outline-item")&&r.classList.add("active"),r=r.parentElement}}))}styleUpdate(){if(!this.wrapper)return;const e=parseFloat(getComputedStyle(this.wrapper).width);this.wrapper.classList.remove("wider-docs","medium-docs","narrow-docs"),this.wrapper.classList.add(this.getWidthClass(e))}getWidthClass(e){return e>1024?"wider-docs":e>720?"medium-docs":"narrow-docs"}toggleSidebar(){const e=c.get(this).querySelector(".easy-docs-sidebar-btn");this.wrapper&&this.wrapper.classList.contains("wider-docs")||e&&(this.wrapper.classList.toggle("sidebar-open"),e.classList.toggle("toggled-on"))}renderOutline(e,t){if(!e||0===Object.keys(e).length)return"";let o=document.createElement("ul");if(Object.keys(e).forEach((t=>{const n=e[t];if(t.startsWith("EasyDocs_"))o=this.addPostsToOutline(n,o);else{const n=document.createElement("li");n.classList.add("docs-outline-item","doc-folder");let r=t;n.innerHTML='<a href="#" class="easy-docs-outline-link">'.concat(s.get_icon("right","mr-2")).concat(r,"</a>");const a=e[t],i=this.renderOutline(a,!1);""!==i&&n.appendChild(i),o.appendChild(n)}})),t){const e=document.createElement("div"),t=r?.data?.i18n||{},n='<button type="button" class="easy-docs-search-btn">'.concat(s.get_icon("search")).concat(t.search,"</button>");return e.classList.add("easy-docs-outline"),e.append(s.strToHTML(n),o),e}return o}addPostsToOutline(e,t){const o=document.createElement("li");o.classList.add("docs-outline-item","doc-post"),o.setAttribute("data-id",e);const n=(r.data?.docs||{})["id-".concat(e)]||"";return n?(o.innerHTML='<a href="'.concat(n.url,'" class="easy-docs-post-link">').concat(s.get_icon("file-text","mr-2")).concat(n.title,"</a>"),t.appendChild(o),t):t}renderDefault(e,t){const o=document.createElement("div");return o.classList.add("easy-docs-main-content"),t?(o.innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(s.get_icon("spinners","text-xl"),"</div>"),this.fetchPost(t),o):(o.innerHTML=e,o)}getWelcomeIdFromUrl(){const e=new URLSearchParams(window.location.search).get("easyDocId"),t=parseInt(e,10);return!isNaN(t)&&Number.isInteger(t)?t:null}renderSearch(){const e=document.createElement("div"),t=document.createElement("div");return t.innerHTML='<div class="relative"><span class="absolute left-4 top-1/2 -translate-y-1/2 text-slate-400">'.concat(s.get_icon("search"),'</span><input type="text" class="docs-search-input w-full py-3 px-10 outline-none" placeholder="Search..."><button class="docs-search-close absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 text-lg border border-slate-300 rounded">').concat(s.get_icon("esc"),'</button></div><div class="docs-search-results p-4 border-t border-gray-200"><ul class="docs-search-results-list p-5"></ul></div>'),t.classList.add("docs-search-results-wrapper","mx-auto","mt-5","w-3/4","bg-white","rounded-md","ring-1","ring-slate-900/10","rounded-lg","max-h-96","overflow-y-auto"),e.append(t),e.classList.add("easy-docs-search-wrapper","hidden"),e}generateArticleOutline(e){const t=document.createElement("div");t.className="article-outline";const o=document.createElement("div");o.innerHTML=e,e=o;const n=document.createElement("ul");n.className="text-sm",t.appendChild(n);let s=0,r=n,a=null;const i=e.querySelectorAll("h1, h2, h3, h4, h5, h6");return 0===i.length?{article:e,outline:null}:(i.forEach((e=>{!function(e){const t=parseInt(e.tagName[1]),o=document.createElement("li");o.className="outline-item";const n=document.createElement("a");n.classList.add("block","post-outline");const i=e.id||"h-"+e.textContent.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"");if(e.id=i,n.setAttribute("data-id",i),n.href="#".concat(i),n.textContent=e.textContent,o.appendChild(n),0===s)r.appendChild(o);else if(t>s){const e=document.createElement("ul");a&&a.appendChild(e),e.appendChild(o),r=e}else if(t<s){let e=s-t;for(;e--;)r=r.parentElement.closest("ul");r.appendChild(o)}else r.appendChild(o);s=t,a=o}(e)})),{article:e,outline:t})}searchInit(){this.isSearchOpen=!0;const e=c.get(this),t=e.querySelector(".easy-docs-search-wrapper"),o=e.querySelector(".docs-search-input");t&&t.classList.remove("hidden"),o&&o.focus()}searchClose(){this.isSearchOpen=!1;const e=c.get(this),t=e.querySelector(".easy-docs-search-wrapper"),o=e.querySelector(".docs-search-input"),n=e.querySelector(".docs-search-results-list");t&&t.classList.add("hidden"),o&&(o.value=""),n&&(n.innerHTML="")}searchDocs(e){const t=c.get(this);let o=e.value;this.prevSearchTerm!==o&&(this.prevSearchTerm=o,clearTimeout(this.serverSearchDelay),this.serverSearchDelay=setTimeout(function(){if(o=o.trim().toLowerCase(),o){const e=t.querySelector(".docs-search-results-list");e&&(e.innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(s.get_icon("spinners","text-xl"),"</div>")),this.fetchSearchResults(o)}}.bind(this),300))}async fetchSearchResults(e){const t=c.get(this).querySelector(".docs-search-results-list"),o=this.getAttribute("outline"),n={security:r.data.security,action:"easy_docs_search",s:e,outline:o},a=await s.sendAjaxRequest(r.data.ajaxUrl,n,this.handleError.bind(this));a&&(!a.success&&a.data?t.innerHTML="".concat(a.data):a.success&&(t.innerHTML="",Object.keys(a.data).forEach((e=>{const o=a.data[e];if(!o)return;const n=document.createElement("li");n.classList.add("docs-search-item","rounded-md","ring-1","ring-slate-900/10","rounded-lg","p-4","cursor-pointer","mb-3","hover:bg-slate-100/50"),n.setAttribute("data-id",o.id),n.innerHTML='<a class="docs-search-item-link block" href="#" data-id="'.concat(o.id,'"><span class="block text-lg font-bold pb-2 border-b border-slate-900/10 mb-2">').concat(o.title,"</span><span>").concat(o.snippet,"</a>"),t.appendChild(n)}))))}async fetchPost(e){if(!e)return;const t=r.data?.docs?.["id-".concat(e)];if(!t)return;const o={security:r.data.security,action:"easy_docs_get_doc",id:e},n=r?.data?.i18n||{},a=r?.store||{};let d="";if(a[e])d=a[e];else{const t=await s.sendAjaxRequest(r.data.ajaxUrl,o,this.handleError.bind(this));if(!t.success)return;d=t.data?t.data:"",a[e]=d}const l=t.title&&"easydocs-welcome"!==t.title?t.title:"",p=c.get(this).querySelector(".easy-docs-main-content");let m="";if(d)if("easydocs-welcome"!==t.title){const e=this.generateArticleOutline(d);m=e.outline,d=e.article}else d=s.strToHTML("<div>".concat(d,"</div>"));const b=m?'<div class="easy-docs-toc"><span class="easy-docs-toc-heading">'.concat(n.toc,"</span>").concat(m.outerHTML,"</div>"):"";p.innerHTML='<div class="easy-docs-content-title">'.concat(l,"</div>").concat(b,'<div class="easy-docs-post-content">').concat(d?d.innerHTML:"","</div>"),r.data.isPremium&&"yes"===r.data.feedback&&"easydocs-welcome"!==t.title&&p.append(function(){const e=r?.data?.i18n||{};return s.strToHTML(i('\n <div class="easy-docs-content-footer">\n <div class="easy-docs-content-feedback">\n <span>'.concat(e.isHelpful,'</span>\n <span>\n <a href="#" class="easy-docs-helpful easy-docs-yes">').concat(e.yes,'</a>\n <a href="#" class="easy-docs-helpful easy-docs-no">').concat(e.no,"</a>\n </span>\n </div>\n </div>\n ")))}()),p.setAttribute("post-id",e)}filterPosts(e){if(e.classList.contains("active"))e.classList.contains("doc-folder")&&(e.querySelectorAll(".doc-folder.active").forEach((e=>{e.classList.remove("active")})),e.classList.remove("active"));else{if(!e.classList.contains("doc-folder")){const t=e.getAttribute("data-id"),o=c.get(this).querySelector(".doc-post.active");o&&o.classList.remove("active"),this.toggleSidebar(),t&&(c.get(this).querySelector(".easy-docs-main-content").innerHTML='<div class="w-full p-10 text-center mt-10">'.concat(s.get_icon("spinners","text-xl"),"</div>"),this.fetchPost(t))}e.classList.add("active")}}handleError(e){console.log(e)}}const l=d;new class{constructor(){"customElements"in window&&customElements.define("easy-docs",l)}}})(); -
easy-docs/trunk/includes/functions/class-markup.php
r3240911 r3475230 40 40 } 41 41 } else { 42 $markup .= '<li class="docs-outline-item docs-folder mb-0 hover:cursor-pointer"><span class="block hover:bg-gray-300"><span class="block truncate py- 1text-sm pr-2 ' . esc_attr( $indent_cls ) . '">';42 $markup .= '<li class="docs-outline-item docs-folder mb-0 hover:cursor-pointer"><span class="block hover:bg-gray-300"><span class="block truncate py-2 text-sm pr-2 ' . esc_attr( $indent_cls ) . '">'; 43 43 $markup .= '<span class="mr-1 text-slate-600">' . Markup::get_icon( 'right' ); 44 44 $markup .= Markup::get_icon( 'loading', 'animate-spin easyhide' ) . '</span>'; … … 77 77 }, ARRAY_FILTER_USE_KEY ); 78 78 $post_ids = self::get_post_ids( $args ); 79 $markup .= '<li class="docs-outline-item docs-folder mb-0 hover:cursor-pointer" data_ids="' . implode( ',', $post_ids ) . '"><span class="block hover:bg-gray-300"><span class="block truncate py- 1text-sm pr-2 ' . esc_attr( $indent_cls ) . '">';79 $markup .= '<li class="docs-outline-item docs-folder mb-0 hover:cursor-pointer" data_ids="' . implode( ',', $post_ids ) . '"><span class="block hover:bg-gray-300"><span class="block truncate py-2 text-sm pr-2 ' . esc_attr( $indent_cls ) . '">'; 80 80 $markup .= '<span class="docs-outline-label">' . esc_html( $label ) . '</span>'; 81 81 $markup .= '<span class="docs-count"> (' . count( $post_ids ) . ')</span>'; … … 127 127 } 128 128 $markup .= '<li data-id="' . absint( $post_id ) . '" class="docs-outline-item docs-post mb-0 hover:cursor-pointer">'; 129 $markup .= '<span class="block hover:bg-gray-300"><span class="block truncate py- 1text-sm pr-2 ' . esc_attr( $indent_cls ) . '">';129 $markup .= '<span class="block hover:bg-gray-300"><span class="block truncate py-2 text-sm pr-2 ' . esc_attr( $indent_cls ) . '">'; 130 130 $markup .= '<span class="mr-1 text-slate-400">' . Markup::get_icon( 'file-text' ); 131 131 $markup .= Markup::get_icon( 'loading', 'animate-spin easyhide' ) . '</span>';
Note: See TracChangeset
for help on using the changeset viewer.