@opentui/core 0.1.62 → 0.1.64

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/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  ASCIIFontSelectionHelper,
4
+ ATTRIBUTE_BASE_BITS,
5
+ ATTRIBUTE_BASE_MASK,
4
6
  BaseRenderable,
5
7
  BorderCharArrays,
6
8
  BorderChars,
@@ -39,6 +41,7 @@ import {
39
41
  TextBuffer,
40
42
  TreeSitterClient,
41
43
  addDefaultParsers,
44
+ attributesWithLink,
42
45
  bg,
43
46
  bgBlack,
44
47
  bgBlue,
@@ -83,11 +86,13 @@ import {
83
86
  fonts,
84
87
  generateEnvColored,
85
88
  generateEnvMarkdown,
89
+ getBaseAttributes,
86
90
  getBorderFromSides,
87
91
  getBorderSides,
88
92
  getCharacterPositions,
89
93
  getDataPaths,
90
94
  getKeyBindingKey,
95
+ getLinkId,
91
96
  getObjectsInViewport,
92
97
  getTreeSitterClient,
93
98
  green,
@@ -101,6 +106,7 @@ import {
101
106
  isVNode,
102
107
  isValidPercentage,
103
108
  italic,
109
+ link,
104
110
  magenta,
105
111
  main,
106
112
  maybeMakeRenderable,
@@ -109,6 +115,7 @@ import {
109
115
  mergeKeyBindings,
110
116
  nonAlphanumericKeys,
111
117
  parseAlign,
118
+ parseAlignItems,
112
119
  parseBoxSizing,
113
120
  parseColor,
114
121
  parseDimension,
@@ -143,7 +150,7 @@ import {
143
150
  white,
144
151
  wrapWithDelegates,
145
152
  yellow
146
- } from "./index-mrwvcpzb.js";
153
+ } from "./index-h33hh1n5.js";
147
154
  // src/text-buffer-view.ts
148
155
  class TextBufferView {
149
156
  lib;
@@ -3041,7 +3048,8 @@ function styledTextToTextNodes(styledText) {
3041
3048
  const node = new TextNodeRenderable({
3042
3049
  fg: chunk.fg,
3043
3050
  bg: chunk.bg,
3044
- attributes: chunk.attributes
3051
+ attributes: chunk.attributes,
3052
+ link: chunk.link
3045
3053
  });
3046
3054
  node.add(chunk.text);
3047
3055
  return node;
@@ -3053,6 +3061,7 @@ class TextNodeRenderable extends BaseRenderable {
3053
3061
  _fg;
3054
3062
  _bg;
3055
3063
  _attributes;
3064
+ _link;
3056
3065
  _children = [];
3057
3066
  parent = null;
3058
3067
  constructor(options) {
@@ -3060,6 +3069,7 @@ class TextNodeRenderable extends BaseRenderable {
3060
3069
  this._fg = options.fg ? parseColor(options.fg) : undefined;
3061
3070
  this._bg = options.bg ? parseColor(options.bg) : undefined;
3062
3071
  this._attributes = options.attributes ?? 0;
3072
+ this._link = options.link;
3063
3073
  }
3064
3074
  get children() {
3065
3075
  return this._children;
@@ -3162,10 +3172,15 @@ class TextNodeRenderable extends BaseRenderable {
3162
3172
  return {
3163
3173
  fg: this._fg ?? parentStyle.fg,
3164
3174
  bg: this._bg ?? parentStyle.bg,
3165
- attributes: this._attributes | parentStyle.attributes
3175
+ attributes: this._attributes | parentStyle.attributes,
3176
+ link: this._link ?? parentStyle.link
3166
3177
  };
3167
3178
  }
3168
- gatherWithInheritedStyle(parentStyle = { fg: undefined, bg: undefined, attributes: 0 }) {
3179
+ gatherWithInheritedStyle(parentStyle = {
3180
+ fg: undefined,
3181
+ bg: undefined,
3182
+ attributes: 0
3183
+ }) {
3169
3184
  const currentStyle = this.mergeStyles(parentStyle);
3170
3185
  const chunks = [];
3171
3186
  for (const child of this._children) {
@@ -3175,7 +3190,8 @@ class TextNodeRenderable extends BaseRenderable {
3175
3190
  text: child,
3176
3191
  fg: currentStyle.fg,
3177
3192
  bg: currentStyle.bg,
3178
- attributes: currentStyle.attributes
3193
+ attributes: currentStyle.attributes,
3194
+ link: currentStyle.link
3179
3195
  });
3180
3196
  } else {
3181
3197
  const childChunks = child.gatherWithInheritedStyle(currentStyle);
@@ -3197,7 +3213,11 @@ class TextNodeRenderable extends BaseRenderable {
3197
3213
  }
3198
3214
  return node;
3199
3215
  }
3200
- toChunks(parentStyle = { fg: undefined, bg: undefined, attributes: 0 }) {
3216
+ toChunks(parentStyle = {
3217
+ fg: undefined,
3218
+ bg: undefined,
3219
+ attributes: 0
3220
+ }) {
3201
3221
  return this.gatherWithInheritedStyle(parentStyle);
3202
3222
  }
3203
3223
  getChildren() {
@@ -3243,6 +3263,13 @@ class TextNodeRenderable extends BaseRenderable {
3243
3263
  get attributes() {
3244
3264
  return this._attributes;
3245
3265
  }
3266
+ set link(link2) {
3267
+ this._link = link2;
3268
+ this.requestRender();
3269
+ }
3270
+ get link() {
3271
+ return this._link;
3272
+ }
3246
3273
  findDescendantById(id) {
3247
3274
  return;
3248
3275
  }
@@ -3798,7 +3825,7 @@ class LineNumberRenderable extends Renderable {
3798
3825
  }
3799
3826
  }
3800
3827
 
3801
- // ../../node_modules/diff/libesm/diff/base.js
3828
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/base.js
3802
3829
  class Diff {
3803
3830
  diff(oldStr, newStr, options = {}) {
3804
3831
  let callback;
@@ -3998,12 +4025,12 @@ class Diff {
3998
4025
  }
3999
4026
  }
4000
4027
 
4001
- // ../../node_modules/diff/libesm/diff/character.js
4028
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/character.js
4002
4029
  class CharacterDiff extends Diff {
4003
4030
  }
4004
4031
  var characterDiff = new CharacterDiff;
4005
4032
 
4006
- // ../../node_modules/diff/libesm/util/string.js
4033
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/util/string.js
4007
4034
  function longestCommonPrefix(str1, str2) {
4008
4035
  let i;
4009
4036
  for (i = 0;i < str1.length && i < str2.length; i++) {
@@ -4099,7 +4126,7 @@ function leadingWs(string) {
4099
4126
  return match ? match[0] : "";
4100
4127
  }
4101
4128
 
4102
- // ../../node_modules/diff/libesm/diff/word.js
4129
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/word.js
4103
4130
  var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
4104
4131
  var tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
4105
4132
 
@@ -4237,7 +4264,7 @@ class WordsWithSpaceDiff extends Diff {
4237
4264
  }
4238
4265
  var wordsWithSpaceDiff = new WordsWithSpaceDiff;
4239
4266
 
4240
- // ../../node_modules/diff/libesm/diff/line.js
4267
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/line.js
4241
4268
  class LineDiff extends Diff {
4242
4269
  constructor() {
4243
4270
  super(...arguments);
@@ -4287,7 +4314,7 @@ function tokenize(value, options) {
4287
4314
  return retLines;
4288
4315
  }
4289
4316
 
4290
- // ../../node_modules/diff/libesm/diff/sentence.js
4317
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/sentence.js
4291
4318
  function isSentenceEndPunct(char) {
4292
4319
  return char == "." || char == "!" || char == "?";
4293
4320
  }
@@ -4317,7 +4344,7 @@ class SentenceDiff extends Diff {
4317
4344
  }
4318
4345
  var sentenceDiff = new SentenceDiff;
4319
4346
 
4320
- // ../../node_modules/diff/libesm/diff/css.js
4347
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/css.js
4321
4348
  class CssDiff extends Diff {
4322
4349
  tokenize(value) {
4323
4350
  return value.split(/([{}:;,]|\s+)/);
@@ -4325,7 +4352,7 @@ class CssDiff extends Diff {
4325
4352
  }
4326
4353
  var cssDiff = new CssDiff;
4327
4354
 
4328
- // ../../node_modules/diff/libesm/diff/json.js
4355
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/json.js
4329
4356
  class JsonDiff extends Diff {
4330
4357
  constructor() {
4331
4358
  super(...arguments);
@@ -4394,7 +4421,7 @@ function canonicalize(obj, stack, replacementStack, replacer, key) {
4394
4421
  return canonicalizedObj;
4395
4422
  }
4396
4423
 
4397
- // ../../node_modules/diff/libesm/diff/array.js
4424
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/array.js
4398
4425
  class ArrayDiff extends Diff {
4399
4426
  tokenize(value) {
4400
4427
  return value.slice();
@@ -4408,7 +4435,7 @@ class ArrayDiff extends Diff {
4408
4435
  }
4409
4436
  var arrayDiff = new ArrayDiff;
4410
4437
 
4411
- // ../../node_modules/diff/libesm/patch/parse.js
4438
+ // ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/patch/parse.js
4412
4439
  function parsePatch(uniDiff) {
4413
4440
  const diffstr = uniDiff.split(/\n/), list = [];
4414
4441
  let i = 0;
@@ -8276,7 +8303,15 @@ var defaultTextareaKeybindings = [
8276
8303
  { name: "b", meta: true, shift: true, action: "select-word-backward" },
8277
8304
  { name: "right", meta: true, shift: true, action: "select-word-forward" },
8278
8305
  { name: "left", meta: true, shift: true, action: "select-word-backward" },
8279
- { name: "backspace", meta: true, action: "delete-word-backward" }
8306
+ { name: "backspace", meta: true, action: "delete-word-backward" },
8307
+ { name: "left", super: true, action: "visual-line-home" },
8308
+ { name: "right", super: true, action: "visual-line-end" },
8309
+ { name: "up", super: true, action: "buffer-home" },
8310
+ { name: "down", super: true, action: "buffer-end" },
8311
+ { name: "left", super: true, shift: true, action: "select-visual-line-home" },
8312
+ { name: "right", super: true, shift: true, action: "select-visual-line-end" },
8313
+ { name: "up", super: true, shift: true, action: "select-buffer-home" },
8314
+ { name: "down", super: true, shift: true, action: "select-buffer-end" }
8280
8315
  ];
8281
8316
 
8282
8317
  class TextareaRenderable extends EditBufferRenderable {
@@ -8769,11 +8804,13 @@ export {
8769
8804
  parseDimension,
8770
8805
  parseColor,
8771
8806
  parseBoxSizing,
8807
+ parseAlignItems,
8772
8808
  parseAlign,
8773
8809
  nonAlphanumericKeys,
8774
8810
  measureText,
8775
8811
  maybeMakeRenderable,
8776
8812
  magenta,
8813
+ link,
8777
8814
  italic,
8778
8815
  isVNode,
8779
8816
  isTextNodeRenderable,
@@ -8786,10 +8823,12 @@ export {
8786
8823
  h,
8787
8824
  green,
8788
8825
  getTreeSitterClient,
8826
+ getLinkId,
8789
8827
  getDataPaths,
8790
8828
  getCharacterPositions,
8791
8829
  getBorderSides,
8792
8830
  getBorderFromSides,
8831
+ getBaseAttributes,
8793
8832
  generateEnvMarkdown,
8794
8833
  generateEnvColored,
8795
8834
  fonts,
@@ -8834,6 +8873,7 @@ export {
8834
8873
  bgBlue,
8835
8874
  bgBlack,
8836
8875
  bg,
8876
+ attributesWithLink,
8837
8877
  applySepia,
8838
8878
  applyScanlines,
8839
8879
  applyNoise,
@@ -8915,10 +8955,12 @@ export {
8915
8955
  BloomEffect,
8916
8956
  BaseRenderable,
8917
8957
  ArrowRenderable,
8958
+ ATTRIBUTE_BASE_MASK,
8959
+ ATTRIBUTE_BASE_BITS,
8918
8960
  ASCIIFontSelectionHelper,
8919
8961
  ASCIIFontRenderable,
8920
8962
  ASCIIFont
8921
8963
  };
8922
8964
 
8923
- //# debugId=36CCE839639ECF0564756E2164756E21
8965
+ //# debugId=34E1AAA3BB112D5D64756E2164756E21
8924
8966
  //# sourceMappingURL=index.js.map