@lvce-editor/problems-view 1.26.3 → 1.26.4

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.
@@ -300,6 +300,61 @@ class VError extends Error {
300
300
  }
301
301
  }
302
302
 
303
+ class AssertionError extends Error {
304
+ constructor(message) {
305
+ super(message);
306
+ this.name = 'AssertionError';
307
+ }
308
+ }
309
+ const Object$1 = 1;
310
+ const Number$1 = 2;
311
+ const Array$1 = 3;
312
+ const String$1 = 4;
313
+ const Boolean$1 = 5;
314
+ const Function = 6;
315
+ const Null = 7;
316
+ const Unknown = 8;
317
+ const getType = value => {
318
+ switch (typeof value) {
319
+ case 'number':
320
+ return Number$1;
321
+ case 'function':
322
+ return Function;
323
+ case 'string':
324
+ return String$1;
325
+ case 'object':
326
+ if (value === null) {
327
+ return Null;
328
+ }
329
+ if (Array.isArray(value)) {
330
+ return Array$1;
331
+ }
332
+ return Object$1;
333
+ case 'boolean':
334
+ return Boolean$1;
335
+ default:
336
+ return Unknown;
337
+ }
338
+ };
339
+ const number = value => {
340
+ const type = getType(value);
341
+ if (type !== Number$1) {
342
+ throw new AssertionError('expected value to be of type number');
343
+ }
344
+ };
345
+ const array = value => {
346
+ const type = getType(value);
347
+ if (type !== Array$1) {
348
+ throw new AssertionError('expected value to be of type array');
349
+ }
350
+ };
351
+ const string = value => {
352
+ const type = getType(value);
353
+ if (type !== String$1) {
354
+ throw new AssertionError('expected value to be of type string');
355
+ }
356
+ };
357
+
303
358
  const isMessagePort = value => {
304
359
  return value && value instanceof MessagePort;
305
360
  };
@@ -1211,6 +1266,34 @@ const listen$1 = async (module, options) => {
1211
1266
  return ipc;
1212
1267
  };
1213
1268
 
1269
+ const createSharedLazyRpc = factory => {
1270
+ let rpcPromise;
1271
+ const getOrCreate = () => {
1272
+ if (!rpcPromise) {
1273
+ rpcPromise = factory();
1274
+ }
1275
+ return rpcPromise;
1276
+ };
1277
+ return {
1278
+ async dispose() {
1279
+ const rpc = await getOrCreate();
1280
+ await rpc.dispose();
1281
+ },
1282
+ async invoke(method, ...params) {
1283
+ const rpc = await getOrCreate();
1284
+ return rpc.invoke(method, ...params);
1285
+ },
1286
+ async invokeAndTransfer(method, ...params) {
1287
+ const rpc = await getOrCreate();
1288
+ return rpc.invokeAndTransfer(method, ...params);
1289
+ },
1290
+ async send(method, ...params) {
1291
+ const rpc = await getOrCreate();
1292
+ rpc.send(method, ...params);
1293
+ }
1294
+ };
1295
+ };
1296
+
1214
1297
  const create$5 = async ({
1215
1298
  commandMap,
1216
1299
  isMessagePortOpen = true,
@@ -1246,34 +1329,6 @@ const create$4 = async ({
1246
1329
  });
1247
1330
  };
1248
1331
 
1249
- const createSharedLazyRpc = factory => {
1250
- let rpcPromise;
1251
- const getOrCreate = () => {
1252
- if (!rpcPromise) {
1253
- rpcPromise = factory();
1254
- }
1255
- return rpcPromise;
1256
- };
1257
- return {
1258
- async dispose() {
1259
- const rpc = await getOrCreate();
1260
- await rpc.dispose();
1261
- },
1262
- async invoke(method, ...params) {
1263
- const rpc = await getOrCreate();
1264
- return rpc.invoke(method, ...params);
1265
- },
1266
- async invokeAndTransfer(method, ...params) {
1267
- const rpc = await getOrCreate();
1268
- return rpc.invokeAndTransfer(method, ...params);
1269
- },
1270
- async send(method, ...params) {
1271
- const rpc = await getOrCreate();
1272
- rpc.send(method, ...params);
1273
- }
1274
- };
1275
- };
1276
-
1277
1332
  const create$3 = async ({
1278
1333
  commandMap,
1279
1334
  isMessagePortOpen,
@@ -1586,61 +1641,6 @@ const EditorWorker = {
1586
1641
  set: set$3
1587
1642
  };
1588
1643
 
1589
- class AssertionError extends Error {
1590
- constructor(message) {
1591
- super(message);
1592
- this.name = 'AssertionError';
1593
- }
1594
- }
1595
- const Object$1 = 1;
1596
- const Number$1 = 2;
1597
- const Array$1 = 3;
1598
- const String$1 = 4;
1599
- const Boolean$1 = 5;
1600
- const Function = 6;
1601
- const Null = 7;
1602
- const Unknown = 8;
1603
- const getType = value => {
1604
- switch (typeof value) {
1605
- case 'number':
1606
- return Number$1;
1607
- case 'function':
1608
- return Function;
1609
- case 'string':
1610
- return String$1;
1611
- case 'object':
1612
- if (value === null) {
1613
- return Null;
1614
- }
1615
- if (Array.isArray(value)) {
1616
- return Array$1;
1617
- }
1618
- return Object$1;
1619
- case 'boolean':
1620
- return Boolean$1;
1621
- default:
1622
- return Unknown;
1623
- }
1624
- };
1625
- const number = value => {
1626
- const type = getType(value);
1627
- if (type !== Number$1) {
1628
- throw new AssertionError('expected value to be of type number');
1629
- }
1630
- };
1631
- const array = value => {
1632
- const type = getType(value);
1633
- if (type !== Array$1) {
1634
- throw new AssertionError('expected value to be of type array');
1635
- }
1636
- };
1637
- const string = value => {
1638
- const type = getType(value);
1639
- if (type !== String$1) {
1640
- throw new AssertionError('expected value to be of type string');
1641
- }
1642
- };
1643
-
1644
1644
  const {
1645
1645
  invoke,
1646
1646
  invokeAndTransfer,
@@ -2828,7 +2828,7 @@ const getFilterBadgeDom = badgeText => {
2828
2828
  return [filterBadgeNode, text(badgeText)];
2829
2829
  };
2830
2830
 
2831
- const getInputBoxVirtualDom = (name, onInput, placeholder) => {
2831
+ const getInputBoxVirtualDom = (name, onInput, placeholder, value) => {
2832
2832
  return {
2833
2833
  ariaLabel: placeholder,
2834
2834
  autocapitalize: 'off',
@@ -2839,7 +2839,10 @@ const getInputBoxVirtualDom = (name, onInput, placeholder) => {
2839
2839
  onInput,
2840
2840
  placeholder,
2841
2841
  spellcheck: false,
2842
- type: Input
2842
+ type: Input,
2843
+ ...(value && {
2844
+ value
2845
+ })
2843
2846
  };
2844
2847
  };
2845
2848
 
@@ -2862,7 +2865,7 @@ const getProblemsFilterVirtualDom = action => {
2862
2865
  childCount: getChildCount(action.badgeText),
2863
2866
  className: Filter$1,
2864
2867
  type: Div
2865
- }, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getFilterBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
2868
+ }, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || '', action.value), ...getFilterBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
2866
2869
  command: 'more filters',
2867
2870
  icon: Filter,
2868
2871
  id: 'more filters'})];
@@ -3201,7 +3204,9 @@ const getProblemsVirtualDom = (activeUri, viewMode, problems, filterValue, isSma
3201
3204
  const filterDom = isSmall ? getProblemsFilterVirtualDom({
3202
3205
  badgeText: '',
3203
3206
  command: HandleFilterInput,
3204
- placeholder: filter()}) : [];
3207
+ placeholder: filter(),
3208
+ value: filterValue
3209
+ }) : [];
3205
3210
  const itemsDom = getProblemsVirtualDom$1(viewMode, problems, filterValue, message, problemCount);
3206
3211
  const scrollBarDom = getScrollBarVirtualDom(scrollBarHeight, scrollBarActive);
3207
3212
  const contentClassName = viewMode === Table ? mergeClassNames(ProblemsContent, ProblemsContentTable) : ProblemsContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.26.3",
3
+ "version": "1.26.4",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",