@textbus/xnote 0.0.1-alpha.44 → 0.0.1-alpha.45
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/bundles/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.btn[vf-d94b56]{align-items:center;background:none;border:none;border-radius:4px;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:inherit;height:28px;outline:none;padding:6px 5px;transition:all .2s}.btn>span[vf-d94b56]{white-space:nowrap}.btn[vf-d94b56]:hover{background:rgba(0,0,0,.1)}.btn-arrow[vf-d94b56]{position:relative;transform:rotate(0);transform-origin:50%;width:1em}.btn.active[vf-d94b56]{background:rgba(0,0,0,.1)}.btn.active .btn-arrow[vf-d94b56]{transform:rotate(180deg)}.btn.highlight[vf-d94b56]{background-color:rgba(41,110,255,.063);color:#296eff}.component-toolbar[vf-ac7e8d]{position:relative;z-index:3}.toolbar[vf-ac7e8d]{background:#fff;border:1px solid #dee0e3;border-radius:5px;bottom:10px;box-shadow:0 4px 8px rgba(0,0,0,.08);box-sizing:border-box;display:flex;font-size:14px;height:36px;opacity:0;padding:0 6px;pointer-events:none;position:absolute;text-align:left;transform:translateY(10px)}.toolbar.active[vf-ac7e8d]{opacity:1;pointer-events:auto;transform:translateY(0);transition-duration:.2s;transition-property:all;transition-timing-function:ease}.divider[vf-ede279]{border-top:1px solid #eee;margin:6px 0}.drag-resize[vf-
|
|
1
|
+
.btn[vf-d94b56]{align-items:center;background:none;border:none;border-radius:4px;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:inherit;height:28px;outline:none;padding:6px 5px;transition:all .2s}.btn>span[vf-d94b56]{white-space:nowrap}.btn[vf-d94b56]:hover{background:rgba(0,0,0,.1)}.btn-arrow[vf-d94b56]{position:relative;transform:rotate(0);transform-origin:50%;width:1em}.btn.active[vf-d94b56]{background:rgba(0,0,0,.1)}.btn.active .btn-arrow[vf-d94b56]{transform:rotate(180deg)}.btn.highlight[vf-d94b56]{background-color:rgba(41,110,255,.063);color:#296eff}.component-toolbar[vf-ac7e8d]{position:relative;z-index:3}.toolbar[vf-ac7e8d]{background:#fff;border:1px solid #dee0e3;border-radius:5px;bottom:10px;box-shadow:0 4px 8px rgba(0,0,0,.08);box-sizing:border-box;display:flex;font-size:14px;height:36px;opacity:0;padding:0 6px;pointer-events:none;position:absolute;text-align:left;transform:translateY(10px)}.toolbar.active[vf-ac7e8d]{opacity:1;pointer-events:auto;transform:translateY(0);transition-duration:.2s;transition-property:all;transition-timing-function:ease}.divider[vf-ede279]{border-top:1px solid #eee;margin:6px 0}.drag-resize[vf-8abf2c]{position:relative;width:100%}.drag-resize .container[vf-8abf2c]{font-size:0;text-indent:0}.drag-resize .resize-tool[vf-8abf2c]{align-items:center;border:1px dashed #296eff;display:none;height:100%;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;width:100%}.drag-resize .resize-tool.active[vf-8abf2c]{display:flex}.drag-resize .mask[vf-8abf2c]{background-color:rgba(0,0,0,.8);border-radius:3px;color:#fff;font-size:14px;padding:3px 8px;pointer-events:none;position:relative;text-shadow:1px 2px 3px rgba(0,0,0,.7);user-select:none;white-space:nowrap;z-index:10}.drag-resize .btn-group[vf-8abf2c]{height:100%;left:0;position:absolute;top:0;width:100%}.drag-resize button[vf-8abf2c]{background:#fff;border:2px solid #296eff;border-radius:50%;box-sizing:border-box;cursor:pointer;font-size:0;height:14px;outline:none;padding:0;pointer-events:auto;position:absolute;width:14px}.drag-resize button[vf-8abf2c]:hover{background-color:#fff;box-shadow:0 0 0 3px rgba(18,150,219,.3)}.drag-resize button[vf-8abf2c]:first-child,.drag-resize button[vf-8abf2c]:nth-child(2),.drag-resize button[vf-8abf2c]:nth-child(3){margin-top:-5px;top:0}.drag-resize button[vf-8abf2c]:nth-child(3),.drag-resize button[vf-8abf2c]:nth-child(4),.drag-resize button[vf-8abf2c]:nth-child(5){margin-right:-5px;right:0}.drag-resize button[vf-8abf2c]:nth-child(5),.drag-resize button[vf-8abf2c]:nth-child(6),.drag-resize button[vf-8abf2c]:nth-child(7){bottom:0;margin-bottom:-5px}.drag-resize button[vf-8abf2c]:first-child,.drag-resize button[vf-8abf2c]:nth-child(7),.drag-resize button[vf-8abf2c]:nth-child(8){left:0;margin-left:-5px}.drag-resize button[vf-8abf2c]:nth-child(2),.drag-resize button[vf-8abf2c]:nth-child(6){left:50%;margin-left:-5px}.drag-resize button[vf-8abf2c]:nth-child(4),.drag-resize button[vf-8abf2c]:nth-child(8){margin-top:-5px;top:50%}.drag-resize button[vf-8abf2c]:first-child{cursor:nw-resize}.drag-resize button[vf-8abf2c]:nth-child(2){cursor:n-resize}.drag-resize button[vf-8abf2c]:nth-child(3){cursor:ne-resize}.drag-resize button[vf-8abf2c]:nth-child(4){cursor:e-resize}.drag-resize button[vf-8abf2c]:nth-child(5){cursor:se-resize}.drag-resize button[vf-8abf2c]:nth-child(6){cursor:s-resize}.drag-resize button[vf-8abf2c]:nth-child(7){cursor:sw-resize}.drag-resize button[vf-8abf2c]:nth-child(8){cursor:w-resize}.dropdown[vf-a99c5e]{display:inline-block;position:relative}.dropdown[vf-a99c5e]:hover{z-index:1}.dropdown-btn[vf-a99c5e]{display:flex;width:100%}.dropdown-btn-inner[vf-a99c5e]{flex:1}.dropdown-menu[vf-8a05e9]{background:#fff;border:1px solid #ddd;border-radius:5px;box-shadow:2px 3px 5px rgba(0,0,0,.1);box-sizing:content-box;height:0;left:-10px;max-height:400px;opacity:0;overflow-y:auto;position:absolute;top:100%;transition-duration:0s;transition:transform .3s,opacity .3s;user-select:none;width:200px;z-index:10}.dropdown-menu[vf-8a05e9]:hover::-webkit-scrollbar-thumb{background-color:#80848f}.dropdown-menu[vf-8a05e9]::-webkit-scrollbar-thumb{border:0;border-radius:4px;height:50px;outline:0;outline-offset:0}.dropdown-menu[vf-8a05e9]::-webkit-scrollbar-thumb:hover{background-color:#495060;height:50px}.dropdown-menu[vf-8a05e9]::-webkit-scrollbar{border-radius:3px;height:6px;width:6px}.dropdown-menu-content[vf-8a05e9]{box-sizing:content-box;padding:6px}.keymap[vf-c32a7b]{align-items:center;display:inline-flex;font-family:Microsoft YaHei Mono,Menlo,Monaco,Consolas,Courier New,monospace;font-size:.9em;margin-left:1em;opacity:.6}.keymap[vf-c32a7b] span{margin:0 2px}.menu-heading[vf-acaa5f]{font-size:14px;opacity:.5;padding:10px}.menu-item[vf-c3b9dc]{border-radius:4px;box-sizing:content-box;cursor:pointer;display:flex;font-size:14px;height:26px;justify-content:space-between;line-height:26px;padding:2px 10px;transition:background-color .2s}.menu-item-content[vf-c3b9dc]{display:flex;flex:1;justify-content:space-between}.menu-item.disabled[vf-c3b9dc]{cursor:not-allowed;opacity:.5}.menu-item[vf-c3b9dc]:hover{background:#eee}.menu-item.active[vf-c3b9dc]{background:rgba(0,0,0,.1)}.menu-icon[vf-c3b9dc]{display:inline-block;width:1.8em}.menu-check[vf-c3b9dc]{display:none}.menu-check.checked[vf-c3b9dc]{color:#296eff;display:block}.popup[vf-a23c47]{background:#fff;border:1px solid #ddd;border-radius:5px;box-shadow:2px 3px 5px rgba(0,0,0,.1);overflow:hidden;position:absolute}.toolbar-item[vf-216815]{padding:3px}.heading-icon[vf-2a8a65]{font-size:1.2em;font-weight:700}.heading-icon sub[vf-2a8a65]{font-weight:400}.xnote-source-code.atom-one-dark pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.atom-one-dark code.hljs{padding:3px 5px}.xnote-source-code.atom-one-dark .hljs{background:#282c34;color:#abb2bf}.xnote-source-code.atom-one-dark .hljs-comment,.xnote-source-code.atom-one-dark .hljs-quote{color:#5c6370;font-style:italic}.xnote-source-code.atom-one-dark .hljs-doctag,.xnote-source-code.atom-one-dark .hljs-formula,.xnote-source-code.atom-one-dark .hljs-keyword{color:#c678dd}.xnote-source-code.atom-one-dark .hljs-deletion,.xnote-source-code.atom-one-dark .hljs-name,.xnote-source-code.atom-one-dark .hljs-section,.xnote-source-code.atom-one-dark .hljs-selector-tag,.xnote-source-code.atom-one-dark .hljs-subst{color:#e06c75}.xnote-source-code.atom-one-dark .hljs-literal{color:#56b6c2}.xnote-source-code.atom-one-dark .hljs-addition,.xnote-source-code.atom-one-dark .hljs-attribute,.xnote-source-code.atom-one-dark .hljs-meta .hljs-string,.xnote-source-code.atom-one-dark .hljs-regexp,.xnote-source-code.atom-one-dark .hljs-string{color:#98c379}.xnote-source-code.atom-one-dark .hljs-attr,.xnote-source-code.atom-one-dark .hljs-number,.xnote-source-code.atom-one-dark .hljs-selector-attr,.xnote-source-code.atom-one-dark .hljs-selector-class,.xnote-source-code.atom-one-dark .hljs-selector-pseudo,.xnote-source-code.atom-one-dark .hljs-template-variable,.xnote-source-code.atom-one-dark .hljs-type,.xnote-source-code.atom-one-dark .hljs-variable{color:#d19a66}.xnote-source-code.atom-one-dark .hljs-bullet,.xnote-source-code.atom-one-dark .hljs-link,.xnote-source-code.atom-one-dark .hljs-meta,.xnote-source-code.atom-one-dark .hljs-selector-id,.xnote-source-code.atom-one-dark .hljs-symbol,.xnote-source-code.atom-one-dark .hljs-title{color:#61aeee}.xnote-source-code.atom-one-dark .hljs-built_in,.xnote-source-code.atom-one-dark .hljs-class .hljs-title,.xnote-source-code.atom-one-dark .hljs-title.class_{color:#e6c07b}.xnote-source-code.atom-one-dark .hljs-emphasis{font-style:italic}.xnote-source-code.atom-one-dark .hljs-strong{font-weight:700}.xnote-source-code.atom-one-dark .hljs-link{text-decoration:underline}.xnote-source-code.foundation pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.foundation code.hljs{padding:3px 5px}.xnote-source-code.foundation .hljs{background:#eee;color:#000}.xnote-source-code.foundation .hljs-addition,.xnote-source-code.foundation .hljs-attribute,.xnote-source-code.foundation .hljs-emphasis,.xnote-source-code.foundation .hljs-link{color:#070}.xnote-source-code.foundation .hljs-emphasis{font-style:italic}.xnote-source-code.foundation .hljs-deletion,.xnote-source-code.foundation .hljs-string,.xnote-source-code.foundation .hljs-strong{color:#d14}.xnote-source-code.foundation .hljs-strong{font-weight:700}.xnote-source-code.foundation .hljs-comment,.xnote-source-code.foundation .hljs-quote{color:#998;font-style:italic}.xnote-source-code.foundation .hljs-section,.xnote-source-code.foundation .hljs-title{color:#900}.xnote-source-code.foundation .hljs-class .hljs-title,.xnote-source-code.foundation .hljs-title.class_,.xnote-source-code.foundation .hljs-type{color:#458}.xnote-source-code.foundation .hljs-template-variable,.xnote-source-code.foundation .hljs-variable{color:#369}.xnote-source-code.foundation .hljs-bullet{color:#970}.xnote-source-code.foundation .hljs-meta{color:#34b}.xnote-source-code.foundation .hljs-code,.xnote-source-code.foundation .hljs-keyword,.xnote-source-code.foundation .hljs-literal,.xnote-source-code.foundation .hljs-number,.xnote-source-code.foundation .hljs-selector-tag{color:#099}.xnote-source-code.foundation .hljs-regexp{background-color:#fff0ff;color:#808}.xnote-source-code.foundation .hljs-symbol{color:#990073}.xnote-source-code.foundation .hljs-name,.xnote-source-code.foundation .hljs-selector-class,.xnote-source-code.foundation .hljs-selector-id,.xnote-source-code.foundation .hljs-tag{color:#070}.xnote-source-code.github{
|
|
2
2
|
/*!
|
|
3
3
|
Theme: GitHub
|
|
4
4
|
Description: Light theme as seen on github.com
|
package/bundles/index.esm.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.btn[vf-d94b56]{align-items:center;background:none;border:none;border-radius:4px;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:inherit;height:28px;outline:none;padding:6px 5px;transition:all .2s}.btn>span[vf-d94b56]{white-space:nowrap}.btn[vf-d94b56]:hover{background:rgba(0,0,0,.1)}.btn-arrow[vf-d94b56]{position:relative;transform:rotate(0);transform-origin:50%;width:1em}.btn.active[vf-d94b56]{background:rgba(0,0,0,.1)}.btn.active .btn-arrow[vf-d94b56]{transform:rotate(180deg)}.btn.highlight[vf-d94b56]{background-color:rgba(41,110,255,.063);color:#296eff}.component-toolbar[vf-ac7e8d]{position:relative;z-index:3}.toolbar[vf-ac7e8d]{background:#fff;border:1px solid #dee0e3;border-radius:5px;bottom:10px;box-shadow:0 4px 8px rgba(0,0,0,.08);box-sizing:border-box;display:flex;font-size:14px;height:36px;opacity:0;padding:0 6px;pointer-events:none;position:absolute;text-align:left;transform:translateY(10px)}.toolbar.active[vf-ac7e8d]{opacity:1;pointer-events:auto;transform:translateY(0);transition-duration:.2s;transition-property:all;transition-timing-function:ease}.divider[vf-ede279]{border-top:1px solid #eee;margin:6px 0}.drag-resize[vf-
|
|
1
|
+
.btn[vf-d94b56]{align-items:center;background:none;border:none;border-radius:4px;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:inherit;height:28px;outline:none;padding:6px 5px;transition:all .2s}.btn>span[vf-d94b56]{white-space:nowrap}.btn[vf-d94b56]:hover{background:rgba(0,0,0,.1)}.btn-arrow[vf-d94b56]{position:relative;transform:rotate(0);transform-origin:50%;width:1em}.btn.active[vf-d94b56]{background:rgba(0,0,0,.1)}.btn.active .btn-arrow[vf-d94b56]{transform:rotate(180deg)}.btn.highlight[vf-d94b56]{background-color:rgba(41,110,255,.063);color:#296eff}.component-toolbar[vf-ac7e8d]{position:relative;z-index:3}.toolbar[vf-ac7e8d]{background:#fff;border:1px solid #dee0e3;border-radius:5px;bottom:10px;box-shadow:0 4px 8px rgba(0,0,0,.08);box-sizing:border-box;display:flex;font-size:14px;height:36px;opacity:0;padding:0 6px;pointer-events:none;position:absolute;text-align:left;transform:translateY(10px)}.toolbar.active[vf-ac7e8d]{opacity:1;pointer-events:auto;transform:translateY(0);transition-duration:.2s;transition-property:all;transition-timing-function:ease}.divider[vf-ede279]{border-top:1px solid #eee;margin:6px 0}.drag-resize[vf-8abf2c]{position:relative;width:100%}.drag-resize .container[vf-8abf2c]{font-size:0;text-indent:0}.drag-resize .resize-tool[vf-8abf2c]{align-items:center;border:1px dashed #296eff;display:none;height:100%;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;width:100%}.drag-resize .resize-tool.active[vf-8abf2c]{display:flex}.drag-resize .mask[vf-8abf2c]{background-color:rgba(0,0,0,.8);border-radius:3px;color:#fff;font-size:14px;padding:3px 8px;pointer-events:none;position:relative;text-shadow:1px 2px 3px rgba(0,0,0,.7);user-select:none;white-space:nowrap;z-index:10}.drag-resize .btn-group[vf-8abf2c]{height:100%;left:0;position:absolute;top:0;width:100%}.drag-resize button[vf-8abf2c]{background:#fff;border:2px solid #296eff;border-radius:50%;box-sizing:border-box;cursor:pointer;font-size:0;height:14px;outline:none;padding:0;pointer-events:auto;position:absolute;width:14px}.drag-resize button[vf-8abf2c]:hover{background-color:#fff;box-shadow:0 0 0 3px rgba(18,150,219,.3)}.drag-resize button[vf-8abf2c]:first-child,.drag-resize button[vf-8abf2c]:nth-child(2),.drag-resize button[vf-8abf2c]:nth-child(3){margin-top:-5px;top:0}.drag-resize button[vf-8abf2c]:nth-child(3),.drag-resize button[vf-8abf2c]:nth-child(4),.drag-resize button[vf-8abf2c]:nth-child(5){margin-right:-5px;right:0}.drag-resize button[vf-8abf2c]:nth-child(5),.drag-resize button[vf-8abf2c]:nth-child(6),.drag-resize button[vf-8abf2c]:nth-child(7){bottom:0;margin-bottom:-5px}.drag-resize button[vf-8abf2c]:first-child,.drag-resize button[vf-8abf2c]:nth-child(7),.drag-resize button[vf-8abf2c]:nth-child(8){left:0;margin-left:-5px}.drag-resize button[vf-8abf2c]:nth-child(2),.drag-resize button[vf-8abf2c]:nth-child(6){left:50%;margin-left:-5px}.drag-resize button[vf-8abf2c]:nth-child(4),.drag-resize button[vf-8abf2c]:nth-child(8){margin-top:-5px;top:50%}.drag-resize button[vf-8abf2c]:first-child{cursor:nw-resize}.drag-resize button[vf-8abf2c]:nth-child(2){cursor:n-resize}.drag-resize button[vf-8abf2c]:nth-child(3){cursor:ne-resize}.drag-resize button[vf-8abf2c]:nth-child(4){cursor:e-resize}.drag-resize button[vf-8abf2c]:nth-child(5){cursor:se-resize}.drag-resize button[vf-8abf2c]:nth-child(6){cursor:s-resize}.drag-resize button[vf-8abf2c]:nth-child(7){cursor:sw-resize}.drag-resize button[vf-8abf2c]:nth-child(8){cursor:w-resize}.dropdown[vf-a99c5e]{display:inline-block;position:relative}.dropdown[vf-a99c5e]:hover{z-index:1}.dropdown-btn[vf-a99c5e]{display:flex;width:100%}.dropdown-btn-inner[vf-a99c5e]{flex:1}.dropdown-menu[vf-8a05e9]{background:#fff;border:1px solid #ddd;border-radius:5px;box-shadow:2px 3px 5px rgba(0,0,0,.1);box-sizing:content-box;height:0;left:-10px;max-height:400px;opacity:0;overflow-y:auto;position:absolute;top:100%;transition-duration:0s;transition:transform .3s,opacity .3s;user-select:none;width:200px;z-index:10}.dropdown-menu[vf-8a05e9]:hover::-webkit-scrollbar-thumb{background-color:#80848f}.dropdown-menu[vf-8a05e9]::-webkit-scrollbar-thumb{border:0;border-radius:4px;height:50px;outline:0;outline-offset:0}.dropdown-menu[vf-8a05e9]::-webkit-scrollbar-thumb:hover{background-color:#495060;height:50px}.dropdown-menu[vf-8a05e9]::-webkit-scrollbar{border-radius:3px;height:6px;width:6px}.dropdown-menu-content[vf-8a05e9]{box-sizing:content-box;padding:6px}.keymap[vf-c32a7b]{align-items:center;display:inline-flex;font-family:Microsoft YaHei Mono,Menlo,Monaco,Consolas,Courier New,monospace;font-size:.9em;margin-left:1em;opacity:.6}.keymap[vf-c32a7b] span{margin:0 2px}.menu-heading[vf-acaa5f]{font-size:14px;opacity:.5;padding:10px}.menu-item[vf-c3b9dc]{border-radius:4px;box-sizing:content-box;cursor:pointer;display:flex;font-size:14px;height:26px;justify-content:space-between;line-height:26px;padding:2px 10px;transition:background-color .2s}.menu-item-content[vf-c3b9dc]{display:flex;flex:1;justify-content:space-between}.menu-item.disabled[vf-c3b9dc]{cursor:not-allowed;opacity:.5}.menu-item[vf-c3b9dc]:hover{background:#eee}.menu-item.active[vf-c3b9dc]{background:rgba(0,0,0,.1)}.menu-icon[vf-c3b9dc]{display:inline-block;width:1.8em}.menu-check[vf-c3b9dc]{display:none}.menu-check.checked[vf-c3b9dc]{color:#296eff;display:block}.popup[vf-a23c47]{background:#fff;border:1px solid #ddd;border-radius:5px;box-shadow:2px 3px 5px rgba(0,0,0,.1);overflow:hidden;position:absolute}.toolbar-item[vf-216815]{padding:3px}.heading-icon[vf-2a8a65]{font-size:1.2em;font-weight:700}.heading-icon sub[vf-2a8a65]{font-weight:400}.xnote-source-code.atom-one-dark pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.atom-one-dark code.hljs{padding:3px 5px}.xnote-source-code.atom-one-dark .hljs{background:#282c34;color:#abb2bf}.xnote-source-code.atom-one-dark .hljs-comment,.xnote-source-code.atom-one-dark .hljs-quote{color:#5c6370;font-style:italic}.xnote-source-code.atom-one-dark .hljs-doctag,.xnote-source-code.atom-one-dark .hljs-formula,.xnote-source-code.atom-one-dark .hljs-keyword{color:#c678dd}.xnote-source-code.atom-one-dark .hljs-deletion,.xnote-source-code.atom-one-dark .hljs-name,.xnote-source-code.atom-one-dark .hljs-section,.xnote-source-code.atom-one-dark .hljs-selector-tag,.xnote-source-code.atom-one-dark .hljs-subst{color:#e06c75}.xnote-source-code.atom-one-dark .hljs-literal{color:#56b6c2}.xnote-source-code.atom-one-dark .hljs-addition,.xnote-source-code.atom-one-dark .hljs-attribute,.xnote-source-code.atom-one-dark .hljs-meta .hljs-string,.xnote-source-code.atom-one-dark .hljs-regexp,.xnote-source-code.atom-one-dark .hljs-string{color:#98c379}.xnote-source-code.atom-one-dark .hljs-attr,.xnote-source-code.atom-one-dark .hljs-number,.xnote-source-code.atom-one-dark .hljs-selector-attr,.xnote-source-code.atom-one-dark .hljs-selector-class,.xnote-source-code.atom-one-dark .hljs-selector-pseudo,.xnote-source-code.atom-one-dark .hljs-template-variable,.xnote-source-code.atom-one-dark .hljs-type,.xnote-source-code.atom-one-dark .hljs-variable{color:#d19a66}.xnote-source-code.atom-one-dark .hljs-bullet,.xnote-source-code.atom-one-dark .hljs-link,.xnote-source-code.atom-one-dark .hljs-meta,.xnote-source-code.atom-one-dark .hljs-selector-id,.xnote-source-code.atom-one-dark .hljs-symbol,.xnote-source-code.atom-one-dark .hljs-title{color:#61aeee}.xnote-source-code.atom-one-dark .hljs-built_in,.xnote-source-code.atom-one-dark .hljs-class .hljs-title,.xnote-source-code.atom-one-dark .hljs-title.class_{color:#e6c07b}.xnote-source-code.atom-one-dark .hljs-emphasis{font-style:italic}.xnote-source-code.atom-one-dark .hljs-strong{font-weight:700}.xnote-source-code.atom-one-dark .hljs-link{text-decoration:underline}.xnote-source-code.foundation pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.foundation code.hljs{padding:3px 5px}.xnote-source-code.foundation .hljs{background:#eee;color:#000}.xnote-source-code.foundation .hljs-addition,.xnote-source-code.foundation .hljs-attribute,.xnote-source-code.foundation .hljs-emphasis,.xnote-source-code.foundation .hljs-link{color:#070}.xnote-source-code.foundation .hljs-emphasis{font-style:italic}.xnote-source-code.foundation .hljs-deletion,.xnote-source-code.foundation .hljs-string,.xnote-source-code.foundation .hljs-strong{color:#d14}.xnote-source-code.foundation .hljs-strong{font-weight:700}.xnote-source-code.foundation .hljs-comment,.xnote-source-code.foundation .hljs-quote{color:#998;font-style:italic}.xnote-source-code.foundation .hljs-section,.xnote-source-code.foundation .hljs-title{color:#900}.xnote-source-code.foundation .hljs-class .hljs-title,.xnote-source-code.foundation .hljs-title.class_,.xnote-source-code.foundation .hljs-type{color:#458}.xnote-source-code.foundation .hljs-template-variable,.xnote-source-code.foundation .hljs-variable{color:#369}.xnote-source-code.foundation .hljs-bullet{color:#970}.xnote-source-code.foundation .hljs-meta{color:#34b}.xnote-source-code.foundation .hljs-code,.xnote-source-code.foundation .hljs-keyword,.xnote-source-code.foundation .hljs-literal,.xnote-source-code.foundation .hljs-number,.xnote-source-code.foundation .hljs-selector-tag{color:#099}.xnote-source-code.foundation .hljs-regexp{background-color:#fff0ff;color:#808}.xnote-source-code.foundation .hljs-symbol{color:#990073}.xnote-source-code.foundation .hljs-name,.xnote-source-code.foundation .hljs-selector-class,.xnote-source-code.foundation .hljs-selector-id,.xnote-source-code.foundation .hljs-tag{color:#070}.xnote-source-code.github{
|
|
2
2
|
/*!
|
|
3
3
|
Theme: GitHub
|
|
4
4
|
Description: Light theme as seen on github.com
|
package/bundles/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from '@viewfly/core/jsx-runtime';
|
|
2
2
|
import { withScopedCSS } from '@viewfly/scoped-css';
|
|
3
|
-
import { Injectable, InjectFlags, Injector, inject, createSignal, onUnmounted, createRef, withAnnotation, onUpdated, onMounted, InjectionToken,
|
|
4
|
-
import { Subject, Selection, fromEvent, Subscription, Attribute, Keyboard, Commander, Controller, useContext, onBreak, onContentInsert, ContentType,
|
|
3
|
+
import { Injectable, InjectFlags, Injector, inject, createSignal, onUnmounted, createRef, withAnnotation, onUpdated, onMounted, InjectionToken, ReflectiveInjector, createDynamicRef, jsx as jsx$1, viewfly, getCurrentInstance, watch } from '@viewfly/core';
|
|
4
|
+
import { Subject, Selection, fromEvent, Subscription, Attribute, Keyboard, Commander, Controller, useContext, onBreak, onContentInsert, ContentType, Slot, Component, Registry, Query, QueryStateType, createVNode, BehaviorSubject, onSlotApplyFormat, onSlotSetAttribute, onPaste, onFocus, onBlur, useDynamicShortcut, VTextNode, onFocusIn, onFocusOut, onDestroy, onGetRanges, Formatter, onParentSlotUpdated, Textbus, RootComponentRef, filter, map, distinctUntilChanged, sampleTime, merge, debounceTime, throttleTime, delay, onContentInserted, onContentDeleted, switchMap, fromPromise, onCompositionStart } from '@textbus/core';
|
|
5
5
|
import { VIEW_CONTAINER, isMac, DomAdapter, Input, SelectionBridge, BrowserModule, VIEW_DOCUMENT, CollaborateSelectionAwarenessDelegate, isMobileBrowser, Parser } from '@textbus/platform-browser';
|
|
6
6
|
import { createPortal, createApp, DomRenderer, HTMLRenderer, OutputTranslator } from '@viewfly/platform-browser';
|
|
7
7
|
import { useProduce } from '@viewfly/hooks';
|
|
@@ -30,18 +30,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
30
30
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
function __rest(s, e) {
|
|
34
|
-
var t = {};
|
|
35
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
36
|
-
t[p] = s[p];
|
|
37
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
39
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
40
|
-
t[p[i]] = s[p[i]];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
33
|
function __decorate(decorators, target, key, desc) {
|
|
46
34
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
47
35
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -177,7 +165,7 @@ function Divider() {
|
|
|
177
165
|
});
|
|
178
166
|
}
|
|
179
167
|
|
|
180
|
-
var scopedId$k = "vf-
|
|
168
|
+
var scopedId$k = "vf-8abf2c";
|
|
181
169
|
|
|
182
170
|
function DragResize(props) {
|
|
183
171
|
const isShow = createSignal(false);
|
|
@@ -198,7 +186,7 @@ function DragResize(props) {
|
|
|
198
186
|
isShow.set(true);
|
|
199
187
|
const width = ref.current.offsetWidth;
|
|
200
188
|
const height = ref.current.offsetHeight;
|
|
201
|
-
|
|
189
|
+
sizeText.set(`${Math.round(width)}px * ${Math.round(height)}px`);
|
|
202
190
|
});
|
|
203
191
|
function selectComponent() {
|
|
204
192
|
selection.selectComponent(component, true);
|
|
@@ -275,7 +263,7 @@ function DragResize(props) {
|
|
|
275
263
|
}
|
|
276
264
|
ele.style.width = endWidth + 'px';
|
|
277
265
|
ele.style.height = endHeight + 'px';
|
|
278
|
-
|
|
266
|
+
sizeText.set(`${Math.round(endWidth)}px * ${Math.round(endHeight)}px`);
|
|
279
267
|
});
|
|
280
268
|
const unUp = fromEvent(document, 'mouseup').subscribe(() => {
|
|
281
269
|
component.state.width = endWidth + 'px';
|
|
@@ -285,10 +273,11 @@ function DragResize(props) {
|
|
|
285
273
|
unUp.unsubscribe();
|
|
286
274
|
});
|
|
287
275
|
}
|
|
276
|
+
const sizeText = createSignal(`${component.state.width}*${component.state.height}`);
|
|
288
277
|
return withScopedCSS(scopedId$k, () => {
|
|
289
278
|
return (jsxs("div", { class: "drag-resize", onClick: selectComponent, children: [jsx("div", { class: "container", ref: ref, children: props.children }), jsxs("div", { class: ['resize-tool', {
|
|
290
279
|
active: isShow()
|
|
291
|
-
}], children: [
|
|
280
|
+
}], children: [jsx("div", { class: "mask", ref: mask, children: sizeText() }), jsxs("div", { class: "btn-group", ref: btnGroup, onMousedown: drag, children: [jsx("button", { type: "button" }), jsx("button", { type: "button" }), jsx("button", { type: "button" }), jsx("button", { type: "button" }), jsx("button", { type: "button" }), jsx("button", { type: "button" }), jsx("button", { type: "button" }), jsx("button", { type: "button" })] })] })] }));
|
|
292
281
|
});
|
|
293
282
|
}
|
|
294
283
|
|
|
@@ -712,23 +701,6 @@ function useBlockContent(slot) {
|
|
|
712
701
|
});
|
|
713
702
|
}
|
|
714
703
|
|
|
715
|
-
function SlotRender(props) {
|
|
716
|
-
const adaper = inject(DomAdapter);
|
|
717
|
-
const instance = getCurrentInstance();
|
|
718
|
-
const sub = props.slot.__changeMarker__.onChange.subscribe(() => {
|
|
719
|
-
instance.markAsDirtied();
|
|
720
|
-
});
|
|
721
|
-
onUnmounted(() => {
|
|
722
|
-
sub.unsubscribe();
|
|
723
|
-
});
|
|
724
|
-
return () => {
|
|
725
|
-
const { slot, tag = 'div', renderEnv = false, elRef, elKey } = props, rest = __rest(props, ["slot", "tag", "renderEnv", "elRef", "elKey"]);
|
|
726
|
-
return adaper.slotRender(slot, children => {
|
|
727
|
-
return createVNode(tag, Object.assign({ ref: elRef, key: elKey }, rest), children);
|
|
728
|
-
}, renderEnv);
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
|
|
732
704
|
class BlockquoteComponent extends Component {
|
|
733
705
|
static fromJSON(textbus, json) {
|
|
734
706
|
const slot = textbus.get(Registry).createSlot(json.slot);
|
|
@@ -822,11 +794,14 @@ function registerBlockquoteShortcut(textbus) {
|
|
|
822
794
|
});
|
|
823
795
|
}
|
|
824
796
|
function BlockquoteView(props) {
|
|
797
|
+
const adapter = inject(DomAdapter);
|
|
825
798
|
const readonly = useReadonly();
|
|
826
799
|
const output = useOutput();
|
|
827
800
|
return () => {
|
|
828
801
|
const slot = props.component.state.slot;
|
|
829
|
-
return (jsx("blockquote", { class: "xnote-blockquote", ref: props.rootRef, "data-component": props.component.name, children:
|
|
802
|
+
return (jsx("blockquote", { class: "xnote-blockquote", ref: props.rootRef, "data-component": props.component.name, children: adapter.slotRender(slot, children => {
|
|
803
|
+
return createVNode('div', null, children);
|
|
804
|
+
}, readonly() || output()) }));
|
|
830
805
|
};
|
|
831
806
|
}
|
|
832
807
|
const blockquoteComponentLoader = {
|
|
@@ -874,6 +849,7 @@ HighlightBoxComponent.defaultTypes = ['❤️', '💡', '📌', '✅', '❎', '
|
|
|
874
849
|
HighlightBoxComponent.componentName = 'HighlightBoxComponent';
|
|
875
850
|
HighlightBoxComponent.type = ContentType.BlockComponent;
|
|
876
851
|
function HighlightBoxView(props) {
|
|
852
|
+
const adapter = inject(DomAdapter);
|
|
877
853
|
const readonly = useReadonly();
|
|
878
854
|
const output = useOutput();
|
|
879
855
|
const emoji = [];
|
|
@@ -889,14 +865,22 @@ function HighlightBoxView(props) {
|
|
|
889
865
|
return () => {
|
|
890
866
|
const { state, name } = props.component;
|
|
891
867
|
if (readonly() || output()) {
|
|
892
|
-
return (jsxs("div", { "data-component": name, ref: props.rootRef, "data-icon": state.type, class: "xnote-highlight-box", children: [jsx("div", { class: "xnote-highlight-box-left", children: jsx("div", { class: "xnote-highlight-box-icon", children: jsx("button", { type: "button", children: state.type || '❤️' }) }) }),
|
|
868
|
+
return (jsxs("div", { "data-component": name, ref: props.rootRef, "data-icon": state.type, class: "xnote-highlight-box", children: [jsx("div", { class: "xnote-highlight-box-left", children: jsx("div", { class: "xnote-highlight-box-icon", children: jsx("button", { type: "button", children: state.type || '❤️' }) }) }), adapter.slotRender(state.slot, children => {
|
|
869
|
+
return createVNode('div', {
|
|
870
|
+
class: 'xnote-highlight-box-content'
|
|
871
|
+
}, children);
|
|
872
|
+
}, readonly() || output())] }));
|
|
893
873
|
}
|
|
894
874
|
return (jsxs("div", { "data-component": name, ref: props.rootRef, "data-icon": state.type, class: "xnote-highlight-box", children: [jsx("div", { class: "xnote-highlight-box-left", children: jsx(Dropdown, { trigger: "click", ref: dropdownRef, width: "282px", menu: jsxs("div", { class: "xnote-highlight-box-icons", children: [jsx("div", { class: "xnote-highlight-box-heading", children: "\u5E38\u7528" }), HighlightBoxComponent.defaultTypes.map(icon => {
|
|
895
875
|
return (jsx("button", { onClick: () => setType(icon), type: "button", children: icon }));
|
|
896
876
|
}), jsx("div", { class: "xnote-highlight-box-heading", children: "\u66F4\u591A" }), emoji.map(i => {
|
|
897
877
|
const icon = String.fromCodePoint(i);
|
|
898
878
|
return (jsx("button", { onClick: () => setType(icon), type: "button", children: icon }));
|
|
899
|
-
})] }), children: jsx("div", { class: "xnote-highlight-box-icon", children: jsx("button", { type: "button", children: state.type || '❤️' }) }) }) }),
|
|
879
|
+
})] }), children: jsx("div", { class: "xnote-highlight-box-icon", children: jsx("button", { type: "button", children: state.type || '❤️' }) }) }) }), adapter.slotRender(state.slot, children => {
|
|
880
|
+
return createVNode('div', {
|
|
881
|
+
class: 'xnote-highlight-box-content'
|
|
882
|
+
}, children);
|
|
883
|
+
}, readonly() || output())] }));
|
|
900
884
|
};
|
|
901
885
|
}
|
|
902
886
|
const highlightBoxComponentLoader = {
|
|
@@ -964,11 +948,14 @@ class ParagraphComponent extends Component {
|
|
|
964
948
|
ParagraphComponent.componentName = 'ParagraphComponent';
|
|
965
949
|
ParagraphComponent.type = ContentType.BlockComponent;
|
|
966
950
|
function ParagraphView(props) {
|
|
951
|
+
const adapter = inject(DomAdapter);
|
|
967
952
|
const readonly = useReadonly();
|
|
968
953
|
const output = useOutput();
|
|
969
954
|
return () => {
|
|
970
955
|
const slot = props.component.state.slot;
|
|
971
|
-
return (jsx("div", { class: "xnote-paragraph", ref: props.rootRef, "data-component": ParagraphComponent.componentName, children:
|
|
956
|
+
return (jsx("div", { class: "xnote-paragraph", ref: props.rootRef, "data-component": ParagraphComponent.componentName, children: adapter.slotRender(slot, children => {
|
|
957
|
+
return (createVNode('div', null, children));
|
|
958
|
+
}, readonly() || output()) }));
|
|
972
959
|
};
|
|
973
960
|
}
|
|
974
961
|
const paragraphComponentLoader = {
|
|
@@ -2137,6 +2124,7 @@ TodolistComponent.zenCoding = {
|
|
|
2137
2124
|
}
|
|
2138
2125
|
};
|
|
2139
2126
|
function TodolistView(props) {
|
|
2127
|
+
const adapter = inject(DomAdapter);
|
|
2140
2128
|
const component = props.component;
|
|
2141
2129
|
const state = component.state;
|
|
2142
2130
|
function toggle() {
|
|
@@ -2165,7 +2153,11 @@ function TodolistView(props) {
|
|
|
2165
2153
|
marginLeft: indent * 24 + 'px',
|
|
2166
2154
|
justifyContent: align[component.state.slot.getAttribute(textAlignAttr)],
|
|
2167
2155
|
textAlign: component.state.slot.getAttribute(textAlignAttr) === 'justify' ? 'justify' : void 0
|
|
2168
|
-
}, children: [jsx("div", { class: "xnote-todolist-icon", onClick: toggle, children: jsx("span", { "data-checked": checked, class: [checked ? 'xnote-icon-checkbox-checked' : 'xnote-icon-checkbox-unchecked'] }) }),
|
|
2156
|
+
}, children: [jsx("div", { class: "xnote-todolist-icon", onClick: toggle, children: jsx("span", { "data-checked": checked, class: [checked ? 'xnote-icon-checkbox-checked' : 'xnote-icon-checkbox-unchecked'] }) }), adapter.slotRender(slot, children => {
|
|
2157
|
+
return createVNode('div', {
|
|
2158
|
+
class: 'xnote-todolist-content'
|
|
2159
|
+
}, children);
|
|
2160
|
+
}, readonly() || output())] }));
|
|
2169
2161
|
};
|
|
2170
2162
|
}
|
|
2171
2163
|
const todolistComponentLoader = {
|
|
@@ -2365,6 +2357,7 @@ function numberToLetter(num) {
|
|
|
2365
2357
|
}).join('');
|
|
2366
2358
|
}
|
|
2367
2359
|
function ListComponentView(props) {
|
|
2360
|
+
const adapter = inject(DomAdapter);
|
|
2368
2361
|
const component = props.component;
|
|
2369
2362
|
function reorder(is) {
|
|
2370
2363
|
component.state.reorder = is;
|
|
@@ -2438,7 +2431,11 @@ function ListComponentView(props) {
|
|
|
2438
2431
|
}, children: [jsx("div", { class: "xnote-list-type", children: (component.state.type === 'UnorderedList' || readonly() || output()) ?
|
|
2439
2432
|
jsx("span", { class: "xnote-order-btn", children: icon })
|
|
2440
2433
|
:
|
|
2441
|
-
jsx(Dropdown, { menu: jsxs(Fragment, { children: [jsx(MenuItem, { onClick: () => reorder(false), children: "\u7EE7\u7EED\u7F16\u53F7" }), jsx(MenuItem, { onClick: () => reorder(true), children: "\u91CD\u65B0\u7F16\u53F7" })] }), children: jsx(Button, { style: { color: 'inherit' }, children: icon }) }) }),
|
|
2434
|
+
jsx(Dropdown, { menu: jsxs(Fragment, { children: [jsx(MenuItem, { onClick: () => reorder(false), children: "\u7EE7\u7EED\u7F16\u53F7" }), jsx(MenuItem, { onClick: () => reorder(true), children: "\u91CD\u65B0\u7F16\u53F7" })] }), children: jsx(Button, { style: { color: 'inherit' }, children: icon }) }) }), adapter.slotRender(component.state.slot, children => {
|
|
2435
|
+
return createVNode('div', {
|
|
2436
|
+
class: 'xnote-list-content'
|
|
2437
|
+
}, children);
|
|
2438
|
+
}, readonly() || output())] }) }));
|
|
2442
2439
|
};
|
|
2443
2440
|
}
|
|
2444
2441
|
const listComponentLoader = {
|
|
@@ -4516,7 +4513,7 @@ class AtComponent extends Component {
|
|
|
4516
4513
|
const registry = textbus.get(Registry);
|
|
4517
4514
|
if (slotState) {
|
|
4518
4515
|
const slot = registry.createSlot(slotState);
|
|
4519
|
-
return new AtComponent({
|
|
4516
|
+
return new AtComponent(textbus, {
|
|
4520
4517
|
slot
|
|
4521
4518
|
});
|
|
4522
4519
|
}
|
|
@@ -4622,6 +4619,7 @@ AtComponent.componentName = 'AtComponent';
|
|
|
4622
4619
|
AtComponent.type = ContentType.InlineComponent;
|
|
4623
4620
|
|
|
4624
4621
|
function AtComponentView(props) {
|
|
4622
|
+
const adapter = inject(DomAdapter);
|
|
4625
4623
|
const selection = inject(Selection);
|
|
4626
4624
|
const dropdownRef = createRef();
|
|
4627
4625
|
const subscription = props.component.focus.subscribe((b) => {
|
|
@@ -4662,7 +4660,11 @@ function AtComponentView(props) {
|
|
|
4662
4660
|
return (jsxs("div", { class: "xnote-at xnote-at-complete", "data-info": encodeURIComponent(JSON.stringify(userInfo)), ref: props.rootRef, "data-component": props.component.name, children: [jsx("span", { children: "@" }), userInfo.name] }));
|
|
4663
4661
|
}
|
|
4664
4662
|
if (readonly() || output()) {
|
|
4665
|
-
return (jsxs("div", { class: "xnote-at", ref: props.rootRef, "data-component": props.component.name, children: [jsx("span", { children: "@" }), slot &&
|
|
4663
|
+
return (jsxs("div", { class: "xnote-at", ref: props.rootRef, "data-component": props.component.name, children: [jsx("span", { children: "@" }), slot && adapter.slotRender(slot, children => {
|
|
4664
|
+
return createVNode('span', {
|
|
4665
|
+
class: 'xnote-at-input'
|
|
4666
|
+
}, children);
|
|
4667
|
+
})] }));
|
|
4666
4668
|
}
|
|
4667
4669
|
const members = props.component.members();
|
|
4668
4670
|
return (jsx("div", { class: "xnote-at", ref: props.rootRef, "data-component": props.component.name, children: jsxs(Dropdown, { trigger: 'none', ref: dropdownRef, menu: jsx("div", { class: "xnote-at-menu", ref: membersRef, children: members.map((member, index) => {
|
|
@@ -4678,7 +4680,11 @@ function AtComponentView(props) {
|
|
|
4678
4680
|
selection.selectComponentEnd(props.component);
|
|
4679
4681
|
}, class: ['xnote-at-member', { selected: index === selectedIndex }], children: [jsx("div", { class: "xnote-at-member-avatar", children: member.avatar ? jsx("img", { src: member.avatar, alt: member.name }) :
|
|
4680
4682
|
jsx("span", { class: "xnote-at-member-avatar-bg", style: { background: member.color, color }, children: member.name }) }), jsxs("div", { class: "xnote-at-member-info", children: [jsx("div", { class: "xnote-at-member-name", children: member.name }), jsx("div", { class: "xnote-at-member-desc", children: member.groupName })] })] }, member.id));
|
|
4681
|
-
}) }), children: [jsx("span", { children: "@" }), slot &&
|
|
4683
|
+
}) }), children: [jsx("span", { children: "@" }), slot && adapter.slotRender(slot, children => {
|
|
4684
|
+
return createVNode('span', {
|
|
4685
|
+
class: 'xnote-at-input'
|
|
4686
|
+
}, children);
|
|
4687
|
+
})] }) }));
|
|
4682
4688
|
};
|
|
4683
4689
|
}
|
|
4684
4690
|
const atComponentLoader = {
|
|
@@ -4737,6 +4743,7 @@ class RootComponent extends Component {
|
|
|
4737
4743
|
RootComponent.componentName = 'RootComponent';
|
|
4738
4744
|
RootComponent.type = ContentType.BlockComponent;
|
|
4739
4745
|
function RootView(props) {
|
|
4746
|
+
const adapter = inject(DomAdapter);
|
|
4740
4747
|
const { content } = props.component.state;
|
|
4741
4748
|
const ref = createDynamicRef(node => {
|
|
4742
4749
|
const sub = props.component.onCompositionStart.subscribe(() => {
|
|
@@ -4753,7 +4760,12 @@ function RootView(props) {
|
|
|
4753
4760
|
const output = useOutput();
|
|
4754
4761
|
return () => {
|
|
4755
4762
|
const { rootRef } = props;
|
|
4756
|
-
return (jsx("div", { class: "xnote-root", dir: "auto", ref: [rootRef, ref], "data-component": props.component.name, children:
|
|
4763
|
+
return (jsx("div", { class: "xnote-root", dir: "auto", ref: [rootRef, ref], "data-component": props.component.name, children: adapter.slotRender(content, children => {
|
|
4764
|
+
return (createVNode('div', {
|
|
4765
|
+
class: 'xnote-content',
|
|
4766
|
+
'data-placeholder': content.isEmpty ? '请输入内容' : ''
|
|
4767
|
+
}, children));
|
|
4768
|
+
}, readonly() || output()) }));
|
|
4757
4769
|
};
|
|
4758
4770
|
}
|
|
4759
4771
|
const rootComponentLoader = {
|
|
@@ -5272,7 +5284,6 @@ function SelectionMask(props) {
|
|
|
5272
5284
|
});
|
|
5273
5285
|
}
|
|
5274
5286
|
|
|
5275
|
-
// import { SlotRender } from '../SlotRender'
|
|
5276
5287
|
const TableComponentView = withAnnotation({
|
|
5277
5288
|
providers: [TableService]
|
|
5278
5289
|
}, function TableComponentView(props) {
|
package/bundles/index.js
CHANGED
|
@@ -32,18 +32,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
32
32
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
function __rest(s, e) {
|
|
36
|
-
var t = {};
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
-
t[p] = s[p];
|
|
39
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
-
t[p[i]] = s[p[i]];
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
35
|
function __decorate(decorators, target, key, desc) {
|
|
48
36
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
49
37
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -179,7 +167,7 @@ function Divider() {
|
|
|
179
167
|
});
|
|
180
168
|
}
|
|
181
169
|
|
|
182
|
-
var scopedId$k = "vf-
|
|
170
|
+
var scopedId$k = "vf-8abf2c";
|
|
183
171
|
|
|
184
172
|
function DragResize(props) {
|
|
185
173
|
const isShow = core.createSignal(false);
|
|
@@ -200,7 +188,7 @@ function DragResize(props) {
|
|
|
200
188
|
isShow.set(true);
|
|
201
189
|
const width = ref.current.offsetWidth;
|
|
202
190
|
const height = ref.current.offsetHeight;
|
|
203
|
-
|
|
191
|
+
sizeText.set(`${Math.round(width)}px * ${Math.round(height)}px`);
|
|
204
192
|
});
|
|
205
193
|
function selectComponent() {
|
|
206
194
|
selection.selectComponent(component, true);
|
|
@@ -277,7 +265,7 @@ function DragResize(props) {
|
|
|
277
265
|
}
|
|
278
266
|
ele.style.width = endWidth + 'px';
|
|
279
267
|
ele.style.height = endHeight + 'px';
|
|
280
|
-
|
|
268
|
+
sizeText.set(`${Math.round(endWidth)}px * ${Math.round(endHeight)}px`);
|
|
281
269
|
});
|
|
282
270
|
const unUp = core$1.fromEvent(document, 'mouseup').subscribe(() => {
|
|
283
271
|
component.state.width = endWidth + 'px';
|
|
@@ -287,10 +275,11 @@ function DragResize(props) {
|
|
|
287
275
|
unUp.unsubscribe();
|
|
288
276
|
});
|
|
289
277
|
}
|
|
278
|
+
const sizeText = core.createSignal(`${component.state.width}*${component.state.height}`);
|
|
290
279
|
return scopedCss.withScopedCSS(scopedId$k, () => {
|
|
291
280
|
return (jsxRuntime.jsxs("div", { class: "drag-resize", onClick: selectComponent, children: [jsxRuntime.jsx("div", { class: "container", ref: ref, children: props.children }), jsxRuntime.jsxs("div", { class: ['resize-tool', {
|
|
292
281
|
active: isShow()
|
|
293
|
-
}], children: [jsxRuntime.
|
|
282
|
+
}], children: [jsxRuntime.jsx("div", { class: "mask", ref: mask, children: sizeText() }), jsxRuntime.jsxs("div", { class: "btn-group", ref: btnGroup, onMousedown: drag, children: [jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" })] })] })] }));
|
|
294
283
|
});
|
|
295
284
|
}
|
|
296
285
|
|
|
@@ -714,23 +703,6 @@ function useBlockContent(slot) {
|
|
|
714
703
|
});
|
|
715
704
|
}
|
|
716
705
|
|
|
717
|
-
function SlotRender(props) {
|
|
718
|
-
const adaper = core.inject(platformBrowser.DomAdapter);
|
|
719
|
-
const instance = core.getCurrentInstance();
|
|
720
|
-
const sub = props.slot.__changeMarker__.onChange.subscribe(() => {
|
|
721
|
-
instance.markAsDirtied();
|
|
722
|
-
});
|
|
723
|
-
core.onUnmounted(() => {
|
|
724
|
-
sub.unsubscribe();
|
|
725
|
-
});
|
|
726
|
-
return () => {
|
|
727
|
-
const { slot, tag = 'div', renderEnv = false, elRef, elKey } = props, rest = __rest(props, ["slot", "tag", "renderEnv", "elRef", "elKey"]);
|
|
728
|
-
return adaper.slotRender(slot, children => {
|
|
729
|
-
return core$1.createVNode(tag, Object.assign({ ref: elRef, key: elKey }, rest), children);
|
|
730
|
-
}, renderEnv);
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
|
|
734
706
|
class BlockquoteComponent extends core$1.Component {
|
|
735
707
|
static fromJSON(textbus, json) {
|
|
736
708
|
const slot = textbus.get(core$1.Registry).createSlot(json.slot);
|
|
@@ -824,11 +796,14 @@ function registerBlockquoteShortcut(textbus) {
|
|
|
824
796
|
});
|
|
825
797
|
}
|
|
826
798
|
function BlockquoteView(props) {
|
|
799
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
827
800
|
const readonly = useReadonly();
|
|
828
801
|
const output = useOutput();
|
|
829
802
|
return () => {
|
|
830
803
|
const slot = props.component.state.slot;
|
|
831
|
-
return (jsxRuntime.jsx("blockquote", { class: "xnote-blockquote", ref: props.rootRef, "data-component": props.component.name, children:
|
|
804
|
+
return (jsxRuntime.jsx("blockquote", { class: "xnote-blockquote", ref: props.rootRef, "data-component": props.component.name, children: adapter.slotRender(slot, children => {
|
|
805
|
+
return core$1.createVNode('div', null, children);
|
|
806
|
+
}, readonly() || output()) }));
|
|
832
807
|
};
|
|
833
808
|
}
|
|
834
809
|
const blockquoteComponentLoader = {
|
|
@@ -876,6 +851,7 @@ HighlightBoxComponent.defaultTypes = ['❤️', '💡', '📌', '✅', '❎', '
|
|
|
876
851
|
HighlightBoxComponent.componentName = 'HighlightBoxComponent';
|
|
877
852
|
HighlightBoxComponent.type = core$1.ContentType.BlockComponent;
|
|
878
853
|
function HighlightBoxView(props) {
|
|
854
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
879
855
|
const readonly = useReadonly();
|
|
880
856
|
const output = useOutput();
|
|
881
857
|
const emoji = [];
|
|
@@ -891,14 +867,22 @@ function HighlightBoxView(props) {
|
|
|
891
867
|
return () => {
|
|
892
868
|
const { state, name } = props.component;
|
|
893
869
|
if (readonly() || output()) {
|
|
894
|
-
return (jsxRuntime.jsxs("div", { "data-component": name, ref: props.rootRef, "data-icon": state.type, class: "xnote-highlight-box", children: [jsxRuntime.jsx("div", { class: "xnote-highlight-box-left", children: jsxRuntime.jsx("div", { class: "xnote-highlight-box-icon", children: jsxRuntime.jsx("button", { type: "button", children: state.type || '❤️' }) }) }),
|
|
870
|
+
return (jsxRuntime.jsxs("div", { "data-component": name, ref: props.rootRef, "data-icon": state.type, class: "xnote-highlight-box", children: [jsxRuntime.jsx("div", { class: "xnote-highlight-box-left", children: jsxRuntime.jsx("div", { class: "xnote-highlight-box-icon", children: jsxRuntime.jsx("button", { type: "button", children: state.type || '❤️' }) }) }), adapter.slotRender(state.slot, children => {
|
|
871
|
+
return core$1.createVNode('div', {
|
|
872
|
+
class: 'xnote-highlight-box-content'
|
|
873
|
+
}, children);
|
|
874
|
+
}, readonly() || output())] }));
|
|
895
875
|
}
|
|
896
876
|
return (jsxRuntime.jsxs("div", { "data-component": name, ref: props.rootRef, "data-icon": state.type, class: "xnote-highlight-box", children: [jsxRuntime.jsx("div", { class: "xnote-highlight-box-left", children: jsxRuntime.jsx(Dropdown, { trigger: "click", ref: dropdownRef, width: "282px", menu: jsxRuntime.jsxs("div", { class: "xnote-highlight-box-icons", children: [jsxRuntime.jsx("div", { class: "xnote-highlight-box-heading", children: "\u5E38\u7528" }), HighlightBoxComponent.defaultTypes.map(icon => {
|
|
897
877
|
return (jsxRuntime.jsx("button", { onClick: () => setType(icon), type: "button", children: icon }));
|
|
898
878
|
}), jsxRuntime.jsx("div", { class: "xnote-highlight-box-heading", children: "\u66F4\u591A" }), emoji.map(i => {
|
|
899
879
|
const icon = String.fromCodePoint(i);
|
|
900
880
|
return (jsxRuntime.jsx("button", { onClick: () => setType(icon), type: "button", children: icon }));
|
|
901
|
-
})] }), children: jsxRuntime.jsx("div", { class: "xnote-highlight-box-icon", children: jsxRuntime.jsx("button", { type: "button", children: state.type || '❤️' }) }) }) }),
|
|
881
|
+
})] }), children: jsxRuntime.jsx("div", { class: "xnote-highlight-box-icon", children: jsxRuntime.jsx("button", { type: "button", children: state.type || '❤️' }) }) }) }), adapter.slotRender(state.slot, children => {
|
|
882
|
+
return core$1.createVNode('div', {
|
|
883
|
+
class: 'xnote-highlight-box-content'
|
|
884
|
+
}, children);
|
|
885
|
+
}, readonly() || output())] }));
|
|
902
886
|
};
|
|
903
887
|
}
|
|
904
888
|
const highlightBoxComponentLoader = {
|
|
@@ -966,11 +950,14 @@ class ParagraphComponent extends core$1.Component {
|
|
|
966
950
|
ParagraphComponent.componentName = 'ParagraphComponent';
|
|
967
951
|
ParagraphComponent.type = core$1.ContentType.BlockComponent;
|
|
968
952
|
function ParagraphView(props) {
|
|
953
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
969
954
|
const readonly = useReadonly();
|
|
970
955
|
const output = useOutput();
|
|
971
956
|
return () => {
|
|
972
957
|
const slot = props.component.state.slot;
|
|
973
|
-
return (jsxRuntime.jsx("div", { class: "xnote-paragraph", ref: props.rootRef, "data-component": ParagraphComponent.componentName, children:
|
|
958
|
+
return (jsxRuntime.jsx("div", { class: "xnote-paragraph", ref: props.rootRef, "data-component": ParagraphComponent.componentName, children: adapter.slotRender(slot, children => {
|
|
959
|
+
return (core$1.createVNode('div', null, children));
|
|
960
|
+
}, readonly() || output()) }));
|
|
974
961
|
};
|
|
975
962
|
}
|
|
976
963
|
const paragraphComponentLoader = {
|
|
@@ -2139,6 +2126,7 @@ TodolistComponent.zenCoding = {
|
|
|
2139
2126
|
}
|
|
2140
2127
|
};
|
|
2141
2128
|
function TodolistView(props) {
|
|
2129
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
2142
2130
|
const component = props.component;
|
|
2143
2131
|
const state = component.state;
|
|
2144
2132
|
function toggle() {
|
|
@@ -2167,7 +2155,11 @@ function TodolistView(props) {
|
|
|
2167
2155
|
marginLeft: indent * 24 + 'px',
|
|
2168
2156
|
justifyContent: align[component.state.slot.getAttribute(textAlignAttr)],
|
|
2169
2157
|
textAlign: component.state.slot.getAttribute(textAlignAttr) === 'justify' ? 'justify' : void 0
|
|
2170
|
-
}, children: [jsxRuntime.jsx("div", { class: "xnote-todolist-icon", onClick: toggle, children: jsxRuntime.jsx("span", { "data-checked": checked, class: [checked ? 'xnote-icon-checkbox-checked' : 'xnote-icon-checkbox-unchecked'] }) }),
|
|
2158
|
+
}, children: [jsxRuntime.jsx("div", { class: "xnote-todolist-icon", onClick: toggle, children: jsxRuntime.jsx("span", { "data-checked": checked, class: [checked ? 'xnote-icon-checkbox-checked' : 'xnote-icon-checkbox-unchecked'] }) }), adapter.slotRender(slot, children => {
|
|
2159
|
+
return core$1.createVNode('div', {
|
|
2160
|
+
class: 'xnote-todolist-content'
|
|
2161
|
+
}, children);
|
|
2162
|
+
}, readonly() || output())] }));
|
|
2171
2163
|
};
|
|
2172
2164
|
}
|
|
2173
2165
|
const todolistComponentLoader = {
|
|
@@ -2367,6 +2359,7 @@ function numberToLetter(num) {
|
|
|
2367
2359
|
}).join('');
|
|
2368
2360
|
}
|
|
2369
2361
|
function ListComponentView(props) {
|
|
2362
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
2370
2363
|
const component = props.component;
|
|
2371
2364
|
function reorder(is) {
|
|
2372
2365
|
component.state.reorder = is;
|
|
@@ -2440,7 +2433,11 @@ function ListComponentView(props) {
|
|
|
2440
2433
|
}, children: [jsxRuntime.jsx("div", { class: "xnote-list-type", children: (component.state.type === 'UnorderedList' || readonly() || output()) ?
|
|
2441
2434
|
jsxRuntime.jsx("span", { class: "xnote-order-btn", children: icon })
|
|
2442
2435
|
:
|
|
2443
|
-
jsxRuntime.jsx(Dropdown, { menu: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem, { onClick: () => reorder(false), children: "\u7EE7\u7EED\u7F16\u53F7" }), jsxRuntime.jsx(MenuItem, { onClick: () => reorder(true), children: "\u91CD\u65B0\u7F16\u53F7" })] }), children: jsxRuntime.jsx(Button, { style: { color: 'inherit' }, children: icon }) }) }),
|
|
2436
|
+
jsxRuntime.jsx(Dropdown, { menu: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem, { onClick: () => reorder(false), children: "\u7EE7\u7EED\u7F16\u53F7" }), jsxRuntime.jsx(MenuItem, { onClick: () => reorder(true), children: "\u91CD\u65B0\u7F16\u53F7" })] }), children: jsxRuntime.jsx(Button, { style: { color: 'inherit' }, children: icon }) }) }), adapter.slotRender(component.state.slot, children => {
|
|
2437
|
+
return core$1.createVNode('div', {
|
|
2438
|
+
class: 'xnote-list-content'
|
|
2439
|
+
}, children);
|
|
2440
|
+
}, readonly() || output())] }) }));
|
|
2444
2441
|
};
|
|
2445
2442
|
}
|
|
2446
2443
|
const listComponentLoader = {
|
|
@@ -4518,7 +4515,7 @@ class AtComponent extends core$1.Component {
|
|
|
4518
4515
|
const registry = textbus.get(core$1.Registry);
|
|
4519
4516
|
if (slotState) {
|
|
4520
4517
|
const slot = registry.createSlot(slotState);
|
|
4521
|
-
return new AtComponent({
|
|
4518
|
+
return new AtComponent(textbus, {
|
|
4522
4519
|
slot
|
|
4523
4520
|
});
|
|
4524
4521
|
}
|
|
@@ -4624,6 +4621,7 @@ AtComponent.componentName = 'AtComponent';
|
|
|
4624
4621
|
AtComponent.type = core$1.ContentType.InlineComponent;
|
|
4625
4622
|
|
|
4626
4623
|
function AtComponentView(props) {
|
|
4624
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
4627
4625
|
const selection = core.inject(core$1.Selection);
|
|
4628
4626
|
const dropdownRef = core.createRef();
|
|
4629
4627
|
const subscription = props.component.focus.subscribe((b) => {
|
|
@@ -4664,7 +4662,11 @@ function AtComponentView(props) {
|
|
|
4664
4662
|
return (jsxRuntime.jsxs("div", { class: "xnote-at xnote-at-complete", "data-info": encodeURIComponent(JSON.stringify(userInfo)), ref: props.rootRef, "data-component": props.component.name, children: [jsxRuntime.jsx("span", { children: "@" }), userInfo.name] }));
|
|
4665
4663
|
}
|
|
4666
4664
|
if (readonly() || output()) {
|
|
4667
|
-
return (jsxRuntime.jsxs("div", { class: "xnote-at", ref: props.rootRef, "data-component": props.component.name, children: [jsxRuntime.jsx("span", { children: "@" }), slot &&
|
|
4665
|
+
return (jsxRuntime.jsxs("div", { class: "xnote-at", ref: props.rootRef, "data-component": props.component.name, children: [jsxRuntime.jsx("span", { children: "@" }), slot && adapter.slotRender(slot, children => {
|
|
4666
|
+
return core$1.createVNode('span', {
|
|
4667
|
+
class: 'xnote-at-input'
|
|
4668
|
+
}, children);
|
|
4669
|
+
})] }));
|
|
4668
4670
|
}
|
|
4669
4671
|
const members = props.component.members();
|
|
4670
4672
|
return (jsxRuntime.jsx("div", { class: "xnote-at", ref: props.rootRef, "data-component": props.component.name, children: jsxRuntime.jsxs(Dropdown, { trigger: 'none', ref: dropdownRef, menu: jsxRuntime.jsx("div", { class: "xnote-at-menu", ref: membersRef, children: members.map((member, index) => {
|
|
@@ -4680,7 +4682,11 @@ function AtComponentView(props) {
|
|
|
4680
4682
|
selection.selectComponentEnd(props.component);
|
|
4681
4683
|
}, class: ['xnote-at-member', { selected: index === selectedIndex }], children: [jsxRuntime.jsx("div", { class: "xnote-at-member-avatar", children: member.avatar ? jsxRuntime.jsx("img", { src: member.avatar, alt: member.name }) :
|
|
4682
4684
|
jsxRuntime.jsx("span", { class: "xnote-at-member-avatar-bg", style: { background: member.color, color: color$1 }, children: member.name }) }), jsxRuntime.jsxs("div", { class: "xnote-at-member-info", children: [jsxRuntime.jsx("div", { class: "xnote-at-member-name", children: member.name }), jsxRuntime.jsx("div", { class: "xnote-at-member-desc", children: member.groupName })] })] }, member.id));
|
|
4683
|
-
}) }), children: [jsxRuntime.jsx("span", { children: "@" }), slot &&
|
|
4685
|
+
}) }), children: [jsxRuntime.jsx("span", { children: "@" }), slot && adapter.slotRender(slot, children => {
|
|
4686
|
+
return core$1.createVNode('span', {
|
|
4687
|
+
class: 'xnote-at-input'
|
|
4688
|
+
}, children);
|
|
4689
|
+
})] }) }));
|
|
4684
4690
|
};
|
|
4685
4691
|
}
|
|
4686
4692
|
const atComponentLoader = {
|
|
@@ -4739,6 +4745,7 @@ class RootComponent extends core$1.Component {
|
|
|
4739
4745
|
RootComponent.componentName = 'RootComponent';
|
|
4740
4746
|
RootComponent.type = core$1.ContentType.BlockComponent;
|
|
4741
4747
|
function RootView(props) {
|
|
4748
|
+
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
4742
4749
|
const { content } = props.component.state;
|
|
4743
4750
|
const ref = core.createDynamicRef(node => {
|
|
4744
4751
|
const sub = props.component.onCompositionStart.subscribe(() => {
|
|
@@ -4755,7 +4762,12 @@ function RootView(props) {
|
|
|
4755
4762
|
const output = useOutput();
|
|
4756
4763
|
return () => {
|
|
4757
4764
|
const { rootRef } = props;
|
|
4758
|
-
return (jsxRuntime.jsx("div", { class: "xnote-root", dir: "auto", ref: [rootRef, ref], "data-component": props.component.name, children:
|
|
4765
|
+
return (jsxRuntime.jsx("div", { class: "xnote-root", dir: "auto", ref: [rootRef, ref], "data-component": props.component.name, children: adapter.slotRender(content, children => {
|
|
4766
|
+
return (core$1.createVNode('div', {
|
|
4767
|
+
class: 'xnote-content',
|
|
4768
|
+
'data-placeholder': content.isEmpty ? '请输入内容' : ''
|
|
4769
|
+
}, children));
|
|
4770
|
+
}, readonly() || output()) }));
|
|
4759
4771
|
};
|
|
4760
4772
|
}
|
|
4761
4773
|
const rootComponentLoader = {
|
|
@@ -5274,7 +5286,6 @@ function SelectionMask(props) {
|
|
|
5274
5286
|
});
|
|
5275
5287
|
}
|
|
5276
5288
|
|
|
5277
|
-
// import { SlotRender } from '../SlotRender'
|
|
5278
5289
|
const TableComponentView = core.withAnnotation({
|
|
5279
5290
|
providers: [TableService]
|
|
5280
5291
|
}, function TableComponentView(props) {
|
|
@@ -29,6 +29,6 @@ export declare class AtComponent extends Component<AtComponentState> {
|
|
|
29
29
|
focus: Subject<boolean>;
|
|
30
30
|
members: import("@viewfly/core").Signal<Member[]>;
|
|
31
31
|
selectedIndex: import("@viewfly/core").Signal<number>;
|
|
32
|
-
constructor(textbus:
|
|
32
|
+
constructor(textbus: Textbus, state?: AtComponentState);
|
|
33
33
|
setup(): void;
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Slot } from '@textbus/core';
|
|
2
|
-
import { DynamicRef } from '@viewfly/core';
|
|
3
|
-
import { HTMLAttributes } from '@viewfly/platform-browser';
|
|
4
|
-
interface Props extends HTMLAttributes<unknown> {
|
|
5
|
-
slot: Slot;
|
|
6
|
-
/** 默认值为 div */
|
|
7
|
-
tag?: string;
|
|
8
|
-
class?: string;
|
|
9
|
-
renderEnv?: boolean;
|
|
10
|
-
elRef?: DynamicRef<HTMLElement>;
|
|
11
|
-
elKey?: number | string;
|
|
12
|
-
}
|
|
13
|
-
export declare function SlotRender(props: Props): () => any;
|
|
14
|
-
export {};
|