edytor 0.1.0-next.29 → 0.1.0-next.30
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
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
Edytor aims to be for Svelte what Slate.js is for React: a heavily customizable editor with an API to build any kind of collaborative rich text editor.
|
|
17
17
|
|
|
18
|
-
> **Work in progress.** Edytor is a pre-release (`0.1.0-next.
|
|
18
|
+
> **Work in progress.** Edytor is a pre-release (`0.1.0-next.30`, `edytor@next` on npm) and not ready for production; the API changes between releases without a compatibility layer. The untagged `edytor@0.0.11` on npm predates the current API. Issues and PRs are welcome: when you report a bug, include the document's JSON value.
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
|
|
@@ -120,27 +120,6 @@ const backdrop = (document) => {
|
|
|
120
120
|
node.setAttribute('aria-hidden', 'true');
|
|
121
121
|
return node;
|
|
122
122
|
};
|
|
123
|
-
/** How many blocks move: the badge beside the drop indicator. */
|
|
124
|
-
const countBadge = (document, count) => {
|
|
125
|
-
const badge = document.createElement('span');
|
|
126
|
-
badge.dataset.edytorDragCount = 'true';
|
|
127
|
-
badge.textContent = String(count);
|
|
128
|
-
Object.assign(badge.style, {
|
|
129
|
-
position: 'absolute',
|
|
130
|
-
top: '-8px',
|
|
131
|
-
right: '-8px',
|
|
132
|
-
minWidth: '18px',
|
|
133
|
-
height: '18px',
|
|
134
|
-
padding: '0 5px',
|
|
135
|
-
boxSizing: 'border-box',
|
|
136
|
-
borderRadius: '9px',
|
|
137
|
-
background: 'rgb(35, 131, 226)',
|
|
138
|
-
color: 'white',
|
|
139
|
-
font: '600 11px/18px system-ui, sans-serif',
|
|
140
|
-
textAlign: 'center'
|
|
141
|
-
});
|
|
142
|
-
return badge;
|
|
143
|
-
};
|
|
144
123
|
export class BlockHandleController {
|
|
145
124
|
edytor;
|
|
146
125
|
options;
|
|
@@ -1045,13 +1024,9 @@ export class BlockHandleController {
|
|
|
1045
1024
|
overlay.dataset.blocked = 'true';
|
|
1046
1025
|
overlay.setAttribute('aria-hidden', 'true');
|
|
1047
1026
|
const count = this.group.length;
|
|
1048
|
-
|
|
1049
|
-
|
|
1027
|
+
// How many blocks move, as data only: the bar shows no badge.
|
|
1028
|
+
if (count > 1)
|
|
1050
1029
|
overlay.dataset.count = String(count);
|
|
1051
|
-
const badge = countBadge(document, count);
|
|
1052
|
-
Object.assign(badge.style, { top: `${BAR / 2 - 9}px`, right: 'auto', left: '-26px' });
|
|
1053
|
-
overlay.append(badge);
|
|
1054
|
-
}
|
|
1055
1030
|
const color = document.defaultView
|
|
1056
1031
|
?.getComputedStyle(placement.node)
|
|
1057
1032
|
.getPropertyValue('--edytor-drop-indicator-color')
|