@mantine-vue/tiptap 3.2.0 → 3.3.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/cjs/index.cjs +462 -15
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +449 -16
- package/esm/index.mjs.map +1 -1
- package/lib/RichTextEditor.context.d.ts +2 -2
- package/lib/RichTextEditor.d.ts +17 -0
- package/lib/RichTextEditor.types.d.ts +19 -2
- package/lib/RichTextEditorControl/RichTextEditorDetailsControl.d.ts +3 -0
- package/lib/RichTextEditorControl/RichTextEditorDetailsControl.types.d.ts +11 -0
- package/lib/RichTextEditorControl/RichTextEditorDetailsControl.vue.d.ts +202 -0
- package/lib/RichTextEditorControl/RichTextEditorInvisibleCharactersControl.d.ts +3 -0
- package/lib/RichTextEditorControl/RichTextEditorInvisibleCharactersControl.types.d.ts +11 -0
- package/lib/RichTextEditorControl/RichTextEditorInvisibleCharactersControl.vue.d.ts +202 -0
- package/lib/RichTextEditorControl/RichTextEditorTableInsertControl.d.ts +3 -0
- package/lib/RichTextEditorControl/RichTextEditorTableInsertControl.types.d.ts +21 -0
- package/lib/RichTextEditorControl/RichTextEditorTableInsertControl.vue.d.ts +209 -0
- package/lib/RichTextEditorControl/controls.d.ts +88 -0
- package/lib/RichTextEditorControl/index.d.ts +3 -0
- package/lib/icons/Icons.d.ts +14 -0
- package/lib/index.d.mts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/labels.d.ts +17 -1
- package/package.json +3 -3
- package/styles.css +276 -108
- package/styles.layer.css +276 -108
package/esm/index.mjs
CHANGED
|
@@ -40,6 +40,21 @@ var DEFAULT_LABELS = {
|
|
|
40
40
|
tasksControlLabel: "Task list",
|
|
41
41
|
tasksSinkLabel: "Decrease task level",
|
|
42
42
|
tasksLiftLabel: "Increase task level",
|
|
43
|
+
tableInsertControlLabel: "Insert table",
|
|
44
|
+
tableInsertLabel: (columns, rows) => `Insert ${columns} × ${rows} table`,
|
|
45
|
+
tableDeleteControlLabel: "Delete table",
|
|
46
|
+
tableColumnBeforeControlLabel: "Add column before",
|
|
47
|
+
tableColumnAfterControlLabel: "Add column after",
|
|
48
|
+
tableColumnDeleteControlLabel: "Delete column",
|
|
49
|
+
tableRowBeforeControlLabel: "Add row before",
|
|
50
|
+
tableRowAfterControlLabel: "Add row after",
|
|
51
|
+
tableRowDeleteControlLabel: "Delete row",
|
|
52
|
+
tableToggleHeaderRowControlLabel: "Toggle header row",
|
|
53
|
+
tableToggleHeaderColumnControlLabel: "Toggle header column",
|
|
54
|
+
tableMergeCellsControlLabel: "Merge cells",
|
|
55
|
+
tableSplitCellControlLabel: "Split cell",
|
|
56
|
+
detailsControlLabel: "Toggle collapsible section",
|
|
57
|
+
invisibleCharactersControlLabel: "Toggle invisible characters",
|
|
43
58
|
linkEditorInputLabel: "Enter URL",
|
|
44
59
|
linkEditorInputPlaceholder: "https://example.com/",
|
|
45
60
|
linkEditorExternalLink: "Open link in a new tab",
|
|
@@ -56,19 +71,23 @@ var DEFAULT_LABELS = {
|
|
|
56
71
|
//#region src/RichTextEditor.context.ts
|
|
57
72
|
var [provideRichTextEditorContext, useRichTextEditorContext] = createSafeContext("RichTextEditor component was not found in tree");
|
|
58
73
|
var RichTextEditor_module_default = {
|
|
59
|
-
root: "
|
|
60
|
-
Typography: "
|
|
61
|
-
content: "
|
|
62
|
-
linkEditorDropdown: "
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
root: "_root_1avnr_1",
|
|
75
|
+
Typography: "_Typography_1avnr_19",
|
|
76
|
+
content: "_content_1avnr_47",
|
|
77
|
+
linkEditorDropdown: "_linkEditorDropdown_1avnr_292",
|
|
78
|
+
tableInsertDropdown: "_tableInsertDropdown_1avnr_296",
|
|
79
|
+
tableInsertGrid: "_tableInsertGrid_1avnr_301",
|
|
80
|
+
tableInsertCell: "_tableInsertCell_1avnr_307",
|
|
81
|
+
tableInsertLabel: "_tableInsertLabel_1avnr_324",
|
|
82
|
+
control: "_control_1avnr_331",
|
|
83
|
+
controlIcon: "_controlIcon_1avnr_406",
|
|
84
|
+
controlsGroup: "_controlsGroup_1avnr_411",
|
|
85
|
+
linkEditor: "_linkEditor_1avnr_292",
|
|
86
|
+
linkEditorInput: "_linkEditorInput_1avnr_440",
|
|
87
|
+
linkEditorExternalControl: "_linkEditorExternalControl_1avnr_446",
|
|
88
|
+
linkEditorSave: "_linkEditorSave_1avnr_476",
|
|
89
|
+
toolbar: "_toolbar_1avnr_481",
|
|
90
|
+
taskList: "_taskList_1avnr_515"
|
|
72
91
|
};
|
|
73
92
|
//#endregion
|
|
74
93
|
//#region src/RichTextEditor.vue
|
|
@@ -723,6 +742,73 @@ var IconBraces = createIcon("IconBraces", [
|
|
|
723
742
|
path("M10 11l-2 2 2 2"),
|
|
724
743
|
path("M14 11l2 2-2 2")
|
|
725
744
|
]);
|
|
745
|
+
var IconTablePlus = createIcon("IconTablePlus", [
|
|
746
|
+
path("M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5"),
|
|
747
|
+
path("M3 10h18"),
|
|
748
|
+
path("M10 3v18"),
|
|
749
|
+
path("M16 19h6"),
|
|
750
|
+
path("M19 16v6")
|
|
751
|
+
]);
|
|
752
|
+
var IconTableOff = createIcon("IconTableOff", [
|
|
753
|
+
path("M7 3h12a2 2 0 0 1 2 2v12m-.585 3.413a1.994 1.994 0 0 1 -1.415 .587h-14a2 2 0 0 1 -2 -2v-14c0 -.55 .223 -1.05 .583 -1.412"),
|
|
754
|
+
path("M3 10h7m4 0h7"),
|
|
755
|
+
path("M10 3v3m0 4v11"),
|
|
756
|
+
path("M3 3l18 18")
|
|
757
|
+
]);
|
|
758
|
+
var IconColumnInsertLeft = createIcon("IconColumnInsertLeft", [
|
|
759
|
+
path("M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-14a1 1 0 0 1 1 -1z"),
|
|
760
|
+
path("M5 12l4 0"),
|
|
761
|
+
path("M7 10l0 4")
|
|
762
|
+
]);
|
|
763
|
+
var IconColumnInsertRight = createIcon("IconColumnInsertRight", [
|
|
764
|
+
path("M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-14a1 1 0 0 1 1 -1z"),
|
|
765
|
+
path("M15 12l4 0"),
|
|
766
|
+
path("M17 10l0 4")
|
|
767
|
+
]);
|
|
768
|
+
var IconColumnRemove = createIcon("IconColumnRemove", [
|
|
769
|
+
path("M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-14a1 1 0 0 1 1 -1z"),
|
|
770
|
+
path("M16 10l4 4"),
|
|
771
|
+
path("M16 14l4 -4")
|
|
772
|
+
]);
|
|
773
|
+
var IconRowInsertTop = createIcon("IconRowInsertTop", [
|
|
774
|
+
path("M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z"),
|
|
775
|
+
path("M12 9v-4"),
|
|
776
|
+
path("M10 7l4 0")
|
|
777
|
+
]);
|
|
778
|
+
var IconRowInsertBottom = createIcon("IconRowInsertBottom", [
|
|
779
|
+
path("M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"),
|
|
780
|
+
path("M12 15l0 4"),
|
|
781
|
+
path("M14 17l-4 0")
|
|
782
|
+
]);
|
|
783
|
+
var IconRowRemove = createIcon("IconRowRemove", [
|
|
784
|
+
path("M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"),
|
|
785
|
+
path("M10 16l4 4"),
|
|
786
|
+
path("M10 20l4 -4")
|
|
787
|
+
]);
|
|
788
|
+
var IconTableHeaderRow = createIcon("IconTableHeaderRow", [path("M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"), path("M4 9l16 0")]);
|
|
789
|
+
var IconTableHeaderColumn = createIcon("IconTableHeaderColumn", [path("M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"), path("M9 4l0 16")]);
|
|
790
|
+
var IconTableMergeCells = createIcon("IconTableMergeCells", [
|
|
791
|
+
path("M18 10h-4v-4"),
|
|
792
|
+
path("M20 4l-6 6"),
|
|
793
|
+
path("M6 14h4v4"),
|
|
794
|
+
path("M10 14l-6 6")
|
|
795
|
+
]);
|
|
796
|
+
var IconTableSplitCell = createIcon("IconTableSplitCell", [
|
|
797
|
+
path("M12 4l0 16"),
|
|
798
|
+
path("M8 8l-4 4l4 4"),
|
|
799
|
+
path("M16 16l4 -4l-4 -4")
|
|
800
|
+
]);
|
|
801
|
+
var IconDetails = createIcon("IconDetails", [
|
|
802
|
+
path("M8 5l3 3l-3 3"),
|
|
803
|
+
path("M15 8l4 0"),
|
|
804
|
+
path("M5 15l14 0"),
|
|
805
|
+
path("M5 19l14 0")
|
|
806
|
+
]);
|
|
807
|
+
var IconPilcrow = createIcon("IconPilcrow", [
|
|
808
|
+
path("M13 4v16"),
|
|
809
|
+
path("M17 4v16"),
|
|
810
|
+
path("M19 4h-9.5a4.5 4.5 0 0 0 0 9h3.5")
|
|
811
|
+
]);
|
|
726
812
|
//#endregion
|
|
727
813
|
//#region src/RichTextEditorControl/RichTextEditorColorPickerControl.ts
|
|
728
814
|
var RichTextEditorColorPickerControl = factory(/* @__PURE__ */ defineComponent({
|
|
@@ -1047,7 +1133,7 @@ var RichTextEditorSourceCodeControl = factory(/* @__PURE__ */ defineComponent({
|
|
|
1047
1133
|
function toggleSourceCode() {
|
|
1048
1134
|
if (!isSafeEditor(ctx.editor)) return;
|
|
1049
1135
|
if (active.value) ctx.editor.commands.setContent(ctx.editor.getText(), { emitUpdate: true });
|
|
1050
|
-
else ctx.editor.commands.setContent(`<textarea>${ctx.editor.getHTML()}</textarea
|
|
1136
|
+
else ctx.editor.commands.setContent(`<textarea>${ctx.editor.getHTML()}</textarea>`, { emitUpdate: false });
|
|
1051
1137
|
active.value = !active.value;
|
|
1052
1138
|
ctx.onSourceCodeTextSwitch?.(active.value);
|
|
1053
1139
|
}
|
|
@@ -1074,6 +1160,273 @@ var RichTextEditorSourceCodeControl = factory(/* @__PURE__ */ defineComponent({
|
|
|
1074
1160
|
}
|
|
1075
1161
|
}), { classes: RichTextEditor_module_default });
|
|
1076
1162
|
//#endregion
|
|
1163
|
+
//#region src/RichTextEditorControl/RichTextEditorTableInsertControl.vue
|
|
1164
|
+
var RichTextEditorTableInsertControl_default = /* @__PURE__ */ defineComponent({
|
|
1165
|
+
name: "RichTextEditorTableInsertControl",
|
|
1166
|
+
inheritAttrs: false,
|
|
1167
|
+
__name: "RichTextEditorTableInsertControl",
|
|
1168
|
+
props: {
|
|
1169
|
+
maxColumns: { default: 10 },
|
|
1170
|
+
maxRows: { default: 10 },
|
|
1171
|
+
withHeaderRow: {
|
|
1172
|
+
type: Boolean,
|
|
1173
|
+
default: true
|
|
1174
|
+
},
|
|
1175
|
+
popoverProps: { default: void 0 },
|
|
1176
|
+
icon: { default: void 0 },
|
|
1177
|
+
classNames: {},
|
|
1178
|
+
styles: {},
|
|
1179
|
+
vars: {},
|
|
1180
|
+
unstyled: { type: Boolean },
|
|
1181
|
+
active: { type: Boolean },
|
|
1182
|
+
interactive: { type: Boolean },
|
|
1183
|
+
disabled: {
|
|
1184
|
+
type: Boolean,
|
|
1185
|
+
default: void 0
|
|
1186
|
+
},
|
|
1187
|
+
variant: {}
|
|
1188
|
+
},
|
|
1189
|
+
setup(__props) {
|
|
1190
|
+
const props = __props;
|
|
1191
|
+
const attrs = useAttrs();
|
|
1192
|
+
const ctx = useRichTextEditorContext();
|
|
1193
|
+
const opened = ref(false);
|
|
1194
|
+
const selected = ref({
|
|
1195
|
+
columns: 0,
|
|
1196
|
+
rows: 0
|
|
1197
|
+
});
|
|
1198
|
+
const commandDisabled = useEditorSelector(() => ctx.editor, (editor) => !isSafeEditor(editor) || !editor.can().insertTable?.());
|
|
1199
|
+
const disabled = computed(() => props.disabled || commandDisabled.value);
|
|
1200
|
+
const cells = computed(() => Array.from({ length: props.maxRows * props.maxColumns }, (_, index) => ({
|
|
1201
|
+
row: Math.floor(index / props.maxColumns) + 1,
|
|
1202
|
+
column: index % props.maxColumns + 1
|
|
1203
|
+
})));
|
|
1204
|
+
const stylesApi = computed(() => ({
|
|
1205
|
+
classNames: props.classNames,
|
|
1206
|
+
styles: props.styles
|
|
1207
|
+
}));
|
|
1208
|
+
function close() {
|
|
1209
|
+
opened.value = false;
|
|
1210
|
+
selected.value = {
|
|
1211
|
+
columns: 0,
|
|
1212
|
+
rows: 0
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
function insertTable(columns, rows) {
|
|
1216
|
+
close();
|
|
1217
|
+
if (isSafeEditor(ctx.editor)) ctx.editor.chain().focus().insertTable({
|
|
1218
|
+
rows,
|
|
1219
|
+
cols: columns,
|
|
1220
|
+
withHeaderRow: props.withHeaderRow
|
|
1221
|
+
}).run();
|
|
1222
|
+
}
|
|
1223
|
+
return (_ctx, _cache) => {
|
|
1224
|
+
return openBlock(), createBlock(unref(Popover), mergeProps({
|
|
1225
|
+
opened: opened.value,
|
|
1226
|
+
"within-portal": true,
|
|
1227
|
+
"trap-focus": true,
|
|
1228
|
+
shadow: "md",
|
|
1229
|
+
position: "bottom-end"
|
|
1230
|
+
}, props.popoverProps, { onChange: _cache[2] || (_cache[2] = (value) => !value && close()) }), {
|
|
1231
|
+
default: withCtx(() => [createVNode(unref(Popover).Target, null, {
|
|
1232
|
+
default: withCtx(() => [createVNode(RichTextEditorControlBase_default, mergeProps(unref(attrs), {
|
|
1233
|
+
active: opened.value,
|
|
1234
|
+
disabled: disabled.value,
|
|
1235
|
+
variant: props.variant ?? unref(ctx).variant,
|
|
1236
|
+
"aria-label": unref(ctx).labels.tableInsertControlLabel,
|
|
1237
|
+
title: unref(ctx).labels.tableInsertControlLabel,
|
|
1238
|
+
onClick: _cache[0] || (_cache[0] = ($event) => opened.value ? close() : opened.value = true)
|
|
1239
|
+
}), {
|
|
1240
|
+
icon: withCtx((iconProps) => [renderSlot(_ctx.$slots, "icon", normalizeProps(guardReactiveProps(iconProps)), () => [(openBlock(), createBlock(resolveDynamicComponent(props.icon ?? unref(IconTablePlus)), normalizeProps(guardReactiveProps(iconProps)), null, 16))])]),
|
|
1241
|
+
_: 3
|
|
1242
|
+
}, 16, [
|
|
1243
|
+
"active",
|
|
1244
|
+
"disabled",
|
|
1245
|
+
"variant",
|
|
1246
|
+
"aria-label",
|
|
1247
|
+
"title"
|
|
1248
|
+
])]),
|
|
1249
|
+
_: 3
|
|
1250
|
+
}), createVNode(unref(Popover).Dropdown, normalizeProps(guardReactiveProps(unref(ctx).getStyles("tableInsertDropdown", stylesApi.value))), {
|
|
1251
|
+
default: withCtx(() => [createElementVNode("div", mergeProps(unref(ctx).getStyles("tableInsertGrid", stylesApi.value), {
|
|
1252
|
+
style: { "--rte-table-insert-columns": props.maxColumns },
|
|
1253
|
+
onMouseleave: _cache[1] || (_cache[1] = ($event) => selected.value = {
|
|
1254
|
+
columns: 0,
|
|
1255
|
+
rows: 0
|
|
1256
|
+
})
|
|
1257
|
+
}), [(openBlock(true), createElementBlock(Fragment, null, renderList(cells.value, (cell) => {
|
|
1258
|
+
return openBlock(), createBlock(unref(UnstyledButton), mergeProps({ key: `${cell.row}-${cell.column}` }, { ref_for: true }, unref(ctx).getStyles("tableInsertCell", stylesApi.value), {
|
|
1259
|
+
"data-active": cell.column <= selected.value.columns && cell.row <= selected.value.rows || void 0,
|
|
1260
|
+
"aria-label": unref(ctx).labels.tableInsertLabel(cell.column, cell.row),
|
|
1261
|
+
onMouseenter: ($event) => selected.value = {
|
|
1262
|
+
columns: cell.column,
|
|
1263
|
+
rows: cell.row
|
|
1264
|
+
},
|
|
1265
|
+
onFocus: ($event) => selected.value = {
|
|
1266
|
+
columns: cell.column,
|
|
1267
|
+
rows: cell.row
|
|
1268
|
+
},
|
|
1269
|
+
onClick: ($event) => insertTable(cell.column, cell.row)
|
|
1270
|
+
}), null, 16, [
|
|
1271
|
+
"data-active",
|
|
1272
|
+
"aria-label",
|
|
1273
|
+
"onMouseenter",
|
|
1274
|
+
"onFocus",
|
|
1275
|
+
"onClick"
|
|
1276
|
+
]);
|
|
1277
|
+
}), 128))], 16), createElementVNode("div", normalizeProps(guardReactiveProps(unref(ctx).getStyles("tableInsertLabel", stylesApi.value))), toDisplayString(selected.value.columns ? `${selected.value.columns} × ${selected.value.rows}` : unref(ctx).labels.tableInsertControlLabel), 17)]),
|
|
1278
|
+
_: 1
|
|
1279
|
+
}, 16)]),
|
|
1280
|
+
_: 3
|
|
1281
|
+
}, 16, ["opened"]);
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region src/RichTextEditorControl/RichTextEditorDetailsControl.vue
|
|
1287
|
+
var RichTextEditorDetailsControl_default = /* @__PURE__ */ defineComponent({
|
|
1288
|
+
name: "RichTextEditorDetailsControl",
|
|
1289
|
+
inheritAttrs: false,
|
|
1290
|
+
__name: "RichTextEditorDetailsControl",
|
|
1291
|
+
props: {
|
|
1292
|
+
icon: { default: void 0 },
|
|
1293
|
+
classNames: {},
|
|
1294
|
+
styles: {},
|
|
1295
|
+
vars: {},
|
|
1296
|
+
unstyled: { type: Boolean },
|
|
1297
|
+
active: {
|
|
1298
|
+
type: Boolean,
|
|
1299
|
+
default: void 0
|
|
1300
|
+
},
|
|
1301
|
+
interactive: {
|
|
1302
|
+
type: Boolean,
|
|
1303
|
+
default: true
|
|
1304
|
+
},
|
|
1305
|
+
disabled: {
|
|
1306
|
+
type: Boolean,
|
|
1307
|
+
default: void 0
|
|
1308
|
+
},
|
|
1309
|
+
variant: {}
|
|
1310
|
+
},
|
|
1311
|
+
setup(__props) {
|
|
1312
|
+
const props = __props;
|
|
1313
|
+
const attrs = useAttrs();
|
|
1314
|
+
const ctx = useRichTextEditorContext();
|
|
1315
|
+
const state = useEditorSelector(() => ctx.editor, (editor) => {
|
|
1316
|
+
const safeEditor = isSafeEditor(editor) ? editor : null;
|
|
1317
|
+
if (!safeEditor) return {
|
|
1318
|
+
active: false,
|
|
1319
|
+
disabled: true
|
|
1320
|
+
};
|
|
1321
|
+
const commands = safeEditor.can();
|
|
1322
|
+
const canSet = Boolean(commands.setDetails?.());
|
|
1323
|
+
const canUnset = Boolean(commands.unsetDetails?.());
|
|
1324
|
+
return {
|
|
1325
|
+
active: canUnset,
|
|
1326
|
+
disabled: !canSet && !canUnset
|
|
1327
|
+
};
|
|
1328
|
+
});
|
|
1329
|
+
const active = computed(() => props.active ?? state.value.active);
|
|
1330
|
+
const disabled = computed(() => props.disabled || state.value.disabled);
|
|
1331
|
+
function toggle() {
|
|
1332
|
+
if (!isSafeEditor(ctx.editor)) return;
|
|
1333
|
+
const chain = ctx.editor.chain().focus();
|
|
1334
|
+
if (ctx.editor.can().unsetDetails?.()) chain.unsetDetails().run();
|
|
1335
|
+
else chain.setDetails().run();
|
|
1336
|
+
}
|
|
1337
|
+
return (_ctx, _cache) => {
|
|
1338
|
+
return openBlock(), createBlock(RichTextEditorControlBase_default, mergeProps(unref(attrs), {
|
|
1339
|
+
active: active.value,
|
|
1340
|
+
disabled: disabled.value,
|
|
1341
|
+
interactive: props.interactive,
|
|
1342
|
+
variant: props.variant ?? unref(ctx).variant,
|
|
1343
|
+
"aria-label": unref(ctx).labels.detailsControlLabel,
|
|
1344
|
+
title: unref(ctx).labels.detailsControlLabel,
|
|
1345
|
+
onClick: toggle
|
|
1346
|
+
}), {
|
|
1347
|
+
icon: withCtx((iconProps) => [renderSlot(_ctx.$slots, "icon", normalizeProps(guardReactiveProps(iconProps)), () => [(openBlock(), createBlock(resolveDynamicComponent(props.icon ?? unref(IconDetails)), normalizeProps(guardReactiveProps(iconProps)), null, 16))])]),
|
|
1348
|
+
_: 3
|
|
1349
|
+
}, 16, [
|
|
1350
|
+
"active",
|
|
1351
|
+
"disabled",
|
|
1352
|
+
"interactive",
|
|
1353
|
+
"variant",
|
|
1354
|
+
"aria-label",
|
|
1355
|
+
"title"
|
|
1356
|
+
]);
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
//#endregion
|
|
1361
|
+
//#region src/RichTextEditorControl/RichTextEditorInvisibleCharactersControl.vue
|
|
1362
|
+
var RichTextEditorInvisibleCharactersControl_default = /* @__PURE__ */ defineComponent({
|
|
1363
|
+
name: "RichTextEditorInvisibleCharactersControl",
|
|
1364
|
+
inheritAttrs: false,
|
|
1365
|
+
__name: "RichTextEditorInvisibleCharactersControl",
|
|
1366
|
+
props: {
|
|
1367
|
+
icon: { default: void 0 },
|
|
1368
|
+
classNames: {},
|
|
1369
|
+
styles: {},
|
|
1370
|
+
vars: {},
|
|
1371
|
+
unstyled: { type: Boolean },
|
|
1372
|
+
active: {
|
|
1373
|
+
type: Boolean,
|
|
1374
|
+
default: void 0
|
|
1375
|
+
},
|
|
1376
|
+
interactive: {
|
|
1377
|
+
type: Boolean,
|
|
1378
|
+
default: true
|
|
1379
|
+
},
|
|
1380
|
+
disabled: {
|
|
1381
|
+
type: Boolean,
|
|
1382
|
+
default: void 0
|
|
1383
|
+
},
|
|
1384
|
+
variant: {}
|
|
1385
|
+
},
|
|
1386
|
+
setup(__props) {
|
|
1387
|
+
const props = __props;
|
|
1388
|
+
const attrs = useAttrs();
|
|
1389
|
+
const ctx = useRichTextEditorContext();
|
|
1390
|
+
const state = useEditorSelector(() => ctx.editor, (editor) => {
|
|
1391
|
+
const safeEditor = isSafeEditor(editor) ? editor : null;
|
|
1392
|
+
if (!safeEditor) return {
|
|
1393
|
+
active: false,
|
|
1394
|
+
disabled: true
|
|
1395
|
+
};
|
|
1396
|
+
return {
|
|
1397
|
+
active: Boolean(safeEditor.storage.invisibleCharacters?.visibility?.()),
|
|
1398
|
+
disabled: !safeEditor.can().toggleInvisibleCharacters?.()
|
|
1399
|
+
};
|
|
1400
|
+
});
|
|
1401
|
+
const active = computed(() => props.active ?? state.value.active);
|
|
1402
|
+
const disabled = computed(() => props.disabled || state.value.disabled);
|
|
1403
|
+
function toggle() {
|
|
1404
|
+
if (isSafeEditor(ctx.editor)) ctx.editor.chain().focus().toggleInvisibleCharacters().run();
|
|
1405
|
+
}
|
|
1406
|
+
return (_ctx, _cache) => {
|
|
1407
|
+
return openBlock(), createBlock(RichTextEditorControlBase_default, mergeProps(unref(attrs), {
|
|
1408
|
+
active: active.value,
|
|
1409
|
+
disabled: disabled.value,
|
|
1410
|
+
interactive: props.interactive,
|
|
1411
|
+
variant: props.variant ?? unref(ctx).variant,
|
|
1412
|
+
"aria-label": unref(ctx).labels.invisibleCharactersControlLabel,
|
|
1413
|
+
title: unref(ctx).labels.invisibleCharactersControlLabel,
|
|
1414
|
+
onClick: toggle
|
|
1415
|
+
}), {
|
|
1416
|
+
icon: withCtx((iconProps) => [renderSlot(_ctx.$slots, "icon", normalizeProps(guardReactiveProps(iconProps)), () => [(openBlock(), createBlock(resolveDynamicComponent(props.icon ?? unref(IconPilcrow)), normalizeProps(guardReactiveProps(iconProps)), null, 16))])]),
|
|
1417
|
+
_: 3
|
|
1418
|
+
}, 16, [
|
|
1419
|
+
"active",
|
|
1420
|
+
"disabled",
|
|
1421
|
+
"interactive",
|
|
1422
|
+
"variant",
|
|
1423
|
+
"aria-label",
|
|
1424
|
+
"title"
|
|
1425
|
+
]);
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
});
|
|
1429
|
+
//#endregion
|
|
1077
1430
|
//#region src/RichTextEditorControl/controls.ts
|
|
1078
1431
|
var BoldControl = createControl({
|
|
1079
1432
|
label: "boldControlLabel",
|
|
@@ -1307,6 +1660,72 @@ var TaskListLiftControl = createControl({
|
|
|
1307
1660
|
},
|
|
1308
1661
|
isDisabled: (editor) => !editor?.can().liftListItem("taskItem")
|
|
1309
1662
|
});
|
|
1663
|
+
var TableDeleteControl = createControl({
|
|
1664
|
+
label: "tableDeleteControlLabel",
|
|
1665
|
+
icon: IconTableOff,
|
|
1666
|
+
operation: { name: "deleteTable" },
|
|
1667
|
+
isDisabled: (editor) => !editor.can().deleteTable?.()
|
|
1668
|
+
});
|
|
1669
|
+
var TableColumnBeforeControl = createControl({
|
|
1670
|
+
label: "tableColumnBeforeControlLabel",
|
|
1671
|
+
icon: IconColumnInsertLeft,
|
|
1672
|
+
operation: { name: "addColumnBefore" },
|
|
1673
|
+
isDisabled: (editor) => !editor.can().addColumnBefore?.()
|
|
1674
|
+
});
|
|
1675
|
+
var TableColumnAfterControl = createControl({
|
|
1676
|
+
label: "tableColumnAfterControlLabel",
|
|
1677
|
+
icon: IconColumnInsertRight,
|
|
1678
|
+
operation: { name: "addColumnAfter" },
|
|
1679
|
+
isDisabled: (editor) => !editor.can().addColumnAfter?.()
|
|
1680
|
+
});
|
|
1681
|
+
var TableColumnDeleteControl = createControl({
|
|
1682
|
+
label: "tableColumnDeleteControlLabel",
|
|
1683
|
+
icon: IconColumnRemove,
|
|
1684
|
+
operation: { name: "deleteColumn" },
|
|
1685
|
+
isDisabled: (editor) => !editor.can().deleteColumn?.()
|
|
1686
|
+
});
|
|
1687
|
+
var TableRowBeforeControl = createControl({
|
|
1688
|
+
label: "tableRowBeforeControlLabel",
|
|
1689
|
+
icon: IconRowInsertTop,
|
|
1690
|
+
operation: { name: "addRowBefore" },
|
|
1691
|
+
isDisabled: (editor) => !editor.can().addRowBefore?.()
|
|
1692
|
+
});
|
|
1693
|
+
var TableRowAfterControl = createControl({
|
|
1694
|
+
label: "tableRowAfterControlLabel",
|
|
1695
|
+
icon: IconRowInsertBottom,
|
|
1696
|
+
operation: { name: "addRowAfter" },
|
|
1697
|
+
isDisabled: (editor) => !editor.can().addRowAfter?.()
|
|
1698
|
+
});
|
|
1699
|
+
var TableRowDeleteControl = createControl({
|
|
1700
|
+
label: "tableRowDeleteControlLabel",
|
|
1701
|
+
icon: IconRowRemove,
|
|
1702
|
+
operation: { name: "deleteRow" },
|
|
1703
|
+
isDisabled: (editor) => !editor.can().deleteRow?.()
|
|
1704
|
+
});
|
|
1705
|
+
var TableToggleHeaderRowControl = createControl({
|
|
1706
|
+
label: "tableToggleHeaderRowControlLabel",
|
|
1707
|
+
icon: IconTableHeaderRow,
|
|
1708
|
+
operation: { name: "toggleHeaderRow" },
|
|
1709
|
+
isDisabled: (editor) => !editor.can().toggleHeaderRow?.()
|
|
1710
|
+
});
|
|
1711
|
+
var TableToggleHeaderColumnControl = createControl({
|
|
1712
|
+
label: "tableToggleHeaderColumnControlLabel",
|
|
1713
|
+
icon: IconTableHeaderColumn,
|
|
1714
|
+
operation: { name: "toggleHeaderColumn" },
|
|
1715
|
+
isDisabled: (editor) => !editor.can().toggleHeaderColumn?.()
|
|
1716
|
+
});
|
|
1717
|
+
var TableMergeCellsControl = createControl({
|
|
1718
|
+
label: "tableMergeCellsControlLabel",
|
|
1719
|
+
icon: IconTableMergeCells,
|
|
1720
|
+
operation: { name: "mergeCells" },
|
|
1721
|
+
isDisabled: (editor) => !editor.can().mergeCells?.()
|
|
1722
|
+
});
|
|
1723
|
+
var TableSplitCellControl = createControl({
|
|
1724
|
+
label: "tableSplitCellControlLabel",
|
|
1725
|
+
icon: IconTableSplitCell,
|
|
1726
|
+
operation: { name: "splitCell" },
|
|
1727
|
+
isDisabled: (editor) => !editor.can().splitCell?.()
|
|
1728
|
+
});
|
|
1310
1729
|
//#endregion
|
|
1311
1730
|
//#region src/RichTextEditorControlsGroup/RichTextEditorControlsGroup.ts
|
|
1312
1731
|
var RichTextEditorControlsGroup = factory(/* @__PURE__ */ defineComponent({
|
|
@@ -1431,7 +1850,21 @@ var RichTextEditor = factory(RichTextEditor_default, {
|
|
|
1431
1850
|
TaskList: TaskListControl,
|
|
1432
1851
|
TaskListSink: TaskListSinkControl,
|
|
1433
1852
|
TaskListLift: TaskListLiftControl,
|
|
1434
|
-
SourceCode: RichTextEditorSourceCodeControl
|
|
1853
|
+
SourceCode: RichTextEditorSourceCodeControl,
|
|
1854
|
+
TableInsert: RichTextEditorTableInsertControl_default,
|
|
1855
|
+
TableDelete: TableDeleteControl,
|
|
1856
|
+
TableColumnBefore: TableColumnBeforeControl,
|
|
1857
|
+
TableColumnAfter: TableColumnAfterControl,
|
|
1858
|
+
TableColumnDelete: TableColumnDeleteControl,
|
|
1859
|
+
TableRowBefore: TableRowBeforeControl,
|
|
1860
|
+
TableRowAfter: TableRowAfterControl,
|
|
1861
|
+
TableRowDelete: TableRowDeleteControl,
|
|
1862
|
+
TableToggleHeaderRow: TableToggleHeaderRowControl,
|
|
1863
|
+
TableToggleHeaderColumn: TableToggleHeaderColumnControl,
|
|
1864
|
+
TableMergeCells: TableMergeCellsControl,
|
|
1865
|
+
TableSplitCell: TableSplitCellControl,
|
|
1866
|
+
Details: RichTextEditorDetailsControl_default,
|
|
1867
|
+
InvisibleCharacters: RichTextEditorInvisibleCharactersControl_default
|
|
1435
1868
|
});
|
|
1436
1869
|
//#endregion
|
|
1437
1870
|
//#region src/extensions/Link.ts
|
|
@@ -1452,6 +1885,6 @@ var getTaskListExtension = (TipTapTaskList) => TipTapTaskList.extend({ addKeyboa
|
|
|
1452
1885
|
}
|
|
1453
1886
|
}) }).configure({ HTMLAttributes: { class: `${RichTextEditor_module_default.taskList} mantine-RichTextEditor-taskList` } });
|
|
1454
1887
|
//#endregion
|
|
1455
|
-
export { AlignCenterControl, AlignJustifyControl, AlignLeftControl, AlignRightControl, BlockquoteControl, BoldControl, BulletListControl, ClearFormattingControl, CodeBlockControl, CodeControl, DEFAULT_LABELS, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, HighlightControl, HrControl, ItalicControl, Link, OrderedListControl, RedoControl, RichTextEditor, RichTextEditorColorControl, RichTextEditorColorPickerControl, RichTextEditorControl, RichTextEditorControlBase, RichTextEditorLinkControl, RichTextEditorSourceCodeControl, StrikeThroughControl, SubscriptControl, SuperscriptControl, TaskListControl, TaskListLiftControl, TaskListSinkControl, UnderlineControl, UndoControl, UnlinkControl, UnsetColorControl, createControl, getTaskListExtension, useRichTextEditorContext };
|
|
1888
|
+
export { AlignCenterControl, AlignJustifyControl, AlignLeftControl, AlignRightControl, BlockquoteControl, BoldControl, BulletListControl, ClearFormattingControl, CodeBlockControl, CodeControl, DEFAULT_LABELS, H1Control, H2Control, H3Control, H4Control, H5Control, H6Control, HighlightControl, HrControl, ItalicControl, Link, OrderedListControl, RedoControl, RichTextEditor, RichTextEditorColorControl, RichTextEditorColorPickerControl, RichTextEditorControl, RichTextEditorControlBase, RichTextEditorDetailsControl_default as RichTextEditorDetailsControl, RichTextEditorInvisibleCharactersControl_default as RichTextEditorInvisibleCharactersControl, RichTextEditorLinkControl, RichTextEditorSourceCodeControl, RichTextEditorTableInsertControl_default as RichTextEditorTableInsertControl, StrikeThroughControl, SubscriptControl, SuperscriptControl, TableColumnAfterControl, TableColumnBeforeControl, TableColumnDeleteControl, TableDeleteControl, TableMergeCellsControl, TableRowAfterControl, TableRowBeforeControl, TableRowDeleteControl, TableSplitCellControl, TableToggleHeaderColumnControl, TableToggleHeaderRowControl, TaskListControl, TaskListLiftControl, TaskListSinkControl, UnderlineControl, UndoControl, UnlinkControl, UnsetColorControl, createControl, getTaskListExtension, useRichTextEditorContext };
|
|
1456
1889
|
|
|
1457
1890
|
//# sourceMappingURL=index.mjs.map
|