@kerebron/extension-tables 0.1.3 → 0.2.1
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/assets/tables.css
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
.
|
|
1
|
+
.kb-editor .tableWrapper {
|
|
2
2
|
overflow-x: auto;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.kb-editor table {
|
|
5
5
|
border-collapse: collapse;
|
|
6
6
|
table-layout: fixed;
|
|
7
7
|
width: 100%;
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
}
|
|
10
|
-
.
|
|
11
|
-
.
|
|
10
|
+
.kb-editor td,
|
|
11
|
+
.kb-editor th {
|
|
12
12
|
vertical-align: top;
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
position: relative;
|
|
15
|
+
border: 1px solid var(--kb-color-border);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
.
|
|
18
|
-
.
|
|
18
|
+
.kb-editor td:not([data-colwidth]):not(.column-resize-dragging),
|
|
19
|
+
.kb-editor th:not([data-colwidth]):not(.column-resize-dragging) {
|
|
19
20
|
/* if there's no explicit width set and the column is not being resized, set a default width */
|
|
20
21
|
min-width: var(--default-cell-min-width);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
.
|
|
24
|
+
.kb-editor .column-resize-handle {
|
|
24
25
|
position: absolute;
|
|
25
26
|
right: -2px;
|
|
26
27
|
top: 0;
|
|
@@ -30,12 +31,12 @@
|
|
|
30
31
|
background-color: #adf;
|
|
31
32
|
pointer-events: none;
|
|
32
33
|
}
|
|
33
|
-
.
|
|
34
|
+
.kb-editor.resize-cursor {
|
|
34
35
|
cursor: ew-resize;
|
|
35
36
|
cursor: col-resize;
|
|
36
37
|
}
|
|
37
38
|
/* Give selected cells a blue overlay */
|
|
38
|
-
.
|
|
39
|
+
.kb-editor .selectedCell:after {
|
|
39
40
|
z-index: 2;
|
|
40
41
|
position: absolute;
|
|
41
42
|
content: '';
|
|
@@ -46,3 +47,39 @@
|
|
|
46
47
|
background: rgba(200, 200, 255, 0.4);
|
|
47
48
|
pointer-events: none;
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
/* Touch-optimized table editing */
|
|
52
|
+
@media (max-width: 767px) {
|
|
53
|
+
.kb-editor table {
|
|
54
|
+
font-size: var(--kb-text-sm);
|
|
55
|
+
border-collapse: collapse;
|
|
56
|
+
width: 100%;
|
|
57
|
+
overflow-x: auto;
|
|
58
|
+
display: block;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.kb-editor th,
|
|
63
|
+
.kb-editor td {
|
|
64
|
+
min-width: 120px;
|
|
65
|
+
padding: var(--kb-space-md);
|
|
66
|
+
border: 1px solid var(--kb-color-border);
|
|
67
|
+
vertical-align: top;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Hide complex table controls on mobile */
|
|
71
|
+
.tableWrapper .column-resize-handle {
|
|
72
|
+
display: none !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.kb-editor .tableWrapper {
|
|
76
|
+
overflow-x: auto;
|
|
77
|
+
-webkit-overflow-scrolling: touch;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Table selection visual feedback */
|
|
81
|
+
.kb-editor .selectedCell {
|
|
82
|
+
background: rgba(var(--kb-color-primary-rgb), 0.1);
|
|
83
|
+
border: 2px solid var(--kb-color-primary);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/src/CoreEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa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I,eAAe;IAIxB,GAAG,IAAI,eAAe;IAI7B,OAAO,CAAC,UAAU;IAgBX,mBAAmB,CAAC,WAAW,EAAE,WAAW;IAcnD,OAAO,CAAC,YAAY;IAcb,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM;IAwC7C,WAAW,CAAC,SAAS,CAAC,EAAE,MAAM;IAkB9B,OAAO,IAAI,WAAW;IAItB,KAAK,CAAC,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,UAAU;IAOvD,KAAK,CAAC,GAAG,CAAC,EAAE,eAAe;CAMnC"}
|
|
@@ -99,6 +99,9 @@ export class CoreEditor extends EventTarget {
|
|
|
99
99
|
if (this.options.element) {
|
|
100
100
|
this.view = new EditorView(this.options.element, {
|
|
101
101
|
state: this.state,
|
|
102
|
+
attributes: {
|
|
103
|
+
class: 'kb-editor',
|
|
104
|
+
},
|
|
102
105
|
dispatchTransaction: (tx) => this.dispatchTransaction(tx),
|
|
103
106
|
});
|
|
104
107
|
}
|