@g9tm/lynxcontrols-richtext 0.0.0-stage → 2.5.9
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 +32 -2
- package/catalog/cards/G9RichLines.md +16 -0
- package/catalog/cards/G9RichText.md +17 -0
- package/catalog/cards/G9RichTextEditor.md +17 -0
- package/catalog/catalog.json +1667 -0
- package/catalog/index.md +7 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/bidi.d.ts +24 -0
- package/dist/bidi.d.ts.map +1 -0
- package/dist/bidi.jsx +102 -0
- package/dist/editor.d.ts +111 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.jsx +556 -0
- package/dist/element-core.d.ts +60 -0
- package/dist/element-core.d.ts.map +1 -0
- package/dist/element-core.jsx +173 -0
- package/dist/element-types.d.ts +31 -0
- package/dist/element-types.d.ts.map +1 -0
- package/dist/element-types.jsx +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.jsx +8 -0
- package/dist/lines-view.d.ts +27 -0
- package/dist/lines-view.d.ts.map +1 -0
- package/dist/lines-view.jsx +100 -0
- package/dist/mentions.d.ts +30 -0
- package/dist/mentions.d.ts.map +1 -0
- package/dist/mentions.jsx +40 -0
- package/dist/ot.d.ts +49 -0
- package/dist/ot.d.ts.map +1 -0
- package/dist/ot.jsx +306 -0
- package/dist/protocol.d.ts +199 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.jsx +11 -0
- package/dist/rich-text.d.ts +48 -0
- package/dist/rich-text.d.ts.map +1 -0
- package/dist/rich-text.jsx +186 -0
- package/dist/richtext.css +411 -0
- package/dist/richtext.css.map +1 -0
- package/dist/session.d.ts +142 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.jsx +665 -0
- package/dist/yjs.d.ts +3 -0
- package/dist/yjs.d.ts.map +1 -0
- package/dist/yjs.jsx +2 -0
- package/dist/ymodel.d.ts +178 -0
- package/dist/ymodel.d.ts.map +1 -0
- package/dist/ymodel.jsx +1379 -0
- package/package.json +68 -4
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { G9TextEntry } from "@g9tm/lynxcontrols/fields";
|
|
2
|
+
import { useG9Direction, useG9Theme } from "@g9tm/lynxcontrols/provider";
|
|
3
|
+
import { resolveThemeColor } from "@g9tm/lynxcontrols-foundation";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "@lynx-js/react";
|
|
5
|
+
import { ElementCore } from "./element-core.jsx";
|
|
6
|
+
import { G9RichLines } from "./lines-view.jsx";
|
|
7
|
+
import { diff } from "./ot.jsx";
|
|
8
|
+
import "./richtext.css";
|
|
9
|
+
function _define_property(obj, key, value) {
|
|
10
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
11
|
+
value: value,
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true
|
|
15
|
+
});
|
|
16
|
+
else obj[key] = value;
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
class G9RichTextPort {
|
|
20
|
+
attach(target) {
|
|
21
|
+
this.target = target;
|
|
22
|
+
}
|
|
23
|
+
attachDirect(handler) {
|
|
24
|
+
this.direct = handler;
|
|
25
|
+
}
|
|
26
|
+
constructor(){
|
|
27
|
+
_define_property(this, "target", null);
|
|
28
|
+
_define_property(this, "direct", null);
|
|
29
|
+
_define_property(this, "send", (message)=>{
|
|
30
|
+
if (this.direct) return void this.direct(message);
|
|
31
|
+
if (!this.target) return;
|
|
32
|
+
this.target.invoke({
|
|
33
|
+
method: 'apply',
|
|
34
|
+
params: {
|
|
35
|
+
json: JSON.stringify(message)
|
|
36
|
+
}
|
|
37
|
+
}).exec();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function g9RichTextPalette(resolve) {
|
|
42
|
+
return {
|
|
43
|
+
text: resolve('--g9-text-primary'),
|
|
44
|
+
text2: resolve('--g9-text-secondary'),
|
|
45
|
+
text3: resolve('--g9-text-tertiary'),
|
|
46
|
+
accent: resolve('--g9-primary'),
|
|
47
|
+
link: resolve('--g9-primary'),
|
|
48
|
+
border: resolve('--g9-outline-variant'),
|
|
49
|
+
surface2: resolve('--g9-surface-container'),
|
|
50
|
+
selection: resolve('--g9-primary-container'),
|
|
51
|
+
info: resolve('--g9-info'),
|
|
52
|
+
success: resolve('--g9-success'),
|
|
53
|
+
warning: resolve('--g9-warning'),
|
|
54
|
+
danger: resolve('--g9-error')
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function G9RichText(props) {
|
|
58
|
+
var _props_bottomInset;
|
|
59
|
+
const ref = useRef(null);
|
|
60
|
+
const theme = useG9Theme();
|
|
61
|
+
const rtl = 'rtl' === useG9Direction();
|
|
62
|
+
const palette = useMemo(()=>{
|
|
63
|
+
var _props_palette;
|
|
64
|
+
return JSON.stringify(null != (_props_palette = props.palette) ? _props_palette : g9RichTextPalette((t)=>resolveThemeColor(`var(${t})`, theme.palette)));
|
|
65
|
+
}, [
|
|
66
|
+
props.palette,
|
|
67
|
+
theme.palette
|
|
68
|
+
]);
|
|
69
|
+
const focused = useRef(false);
|
|
70
|
+
const drawn = 'drawn' === props.surface;
|
|
71
|
+
useEffect(()=>{
|
|
72
|
+
if (drawn) return;
|
|
73
|
+
props.port.attach(ref.current);
|
|
74
|
+
props.session.reset();
|
|
75
|
+
return ()=>props.port.attach(null);
|
|
76
|
+
}, [
|
|
77
|
+
props.session,
|
|
78
|
+
props.port,
|
|
79
|
+
drawn
|
|
80
|
+
]);
|
|
81
|
+
if (drawn) return <DrawnSurface {...props}/>;
|
|
82
|
+
return <g9-richtext ref={ref} className={`g9-rt-element${props.className ? ` ${props.className}` : ''}`} editable={props.editable} placeholder={props.placeholder} palette={palette} page-dir={rtl ? 'rtl' : 'ltr'} bottom-inset={null != (_props_bottomInset = props.bottomInset) ? _props_bottomInset : 0} bindrtedit={(e)=>props.session.edit(e.detail)} bindrtselect={(e)=>{
|
|
83
|
+
const d = e.detail;
|
|
84
|
+
if (void 0 !== d.focus && d.focus !== focused.current) {
|
|
85
|
+
var _props_onFocusChange;
|
|
86
|
+
focused.current = d.focus;
|
|
87
|
+
null == (_props_onFocusChange = props.onFocusChange) || _props_onFocusChange.call(props, d.focus);
|
|
88
|
+
}
|
|
89
|
+
props.session.select(d);
|
|
90
|
+
}} bindrtapplied={(e)=>props.session.applied(e.detail)} bindrtaction={(e)=>{
|
|
91
|
+
var _props_onTapObject;
|
|
92
|
+
const a = e.detail;
|
|
93
|
+
if ('tap' === a.kind) null == (_props_onTapObject = props.onTapObject) || _props_onTapObject.call(props, a.at);
|
|
94
|
+
else props.session.action(a);
|
|
95
|
+
}}/>;
|
|
96
|
+
}
|
|
97
|
+
function DrawnSurface(props) {
|
|
98
|
+
var _props_bottomInset;
|
|
99
|
+
const core = useRef(new ElementCore());
|
|
100
|
+
const rtl = 'rtl' === useG9Direction();
|
|
101
|
+
const [, setVersion] = useState(0);
|
|
102
|
+
const [editing, setEditing] = useState(-1);
|
|
103
|
+
const field = useRef(null);
|
|
104
|
+
const { session, port } = props;
|
|
105
|
+
useEffect(()=>{
|
|
106
|
+
port.attachDirect((message)=>{
|
|
107
|
+
const result = core.current.apply(message);
|
|
108
|
+
if ('resync' === result) session.action({
|
|
109
|
+
kind: 'resync'
|
|
110
|
+
});
|
|
111
|
+
else if (result) {
|
|
112
|
+
session.applied({
|
|
113
|
+
rev: message.rev
|
|
114
|
+
});
|
|
115
|
+
setVersion((v)=>v + 1);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
session.reset();
|
|
119
|
+
return ()=>port.attachDirect(null);
|
|
120
|
+
}, [
|
|
121
|
+
session,
|
|
122
|
+
port
|
|
123
|
+
]);
|
|
124
|
+
useEffect(()=>{
|
|
125
|
+
var _field_current_focus, _field_current;
|
|
126
|
+
if (editing >= 0) null == (_field_current = field.current) || null == (_field_current_focus = _field_current.focus) || _field_current_focus.call(_field_current);
|
|
127
|
+
}, [
|
|
128
|
+
editing
|
|
129
|
+
]);
|
|
130
|
+
const text1 = core.current.text;
|
|
131
|
+
const lines = core.current.lines;
|
|
132
|
+
const parts = text1.split('\n');
|
|
133
|
+
const lineStart = (index)=>{
|
|
134
|
+
let pos = 0;
|
|
135
|
+
for(let i = 0; i < index; i++)pos += parts[i].length + 1;
|
|
136
|
+
return pos;
|
|
137
|
+
};
|
|
138
|
+
const edit = (index)=>{
|
|
139
|
+
var _props_onFocusChange;
|
|
140
|
+
if (!props.editable) return;
|
|
141
|
+
setEditing(index);
|
|
142
|
+
const end = lineStart(index) + parts[index].length;
|
|
143
|
+
session.select(core.current.select(end, end, true));
|
|
144
|
+
null == (_props_onFocusChange = props.onFocusChange) || _props_onFocusChange.call(props, true);
|
|
145
|
+
};
|
|
146
|
+
const changed = (index, value)=>{
|
|
147
|
+
const before = parts[index];
|
|
148
|
+
if (value === before) return;
|
|
149
|
+
const start = lineStart(index);
|
|
150
|
+
for (const r of diff(before, value).toReplacements())session.edit(core.current.edit(start + r.from, start + r.to, r.text));
|
|
151
|
+
session.select(core.current.select(core.current.sel.a, core.current.sel.h, true));
|
|
152
|
+
setVersion((v)=>v + 1);
|
|
153
|
+
};
|
|
154
|
+
const enter = (index)=>{
|
|
155
|
+
const end = lineStart(index) + parts[index].length;
|
|
156
|
+
session.edit(core.current.edit(end, end, '\n'));
|
|
157
|
+
session.select(core.current.select(end + 1, end + 1, true));
|
|
158
|
+
setEditing(index + 1);
|
|
159
|
+
setVersion((v)=>v + 1);
|
|
160
|
+
};
|
|
161
|
+
const cls = `g9-rt-drawn${props.className ? ` ${props.className}` : ''}`;
|
|
162
|
+
if (!text1 && lines.length <= 1 && editing < 0) return <scroll-view className={cls} scroll-orientation="vertical">
|
|
163
|
+
<view className="g9-rt-drawn__empty" bindtap={()=>edit(0)}>
|
|
164
|
+
<text className="g9-rt-drawn__placeholder">{props.placeholder}</text>
|
|
165
|
+
</view>
|
|
166
|
+
</scroll-view>;
|
|
167
|
+
return <scroll-view className={cls} scroll-orientation="vertical">
|
|
168
|
+
<view className="g9-rt-drawn__body" style={{
|
|
169
|
+
paddingBottom: `${(null != (_props_bottomInset = props.bottomInset) ? _props_bottomInset : 0) + 96}px`
|
|
170
|
+
}}>
|
|
171
|
+
<G9RichLines text={text1} lines={lines} editing={editing} direction={rtl ? 'rtl' : 'ltr'} onTapLine={(index)=>{
|
|
172
|
+
var _lines_index, _props_onTapObject;
|
|
173
|
+
const atom = null == (_lines_index = lines[index]) ? void 0 : _lines_index.r.find((run)=>run.a);
|
|
174
|
+
if (atom && !props.editable) null == (_props_onTapObject = props.onTapObject) || _props_onTapObject.call(props, lineStart(index));
|
|
175
|
+
edit(index);
|
|
176
|
+
}} onToggleCheck={(index)=>props.editable && session.action({
|
|
177
|
+
kind: 'check',
|
|
178
|
+
line: index
|
|
179
|
+
})} renderLine={(index, _line, value)=><G9TextEntry key={`line-${index}`} ref={field} value={value} onValueChange={(next)=>changed(index, next)} onConfirm={()=>enter(index)} onBlur={()=>{
|
|
180
|
+
var _props_onFocusChange;
|
|
181
|
+
return null == (_props_onFocusChange = props.onFocusChange) ? void 0 : _props_onFocusChange.call(props, false);
|
|
182
|
+
}} confirmType="next"/>}/>
|
|
183
|
+
</view>
|
|
184
|
+
</scroll-view>;
|
|
185
|
+
}
|
|
186
|
+
export { G9RichText, G9RichTextPort, g9RichTextPalette };
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
.g9-rt-element {
|
|
2
|
+
flex: 1;
|
|
3
|
+
min-height: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.g9-rt-lines {
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.g9-rt-line {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
width: 100%;
|
|
16
|
+
min-height: 26px;
|
|
17
|
+
padding: 2px 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.g9-rt-line--h1, .g9-rt-line--h2, .g9-rt-line--h3 {
|
|
22
|
+
margin-top: 10px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.g9-rt-line--code {
|
|
26
|
+
background-color: var(--g9-surface-container);
|
|
27
|
+
padding: 0 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.g9-rt-line--code-first {
|
|
31
|
+
border-top-left-radius: 10px;
|
|
32
|
+
border-top-right-radius: 10px;
|
|
33
|
+
padding-top: 8px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.g9-rt-line--code-last {
|
|
37
|
+
border-bottom-right-radius: 10px;
|
|
38
|
+
border-bottom-left-radius: 10px;
|
|
39
|
+
padding-bottom: 8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.g9-rt-text {
|
|
43
|
+
flex: 1;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.g9-rt-font {
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
line-height: 28px;
|
|
50
|
+
font-family: var(--g9-font-text);
|
|
51
|
+
color: var(--g9-text-primary);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.g9-rt-text--h1 {
|
|
55
|
+
font-size: 26px;
|
|
56
|
+
font-weight: 700;
|
|
57
|
+
line-height: 34px;
|
|
58
|
+
font-family: var(--g9-font-text-600);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.g9-rt-text--h2 {
|
|
62
|
+
font-size: 21px;
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
line-height: 30px;
|
|
65
|
+
font-family: var(--g9-font-text-600);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.g9-rt-text--h3 {
|
|
69
|
+
font-size: 18px;
|
|
70
|
+
font-weight: 600;
|
|
71
|
+
line-height: 28px;
|
|
72
|
+
font-family: var(--g9-font-text-600);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.g9-rt-text--code {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
line-height: 22px;
|
|
78
|
+
font-family: var(--g9-font-text);
|
|
79
|
+
text-align: left;
|
|
80
|
+
direction: ltr;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.g9-rt-text--done {
|
|
84
|
+
color: var(--g9-text-tertiary);
|
|
85
|
+
text-decoration: line-through;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.g9-rt-quote {
|
|
89
|
+
border-style: solid;
|
|
90
|
+
border-left-width: 3px;
|
|
91
|
+
border-color: var(--g9-outline);
|
|
92
|
+
flex-shrink: 0;
|
|
93
|
+
align-self: stretch;
|
|
94
|
+
margin-right: 10px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.g9-rt-quote--rtl {
|
|
98
|
+
border-left-width: 0;
|
|
99
|
+
border-right-width: 3px;
|
|
100
|
+
margin-left: 10px;
|
|
101
|
+
margin-right: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.g9-rt-marker {
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
align-items: center;
|
|
108
|
+
width: 24px;
|
|
109
|
+
height: 28px;
|
|
110
|
+
display: flex;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.g9-rt-marker-text {
|
|
114
|
+
font-size: 15px;
|
|
115
|
+
font-family: var(--g9-font-text);
|
|
116
|
+
color: var(--g9-text-secondary);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.g9-rt-check {
|
|
120
|
+
border-style: solid;
|
|
121
|
+
border-width: 1.5px;
|
|
122
|
+
border-color: var(--g9-text-tertiary);
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
width: 16px;
|
|
125
|
+
height: 16px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.g9-rt-check--on {
|
|
129
|
+
border-color: var(--g9-primary);
|
|
130
|
+
background-color: var(--g9-primary);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.g9-rt-callout {
|
|
134
|
+
border-style: solid;
|
|
135
|
+
border-left-width: 3px;
|
|
136
|
+
border-color: var(--g9-info);
|
|
137
|
+
background-color: var(--g9-surface-container);
|
|
138
|
+
padding: 4px 12px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.g9-rt-callout--rtl {
|
|
142
|
+
border-left-width: 0;
|
|
143
|
+
border-right-width: 3px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.g9-rt-callout--success {
|
|
147
|
+
border-color: var(--g9-success);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.g9-rt-callout--warning {
|
|
151
|
+
border-color: var(--g9-warning);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.g9-rt-callout--danger {
|
|
155
|
+
border-color: var(--g9-error);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.g9-rt-cell {
|
|
159
|
+
border-style: solid;
|
|
160
|
+
border-left-width: 2px;
|
|
161
|
+
border-color: var(--g9-outline-variant);
|
|
162
|
+
padding: 2px 8px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.g9-rt-cell--rtl {
|
|
166
|
+
border-left-width: 0;
|
|
167
|
+
border-right-width: 2px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.g9-rt-cell--top {
|
|
171
|
+
border-top-width: 1px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.g9-rt-cell--head {
|
|
175
|
+
background-color: var(--g9-surface-container);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.g9-rt-hr {
|
|
179
|
+
background-color: var(--g9-outline);
|
|
180
|
+
flex: 1;
|
|
181
|
+
height: 1px;
|
|
182
|
+
margin: 13px 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.g9-rt-img {
|
|
186
|
+
border-radius: 10px;
|
|
187
|
+
width: 100%;
|
|
188
|
+
height: 220px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.g9-rt-img--loading {
|
|
192
|
+
background-color: var(--g9-surface-container-high);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.g9-rt-run--b {
|
|
196
|
+
font-weight: 700;
|
|
197
|
+
font-family: var(--g9-font-text-600);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.g9-rt-run--i {
|
|
201
|
+
font-style: italic;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.g9-rt-run--u {
|
|
205
|
+
text-decoration: underline;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.g9-rt-run--s {
|
|
209
|
+
text-decoration: line-through;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.g9-rt-run--c {
|
|
213
|
+
background-color: var(--g9-surface-container);
|
|
214
|
+
font-family: monospace;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.g9-rt-run--a {
|
|
218
|
+
color: var(--g9-primary);
|
|
219
|
+
text-decoration: underline;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.g9-rt-atom {
|
|
223
|
+
color: var(--g9-primary);
|
|
224
|
+
background-color: var(--g9-primary-container);
|
|
225
|
+
border-radius: 6px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.g9-rt-atom--off {
|
|
229
|
+
color: var(--g9-text-tertiary);
|
|
230
|
+
background-color: var(--g9-surface-container);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.g9-rt-drawn {
|
|
234
|
+
flex: 1;
|
|
235
|
+
min-height: 0;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.g9-rt-drawn__body {
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
padding: 12px 16px;
|
|
241
|
+
display: flex;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.g9-rt-drawn__empty {
|
|
245
|
+
padding: 16px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.g9-rt-drawn__placeholder {
|
|
249
|
+
font-size: 16px;
|
|
250
|
+
font-family: var(--g9-font-text);
|
|
251
|
+
color: var(--g9-text-tertiary);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.g9-rt-editor {
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
flex: 1;
|
|
257
|
+
min-height: 0;
|
|
258
|
+
display: flex;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.g9-rt-editor__surface {
|
|
262
|
+
flex: 1;
|
|
263
|
+
min-height: 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.g9-rt-toolbar {
|
|
267
|
+
background-color: var(--g9-surface);
|
|
268
|
+
flex-direction: column;
|
|
269
|
+
display: flex;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.g9-rt-toolbar--top {
|
|
273
|
+
border-bottom-style: solid;
|
|
274
|
+
border-bottom-width: 1px;
|
|
275
|
+
border-bottom-color: var(--g9-outline-variant);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.g9-rt-toolbar--bottom {
|
|
279
|
+
border-top-style: solid;
|
|
280
|
+
border-top-width: 1px;
|
|
281
|
+
border-top-color: var(--g9-outline-variant);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.g9-rt-toolbar__scroll {
|
|
285
|
+
width: 100%;
|
|
286
|
+
height: 48px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.g9-rt-toolbar__row {
|
|
290
|
+
align-items: center;
|
|
291
|
+
column-gap: 2px;
|
|
292
|
+
height: 48px;
|
|
293
|
+
padding: 0 6px;
|
|
294
|
+
display: flex;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.g9-rt-toolbar__sep {
|
|
298
|
+
background-color: var(--g9-outline-variant);
|
|
299
|
+
width: 1px;
|
|
300
|
+
height: 24px;
|
|
301
|
+
margin: 0 4px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.g9-rt-toolbar__style {
|
|
305
|
+
border-radius: 8px;
|
|
306
|
+
align-items: center;
|
|
307
|
+
height: 36px;
|
|
308
|
+
padding: 0 8px;
|
|
309
|
+
display: flex;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.g9-rt-toolbar__style-text {
|
|
313
|
+
font-size: 14px;
|
|
314
|
+
font-weight: 600;
|
|
315
|
+
font-family: var(--g9-font-text-600);
|
|
316
|
+
color: var(--g9-text-secondary);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.g9-rt-tool {
|
|
320
|
+
border-radius: 8px;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
align-items: center;
|
|
323
|
+
min-width: 36px;
|
|
324
|
+
height: 36px;
|
|
325
|
+
padding: 0 4px;
|
|
326
|
+
display: flex;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.g9-rt-tool--on {
|
|
330
|
+
background-color: var(--g9-primary-container);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.g9-rt-tool--off {
|
|
334
|
+
opacity: .38;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.g9-rt-tool__glyph {
|
|
338
|
+
font-size: 15px;
|
|
339
|
+
font-family: var(--g9-font-text);
|
|
340
|
+
color: var(--g9-text-secondary);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.g9-rt-tool__glyph--b {
|
|
344
|
+
font-weight: 700;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.g9-rt-tool__glyph--i {
|
|
348
|
+
font-style: italic;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.g9-rt-tool__glyph--u {
|
|
352
|
+
text-decoration: underline;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.g9-rt-tool__glyph--s {
|
|
356
|
+
text-decoration: line-through;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.g9-rt-suggest {
|
|
360
|
+
border-top-style: solid;
|
|
361
|
+
border-top-width: 1px;
|
|
362
|
+
border-top-color: var(--g9-outline-variant);
|
|
363
|
+
background-color: var(--g9-surface);
|
|
364
|
+
max-height: 260px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.g9-rt-suggest__row {
|
|
368
|
+
align-items: center;
|
|
369
|
+
column-gap: 12px;
|
|
370
|
+
min-height: 44px;
|
|
371
|
+
padding: 0 16px;
|
|
372
|
+
display: flex;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.g9-rt-suggest__glyph {
|
|
376
|
+
width: 24px;
|
|
377
|
+
font-size: 15px;
|
|
378
|
+
font-family: var(--g9-font-text);
|
|
379
|
+
text-align: center;
|
|
380
|
+
color: var(--g9-text-secondary);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.g9-rt-suggest__texts {
|
|
384
|
+
flex-direction: column;
|
|
385
|
+
flex: 1;
|
|
386
|
+
min-width: 0;
|
|
387
|
+
display: flex;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.g9-rt-suggest__label {
|
|
391
|
+
font-size: 14px;
|
|
392
|
+
font-family: var(--g9-font-text);
|
|
393
|
+
color: var(--g9-text-primary);
|
|
394
|
+
text-overflow: ellipsis;
|
|
395
|
+
overflow: hidden;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.g9-rt-suggest__sub {
|
|
399
|
+
font-size: 12px;
|
|
400
|
+
font-family: var(--g9-font-text);
|
|
401
|
+
color: var(--g9-text-tertiary);
|
|
402
|
+
text-overflow: ellipsis;
|
|
403
|
+
overflow: hidden;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.g9-rt-mono {
|
|
407
|
+
font-family: monospace;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
/*# sourceMappingURL=richtext.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://./src/richtext.css"],"names":[],"mappings":"AAGA;EAFE,OAAO;EACP,aAAa;AACf;;AAKA;EAFE,sBAAsB;EAC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AAY;EACZ,cAAc;EACd,aAAa;AACf;;AAUA;EAPE,2CAA2C;EAC3C,UAAU;EACV,YAAY;EACZ,aAAa;AACf;;AAUA;EAPE,kBAAkB;EAClB,mBAAmB;EACnB,YAAY;EACZ,cAAc;EACd,aAAa;AACf;;AAUA;EAPE,eAAe;EACf,gBAAgB;EAChB,oCAAoC;EACpC,+BAA+B;AACjC;;AAUA;EAPE,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,cAAc;EACd,aAAa;AACf;;AAUA;EAPE,6CAA6C;AAC/C;;AAUA;EAPE,YAAY;AACd;;AAUA;EAPE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;AACjC;;AAUA;EAPE,gBAAgB;AAClB;;AAUA;EAPE,kBAAkB;AACpB;;AAUA;EAPE,0BAA0B;AAC5B;;AAUA;EAPE,6BAA6B;AAC/B;;AAUA;EAPE,uBAAuB;EACvB,qBAAqB;EACrB,2CAA2C;EAC3C,mCAAmC;EACnC,iBAAiB;AACnB;;AAUA;EAPE,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,eAAe;EACf,aAAa;AACf;;AAUA;EAPE,WAAW;EACX,eAAe;EACf,gCAAgC;EAChC,kBAAkB;EAClB,+BAA+B;AACjC;;AAUA;EAPE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAUA;EAPE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;EAC7B,uBAAuB;EACvB,gBAAgB;AAClB;;AAUA;EAPE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;EAC9B,uBAAuB;EACvB,gBAAgB;AAClB;;AAWA;EARE,sBAAsB;AACxB","sourcesContent":["/* Rich text (2.5.8, G9Hub item 50): the drawn lines, the element's box, the editor's toolbar and suggestions.\n Single-class rules; every text that may truncate clips. */\n\n.g9-rt-element {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-rt-lines {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-rt-line {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n width: 100%;\n min-height: 26px;\n padding: 2px 0px;\n}\n\n.g9-rt-line--h1,\n.g9-rt-line--h2,\n.g9-rt-line--h3 {\n margin-top: 10px;\n}\n\n.g9-rt-line--code {\n padding: 0px 12px;\n background-color: var(--g9-surface-container);\n}\n\n.g9-rt-line--code-first {\n padding-top: 8px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n}\n\n.g9-rt-line--code-last {\n padding-bottom: 8px;\n border-bottom-left-radius: 10px;\n border-bottom-right-radius: 10px;\n}\n\n.g9-rt-text {\n flex: 1;\n min-width: 0px;\n}\n\n/* The line's font, on its text AND on every run: Lynx does not hand a text's font to the inline texts inside it. */\n.g9-rt-font {\n font-size: 16px;\n line-height: 28px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-rt-text--h1 {\n font-size: 26px;\n line-height: 34px;\n font-weight: 700;\n font-family: var(--g9-font-text-600);\n}\n\n.g9-rt-text--h2 {\n font-size: 21px;\n line-height: 30px;\n font-weight: 700;\n font-family: var(--g9-font-text-600);\n}\n\n.g9-rt-text--h3 {\n font-size: 18px;\n line-height: 28px;\n font-weight: 600;\n font-family: var(--g9-font-text-600);\n}\n\n.g9-rt-text--code {\n font-size: 14px;\n line-height: 22px;\n font-family: var(--g9-font-text);\n direction: ltr;\n text-align: left;\n}\n\n.g9-rt-text--done {\n color: var(--g9-text-tertiary);\n text-decoration: line-through;\n}\n\n.g9-rt-quote {\n align-self: stretch;\n flex-shrink: 0;\n margin-right: 10px;\n border-left-width: 3px;\n border-style: solid;\n border-color: var(--g9-outline);\n}\n\n.g9-rt-quote--rtl {\n margin-right: 0px;\n margin-left: 10px;\n border-left-width: 0px;\n border-right-width: 3px;\n}\n\n.g9-rt-marker {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 24px;\n height: 28px;\n}\n\n.g9-rt-marker-text {\n font-size: 15px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-rt-check {\n width: 16px;\n height: 16px;\n border-radius: 4px;\n border-width: 1.5px;\n border-style: solid;\n border-color: var(--g9-text-tertiary);\n}\n\n.g9-rt-check--on {\n border-color: var(--g9-primary);\n background-color: var(--g9-primary);\n}\n\n.g9-rt-callout {\n padding: 4px 12px;\n border-left-width: 3px;\n border-style: solid;\n border-color: var(--g9-info);\n background-color: var(--g9-surface-container);\n}\n\n.g9-rt-callout--rtl {\n border-left-width: 0px;\n border-right-width: 3px;\n}\n\n.g9-rt-callout--success {\n border-color: var(--g9-success);\n}\n\n.g9-rt-callout--warning {\n border-color: var(--g9-warning);\n}\n\n.g9-rt-callout--danger {\n border-color: var(--g9-error);\n}\n\n.g9-rt-cell {\n padding: 2px 8px;\n border-left-width: 2px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-rt-cell--rtl {\n border-left-width: 0px;\n border-right-width: 2px;\n}\n\n.g9-rt-cell--top {\n border-top-width: 1px;\n}\n\n.g9-rt-cell--head {\n background-color: var(--g9-surface-container);\n}\n\n.g9-rt-hr {\n flex: 1;\n height: 1px;\n margin: 13px 0px;\n background-color: var(--g9-outline);\n}\n\n.g9-rt-img {\n width: 100%;\n height: 220px;\n border-radius: 10px;\n}\n\n.g9-rt-img--loading {\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-rt-run--b {\n font-weight: 700;\n font-family: var(--g9-font-text-600);\n}\n\n.g9-rt-run--i {\n font-style: italic;\n}\n\n.g9-rt-run--u {\n text-decoration: underline;\n}\n\n.g9-rt-run--s {\n text-decoration: line-through;\n}\n\n.g9-rt-run--c {\n font-family: monospace;\n background-color: var(--g9-surface-container);\n}\n\n.g9-rt-run--a {\n color: var(--g9-primary);\n text-decoration: underline;\n}\n\n.g9-rt-atom {\n border-radius: 6px;\n color: var(--g9-primary);\n background-color: var(--g9-primary-container);\n}\n\n.g9-rt-atom--off {\n color: var(--g9-text-tertiary);\n background-color: var(--g9-surface-container);\n}\n\n/* the drawn surface (desktop) */\n.g9-rt-drawn {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-rt-drawn__body {\n display: flex;\n flex-direction: column;\n padding: 12px 16px;\n}\n\n.g9-rt-drawn__empty {\n padding: 16px;\n}\n\n.g9-rt-drawn__placeholder {\n font-size: 16px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n/* the editor */\n.g9-rt-editor {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0px;\n}\n\n.g9-rt-editor__surface {\n flex: 1;\n min-height: 0px;\n}\n\n.g9-rt-toolbar {\n display: flex;\n flex-direction: column;\n background-color: var(--g9-surface);\n}\n\n.g9-rt-toolbar--top {\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: var(--g9-outline-variant);\n}\n\n.g9-rt-toolbar--bottom {\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: var(--g9-outline-variant);\n}\n\n.g9-rt-toolbar__scroll {\n width: 100%;\n height: 48px;\n}\n\n.g9-rt-toolbar__row {\n display: flex;\n align-items: center;\n column-gap: 2px;\n height: 48px;\n padding: 0px 6px;\n}\n\n.g9-rt-toolbar__sep {\n width: 1px;\n height: 24px;\n margin: 0px 4px;\n background-color: var(--g9-outline-variant);\n}\n\n.g9-rt-toolbar__style {\n display: flex;\n align-items: center;\n height: 36px;\n padding: 0px 8px;\n border-radius: 8px;\n}\n\n.g9-rt-toolbar__style-text {\n font-size: 14px;\n font-weight: 600;\n font-family: var(--g9-font-text-600);\n color: var(--g9-text-secondary);\n}\n\n.g9-rt-tool {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 36px;\n height: 36px;\n padding: 0px 4px;\n border-radius: 8px;\n}\n\n.g9-rt-tool--on {\n background-color: var(--g9-primary-container);\n}\n\n.g9-rt-tool--off {\n opacity: 0.38;\n}\n\n.g9-rt-tool__glyph {\n font-size: 15px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-rt-tool__glyph--b {\n font-weight: 700;\n}\n\n.g9-rt-tool__glyph--i {\n font-style: italic;\n}\n\n.g9-rt-tool__glyph--u {\n text-decoration: underline;\n}\n\n.g9-rt-tool__glyph--s {\n text-decoration: line-through;\n}\n\n.g9-rt-suggest {\n max-height: 260px;\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-rt-suggest__row {\n display: flex;\n align-items: center;\n column-gap: 12px;\n min-height: 44px;\n padding: 0px 16px;\n}\n\n.g9-rt-suggest__glyph {\n width: 24px;\n font-size: 15px;\n font-family: var(--g9-font-text);\n text-align: center;\n color: var(--g9-text-secondary);\n}\n\n.g9-rt-suggest__texts {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-rt-suggest__label {\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.g9-rt-suggest__sub {\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Code reads in a monospace face (the size and the theme font stay on the text's own class). */\n.g9-rt-mono {\n font-family: monospace;\n}\n"],"sourceRoot":""}
|