@podlite/editor-react 0.0.14 → 0.0.16
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/CHANGELOG.md +6 -1
- package/esm/dict.d.ts +4 -2
- package/esm/helpers.d.ts +15 -0
- package/esm/index.css +1 -1
- package/esm/index.js +1244 -2
- package/esm/index.js.map +3 -3
- package/lib/dict.d.ts +4 -2
- package/lib/helpers.d.ts +15 -0
- package/lib/index.css +1 -1
- package/lib/index.js +1244 -2
- package/lib/index.js.map +3 -3
- package/package.json +4 -10
- package/src/Editor.css +3 -3
- package/src/dict.ts +163 -89
- package/src/helpers.ts +74 -0
- package/src/index.tsx +24 -2
- package/t/editor.test.tsx +86 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/esm/dict.d.ts
CHANGED
package/esm/helpers.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PodliteDocument } from '@podlite/schema';
|
|
2
|
+
export declare const parse: (str: string) => PodliteDocument;
|
|
3
|
+
export declare const getSuggestionContextForLine: (pod: string, line: number) => 'pod6' | 'md';
|
|
4
|
+
interface Pos {
|
|
5
|
+
line: number;
|
|
6
|
+
offset: number;
|
|
7
|
+
}
|
|
8
|
+
interface Selection {
|
|
9
|
+
start: Pos;
|
|
10
|
+
end: Pos;
|
|
11
|
+
text?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const templateGetSelectionPos: (pod: string) => Selection | null;
|
|
14
|
+
export declare const addVMargin: (count: number, pod: string) => string;
|
|
15
|
+
export {};
|
package/esm/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.EditorApp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion: no-preference){.App-logo{animation:App-logo-spin infinite 20s linear}}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}.layout{position:absolute;width:100%}.Editor{text-align:left;white-space:pre-wrap;word-break:break-word;word-wrap:break-word}[contenteditable]:focus{outline:0px solid transparent}.layout__panel{position:relative;width:100%;height:100%;flex:none;overflow:hidden}.flex--row{flex-direction:row}.flex{display:flex}.CodeMirror{height:auto;font-family:inherit}pre{overflow-x:auto;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.title{margin:0}.Editorleft{border-right:1px dotted lightgrey;white-space:pre-wrap;word-break:break-word;word-wrap:break-word;width:50%;font-size:15px;text-align:left}body{margin:0;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}pre{padding:9.5px;display:block;word-break:break-all;word-wrap:break-word;background-color:#f8f8f8;border-radius:4px}code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}img{max-width:1024px}table{word-break:normal;min-width:70%;max-width:100%;margin:2em auto 1em;border-spacing:0;border-collapse:collapse;text-align:center}table caption{margin-bottom:.8em}table tbody tr:hover{background-color:#eee;-webkit-transition:.5s;transition:.5s}tr th{vertical-align:bottom;border-bottom:2px solid #eee}td{padding:8px;border:1px solid #eee}.footnote a{text-decoration:none}.footnotes{border-top-style:solid;border-top-width:1px;border-top-color:#eee}img{display:block;margin:0 auto;max-width:100%}.shadow{-webkit-box-shadow:3px 3px 5px 6px #ccc;-moz-box-shadow:3px 3px 5px 6px #ccc;box-shadow:3px 3px 5px 6px #ccc}.box{box-shadow:0 2.8px 2.2px #00000009,0 6.7px 5.3px #0000000c,0 12.5px 10px #0000000f,0 22.3px 17.9px #00000012,0 41.8px 33.4px #00000016,0 100px 80px #0000001f;margin:100px auto;background:white;border-radius:5px}.video{max-width:
|
|
1
|
+
.EditorApp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion: no-preference){.App-logo{animation:App-logo-spin infinite 20s linear}}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}.layout{position:absolute;width:100%}.Editor{text-align:left;white-space:pre-wrap;word-break:break-word;word-wrap:break-word}[contenteditable]:focus{outline:0px solid transparent}.layout__panel{position:relative;width:100%;height:100%;flex:none;overflow:hidden}.flex--row{flex-direction:row}.flex{display:flex}.CodeMirror{height:auto;font-family:inherit}pre{overflow-x:auto;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.title{margin:0}.Editorleft{border-right:1px dotted lightgrey;white-space:pre-wrap;word-break:break-word;word-wrap:break-word;width:50%;font-size:15px;text-align:left}body{margin:0;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}pre{padding:9.5px;display:block;word-break:break-all;word-wrap:break-word;background-color:#f8f8f8;border-radius:4px}code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}img{max-width:1024px}table{word-break:normal;min-width:70%;max-width:100%;margin:2em auto 1em;border-spacing:0;border-collapse:collapse;text-align:center}table caption{margin-bottom:.8em}table tbody tr:hover{background-color:#eee;-webkit-transition:.5s;transition:.5s}tr th{vertical-align:bottom;border-bottom:2px solid #eee}td{padding:8px;border:1px solid #eee}.footnote a{text-decoration:none}.footnotes{border-top-style:solid;border-top-width:1px;border-top-color:#eee}img{display:block;margin:0 auto;max-width:100%}.shadow{-webkit-box-shadow:3px 3px 5px 6px #ccc;-moz-box-shadow:3px 3px 5px 6px #ccc;box-shadow:3px 3px 5px 6px #ccc}.box{box-shadow:0 2.8px 2.2px #00000009,0 6.7px 5.3px #0000000c,0 12.5px 10px #0000000f,0 22.3px 17.9px #00000012,0 41.8px 33.4px #00000016,0 100px 80px #0000001f;margin:100px auto;background:white;border-radius:5px}.image_block video{max-width:100%;margin-bottom:1em}.image_block video{width:100%;outline:none;border:none}.mermaid svg{display:block;margin:auto}.toc{padding:1rem}.toc-list{list-style:none;font-size:.8rem}.caption{text-align:center;font-size:.9rem}.CodeMirror{height:auto;font-family:inherit}.title{margin:0}.Editorleft{border-right:1px dotted lightgrey;white-space:pre-wrap;word-break:break-word;word-wrap:break-word;width:50%;font-size:15px;text-align:left;float:left;height:100%;padding-left:10px;visibility:visible;opacity:1;transition:all .2s ease-out}.editorApp,.CodeMirror{height:100%}.Editorright{text-align:left;word-break:break-word;word-wrap:break-word;margin-right:0;height:100%;font-size:15px;padding-left:10px;overflow-y:scroll;overflow-x:hidden;background-color:#fff}.Editorright .error{opacity:.5}.Editorright img{display:block;margin:0 auto;max-width:100%}.content{height:100%}.layoutPreview .Editorright{position:absolute;width:48%;float:right;top:0;right:0;width:100%;background-color:#fff}.layoutPreview .Editorleft{visibility:hidden;opacity:0}.layoutPreview .content{width:50%;margin:0 auto;height:100%;overflow-y:initial}@keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.CodeMirror-vscrollbar{user-select:none;outline:none!important}::-webkit-scrollbar-thumb{background-color:#0000001a}::-webkit-scrollbar{background-color:(0,0,0,.05)}::-webkit-scrollbar-thumb:active{background-color:#0000001a}::-webkit-scrollbar{width:10px;height:10px;-webkit-border-radius:100px}::-webkit-scrollbar-thumb{-webkit-border-radius:100px}::-webkit-scrollbar-thumb:active{-webkit-border-radius:100px}::-webkit-scrollbar-corner{background:transparent}.CodeMirror-hints{z-index:1000;border:none}
|