From dee19f96086c204c5dd297d4bd9c434a97e477f8 Mon Sep 17 00:00:00 2001 From: jckirton <66995801+jckirton@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:13:26 +1030 Subject: [PATCH 1/4] Updated script autocolor code to include marks scripts, and new trust/risk coloring. --- docs/autocolor_demo.mdx | 7 ++- src/css/custom.css | 78 +++++++++++++++++++++++++++------ src/plugins/rehype/autocolor.js | 22 ++++++++-- 3 files changed, 89 insertions(+), 18 deletions(-) diff --git a/docs/autocolor_demo.mdx b/docs/autocolor_demo.mdx index 398f14bb..17e78f0f 100644 --- a/docs/autocolor_demo.mdx +++ b/docs/autocolor_demo.mdx @@ -5,7 +5,12 @@ unlisted: true ### simple -(( scripts.trust )) +(( user.script ))\ +(( scripts.trust ))\ +(( trust.me ))\ +(( risk.it ))\ +(( marks.init ))\ +(( marks.protocol )) ### color diff --git a/src/css/custom.css b/src/css/custom.css index 742fc0fe..9d0f6794 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -97,8 +97,7 @@ a.wikilink-new { border: none; mask-image: url("../../assets/universal-access.svg"); mask-size: 100% auto; - transition: background-color var(--ifm-transition-fast) - var(--ifm-transition-timing-default); + transition: background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default); } .navbar-a11y:hover::before { @@ -106,117 +105,148 @@ a.wikilink-new { } .main-wrapper:not([data-accessible="true"]) { - background-image: repeating-linear-gradient( - #0e0e0e, - #0e0e0e 2px, - #101215 2px, - #101215 4px - ); + background-image: repeating-linear-gradient(#0e0e0e, + #0e0e0e 2px, + #101215 2px, + #101215 4px); background-size: 100% 4px; } -.color-tag[data-tag="a"] { +.color-tag[data-tag="a"], +.color-risk { color: #000000; } + .color-tag[data-tag="b"] { color: #3f3f3f; } + .color-tag[data-tag="c"] { color: #676767; } + .color-tag[data-tag="d"] { color: #7d0000; } + .color-tag[data-tag="e"] { color: #8e3434; } + .color-tag[data-tag="f"] { color: #a34f00; } + .color-tag[data-tag="g"] { color: #725437; } + .color-tag[data-tag="h"] { color: #a88600; } + .color-tag[data-tag="i"] { color: #b2934a; } + .color-tag[data-tag="j"] { color: #939500; } + .color-tag[data-tag="k"] { color: #495225; } + .color-tag[data-tag="l"] { color: #299400; } + .color-tag[data-tag="m"] { color: #23381b; } + .color-tag[data-tag="n"] { color: #00535b; } + .color-tag[data-tag="o"] { color: #324a4c; } + .color-tag[data-tag="p"] { color: #0073a6; } + .color-tag[data-tag="q"] { color: #385a6c; } + .color-tag[data-tag="r"] { color: #010067; } + .color-tag[data-tag="s"] { color: #507aa1; } + .color-tag[data-tag="t"] { color: #601c81; } + .color-tag[data-tag="u"] { color: #43314c; } + .color-tag[data-tag="v"] { color: #8c0069; } + .color-tag[data-tag="w"] { color: #973984; } + .color-tag[data-tag="x"] { color: #880024; } + .color-tag[data-tag="y"] { color: #762e4a; } + .color-tag[data-tag="z"] { color: #101215; } + .color-tag[data-tag="A"], .color-tag[data-tag="1"], -.color-cli { +.color-cli, +.color-trust { color: #ffffff; } + .color-tag[data-tag="B"], .color-gc-text { color: #cacaca; } + .color-tag[data-tag="C"], .color-tag[data-tag="0"], .color-user, .color-gc-end { color: #9b9b9b; } + .color-tag[data-tag="D"], .color-gc-q { color: #ff0000; } + .color-tag[data-tag="E"] { color: #ff8383; } + .color-tag[data-tag="F"], -.color-trust, +.color-trust-user, .color-tag[data-tag="5"], .color-tag[data-tag="6"], .color-tag[data-tag="7"], @@ -224,73 +254,95 @@ a.wikilink-new { .color-tag[data-tag="9"] { color: #ff8000; } + .color-tag[data-tag="G"] { color: #f3aa6f; } + .color-tag[data-tag="H"] { color: #fbc803; } + .color-tag[data-tag="I"] { color: #ffd863; } + .color-tag[data-tag="J"], .color-gc-b { color: #fff404; } + .color-tag[data-tag="K"] { color: #f3f998; } + .color-tag[data-tag="L"], .color-tag[data-tag="2"], .color-script, .color-gc-m { color: #1eff00; } + .color-tag[data-tag="M"] { color: #b3ff9b; } + .color-tag[data-tag="N"], .color-gc-k, .color-key { color: #00ffff; } + .color-tag[data-tag="O"] { color: #8fe6ff; } + .color-tag[data-tag="P"], .color-tag[data-tag="3"] { color: #0070dd; } -.color-tag[data-tag="Q"] { + +.color-tag[data-tag="Q"], +.color-script-marks { color: #a4e3ff; } + .color-tag[data-tag="R"] { color: #0000ff; } + .color-tag[data-tag="S"] { color: #7ab2f4; } + .color-tag[data-tag="T"], -.color-tag[data-tag="4"] { +.color-tag[data-tag="4"], +.color-script-risk { color: #b035ee; } + .color-tag[data-tag="U"] { color: #e6c4ff; } + .color-tag[data-tag="V"], .color-gc-t, .color-value { color: #ff00ec; } + .color-tag[data-tag="W"] { color: #ff96e0; } + .color-tag[data-tag="X"] { color: #ff0070; } + .color-tag[data-tag="Y"] { color: #ff6a98; } + .color-tag[data-tag="Z"] { color: #0c112b; } diff --git a/src/plugins/rehype/autocolor.js b/src/plugins/rehype/autocolor.js index 90fab92b..39a503c5 100644 --- a/src/plugins/rehype/autocolor.js +++ b/src/plugins/rehype/autocolor.js @@ -15,11 +15,18 @@ const trustUsers = [ "market", "scripts", "sys", - "trust", + // "trust", "users", "marks", ]; +const marksTrustScripts = [ + "protocol", + "available", + "sync", + "clone" +] + // Matches (( )) const regexAutocolorBlock = /\(\((.*?)\)\)/g; @@ -47,11 +54,18 @@ const regexGC = /(?=\d)(?:(\d+)Q)?(?:(\d{1,3})T)?(?:(\d{1,3})B)?(?:(\d{1,3})M)?(?:(\d{1,3})K)?(\d{1,3})?GC/g; function colorScript(_fullMatch, user, script) { - const isTrust = trustUsers.includes(user); + const isTrustUser = trustUsers.includes(user); + const isTrust = user == "trust"; + const isRisk = user == "risk"; + const isMarksScript = (user == "marks" && !marksTrustScripts.includes(script)) + + const userColor = (isTrustUser ? "trust-user" : isTrust ? "trust" : isRisk ? "risk" : "user") + const scriptColor = (isRisk ? "script-risk" : isMarksScript ? "script-marks" : "script") + return [ - h("span", { class: `color-${isTrust ? "trust" : "user"}` }, user), + h("span", { class: `color-${userColor}` }, user), u("text", "."), - h("span", { class: "color-script" }, script), + h("span", { class: `color-${scriptColor}` }, script), ]; } From dffe8a7f1e3f826b0a3468a2ec39cc88a8729d4d Mon Sep 17 00:00:00 2001 From: jckirton <66995801+jckirton@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:14:28 +1030 Subject: [PATCH 2/4] Removed forced scriptname coloring from priv_store page. --- docs/guides/new_players/priv_store.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/new_players/priv_store.mdx b/docs/guides/new_players/priv_store.mdx index e4457b52..af370ef9 100644 --- a/docs/guides/new_players/priv_store.mdx +++ b/docs/guides/new_players/priv_store.mdx @@ -4,7 +4,7 @@ title: priv_store > Think of it as a secure account that scripts can't touch. -_- Unknown, ((%Fmarks%.%Qlost_and_found%))_ +_- Unknown, ((marks.lost_and_found))_ ((%Cpriv_store%)) is a special user that does not take a user slot, cannot be retired, and cannot run any scripts other than ((accts.balance)) or ((accts.xfer_gc_to)). From 4577ee0f537b0801962cbc87a5ab6d211530df22 Mon Sep 17 00:00:00 2001 From: matr1x-hackmud Date: Mon, 1 Dec 2025 08:09:01 +0000 Subject: [PATCH 3/4] Fix linter errors --- src/css/custom.css | 13 ++++++++----- src/plugins/rehype/autocolor.js | 25 +++++++++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/css/custom.css b/src/css/custom.css index 9d0f6794..e9fdcd42 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -97,7 +97,8 @@ a.wikilink-new { border: none; mask-image: url("../../assets/universal-access.svg"); mask-size: 100% auto; - transition: background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default); + transition: background-color var(--ifm-transition-fast) + var(--ifm-transition-timing-default); } .navbar-a11y:hover::before { @@ -105,10 +106,12 @@ a.wikilink-new { } .main-wrapper:not([data-accessible="true"]) { - background-image: repeating-linear-gradient(#0e0e0e, - #0e0e0e 2px, - #101215 2px, - #101215 4px); + background-image: repeating-linear-gradient( + #0e0e0e, + #0e0e0e 2px, + #101215 2px, + #101215 4px + ); background-size: 100% 4px; } diff --git a/src/plugins/rehype/autocolor.js b/src/plugins/rehype/autocolor.js index 39a503c5..dc174bb5 100644 --- a/src/plugins/rehype/autocolor.js +++ b/src/plugins/rehype/autocolor.js @@ -20,12 +20,7 @@ const trustUsers = [ "marks", ]; -const marksTrustScripts = [ - "protocol", - "available", - "sync", - "clone" -] +const marksTrustScripts = ["protocol", "available", "sync", "clone"]; // Matches (( )) const regexAutocolorBlock = /\(\((.*?)\)\)/g; @@ -57,10 +52,20 @@ function colorScript(_fullMatch, user, script) { const isTrustUser = trustUsers.includes(user); const isTrust = user == "trust"; const isRisk = user == "risk"; - const isMarksScript = (user == "marks" && !marksTrustScripts.includes(script)) - - const userColor = (isTrustUser ? "trust-user" : isTrust ? "trust" : isRisk ? "risk" : "user") - const scriptColor = (isRisk ? "script-risk" : isMarksScript ? "script-marks" : "script") + const isMarksScript = user == "marks" && !marksTrustScripts.includes(script); + + const userColor = isTrustUser + ? "trust-user" + : isTrust + ? "trust" + : isRisk + ? "risk" + : "user"; + const scriptColor = isRisk + ? "script-risk" + : isMarksScript + ? "script-marks" + : "script"; return [ h("span", { class: `color-${userColor}` }, user), From be83a36d199041e0050dbbc94f9f85533038d9e2 Mon Sep 17 00:00:00 2001 From: jckirton <66995801+jckirton@users.noreply.github.com> Date: Mon, 1 Dec 2025 19:02:46 +1030 Subject: [PATCH 4/4] Bump.