@omegagrid/markdown 0.10.1 → 0.10.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.
- package/package.json +6 -6
- package/dist/components/features/blockEdit.d.ts +0 -23
- package/dist/components/features/blockEdit.d.ts.map +0 -1
- package/dist/components/features/blockEdit.js +0 -38
- package/dist/components/features/blockEdit.js.map +0 -1
- package/dist/components/features/blockEditMenu.d.ts +0 -16
- package/dist/components/features/blockEditMenu.d.ts.map +0 -1
- package/dist/components/features/blockEditMenu.js +0 -25
- package/dist/components/features/blockEditMenu.js.map +0 -1
- package/dist/components/features/codeBlock.d.ts +0 -31
- package/dist/components/features/codeBlock.d.ts.map +0 -1
- package/dist/components/features/codeBlock.js +0 -1
- package/dist/components/features/codeBlock.js.map +0 -1
- package/dist/components/features/htmlBlock.d.ts +0 -39
- package/dist/components/features/htmlBlock.d.ts.map +0 -1
- package/dist/components/features/htmlBlock.js +0 -52
- package/dist/components/features/htmlBlock.js.map +0 -1
- package/dist/components/features/index.d.ts +0 -28
- package/dist/components/features/index.d.ts.map +0 -1
- package/dist/components/features/index.js +0 -1
- package/dist/components/features/index.js.map +0 -1
- package/dist/components/features/linkEdit/component.d.ts +0 -12
- package/dist/components/features/linkEdit/component.d.ts.map +0 -1
- package/dist/components/features/linkEdit/component.js +0 -46
- package/dist/components/features/linkEdit/component.js.map +0 -1
- package/dist/components/features/linkEdit/config.d.ts +0 -4
- package/dist/components/features/linkEdit/config.d.ts.map +0 -1
- package/dist/components/features/linkEdit/config.js +0 -1
- package/dist/components/features/linkEdit/config.js.map +0 -1
- package/dist/components/features/linkEdit/index.d.ts +0 -10
- package/dist/components/features/linkEdit/index.d.ts.map +0 -1
- package/dist/components/features/linkEdit/index.js +0 -1
- package/dist/components/features/linkEdit/index.js.map +0 -1
- package/dist/components/features/linkEdit/slices.d.ts +0 -20
- package/dist/components/features/linkEdit/slices.d.ts.map +0 -1
- package/dist/components/features/linkEdit/slices.js +0 -1
- package/dist/components/features/linkEdit/slices.js.map +0 -1
- package/dist/components/features/linkEdit/utils.d.ts +0 -14
- package/dist/components/features/linkEdit/utils.d.ts.map +0 -1
- package/dist/components/features/linkEdit/utils.js +0 -1
- package/dist/components/features/linkEdit/utils.js.map +0 -1
- package/dist/components/features/linkEdit/view.d.ts +0 -19
- package/dist/components/features/linkEdit/view.d.ts.map +0 -1
- package/dist/components/features/linkEdit/view.js +0 -1
- package/dist/components/features/linkEdit/view.js.map +0 -1
- package/dist/components/features/placeholder.d.ts +0 -13
- package/dist/components/features/placeholder.d.ts.map +0 -1
- package/dist/components/features/placeholder.js +0 -1
- package/dist/components/features/placeholder.js.map +0 -1
- package/dist/components/features/tocBlock.d.ts +0 -21
- package/dist/components/features/tocBlock.d.ts.map +0 -1
- package/dist/components/features/tocBlock.js +0 -46
- package/dist/components/features/tocBlock.js.map +0 -1
- package/dist/components/features/toolbar.d.ts +0 -24
- package/dist/components/features/toolbar.d.ts.map +0 -1
- package/dist/components/features/toolbar.js +0 -67
- package/dist/components/features/toolbar.js.map +0 -1
- package/dist/components/features/utils.d.ts +0 -12
- package/dist/components/features/utils.d.ts.map +0 -1
- package/dist/components/features/utils.js +0 -1
- package/dist/components/features/utils.js.map +0 -1
- package/dist/components/index.d.ts +0 -4
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/markdownEditor.d.ts +0 -36
- package/dist/components/markdownEditor.d.ts.map +0 -1
- package/dist/components/markdownEditor.js +0 -7
- package/dist/components/markdownEditor.js.map +0 -1
- package/dist/components/markdownEditor.style.d.ts +0 -2
- package/dist/components/markdownEditor.style.d.ts.map +0 -1
- package/dist/components/markdownEditor.style.js +0 -230
- package/dist/components/markdownEditor.style.js.map +0 -1
- package/dist/components/markdownView.d.ts +0 -5
- package/dist/components/markdownView.d.ts.map +0 -1
- package/dist/components/markdownView.js +0 -1
- package/dist/components/markdownView.js.map +0 -1
- package/dist/components/markdownView.style.d.ts +0 -2
- package/dist/components/markdownView.style.d.ts.map +0 -1
- package/dist/components/markdownView.style.js +0 -44
- package/dist/components/markdownView.style.js.map +0 -1
- package/dist/components/styles/block-edit.d.ts +0 -2
- package/dist/components/styles/block-edit.d.ts.map +0 -1
- package/dist/components/styles/block-edit.js +0 -132
- package/dist/components/styles/block-edit.js.map +0 -1
- package/dist/components/styles/cursor.d.ts +0 -2
- package/dist/components/styles/cursor.d.ts.map +0 -1
- package/dist/components/styles/cursor.js +0 -12
- package/dist/components/styles/cursor.js.map +0 -1
- package/dist/components/styles/emoji.d.ts +0 -2
- package/dist/components/styles/emoji.d.ts.map +0 -1
- package/dist/components/styles/emoji.js +0 -14
- package/dist/components/styles/emoji.js.map +0 -1
- package/dist/components/styles/image-block.d.ts +0 -2
- package/dist/components/styles/image-block.d.ts.map +0 -1
- package/dist/components/styles/image-block.js +0 -395
- package/dist/components/styles/image-block.js.map +0 -1
- package/dist/components/styles/index.d.ts +0 -3
- package/dist/components/styles/index.d.ts.map +0 -1
- package/dist/components/styles/index.js +0 -1
- package/dist/components/styles/index.js.map +0 -1
- package/dist/components/styles/link-tooltip.d.ts +0 -2
- package/dist/components/styles/link-tooltip.d.ts.map +0 -1
- package/dist/components/styles/link-tooltip.js +0 -110
- package/dist/components/styles/link-tooltip.js.map +0 -1
- package/dist/components/styles/list-item.d.ts +0 -2
- package/dist/components/styles/list-item.d.ts.map +0 -1
- package/dist/components/styles/list-item.js +0 -40
- package/dist/components/styles/list-item.js.map +0 -1
- package/dist/components/styles/placeholder.d.ts +0 -2
- package/dist/components/styles/placeholder.d.ts.map +0 -1
- package/dist/components/styles/placeholder.js +0 -9
- package/dist/components/styles/placeholder.js.map +0 -1
- package/dist/components/styles/prosemirror.d.ts +0 -2
- package/dist/components/styles/prosemirror.d.ts.map +0 -1
- package/dist/components/styles/prosemirror.js +0 -56
- package/dist/components/styles/prosemirror.js.map +0 -1
- package/dist/components/styles/table.d.ts +0 -2
- package/dist/components/styles/table.d.ts.map +0 -1
- package/dist/components/styles/table.js +0 -283
- package/dist/components/styles/table.js.map +0 -1
- package/dist/constants.d.ts +0 -47
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/loader.d.ts +0 -16
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -1
- package/dist/loader.js.map +0 -1
- package/dist/utils.d.ts +0 -11
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
var _MarkdownEditor_content,_MarkdownEditor_mouseIn,_MarkdownEditor_editor,__decorate=this&&this.__decorate||function(t,e,r,o){var i,d=arguments.length,n=d<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(n=(d<3?i(n):d>3?i(e,r,n):i(e,r))||n);return d>3&&n&&Object.defineProperty(e,r,n),n},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,r,o){if("a"===r&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?o:"a"===r?o.call(t):o?o.value:e.get(t)},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,r):i?i.value=r:e.set(t,r),r};import{dom,events}from"@omegagrid/core";import{LitElement,html}from"lit";import{customElement,query,property}from"lit/decorators.js";import{style}from"./markdownEditor.style";import styles from"./styles";import{createEditor}from"../utils";export class MarkdownLinkEvent extends Event{constructor(t){super("markdown.link",{bubbles:!0,composed:!0,cancelable:!0}),Object.assign(this,t)}}let MarkdownEditor=class extends LitElement{get content(){return __classPrivateFieldGet(this,_MarkdownEditor_content,"f")}set content(t){__classPrivateFieldSet(this,_MarkdownEditor_content,t,"f"),__classPrivateFieldGet(this,_MarkdownEditor_editor,"f")?.destroy(),__classPrivateFieldSet(this,_MarkdownEditor_editor,null,"f"),this.requestUpdate()}get milkdownElm(){return this.container.firstElementChild}get editor(){return __classPrivateFieldGet(this,_MarkdownEditor_editor,"f")}constructor(){super(),_MarkdownEditor_content.set(this,void 0),this.maxContentWidth=800,this.contentAlignment="left",this.readOnly=!1,_MarkdownEditor_mouseIn.set(this,!1),_MarkdownEditor_editor.set(this,void 0),this._onChange=(t,e)=>{__classPrivateFieldSet(this,_MarkdownEditor_content,t,"f"),this.dispatchEvent(new events.ChangeEvent({value:t,oldValue:e}))},this.render=()=>html`
|
|
2
|
-
<style>
|
|
3
|
-
.ProseMirror.editor { max-width: ${this.maxContentWidth}px; }
|
|
4
|
-
</style>
|
|
5
|
-
<div id="container" spellcheck="false"></div>
|
|
6
|
-
<og-slider direction="vertical" hidden></og-slider>
|
|
7
|
-
`,dom.on(this,"click","a",((t,e)=>{if(!this.dispatchEvent(new MarkdownLinkEvent({href:e.getAttribute("href"),a:e,origEvent:t})))return void t.preventDefault();const r=e.getAttribute("href");r&&r.startsWith("#")&&(t.preventDefault(),this.scrollToSelector(r))}))}scrollToSelector(t){const e=this.milkdownElm.querySelector(t);e&&(this.milkdownElm.scrollTop=e.offsetTop,this.slider.updatePosition())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}updateWidth(){const t=Math.min(this.maxContentWidth,this.clientWidth);this.milkdownElm.style.width=`${t}px`}firstUpdated(){this.slider.hide(),this.addEventListener("mouseenter",(()=>{__classPrivateFieldSet(this,_MarkdownEditor_mouseIn,!0,"f"),this.updateSlider()})),this.addEventListener("mouseleave",(()=>{__classPrivateFieldSet(this,_MarkdownEditor_mouseIn,!1,"f"),this.updateSlider()})),this.slider.addEventListener("slideEnd",(()=>{this.updateSlider()}))}async updated(){__classPrivateFieldGet(this,_MarkdownEditor_editor,"f")||(__classPrivateFieldSet(this,_MarkdownEditor_editor,await createEditor({container:this.container,content:this.content,readOnly:this.readOnly,onUpload:this.onUpload,onChange:this._onChange,modifyImageUrl:this.modifyImageUrl}),"f"),this.slider.attachElement(this.milkdownElm))}updateSlider(){this.slider&&this.milkdownElm&&(this.milkdownElm.scrollHeight>this.milkdownElm.clientHeight&&(__classPrivateFieldGet(this,_MarkdownEditor_mouseIn,"f")||this.slider.sliding)?this.slider.show():this.slider.hide())}disconnectedCallback(){super.disconnectedCallback(),__classPrivateFieldGet(this,_MarkdownEditor_editor,"f")?.destroy(),__classPrivateFieldSet(this,_MarkdownEditor_editor,null,"f"),dom.empty(this.container)}layout(){}};_MarkdownEditor_content=new WeakMap,_MarkdownEditor_mouseIn=new WeakMap,_MarkdownEditor_editor=new WeakMap,MarkdownEditor.styles=[style,...styles],__decorate([property({type:String})],MarkdownEditor.prototype,"content",null),__decorate([property({type:Number})],MarkdownEditor.prototype,"maxContentWidth",void 0),__decorate([property({type:String,reflect:!0})],MarkdownEditor.prototype,"contentAlignment",void 0),__decorate([property({type:Boolean,reflect:!0})],MarkdownEditor.prototype,"readOnly",void 0),__decorate([query("#container")],MarkdownEditor.prototype,"container",void 0),__decorate([query("og-slider")],MarkdownEditor.prototype,"slider",void 0),__decorate([property({type:Object})],MarkdownEditor.prototype,"onUpload",void 0),__decorate([property({type:Object})],MarkdownEditor.prototype,"modifyImageUrl",void 0),MarkdownEditor=__decorate([customElement("og-markdown-editor")],MarkdownEditor);export{MarkdownEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownEditor.js","sourceRoot":"","sources":["../../src/components/markdownEditor.ts"],"names":[],"mappings":";;;;;;;;;;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;gDACxB;AAGjB;IADC,KAAK,CAAC,YAAY,CAAC;iDACM;AAG1B;IADC,KAAK,CAAC,WAAW,CAAC;8CACJ;AAKf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDACiB;AAG1C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;sDACgC;AAnC7C,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CAgJ1B","sourcesContent":["import { dom, events, HorizontalPosition, Layout, Slider } from '@omegagrid/core';\nimport { LitElement, html } from 'lit';\nimport { customElement, query, property } from 'lit/decorators.js';\nimport { style } from './markdownEditor.style';\nimport styles from './styles';\nimport { createEditor } from '../utils';\nimport type * as milkdown from '@omegagrid/milkdown-kit';\n\nexport class MarkdownLinkEvent extends Event {\n\treadonly href: string;\n\treadonly a: HTMLAnchorElement;\n\treadonly origEvent: PointerEvent;\n\n\tconstructor(args: Partial<MarkdownLinkEvent>) {\n\t\tsuper(`markdown.link`, {bubbles: true, composed: true, cancelable: true});\n\t\tObject.assign(this, args);\n\t}\n}\n\n@customElement('og-markdown-editor')\nexport class MarkdownEditor extends LitElement implements Layout {\n\n\tstatic styles = [style, ...styles];\n\n\t#content: string\n\t@property({type: String})\n\tget content() { return this.#content }\n\tset content(val: string) {\n\t\tthis.#content = val;\n\t\tthis.#editor?.destroy();\n\t\tthis.#editor = null;\n\t\tthis.requestUpdate();\n\t}\n\n\t@property({type: Number})\n\tmaxContentWidth = 800;\n\n\t@property({type: String, reflect: true})\n\tcontentAlignment: HorizontalPosition = 'left';\n\n\t@property({type: Boolean, reflect: true})\n\treadOnly = false;\n\n\t@query('#container')\n\tcontainer: HTMLDivElement;\n\n\t@query('og-slider')\n\tslider: Slider;\n\n\t#mouseIn = false;\n\n\t@property({type: Object})\n\tonUpload: (file: File) => Promise<string>;\n\n\t@property({type: Object})\n\tmodifyImageUrl: (file: string) => Promise<string>|string;\n\n\t#editor: milkdown.core.Editor;\n\n\tget milkdownElm () { return this.container.firstElementChild as HTMLElement }\n\tget editor() { return this.#editor }\n\n\tconstructor() {\n\t\tsuper();\n\t\tdom.on(this, 'click', 'a', (e: PointerEvent, a) => {\n\t\t\tconst canceled = !this.dispatchEvent(new MarkdownLinkEvent({\n\t\t\t\thref: a.getAttribute('href'), \n\t\t\t\ta: a as HTMLAnchorElement,\n\t\t\t\torigEvent: e\n\t\t\t}));\n\n\t\t\tif (canceled) {\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst href = a.getAttribute('href');\n\t\t\tif (href && href.startsWith('#')) {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.scrollToSelector(href);\n\t\t\t}\n\t\t});\n\t}\n\n\tscrollToSelector(selector: string) {\n\t\tconst elm = this.milkdownElm.querySelector(selector) as HTMLElement;\n\t\tif (!elm) return;\n\t\tthis.milkdownElm.scrollTop = elm.offsetTop;\n\t\tthis.slider.updatePosition();\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.requestUpdate();\n\t}\n\n\tupdateWidth() {\n\t\tconst width = Math.min(this.maxContentWidth, this.clientWidth);\n\t\tthis.milkdownElm.style.width = `${width}px`;\n\t}\n\n\t_onChange = (markdown: string, prevMarkdown: string) => {\n\t\tthis.#content = markdown;\n\t\tthis.dispatchEvent(new events.ChangeEvent({value: markdown, oldValue: prevMarkdown}));\n\t}\n\n\tfirstUpdated() {\n\t\tthis.slider.hide();\n\n\t\tthis.addEventListener('mouseenter', () => {\n\t\t\tthis.#mouseIn = true;\n\t\t\tthis.updateSlider();\n\t\t});\n\n\t\tthis.addEventListener('mouseleave', () => {\n\t\t\tthis.#mouseIn = false;\n\t\t\tthis.updateSlider();\n\t\t});\n\n\t\tthis.slider.addEventListener('slideEnd', () => {\n\t\t\tthis.updateSlider();\n\t\t});\n\t}\n\n\tasync updated() {\n\t\tif (this.#editor) return;\n\t\tthis.#editor = await createEditor({\n\t\t\tcontainer: this.container,\n\t\t\tcontent: this.content,\n\t\t\treadOnly: this.readOnly,\n\t\t\tonUpload: this.onUpload,\n\t\t\tonChange: this._onChange,\n\t\t\tmodifyImageUrl: this.modifyImageUrl\n\t\t});\n\t\tthis.slider.attachElement(this.milkdownElm);\n\t}\n\n\tupdateSlider() {\n\t\tif (!this.slider || !this.milkdownElm) return;\n\t\tconst needsScroll = this.milkdownElm.scrollHeight > this.milkdownElm.clientHeight;\n\t\tif (needsScroll && (this.#mouseIn || this.slider.sliding)) {\n\t\t\tthis.slider.show();\n\t\t} else {\n\t\t\tthis.slider.hide();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.#editor?.destroy();\n\t\tthis.#editor = null;\n\t\tdom.empty(this.container);\n\t}\n\n\trender = () => html`\n\t\t<style>\n\t\t\t.ProseMirror.editor { max-width: ${this.maxContentWidth}px; }\n\t\t</style>\n\t\t<div id=\"container\" spellcheck=\"false\"></div>\n\t\t<og-slider direction=\"vertical\" hidden></og-slider>\n\t`;\n\n\tlayout() { }\n\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownEditor.style.d.ts","sourceRoot":"","sources":["../../src/components/markdownEditor.style.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,KAAK,yBAqOjB,CAAC"}
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import{css}from"lit";export const style=css`
|
|
2
|
-
* {
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:host {
|
|
7
|
-
display: block;
|
|
8
|
-
position: relative;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
color: var(--og-text-color);
|
|
11
|
-
font-size: var(--og-font-size);
|
|
12
|
-
user-select: text;
|
|
13
|
-
background-color: var(--og-background-color);
|
|
14
|
-
|
|
15
|
-
--markdown-color-selected: var(--og-accent-color);
|
|
16
|
-
--markdown-color-outline: var(--og-accent-color);
|
|
17
|
-
--markdown-color-surface: var(--og-background-color);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:host([readonly]) og-markdown-block-edit,
|
|
21
|
-
:host([readonly]) .operation-item
|
|
22
|
-
:host([readonly]) .image-resize-handle {
|
|
23
|
-
display: none !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
og-code-block, og-code-view {
|
|
27
|
-
border: 1px solid var(--og-accent-color);
|
|
28
|
-
white-space: normal;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.md-editor-drop-cursor {
|
|
32
|
-
background-color: var(--og-accent-color) !important;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#container {
|
|
36
|
-
height: 100%;
|
|
37
|
-
position: relative;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.milkdown {
|
|
42
|
-
height: 100%;
|
|
43
|
-
position: relative;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
flex-direction: row;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
og-markdown-html-block {
|
|
49
|
-
border-width: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
div[contenteditable="true"] og-markdown-html-block {
|
|
53
|
-
border-width: 1px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host([contentAlignment='center']) .ProseMirror {
|
|
57
|
-
margin: 0 auto;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
:host([contentAlignment='left']) .ProseMirror {
|
|
61
|
-
margin: 0 auto 0 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:host([contentAlignment='right']) .ProseMirror {
|
|
65
|
-
margin: 0 0 0 auto;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
button, input {
|
|
69
|
-
border: none;
|
|
70
|
-
background: none;
|
|
71
|
-
box-shadow: none;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
button:focus, input:focus {
|
|
75
|
-
outline: none;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
:focus-visible {
|
|
79
|
-
outline: none;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ProseMirror-focused {
|
|
83
|
-
outline: none;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.ProseMirror {
|
|
87
|
-
padding: 0px 60px 60px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.ProseMirror *::selection {
|
|
91
|
-
background: var(--markdown-color-selected);
|
|
92
|
-
color: var(--og-text-color-2);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
li.ProseMirror-selectednode {
|
|
96
|
-
background: var(--markdown-color-selected);
|
|
97
|
-
outline: none;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
li.ProseMirror-selectednode::selection {
|
|
101
|
-
background: transparent;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
li.ProseMirror-selectednode:after {
|
|
105
|
-
all: unset;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.ProseMirror-selectednode {
|
|
109
|
-
background: var(--markdown-color-selected);
|
|
110
|
-
outline: none;
|
|
111
|
-
background: color-mix(in srgb, var(--markdown-color-selected), transparent 60%);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.ProseMirror-selectednode::selection {
|
|
115
|
-
background: transparent;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.ProseMirror[data-dragging='true'] .ProseMirror-selectednode,
|
|
119
|
-
.ProseMirror[data-dragging='true']::selection,
|
|
120
|
-
.ProseMirror[data-dragging='true'] *::selection {
|
|
121
|
-
background: transparent;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.ProseMirror[data-dragging='true'] input::selection {
|
|
125
|
-
background: var(--markdown-color-selected);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
img {
|
|
129
|
-
vertical-align: bottom;
|
|
130
|
-
max-width: 100%;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
img.ProseMirror-selectednode {
|
|
134
|
-
background: none;
|
|
135
|
-
outline: 2px solid var(--markdown-color-primary);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
h1 {
|
|
139
|
-
font-size: 1.5em;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
h2 {
|
|
143
|
-
font-size: 1.3em;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
h3 {
|
|
147
|
-
font-size: 1.1em;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
h4 {
|
|
151
|
-
font-size: 1em;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
a {
|
|
155
|
-
color: #688DC8;
|
|
156
|
-
text-decoration: underline;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
p {
|
|
160
|
-
font-size: var(--og-font-size);
|
|
161
|
-
margin-block-start: 0.2em;
|
|
162
|
-
margin-block-end: 0.2em;
|
|
163
|
-
padding: 0px 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
code {
|
|
167
|
-
padding: 2px 4px;
|
|
168
|
-
font-size: 90%;
|
|
169
|
-
color: #c7254e;
|
|
170
|
-
background-color: var(--og-background-color-3);
|
|
171
|
-
border-radius: 0;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
pre {
|
|
175
|
-
background: color-mix(in srgb, var(--markdown-color-inline-area), transparent 40%);
|
|
176
|
-
padding: 10px;
|
|
177
|
-
border-radius: 4px;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
pre code {
|
|
181
|
-
padding: 0;
|
|
182
|
-
background: transparent;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
blockquote {
|
|
186
|
-
position: relative;
|
|
187
|
-
padding-left: 40px;
|
|
188
|
-
padding-top: 0;
|
|
189
|
-
padding-bottom: 0;
|
|
190
|
-
box-sizing: content-box;
|
|
191
|
-
margin: 4px 0;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
blockquote::before {
|
|
195
|
-
content: '';
|
|
196
|
-
width: 4px;
|
|
197
|
-
left: 0;
|
|
198
|
-
top: 4px;
|
|
199
|
-
bottom: 4px;
|
|
200
|
-
position: absolute;
|
|
201
|
-
background: var(--markdown-color-selected);
|
|
202
|
-
border-radius: 100px;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
hr {
|
|
206
|
-
border: none;
|
|
207
|
-
background-color: color-mix(in srgb, var(--markdown-color-outline), transparent 80%);
|
|
208
|
-
background-clip: content-box;
|
|
209
|
-
padding: 6px 0;
|
|
210
|
-
height: 13px;
|
|
211
|
-
position: relative;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
hr.ProseMirror-selectednode {
|
|
215
|
-
outline: none;
|
|
216
|
-
background-color: color-mix(in srgb, var(--markdown-color-outline), transparent 20%);
|
|
217
|
-
background-clip: content-box;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
hr.ProseMirror-selectednode::before {
|
|
221
|
-
content: '';
|
|
222
|
-
position: absolute;
|
|
223
|
-
left: 0;
|
|
224
|
-
top: 0;
|
|
225
|
-
bottom: 0;
|
|
226
|
-
right: 0;
|
|
227
|
-
background-color: color-mix(in srgb, var(--markdown-color-outline), transparent 80%);
|
|
228
|
-
pointer-events: none;
|
|
229
|
-
}
|
|
230
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownEditor.style.js","sourceRoot":"","sources":["../../src/components/markdownEditor.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,0BAA0B;AAC1B,iCAAiC;AACjC,8BAA8B;AAC9B,4BAA4B;AAC5B,2BAA2B;AAC3B,wBAAwB;AACxB,+BAA+B;AAC/B,+BAA+B;AAC/B,uBAAuB;AACvB,yBAAyB;AACzB,sBAAsB;AACtB,8BAA8B;AAC9B,2BAA2B;AAC3B,2BAA2B;AAC3B,8BAA8B;AAC9B,2BAA2B;AAC3B,gCAAgC;AAChC,6BAA6B;AAG7B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqOvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\n// --markdown-font-default\n// --markdown-color-on-background\n// --markdown-color-background\n// --markdown-color-selected\n// --markdown-color-primary\n// --markdown-font-title\n// --markdown-color-inline-code\n// --markdown-color-inline-area\n// --markdown-font-code\n// --markdown-color-hover\n// --markdown-shadow-1\n// --markdown-color-on-surface\n// --markdown-color-surface\n// --markdown-color-outline\n// --markdown-color-on-inverse\n// --markdown-color-inverse\n// --markdown-color-on-secondary\n// --markdown-color-secondary\n\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t\tcolor: var(--og-text-color);\n\t\tfont-size: var(--og-font-size);\n\t\tuser-select: text;\n\t\tbackground-color: var(--og-background-color);\n\n\t\t--markdown-color-selected: var(--og-accent-color);\n\t\t--markdown-color-outline: var(--og-accent-color);\n\t\t--markdown-color-surface: var(--og-background-color);\n\t}\n\n\t:host([readonly]) og-markdown-block-edit, \n\t:host([readonly]) .operation-item \n\t:host([readonly]) .image-resize-handle {\n\t\tdisplay: none !important;\n\t}\n\n\tog-code-block, og-code-view {\n\t\tborder: 1px solid var(--og-accent-color);\n\t\twhite-space: normal;\n\t}\n\n\t.md-editor-drop-cursor {\n\t\tbackground-color: var(--og-accent-color) !important;\n\t}\n\n\t#container {\n\t\theight: 100%;\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t}\n\n\t.milkdown {\n\t\theight: 100%;\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t\tflex-direction: row;\n\t}\n\n\tog-markdown-html-block {\n\t\tborder-width: 0;\n\t}\n\n\tdiv[contenteditable=\"true\"] og-markdown-html-block {\n\t\tborder-width: 1px;\n\t}\n\n\t:host([contentAlignment='center']) .ProseMirror {\n\t\tmargin: 0 auto;\n\t}\n\n\t:host([contentAlignment='left']) .ProseMirror {\n\t\tmargin: 0 auto 0 0;\n\t}\n\n\t:host([contentAlignment='right']) .ProseMirror {\n\t\tmargin: 0 0 0 auto;\n\t}\n\n\tbutton, input {\n\t\tborder: none;\n\t\tbackground: none;\n\t\tbox-shadow: none;\n\t}\n\t\n\tbutton:focus, input:focus {\n\t\toutline: none;\n\t}\n\t\t\n\t:focus-visible {\n\t\toutline: none;\n\t}\n\t\t\t\n\t.ProseMirror-focused {\n\t\toutline: none;\n\t}\n\t\t\n\t.ProseMirror {\n\t\tpadding: 0px 60px 60px;\n\t}\n\t\t\n\t.ProseMirror *::selection {\n\t\tbackground: var(--markdown-color-selected);\n\t\tcolor: var(--og-text-color-2);\n\t}\n\t\t\n\tli.ProseMirror-selectednode {\n\t\tbackground: var(--markdown-color-selected);\n\t\toutline: none;\n\t}\n\t\n\tli.ProseMirror-selectednode::selection {\n\t\tbackground: transparent;\n\t}\n\t\n\tli.ProseMirror-selectednode:after {\n\t\tall: unset;\n\t}\n\t\t\n\t.ProseMirror-selectednode {\n\t\tbackground: var(--markdown-color-selected);\n\t\toutline: none;\n\t\tbackground: color-mix(in srgb, var(--markdown-color-selected), transparent 60%);\n\t}\n\t\n\t.ProseMirror-selectednode::selection {\n\t\tbackground: transparent;\n\t}\n\t\t\n\t.ProseMirror[data-dragging='true'] .ProseMirror-selectednode,\n\t.ProseMirror[data-dragging='true']::selection,\n\t.ProseMirror[data-dragging='true'] *::selection {\n\t\tbackground: transparent;\n\t}\n\t\t\n\t.ProseMirror[data-dragging='true'] input::selection {\n\t\tbackground: var(--markdown-color-selected);\n\t}\n\t\t\n\timg {\n\t\tvertical-align: bottom;\n\t\tmax-width: 100%;\n\t}\n\t\t\n\timg.ProseMirror-selectednode {\n\t\tbackground: none;\n\t\toutline: 2px solid var(--markdown-color-primary);\n\t}\n\t\t\n\th1 {\n\t\tfont-size: 1.5em;\n\t}\n\n\th2 {\n\t\tfont-size: 1.3em;\n\t}\n\n\th3 {\n\t\tfont-size: 1.1em;\n\t}\n\n\th4 {\n\t\tfont-size: 1em;\n\t}\n\n\ta {\n\t\tcolor: #688DC8;\n\t\ttext-decoration: underline;\n\t}\n\t\t\n\tp {\n\t\tfont-size: var(--og-font-size);\n\t\tmargin-block-start: 0.2em;\n\t\tmargin-block-end: 0.2em;\n\t\tpadding: 0px 0;\n\t}\n\n\tcode {\n\t\tpadding: 2px 4px;\n\t\tfont-size: 90%;\n\t\tcolor: #c7254e;\n\t\tbackground-color: var(--og-background-color-3);\n\t\tborder-radius: 0;\n\t}\n\t\t\n\tpre {\n\t\tbackground: color-mix(in srgb, var(--markdown-color-inline-area), transparent 40%);\n\t\tpadding: 10px;\n\t\tborder-radius: 4px;\n\t}\n\t\n\tpre code {\n\t\tpadding: 0;\n\t\tbackground: transparent;\n\t}\n\t\t\n\tblockquote {\n\t\tposition: relative;\n\t\tpadding-left: 40px;\n\t\tpadding-top: 0;\n\t\tpadding-bottom: 0;\n\t\tbox-sizing: content-box;\n\t\tmargin: 4px 0;\n\t}\n\t\n\tblockquote::before {\n\t\tcontent: '';\n\t\twidth: 4px;\n\t\tleft: 0;\n\t\ttop: 4px;\n\t\tbottom: 4px;\n\t\tposition: absolute;\n\t\tbackground: var(--markdown-color-selected);\n\t\tborder-radius: 100px;\n\t}\n\t\t\n\thr {\n\t\tborder: none;\n\t\tbackground-color: color-mix(in srgb, var(--markdown-color-outline), transparent 80%);\n\t\tbackground-clip: content-box;\n\t\tpadding: 6px 0;\n\t\theight: 13px;\n\t\tposition: relative;\n\t}\n\t\n\thr.ProseMirror-selectednode {\n\t\toutline: none;\n\t\tbackground-color: color-mix(in srgb, var(--markdown-color-outline), transparent 20%);\n\t\tbackground-clip: content-box;\n\t}\n\t\n\thr.ProseMirror-selectednode::before {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tright: 0;\n\t\tbackground-color: color-mix(in srgb, var(--markdown-color-outline), transparent 80%);\n\t\tpointer-events: none;\n\t}\n`;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownView.d.ts","sourceRoot":"","sources":["../../src/components/markdownView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBACa,YAAa,SAAQ,cAAc;;CAO/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,r,o){var n,c=arguments.length,d=c<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(d=(c<3?n(d):c>3?n(t,r,d):n(t,r))||d);return c>3&&d&&Object.defineProperty(t,r,d),d};import{customElement}from"lit/decorators.js";import{MarkdownEditor}from"./markdownEditor";let MarkdownView=class extends MarkdownEditor{constructor(){super(),this.readOnly=!0}};MarkdownView=__decorate([customElement("og-markdown-view")],MarkdownView);export{MarkdownView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownView.js","sourceRoot":"","sources":["../../src/components/markdownView.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG3C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,cAAc;IAE/C;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtB,CAAC;CAED,CAAA;AAPY,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CAOxB","sourcesContent":["import { customElement } from 'lit/decorators.js';\nimport { MarkdownEditor } from './markdownEditor';\n\n@customElement('og-markdown-view')\nexport class MarkdownView extends MarkdownEditor {\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.readOnly = true;\n\t}\n\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownView.style.d.ts","sourceRoot":"","sources":["../../src/components/markdownView.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBA2CjB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import{css}from"lit";export const style=css`
|
|
2
|
-
* {
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:host {
|
|
7
|
-
display: block;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
user-select: text;
|
|
10
|
-
color: var(--og-text-color);
|
|
11
|
-
font-size: var(--og-font-size);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
og-container {
|
|
15
|
-
height: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
h1 {
|
|
19
|
-
font-size: 1.5em;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
h2 {
|
|
23
|
-
font-size: 1.3em;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
h3 {
|
|
27
|
-
font-size: 1.1em;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
h4 {
|
|
31
|
-
font-size: 1em;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
a {
|
|
35
|
-
color: #688DC8;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
og-highlighter {
|
|
39
|
-
border: 1px solid var(--og-border-color);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdownView.style.js","sourceRoot":"","sources":["../../src/components/markdownView.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t:host {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\tuser-select: text;\n\t\tcolor: var(--og-text-color);\n\t\tfont-size: var(--og-font-size);\n\t}\n\n\tog-container {\n\t\theight: 100%;\n\t}\n\n\th1 {\n\t\tfont-size: 1.5em;\n\t}\n\n\th2 {\n\t\tfont-size: 1.3em;\n\t}\n\n\th3 {\n\t\tfont-size: 1.1em;\n\t}\n\n\th4 {\n\t\tfont-size: 1em;\n\t}\n\n\ta {\n\t\tcolor: #688DC8;\n\t}\n\n\tog-highlighter {\n\t\tborder: 1px solid var(--og-border-color);\n\t}\n\n\n\n`;"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-edit.d.ts","sourceRoot":"","sources":["../../../src/components/styles/block-edit.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAmIjB,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import{css}from"lit";export const style=css`
|
|
2
|
-
milkdown-block-handle {
|
|
3
|
-
transition: all 0.2s;
|
|
4
|
-
position: absolute;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-items: center;
|
|
9
|
-
gap: 2px;
|
|
10
|
-
}
|
|
11
|
-
milkdown-block-handle[data-show='false'] {
|
|
12
|
-
opacity: 0;
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.operation-item {
|
|
17
|
-
border-radius: 4px;
|
|
18
|
-
width: 32px;
|
|
19
|
-
height: 32px;
|
|
20
|
-
padding: 4px;
|
|
21
|
-
}
|
|
22
|
-
.operation-item svg {
|
|
23
|
-
width: 24px;
|
|
24
|
-
height: 24px;
|
|
25
|
-
fill: var(--crepe-color-outline);
|
|
26
|
-
}
|
|
27
|
-
.operation-item:hover {
|
|
28
|
-
background: var(--crepe-color-hover);
|
|
29
|
-
}
|
|
30
|
-
.operation-item.active {
|
|
31
|
-
background: var(--crepe-color-selected);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
milkdown-slash-menu {
|
|
35
|
-
position: absolute;
|
|
36
|
-
display: block;
|
|
37
|
-
font-family: var(--crepe-font-default);
|
|
38
|
-
color: var(--crepe-color-on-surface);
|
|
39
|
-
background: var(--crepe-color-surface);
|
|
40
|
-
border-radius: 12px;
|
|
41
|
-
box-shadow: var(--crepe-shadow-1);
|
|
42
|
-
}
|
|
43
|
-
milkdown-slash-menu[data-show='false'] {
|
|
44
|
-
display: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
milkdown-slash-menu ul {
|
|
48
|
-
list-style-type: none;
|
|
49
|
-
}
|
|
50
|
-
milkdown-slash-menu ul li {
|
|
51
|
-
cursor: pointer;
|
|
52
|
-
border-radius: 8px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.tab-group {
|
|
56
|
-
border-bottom: 1px solid color-mix(in srgb, var(--crepe-color-outline), transparent 80%);
|
|
57
|
-
padding: 12px 12px 0;
|
|
58
|
-
}
|
|
59
|
-
.tab-group ul {
|
|
60
|
-
padding: 8px 10px;
|
|
61
|
-
display: flex;
|
|
62
|
-
gap: 10px;
|
|
63
|
-
flex-wrap: nowrap;
|
|
64
|
-
}
|
|
65
|
-
.tab-group ul li {
|
|
66
|
-
padding: 6px 10px;
|
|
67
|
-
font-size: 14px;
|
|
68
|
-
font-style: normal;
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
line-height: 20px;
|
|
71
|
-
}
|
|
72
|
-
.tab-group ul li:hover {
|
|
73
|
-
background: var(--crepe-color-hover);
|
|
74
|
-
}
|
|
75
|
-
.tab-group ul li.selected {
|
|
76
|
-
background: var(--crepe-color-selected);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.menu-groups {
|
|
80
|
-
padding: 0 12px 12px;
|
|
81
|
-
max-height: 420px;
|
|
82
|
-
overflow: auto;
|
|
83
|
-
overscroll-behavior: contain;
|
|
84
|
-
scroll-behavior: smooth;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.menu-group h6 {
|
|
88
|
-
font-size: 14px;
|
|
89
|
-
font-style: normal;
|
|
90
|
-
font-weight: 600;
|
|
91
|
-
line-height: 20px;
|
|
92
|
-
padding: 14px 10px;
|
|
93
|
-
text-transform: uppercase;
|
|
94
|
-
color: color-mix(in srgb, var(--crepe-color-on-surface), transparent 40%);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.menu-group li {
|
|
98
|
-
min-width: 220px;
|
|
99
|
-
display: flex;
|
|
100
|
-
justify-content: flex-start;
|
|
101
|
-
align-items: center;
|
|
102
|
-
gap: 16px;
|
|
103
|
-
padding: 14px 10px;
|
|
104
|
-
}
|
|
105
|
-
.menu-group li.hover {
|
|
106
|
-
background: var(--crepe-color-hover);
|
|
107
|
-
}
|
|
108
|
-
.menu-group li.active {
|
|
109
|
-
background: var(--crepe-color-selected);
|
|
110
|
-
}
|
|
111
|
-
.menu-group li > svg {
|
|
112
|
-
width: 24px;
|
|
113
|
-
height: 24px;
|
|
114
|
-
color: var(--crepe-color-outline);
|
|
115
|
-
fill: var(--crepe-color-outline);
|
|
116
|
-
}
|
|
117
|
-
.menu-group li > span {
|
|
118
|
-
font-size: 14px;
|
|
119
|
-
font-style: normal;
|
|
120
|
-
font-weight: 600;
|
|
121
|
-
line-height: 20px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.menu-group + .menu-group::before {
|
|
125
|
-
content: '';
|
|
126
|
-
display: block;
|
|
127
|
-
height: 1px;
|
|
128
|
-
background: color-mix(in srgb, var(--crepe-color-outline), transparent 80%);
|
|
129
|
-
margin: 0 10px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-edit.js","sourceRoot":"","sources":["../../../src/components/styles/block-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\nmilkdown-block-handle {\n\ttransition: all 0.2s;\n\tposition: absolute;\n\tcursor: pointer;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tgap: 2px;\n }\n milkdown-block-handle[data-show='false'] {\n\topacity: 0;\n\tpointer-events: none;\n }\n \n .operation-item {\n\tborder-radius: 4px;\n\twidth: 32px;\n\theight: 32px;\n\tpadding: 4px;\n }\n .operation-item svg {\n\twidth: 24px;\n\theight: 24px;\n\tfill: var(--crepe-color-outline);\n }\n .operation-item:hover {\n\tbackground: var(--crepe-color-hover);\n }\n .operation-item.active {\n\tbackground: var(--crepe-color-selected);\n }\n \n milkdown-slash-menu {\n\tposition: absolute;\n\tdisplay: block;\n\tfont-family: var(--crepe-font-default);\n\tcolor: var(--crepe-color-on-surface);\n\tbackground: var(--crepe-color-surface);\n\tborder-radius: 12px;\n\tbox-shadow: var(--crepe-shadow-1);\n }\n milkdown-slash-menu[data-show='false'] {\n\tdisplay: none;\n }\n \n milkdown-slash-menu ul {\n\tlist-style-type: none;\n }\n milkdown-slash-menu ul li {\n\tcursor: pointer;\n\tborder-radius: 8px;\n }\n \n .tab-group {\n\tborder-bottom: 1px solid color-mix(in srgb, var(--crepe-color-outline), transparent 80%);\n\tpadding: 12px 12px 0;\n }\n .tab-group ul {\n\tpadding: 8px 10px;\n\tdisplay: flex;\n\tgap: 10px;\n\tflex-wrap: nowrap;\n }\n .tab-group ul li {\n\tpadding: 6px 10px;\n\tfont-size: 14px;\n\tfont-style: normal;\n\tfont-weight: 600;\n\tline-height: 20px;\n }\n .tab-group ul li:hover {\n\tbackground: var(--crepe-color-hover);\n }\n .tab-group ul li.selected {\n\tbackground: var(--crepe-color-selected);\n }\n \n .menu-groups {\n\tpadding: 0 12px 12px;\n\tmax-height: 420px;\n\toverflow: auto;\n\toverscroll-behavior: contain;\n\tscroll-behavior: smooth;\n }\n \n .menu-group h6 {\n\tfont-size: 14px;\n\tfont-style: normal;\n\tfont-weight: 600;\n\tline-height: 20px;\n\tpadding: 14px 10px;\n\ttext-transform: uppercase;\n\tcolor: color-mix(in srgb, var(--crepe-color-on-surface), transparent 40%);\n }\n \n .menu-group li {\n\tmin-width: 220px;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tgap: 16px;\n\tpadding: 14px 10px;\n }\n .menu-group li.hover {\n\tbackground: var(--crepe-color-hover);\n }\n .menu-group li.active {\n\tbackground: var(--crepe-color-selected);\n }\n .menu-group li > svg {\n\twidth: 24px;\n\theight: 24px;\n\tcolor: var(--crepe-color-outline);\n\tfill: var(--crepe-color-outline);\n }\n .menu-group li > span {\n\tfont-size: 14px;\n\tfont-style: normal;\n\tfont-weight: 600;\n\tline-height: 20px;\n }\n \n .menu-group + .menu-group::before {\n\tcontent: '';\n\tdisplay: block;\n\theight: 1px;\n\tbackground: color-mix(in srgb, var(--crepe-color-outline), transparent 80%);\n\tmargin: 0 10px;\n }\n \n`;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/components/styles/cursor.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAWjB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{css}from"lit";export const style=css`
|
|
2
|
-
.crepe-drop-cursor {
|
|
3
|
-
opacity: 0.5;
|
|
4
|
-
transition: all 0.2s;
|
|
5
|
-
pointer-events: none;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.ProseMirror-gapcursor:after {
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
border-top: 1px solid var(--crepe-color-on-background);
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/components/styles/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;CAWvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t.crepe-drop-cursor {\n\t\topacity: 0.5;\n\t\ttransition: all 0.2s;\n\t\tpointer-events: none;\n\t}\n \n\t.ProseMirror-gapcursor:after {\n\t\tbox-sizing: border-box;\n\t\tborder-top: 1px solid var(--crepe-color-on-background);\n\t}\n`;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emoji.d.ts","sourceRoot":"","sources":["../../../src/components/styles/emoji.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAajB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emoji.js","sourceRoot":"","sources":["../../../src/components/styles/emoji.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;CAavB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\tspan[data-type='emoji'] {\n\t\tdisplay: inline-block;\n\t}\n\n\tspan[data-type='emoji'] .emoji {\n\t\twidth: 0.6rem;\n\t\theight: 0.6rem;\n\t}\n\n\timg.emoji {\n\t\tvertical-align: middle;\n\t}\n`;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image-block.d.ts","sourceRoot":"","sources":["../../../src/components/styles/image-block.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBA0YjB,CAAC"}
|