@lvce-editor/problems-view 1.36.0 → 1.37.0

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.
@@ -6,7 +6,8 @@ const create$a = () => {
6
6
  const commandQueues = new Map();
7
7
  const generations = Object.create(null);
8
8
  const states = Object.create(null);
9
- const commandMapRef = {};
9
+ const commandMapRef = Object.create(null);
10
+ const commandsById = Object.create(null);
10
11
  const getGeneration = uid => generations[uid] || 0;
11
12
  const isCurrentGeneration = (uid, generation) => {
12
13
  return states[uid] !== undefined && getGeneration(uid) === generation;
@@ -68,6 +69,18 @@ const create$a = () => {
68
69
  delete states[key];
69
70
  }
70
71
  },
72
+ createDirectEventCommandMap(requestRender) {
73
+ return {
74
+ async 'Viewlet.executeViewletCommand'(uid, command, ...args) {
75
+ const fn = commandsById[command];
76
+ if (!fn) {
77
+ throw new Error(`Viewlet command not found: ${command}`);
78
+ }
79
+ await fn(uid, ...args);
80
+ await requestRender(uid);
81
+ }
82
+ };
83
+ },
71
84
  diff(uid, modules, numbers) {
72
85
  const {
73
86
  oldState,
@@ -99,6 +112,9 @@ const create$a = () => {
99
112
  },
100
113
  registerCommands(commandMap) {
101
114
  Object.assign(commandMapRef, commandMap);
115
+ for (const [key, fn] of Object.entries(commandMap)) {
116
+ commandsById[toCommandId(key)] = fn;
117
+ }
102
118
  },
103
119
  set(uid, oldState, newState, scheduledState) {
104
120
  const current = states[uid];
@@ -1442,174 +1458,13 @@ const ToolBar = 'toolbar';
1442
1458
  const Tree = 'tree';
1443
1459
  const TreeItem = 'treeitem';
1444
1460
 
1445
- const Audio = 0;
1446
1461
  const Button$1 = 1;
1447
- const Col = 2;
1448
- const ColGroup = 3;
1449
1462
  const Div = 4;
1450
- const H1 = 5;
1451
1463
  const Input = 6;
1452
- const Kbd = 7;
1453
1464
  const Span = 8;
1454
- const Table$1 = 9;
1455
- const TBody = 10;
1456
- const Td = 11;
1457
1465
  const Text = 12;
1458
- const Th = 13;
1459
- const THead = 14;
1460
- const Tr = 15;
1461
- const I = 16;
1462
1466
  const Img = 17;
1463
- const Root = 0;
1464
- const Ins = 20;
1465
- const Del = 21;
1466
- const H2 = 22;
1467
- const H3 = 23;
1468
- const H4 = 24;
1469
- const H5 = 25;
1470
- const H6 = 26;
1471
- const Article = 27;
1472
- const Aside = 28;
1473
- const Footer = 29;
1474
- const Header = 30;
1475
- const Nav = 40;
1476
- const Section = 41;
1477
- const Search = 42;
1478
- const Dd = 43;
1479
- const Dl = 44;
1480
- const Figcaption = 45;
1481
- const Figure = 46;
1482
- const Hr = 47;
1483
- const Li = 48;
1484
- const Ol = 49;
1485
- const P = 50;
1486
- const Pre = 51;
1487
1467
  const A = 53;
1488
- const Abbr = 54;
1489
- const Br = 55;
1490
- const Cite = 56;
1491
- const Data = 57;
1492
- const Time = 58;
1493
- const Tfoot = 59;
1494
- const Ul = 60;
1495
- const Video = 61;
1496
- const TextArea = 62;
1497
- const Select = 63;
1498
- const Option = 64;
1499
- const Code$1 = 65;
1500
- const Label$1 = 66;
1501
- const Dt = 67;
1502
- const Iframe = 68;
1503
- const Main = 69;
1504
- const Strong = 70;
1505
- const Em = 71;
1506
- const Style = 72;
1507
- const Html = 73;
1508
- const Head = 74;
1509
- const Title = 75;
1510
- const Meta = 76;
1511
- const Canvas = 77;
1512
- const Form = 78;
1513
- const BlockQuote = 79;
1514
- const Quote = 80;
1515
- const Circle = 81;
1516
- const Defs = 82;
1517
- const Ellipse = 83;
1518
- const G = 84;
1519
- const Line = 85;
1520
- const Path = 86;
1521
- const Polygon = 87;
1522
- const Polyline = 88;
1523
- const Rect = 89;
1524
- const Svg = 90;
1525
- const Use = 91;
1526
- const Reference = 100;
1527
-
1528
- const VirtualDomElements = {
1529
- __proto__: null,
1530
- A,
1531
- Abbr,
1532
- Article,
1533
- Aside,
1534
- Audio,
1535
- BlockQuote,
1536
- Br,
1537
- Button: Button$1,
1538
- Canvas,
1539
- Circle,
1540
- Cite,
1541
- Code: Code$1,
1542
- Col,
1543
- ColGroup,
1544
- Data,
1545
- Dd,
1546
- Defs,
1547
- Del,
1548
- Div,
1549
- Dl,
1550
- Dt,
1551
- Ellipse,
1552
- Em,
1553
- Figcaption,
1554
- Figure,
1555
- Footer,
1556
- Form,
1557
- G,
1558
- H1,
1559
- H2,
1560
- H3,
1561
- H4,
1562
- H5,
1563
- H6,
1564
- Head,
1565
- Header,
1566
- Hr,
1567
- Html,
1568
- I,
1569
- Iframe,
1570
- Img,
1571
- Input,
1572
- Ins,
1573
- Kbd,
1574
- Label: Label$1,
1575
- Li,
1576
- Line,
1577
- Main,
1578
- Meta,
1579
- Nav,
1580
- Ol,
1581
- Option,
1582
- P,
1583
- Path,
1584
- Polygon,
1585
- Polyline,
1586
- Pre,
1587
- Quote,
1588
- Rect,
1589
- Reference,
1590
- Root,
1591
- Search,
1592
- Section,
1593
- Select,
1594
- Span,
1595
- Strong,
1596
- Style,
1597
- Svg,
1598
- TBody,
1599
- THead,
1600
- Table: Table$1,
1601
- Td,
1602
- Text,
1603
- TextArea,
1604
- Tfoot,
1605
- Th,
1606
- Time,
1607
- Title,
1608
- Tr,
1609
- Ul,
1610
- Use,
1611
- Video
1612
- };
1613
1468
 
1614
1469
  const ClientX = 'event.clientX';
1615
1470
  const ClientY = 'event.clientY';
@@ -2010,8 +1865,6 @@ const text = data => {
2010
1865
  };
2011
1866
  };
2012
1867
 
2013
- new Set(Object.values(VirtualDomElements));
2014
-
2015
1868
  const FocusProblems = 19;
2016
1869
 
2017
1870
  const getKeyBindings = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",