@ni/nimble-components 32.8.0 → 32.8.2
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 +7 -7
- package/dist/all-components-bundle.js +306 -148
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2216 -2191
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/checkbox/styles.js +8 -3
- package/dist/esm/checkbox/styles.js.map +1 -1
- package/dist/esm/checkbox/template.js +21 -19
- package/dist/esm/checkbox/template.js.map +1 -1
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.js +1 -1
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.js.map +1 -1
- package/dist/esm/switch/styles.js +2 -1
- package/dist/esm/switch/styles.js.map +1 -1
- package/dist/esm/table/components/row/styles.js +4 -2
- package/dist/esm/table/components/row/styles.js.map +1 -1
- package/dist/esm/table/styles.js +5 -2
- package/dist/esm/table/styles.js.map +1 -1
- package/package.json +17 -17
|
@@ -20371,12 +20371,11 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20371
20371
|
`;
|
|
20372
20372
|
|
|
20373
20373
|
const styles$L = css `
|
|
20374
|
-
${display('inline-
|
|
20374
|
+
${display('inline-grid')}
|
|
20375
20375
|
${styles$M}
|
|
20376
20376
|
|
|
20377
20377
|
:host {
|
|
20378
20378
|
font: ${bodyFont};
|
|
20379
|
-
align-items: center;
|
|
20380
20379
|
cursor: pointer;
|
|
20381
20380
|
outline: none;
|
|
20382
20381
|
${userSelectNone}
|
|
@@ -20387,8 +20386,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20387
20386
|
cursor: default;
|
|
20388
20387
|
}
|
|
20389
20388
|
|
|
20390
|
-
.container {
|
|
20389
|
+
.outer-container {
|
|
20390
|
+
height: 100%;
|
|
20391
|
+
display: flex;
|
|
20392
|
+
align-items: center;
|
|
20391
20393
|
position: relative;
|
|
20394
|
+
}
|
|
20395
|
+
|
|
20396
|
+
.container {
|
|
20392
20397
|
display: grid;
|
|
20393
20398
|
grid-template-columns: auto 1fr auto;
|
|
20394
20399
|
grid-template-rows: ${bodyFontLineHeight} auto;
|
|
@@ -20513,27 +20518,29 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20513
20518
|
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
20514
20519
|
class="${x => (x.readOnly ? 'readonly' : '')} ${x => (x.checked ? 'checked' : '')} ${x => (x.indeterminate ? 'indeterminate' : '')}"
|
|
20515
20520
|
>
|
|
20516
|
-
<div
|
|
20517
|
-
<div part="
|
|
20518
|
-
<
|
|
20519
|
-
|
|
20520
|
-
|
|
20521
|
-
|
|
20522
|
-
|
|
20523
|
-
|
|
20524
|
-
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
|
|
20521
|
+
<div class="outer-container">
|
|
20522
|
+
<div part="container" class="container">
|
|
20523
|
+
<div part="control" class="control">
|
|
20524
|
+
<slot name="checked-indicator">
|
|
20525
|
+
${definition.checkedIndicator || ''}
|
|
20526
|
+
</slot>
|
|
20527
|
+
<slot name="indeterminate-indicator">
|
|
20528
|
+
${definition.indeterminateIndicator || ''}
|
|
20529
|
+
</slot>
|
|
20530
|
+
</div>
|
|
20531
|
+
<label
|
|
20532
|
+
part="label"
|
|
20533
|
+
class="${x => (x.defaultSlottedNodes?.length
|
|
20528
20534
|
? 'label'
|
|
20529
20535
|
: 'label label__hidden')}"
|
|
20530
|
-
|
|
20531
|
-
|
|
20532
|
-
|
|
20533
|
-
|
|
20534
|
-
|
|
20535
|
-
|
|
20536
|
-
|
|
20536
|
+
>
|
|
20537
|
+
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
20538
|
+
</label>
|
|
20539
|
+
<${iconExclamationMarkTag}
|
|
20540
|
+
severity="error"
|
|
20541
|
+
class="error-icon"
|
|
20542
|
+
></${iconExclamationMarkTag}>
|
|
20543
|
+
</div>
|
|
20537
20544
|
${errorTextTemplate}
|
|
20538
20545
|
</div>
|
|
20539
20546
|
</template>
|
|
@@ -27222,7 +27229,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27222
27229
|
*/
|
|
27223
27230
|
constructor(
|
|
27224
27231
|
/**
|
|
27225
|
-
|
|
27232
|
+
The child nodes in this fragment.
|
|
27226
27233
|
*/
|
|
27227
27234
|
content, size) {
|
|
27228
27235
|
this.content = content;
|
|
@@ -28334,6 +28341,10 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
28334
28341
|
this.content = content || Fragment.empty;
|
|
28335
28342
|
}
|
|
28336
28343
|
/**
|
|
28344
|
+
The array of this node's child nodes.
|
|
28345
|
+
*/
|
|
28346
|
+
get children() { return this.content.content; }
|
|
28347
|
+
/**
|
|
28337
28348
|
The size of this node, as defined by the integer-based [indexing
|
|
28338
28349
|
scheme](/docs/guide/#doc.indexing). For text nodes, this is the
|
|
28339
28350
|
amount of characters. For other leaf nodes, it is one. For
|
|
@@ -29029,16 +29040,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
29029
29040
|
stream.err("Unexpected token '" + stream.next + "'");
|
|
29030
29041
|
}
|
|
29031
29042
|
}
|
|
29032
|
-
|
|
29033
|
-
|
|
29034
|
-
|
|
29035
|
-
|
|
29036
|
-
|
|
29037
|
-
|
|
29038
|
-
|
|
29039
|
-
|
|
29040
|
-
necessary.
|
|
29041
|
-
*/
|
|
29043
|
+
// Construct an NFA from an expression as returned by the parser. The
|
|
29044
|
+
// NFA is represented as an array of states, which are themselves
|
|
29045
|
+
// arrays of edges, which are `{term, to}` objects. The first state is
|
|
29046
|
+
// the entry state and the last node is the success state.
|
|
29047
|
+
//
|
|
29048
|
+
// Note that unlike typical NFAs, the edge ordering in this one is
|
|
29049
|
+
// significant, in that it is used to contruct filler content when
|
|
29050
|
+
// necessary.
|
|
29042
29051
|
function nfa(expr) {
|
|
29043
29052
|
let nfa = [[]];
|
|
29044
29053
|
connect(compile(expr, 0), node());
|
|
@@ -34738,18 +34747,19 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
34738
34747
|
// custom things with the selection. Note that this falls apart when
|
|
34739
34748
|
// a selection starts in such a node and ends in another, in which
|
|
34740
34749
|
// case we just use whatever domFromPos produces as a best effort.
|
|
34741
|
-
setSelection(anchor, head,
|
|
34750
|
+
setSelection(anchor, head, view, force = false) {
|
|
34742
34751
|
// If the selection falls entirely in a child, give it to that child
|
|
34743
34752
|
let from = Math.min(anchor, head), to = Math.max(anchor, head);
|
|
34744
34753
|
for (let i = 0, offset = 0; i < this.children.length; i++) {
|
|
34745
34754
|
let child = this.children[i], end = offset + child.size;
|
|
34746
34755
|
if (from > offset && to < end)
|
|
34747
|
-
return child.setSelection(anchor - offset - child.border, head - offset - child.border,
|
|
34756
|
+
return child.setSelection(anchor - offset - child.border, head - offset - child.border, view, force);
|
|
34748
34757
|
offset = end;
|
|
34749
34758
|
}
|
|
34750
34759
|
let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);
|
|
34751
34760
|
let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);
|
|
34752
|
-
let domSel = root.getSelection();
|
|
34761
|
+
let domSel = view.root.getSelection();
|
|
34762
|
+
let selRange = view.domSelectionRange();
|
|
34753
34763
|
let brKludge = false;
|
|
34754
34764
|
// On Firefox, using Selection.collapse to put the cursor after a
|
|
34755
34765
|
// BR node for some reason doesn't always work (#1073). On Safari,
|
|
@@ -34780,14 +34790,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
34780
34790
|
}
|
|
34781
34791
|
// Firefox can act strangely when the selection is in front of an
|
|
34782
34792
|
// uneditable node. See #1163 and https://bugzilla.mozilla.org/show_bug.cgi?id=1709536
|
|
34783
|
-
if (gecko &&
|
|
34784
|
-
let after =
|
|
34793
|
+
if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && selRange.focusNode.nodeType == 1) {
|
|
34794
|
+
let after = selRange.focusNode.childNodes[selRange.focusOffset];
|
|
34785
34795
|
if (after && after.contentEditable == "false")
|
|
34786
34796
|
force = true;
|
|
34787
34797
|
}
|
|
34788
34798
|
if (!(force || brKludge && safari) &&
|
|
34789
|
-
isEquivalentPosition(anchorDOM.node, anchorDOM.offset,
|
|
34790
|
-
isEquivalentPosition(headDOM.node, headDOM.offset,
|
|
34799
|
+
isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) &&
|
|
34800
|
+
isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset))
|
|
34791
34801
|
return;
|
|
34792
34802
|
// Selection.extend can be used to create an 'inverted' selection
|
|
34793
34803
|
// (one where the focus is before the anchor), but not all
|
|
@@ -34976,6 +34986,9 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
34976
34986
|
copy.children = nodes;
|
|
34977
34987
|
return copy;
|
|
34978
34988
|
}
|
|
34989
|
+
ignoreMutation(mutation) {
|
|
34990
|
+
return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);
|
|
34991
|
+
}
|
|
34979
34992
|
destroy() {
|
|
34980
34993
|
if (this.spec.destroy)
|
|
34981
34994
|
this.spec.destroy();
|
|
@@ -35319,9 +35332,9 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
35319
35332
|
deselectNode() {
|
|
35320
35333
|
this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
|
|
35321
35334
|
}
|
|
35322
|
-
setSelection(anchor, head,
|
|
35323
|
-
this.spec.setSelection ? this.spec.setSelection(anchor, head, root)
|
|
35324
|
-
: super.setSelection(anchor, head,
|
|
35335
|
+
setSelection(anchor, head, view, force) {
|
|
35336
|
+
this.spec.setSelection ? this.spec.setSelection(anchor, head, view.root)
|
|
35337
|
+
: super.setSelection(anchor, head, view, force);
|
|
35325
35338
|
}
|
|
35326
35339
|
destroy() {
|
|
35327
35340
|
if (this.spec.destroy)
|
|
@@ -35981,7 +35994,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
35981
35994
|
if (!sel.empty && !sel.$from.parent.inlineContent)
|
|
35982
35995
|
resetEditableTo = temporarilyEditableNear(view, sel.to);
|
|
35983
35996
|
}
|
|
35984
|
-
view.docView.setSelection(anchor, head, view
|
|
35997
|
+
view.docView.setSelection(anchor, head, view, force);
|
|
35985
35998
|
if (brokenSelectBetweenUneditable) {
|
|
35986
35999
|
if (resetEditableFrom)
|
|
35987
36000
|
resetEditable(resetEditableFrom);
|
|
@@ -40609,6 +40622,13 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
40609
40622
|
}
|
|
40610
40623
|
return this;
|
|
40611
40624
|
}
|
|
40625
|
+
once(event, fn) {
|
|
40626
|
+
const onceFn = (...args) => {
|
|
40627
|
+
this.off(event, onceFn);
|
|
40628
|
+
fn.apply(this, args);
|
|
40629
|
+
};
|
|
40630
|
+
return this.on(event, onceFn);
|
|
40631
|
+
}
|
|
40612
40632
|
removeAllListeners() {
|
|
40613
40633
|
this.callbacks = {};
|
|
40614
40634
|
}
|
|
@@ -40914,6 +40934,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
40914
40934
|
draggable: callOrReturn(getExtensionField(extension, 'draggable', context)),
|
|
40915
40935
|
code: callOrReturn(getExtensionField(extension, 'code', context)),
|
|
40916
40936
|
whitespace: callOrReturn(getExtensionField(extension, 'whitespace', context)),
|
|
40937
|
+
linebreakReplacement: callOrReturn(getExtensionField(extension, 'linebreakReplacement', context)),
|
|
40917
40938
|
defining: callOrReturn(getExtensionField(extension, 'defining', context)),
|
|
40918
40939
|
isolating: callOrReturn(getExtensionField(extension, 'isolating', context)),
|
|
40919
40940
|
attrs: Object.fromEntries(extensionAttributes.map(extensionAttribute => {
|
|
@@ -41007,6 +41028,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41007
41028
|
return enabled;
|
|
41008
41029
|
}
|
|
41009
41030
|
|
|
41031
|
+
function getHTMLFromFragment(fragment, schema) {
|
|
41032
|
+
const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
|
|
41033
|
+
const temporaryDocument = document.implementation.createHTMLDocument();
|
|
41034
|
+
const container = temporaryDocument.createElement('div');
|
|
41035
|
+
container.appendChild(documentFragment);
|
|
41036
|
+
return container.innerHTML;
|
|
41037
|
+
}
|
|
41038
|
+
|
|
41010
41039
|
/**
|
|
41011
41040
|
* Returns the text content of a resolved prosemirror position
|
|
41012
41041
|
* @param $from The resolved position to get the text content from
|
|
@@ -41136,7 +41165,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41136
41165
|
init() {
|
|
41137
41166
|
return null;
|
|
41138
41167
|
},
|
|
41139
|
-
apply(tr, prev) {
|
|
41168
|
+
apply(tr, prev, state) {
|
|
41140
41169
|
const stored = tr.getMeta(plugin);
|
|
41141
41170
|
if (stored) {
|
|
41142
41171
|
return stored;
|
|
@@ -41146,7 +41175,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41146
41175
|
const isSimulatedInput = !!simulatedInputMeta;
|
|
41147
41176
|
if (isSimulatedInput) {
|
|
41148
41177
|
setTimeout(() => {
|
|
41149
|
-
|
|
41178
|
+
let { text } = simulatedInputMeta;
|
|
41179
|
+
if (typeof text === 'string') {
|
|
41180
|
+
text = text;
|
|
41181
|
+
}
|
|
41182
|
+
else {
|
|
41183
|
+
text = getHTMLFromFragment(Fragment.from(text), state.schema);
|
|
41184
|
+
}
|
|
41185
|
+
const { from } = simulatedInputMeta;
|
|
41150
41186
|
const to = from + text.length;
|
|
41151
41187
|
run$1$1({
|
|
41152
41188
|
editor,
|
|
@@ -41339,7 +41375,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41339
41375
|
|
|
41340
41376
|
/**
|
|
41341
41377
|
* Paste rules are used to react to pasted content.
|
|
41342
|
-
* @see https://tiptap.dev/
|
|
41378
|
+
* @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#paste-rules
|
|
41343
41379
|
*/
|
|
41344
41380
|
class PasteRule {
|
|
41345
41381
|
constructor(config) {
|
|
@@ -41429,7 +41465,13 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41429
41465
|
let isPastedFromProseMirror = false;
|
|
41430
41466
|
let isDroppedFromProseMirror = false;
|
|
41431
41467
|
let pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
41432
|
-
let dropEvent
|
|
41468
|
+
let dropEvent;
|
|
41469
|
+
try {
|
|
41470
|
+
dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
41471
|
+
}
|
|
41472
|
+
catch (e) {
|
|
41473
|
+
dropEvent = null;
|
|
41474
|
+
}
|
|
41433
41475
|
const processEvent = ({ state, from, to, rule, pasteEvt, }) => {
|
|
41434
41476
|
const tr = state.tr;
|
|
41435
41477
|
const chainableState = createChainableState({
|
|
@@ -41448,7 +41490,12 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41448
41490
|
if (!handler || !tr.steps.length) {
|
|
41449
41491
|
return;
|
|
41450
41492
|
}
|
|
41451
|
-
|
|
41493
|
+
try {
|
|
41494
|
+
dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
41495
|
+
}
|
|
41496
|
+
catch (e) {
|
|
41497
|
+
dropEvent = null;
|
|
41498
|
+
}
|
|
41452
41499
|
pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
41453
41500
|
return tr;
|
|
41454
41501
|
};
|
|
@@ -41497,7 +41544,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
41497
41544
|
}
|
|
41498
41545
|
// Handle simulated paste
|
|
41499
41546
|
if (isSimulatedPaste) {
|
|
41500
|
-
|
|
41547
|
+
let { text } = simulatedPasteMeta;
|
|
41548
|
+
if (typeof text === 'string') {
|
|
41549
|
+
text = text;
|
|
41550
|
+
}
|
|
41551
|
+
else {
|
|
41552
|
+
text = getHTMLFromFragment(Fragment.from(text), state.schema);
|
|
41553
|
+
}
|
|
41554
|
+
const { from } = simulatedPasteMeta;
|
|
41501
41555
|
const to = from + text.length;
|
|
41502
41556
|
const pasteEvt = createClipboardPasteEvent(text);
|
|
41503
41557
|
return processEvent({
|
|
@@ -42094,13 +42148,33 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
42094
42148
|
|
|
42095
42149
|
function findMarkInSet(marks, type, attributes = {}) {
|
|
42096
42150
|
return marks.find(item => {
|
|
42097
|
-
return item.type === type
|
|
42151
|
+
return (item.type === type
|
|
42152
|
+
&& objectIncludes(
|
|
42153
|
+
// Only check equality for the attributes that are provided
|
|
42154
|
+
Object.fromEntries(Object.keys(attributes).map(k => [k, item.attrs[k]])), attributes));
|
|
42098
42155
|
});
|
|
42099
42156
|
}
|
|
42100
42157
|
function isMarkInSet(marks, type, attributes = {}) {
|
|
42101
42158
|
return !!findMarkInSet(marks, type, attributes);
|
|
42102
42159
|
}
|
|
42103
|
-
|
|
42160
|
+
/**
|
|
42161
|
+
* Get the range of a mark at a resolved position.
|
|
42162
|
+
*/
|
|
42163
|
+
function getMarkRange(
|
|
42164
|
+
/**
|
|
42165
|
+
* The position to get the mark range for.
|
|
42166
|
+
*/
|
|
42167
|
+
$pos,
|
|
42168
|
+
/**
|
|
42169
|
+
* The mark type to get the range for.
|
|
42170
|
+
*/
|
|
42171
|
+
type,
|
|
42172
|
+
/**
|
|
42173
|
+
* The attributes to match against.
|
|
42174
|
+
* If not provided, only the first mark at the position will be matched.
|
|
42175
|
+
*/
|
|
42176
|
+
attributes) {
|
|
42177
|
+
var _a;
|
|
42104
42178
|
if (!$pos || !type) {
|
|
42105
42179
|
return;
|
|
42106
42180
|
}
|
|
@@ -42113,6 +42187,8 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
42113
42187
|
if (!start.node || !start.node.marks.some(mark => mark.type === type)) {
|
|
42114
42188
|
return;
|
|
42115
42189
|
}
|
|
42190
|
+
// Default to only matching against the first mark's attributes
|
|
42191
|
+
attributes = attributes || ((_a = start.node.marks[0]) === null || _a === void 0 ? void 0 : _a.attrs);
|
|
42116
42192
|
// We now know that the cursor is either at the start, middle or end of a text node with the specified mark
|
|
42117
42193
|
// so we can look it up on the targeted mark
|
|
42118
42194
|
const mark = findMarkInSet([...start.node.marks], type, attributes);
|
|
@@ -42123,8 +42199,8 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
42123
42199
|
let startPos = $pos.start() + start.offset;
|
|
42124
42200
|
let endIndex = startIndex + 1;
|
|
42125
42201
|
let endPos = startPos + start.node.nodeSize;
|
|
42126
|
-
|
|
42127
|
-
|
|
42202
|
+
while (startIndex > 0
|
|
42203
|
+
&& isMarkInSet([...$pos.parent.child(startIndex - 1).marks], type, attributes)) {
|
|
42128
42204
|
startIndex -= 1;
|
|
42129
42205
|
startPos -= $pos.parent.child(startIndex).nodeSize;
|
|
42130
42206
|
}
|
|
@@ -42300,6 +42376,9 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
42300
42376
|
* @returns The created Prosemirror node or fragment
|
|
42301
42377
|
*/
|
|
42302
42378
|
function createNodeFromContent(content, schema, options) {
|
|
42379
|
+
if (content instanceof Node$2 || content instanceof Fragment) {
|
|
42380
|
+
return content;
|
|
42381
|
+
}
|
|
42303
42382
|
options = {
|
|
42304
42383
|
slice: true,
|
|
42305
42384
|
parseOptions: {},
|
|
@@ -42464,6 +42543,15 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
42464
42543
|
if (Array.isArray(value)) {
|
|
42465
42544
|
newContent = value.map(v => v.text || '').join('');
|
|
42466
42545
|
}
|
|
42546
|
+
else if (value instanceof Fragment) {
|
|
42547
|
+
let text = '';
|
|
42548
|
+
value.forEach(node => {
|
|
42549
|
+
if (node.text) {
|
|
42550
|
+
text += node.text;
|
|
42551
|
+
}
|
|
42552
|
+
});
|
|
42553
|
+
newContent = text;
|
|
42554
|
+
}
|
|
42467
42555
|
else if (typeof value === 'object' && !!value && !!value.text) {
|
|
42468
42556
|
newContent = value.text;
|
|
42469
42557
|
}
|
|
@@ -42941,14 +43029,6 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
42941
43029
|
return (selection) => findParentNodeClosestToPos(selection.$from, predicate);
|
|
42942
43030
|
}
|
|
42943
43031
|
|
|
42944
|
-
function getHTMLFromFragment(fragment, schema) {
|
|
42945
|
-
const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
|
|
42946
|
-
const temporaryDocument = document.implementation.createHTMLDocument();
|
|
42947
|
-
const container = temporaryDocument.createElement('div');
|
|
42948
|
-
container.appendChild(documentFragment);
|
|
42949
|
-
return container.innerHTML;
|
|
42950
|
-
}
|
|
42951
|
-
|
|
42952
43032
|
/**
|
|
42953
43033
|
* Gets the text of a Prosemirror node
|
|
42954
43034
|
* @param node The Prosemirror node
|
|
@@ -43345,6 +43425,11 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
43345
43425
|
|
|
43346
43426
|
const setNode = (typeOrName, attributes = {}) => ({ state, dispatch, chain }) => {
|
|
43347
43427
|
const type = getNodeType(typeOrName, state.schema);
|
|
43428
|
+
let attributesToCopy;
|
|
43429
|
+
if (state.selection.$anchor.sameParent(state.selection.$head)) {
|
|
43430
|
+
// only copy attributes if the selection is pointing to a node of the same type
|
|
43431
|
+
attributesToCopy = state.selection.$anchor.parent.attrs;
|
|
43432
|
+
}
|
|
43348
43433
|
// TODO: use a fallback like insertContent?
|
|
43349
43434
|
if (!type.isTextblock) {
|
|
43350
43435
|
console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.');
|
|
@@ -43353,14 +43438,14 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
43353
43438
|
return (chain()
|
|
43354
43439
|
// try to convert node to default node if needed
|
|
43355
43440
|
.command(({ commands }) => {
|
|
43356
|
-
const canSetBlock = setBlockType(type, attributes)(state);
|
|
43441
|
+
const canSetBlock = setBlockType(type, { ...attributesToCopy, ...attributes })(state);
|
|
43357
43442
|
if (canSetBlock) {
|
|
43358
43443
|
return true;
|
|
43359
43444
|
}
|
|
43360
43445
|
return commands.clearNodes();
|
|
43361
43446
|
})
|
|
43362
43447
|
.command(({ state: updatedState }) => {
|
|
43363
|
-
return setBlockType(type, attributes)(updatedState, dispatch);
|
|
43448
|
+
return setBlockType(type, { ...attributesToCopy, ...attributes })(updatedState, dispatch);
|
|
43364
43449
|
})
|
|
43365
43450
|
.run());
|
|
43366
43451
|
};
|
|
@@ -43779,21 +43864,63 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
43779
43864
|
markType = getMarkType(typeOrName, state.schema);
|
|
43780
43865
|
}
|
|
43781
43866
|
if (dispatch) {
|
|
43782
|
-
tr.selection.ranges.forEach(range => {
|
|
43867
|
+
tr.selection.ranges.forEach((range) => {
|
|
43783
43868
|
const from = range.$from.pos;
|
|
43784
43869
|
const to = range.$to.pos;
|
|
43785
|
-
|
|
43786
|
-
|
|
43787
|
-
|
|
43788
|
-
|
|
43870
|
+
let lastPos;
|
|
43871
|
+
let lastNode;
|
|
43872
|
+
let trimmedFrom;
|
|
43873
|
+
let trimmedTo;
|
|
43874
|
+
if (tr.selection.empty) {
|
|
43875
|
+
state.doc.nodesBetween(from, to, (node, pos) => {
|
|
43876
|
+
if (nodeType && nodeType === node.type) {
|
|
43877
|
+
trimmedFrom = Math.max(pos, from);
|
|
43878
|
+
trimmedTo = Math.min(pos + node.nodeSize, to);
|
|
43879
|
+
lastPos = pos;
|
|
43880
|
+
lastNode = node;
|
|
43881
|
+
}
|
|
43882
|
+
});
|
|
43883
|
+
}
|
|
43884
|
+
else {
|
|
43885
|
+
state.doc.nodesBetween(from, to, (node, pos) => {
|
|
43886
|
+
if (pos < from && nodeType && nodeType === node.type) {
|
|
43887
|
+
trimmedFrom = Math.max(pos, from);
|
|
43888
|
+
trimmedTo = Math.min(pos + node.nodeSize, to);
|
|
43889
|
+
lastPos = pos;
|
|
43890
|
+
lastNode = node;
|
|
43891
|
+
}
|
|
43892
|
+
if (pos >= from && pos <= to) {
|
|
43893
|
+
if (nodeType && nodeType === node.type) {
|
|
43894
|
+
tr.setNodeMarkup(pos, undefined, {
|
|
43895
|
+
...node.attrs,
|
|
43896
|
+
...attributes,
|
|
43897
|
+
});
|
|
43898
|
+
}
|
|
43899
|
+
if (markType && node.marks.length) {
|
|
43900
|
+
node.marks.forEach((mark) => {
|
|
43901
|
+
if (markType === mark.type) {
|
|
43902
|
+
const trimmedFrom2 = Math.max(pos, from);
|
|
43903
|
+
const trimmedTo2 = Math.min(pos + node.nodeSize, to);
|
|
43904
|
+
tr.addMark(trimmedFrom2, trimmedTo2, markType.create({
|
|
43905
|
+
...mark.attrs,
|
|
43906
|
+
...attributes,
|
|
43907
|
+
}));
|
|
43908
|
+
}
|
|
43909
|
+
});
|
|
43910
|
+
}
|
|
43911
|
+
}
|
|
43912
|
+
});
|
|
43913
|
+
}
|
|
43914
|
+
if (lastNode) {
|
|
43915
|
+
if (lastPos !== undefined) {
|
|
43916
|
+
tr.setNodeMarkup(lastPos, undefined, {
|
|
43917
|
+
...lastNode.attrs,
|
|
43789
43918
|
...attributes,
|
|
43790
43919
|
});
|
|
43791
43920
|
}
|
|
43792
|
-
if (markType &&
|
|
43793
|
-
|
|
43921
|
+
if (markType && lastNode.marks.length) {
|
|
43922
|
+
lastNode.marks.forEach((mark) => {
|
|
43794
43923
|
if (markType === mark.type) {
|
|
43795
|
-
const trimmedFrom = Math.max(pos, from);
|
|
43796
|
-
const trimmedTo = Math.min(pos + node.nodeSize, to);
|
|
43797
43924
|
tr.addMark(trimmedFrom, trimmedTo, markType.create({
|
|
43798
43925
|
...mark.attrs,
|
|
43799
43926
|
...attributes,
|
|
@@ -43801,7 +43928,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
43801
43928
|
}
|
|
43802
43929
|
});
|
|
43803
43930
|
}
|
|
43804
|
-
}
|
|
43931
|
+
}
|
|
43805
43932
|
});
|
|
43806
43933
|
}
|
|
43807
43934
|
return true;
|
|
@@ -44605,6 +44732,7 @@ img.ProseMirror-separator {
|
|
|
44605
44732
|
* Creates a ProseMirror view.
|
|
44606
44733
|
*/
|
|
44607
44734
|
createView() {
|
|
44735
|
+
var _a;
|
|
44608
44736
|
let doc;
|
|
44609
44737
|
try {
|
|
44610
44738
|
doc = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
|
|
@@ -44633,18 +44761,17 @@ img.ProseMirror-separator {
|
|
|
44633
44761
|
const selection = resolveFocusPosition(doc, this.options.autofocus);
|
|
44634
44762
|
this.view = new EditorView(this.options.element, {
|
|
44635
44763
|
...this.options.editorProps,
|
|
44764
|
+
attributes: {
|
|
44765
|
+
// add `role="textbox"` to the editor element
|
|
44766
|
+
role: 'textbox',
|
|
44767
|
+
...(_a = this.options.editorProps) === null || _a === void 0 ? void 0 : _a.attributes,
|
|
44768
|
+
},
|
|
44636
44769
|
dispatchTransaction: this.dispatchTransaction.bind(this),
|
|
44637
44770
|
state: EditorState.create({
|
|
44638
44771
|
doc,
|
|
44639
44772
|
selection: selection || undefined,
|
|
44640
44773
|
}),
|
|
44641
44774
|
});
|
|
44642
|
-
// add `role="textbox"` to the editor element
|
|
44643
|
-
this.view.dom.setAttribute('role', 'textbox');
|
|
44644
|
-
// add aria-label to the editor element
|
|
44645
|
-
if (!this.view.dom.getAttribute('aria-label')) {
|
|
44646
|
-
this.view.dom.setAttribute('aria-label', 'Rich-Text Editor');
|
|
44647
|
-
}
|
|
44648
44775
|
// `editor.view` is not yet available at this time.
|
|
44649
44776
|
// Therefore we will add all plugins and node views directly afterwards.
|
|
44650
44777
|
const newState = this.state.reconfigure({
|
|
@@ -44840,7 +44967,7 @@ img.ProseMirror-separator {
|
|
|
44840
44967
|
/**
|
|
44841
44968
|
* Build an input rule that adds a mark when the
|
|
44842
44969
|
* matched text is typed into it.
|
|
44843
|
-
* @see https://tiptap.dev/
|
|
44970
|
+
* @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#input-rules
|
|
44844
44971
|
*/
|
|
44845
44972
|
function markInputRule(config) {
|
|
44846
44973
|
return new InputRule({
|
|
@@ -44894,7 +45021,7 @@ img.ProseMirror-separator {
|
|
|
44894
45021
|
* two nodes. You can pass a join predicate, which takes a regular
|
|
44895
45022
|
* expression match and the node before the wrapped node, and can
|
|
44896
45023
|
* return a boolean to indicate whether a join should happen.
|
|
44897
|
-
* @see https://tiptap.dev/
|
|
45024
|
+
* @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#input-rules
|
|
44898
45025
|
*/
|
|
44899
45026
|
function wrappingInputRule(config) {
|
|
44900
45027
|
return new InputRule({
|
|
@@ -45008,7 +45135,7 @@ img.ProseMirror-separator {
|
|
|
45008
45135
|
/**
|
|
45009
45136
|
* Build an paste rule that adds a mark when the
|
|
45010
45137
|
* matched text is pasted into it.
|
|
45011
|
-
* @see https://tiptap.dev/
|
|
45138
|
+
* @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#paste-rules
|
|
45012
45139
|
*/
|
|
45013
45140
|
function markPasteRule(config) {
|
|
45014
45141
|
return new PasteRule({
|
|
@@ -45070,6 +45197,7 @@ img.ProseMirror-separator {
|
|
|
45070
45197
|
inline: true,
|
|
45071
45198
|
group: 'inline',
|
|
45072
45199
|
selectable: false,
|
|
45200
|
+
linebreakReplacement: true,
|
|
45073
45201
|
parseHTML() {
|
|
45074
45202
|
return [
|
|
45075
45203
|
{ tag: 'br' },
|
|
@@ -56670,7 +56798,7 @@ img.ProseMirror-separator {
|
|
|
56670
56798
|
// THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY
|
|
56671
56799
|
// See update-tlds.js for encoding/decoding format
|
|
56672
56800
|
// https://data.iana.org/TLD/tlds-alpha-by-domain.txt
|
|
56673
|
-
const encodedTlds = '
|
|
56801
|
+
const encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2';
|
|
56674
56802
|
// Internationalized domain names containing non-ASCII
|
|
56675
56803
|
const encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2';
|
|
56676
56804
|
|
|
@@ -56795,10 +56923,7 @@ img.ProseMirror-separator {
|
|
|
56795
56923
|
* @template T
|
|
56796
56924
|
* @param {T} [token] Token that this state emits
|
|
56797
56925
|
*/
|
|
56798
|
-
function State(token) {
|
|
56799
|
-
if (token === void 0) {
|
|
56800
|
-
token = null;
|
|
56801
|
-
}
|
|
56926
|
+
function State(token = null) {
|
|
56802
56927
|
// this.n = null; // DEBUG: State name
|
|
56803
56928
|
/** @type {{ [input: string]: State<T> }} j */
|
|
56804
56929
|
this.j = {}; // IMPLEMENTATION 1
|
|
@@ -56849,10 +56974,7 @@ img.ProseMirror-separator {
|
|
|
56849
56974
|
* @param {string} input
|
|
56850
56975
|
* @param {boolean} exactOnly
|
|
56851
56976
|
*/
|
|
56852
|
-
has(input, exactOnly) {
|
|
56853
|
-
if (exactOnly === void 0) {
|
|
56854
|
-
exactOnly = false;
|
|
56855
|
-
}
|
|
56977
|
+
has(input, exactOnly = false) {
|
|
56856
56978
|
return exactOnly ? input in this.j : !!this.go(input);
|
|
56857
56979
|
},
|
|
56858
56980
|
/**
|
|
@@ -56975,7 +57097,6 @@ img.ProseMirror-separator {
|
|
|
56975
57097
|
}
|
|
56976
57098
|
nextState.t = t; // overwrite anything that was previously there
|
|
56977
57099
|
}
|
|
56978
|
-
|
|
56979
57100
|
state.j[input] = nextState;
|
|
56980
57101
|
return nextState;
|
|
56981
57102
|
}
|
|
@@ -57100,6 +57221,7 @@ img.ProseMirror-separator {
|
|
|
57100
57221
|
const POUND = 'POUND'; // #
|
|
57101
57222
|
const QUERY = 'QUERY'; // ?
|
|
57102
57223
|
const QUOTE = 'QUOTE'; // "
|
|
57224
|
+
const FULLWIDTHMIDDLEDOT = 'FULLWIDTHMIDDLEDOT'; // ・
|
|
57103
57225
|
|
|
57104
57226
|
const SEMI = 'SEMI'; // ;
|
|
57105
57227
|
const SLASH = 'SLASH'; // /
|
|
@@ -57160,6 +57282,7 @@ img.ProseMirror-separator {
|
|
|
57160
57282
|
POUND: POUND,
|
|
57161
57283
|
QUERY: QUERY,
|
|
57162
57284
|
QUOTE: QUOTE,
|
|
57285
|
+
FULLWIDTHMIDDLEDOT: FULLWIDTHMIDDLEDOT,
|
|
57163
57286
|
SEMI: SEMI,
|
|
57164
57287
|
SLASH: SLASH,
|
|
57165
57288
|
TILDE: TILDE,
|
|
@@ -57207,10 +57330,7 @@ img.ProseMirror-separator {
|
|
|
57207
57330
|
* item is a length-2 tuple with the first element set to the string scheme, and
|
|
57208
57331
|
* the second element set to `true` if the `://` after the scheme is optional
|
|
57209
57332
|
*/
|
|
57210
|
-
function init$2(customSchemes) {
|
|
57211
|
-
if (customSchemes === void 0) {
|
|
57212
|
-
customSchemes = [];
|
|
57213
|
-
}
|
|
57333
|
+
function init$2(customSchemes = []) {
|
|
57214
57334
|
// Frequently used states (name argument removed during minification)
|
|
57215
57335
|
/** @type Collections<string> */
|
|
57216
57336
|
const groups = {}; // of tokens
|
|
@@ -57265,6 +57385,7 @@ img.ProseMirror-separator {
|
|
|
57265
57385
|
tt(Start, '~', TILDE);
|
|
57266
57386
|
tt(Start, '_', UNDERSCORE);
|
|
57267
57387
|
tt(Start, '\\', BACKSLASH);
|
|
57388
|
+
tt(Start, '・', FULLWIDTHMIDDLEDOT);
|
|
57268
57389
|
const Num = tr(Start, DIGIT, NUM, {
|
|
57269
57390
|
[numeric]: true
|
|
57270
57391
|
});
|
|
@@ -57448,7 +57569,6 @@ img.ProseMirror-separator {
|
|
|
57448
57569
|
e: cursor // end index (excluding)
|
|
57449
57570
|
});
|
|
57450
57571
|
}
|
|
57451
|
-
|
|
57452
57572
|
return tokens;
|
|
57453
57573
|
}
|
|
57454
57574
|
|
|
@@ -57523,7 +57643,6 @@ img.ProseMirror-separator {
|
|
|
57523
57643
|
while (digits.indexOf(encoded[i + popDigitCount]) >= 0) {
|
|
57524
57644
|
popDigitCount++; // encountered some digits, have to pop to go one level up trie
|
|
57525
57645
|
}
|
|
57526
|
-
|
|
57527
57646
|
if (popDigitCount > 0) {
|
|
57528
57647
|
words.push(stack.join('')); // whatever preceded the pop digits must be a word
|
|
57529
57648
|
for (let popCount = parseInt(encoded.substring(i, i + popDigitCount), 10); popCount > 0; popCount--) {
|
|
@@ -57646,10 +57765,7 @@ img.ProseMirror-separator {
|
|
|
57646
57765
|
* HTML element based on a link token's derived tagName, attributes and HTML.
|
|
57647
57766
|
* Similar to render option
|
|
57648
57767
|
*/
|
|
57649
|
-
function Options(opts, defaultRender) {
|
|
57650
|
-
if (defaultRender === void 0) {
|
|
57651
|
-
defaultRender = null;
|
|
57652
|
-
}
|
|
57768
|
+
function Options(opts, defaultRender = null) {
|
|
57653
57769
|
let o = assign({}, defaults);
|
|
57654
57770
|
if (opts) {
|
|
57655
57771
|
o = assign(o, opts instanceof Options ? opts.o : opts);
|
|
@@ -57792,7 +57908,7 @@ img.ProseMirror-separator {
|
|
|
57792
57908
|
* Returns the `.toString` value by default.
|
|
57793
57909
|
* @param {string} [scheme]
|
|
57794
57910
|
* @return {string}
|
|
57795
|
-
|
|
57911
|
+
*/
|
|
57796
57912
|
toHref(scheme) {
|
|
57797
57913
|
return this.toString();
|
|
57798
57914
|
},
|
|
@@ -57838,10 +57954,7 @@ img.ProseMirror-separator {
|
|
|
57838
57954
|
@method toObject
|
|
57839
57955
|
@param {string} [protocol] `'http'` by default
|
|
57840
57956
|
*/
|
|
57841
|
-
toObject(protocol) {
|
|
57842
|
-
if (protocol === void 0) {
|
|
57843
|
-
protocol = defaults.defaultProtocol;
|
|
57844
|
-
}
|
|
57957
|
+
toObject(protocol = defaults.defaultProtocol) {
|
|
57845
57958
|
return {
|
|
57846
57959
|
type: this.t,
|
|
57847
57960
|
value: this.toString(),
|
|
@@ -57965,10 +58078,7 @@ img.ProseMirror-separator {
|
|
|
57965
58078
|
@param {string} [scheme] default scheme (e.g., 'https')
|
|
57966
58079
|
@return {string} the full href
|
|
57967
58080
|
*/
|
|
57968
|
-
toHref(scheme) {
|
|
57969
|
-
if (scheme === void 0) {
|
|
57970
|
-
scheme = defaults.defaultProtocol;
|
|
57971
|
-
}
|
|
58081
|
+
toHref(scheme = defaults.defaultProtocol) {
|
|
57972
58082
|
// Check if already has a prefix scheme
|
|
57973
58083
|
return this.hasProtocol() ? this.v : `${scheme}://${this.v}`;
|
|
57974
58084
|
},
|
|
@@ -58002,10 +58112,9 @@ img.ProseMirror-separator {
|
|
|
58002
58112
|
* Generate the parser multi token-based state machine
|
|
58003
58113
|
* @param {{ groups: Collections<string> }} tokens
|
|
58004
58114
|
*/
|
|
58005
|
-
function init$1(
|
|
58006
|
-
|
|
58007
|
-
|
|
58008
|
-
} = _ref;
|
|
58115
|
+
function init$1({
|
|
58116
|
+
groups
|
|
58117
|
+
}) {
|
|
58009
58118
|
// Types of characters the URL can definitely end in
|
|
58010
58119
|
const qsAccepting = groups.domain.concat([AMPERSAND, ASTERISK, AT, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, NUM, PERCENT, PIPE, PLUS, POUND, SLASH, SYM, TILDE, UNDERSCORE]);
|
|
58011
58120
|
|
|
@@ -58140,7 +58249,6 @@ img.ProseMirror-separator {
|
|
|
58140
58249
|
// 『』
|
|
58141
58250
|
[FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN] // <>
|
|
58142
58251
|
];
|
|
58143
|
-
|
|
58144
58252
|
for (let i = 0; i < bracketPairs.length; i++) {
|
|
58145
58253
|
const [OPEN, CLOSE] = bracketPairs[i];
|
|
58146
58254
|
const UrlOpen = tt(Url$1, OPEN); // URL followed by open bracket
|
|
@@ -58318,6 +58426,7 @@ img.ProseMirror-separator {
|
|
|
58318
58426
|
INIT.pluginQueue = [];
|
|
58319
58427
|
INIT.customSchemes = [];
|
|
58320
58428
|
INIT.initialized = false;
|
|
58429
|
+
return INIT;
|
|
58321
58430
|
}
|
|
58322
58431
|
|
|
58323
58432
|
/**
|
|
@@ -58327,10 +58436,7 @@ img.ProseMirror-separator {
|
|
|
58327
58436
|
* @param {string} protocol
|
|
58328
58437
|
* @param {boolean} [optionalSlashSlash]
|
|
58329
58438
|
*/
|
|
58330
|
-
function registerCustomProtocol(scheme, optionalSlashSlash) {
|
|
58331
|
-
if (optionalSlashSlash === void 0) {
|
|
58332
|
-
optionalSlashSlash = false;
|
|
58333
|
-
}
|
|
58439
|
+
function registerCustomProtocol(scheme, optionalSlashSlash = false) {
|
|
58334
58440
|
if (INIT.initialized) {
|
|
58335
58441
|
warn(`linkifyjs: already initialized - will not register custom scheme "${scheme}" ${warnAdvice}`);
|
|
58336
58442
|
}
|
|
@@ -58365,6 +58471,7 @@ img.ProseMirror-separator {
|
|
|
58365
58471
|
});
|
|
58366
58472
|
}
|
|
58367
58473
|
INIT.initialized = true;
|
|
58474
|
+
return INIT;
|
|
58368
58475
|
}
|
|
58369
58476
|
|
|
58370
58477
|
/**
|
|
@@ -58378,6 +58485,7 @@ img.ProseMirror-separator {
|
|
|
58378
58485
|
}
|
|
58379
58486
|
return run(INIT.parser.start, str, run$1(INIT.scanner.start, str));
|
|
58380
58487
|
}
|
|
58488
|
+
tokenize.scan = run$1; // for testing
|
|
58381
58489
|
|
|
58382
58490
|
/**
|
|
58383
58491
|
* Find a list of linkable items in the given string.
|
|
@@ -58387,13 +58495,7 @@ img.ProseMirror-separator {
|
|
|
58387
58495
|
* @param {Opts} [opts] formatting options for final output. Cannot be specified
|
|
58388
58496
|
* if opts already provided in `type` argument
|
|
58389
58497
|
*/
|
|
58390
|
-
function find$1(str, type, opts) {
|
|
58391
|
-
if (type === void 0) {
|
|
58392
|
-
type = null;
|
|
58393
|
-
}
|
|
58394
|
-
if (opts === void 0) {
|
|
58395
|
-
opts = null;
|
|
58396
|
-
}
|
|
58498
|
+
function find$1(str, type = null, opts = null) {
|
|
58397
58499
|
if (type && typeof type === 'object') {
|
|
58398
58500
|
if (opts) {
|
|
58399
58501
|
throw Error(`linkifyjs: Invalid link type ${type}; must be a string`);
|
|
@@ -58506,6 +58608,8 @@ img.ProseMirror-separator {
|
|
|
58506
58608
|
})
|
|
58507
58609
|
// validate link
|
|
58508
58610
|
.filter(link => options.validate(link.value))
|
|
58611
|
+
// check whether should autolink
|
|
58612
|
+
.filter(link => options.shouldAutoLink(link.value))
|
|
58509
58613
|
// Add link mark.
|
|
58510
58614
|
.forEach(link => {
|
|
58511
58615
|
if (getMarksBetween(link.from, link.to, newState.doc).some(item => item.mark.type === options.type)) {
|
|
@@ -58592,17 +58696,32 @@ img.ProseMirror-separator {
|
|
|
58592
58696
|
// eslint-disable-next-line no-control-regex
|
|
58593
58697
|
const ATTR_WHITESPACE = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
|
|
58594
58698
|
function isAllowedUri(uri, protocols) {
|
|
58595
|
-
const allowedProtocols = [
|
|
58699
|
+
const allowedProtocols = [
|
|
58700
|
+
'http',
|
|
58701
|
+
'https',
|
|
58702
|
+
'ftp',
|
|
58703
|
+
'ftps',
|
|
58704
|
+
'mailto',
|
|
58705
|
+
'tel',
|
|
58706
|
+
'callto',
|
|
58707
|
+
'sms',
|
|
58708
|
+
'cid',
|
|
58709
|
+
'xmpp',
|
|
58710
|
+
];
|
|
58596
58711
|
if (protocols) {
|
|
58597
58712
|
protocols.forEach(protocol => {
|
|
58598
|
-
const nextProtocol =
|
|
58713
|
+
const nextProtocol = typeof protocol === 'string' ? protocol : protocol.scheme;
|
|
58599
58714
|
if (nextProtocol) {
|
|
58600
58715
|
allowedProtocols.push(nextProtocol);
|
|
58601
58716
|
}
|
|
58602
58717
|
});
|
|
58603
58718
|
}
|
|
58604
|
-
|
|
58605
|
-
|
|
58719
|
+
return (!uri
|
|
58720
|
+
|| uri
|
|
58721
|
+
.replace(ATTR_WHITESPACE, '')
|
|
58722
|
+
.match(new RegExp(
|
|
58723
|
+
// eslint-disable-next-line no-useless-escape
|
|
58724
|
+
`^(?:(?:${allowedProtocols.join('|')}):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))`, 'i')));
|
|
58606
58725
|
}
|
|
58607
58726
|
/**
|
|
58608
58727
|
* This extension allows you to create links.
|
|
@@ -58614,6 +58733,11 @@ img.ProseMirror-separator {
|
|
|
58614
58733
|
keepOnSplit: false,
|
|
58615
58734
|
exitable: true,
|
|
58616
58735
|
onCreate() {
|
|
58736
|
+
if (this.options.validate && !this.options.shouldAutoLink) {
|
|
58737
|
+
// Copy the validate function to the shouldAutoLink option
|
|
58738
|
+
this.options.shouldAutoLink = this.options.validate;
|
|
58739
|
+
console.warn('The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.');
|
|
58740
|
+
}
|
|
58617
58741
|
this.options.protocols.forEach(protocol => {
|
|
58618
58742
|
if (typeof protocol === 'string') {
|
|
58619
58743
|
registerCustomProtocol(protocol);
|
|
@@ -58640,7 +58764,9 @@ img.ProseMirror-separator {
|
|
|
58640
58764
|
rel: 'noopener noreferrer nofollow',
|
|
58641
58765
|
class: null,
|
|
58642
58766
|
},
|
|
58767
|
+
isAllowedUri: (url, ctx) => !!isAllowedUri(url, ctx.protocols),
|
|
58643
58768
|
validate: url => !!url,
|
|
58769
|
+
shouldAutoLink: url => !!url,
|
|
58644
58770
|
};
|
|
58645
58771
|
},
|
|
58646
58772
|
addAttributes() {
|
|
@@ -58663,23 +58789,38 @@ img.ProseMirror-separator {
|
|
|
58663
58789
|
};
|
|
58664
58790
|
},
|
|
58665
58791
|
parseHTML() {
|
|
58666
|
-
return [
|
|
58792
|
+
return [
|
|
58793
|
+
{
|
|
58667
58794
|
tag: 'a[href]',
|
|
58668
58795
|
getAttrs: dom => {
|
|
58669
58796
|
const href = dom.getAttribute('href');
|
|
58670
58797
|
// prevent XSS attacks
|
|
58671
|
-
if (!href
|
|
58798
|
+
if (!href
|
|
58799
|
+
|| !this.options.isAllowedUri(href, {
|
|
58800
|
+
defaultValidate: url => !!isAllowedUri(url, this.options.protocols),
|
|
58801
|
+
protocols: this.options.protocols,
|
|
58802
|
+
defaultProtocol: this.options.defaultProtocol,
|
|
58803
|
+
})) {
|
|
58672
58804
|
return false;
|
|
58673
58805
|
}
|
|
58674
58806
|
return null;
|
|
58675
58807
|
},
|
|
58676
|
-
}
|
|
58808
|
+
},
|
|
58809
|
+
];
|
|
58677
58810
|
},
|
|
58678
58811
|
renderHTML({ HTMLAttributes }) {
|
|
58679
58812
|
// prevent XSS attacks
|
|
58680
|
-
if (!isAllowedUri(HTMLAttributes.href,
|
|
58813
|
+
if (!this.options.isAllowedUri(HTMLAttributes.href, {
|
|
58814
|
+
defaultValidate: href => !!isAllowedUri(href, this.options.protocols),
|
|
58815
|
+
protocols: this.options.protocols,
|
|
58816
|
+
defaultProtocol: this.options.defaultProtocol,
|
|
58817
|
+
})) {
|
|
58681
58818
|
// strip out the href
|
|
58682
|
-
return [
|
|
58819
|
+
return [
|
|
58820
|
+
'a',
|
|
58821
|
+
mergeAttributes(this.options.HTMLAttributes, { ...HTMLAttributes, href: '' }),
|
|
58822
|
+
0,
|
|
58823
|
+
];
|
|
58683
58824
|
}
|
|
58684
58825
|
return ['a', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
58685
58826
|
},
|
|
@@ -58708,16 +58849,21 @@ img.ProseMirror-separator {
|
|
|
58708
58849
|
find: text => {
|
|
58709
58850
|
const foundLinks = [];
|
|
58710
58851
|
if (text) {
|
|
58711
|
-
const {
|
|
58712
|
-
const links = find$1(text).filter(item => item.isLink
|
|
58852
|
+
const { protocols, defaultProtocol } = this.options;
|
|
58853
|
+
const links = find$1(text).filter(item => item.isLink
|
|
58854
|
+
&& this.options.isAllowedUri(item.value, {
|
|
58855
|
+
defaultValidate: href => !!isAllowedUri(href, protocols),
|
|
58856
|
+
protocols,
|
|
58857
|
+
defaultProtocol,
|
|
58858
|
+
}));
|
|
58713
58859
|
if (links.length) {
|
|
58714
|
-
links.forEach(link =>
|
|
58860
|
+
links.forEach(link => foundLinks.push({
|
|
58715
58861
|
text: link.value,
|
|
58716
58862
|
data: {
|
|
58717
58863
|
href: link.href,
|
|
58718
58864
|
},
|
|
58719
58865
|
index: link.start,
|
|
58720
|
-
}))
|
|
58866
|
+
}));
|
|
58721
58867
|
}
|
|
58722
58868
|
}
|
|
58723
58869
|
return foundLinks;
|
|
@@ -58734,11 +58880,17 @@ img.ProseMirror-separator {
|
|
|
58734
58880
|
},
|
|
58735
58881
|
addProseMirrorPlugins() {
|
|
58736
58882
|
const plugins = [];
|
|
58883
|
+
const { protocols, defaultProtocol } = this.options;
|
|
58737
58884
|
if (this.options.autolink) {
|
|
58738
58885
|
plugins.push(autolink({
|
|
58739
58886
|
type: this.type,
|
|
58740
58887
|
defaultProtocol: this.options.defaultProtocol,
|
|
58741
|
-
validate: this.options.
|
|
58888
|
+
validate: url => this.options.isAllowedUri(url, {
|
|
58889
|
+
defaultValidate: href => !!isAllowedUri(href, protocols),
|
|
58890
|
+
protocols,
|
|
58891
|
+
defaultProtocol,
|
|
58892
|
+
}),
|
|
58893
|
+
shouldAutoLink: this.options.shouldAutoLink,
|
|
58742
58894
|
}));
|
|
58743
58895
|
}
|
|
58744
58896
|
if (this.options.openOnClick === true) {
|
|
@@ -59505,7 +59657,7 @@ img.ProseMirror-separator {
|
|
|
59505
59657
|
// linkOnPaste can be enabled when hyperlink support added
|
|
59506
59658
|
// See: https://github.com/ni/nimble/issues/1527
|
|
59507
59659
|
linkOnPaste: false,
|
|
59508
|
-
|
|
59660
|
+
shouldAutoLink: href => validAbsoluteLinkRegex.test(href)
|
|
59509
59661
|
});
|
|
59510
59662
|
}
|
|
59511
59663
|
function createCustomMentionExtension(config, activeMentionCharacterEmitter, activeMentionCommandEmitter, mentionListbox) {
|
|
@@ -62077,7 +62229,8 @@ img.ProseMirror-separator {
|
|
|
62077
62229
|
var(--ni-private-switch-height) - var(
|
|
62078
62230
|
--ni-private-switch-indicator-size
|
|
62079
62231
|
)
|
|
62080
|
-
) /
|
|
62232
|
+
) /
|
|
62233
|
+
2
|
|
62081
62234
|
);
|
|
62082
62235
|
border: ${borderWidth} solid
|
|
62083
62236
|
var(--ni-private-switch-indicator-border-color);
|
|
@@ -66202,8 +66355,11 @@ focus outline in that case.
|
|
|
66202
66355
|
);
|
|
66203
66356
|
height: 100%;
|
|
66204
66357
|
left: calc(
|
|
66205
|
-
-1 *
|
|
66206
|
-
|
|
66358
|
+
-1 *
|
|
66359
|
+
(
|
|
66360
|
+
var(--ni-private-column-divider-width) +
|
|
66361
|
+
var(--ni-private-column-divider-padding)
|
|
66362
|
+
)
|
|
66207
66363
|
);
|
|
66208
66364
|
}
|
|
66209
66365
|
|
|
@@ -66552,7 +66708,8 @@ focus outline in that case.
|
|
|
66552
66708
|
|
|
66553
66709
|
nimble-table-cell:first-of-type${focusVisible} {
|
|
66554
66710
|
margin-left: calc(
|
|
66555
|
-
-1 * (${controlHeight} - ${smallPadding}) *
|
|
66711
|
+
-1 * (${controlHeight} - ${smallPadding}) *
|
|
66712
|
+
var(--ni-private-table-cell-focus-offset-multiplier)
|
|
66556
66713
|
);
|
|
66557
66714
|
padding-left: calc(
|
|
66558
66715
|
(${controlHeight} - ${mediumPadding}) *
|
|
@@ -66569,7 +66726,8 @@ focus outline in that case.
|
|
|
66569
66726
|
${controlHeight} *
|
|
66570
66727
|
var(--ni-private-table-cell-nesting-level) +
|
|
66571
66728
|
${smallPadding}
|
|
66572
|
-
) *
|
|
66729
|
+
) *
|
|
66730
|
+
var(--ni-private-table-cell-focus-offset-multiplier)
|
|
66573
66731
|
);
|
|
66574
66732
|
height: ${controlHeight};
|
|
66575
66733
|
}
|