@salesforcedevs/dx-components 1.18.8 → 1.19.3-layoutfix-alpha1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.18.8",
3
+ "version": "1.19.3-layoutfix-alpha1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -45,6 +45,5 @@
45
45
  },
46
46
  "volta": {
47
47
  "node": "20.19.0"
48
- },
49
- "gitHead": "e9d51d7dab7f574cbbc850c7201d3296ffd7f321"
48
+ }
50
49
  }
@@ -95,7 +95,7 @@ img.mobile.center-img {
95
95
  position: absolute;
96
96
  left: 0;
97
97
  bottom: 0;
98
- width: 418px;
98
+ width: 419px;
99
99
  height: 515px;
100
100
  }
101
101
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  .toc {
5
5
  display: flex;
6
- flex-direction: row-reverse;
6
+ flex-direction: row;
7
7
  max-width: 240px;
8
8
  min-width: 80px;
9
9
  word-break: break-word;
@@ -1,11 +1,13 @@
1
- import { createHighlighterCore, HighlighterCore } from "shiki/core";
1
+ import * as shiki from "shiki";
2
+
2
3
  import type { BundledLanguage, BundledTheme } from "shiki";
3
- import { createOnigurumaEngine } from "shiki/engine/oniguruma";
4
4
  import { transformerColorizedBrackets } from "@shikijs/colorized-brackets";
5
+ import { getCustomLanguageGrammars } from "dxUtils/shikiGrammars";
6
+
5
7
  interface ShikiSingleton {
6
- highlighter: HighlighterCore | null;
8
+ highlighter: shiki.HighlighterCore | null;
7
9
  initialized: boolean;
8
- initPromise: Promise<HighlighterCore> | null;
10
+ initPromise: Promise<shiki.HighlighterCore> | null;
9
11
  }
10
12
 
11
13
  const shikiInstance: ShikiSingleton = {
@@ -50,58 +52,47 @@ const LANGUAGE_MAP: Record<string, BundledLanguage> = {
50
52
 
51
53
  // Core languages that should be loaded immediately for best performance
52
54
  const CORE_LANGUAGES = [
53
- // @ts-ignore
54
- () => import("@shikijs/langs/apex"),
55
- // @ts-ignore
56
- () => import("@shikijs/langs/javascript"),
57
- // @ts-ignore
58
- () => import("@shikijs/langs/html"),
59
- // @ts-ignore
60
- () => import("@shikijs/langs/css"),
61
- // @ts-ignore
62
- () => import("@shikijs/langs/json"),
63
- // @ts-ignore
64
- () => import("@shikijs/langs/sql"),
65
- // @ts-ignore
66
- () => import("@shikijs/langs/bash"),
67
- // @ts-ignore
68
- () => import("@shikijs/langs/xml"),
69
- // @ts-ignore
70
- () => import("@shikijs/langs/graphql"),
71
- // @ts-ignore
72
- () => import("@shikijs/langs/jsx"),
73
- // @ts-ignore
74
- () => import("./customLanguages/ampscript.tmLanguage.json")
55
+ "apex",
56
+ "javascript",
57
+ "html",
58
+ "css",
59
+ "json",
60
+ "sql",
61
+ "bash",
62
+ "xml",
63
+ "graphql",
64
+ "jsx",
65
+ getCustomLanguageGrammars().ampscript
75
66
  ];
76
67
 
77
68
  // Non-critical languages that can be loaded asynchronously when needed
78
- const OPTIONAL_LANGUAGES: Record<string, () => Promise<any>> = {
69
+ const OPTIONAL_LANGUAGES: Record<string, any> = {
79
70
  // @ts-ignore
80
- typescript: () => import("@shikijs/langs/typescript"),
71
+ typescript: "typescript",
81
72
  // @ts-ignore
82
- markdown: () => import("@shikijs/langs/markdown"),
73
+ markdown: "markdown",
83
74
  // @ts-ignore
84
- python: () => import("@shikijs/langs/python"),
75
+ python: "python",
85
76
  // @ts-ignore
86
- java: () => import("@shikijs/langs/java"),
77
+ java: "java",
87
78
  // @ts-ignore
88
- yaml: () => import("@shikijs/langs/yaml"),
79
+ yaml: "yaml",
89
80
  // @ts-ignore
90
- php: () => import("@shikijs/langs/php"),
81
+ php: "php",
91
82
  // @ts-ignore
92
- swift: () => import("@shikijs/langs/swift"),
83
+ swift: "swift",
93
84
  // @ts-ignore
94
- kotlin: () => import("@shikijs/langs/kotlin"),
85
+ kotlin: "kotlin",
95
86
  // @ts-ignore
96
- handlebars: () => import("@shikijs/langs/handlebars"),
87
+ handlebars: "handlebars",
97
88
  // @ts-ignore
98
- dataweave: () => import("./customLanguages/dataweave.tmLanguage.json"),
89
+ dataweave: getCustomLanguageGrammars().dataweave,
99
90
  // @ts-ignore
100
- afscript: () => import("./customLanguages/afscript.tmLanguage.json")
91
+ afscript: getCustomLanguageGrammars().afscript
101
92
  };
102
93
 
103
94
  // Initialize Shiki highlighter with fine-grained modules for better performance
104
- async function initializeShiki(): Promise<HighlighterCore> {
95
+ async function initializeShiki(): Promise<shiki.HighlighterCore> {
105
96
  if (shikiInstance.highlighter) {
106
97
  return shikiInstance.highlighter;
107
98
  }
@@ -110,15 +101,9 @@ async function initializeShiki(): Promise<HighlighterCore> {
110
101
  return shikiInstance.initPromise;
111
102
  }
112
103
 
113
- shikiInstance.initPromise = createHighlighterCore({
114
- themes: [
115
- // @ts-ignore
116
- import("@shikijs/themes/light-plus"),
117
- // @ts-ignore
118
- import("@shikijs/themes/material-theme-darker")
119
- ],
120
- langs: CORE_LANGUAGES,
121
- engine: createOnigurumaEngine(import("shiki/wasm"))
104
+ shikiInstance.initPromise = shiki.createHighlighter({
105
+ themes: ["light-plus", "material-theme-darker"],
106
+ langs: CORE_LANGUAGES
122
107
  });
123
108
 
124
109
  try {
@@ -134,7 +119,7 @@ async function initializeShiki(): Promise<HighlighterCore> {
134
119
 
135
120
  // Async function to load additional languages when needed
136
121
  async function loadLanguageIfNeeded(
137
- highlighter: HighlighterCore,
122
+ highlighter: shiki.HighlighterCore,
138
123
  language: string
139
124
  ): Promise<void> {
140
125
  const loadedLanguages = highlighter.getLoadedLanguages();
@@ -145,10 +130,7 @@ async function loadLanguageIfNeeded(
145
130
 
146
131
  if (languageLoader) {
147
132
  try {
148
- const languageModule = await languageLoader();
149
- await highlighter.loadLanguage(
150
- languageModule.default || languageModule
151
- );
133
+ await highlighter.loadLanguage(languageLoader);
152
134
  } catch (error) {
153
135
  console.warn(
154
136
  `Failed to load optional language ${language}:`,
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <!-- This is a utility module for importing custom language grammars for Shiki -->
3
+ </template>