slate-angular 17.1.3 → 17.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/esm2022/components/editable/editable.component.mjs +2 -3
- package/esm2022/components/element/default-element.component.mjs +2 -4
- package/esm2022/components/element/element.component.mjs +2 -4
- package/esm2022/components/text/default-text.component.mjs +2 -4
- package/esm2022/components/text/void-text.component.mjs +2 -4
- package/esm2022/module.mjs +3 -9
- package/esm2022/plugins/angular-editor.mjs +1 -1
- package/esm2022/plugins/with-angular.mjs +15 -22
- package/esm2022/public-api.mjs +1 -3
- package/esm2022/types/clipboard.mjs +2 -0
- package/esm2022/types/index.mjs +2 -1
- package/esm2022/utils/clipboard/clipboard.mjs +77 -0
- package/esm2022/utils/clipboard/common.mjs +32 -0
- package/esm2022/utils/clipboard/data-transfer.mjs +44 -0
- package/esm2022/utils/clipboard/index.mjs +5 -0
- package/esm2022/utils/clipboard/navigator-clipboard.mjs +56 -0
- package/esm2022/utils/dom.mjs +5 -23
- package/esm2022/utils/index.mjs +2 -1
- package/fesm2022/slate-angular.mjs +228 -121
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/module.d.ts +5 -7
- package/package.json +1 -1
- package/plugins/angular-editor.d.ts +7 -6
- package/public-api.d.ts +0 -2
- package/types/clipboard.d.ts +8 -0
- package/types/index.d.ts +1 -0
- package/utils/clipboard/clipboard.d.ts +12 -0
- package/utils/clipboard/common.d.ts +6 -0
- package/utils/clipboard/data-transfer.d.ts +5 -0
- package/utils/clipboard/index.d.ts +4 -0
- package/utils/clipboard/navigator-clipboard.d.ts +4 -0
- package/utils/dom.d.ts +2 -6
- package/utils/index.d.ts +1 -0
- package/components/children/children.component.d.ts +0 -11
- package/components/leaves/leaves.component.d.ts +0 -12
- package/esm2022/components/children/children.component.mjs +0 -23
- package/esm2022/components/leaves/leaves.component.mjs +0 -25
- package/esm2022/view/container.mjs +0 -22
- package/view/container.d.ts +0 -18
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Editor, Range, Element, Transforms, Path, Text as Text$1, Node } from 'slate';
|
|
2
2
|
import { isKeyHotkey } from 'is-hotkey';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { TemplateRef, Component, ChangeDetectionStrategy, ViewChild,
|
|
4
|
+
import { TemplateRef, Component, ChangeDetectionStrategy, ViewChild, InjectionToken, ComponentRef, IterableDiffers, Directive, Input, HostBinding, inject, ViewContainerRef, forwardRef, ElementRef, Inject, NgModule } from '@angular/core';
|
|
5
5
|
import { direction } from 'direction';
|
|
6
6
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
7
7
|
import { Subject } from 'rxjs';
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
9
|
import { HistoryEditor } from 'slate-history';
|
|
10
|
-
import {
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Two weak maps that allow us rebuild a path given a node. They are populated
|
|
@@ -203,33 +203,15 @@ const getPlainText = (domNode) => {
|
|
|
203
203
|
}
|
|
204
204
|
return text;
|
|
205
205
|
};
|
|
206
|
+
const SlateFragmentAttributeKey = 'data-slate-angular-fragment';
|
|
206
207
|
/**
|
|
207
|
-
* Get x-slate-fragment attribute from data-slate-fragment
|
|
208
|
+
* Get x-slate-fragment attribute from data-slate-angular-fragment
|
|
208
209
|
*/
|
|
209
|
-
const catchSlateFragment = /data-slate-fragment="(.+?)"/m;
|
|
210
|
-
const getSlateFragmentAttribute = (
|
|
211
|
-
const htmlData = dataTransfer.getData('text/html');
|
|
210
|
+
const catchSlateFragment = /data-slate-angular-fragment="(.+?)"/m;
|
|
211
|
+
const getSlateFragmentAttribute = (htmlData) => {
|
|
212
212
|
const [, fragment] = htmlData.match(catchSlateFragment) || [];
|
|
213
213
|
return fragment;
|
|
214
214
|
};
|
|
215
|
-
/**
|
|
216
|
-
* Get the x-slate-fragment attribute that exist in text/html data
|
|
217
|
-
* and append it to the DataTransfer object
|
|
218
|
-
*/
|
|
219
|
-
const getClipboardData = (dataTransfer, clipboardFormatKey = 'x-slate-fragment') => {
|
|
220
|
-
if (!dataTransfer.getData(`application/${clipboardFormatKey}`)) {
|
|
221
|
-
const fragment = getSlateFragmentAttribute(dataTransfer);
|
|
222
|
-
if (fragment) {
|
|
223
|
-
const clipboardData = new DataTransfer();
|
|
224
|
-
dataTransfer.types.forEach(type => {
|
|
225
|
-
clipboardData.setData(type, dataTransfer.getData(type));
|
|
226
|
-
});
|
|
227
|
-
clipboardData.setData(`application/${clipboardFormatKey}`, fragment);
|
|
228
|
-
return clipboardData;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return dataTransfer;
|
|
232
|
-
};
|
|
233
215
|
|
|
234
216
|
/**
|
|
235
217
|
* An auto-incrementing identifier for keys.
|
|
@@ -1073,6 +1055,208 @@ const createThrottleRAF = () => {
|
|
|
1073
1055
|
return throttleRAF;
|
|
1074
1056
|
};
|
|
1075
1057
|
|
|
1058
|
+
const setDataTransferClipboard = (dataTransfer, htmlText) => {
|
|
1059
|
+
dataTransfer?.setData(`text/html`, htmlText);
|
|
1060
|
+
};
|
|
1061
|
+
const setDataTransferClipboardText = (data, text) => {
|
|
1062
|
+
data?.setData(`text/plain`, text);
|
|
1063
|
+
};
|
|
1064
|
+
const getDataTransferClipboard = (data) => {
|
|
1065
|
+
const html = data?.getData(`text/html`);
|
|
1066
|
+
if (html) {
|
|
1067
|
+
const htmlClipboardData = getClipboardFromHTMLText(html);
|
|
1068
|
+
if (htmlClipboardData) {
|
|
1069
|
+
return htmlClipboardData;
|
|
1070
|
+
}
|
|
1071
|
+
const textData = getDataTransferClipboardText(data);
|
|
1072
|
+
if (textData) {
|
|
1073
|
+
return {
|
|
1074
|
+
html,
|
|
1075
|
+
...textData
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
return { html };
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
else {
|
|
1083
|
+
const textData = getDataTransferClipboardText(data);
|
|
1084
|
+
return textData;
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
const getDataTransferClipboardText = (data) => {
|
|
1088
|
+
if (!data) {
|
|
1089
|
+
return null;
|
|
1090
|
+
}
|
|
1091
|
+
const text = data?.getData(`text/plain`);
|
|
1092
|
+
if (text) {
|
|
1093
|
+
const htmlClipboardData = getClipboardFromHTMLText(text);
|
|
1094
|
+
if (htmlClipboardData) {
|
|
1095
|
+
return htmlClipboardData;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return { text };
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
const isClipboardReadSupported = () => {
|
|
1102
|
+
return 'clipboard' in navigator && 'read' in navigator.clipboard;
|
|
1103
|
+
};
|
|
1104
|
+
const isClipboardWriteSupported = () => {
|
|
1105
|
+
return 'clipboard' in navigator && 'write' in navigator.clipboard;
|
|
1106
|
+
};
|
|
1107
|
+
const isClipboardWriteTextSupported = () => {
|
|
1108
|
+
return 'clipboard' in navigator && 'writeText' in navigator.clipboard;
|
|
1109
|
+
};
|
|
1110
|
+
const isClipboardFile = (item) => {
|
|
1111
|
+
return item.types.find(i => i.match(/^image\//));
|
|
1112
|
+
};
|
|
1113
|
+
const stripHtml = (html) => {
|
|
1114
|
+
// See <https://github.com/developit/preact-markup/blob/4788b8d61b4e24f83688710746ee36e7464f7bbc/src/parse-markup.js#L60-L69>
|
|
1115
|
+
const doc = document.implementation.createHTMLDocument('');
|
|
1116
|
+
doc.documentElement.innerHTML = html.trim();
|
|
1117
|
+
return doc.body.textContent || doc.body.innerText || '';
|
|
1118
|
+
};
|
|
1119
|
+
const blobAsString = (blob) => {
|
|
1120
|
+
return new Promise((resolve, reject) => {
|
|
1121
|
+
const reader = new FileReader();
|
|
1122
|
+
reader.addEventListener('loadend', () => {
|
|
1123
|
+
const text = reader.result;
|
|
1124
|
+
resolve(text);
|
|
1125
|
+
});
|
|
1126
|
+
reader.addEventListener('error', () => {
|
|
1127
|
+
reject(reader.error);
|
|
1128
|
+
});
|
|
1129
|
+
reader.readAsText(blob);
|
|
1130
|
+
});
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
const setNavigatorClipboard = async (htmlText, data, text = '') => {
|
|
1134
|
+
let textClipboard = text;
|
|
1135
|
+
if (isClipboardWriteSupported()) {
|
|
1136
|
+
await navigator.clipboard.write([
|
|
1137
|
+
new ClipboardItem({
|
|
1138
|
+
'text/html': new Blob([htmlText], {
|
|
1139
|
+
type: 'text/html'
|
|
1140
|
+
}),
|
|
1141
|
+
'text/plain': new Blob([JSON.stringify(textClipboard ?? data)], { type: 'text/plain' })
|
|
1142
|
+
})
|
|
1143
|
+
]);
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
const getNavigatorClipboard = async () => {
|
|
1147
|
+
if (!isClipboardReadSupported()) {
|
|
1148
|
+
return null;
|
|
1149
|
+
}
|
|
1150
|
+
const clipboardItems = await navigator.clipboard.read();
|
|
1151
|
+
let clipboardData = {};
|
|
1152
|
+
if (Array.isArray(clipboardItems) && clipboardItems[0] instanceof ClipboardItem) {
|
|
1153
|
+
for (const item of clipboardItems) {
|
|
1154
|
+
if (isClipboardFile(item)) {
|
|
1155
|
+
const clipboardFiles = item.types.filter(type => type.match(/^image\//));
|
|
1156
|
+
const fileBlobs = await Promise.all(clipboardFiles.map(type => item.getType(type)));
|
|
1157
|
+
const urls = fileBlobs.filter(Boolean).map(blob => URL.createObjectURL(blob));
|
|
1158
|
+
const files = await Promise.all(urls.map(async (url) => {
|
|
1159
|
+
const blob = await (await fetch(url)).blob();
|
|
1160
|
+
return new File([blob], 'file', { type: blob.type });
|
|
1161
|
+
}));
|
|
1162
|
+
return {
|
|
1163
|
+
files
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
if (item.types.includes('text/html')) {
|
|
1167
|
+
const htmlContent = await blobAsString(await item.getType('text/html'));
|
|
1168
|
+
const htmlClipboardData = getClipboardFromHTMLText(htmlContent);
|
|
1169
|
+
if (htmlClipboardData) {
|
|
1170
|
+
return htmlClipboardData;
|
|
1171
|
+
}
|
|
1172
|
+
if (htmlContent && htmlContent.trim()) {
|
|
1173
|
+
clipboardData = { html: htmlContent };
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
if (item.types.includes('text/plain')) {
|
|
1177
|
+
const textContent = await blobAsString(await item.getType('text/plain'));
|
|
1178
|
+
clipboardData = {
|
|
1179
|
+
text: stripHtml(textContent)
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
return clipboardData;
|
|
1185
|
+
};
|
|
1186
|
+
|
|
1187
|
+
const buildHTMLText = (wrapper, attach, data) => {
|
|
1188
|
+
const stringObj = JSON.stringify(data);
|
|
1189
|
+
const encoded = window.btoa(encodeURIComponent(stringObj));
|
|
1190
|
+
attach.setAttribute(SlateFragmentAttributeKey, encoded);
|
|
1191
|
+
return wrapper.innerHTML;
|
|
1192
|
+
};
|
|
1193
|
+
const getClipboardFromHTMLText = (html) => {
|
|
1194
|
+
const fragmentAttribute = getSlateFragmentAttribute(html);
|
|
1195
|
+
if (fragmentAttribute) {
|
|
1196
|
+
try {
|
|
1197
|
+
const decoded = decodeURIComponent(window.atob(fragmentAttribute));
|
|
1198
|
+
const result = JSON.parse(decoded);
|
|
1199
|
+
if (result && Array.isArray(result) && result.length > 0) {
|
|
1200
|
+
return {
|
|
1201
|
+
elements: result
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
catch (error) {
|
|
1206
|
+
console.error(error);
|
|
1207
|
+
return null;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
return null;
|
|
1211
|
+
};
|
|
1212
|
+
const createClipboardData = (html, elements, text, files) => {
|
|
1213
|
+
const data = { elements, text, html, files };
|
|
1214
|
+
return data;
|
|
1215
|
+
};
|
|
1216
|
+
const getClipboardData = async (dataTransfer) => {
|
|
1217
|
+
let clipboardData = null;
|
|
1218
|
+
if (dataTransfer) {
|
|
1219
|
+
if (dataTransfer.files.length) {
|
|
1220
|
+
return { files: Array.from(dataTransfer.files) };
|
|
1221
|
+
}
|
|
1222
|
+
clipboardData = getDataTransferClipboard(dataTransfer);
|
|
1223
|
+
return clipboardData;
|
|
1224
|
+
}
|
|
1225
|
+
if (isClipboardReadSupported()) {
|
|
1226
|
+
return await getNavigatorClipboard();
|
|
1227
|
+
}
|
|
1228
|
+
return clipboardData;
|
|
1229
|
+
};
|
|
1230
|
+
/**
|
|
1231
|
+
* @param wrapper get wrapper.innerHTML string which will be written in clipboard
|
|
1232
|
+
* @param attach attach must be child element of wrapper which will be attached json data
|
|
1233
|
+
* @returns void
|
|
1234
|
+
*/
|
|
1235
|
+
const setClipboardData = async (clipboardData, wrapper, attach, dataTransfer) => {
|
|
1236
|
+
if (!clipboardData) {
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
const { elements, text } = clipboardData;
|
|
1240
|
+
if (isClipboardWriteSupported()) {
|
|
1241
|
+
const htmlText = buildHTMLText(wrapper, attach, elements);
|
|
1242
|
+
// TODO
|
|
1243
|
+
// maybe fail to write when copy some cell in table
|
|
1244
|
+
return await setNavigatorClipboard(htmlText, elements, text);
|
|
1245
|
+
}
|
|
1246
|
+
if (dataTransfer) {
|
|
1247
|
+
const htmlText = buildHTMLText(wrapper, attach, elements);
|
|
1248
|
+
setDataTransferClipboard(dataTransfer, htmlText);
|
|
1249
|
+
setDataTransferClipboardText(dataTransfer, text);
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
// Compatible with situations where navigator.clipboard.write is not supported and dataTransfer is empty
|
|
1253
|
+
// Such as contextmenu copy in Firefox.
|
|
1254
|
+
if (isClipboardWriteTextSupported()) {
|
|
1255
|
+
const htmlText = buildHTMLText(wrapper, attach, elements);
|
|
1256
|
+
return await navigator.clipboard.writeText(htmlText);
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1076
1260
|
/**
|
|
1077
1261
|
* Utilities for single-line deletion
|
|
1078
1262
|
*/
|
|
@@ -1195,7 +1379,7 @@ const withAngular = (editor, clipboardFormatKey = 'x-slate-fragment') => {
|
|
|
1195
1379
|
}
|
|
1196
1380
|
onChange();
|
|
1197
1381
|
};
|
|
1198
|
-
e.setFragmentData = (
|
|
1382
|
+
e.setFragmentData = (dataTransfer, originEvent) => {
|
|
1199
1383
|
const { selection } = e;
|
|
1200
1384
|
if (!selection) {
|
|
1201
1385
|
return;
|
|
@@ -1254,19 +1438,13 @@ const withAngular = (editor, clipboardFormatKey = 'x-slate-fragment') => {
|
|
|
1254
1438
|
attach = span;
|
|
1255
1439
|
}
|
|
1256
1440
|
const fragment = e.getFragment();
|
|
1257
|
-
const stringObj = JSON.stringify(fragment);
|
|
1258
|
-
const encoded = window.btoa(encodeURIComponent(stringObj));
|
|
1259
|
-
attach.setAttribute('data-slate-fragment', encoded);
|
|
1260
|
-
data.setData(`application/${clipboardFormatKey}`, encoded);
|
|
1261
1441
|
// Add the content to a <div> so that we can get its inner HTML.
|
|
1262
1442
|
const div = contents.ownerDocument.createElement('div');
|
|
1263
1443
|
div.appendChild(contents);
|
|
1264
1444
|
div.setAttribute('hidden', 'true');
|
|
1265
1445
|
contents.ownerDocument.body.appendChild(div);
|
|
1266
|
-
|
|
1267
|
-
data.setData('text/plain', getPlainText(div));
|
|
1446
|
+
setClipboardData({ text: getPlainText(div), elements: fragment }, div, attach, dataTransfer);
|
|
1268
1447
|
contents.ownerDocument.body.removeChild(div);
|
|
1269
|
-
return data;
|
|
1270
1448
|
};
|
|
1271
1449
|
e.deleteCutData = () => {
|
|
1272
1450
|
const { selection } = editor;
|
|
@@ -1282,28 +1460,26 @@ const withAngular = (editor, clipboardFormatKey = 'x-slate-fragment') => {
|
|
|
1282
1460
|
}
|
|
1283
1461
|
}
|
|
1284
1462
|
};
|
|
1285
|
-
e.insertData = (data) => {
|
|
1286
|
-
if (!e.insertFragmentData(data)) {
|
|
1463
|
+
e.insertData = async (data) => {
|
|
1464
|
+
if (!(await e.insertFragmentData(data))) {
|
|
1287
1465
|
e.insertTextData(data);
|
|
1288
1466
|
}
|
|
1289
1467
|
};
|
|
1290
|
-
e.insertFragmentData = (data) => {
|
|
1468
|
+
e.insertFragmentData = async (data) => {
|
|
1291
1469
|
/**
|
|
1292
1470
|
* Checking copied fragment from application/x-slate-fragment or data-slate-fragment
|
|
1293
1471
|
*/
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1296
|
-
|
|
1297
|
-
const parsed = JSON.parse(decoded);
|
|
1298
|
-
e.insertFragment(parsed);
|
|
1472
|
+
const clipboardData = await getClipboardData(data);
|
|
1473
|
+
if (clipboardData && clipboardData.elements) {
|
|
1474
|
+
e.insertFragment(clipboardData.elements);
|
|
1299
1475
|
return true;
|
|
1300
1476
|
}
|
|
1301
1477
|
return false;
|
|
1302
1478
|
};
|
|
1303
|
-
e.insertTextData = (data) => {
|
|
1304
|
-
const
|
|
1305
|
-
if (text) {
|
|
1306
|
-
const lines = text.split(/\r\n|\r|\n/);
|
|
1479
|
+
e.insertTextData = async (data) => {
|
|
1480
|
+
const clipboardData = await getClipboardData(data);
|
|
1481
|
+
if (clipboardData && clipboardData.text) {
|
|
1482
|
+
const lines = clipboardData.text.split(/\r\n|\r|\n/);
|
|
1307
1483
|
let split = false;
|
|
1308
1484
|
for (const line of lines) {
|
|
1309
1485
|
if (split) {
|
|
@@ -1729,46 +1905,6 @@ function restoreDom(editor, execute) {
|
|
|
1729
1905
|
}, 0);
|
|
1730
1906
|
}
|
|
1731
1907
|
|
|
1732
|
-
/**
|
|
1733
|
-
* @deprecated
|
|
1734
|
-
* the special container for angular template
|
|
1735
|
-
* Add the rootNodes of each child component to the parentElement
|
|
1736
|
-
* Remove useless DOM elements, eg: comment...
|
|
1737
|
-
*/
|
|
1738
|
-
class ViewContainer {
|
|
1739
|
-
constructor(elementRef, differs) {
|
|
1740
|
-
this.elementRef = elementRef;
|
|
1741
|
-
this.differs = differs;
|
|
1742
|
-
}
|
|
1743
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ViewContainer, deps: [{ token: i0.ElementRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1744
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.4", type: ViewContainer, inputs: { viewContext: "viewContext" }, ngImport: i0 }); }
|
|
1745
|
-
}
|
|
1746
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ViewContainer, decorators: [{
|
|
1747
|
-
type: Directive
|
|
1748
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { viewContext: [{
|
|
1749
|
-
type: Input
|
|
1750
|
-
}] } });
|
|
1751
|
-
|
|
1752
|
-
class SlateChildren extends ViewContainer {
|
|
1753
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateChildren, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1754
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: SlateChildren, isStandalone: true, selector: "slate-children", inputs: { children: "children", context: "context", viewContext: "viewContext" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1755
|
-
}
|
|
1756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateChildren, decorators: [{
|
|
1757
|
-
type: Component,
|
|
1758
|
-
args: [{
|
|
1759
|
-
selector: 'slate-children',
|
|
1760
|
-
template: ``,
|
|
1761
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1762
|
-
standalone: true
|
|
1763
|
-
}]
|
|
1764
|
-
}], propDecorators: { children: [{
|
|
1765
|
-
type: Input
|
|
1766
|
-
}], context: [{
|
|
1767
|
-
type: Input
|
|
1768
|
-
}], viewContext: [{
|
|
1769
|
-
type: Input
|
|
1770
|
-
}] } });
|
|
1771
|
-
|
|
1772
1908
|
const SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN = new InjectionToken('slate-default-element-token');
|
|
1773
1909
|
|
|
1774
1910
|
const SLATE_DEFAULT_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-text-token');
|
|
@@ -2606,27 +2742,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2606
2742
|
args: [SlateChildrenOutlet, { static: true }]
|
|
2607
2743
|
}] } });
|
|
2608
2744
|
|
|
2609
|
-
class SlateLeaves extends ViewContainer {
|
|
2610
|
-
constructor() {
|
|
2611
|
-
super(...arguments);
|
|
2612
|
-
this.initialized = false;
|
|
2613
|
-
}
|
|
2614
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateLeaves, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2615
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: SlateLeaves, isStandalone: true, selector: "slate-leaves", inputs: { context: "context" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2616
|
-
}
|
|
2617
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateLeaves, decorators: [{
|
|
2618
|
-
type: Component,
|
|
2619
|
-
args: [{
|
|
2620
|
-
selector: 'slate-leaves',
|
|
2621
|
-
template: ``,
|
|
2622
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2623
|
-
standalone: true,
|
|
2624
|
-
imports: [NgFor]
|
|
2625
|
-
}]
|
|
2626
|
-
}], propDecorators: { context: [{
|
|
2627
|
-
type: Input
|
|
2628
|
-
}] } });
|
|
2629
|
-
|
|
2630
2745
|
class SlateVoidText extends BaseTextComponent {
|
|
2631
2746
|
ngOnInit() {
|
|
2632
2747
|
super.ngOnInit();
|
|
@@ -2650,8 +2765,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2650
2765
|
class: 'slate-spacer',
|
|
2651
2766
|
'data-slate-node': 'text'
|
|
2652
2767
|
},
|
|
2653
|
-
standalone: true
|
|
2654
|
-
imports: [SlateLeaves]
|
|
2768
|
+
standalone: true
|
|
2655
2769
|
}]
|
|
2656
2770
|
}] });
|
|
2657
2771
|
|
|
@@ -2668,8 +2782,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2668
2782
|
host: {
|
|
2669
2783
|
'data-slate-node': 'text'
|
|
2670
2784
|
},
|
|
2671
|
-
standalone: true
|
|
2672
|
-
imports: [SlateLeaves]
|
|
2785
|
+
standalone: true
|
|
2673
2786
|
}]
|
|
2674
2787
|
}] });
|
|
2675
2788
|
|
|
@@ -2683,8 +2796,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2683
2796
|
selector: 'div[slateDefaultElement]',
|
|
2684
2797
|
template: ``,
|
|
2685
2798
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2686
|
-
standalone: true
|
|
2687
|
-
imports: [SlateChildren]
|
|
2799
|
+
standalone: true
|
|
2688
2800
|
}]
|
|
2689
2801
|
}] });
|
|
2690
2802
|
|
|
@@ -4080,7 +4192,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
4080
4192
|
provide: SLATE_DEFAULT_LEAF_COMPONENT_TOKEN,
|
|
4081
4193
|
useValue: SlateDefaultLeaf
|
|
4082
4194
|
}
|
|
4083
|
-
], standalone: true, imports: [
|
|
4195
|
+
], standalone: true, imports: [SlateStringTemplate], template: "<slate-string-template #templateComponent></slate-string-template>\n" }]
|
|
4084
4196
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i0.Injector }, { type: undefined, decorators: [{
|
|
4085
4197
|
type: Inject,
|
|
4086
4198
|
args: [SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN]
|
|
@@ -4246,8 +4358,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
4246
4358
|
selector: '[slateElement]',
|
|
4247
4359
|
template: '<ng-content></ng-content>',
|
|
4248
4360
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4249
|
-
standalone: true
|
|
4250
|
-
imports: [SlateChildren]
|
|
4361
|
+
standalone: true
|
|
4251
4362
|
}]
|
|
4252
4363
|
}] });
|
|
4253
4364
|
|
|
@@ -4261,12 +4372,10 @@ class SlateModule {
|
|
|
4261
4372
|
SlateDefaultText,
|
|
4262
4373
|
SlateString,
|
|
4263
4374
|
SlateStringTemplate,
|
|
4264
|
-
SlateChildren,
|
|
4265
4375
|
SlateBlockCard,
|
|
4266
|
-
SlateLeaves,
|
|
4267
4376
|
SlateDefaultLeaf,
|
|
4268
4377
|
SlateDefaultString,
|
|
4269
|
-
SlateChildrenOutlet], exports: [SlateEditable,
|
|
4378
|
+
SlateChildrenOutlet], exports: [SlateEditable, SlateChildrenOutlet, SlateElement, SlateString, SlateDefaultString] }); }
|
|
4270
4379
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateModule, providers: [
|
|
4271
4380
|
{
|
|
4272
4381
|
provide: SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN,
|
|
@@ -4286,14 +4395,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
4286
4395
|
SlateDefaultText,
|
|
4287
4396
|
SlateString,
|
|
4288
4397
|
SlateStringTemplate,
|
|
4289
|
-
SlateChildren,
|
|
4290
4398
|
SlateBlockCard,
|
|
4291
|
-
SlateLeaves,
|
|
4292
4399
|
SlateDefaultLeaf,
|
|
4293
4400
|
SlateDefaultString,
|
|
4294
4401
|
SlateChildrenOutlet
|
|
4295
4402
|
],
|
|
4296
|
-
exports: [SlateEditable,
|
|
4403
|
+
exports: [SlateEditable, SlateChildrenOutlet, SlateElement, SlateString, SlateDefaultString],
|
|
4297
4404
|
providers: [
|
|
4298
4405
|
{
|
|
4299
4406
|
provide: SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN,
|
|
@@ -4311,5 +4418,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
4311
4418
|
* Generated bundle index. Do not edit.
|
|
4312
4419
|
*/
|
|
4313
4420
|
|
|
4314
|
-
export { AngularEditor, BaseComponent, BaseElementComponent, BaseLeafComponent, BaseTextComponent, DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, EDITOR_TO_ELEMENT, EDITOR_TO_ON_CHANGE, EDITOR_TO_PLACEHOLDER, EDITOR_TO_WINDOW, ELEMENT_TO_COMPONENT, ELEMENT_TO_NODE, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_CLICKING, IS_DRAGGING, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_FOCUSED, IS_IOS, IS_QQBROWSER, IS_READONLY, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, KEY_TO_ELEMENT, Key, NODE_TO_ELEMENT, NODE_TO_INDEX, NODE_TO_KEY, NODE_TO_PARENT, PLACEHOLDER_SYMBOL,
|
|
4421
|
+
export { AngularEditor, BaseComponent, BaseElementComponent, BaseLeafComponent, BaseTextComponent, DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, EDITOR_TO_ELEMENT, EDITOR_TO_ON_CHANGE, EDITOR_TO_PLACEHOLDER, EDITOR_TO_WINDOW, ELEMENT_TO_COMPONENT, ELEMENT_TO_NODE, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_CLICKING, IS_DRAGGING, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_FOCUSED, IS_IOS, IS_QQBROWSER, IS_READONLY, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, KEY_TO_ELEMENT, Key, NODE_TO_ELEMENT, NODE_TO_INDEX, NODE_TO_KEY, NODE_TO_PARENT, PLACEHOLDER_SYMBOL, SlateChildrenOutlet, SlateDefaultString, SlateEditable, SlateElement, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, SlateString, blobAsString, buildHTMLText, check, createClipboardData, createThrottleRAF, defaultScrollSelectionIntoView, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getDataTransferClipboard, getDataTransferClipboardText, getDefaultView, getEditableChild, getEditableChildAndIndex, getNavigatorClipboard, getPlainText, getSlateFragmentAttribute, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hasEditableTarget, hasShadowRoot, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMComment, isDOMElement, isDOMNode, isDOMSelection, isDOMText, isDecoratorRangeListEqual, isEmpty, isPlainTextOnlyPaste, isTemplateRef, isValid, normalize, normalizeDOMPoint, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
4315
4422
|
//# sourceMappingURL=slate-angular.mjs.map
|