@pierre/diffs 1.3.0 → 1.3.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.
Files changed (76) hide show
  1. package/dist/components/CodeView.d.ts +4 -1
  2. package/dist/components/CodeView.d.ts.map +1 -1
  3. package/dist/components/CodeView.js +60 -26
  4. package/dist/components/CodeView.js.map +1 -1
  5. package/dist/components/File.d.ts +1 -0
  6. package/dist/components/File.d.ts.map +1 -1
  7. package/dist/components/File.js +18 -9
  8. package/dist/components/File.js.map +1 -1
  9. package/dist/components/FileDiff.d.ts +4 -0
  10. package/dist/components/FileDiff.d.ts.map +1 -1
  11. package/dist/components/FileDiff.js +48 -21
  12. package/dist/components/FileDiff.js.map +1 -1
  13. package/dist/components/VirtualizedFile.d.ts +1 -0
  14. package/dist/components/VirtualizedFile.d.ts.map +1 -1
  15. package/dist/components/VirtualizedFile.js +3 -0
  16. package/dist/components/VirtualizedFile.js.map +1 -1
  17. package/dist/components/VirtualizedFileDiff.d.ts +1 -0
  18. package/dist/components/VirtualizedFileDiff.d.ts.map +1 -1
  19. package/dist/components/VirtualizedFileDiff.js +3 -0
  20. package/dist/components/VirtualizedFileDiff.js.map +1 -1
  21. package/dist/edit/index.d.ts +4 -3
  22. package/dist/editor/command.d.ts +10 -2
  23. package/dist/editor/command.d.ts.map +1 -1
  24. package/dist/editor/command.js +113 -39
  25. package/dist/editor/command.js.map +1 -1
  26. package/dist/editor/editStack.d.ts +2 -2
  27. package/dist/editor/editStack.d.ts.map +1 -1
  28. package/dist/editor/editStack.js.map +1 -1
  29. package/dist/editor/editor.d.ts +5 -2
  30. package/dist/editor/editor.d.ts.map +1 -1
  31. package/dist/editor/editor.js +49 -29
  32. package/dist/editor/editor.js.map +1 -1
  33. package/dist/editor/pieceTable.d.ts +1 -2
  34. package/dist/editor/pieceTable.d.ts.map +1 -1
  35. package/dist/editor/pieceTable.js.map +1 -1
  36. package/dist/editor/platform.d.ts +3 -11
  37. package/dist/editor/platform.d.ts.map +1 -1
  38. package/dist/editor/platform.js +2 -28
  39. package/dist/editor/platform.js.map +1 -1
  40. package/dist/editor/searchPanel.d.ts +2 -1
  41. package/dist/editor/searchPanel.d.ts.map +1 -1
  42. package/dist/editor/searchPanel.js.map +1 -1
  43. package/dist/editor/selection.d.ts +2 -2
  44. package/dist/editor/selection.d.ts.map +1 -1
  45. package/dist/editor/selection.js.map +1 -1
  46. package/dist/editor/selectionAction.d.ts +2 -1
  47. package/dist/editor/selectionAction.d.ts.map +1 -1
  48. package/dist/editor/selectionAction.js +3 -1
  49. package/dist/editor/selectionAction.js.map +1 -1
  50. package/dist/editor/textDocument.d.ts +4 -14
  51. package/dist/editor/textDocument.d.ts.map +1 -1
  52. package/dist/editor/textDocument.js +7 -0
  53. package/dist/editor/textDocument.js.map +1 -1
  54. package/dist/index.d.ts +2 -2
  55. package/dist/react/CodeView.d.ts +1 -0
  56. package/dist/react/CodeView.d.ts.map +1 -1
  57. package/dist/react/CodeView.js +9 -0
  58. package/dist/react/CodeView.js.map +1 -1
  59. package/dist/react/index.d.ts +2 -2
  60. package/dist/ssr/index.d.ts +2 -2
  61. package/dist/types.d.ts +22 -2
  62. package/dist/types.d.ts.map +1 -1
  63. package/dist/utils/areManagedSnapshotsEqual.js +1 -1
  64. package/dist/utils/areManagedSnapshotsEqual.js.map +1 -1
  65. package/dist/utils/guardWebKitScrollDuringRebuild.d.ts +20 -0
  66. package/dist/utils/guardWebKitScrollDuringRebuild.d.ts.map +1 -0
  67. package/dist/utils/guardWebKitScrollDuringRebuild.js +34 -0
  68. package/dist/utils/guardWebKitScrollDuringRebuild.js.map +1 -0
  69. package/dist/utils/platform.d.ts +14 -0
  70. package/dist/utils/platform.d.ts.map +1 -0
  71. package/dist/utils/platform.js +32 -0
  72. package/dist/utils/platform.js.map +1 -0
  73. package/dist/worker/wasm-B9ZqxnKj.js.map +1 -1
  74. package/dist/worker/worker-portable.js +13 -12
  75. package/dist/worker/worker-portable.js.map +1 -1
  76. package/package.json +1 -1
@@ -10,7 +10,7 @@ var __exportAll$1 = (all, no_symbols) => {
10
10
  return target;
11
11
  };
12
12
  //#endregion
13
- //#region ../../node_modules/.pnpm/shiki@4.2.0/node_modules/shiki/dist/chunk-BBjsoOtd.mjs
13
+ //#region ../../node_modules/.pnpm/shiki@4.4.1/node_modules/shiki/dist/rolldown-runtime-BBjsoOtd.mjs
14
14
  var __defProp$1 = Object.defineProperty;
15
15
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
16
16
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -36,7 +36,7 @@ var __copyProps = (to, from, except, desc) => {
36
36
  };
37
37
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
38
38
  //#endregion
39
- //#region ../../node_modules/.pnpm/@shikijs+types@4.2.0/node_modules/@shikijs/types/dist/index.mjs
39
+ //#region ../../node_modules/.pnpm/@shikijs+types@4.4.1/node_modules/@shikijs/types/dist/index.mjs
40
40
  var ShikiError$1 = class extends Error {
41
41
  constructor(message) {
42
42
  super(message);
@@ -2368,7 +2368,7 @@ var Registry$1 = class {
2368
2368
  };
2369
2369
  var INITIAL = StateStackImpl.NULL;
2370
2370
  //#endregion
2371
- //#region ../../node_modules/.pnpm/@shikijs+primitive@4.2.0/node_modules/@shikijs/primitive/dist/index.mjs
2371
+ //#region ../../node_modules/.pnpm/@shikijs+primitive@4.4.1/node_modules/@shikijs/primitive/dist/index.mjs
2372
2372
  function resolveColorReplacements(theme, options) {
2373
2373
  const replacements = typeof theme === "string" ? {} : { ...theme.colorReplacements };
2374
2374
  const themeName = typeof theme === "string" ? theme : theme.name;
@@ -2954,7 +2954,7 @@ function tokenizeWithTheme(code, grammar, theme, colorMap, options) {
2954
2954
  }
2955
2955
  function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
2956
2956
  const colorReplacements = resolveColorReplacements(theme, options);
2957
- const { tokenizeMaxLineLength = 0, tokenizeTimeLimit = 500 } = options;
2957
+ const { tokenizeMaxLineLength = 0, tokenizeTimeLimit = 500, includeExplanation = false } = options;
2958
2958
  const lines = splitLines$1(code);
2959
2959
  let stateStack = options.grammarState ? getGrammarStack(options.grammarState, theme.name) ?? INITIAL : options.grammarContextCode != null ? _tokenizeWithTheme(options.grammarContextCode, grammar, theme, colorMap, {
2960
2960
  ...options,
@@ -2983,7 +2983,7 @@ function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
2983
2983
  let resultWithScopes;
2984
2984
  let tokensWithScopes;
2985
2985
  let tokensWithScopesIndex;
2986
- if (options.includeExplanation) {
2986
+ if (includeExplanation && includeExplanation !== "tokenType") {
2987
2987
  resultWithScopes = grammar.tokenizeLine(line, stateStack, tokenizeTimeLimit);
2988
2988
  tokensWithScopes = resultWithScopes.tokens;
2989
2989
  tokensWithScopesIndex = 0;
@@ -3003,9 +3003,10 @@ function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
3003
3003
  color,
3004
3004
  fontStyle
3005
3005
  };
3006
- if (options.includeExplanation) {
3006
+ if (includeExplanation === "tokenType") token.type = EncodedTokenMetadata.getTokenType(metadata);
3007
+ else if (includeExplanation) {
3007
3008
  const themeSettingsSelectors = [];
3008
- if (options.includeExplanation !== "scopeName") for (const setting of theme.settings) {
3009
+ if (includeExplanation !== "scopeName") for (const setting of theme.settings) {
3009
3010
  let selectors;
3010
3011
  switch (typeof setting.scope) {
3011
3012
  case "string":
@@ -3029,7 +3030,7 @@ function _tokenizeWithTheme(code, grammar, theme, colorMap, options) {
3029
3030
  offset += tokenWithScopesText.length;
3030
3031
  token.explanation.push({
3031
3032
  content: tokenWithScopesText,
3032
- scopes: options.includeExplanation === "scopeName" ? explainThemeScopesNameOnly(tokenWithScopes.scopes) : explainThemeScopesFull(themeSettingsSelectors, tokenWithScopes.scopes)
3033
+ scopes: includeExplanation === "scopeName" ? explainThemeScopesNameOnly(tokenWithScopes.scopes) : explainThemeScopesFull(themeSettingsSelectors, tokenWithScopes.scopes)
3033
3034
  });
3034
3035
  tokensWithScopesIndex += 1;
3035
3036
  }
@@ -6236,7 +6237,7 @@ function all(parent) {
6236
6237
  return results.join("");
6237
6238
  }
6238
6239
  //#endregion
6239
- //#region ../../node_modules/.pnpm/@shikijs+core@4.2.0/node_modules/@shikijs/core/dist/index.mjs
6240
+ //#region ../../node_modules/.pnpm/@shikijs+core@4.4.1/node_modules/@shikijs/core/dist/index.mjs
6240
6241
  const RE_WHITESPACE = /\s+/g;
6241
6242
  /**
6242
6243
  * Utility to append class to a hast node
@@ -7221,7 +7222,7 @@ async function createHighlighterCore(options) {
7221
7222
  };
7222
7223
  }
7223
7224
  //#endregion
7224
- //#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.2.0/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs
7225
+ //#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.4.1/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs
7225
7226
  const MAX = 4294967295;
7226
7227
  var JavaScriptScanner = class {
7227
7228
  patterns;
@@ -10282,7 +10283,7 @@ function toRegExpDetails(pattern, options) {
10282
10283
  return details;
10283
10284
  }
10284
10285
  //#endregion
10285
- //#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.2.0/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
10286
+ //#region ../../node_modules/.pnpm/@shikijs+engine-javascript@4.4.1/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs
10286
10287
  /**
10287
10288
  * The default regex constructor for the JavaScript RegExp engine.
10288
10289
  */
@@ -10326,7 +10327,7 @@ function createJavaScriptRegexEngine(options = {}) {
10326
10327
  };
10327
10328
  }
10328
10329
  //#endregion
10329
- //#region ../../node_modules/.pnpm/@shikijs+engine-oniguruma@4.2.0/node_modules/@shikijs/engine-oniguruma/dist/index.mjs
10330
+ //#region ../../node_modules/.pnpm/@shikijs+engine-oniguruma@4.4.1/node_modules/@shikijs/engine-oniguruma/dist/index.mjs
10330
10331
  var dist_exports = /* @__PURE__ */ __exportAll$1({
10331
10332
  createOnigurumaEngine: () => createOnigurumaEngine,
10332
10333
  getDefaultWasmLoader: () => getDefaultWasmLoader,