@shell-shock/plugin-theme 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -107,16 +107,18 @@ function resolveBorderStyle(identifier) {
|
|
|
107
107
|
right: "🙼🙼"
|
|
108
108
|
};
|
|
109
109
|
break;
|
|
110
|
-
case "pointer":
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
case "pointer":
|
|
111
|
+
result = {
|
|
112
|
+
topLeft: "▶",
|
|
113
|
+
topRight: "◀",
|
|
114
|
+
bottomLeft: "◀",
|
|
115
|
+
bottomRight: "▶",
|
|
116
|
+
top: "─",
|
|
117
|
+
bottom: "─",
|
|
118
|
+
left: "►",
|
|
119
|
+
right: "◄"
|
|
120
|
+
};
|
|
121
|
+
break;
|
|
120
122
|
case "outward-arrow":
|
|
121
123
|
result = {
|
|
122
124
|
topLeft: "↗",
|
|
@@ -106,16 +106,18 @@ function resolveBorderStyle(identifier) {
|
|
|
106
106
|
right: "🙼🙼"
|
|
107
107
|
};
|
|
108
108
|
break;
|
|
109
|
-
case "pointer":
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
case "pointer":
|
|
110
|
+
result = {
|
|
111
|
+
topLeft: "▶",
|
|
112
|
+
topRight: "◀",
|
|
113
|
+
bottomLeft: "◀",
|
|
114
|
+
bottomRight: "▶",
|
|
115
|
+
top: "─",
|
|
116
|
+
bottom: "─",
|
|
117
|
+
left: "►",
|
|
118
|
+
right: "◄"
|
|
119
|
+
};
|
|
120
|
+
break;
|
|
119
121
|
case "outward-arrow":
|
|
120
122
|
result = {
|
|
121
123
|
topLeft: "↗",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.mjs","names":["result!: ThemeStyleBorderTypeConfig","defu"],"sources":["../../src/style-dictionary/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { defu } from \"defu\";\nimport type { ThemePluginContext } from \"../types/plugin\";\nimport type {\n ThemeResolvedConfig,\n ThemeStyleBorderIdentifiers,\n ThemeStyleBorderTypeConfig\n} from \"../types/theme\";\n\n/**\n * Applies the specified border style type and returns the corresponding border characters.\n *\n * @param identifier - The border style identifier.\n * @returns The border type configuration with the corresponding characters.\n */\nexport function resolveBorderStyle(\n identifier: ThemeStyleBorderIdentifiers\n): ThemeStyleBorderTypeConfig {\n let result!: ThemeStyleBorderTypeConfig;\n switch (identifier.replace(/-corners$/, \"\").toLowerCase()) {\n case \"double\":\n result = {\n topLeft: \"╔\",\n topRight: \"╗\",\n bottomLeft: \"╚\",\n bottomRight: \"╝\",\n top: \"═\",\n bottom: \"═\",\n left: \"║\",\n right: \"║\"\n };\n break;\n case \"bold\":\n result = {\n topLeft: \"┏\",\n topRight: \"┓\",\n bottomLeft: \"┗\",\n bottomRight: \"┛\",\n top: \"━\",\n bottom: \"━\",\n left: \"┃\",\n right: \"┃\"\n };\n break;\n case \"round\":\n result = {\n topLeft: \"╭\",\n topRight: \"╮\",\n bottomLeft: \"╰\",\n bottomRight: \"╯\",\n top: \"─\",\n bottom: \"─\",\n left: \"│\",\n right: \"│\"\n };\n break;\n case \"single-double\":\n result = {\n topLeft: \"╓\",\n topRight: \"╖\",\n bottomLeft: \"╙\",\n bottomRight: \"╜\",\n top: \"─\",\n bottom: \"─\",\n left: \"║\",\n right: \"║\"\n };\n break;\n case \"double-single\":\n result = {\n topLeft: \"╒\",\n topRight: \"╕\",\n bottomLeft: \"╘\",\n bottomRight: \"╛\",\n top: \"═\",\n bottom: \"═\",\n left: \"│\",\n right: \"│\"\n };\n break;\n case \"classic\":\n result = {\n topLeft: \"+\",\n topRight: \"+\",\n bottomLeft: \"+\",\n bottomRight: \"+\",\n top: \"-\",\n bottom: \"-\",\n left: \"|\",\n right: \"|\"\n };\n break;\n case \"diagonal\":\n result = {\n topLeft: \"╱╱\",\n topRight: \"╱╱\",\n bottomLeft: \"╱╱\",\n bottomRight: \"╱╱\",\n top: \"╱\",\n bottom: \"╱\",\n left: \"╱╱\",\n right: \"╱╱\"\n };\n break;\n case \"diagonal-thick\":\n result = {\n topLeft: \"🙼🙼\",\n topRight: \"🙼🙼\",\n bottomLeft: \"🙼🙼\",\n bottomRight: \"🙼🙼\",\n top: \"🙼\",\n bottom: \"🙼\",\n left: \"🙼🙼\",\n right: \"🙼🙼\"\n };\n break;\n case \"pointer\":\n result = {\n topLeft: \"▶\",\n topRight: \"◀\",\n bottomLeft: \"◀\",\n bottomRight: \"▶\",\n top: \"─\",\n bottom: \"─\",\n left: \"►\",\n right: \"◄\"\n };\n case \"outward-arrow\":\n result = {\n topLeft: \"↗\",\n topRight: \"↖\",\n bottomLeft: \"↙\",\n bottomRight: \"↘\",\n top: \"↑\",\n bottom: \"↓\",\n left: \"←\",\n right: \"→\"\n };\n break;\n case \"arrow\":\n case \"inward-arrow\":\n result = {\n topLeft: \"↘\",\n topRight: \"↙\",\n bottomLeft: \"↖\",\n bottomRight: \"↗\",\n top: \"↓\",\n bottom: \"↑\",\n left: \"→\",\n right: \"←\"\n };\n break;\n case \"outward-double-arrow\":\n result = {\n topLeft: \"⇗\",\n topRight: \"⇖\",\n bottomLeft: \"⇙\",\n bottomRight: \"⇘\",\n top: \"⇑\",\n bottom: \"⇓\",\n left: \"⇐\",\n right: \"⇒\"\n };\n break;\n case \"double-arrow\":\n case \"inward-double-arrow\":\n result = {\n topLeft: \"⇘\",\n topRight: \"⇙\",\n bottomLeft: \"⇖\",\n bottomRight: \"⇗\",\n top: \"⇓\",\n bottom: \"⇑\",\n left: \"⇒\",\n right: \"⇐\"\n };\n break;\n case \"none\":\n result = {\n topLeft: \" \",\n topRight: \" \",\n bottomLeft: \" \",\n bottomRight: \" \",\n top: \" \",\n bottom: \" \",\n left: \" \",\n right: \" \"\n };\n break;\n case \"single\":\n default:\n result = {\n topLeft: \"┌\",\n topRight: \"┐\",\n bottomLeft: \"└\",\n bottomRight: \"┘\",\n top: \"─\",\n bottom: \"─\",\n left: \"│\",\n right: \"│\"\n };\n break;\n }\n\n result.meta = identifier.endsWith(\"-corners\")\n ? {\n corners: true\n }\n : {};\n\n return result;\n}\n\n/**\n * Merges the provided resolved theme configuration into the existing theme configuration in the context.\n *\n * @param context - The theme plugin context containing the current theme configuration.\n * @param resolvedConfig - The resolved theme configuration to merge into the context's theme configuration.\n * @return The merged theme configuration.\n */\nexport function mergeThemes<TContext extends ThemePluginContext>(\n context: TContext,\n resolvedConfig: Partial<ThemeResolvedConfig>\n) {\n context.theme = defu(context.theme, resolvedConfig);\n\n return context.theme;\n}\n"],"mappings":";;;;;;;;;AAgCA,SAAgB,mBACd,YAC4B;CAC5B,IAAIA;AACJ,SAAQ,WAAW,QAAQ,aAAa,GAAG,CAAC,aAAa,EAAzD;EACE,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK,
|
|
1
|
+
{"version":3,"file":"helpers.mjs","names":["result!: ThemeStyleBorderTypeConfig","defu"],"sources":["../../src/style-dictionary/helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { defu } from \"defu\";\nimport type { ThemePluginContext } from \"../types/plugin\";\nimport type {\n ThemeResolvedConfig,\n ThemeStyleBorderIdentifiers,\n ThemeStyleBorderTypeConfig\n} from \"../types/theme\";\n\n/**\n * Applies the specified border style type and returns the corresponding border characters.\n *\n * @param identifier - The border style identifier.\n * @returns The border type configuration with the corresponding characters.\n */\nexport function resolveBorderStyle(\n identifier: ThemeStyleBorderIdentifiers\n): ThemeStyleBorderTypeConfig {\n let result!: ThemeStyleBorderTypeConfig;\n switch (identifier.replace(/-corners$/, \"\").toLowerCase()) {\n case \"double\":\n result = {\n topLeft: \"╔\",\n topRight: \"╗\",\n bottomLeft: \"╚\",\n bottomRight: \"╝\",\n top: \"═\",\n bottom: \"═\",\n left: \"║\",\n right: \"║\"\n };\n break;\n case \"bold\":\n result = {\n topLeft: \"┏\",\n topRight: \"┓\",\n bottomLeft: \"┗\",\n bottomRight: \"┛\",\n top: \"━\",\n bottom: \"━\",\n left: \"┃\",\n right: \"┃\"\n };\n break;\n case \"round\":\n result = {\n topLeft: \"╭\",\n topRight: \"╮\",\n bottomLeft: \"╰\",\n bottomRight: \"╯\",\n top: \"─\",\n bottom: \"─\",\n left: \"│\",\n right: \"│\"\n };\n break;\n case \"single-double\":\n result = {\n topLeft: \"╓\",\n topRight: \"╖\",\n bottomLeft: \"╙\",\n bottomRight: \"╜\",\n top: \"─\",\n bottom: \"─\",\n left: \"║\",\n right: \"║\"\n };\n break;\n case \"double-single\":\n result = {\n topLeft: \"╒\",\n topRight: \"╕\",\n bottomLeft: \"╘\",\n bottomRight: \"╛\",\n top: \"═\",\n bottom: \"═\",\n left: \"│\",\n right: \"│\"\n };\n break;\n case \"classic\":\n result = {\n topLeft: \"+\",\n topRight: \"+\",\n bottomLeft: \"+\",\n bottomRight: \"+\",\n top: \"-\",\n bottom: \"-\",\n left: \"|\",\n right: \"|\"\n };\n break;\n case \"diagonal\":\n result = {\n topLeft: \"╱╱\",\n topRight: \"╱╱\",\n bottomLeft: \"╱╱\",\n bottomRight: \"╱╱\",\n top: \"╱\",\n bottom: \"╱\",\n left: \"╱╱\",\n right: \"╱╱\"\n };\n break;\n case \"diagonal-thick\":\n result = {\n topLeft: \"🙼🙼\",\n topRight: \"🙼🙼\",\n bottomLeft: \"🙼🙼\",\n bottomRight: \"🙼🙼\",\n top: \"🙼\",\n bottom: \"🙼\",\n left: \"🙼🙼\",\n right: \"🙼🙼\"\n };\n break;\n case \"pointer\":\n result = {\n topLeft: \"▶\",\n topRight: \"◀\",\n bottomLeft: \"◀\",\n bottomRight: \"▶\",\n top: \"─\",\n bottom: \"─\",\n left: \"►\",\n right: \"◄\"\n };\n break;\n case \"outward-arrow\":\n result = {\n topLeft: \"↗\",\n topRight: \"↖\",\n bottomLeft: \"↙\",\n bottomRight: \"↘\",\n top: \"↑\",\n bottom: \"↓\",\n left: \"←\",\n right: \"→\"\n };\n break;\n case \"arrow\":\n case \"inward-arrow\":\n result = {\n topLeft: \"↘\",\n topRight: \"↙\",\n bottomLeft: \"↖\",\n bottomRight: \"↗\",\n top: \"↓\",\n bottom: \"↑\",\n left: \"→\",\n right: \"←\"\n };\n break;\n case \"outward-double-arrow\":\n result = {\n topLeft: \"⇗\",\n topRight: \"⇖\",\n bottomLeft: \"⇙\",\n bottomRight: \"⇘\",\n top: \"⇑\",\n bottom: \"⇓\",\n left: \"⇐\",\n right: \"⇒\"\n };\n break;\n case \"double-arrow\":\n case \"inward-double-arrow\":\n result = {\n topLeft: \"⇘\",\n topRight: \"⇙\",\n bottomLeft: \"⇖\",\n bottomRight: \"⇗\",\n top: \"⇓\",\n bottom: \"⇑\",\n left: \"⇒\",\n right: \"⇐\"\n };\n break;\n case \"none\":\n result = {\n topLeft: \" \",\n topRight: \" \",\n bottomLeft: \" \",\n bottomRight: \" \",\n top: \" \",\n bottom: \" \",\n left: \" \",\n right: \" \"\n };\n break;\n case \"single\":\n default:\n result = {\n topLeft: \"┌\",\n topRight: \"┐\",\n bottomLeft: \"└\",\n bottomRight: \"┘\",\n top: \"─\",\n bottom: \"─\",\n left: \"│\",\n right: \"│\"\n };\n break;\n }\n\n result.meta = identifier.endsWith(\"-corners\")\n ? {\n corners: true\n }\n : {};\n\n return result;\n}\n\n/**\n * Merges the provided resolved theme configuration into the existing theme configuration in the context.\n *\n * @param context - The theme plugin context containing the current theme configuration.\n * @param resolvedConfig - The resolved theme configuration to merge into the context's theme configuration.\n * @return The merged theme configuration.\n */\nexport function mergeThemes<TContext extends ThemePluginContext>(\n context: TContext,\n resolvedConfig: Partial<ThemeResolvedConfig>\n) {\n context.theme = defu(context.theme, resolvedConfig);\n\n return context.theme;\n}\n"],"mappings":";;;;;;;;;AAgCA,SAAgB,mBACd,YAC4B;CAC5B,IAAIA;AACJ,SAAQ,WAAW,QAAQ,aAAa,GAAG,CAAC,aAAa,EAAzD;EACE,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;EACL,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;EACL,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;AACH,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;EACF,KAAK;EACL;AACE,YAAS;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACR;AACD;;AAGJ,QAAO,OAAO,WAAW,SAAS,WAAW,GACzC,EACE,SAAS,MACV,GACD,EAAE;AAEN,QAAO;;;;;;;;;AAUT,SAAgB,YACd,SACA,gBACA;AACA,SAAQ,QAAQC,OAAK,QAAQ,OAAO,eAAe;AAEnD,QAAO,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/plugin-theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -110,18 +110,18 @@
|
|
|
110
110
|
"storm-software"
|
|
111
111
|
],
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
114
|
-
"@powerlines/plugin-style-dictionary": "^0.3.
|
|
113
|
+
"@powerlines/plugin-plugin": "^0.12.236",
|
|
114
|
+
"@powerlines/plugin-style-dictionary": "^0.3.186",
|
|
115
115
|
"@stryke/helpers": "^0.9.42",
|
|
116
116
|
"@stryke/type-checks": "^0.5.25",
|
|
117
|
-
"defu": "
|
|
118
|
-
"powerlines": "^0.38.
|
|
117
|
+
"defu": "6.1.4",
|
|
118
|
+
"powerlines": "^0.38.52",
|
|
119
119
|
"style-dictionary": "^5.3.1"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
122
|
+
"@powerlines/plugin-deepkit": "^0.11.164",
|
|
123
123
|
"@types/node": "^22.19.11"
|
|
124
124
|
},
|
|
125
125
|
"publishConfig": { "access": "public" },
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "ba4e6ba921fb77de5be8950f02ea798752b61450"
|
|
127
127
|
}
|