teem-editor 0.1.0 → 0.2.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.
- package/README.md +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/teem-editor.cjs +1 -1
- package/dist/teem-editor.cjs.map +1 -1
- package/dist/teem-editor.css +1 -1
- package/dist/teem-editor.js +526 -509
- package/dist/teem-editor.js.map +1 -1
- package/package.json +1 -1
package/dist/teem-editor.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.te-root{--te-bg: #ffffff;--te-surface: #f8fafc;--te-border: #e2e8f0;--te-border-strong: #cbd5e1;--te-text: #0f172a;--te-muted: #64748b;--te-primary: #0f766e;--te-primary-soft: #ccfbf1;--te-danger: #dc2626;--te-radius: 12px;--te-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);--te-font: "Vazirmatn", "IRANSansX", "Tahoma", "Segoe UI", sans-serif;direction:ltr;text-align:start;color:var(--te-text);background:var(--te-bg);border:1px solid var(--te-border);border-radius:var(--te-radius);box-shadow:var(--te-shadow);font-family:var(--te-font);overflow:hidden}.te-root[dir=rtl],.te-root.te-root--rtl{direction:rtl}.te-root[dir=ltr],.te-root.te-root--ltr{direction:ltr}.te-root.is-disabled{opacity:.65;pointer-events:none}.te-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.te-toolbar{display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:8px 10px;background:linear-gradient(180deg,#f8fafc,#f1f5f9);border-bottom:1px solid var(--te-border)}.te-toolbar__group{display:inline-flex;align-items:center;gap:2px}.te-toolbar__divider{width:1px;height:22px;background:var(--te-border-strong);margin:0 4px}.te-tool{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid transparent;border-radius:8px;background:transparent;color:#334155;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.te-tool:hover:not(:disabled){background:#fff;border-color:var(--te-border);color:var(--te-text)}.te-tool.is-active{background:var(--te-primary-soft);border-color:#99f6e4;color:var(--te-primary)}.te-tool:disabled{opacity:.35;cursor:not-allowed}.te-root[dir=rtl] .te-tool--indent svg,.te-root[dir=rtl] .te-tool--outdent svg,.te-root--rtl .te-tool--indent svg,.te-root--rtl .te-tool--outdent svg{transform:scaleX(-1)}.te-select-wrap{display:inline-flex}.te-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:34px;min-width:110px;padding-block:0;padding-inline:10px 28px;border:1px solid var(--te-border);border-radius:8px;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;color:var(--te-text);font:inherit;font-size:13px;cursor:pointer}.te-root[dir=rtl] .te-select,.te-root--rtl .te-select{background-position:left 10px center}.te-toolbar__colors{gap:8px}.te-color{position:relative;display:inline-flex;align-items:center}.te-color__split{display:inline-flex;align-items:stretch;border:1px solid transparent;border-radius:8px;overflow:hidden}.te-color.is-open .te-color__split,.te-color__split:hover{border-color:var(--te-border);background:#fff}.te-color__apply{position:relative;width:34px;height:34px;flex-direction:column;gap:2px;border-radius:0;border:0}.te-color__icon{display:inline-flex;line-height:0}.te-color__bar{display:block;width:16px;height:3px;border-radius:2px;border:1px solid rgba(15,23,42,.12);flex-shrink:0}.te-color__caret{width:20px;height:34px;border-radius:0;border:0;border-inline-start:1px solid transparent;color:#64748b}.te-color__split:hover .te-color__caret,.te-color.is-open .te-color__caret{border-inline-start-color:var(--te-border)}.te-color__caret.is-active{background:var(--te-primary-soft);color:var(--te-primary)}.te-color__swatches{display:flex;position:absolute;top:calc(100% + 6px);inset-inline-end:0;z-index:40;padding:8px;gap:4px;flex-wrap:wrap;width:148px;background:#fff;border:1px solid var(--te-border);border-radius:10px;box-shadow:var(--te-shadow)}.te-swatch.is-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--te-primary)}.te-editor .te-figure{position:relative;display:block;width:fit-content;max-width:100%;margin:.85em 0;padding:4px;border-radius:10px;cursor:pointer;-webkit-user-select:none;user-select:none;outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease,background .15s ease,box-shadow .15s ease}.te-editor .te-figure[data-align=center]{margin-left:auto;margin-right:auto}.te-editor .te-figure[data-align=left]{margin-left:0;margin-right:auto}.te-editor .te-figure[data-align=right]{margin-left:auto;margin-right:0}.te-editor .te-figure:hover{background:#0f766e0a}.te-editor .te-figure.is-selected{outline-color:var(--te-primary);background:#0f766e0f;box-shadow:0 0 0 4px #0f766e1f}.te-editor .te-figure__alt-btn{position:absolute;top:10px;inset-inline-start:10px;z-index:2;max-width:calc(100% - 20px);height:28px;padding:0 10px;border:0;border-radius:8px;background:#0f172ad1;color:#fff;font:inherit;font-size:12px;line-height:1;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.te-editor .te-figure__alt-btn:hover{background:#0f172af2}.te-editor .te-figure img,.te-editor img{max-width:100%;height:auto;border-radius:8px;margin:0;display:block;cursor:pointer}.te-editor img.is-selected{outline:none}.te-swatch{width:20px;height:20px;border-radius:5px;border:1px solid rgba(15,23,42,.12);cursor:pointer;padding:0}.te-swatch--picker{position:relative;overflow:hidden;background:conic-gradient(red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.te-swatch--picker input{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer;border:0;padding:0;width:100%;height:100%}.te-editor-shell{position:relative;background:var(--te-bg)}.te-placeholder{position:absolute;top:16px;inset-inline:18px;color:#94a3b8;pointer-events:none;font-size:15px;line-height:1.9;text-align:start}.te-editor{outline:none;padding:16px 18px;min-height:220px;line-height:1.9;font-size:15px;color:var(--te-text);word-break:break-word;overflow-wrap:anywhere;text-align:start}.te-editor:focus{background:#fff}.te-editor h1,.te-editor h2,.te-editor h3,.te-editor h4,.te-editor h5,.te-editor h6{margin:.85em 0 .45em;line-height:1.45;font-weight:700}.te-editor h1{font-size:1.75em}.te-editor h2{font-size:1.45em}.te-editor h3{font-size:1.25em}.te-editor h4{font-size:1.1em}.te-editor h5{font-size:1em}.te-editor h6{font-size:.9em}.te-source{display:block;width:100%;box-sizing:border-box;margin:0;padding:16px 18px;border:0;outline:none;resize:vertical;background:#0f172a;color:#e2e8f0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.7;direction:ltr;text-align:left;-moz-tab-size:2;tab-size:2}.te-source:focus{box-shadow:inset 0 0 0 2px #2dd4bf}.te-color.is-disabled{opacity:.35;pointer-events:none}.te-select:disabled{opacity:.45;cursor:not-allowed}.te-editor p{margin:0 0 .75em}.te-editor ul,.te-editor ol{margin:0 0 .85em;padding-inline-start:1.5em}.te-editor li{margin:.2em 0}.te-editor blockquote{margin:.85em 0;padding:.55em 1em;border-inline-start:3px solid var(--te-primary);background:#f0fdfa;color:#334155;border-radius:0 8px 8px 0}.te-editor pre{margin:.85em 0;padding:.75em 1em;background:#f1f5f9;color:#0f172a;border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.9em;white-space:pre-wrap;overflow-x:auto}.te-editor a{color:#0f766e;text-decoration:underline;text-underline-offset:2px}.te-editor hr{border:0;border-top:1px solid var(--te-border-strong);margin:1.25em 0}.te-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:16px}.te-modal{width:min(420px,100%);background:#fff;border-radius:14px;box-shadow:0 20px 50px #0f172a38;overflow:hidden;font-family:var(--te-font);direction:inherit;text-align:start}.te-modal__header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--te-border)}.te-modal__header h3{margin:0;font-size:16px;font-weight:700}.te-modal__close{border:0;background:transparent;color:#64748b;cursor:pointer;width:32px;height:32px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center}.te-modal__close:hover{background:#f1f5f9;color:#0f172a}.te-modal__body{padding:16px}.te-modal__footer{display:flex;justify-content:flex-start;gap:8px;padding:12px 16px 16px;border-top:1px solid var(--te-border)}.te-form{display:flex;flex-direction:column;gap:12px}.te-field{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#334155}.te-field input[type=text],.te-field input[type=url],.te-field input[type=file]{height:40px;border:1px solid var(--te-border);border-radius:10px;padding:0 12px;font:inherit;color:var(--te-text);background:#fff}.te-field input[type=file]{padding:8px 12px;height:auto}.te-field input:focus{outline:2px solid #99f6e4;border-color:#2dd4bf}.te-hint{margin:0;font-size:12px;color:var(--te-muted)}.te-error{margin:0;font-size:13px;color:var(--te-danger)}.te-btn{height:38px;padding:0 14px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13px;cursor:pointer}.te-btn--ghost{background:#fff;border-color:var(--te-border);color:#334155}.te-btn--ghost:hover{background:#f8fafc}.te-btn--primary{background:var(--te-primary);color:#fff}.te-btn--primary:hover{background:#0d9488}.te-btn:disabled{opacity:.55;cursor:not-allowed}.te-tabs{display:flex;gap:6px;margin-bottom:14px}.te-tabs button{flex:1;height:36px;border:1px solid var(--te-border);border-radius:9px;background:#fff;color:#475569;font:inherit;font-size:13px;cursor:pointer}.te-tabs button.is-active{background:var(--te-primary-soft);border-color:#99f6e4;color:var(--te-primary);font-weight:600}@media(max-width:640px){.te-toolbar{padding:6px}.te-tool{width:32px;height:32px}.te-select{min-width:96px;font-size:12px}}
|
|
1
|
+
.te-root{--te-bg: #ffffff;--te-surface: #f8fafc;--te-border: #e2e8f0;--te-border-strong: #cbd5e1;--te-text: #0f172a;--te-muted: #64748b;--te-primary: #0f766e;--te-primary-soft: #ccfbf1;--te-danger: #dc2626;--te-radius: 12px;--te-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);--te-font: "Vazirmatn", "IRANSansX", "Tahoma", "Segoe UI", sans-serif;direction:ltr;text-align:start;color:var(--te-text);background:var(--te-bg);border:1px solid var(--te-border);border-radius:var(--te-radius);box-shadow:var(--te-shadow);font-family:var(--te-font);overflow:hidden}.te-root[dir=rtl],.te-root.te-root--rtl{direction:rtl}.te-root[dir=ltr],.te-root.te-root--ltr{direction:ltr}.te-root.is-disabled{opacity:.65;pointer-events:none}.te-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.te-toolbar{display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:8px 10px;background:linear-gradient(180deg,#f8fafc,#f1f5f9);border-bottom:1px solid var(--te-border)}.te-toolbar__group{display:inline-flex;align-items:center;gap:2px}.te-toolbar__divider{width:1px;height:22px;background:var(--te-border-strong);margin:0 4px}.te-tool{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid transparent;border-radius:8px;background:transparent;color:#334155;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.te-tool:hover:not(:disabled){background:#fff;border-color:var(--te-border);color:var(--te-text)}.te-tool.is-active{background:var(--te-primary-soft);border-color:#99f6e4;color:var(--te-primary)}.te-tool:disabled{opacity:.35;cursor:not-allowed}.te-root[dir=rtl] .te-tool--indent svg,.te-root[dir=rtl] .te-tool--outdent svg,.te-root--rtl .te-tool--indent svg,.te-root--rtl .te-tool--outdent svg{transform:scaleX(-1)}.te-select-wrap{display:inline-flex}.te-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:34px;min-width:110px;padding-block:0;padding-inline:10px 28px;border:1px solid var(--te-border);border-radius:8px;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;color:var(--te-text);font:inherit;font-size:13px;cursor:pointer}.te-root[dir=rtl] .te-select,.te-root--rtl .te-select{background-position:left 10px center}.te-toolbar__colors{gap:8px}.te-color{position:relative;display:inline-flex;align-items:center}.te-color__split{display:inline-flex;align-items:stretch;border:1px solid transparent;border-radius:8px;overflow:hidden}.te-color.is-open .te-color__split,.te-color__split:hover{border-color:var(--te-border);background:#fff}.te-color__apply{position:relative;width:34px;height:34px;flex-direction:column;gap:2px;border-radius:0;border:0}.te-color__icon{display:inline-flex;line-height:0}.te-color__bar{display:block;width:16px;height:3px;border-radius:2px;border:1px solid rgba(15,23,42,.12);flex-shrink:0}.te-color__caret{width:20px;height:34px;border-radius:0;border:0;border-inline-start:1px solid transparent;color:#64748b}.te-color__split:hover .te-color__caret,.te-color.is-open .te-color__caret{border-inline-start-color:var(--te-border)}.te-color__caret.is-active{background:var(--te-primary-soft);color:var(--te-primary)}.te-color__swatches{display:flex;position:absolute;top:calc(100% + 6px);inset-inline-end:0;z-index:40;padding:8px;gap:4px;flex-wrap:wrap;width:148px;background:#fff;border:1px solid var(--te-border);border-radius:10px;box-shadow:var(--te-shadow)}.te-swatch.is-selected{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--te-primary)}.te-editor .te-figure{position:relative;display:block;width:fit-content;max-width:100%;margin:.85em 0;padding:4px;border-radius:10px;cursor:pointer;-webkit-user-select:none;user-select:none;outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease,background .15s ease,box-shadow .15s ease}.te-editor .te-figure[data-align=center]{margin-left:auto;margin-right:auto}.te-editor .te-figure[data-align=left]{margin-left:0;margin-right:auto}.te-editor .te-figure[data-align=right]{margin-left:auto;margin-right:0}.te-editor .te-figure:hover{background:#0f766e0a}.te-editor .te-figure.is-selected{outline-color:var(--te-primary);background:#0f766e0f;box-shadow:0 0 0 4px #0f766e1f}.te-editor .te-figure__alt-btn{position:absolute;top:10px;inset-inline-start:10px;z-index:2;max-width:calc(100% - 20px);height:28px;padding:0 10px;border:0;border-radius:8px;background:#0f172ad1;color:#fff;font:inherit;font-size:12px;line-height:1;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.te-editor .te-figure__alt-btn:hover{background:#0f172af2}.te-editor .te-figure img,.te-editor img{max-width:100%;height:auto;border-radius:8px;margin:0;display:block;cursor:pointer}.te-editor img.is-selected{outline:none}.te-swatch{width:20px;height:20px;border-radius:5px;border:1px solid rgba(15,23,42,.12);cursor:pointer;padding:0}.te-swatch--picker{position:relative;overflow:hidden;background:conic-gradient(red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.te-swatch--picker input{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer;border:0;padding:0;width:100%;height:100%}.te-editor-shell{position:relative;background:var(--te-bg)}.te-placeholder{position:absolute;top:16px;inset-inline:18px;color:#94a3b8;pointer-events:none;font-size:15px;line-height:1.9;text-align:start}.te-editor{outline:none;padding:16px 18px 28px;min-height:220px;line-height:1.9;font-size:15px;color:var(--te-text);word-break:break-word;overflow-wrap:anywhere;text-align:start}.te-credit{position:absolute;bottom:6px;inset-inline-end:10px;z-index:2;margin:0;padding:0;border:0;background:none;font-family:var(--te-font);font-size:10px;font-weight:400;line-height:1.2;letter-spacing:.01em;color:var(--te-muted);opacity:.38;text-decoration:none;white-space:nowrap;-webkit-user-select:none;user-select:none;cursor:pointer;transition:opacity .15s ease}.te-credit:hover,.te-credit:focus-visible{opacity:.72;outline:none}.te-root.is-source .te-credit{color:#94a3b8;opacity:.42}.te-root.is-source .te-credit:hover,.te-root.is-source .te-credit:focus-visible{opacity:.75}.te-root:not(.te-root--noscroll) .te-editor,.te-root:not(.te-root--noscroll) .te-source{max-height:70vh;max-height:70dvh;overflow-y:auto}.te-root:not(.te-root--noscroll) .te-source{resize:none}.te-editor:focus{background:#fff}.te-editor h1,.te-editor h2,.te-editor h3,.te-editor h4,.te-editor h5,.te-editor h6{margin:.85em 0 .45em;line-height:1.45;font-weight:700}.te-editor h1{font-size:1.75em}.te-editor h2{font-size:1.45em}.te-editor h3{font-size:1.25em}.te-editor h4{font-size:1.1em}.te-editor h5{font-size:1em}.te-editor h6{font-size:.9em}.te-source{display:block;width:100%;box-sizing:border-box;margin:0;padding:16px 18px 28px;border:0;outline:none;resize:vertical;background:#0f172a;color:#e2e8f0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.7;direction:ltr;text-align:left;-moz-tab-size:2;tab-size:2}.te-source:focus{box-shadow:inset 0 0 0 2px #2dd4bf}.te-color.is-disabled{opacity:.35;pointer-events:none}.te-select:disabled{opacity:.45;cursor:not-allowed}.te-editor p{margin:0 0 .75em}.te-editor ul,.te-editor ol{margin:0 0 .85em;padding-inline-start:1.5em}.te-editor li{margin:.2em 0}.te-editor blockquote{margin:.85em 0;padding:.55em 1em;border-inline-start:3px solid var(--te-primary);background:#f0fdfa;color:#334155;border-radius:0 8px 8px 0}.te-editor pre{margin:.85em 0;padding:.75em 1em;background:#f1f5f9;color:#0f172a;border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.9em;white-space:pre-wrap;overflow-x:auto}.te-editor a{color:#0f766e;text-decoration:underline;text-underline-offset:2px}.te-editor hr{border:0;border-top:1px solid var(--te-border-strong);margin:1.25em 0}.te-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:16px}.te-modal{width:min(420px,100%);background:#fff;border-radius:14px;box-shadow:0 20px 50px #0f172a38;overflow:hidden;font-family:var(--te-font);direction:inherit;text-align:start}.te-modal__header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--te-border)}.te-modal__header h3{margin:0;font-size:16px;font-weight:700}.te-modal__close{border:0;background:transparent;color:#64748b;cursor:pointer;width:32px;height:32px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center}.te-modal__close:hover{background:#f1f5f9;color:#0f172a}.te-modal__body{padding:16px}.te-modal__footer{display:flex;justify-content:flex-start;gap:8px;padding:12px 16px 16px;border-top:1px solid var(--te-border)}.te-form{display:flex;flex-direction:column;gap:12px}.te-field{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#334155}.te-field input[type=text],.te-field input[type=url],.te-field input[type=file]{height:40px;border:1px solid var(--te-border);border-radius:10px;padding:0 12px;font:inherit;color:var(--te-text);background:#fff}.te-field input[type=file]{padding:8px 12px;height:auto}.te-field input:focus{outline:2px solid #99f6e4;border-color:#2dd4bf}.te-hint{margin:0;font-size:12px;color:var(--te-muted)}.te-error{margin:0;font-size:13px;color:var(--te-danger)}.te-btn{height:38px;padding:0 14px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13px;cursor:pointer}.te-btn--ghost{background:#fff;border-color:var(--te-border);color:#334155}.te-btn--ghost:hover{background:#f8fafc}.te-btn--primary{background:var(--te-primary);color:#fff}.te-btn--primary:hover{background:#0d9488}.te-btn:disabled{opacity:.55;cursor:not-allowed}.te-tabs{display:flex;gap:6px;margin-bottom:14px}.te-tabs button{flex:1;height:36px;border:1px solid var(--te-border);border-radius:9px;background:#fff;color:#475569;font:inherit;font-size:13px;cursor:pointer}.te-tabs button.is-active{background:var(--te-primary-soft);border-color:#99f6e4;color:var(--te-primary);font-weight:600}@media(max-width:640px){.te-toolbar{padding:6px}.te-tool{width:32px;height:32px}.te-select{min-width:96px;font-size:12px}}
|