lightview 1.7.2-b → 1.8.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 (122) hide show
  1. package/README.md +15 -16
  2. package/docs/CNAME +1 -0
  3. package/docs/api.html +674 -0
  4. package/docs/blank.html +10 -0
  5. package/docs/comparedto.html +89 -0
  6. package/docs/components/chart-repl.html +69 -0
  7. package/docs/components/chart.html +17 -0
  8. package/{components → docs/components}/components.js +31 -11
  9. package/docs/components/contents.html +17 -0
  10. package/docs/components/gantt-repl.html +61 -0
  11. package/docs/components/gantt.html +42 -0
  12. package/docs/components/gauge-repl.html +66 -0
  13. package/docs/components/gauge.html +20 -0
  14. package/docs/components/orgchart-repl.html +64 -0
  15. package/docs/components/orgchart.html +41 -0
  16. package/docs/components/repl-as-src.html +17 -0
  17. package/docs/components/repl-repl.html +95 -0
  18. package/docs/components/repl.html +527 -0
  19. package/docs/components/timeline-repl.html +72 -0
  20. package/docs/components/timeline.html +44 -0
  21. package/docs/components.html +14 -0
  22. package/docs/css/highlightjs.min.css +9 -0
  23. package/docs/css/tutorial.css +35 -0
  24. package/docs/examples/anchor.html +11 -0
  25. package/{components/chart/example.html → docs/examples/chart.html} +6 -4
  26. package/docs/examples/counter.html +26 -0
  27. package/{examples → docs/examples}/counter.test.mjs +0 -0
  28. package/docs/examples/counter2.html +26 -0
  29. package/{examples → docs/examples}/directives.html +20 -18
  30. package/{examples → docs/examples}/foreign.html +1 -1
  31. package/docs/examples/forgeinform.html +98 -0
  32. package/docs/examples/form.html +61 -0
  33. package/{examples → docs/examples}/gauge.html +4 -2
  34. package/{examples → docs/examples}/invalid-template-literals.html +6 -4
  35. package/{examples → docs/examples}/medium/remote.html +1 -1
  36. package/docs/examples/message.html +18 -0
  37. package/{examples → docs/examples}/nested.html +2 -2
  38. package/docs/examples/object-bound-form.html +34 -0
  39. package/{examples → docs/examples}/remote-server.js +0 -0
  40. package/docs/examples/remote.html +34 -0
  41. package/{examples → docs/examples}/remote.json +0 -0
  42. package/{examples → docs/examples}/scratch.html +1 -1
  43. package/docs/examples/sensors/index.html +44 -0
  44. package/{examples → docs/examples}/sensors/sensor-server.js +0 -0
  45. package/docs/examples/shared.html +41 -0
  46. package/{examples → docs/examples}/template.html +1 -1
  47. package/{examples → docs/examples}/timeline.html +2 -2
  48. package/docs/examples/todo.html +40 -0
  49. package/docs/examples/top.html +10 -0
  50. package/{examples → docs/examples}/types.html +1 -1
  51. package/{examples → docs/examples}/xor.html +22 -20
  52. package/docs/examples.html +25 -0
  53. package/docs/index.html +44 -0
  54. package/docs/javascript/codejar.min.js +8 -0
  55. package/docs/javascript/highlightjs.min.js +1173 -0
  56. package/docs/javascript/isomorphic-git.js +9 -0
  57. package/docs/javascript/json5.min.js +1 -0
  58. package/docs/javascript/lightning-fs.js +1 -0
  59. package/docs/javascript/lightview.js +1285 -0
  60. package/docs/javascript/marked.min.js +6 -0
  61. package/docs/javascript/peerjs.min.js +70 -0
  62. package/docs/javascript/turndown.js +973 -0
  63. package/docs/javascript/types.js +606 -0
  64. package/docs/javascript/utils.js +45 -0
  65. package/docs/lightview.html +63 -0
  66. package/docs/old_index.html +965 -0
  67. package/docs/old_index.md +1132 -0
  68. package/docs/slidein.html +51 -0
  69. package/docs/tutorial/0-getting-started.html +67 -0
  70. package/docs/tutorial/1-intro-to-variables.html +103 -0
  71. package/docs/tutorial/10-template-components.html +80 -0
  72. package/docs/tutorial/11-linked-components.html +76 -0
  73. package/docs/tutorial/12-imported-components.html +67 -0
  74. package/docs/tutorial/13-input-binding.html +94 -0
  75. package/docs/tutorial/14-automatic-variable-creation.html +74 -0
  76. package/docs/tutorial/15-form-binding.html +110 -0
  77. package/docs/tutorial/16-if-directive.html +60 -0
  78. package/docs/tutorial/17-loop-directives.html +83 -0
  79. package/docs/tutorial/18-sanitizing-and-escaping-input.html +79 -0
  80. package/docs/tutorial/2-imported-and-exported-variables.html +80 -0
  81. package/docs/tutorial/3-data-types.html +89 -0
  82. package/docs/tutorial/4-extended-data-types.html +83 -0
  83. package/docs/tutorial/5-extended-functional-types.html +96 -0
  84. package/docs/tutorial/5.1-extended-functional-types.html +79 -0
  85. package/docs/tutorial/5.2-extended-functional-types.html +70 -0
  86. package/docs/tutorial/6-conventional-javascript.html +75 -0
  87. package/docs/tutorial/7-monitoring-with-observers.html +107 -0
  88. package/docs/tutorial/8-event-listeners.html +65 -0
  89. package/docs/tutorial/9-intro-to-components.html +91 -0
  90. package/docs/tutorial/contents.html +32 -0
  91. package/docs/tutorial/my-component.html +29 -0
  92. package/docs/tutorial/remote-value.json +4 -0
  93. package/docs/websiterepl.html +46 -0
  94. package/lightview.js +499 -363
  95. package/lightview.min.js +1 -0
  96. package/lightview_good.js +1267 -0
  97. package/lightview_optimized.js +1274 -0
  98. package/package.json +7 -2
  99. package/repl_hold.html +320 -0
  100. package/test/basic.html +29 -17
  101. package/test/basic.test.mjs +1 -11
  102. package/test/extended.html +16 -19
  103. package/types.js +118 -36
  104. package/unsplash.key +1 -0
  105. package/components/chart/chart.html +0 -15
  106. package/components/chart.html +0 -81
  107. package/components/gantt/example.html +0 -27
  108. package/components/gantt/gantt.html +0 -34
  109. package/components/gauge/example.html +0 -28
  110. package/components/gauge/guage.html +0 -19
  111. package/components/gauge.html +0 -57
  112. package/components/timeline.html +0 -81
  113. package/examples/chart.html +0 -66
  114. package/examples/counter.html +0 -24
  115. package/examples/forgeinform.html +0 -96
  116. package/examples/form.html +0 -59
  117. package/examples/message.html +0 -12
  118. package/examples/object-bound-form.html +0 -32
  119. package/examples/remote.html +0 -32
  120. package/examples/sensors/index.html +0 -30
  121. package/examples/todo.html +0 -38
  122. package/examples/top.html +0 -10
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <head>
3
+ <title>Lightview:Sensor Demo</title>
4
+ <link href="../../components/gauge-repl.html" rel="module">
5
+ <script src="../../../lightview.js?as=x-body"></script>
6
+ <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
7
+ <script src="https://unpkg.com/json5@^2.0.0/dist/index.min.js"></script>
8
+ </head>
9
+ <body>
10
+ <div style="width:100%;text-align:center">
11
+ <div style="display:inline-block">
12
+ <l-gauge id="sensor1" type="Gauge" label="Sensor One" value="50"></l-gauge>
13
+ </div>
14
+
15
+ <div style="display:inline-block">
16
+ <l-gauge id="sensor2" type="Gauge" label="Sensor Two" value="50"></l-gauge>
17
+ </div>
18
+ </div>
19
+
20
+ <script id="lightview">
21
+ (document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
22
+ const {remote} = await import("../../../types.js");
23
+ self.variables({sensor1: "number"}, {
24
+ remote: remote({
25
+ ttl: 5000,
26
+ path: "https://lightview.dev/sensors/sensor1"
27
+ })
28
+ });
29
+ self.variables({sensor2: "number"}, {
30
+ remote: remote({
31
+ ttl: 7500,
32
+ path: "https://lightview.dev/sensors/sensor2"
33
+ })
34
+ });
35
+ await sensor1;
36
+ await sensor2;
37
+ addEventListener("change", ({variableName, value}) => {
38
+ const sensor = document.body.getElementById(variableName);
39
+ sensor.setValue(value);
40
+ });
41
+ }
42
+ </script>
43
+ </body>
44
+ </html>
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <title>Form</title>
6
+ <template id="myform">
7
+ ${formname}: <form>
8
+ <input type="text" value="${name}">
9
+ </form>
10
+ <script id="lightview">
11
+ (document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
12
+ self.variables({
13
+ name: "string"
14
+ }, {
15
+ shared,
16
+ reactive
17
+ });
18
+
19
+ self.variables({
20
+ formname: "string"
21
+ }, {
22
+ imported
23
+ });
24
+ }
25
+ </script>
26
+ </template>
27
+ <script src="https://000686818.codepen.website/lightview.js"></script>
28
+ <script>
29
+ Lightview.createComponent("x-form", document.getElementById("myform"))
30
+ </script>
31
+ </head>
32
+
33
+ <body>
34
+ <div style="margin:20px">
35
+ <p>Changing one field will change the other. Try it.</p>
36
+ <x-form formname="Form1"></x-form>
37
+ <x-form formname="Form2"></x-form>
38
+ </div>
39
+ </body>
40
+
41
+ </html>
@@ -18,7 +18,7 @@
18
18
  };
19
19
  </script>
20
20
  </template>
21
- <script src="../lightview.js"></script>
21
+ <script src="../../lightview.js"></script>
22
22
  <script>
23
23
  Lightview.createComponent("x-hello", document.getElementById("local-component"));
24
24
  </script>
@@ -1,8 +1,8 @@
1
1
  <!DOCTYPE html>
2
2
  <head>
3
3
  <title>Chart</title>
4
- <link href="../components/timeline.html" rel="module">
5
- <script src="../lightview.js"></script>
4
+ <link href="../components/timeline-repl.html" rel="module">
5
+ <script src="../../lightview.js"></script>
6
6
  </head>
7
7
  <body>
8
8
  <l-timeline id="myPieChart" style="max-width:750px" type="PieChart" title="How Much Pizza I Ate Last Night">
@@ -0,0 +1,40 @@
1
+ <html>
2
+ <body>
3
+ <script src="./javascript/lightview.js?as=x-body"></script>
4
+ <input name="New Todo" value="${newItem}" placeholder="new todo item...">
5
+ <button l-on:click="${addToList}">Add ToDo</button>
6
+ <div l-for="${todoList}">
7
+ <input value="${item.done}" type="checkbox">
8
+ <span class="${item.done ? 'checked' : ''}">${item.text}</span>
9
+ <span l-on:click="({self}) => self.removeFromList(${index})">X</span>
10
+ <br/>
11
+ </div>
12
+ <script id="lightview">
13
+ Lightview.createInputVariables = true;
14
+ currentComponent.mount = function() {
15
+ this.variables(
16
+ {
17
+ todoList: Array
18
+ },
19
+ {
20
+ reactive,
21
+ set: [
22
+ {text: 'Write my first post', done: true},
23
+ {text: 'Upload the post to the blog', done: false}
24
+ ]
25
+ }
26
+ );
27
+ this.addToList = () => {
28
+ todoList = [...todoList, {text: newItem, done: false}];
29
+ newItem = '';
30
+ };
31
+ this.removeFromList = (index) => {
32
+ todoList.splice(index, 1);
33
+ };
34
+ }
35
+ </script>
36
+ <style>
37
+ .checked { text-decoration: line-through; }
38
+ </style>
39
+ </body>
40
+ </html>
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html>
2
+ <head>
3
+ <title>Top</title>
4
+ <link href="nested.html" rel="module">
5
+ <script src="../../lightview.js?as=x-body"></script>
6
+ </head>
7
+ <body>
8
+ <l-nested></l-nested>
9
+ </body>
10
+ </html>
@@ -3,7 +3,7 @@
3
3
 
4
4
  <head>
5
5
  <title>Types</title>
6
- <script src="../lightview.js?as=x-body"></script>
6
+ <script src="../../lightview.js?as=x-body"></script>
7
7
  </head>
8
8
 
9
9
  <body>
@@ -7,29 +7,31 @@
7
7
  <p>
8
8
  Play: <input type="checkbox" value="${run}">
9
9
  </p>
10
- <script type="lightview/module">
11
- self.variables({
12
- run: "boolean"
13
- },{reactive});
14
- self.variables({
15
- name: "string"
16
- }, {
17
- imported
18
- });
19
- addEventListener("change", ({
20
- variableName,
21
- value
22
- }) => {
23
- if (variableName === "run" && value === true) {
24
- self.siblings.forEach((sibling) => {
25
- sibling.setVariableValue(variableName, false);
26
- })
27
- }
28
- })
10
+ <script id="lightview">
11
+ (document.currentComponent||(document.currentComponent=document.body)).mount = async function() {
12
+ self.variables({
13
+ run: "boolean"
14
+ }, {reactive});
15
+ self.variables({
16
+ name: "string"
17
+ }, {
18
+ imported
19
+ });
20
+ addEventListener("change", ({
21
+ variableName,
22
+ value
23
+ }) => {
24
+ if (variableName === "run" && value === true) {
25
+ self.siblings.forEach((sibling) => {
26
+ sibling.setVariableValue(variableName, false);
27
+ })
28
+ }
29
+ });
30
+ }
29
31
  </script>
30
32
  </template>
31
33
  <title>Lightview:Examples:XOR</title>
32
- <script src="../lightview.js"></script>
34
+ <script src="../../lightview.js"></script>
33
35
  <script>
34
36
  Lightview.createComponent("x-audiostream", document.getElementById("audiostream"))
35
37
  </script>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Lightview:Examples</title>
6
+ <script src="https://unpkg.com/@isomorphic-git/lightning-fs"></script>
7
+ <script src="https://unpkg.com/isomorphic-git"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
9
+ <script src="https://unpkg.com/turndown/dist/turndown.js"></script>
10
+ <script>var lightviewDebug = false; </script>
11
+ <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
12
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css">
13
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
14
+ <link href="components/repl.html" rel="module">
15
+ <script src="../lightview.js"></script>
16
+ </head>
17
+ <body>
18
+ <l-repl id="repl" style="min-height:95vh" src="../examples/counter.html">
19
+ <div slot="head"></div>
20
+ <div slot="body"></div>
21
+ <div slot="css"></div>
22
+ <div slot="script"></div>
23
+ </l-repl>
24
+ </body>
25
+ </html>
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Lightview</title>
6
+ <link rel="stylesheet" href="css/highlightjs.min.css">
7
+ <script src="javascript/highlightjs.min.js"></script>
8
+ <script>hljs.highlightAll();</script>
9
+ </head>
10
+ <body style="min-width:100%;height:98vh;overflow:hidden">
11
+ <div id="tabs" style="display:flex;flex-direction:row;min-width:100%;border-bottom:1px solid;padding-bottom:5px;">
12
+ <span style="flex-grow:0.2;">
13
+ <a href="./lightview.html" target="content">Lightview</a>
14
+ </span>
15
+ <span style="flex-grow:0.4;text-align:center">
16
+ <a href="./tutorial/0-getting-started.html" target="content" as="l-tutorial-1">Tutorial</a>
17
+ <a href="./comparedto.html" target="content">Compared To</a>
18
+ <a href="./api.html" target="content">API</a>
19
+ <a href="./components/chart-repl.html" target="content">Components</a>
20
+ <a href="./websiterepl.html" target="content">REPL</a>
21
+ </span>
22
+ <span style="flex-grow:0.2;text-align:right;">
23
+ <a class="tabctrl" href="https://github.com/anywhichway/lightview" target="_other">GitHub</a>
24
+ <a class="tabctrl" href="https://www.npmjs.com/package/lightview" target="_other">NPM</a>
25
+ </span>
26
+ </div>
27
+ <iframe name="content" style="width:100%;" src="lightview.html"></iframe>
28
+ <style id="style">
29
+ a {
30
+ font-size: x-large;
31
+ color: black;
32
+ padding-left: 5px;
33
+ padding-right: 5px;
34
+ }
35
+
36
+ a:hover {
37
+ color: blue;
38
+ }
39
+ </style>
40
+ <script>
41
+ document.querySelector("iframe").style.height = (document.body.clientHeight - document.getElementById("tabs").clientHeight)+"px"
42
+ </script>
43
+ </body>
44
+ </html>
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Minified by jsDelivr using Terser v5.10.0.
3
+ * Original file: /npm/codejar@3.6.0/codejar.js
4
+ *
5
+ * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6
+ */
7
+ const globalWindow=window;export function CodeJar(t,e,n={}){const o=Object.assign({tab:"\t",indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:globalWindow},n),r=o.window,i=r.document;let s,d,l=[],a=[],c=-1,f=!1;t.setAttribute("contenteditable","plaintext-only"),t.setAttribute("spellcheck",o.spellcheck?"true":"false"),t.style.outline="none",t.style.overflowWrap="break-word",t.style.overflowY="auto",t.style.whiteSpace="pre-wrap";let u=!1;e(t),"plaintext-only"!==t.contentEditable&&(u=!0),u&&t.setAttribute("contenteditable","true");const p=L((()=>{const n=T();e(t,n),b(n)}),30);let h=!1;const g=t=>!O(t)&&!x(t)&&"Meta"!==t.key&&"Control"!==t.key&&"Alt"!==t.key&&!t.key.startsWith("Arrow"),y=L((t=>{g(t)&&(C(),h=!1)}),300),N=(e,n)=>{l.push([e,n]),t.addEventListener(e,n)};function T(){const e=K(),n={start:0,end:0,dir:void 0};let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:d}=e;if(!o||!s)throw"error1";if(o.nodeType===Node.ELEMENT_NODE){const t=i.createTextNode("");o.insertBefore(t,o.childNodes[r]),o=t,r=0}if(s.nodeType===Node.ELEMENT_NODE){const t=i.createTextNode("");s.insertBefore(t,s.childNodes[d]),s=t,d=0}return v(t,(t=>{if(t===o&&t===s)return n.start+=r,n.end+=d,n.dir=r<=d?"->":"<-","stop";if(t===o){if(n.start+=r,n.dir)return"stop";n.dir="->"}else if(t===s){if(n.end+=d,n.dir)return"stop";n.dir="<-"}t.nodeType===Node.TEXT_NODE&&("->"!=n.dir&&(n.start+=t.nodeValue.length),"<-"!=n.dir&&(n.end+=t.nodeValue.length))})),t.normalize(),n}function b(e){const n=K();let o,r,i=0,s=0;if(e.dir||(e.dir="->"),e.start<0&&(e.start=0),e.end<0&&(e.end=0),"<-"==e.dir){const{start:t,end:n}=e;e.start=n,e.end=t}let d=0;v(t,(t=>{if(t.nodeType!==Node.TEXT_NODE)return;const n=(t.nodeValue||"").length;if(d+n>e.start&&(o||(o=t,i=e.start-d),d+n>e.end))return r=t,s=e.end-d,"stop";d+=n})),o||(o=t,i=t.childNodes.length),r||(r=t,s=t.childNodes.length),"<-"==e.dir&&([o,i,r,s]=[r,s,o,i]),n.setBaseAndExtent(o,i,r,s)}function E(){const e=K().getRangeAt(0),n=i.createRange();return n.selectNodeContents(t),n.setEnd(e.startContainer,e.startOffset),n.toString()}function m(){const e=K().getRangeAt(0),n=i.createRange();return n.selectNodeContents(t),n.setStart(e.endContainer,e.endOffset),n.toString()}function k(t){if(u&&"Enter"===t.key)if(D(t),t.stopPropagation(),""==m()){M("\n ");const t=T();t.start=--t.end,b(t)}else M("\n")}function C(){if(!f)return;const e=t.innerHTML,n=T(),o=a[c];if(o&&o.html===e&&o.pos.start===n.start&&o.pos.end===n.end)return;c++,a[c]={html:e,pos:n},a.splice(c+1);c>300&&(c=300,a.splice(0,1))}function v(t,e){const n=[];t.firstChild&&n.push(t.firstChild);let o=n.pop();for(;o&&"stop"!==e(o);)o.nextSibling&&n.push(o.nextSibling),o.firstChild&&n.push(o.firstChild),o=n.pop()}function w(t){return t.metaKey||t.ctrlKey}function O(t){return w(t)&&!t.shiftKey&&"KeyZ"===t.code}function x(t){return w(t)&&t.shiftKey&&"KeyZ"===t.code}function M(t){t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),i.execCommand("insertHTML",!1,t)}function L(t,e){let n=0;return(...o)=>{clearTimeout(n),n=r.setTimeout((()=>t(...o)),e)}}function S(t){let e=t.length-1;for(;e>=0&&"\n"!==t[e];)e--;e++;let n=e;for(;n<t.length&&/[ \t]/.test(t[n]);)n++;return[t.substring(e,n)||"",e,n]}function A(){return t.textContent||""}function D(t){t.preventDefault()}function K(){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.nodeType)==Node.DOCUMENT_FRAGMENT_NODE?t.parentNode.getSelection():r.getSelection()}return N("keydown",(e=>{e.defaultPrevented||(d=A(),o.preserveIdent?function(t){if("Enter"===t.key){const e=E(),n=m();let[r]=S(e),i=r;if(o.indentOn.test(e)&&(i+=o.tab),i.length>0?(D(t),t.stopPropagation(),M("\n"+i)):k(t),i!==r&&o.moveToNewLine.test(n)){const t=T();M("\n"+r),b(t)}}}(e):k(e),o.catchTab&&function(t){if("Tab"===t.key)if(D(t),t.shiftKey){const t=E();let[e,n]=S(t);if(e.length>0){const t=T(),r=Math.min(o.tab.length,e.length);b({start:n,end:n+r}),i.execCommand("delete"),t.start-=r,t.end-=r,b(t)}}else M(o.tab)}(e),o.addClosing&&function(t){const e="([{'\"",n=")]}'\"",o=m(),r=E(),i="\\"===r.substr(r.length-1),s=o.substr(0,1);if(n.includes(t.key)&&!i&&s===t.key){const e=T();D(t),e.start=++e.end,b(e)}else if(e.includes(t.key)&&!i&&("\"'".includes(t.key)||[""," ","\n"].includes(s))){D(t);const o=T(),r=o.start==o.end?"":K().toString();M(t.key+r+n[e.indexOf(t.key)]),o.start++,o.end++,b(o)}}(e),o.history&&(!function(e){if(O(e)){D(e),c--;const n=a[c];n&&(t.innerHTML=n.html,b(n.pos)),c<0&&(c=0)}if(x(e)){D(e),c++;const n=a[c];n&&(t.innerHTML=n.html,b(n.pos)),c>=a.length&&c--}}(e),g(e)&&!h&&(C(),h=!0)),u&&b(T()))})),N("keyup",(t=>{t.defaultPrevented||t.isComposing||(d!==A()&&p(),y(t),s&&s(A()))})),N("focus",(t=>{f=!0})),N("blur",(t=>{f=!1})),N("paste",(n=>{C(),function(n){D(n);const o=(n.originalEvent||n).clipboardData.getData("text/plain").replace(/\r/g,""),r=T();M(o),e(t),b({start:Math.min(r.start,r.end)+o.length,end:Math.min(r.start,r.end)+o.length,dir:"<-"})}(n),C(),s&&s(A())})),{updateOptions(t){Object.assign(o,t)},updateCode(n){t.textContent=n,e(t)},onUpdate(t){s=t},toString:A,save:T,restore:b,recordHistory:C,destroy(){for(let[e,n]of l)t.removeEventListener(e,n)}}}
8
+ //# sourceMappingURL=/sm/96f81945d5ecf71ee083a671465d6081d317ddc1afb05de3cce12b31422fa964.map