@shell-shock/plugin-theme 0.2.0 → 0.2.2

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.
package/dist/index.cjs CHANGED
@@ -23,14 +23,17 @@ const plugin = (options = {}) => {
23
23
  name: "shell-shock:theme",
24
24
  config() {
25
25
  this.debug("Providing default configuration for the Shell Shock `theme` plugin.");
26
- return { styleDictionary: { customPreprocessors: (context) => ({
27
- "shell-shock/colors": require_colors.colors(context),
28
- "shell-shock/border-styles": require_border_styles.borderStyles(context),
29
- "shell-shock/padding": require_padding.padding(context),
30
- "shell-shock/icons": require_icons.icons(context),
31
- "shell-shock/labels": require_labels.labels(context),
32
- "shell-shock/settings": require_settings.settings(context)
33
- }) } };
26
+ return {
27
+ theme: options.theme,
28
+ styleDictionary: { customPreprocessors: (context) => ({
29
+ "shell-shock/colors": require_colors.colors(context),
30
+ "shell-shock/border-styles": require_border_styles.borderStyles(context),
31
+ "shell-shock/padding": require_padding.padding(context),
32
+ "shell-shock/icons": require_icons.icons(context),
33
+ "shell-shock/labels": require_labels.labels(context),
34
+ "shell-shock/settings": require_settings.settings(context)
35
+ }) }
36
+ };
34
37
  },
35
38
  configResolved: {
36
39
  order: "pre",
package/dist/index.mjs CHANGED
@@ -19,14 +19,17 @@ const plugin = (options = {}) => {
19
19
  name: "shell-shock:theme",
20
20
  config() {
21
21
  this.debug("Providing default configuration for the Shell Shock `theme` plugin.");
22
- return { styleDictionary: { customPreprocessors: (context) => ({
23
- "shell-shock/colors": colors(context),
24
- "shell-shock/border-styles": borderStyles(context),
25
- "shell-shock/padding": padding(context),
26
- "shell-shock/icons": icons(context),
27
- "shell-shock/labels": labels(context),
28
- "shell-shock/settings": settings(context)
29
- }) } };
22
+ return {
23
+ theme: options.theme,
24
+ styleDictionary: { customPreprocessors: (context) => ({
25
+ "shell-shock/colors": colors(context),
26
+ "shell-shock/border-styles": borderStyles(context),
27
+ "shell-shock/padding": padding(context),
28
+ "shell-shock/icons": icons(context),
29
+ "shell-shock/labels": labels(context),
30
+ "shell-shock/settings": settings(context)
31
+ }) }
32
+ };
30
33
  },
31
34
  configResolved: {
32
35
  order: "pre",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["defaultTheme"],"sources":["../src/index.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 styleDictionary from \"@powerlines/plugin-style-dictionary\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport type { Config } from \"style-dictionary/types\";\nimport { borderStyles } from \"./style-dictionary/border-styles\";\nimport { colors } from \"./style-dictionary/colors\";\nimport { icons } from \"./style-dictionary/icons\";\nimport { labels } from \"./style-dictionary/labels\";\nimport { padding } from \"./style-dictionary/padding\";\nimport { settings } from \"./style-dictionary/settings\";\nimport { theme as defaultTheme } from \"./themes/storm\";\nimport type { ThemePluginContext, ThemePluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\n/**\n * The Style Dictionary - Shell Shock plugin to use Style Dictionary tokens to select theme colors to Shell Shock projects.\n */\nexport const plugin = <\n TContext extends ThemePluginContext = ThemePluginContext\n>(\n options: ThemePluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n styleDictionary(defu({ skipBuild: false }, omit(options, [\"theme\"]))),\n {\n name: \"shell-shock:theme\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `theme` plugin.\"\n );\n\n return {\n // theme: options.theme,\n styleDictionary: {\n customPreprocessors: (context: TContext) => ({\n \"shell-shock/colors\": colors(context),\n \"shell-shock/border-styles\": borderStyles(context),\n \"shell-shock/padding\": padding(context),\n \"shell-shock/icons\": icons(context),\n \"shell-shock/labels\": labels(context),\n \"shell-shock/settings\": settings(context)\n })\n }\n };\n },\n configResolved: {\n order: \"pre\",\n async handler() {\n this.debug(\"Shell Shock `theme` plugin configuration resolved.\");\n\n this.config.styleDictionary = defu(this.config.styleDictionary, {\n tokens: isSetObject(this.config.theme)\n ? defu(this.config.theme, defaultTheme)\n : defaultTheme,\n platforms: {\n js: {\n preprocessors: [\n \"shell-shock/colors\",\n \"shell-shock/border-styles\",\n \"shell-shock/padding\",\n \"shell-shock/icons\",\n \"shell-shock/labels\",\n \"shell-shock/settings\"\n ],\n transformGroup: \"js\",\n transforms: [\"name/camel\"],\n fileHeader: \"powerlines/file-header\",\n buildPath: this.config.output.outputPath,\n files: [\n {\n format: \"javascript/module\",\n destination: \"theme.js\",\n options: {\n minify: this.config.mode === \"production\"\n }\n },\n {\n format: \"typescript/module-declarations\",\n destination: \"theme.d.ts\",\n options: {\n minify: this.config.mode === \"production\"\n }\n }\n ]\n }\n }\n } as Config);\n }\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAa,UAGX,UAA8B,EAAE,KACT;AACvB,QAAO,CACL,gBAAgB,KAAK,EAAE,WAAW,OAAO,EAAE,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EACrE;EACE,MAAM;EACN,SAAS;AACP,QAAK,MACH,sEACD;AAED,UAAO,EAEL,iBAAiB,EACf,sBAAsB,aAAuB;IAC3C,sBAAsB,OAAO,QAAQ;IACrC,6BAA6B,aAAa,QAAQ;IAClD,uBAAuB,QAAQ,QAAQ;IACvC,qBAAqB,MAAM,QAAQ;IACnC,sBAAsB,OAAO,QAAQ;IACrC,wBAAwB,SAAS,QAAQ;IAC1C,GACF,EACF;;EAEH,gBAAgB;GACd,OAAO;GACP,MAAM,UAAU;AACd,SAAK,MAAM,qDAAqD;AAEhE,SAAK,OAAO,kBAAkB,KAAK,KAAK,OAAO,iBAAiB;KAC9D,QAAQ,YAAY,KAAK,OAAO,MAAM,GAClC,KAAK,KAAK,OAAO,OAAOA,MAAa,GACrCA;KACJ,WAAW,EACT,IAAI;MACF,eAAe;OACb;OACA;OACA;OACA;OACA;OACA;OACD;MACD,gBAAgB;MAChB,YAAY,CAAC,aAAa;MAC1B,YAAY;MACZ,WAAW,KAAK,OAAO,OAAO;MAC9B,OAAO,CACL;OACE,QAAQ;OACR,aAAa;OACb,SAAS,EACP,QAAQ,KAAK,OAAO,SAAS,cAC9B;OACF,EACD;OACE,QAAQ;OACR,aAAa;OACb,SAAS,EACP,QAAQ,KAAK,OAAO,SAAS,cAC9B;OACF,CACF;MACF,EACF;KACF,CAAW;;GAEf;EACF,CACF;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["defaultTheme"],"sources":["../src/index.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 styleDictionary from \"@powerlines/plugin-style-dictionary\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport type { Config } from \"style-dictionary/types\";\nimport { borderStyles } from \"./style-dictionary/border-styles\";\nimport { colors } from \"./style-dictionary/colors\";\nimport { icons } from \"./style-dictionary/icons\";\nimport { labels } from \"./style-dictionary/labels\";\nimport { padding } from \"./style-dictionary/padding\";\nimport { settings } from \"./style-dictionary/settings\";\nimport { theme as defaultTheme } from \"./themes/storm\";\nimport type { ThemePluginContext, ThemePluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\n/**\n * The Style Dictionary - Shell Shock plugin to use Style Dictionary tokens to select theme colors to Shell Shock projects.\n */\nexport const plugin = <\n TContext extends ThemePluginContext = ThemePluginContext\n>(\n options: ThemePluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n styleDictionary(defu({ skipBuild: false }, omit(options, [\"theme\"]))),\n {\n name: \"shell-shock:theme\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `theme` plugin.\"\n );\n\n return {\n theme: options.theme,\n styleDictionary: {\n customPreprocessors: (context: TContext) => ({\n \"shell-shock/colors\": colors(context),\n \"shell-shock/border-styles\": borderStyles(context),\n \"shell-shock/padding\": padding(context),\n \"shell-shock/icons\": icons(context),\n \"shell-shock/labels\": labels(context),\n \"shell-shock/settings\": settings(context)\n })\n }\n };\n },\n configResolved: {\n order: \"pre\",\n async handler() {\n this.debug(\"Shell Shock `theme` plugin configuration resolved.\");\n\n this.config.styleDictionary = defu(this.config.styleDictionary, {\n tokens: isSetObject(this.config.theme)\n ? defu(this.config.theme, defaultTheme)\n : defaultTheme,\n platforms: {\n js: {\n preprocessors: [\n \"shell-shock/colors\",\n \"shell-shock/border-styles\",\n \"shell-shock/padding\",\n \"shell-shock/icons\",\n \"shell-shock/labels\",\n \"shell-shock/settings\"\n ],\n transformGroup: \"js\",\n transforms: [\"name/camel\"],\n fileHeader: \"powerlines/file-header\",\n buildPath: this.config.output.outputPath,\n files: [\n {\n format: \"javascript/module\",\n destination: \"theme.js\",\n options: {\n minify: this.config.mode === \"production\"\n }\n },\n {\n format: \"typescript/module-declarations\",\n destination: \"theme.d.ts\",\n options: {\n minify: this.config.mode === \"production\"\n }\n }\n ]\n }\n }\n } as Config);\n }\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAa,UAGX,UAA8B,EAAE,KACT;AACvB,QAAO,CACL,gBAAgB,KAAK,EAAE,WAAW,OAAO,EAAE,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EACrE;EACE,MAAM;EACN,SAAS;AACP,QAAK,MACH,sEACD;AAED,UAAO;IACL,OAAO,QAAQ;IACf,iBAAiB,EACf,sBAAsB,aAAuB;KAC3C,sBAAsB,OAAO,QAAQ;KACrC,6BAA6B,aAAa,QAAQ;KAClD,uBAAuB,QAAQ,QAAQ;KACvC,qBAAqB,MAAM,QAAQ;KACnC,sBAAsB,OAAO,QAAQ;KACrC,wBAAwB,SAAS,QAAQ;KAC1C,GACF;IACF;;EAEH,gBAAgB;GACd,OAAO;GACP,MAAM,UAAU;AACd,SAAK,MAAM,qDAAqD;AAEhE,SAAK,OAAO,kBAAkB,KAAK,KAAK,OAAO,iBAAiB;KAC9D,QAAQ,YAAY,KAAK,OAAO,MAAM,GAClC,KAAK,KAAK,OAAO,OAAOA,MAAa,GACrCA;KACJ,WAAW,EACT,IAAI;MACF,eAAe;OACb;OACA;OACA;OACA;OACA;OACA;OACD;MACD,gBAAgB;MAChB,YAAY,CAAC,aAAa;MAC1B,YAAY;MACZ,WAAW,KAAK,OAAO,OAAO;MAC9B,OAAO,CACL;OACE,QAAQ;OACR,aAAa;OACb,SAAS,EACP,QAAQ,KAAK,OAAO,SAAS,cAC9B;OACF,EACD;OACE,QAAQ;OACR,aAAa;OACb,SAAS,EACP,QAAQ,KAAK,OAAO,SAAS,cAC9B;OACF,CACF;MACF,EACF;KACF,CAAW;;GAEf;EACF,CACF;;AAGH,kBAAe"}
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let defu = require("defu");
2
+ let powerlines_plugin_utils_merge = require("powerlines/plugin-utils/merge");
3
3
 
4
4
  //#region src/style-dictionary/helpers.ts
5
5
  /**
@@ -107,16 +107,18 @@ function resolveBorderStyle(identifier) {
107
107
  right: "🙼🙼"
108
108
  };
109
109
  break;
110
- case "pointer": result = {
111
- topLeft: "▶",
112
- topRight: "",
113
- bottomLeft: "◀",
114
- bottomRight: "",
115
- top: "",
116
- bottom: "─",
117
- left: "",
118
- right: ""
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: "↗",
@@ -204,7 +206,7 @@ function resolveBorderStyle(identifier) {
204
206
  * @return The merged theme configuration.
205
207
  */
206
208
  function mergeThemes(context, resolvedConfig) {
207
- context.theme = (0, defu.defu)(context.theme, resolvedConfig);
209
+ context.theme = (0, powerlines_plugin_utils_merge.mergeConfig)(context.theme, resolvedConfig);
208
210
  return context.theme;
209
211
  }
210
212
 
@@ -1,4 +1,4 @@
1
- import { defu as defu$1 } from "defu";
1
+ import { mergeConfig } from "powerlines/plugin-utils/merge";
2
2
 
3
3
  //#region src/style-dictionary/helpers.ts
4
4
  /**
@@ -106,16 +106,18 @@ function resolveBorderStyle(identifier) {
106
106
  right: "🙼🙼"
107
107
  };
108
108
  break;
109
- case "pointer": result = {
110
- topLeft: "▶",
111
- topRight: "",
112
- bottomLeft: "◀",
113
- bottomRight: "",
114
- top: "",
115
- bottom: "─",
116
- left: "",
117
- right: ""
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: "↗",
@@ -203,7 +205,7 @@ function resolveBorderStyle(identifier) {
203
205
  * @return The merged theme configuration.
204
206
  */
205
207
  function mergeThemes(context, resolvedConfig) {
206
- context.theme = defu$1(context.theme, resolvedConfig);
208
+ context.theme = mergeConfig(context.theme, resolvedConfig);
207
209
  return context.theme;
208
210
  }
209
211
 
@@ -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,UACH,UAAS;GACP,SAAS;GACT,UAAU;GACV,YAAY;GACZ,aAAa;GACb,KAAK;GACL,QAAQ;GACR,MAAM;GACN,OAAO;GACR;EACH,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"}
1
+ {"version":3,"file":"helpers.mjs","names":["result!: ThemeStyleBorderTypeConfig"],"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 { mergeConfig } from \"powerlines/plugin-utils/merge\";\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 = mergeConfig(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,QAAQ,YAAY,QAAQ,OAAO,eAAe;AAE1D,QAAO,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-theme",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
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.234",
114
- "@powerlines/plugin-style-dictionary": "^0.3.184",
113
+ "@powerlines/plugin-plugin": "^0.12.237",
114
+ "@powerlines/plugin-style-dictionary": "^0.3.187",
115
115
  "@stryke/helpers": "^0.9.42",
116
116
  "@stryke/type-checks": "^0.5.25",
117
- "defu": "^6.1.4",
118
- "powerlines": "^0.38.50",
117
+ "defu": "6.1.4",
118
+ "powerlines": "^0.38.53",
119
119
  "style-dictionary": "^5.3.1"
120
120
  },
121
121
  "devDependencies": {
122
- "@powerlines/plugin-deepkit": "^0.11.162",
122
+ "@powerlines/plugin-deepkit": "^0.11.165",
123
123
  "@types/node": "^22.19.11"
124
124
  },
125
125
  "publishConfig": { "access": "public" },
126
- "gitHead": "305a2a23562d3ddd3f1c04bc770de72a30cf0fcb"
126
+ "gitHead": "1137a1ee3be5bb927dc9b15e118f804fd09a24b4"
127
127
  }