@astryx-vue/lab 0.2.0 → 0.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/dist/index.d.ts +18 -1
- package/dist/index.js +168 -94
- package/package.json +3 -3
- package/styles/diff-viewer.css +67 -0
package/dist/index.d.ts
CHANGED
|
@@ -192,6 +192,8 @@ type DiffViewerViewMode = 'unified' | 'split';
|
|
|
192
192
|
* line that replaced it: by `word`, by `char`acter, or `none`.
|
|
193
193
|
*/
|
|
194
194
|
type DiffViewerInlineHighlight = 'word' | 'char' | 'none';
|
|
195
|
+
/** 行内变化标记:经典加减号、实线/虚线条,或不显示可见标记。 */
|
|
196
|
+
type DiffViewerChangeIndicator = 'classic' | 'bars' | 'none';
|
|
195
197
|
interface DiffViewerProps {
|
|
196
198
|
/**
|
|
197
199
|
* The file to render. Build one with `parseUnifiedDiff(patch)` (one per file
|
|
@@ -227,6 +229,19 @@ interface DiffViewerProps {
|
|
|
227
229
|
* @default 'word'
|
|
228
230
|
*/
|
|
229
231
|
inlineHighlight?: DiffViewerInlineHighlight;
|
|
232
|
+
/**
|
|
233
|
+
* How changed lines are marked beside the code: classic +/− glyphs, a solid
|
|
234
|
+
* bar for additions and a dashed bar for removals, or no visible marker.
|
|
235
|
+
* Screen readers keep the Added/Removed label in every mode.
|
|
236
|
+
* @default 'classic'
|
|
237
|
+
*/
|
|
238
|
+
changeIndicator?: DiffViewerChangeIndicator;
|
|
239
|
+
/**
|
|
240
|
+
* Tint added and removed rows. When false, line numbers, the indicator and
|
|
241
|
+
* inline highlights still carry the change.
|
|
242
|
+
* @default true
|
|
243
|
+
*/
|
|
244
|
+
hasChangeBackground?: boolean;
|
|
230
245
|
/**
|
|
231
246
|
* Make the file header a disclosure that hides and shows the hunks. Needs a
|
|
232
247
|
* file path to name the control.
|
|
@@ -290,6 +305,8 @@ declare const __VLS_base$3: import("vue").DefineComponent<DiffViewerProps, {}, {
|
|
|
290
305
|
hasLineNumbers: boolean;
|
|
291
306
|
isWrapped: boolean;
|
|
292
307
|
inlineHighlight: DiffViewerInlineHighlight;
|
|
308
|
+
changeIndicator: DiffViewerChangeIndicator;
|
|
309
|
+
hasChangeBackground: boolean;
|
|
293
310
|
isCollapsible: boolean;
|
|
294
311
|
isCollapsed: boolean;
|
|
295
312
|
defaultIsCollapsed: boolean;
|
|
@@ -1172,4 +1189,4 @@ declare const __VLS_export: <T extends string>(__VLS_props: NonNullable<Awaited<
|
|
|
1172
1189
|
declare const _default$9: typeof __VLS_export;
|
|
1173
1190
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1174
1191
|
//#endregion
|
|
1175
|
-
export { _default as CircularProgress, type CircularProgressProps, type CircularProgressSize, type CircularProgressVariant, type CircularProgressVariantMap, type CreateDiffFileOptions, _default$1 as DiffViewer, type DiffViewerEmits, type DiffViewerFile, type DiffViewerFileStatus, type DiffViewerHunk, type DiffViewerInlineHighlight, type DiffViewerLine, type DiffViewerLineKind, type DiffViewerLineRef, type DiffViewerProps, type DiffViewerSide, type DiffViewerSlots, type DiffViewerViewMode, type IconShape, type IconShapeRole, _default$2 as InfoTip, type InfoTipProps, type InfoTipSize, type InlineDiffGranularity, type InlineDiffResult, type InlineRange, _default$3 as ListInput, type ListInputChange, type ListInputColumn, type ListInputColumnWidth, type ListInputEmits, type ListInputProps, type ListInputRenderContext, type ListInputValueContext, type LogEntry, _default$4 as LogStream, type LogStreamEmits, type LogStreamLevel, type LogStreamProps, _default$5 as MobileTokenizer, type MobileTokenizerChange, type MobileTokenizerEmits, type MobileTokenizerProps, type PanelGroup, type PanelRow, type PathPersonality, _default$6 as SVGIcon, type SVGIconColor, type SVGIconDef, type SVGIconProps, type SVGIconSize, type SVGIconVariation, type SearchSource, type SearchableItem, _default$7 as Stat, type StatDelta, type StatDeltaDirection, type StatDeltaSentiment, type StatProps, type StatSize, _default$8 as TransferList, type TransferListEmits, type TransferListOption, type TransferListProps, _default$9 as TransferListSelector, type TransferListSlots, type XIFAnimate, type XIFIcon, type XIFPath, type XIFPersonality, type XIFSlot };
|
|
1192
|
+
export { _default as CircularProgress, type CircularProgressProps, type CircularProgressSize, type CircularProgressVariant, type CircularProgressVariantMap, type CreateDiffFileOptions, _default$1 as DiffViewer, type DiffViewerChangeIndicator, type DiffViewerEmits, type DiffViewerFile, type DiffViewerFileStatus, type DiffViewerHunk, type DiffViewerInlineHighlight, type DiffViewerLine, type DiffViewerLineKind, type DiffViewerLineRef, type DiffViewerProps, type DiffViewerSide, type DiffViewerSlots, type DiffViewerViewMode, type IconShape, type IconShapeRole, _default$2 as InfoTip, type InfoTipProps, type InfoTipSize, type InlineDiffGranularity, type InlineDiffResult, type InlineRange, _default$3 as ListInput, type ListInputChange, type ListInputColumn, type ListInputColumnWidth, type ListInputEmits, type ListInputProps, type ListInputRenderContext, type ListInputValueContext, type LogEntry, _default$4 as LogStream, type LogStreamEmits, type LogStreamLevel, type LogStreamProps, _default$5 as MobileTokenizer, type MobileTokenizerChange, type MobileTokenizerEmits, type MobileTokenizerProps, type PanelGroup, type PanelRow, type PathPersonality, _default$6 as SVGIcon, type SVGIconColor, type SVGIconDef, type SVGIconProps, type SVGIconSize, type SVGIconVariation, type SearchSource, type SearchableItem, _default$7 as Stat, type StatDelta, type StatDeltaDirection, type StatDeltaSentiment, type StatProps, type StatSize, _default$8 as TransferList, type TransferListEmits, type TransferListOption, type TransferListProps, _default$9 as TransferListSelector, type TransferListSlots, type XIFAnimate, type XIFIcon, type XIFPath, type XIFPersonality, type XIFSlot };
|
package/dist/index.js
CHANGED
|
@@ -409,88 +409,124 @@ var RenderVNode_default = defineComponent({
|
|
|
409
409
|
});
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region src/DiffViewer/DiffViewerTable.vue
|
|
412
|
-
const _hoisted_1$12 =
|
|
412
|
+
const _hoisted_1$12 = [
|
|
413
|
+
"data-view-mode",
|
|
414
|
+
"data-has-line-numbers",
|
|
415
|
+
"data-change-indicator",
|
|
416
|
+
"data-change-background"
|
|
417
|
+
];
|
|
418
|
+
const _hoisted_2$11 = {
|
|
413
419
|
key: 0,
|
|
414
420
|
scope: "col",
|
|
415
421
|
class: "astryx-diff-viewer__column-header"
|
|
416
422
|
};
|
|
417
|
-
const
|
|
423
|
+
const _hoisted_3$10 = {
|
|
418
424
|
key: 1,
|
|
419
425
|
scope: "col",
|
|
420
426
|
class: "astryx-diff-viewer__column-header"
|
|
421
427
|
};
|
|
422
|
-
const
|
|
428
|
+
const _hoisted_4$9 = {
|
|
423
429
|
scope: "col",
|
|
424
430
|
class: "astryx-diff-viewer__column-header"
|
|
425
431
|
};
|
|
426
|
-
const
|
|
432
|
+
const _hoisted_5$8 = {
|
|
427
433
|
scope: "col",
|
|
428
434
|
class: "astryx-diff-viewer__column-header"
|
|
429
435
|
};
|
|
430
|
-
const
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
const _hoisted_8$4 = ["aria-label", "onClick"];
|
|
436
|
+
const _hoisted_6$7 = { key: 0 };
|
|
437
|
+
const _hoisted_7$5 = ["colspan"];
|
|
438
|
+
const _hoisted_8$4 = { class: "astryx-diff-viewer__ltr" };
|
|
434
439
|
const _hoisted_9$4 = ["aria-label", "onClick"];
|
|
435
|
-
const _hoisted_10$4 = ["
|
|
436
|
-
const _hoisted_11$2 = {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
|
|
440
|
+
const _hoisted_10$4 = ["aria-label", "onClick"];
|
|
441
|
+
const _hoisted_11$2 = {
|
|
442
|
+
key: 0,
|
|
443
|
+
"aria-hidden": "true"
|
|
444
|
+
};
|
|
445
|
+
const _hoisted_12$1 = {
|
|
446
|
+
key: 0,
|
|
447
|
+
"aria-hidden": "true"
|
|
448
|
+
};
|
|
449
|
+
const _hoisted_13 = ["data-diff"];
|
|
450
|
+
const _hoisted_14 = { class: "astryx-diff-viewer__ltr" };
|
|
451
|
+
const _hoisted_15 = ["data-kind"];
|
|
452
|
+
const _hoisted_16 = { key: 0 };
|
|
453
|
+
const _hoisted_17 = ["colspan"];
|
|
454
|
+
const _hoisted_18 = { class: "astryx-diff-viewer__annotation-content" };
|
|
455
|
+
const _hoisted_19 = [
|
|
456
|
+
"data-view-mode",
|
|
457
|
+
"data-has-line-numbers",
|
|
458
|
+
"data-change-indicator",
|
|
459
|
+
"data-change-background"
|
|
460
|
+
];
|
|
461
|
+
const _hoisted_20 = {
|
|
442
462
|
key: 0,
|
|
443
463
|
class: "astryx-diff-viewer__gutter-col"
|
|
444
464
|
};
|
|
445
|
-
const
|
|
465
|
+
const _hoisted_21 = {
|
|
446
466
|
key: 1,
|
|
447
467
|
class: "astryx-diff-viewer__gutter-col"
|
|
448
468
|
};
|
|
449
|
-
const
|
|
469
|
+
const _hoisted_22 = {
|
|
450
470
|
key: 0,
|
|
451
471
|
scope: "col",
|
|
452
472
|
class: "astryx-diff-viewer__column-header"
|
|
453
473
|
};
|
|
454
|
-
const
|
|
474
|
+
const _hoisted_23 = {
|
|
455
475
|
scope: "col",
|
|
456
476
|
class: "astryx-diff-viewer__column-header"
|
|
457
477
|
};
|
|
458
|
-
const
|
|
478
|
+
const _hoisted_24 = {
|
|
459
479
|
scope: "col",
|
|
460
480
|
class: "astryx-diff-viewer__column-header"
|
|
461
481
|
};
|
|
462
|
-
const
|
|
482
|
+
const _hoisted_25 = {
|
|
463
483
|
key: 1,
|
|
464
484
|
scope: "col",
|
|
465
485
|
class: "astryx-diff-viewer__column-header"
|
|
466
486
|
};
|
|
467
|
-
const
|
|
487
|
+
const _hoisted_26 = {
|
|
468
488
|
scope: "col",
|
|
469
489
|
class: "astryx-diff-viewer__column-header"
|
|
470
490
|
};
|
|
471
|
-
const
|
|
491
|
+
const _hoisted_27 = {
|
|
472
492
|
scope: "col",
|
|
473
493
|
class: "astryx-diff-viewer__column-header"
|
|
474
494
|
};
|
|
475
|
-
const
|
|
476
|
-
const
|
|
477
|
-
const
|
|
478
|
-
const _hoisted_27 = ["aria-label", "onClick"];
|
|
479
|
-
const _hoisted_28 = ["data-diff"];
|
|
480
|
-
const _hoisted_29 = { class: "astryx-diff-viewer__ltr" };
|
|
481
|
-
const _hoisted_30 = ["data-kind"];
|
|
495
|
+
const _hoisted_28 = { key: 0 };
|
|
496
|
+
const _hoisted_29 = ["colspan"];
|
|
497
|
+
const _hoisted_30 = { class: "astryx-diff-viewer__ltr" };
|
|
482
498
|
const _hoisted_31 = ["aria-label", "onClick"];
|
|
483
|
-
const _hoisted_32 =
|
|
484
|
-
const _hoisted_33 = { class: "astryx-diff-viewer__ltr" };
|
|
485
|
-
const _hoisted_34 = ["data-kind"];
|
|
486
|
-
const _hoisted_35 = { key: 0 };
|
|
487
|
-
const _hoisted_36 = ["colspan"];
|
|
488
|
-
const _hoisted_37 = {
|
|
499
|
+
const _hoisted_32 = {
|
|
489
500
|
key: 0,
|
|
490
|
-
|
|
501
|
+
"aria-hidden": "true"
|
|
502
|
+
};
|
|
503
|
+
const _hoisted_33 = {
|
|
504
|
+
key: 0,
|
|
505
|
+
"aria-hidden": "true"
|
|
506
|
+
};
|
|
507
|
+
const _hoisted_34 = ["data-diff"];
|
|
508
|
+
const _hoisted_35 = { class: "astryx-diff-viewer__ltr" };
|
|
509
|
+
const _hoisted_36 = ["data-kind"];
|
|
510
|
+
const _hoisted_37 = ["aria-label", "onClick"];
|
|
511
|
+
const _hoisted_38 = {
|
|
512
|
+
key: 0,
|
|
513
|
+
"aria-hidden": "true"
|
|
491
514
|
};
|
|
492
|
-
const _hoisted_38 = ["colspan"];
|
|
493
515
|
const _hoisted_39 = {
|
|
516
|
+
key: 0,
|
|
517
|
+
"aria-hidden": "true"
|
|
518
|
+
};
|
|
519
|
+
const _hoisted_40 = ["data-diff"];
|
|
520
|
+
const _hoisted_41 = { class: "astryx-diff-viewer__ltr" };
|
|
521
|
+
const _hoisted_42 = ["data-kind"];
|
|
522
|
+
const _hoisted_43 = { key: 0 };
|
|
523
|
+
const _hoisted_44 = ["colspan"];
|
|
524
|
+
const _hoisted_45 = {
|
|
525
|
+
key: 0,
|
|
526
|
+
class: "astryx-diff-viewer__annotation-content"
|
|
527
|
+
};
|
|
528
|
+
const _hoisted_46 = ["colspan"];
|
|
529
|
+
const _hoisted_47 = {
|
|
494
530
|
key: 0,
|
|
495
531
|
class: "astryx-diff-viewer__annotation-content"
|
|
496
532
|
};
|
|
@@ -503,6 +539,8 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
503
539
|
splitRows: {},
|
|
504
540
|
hasLineNumbers: { type: Boolean },
|
|
505
541
|
isWrapped: { type: Boolean },
|
|
542
|
+
changeIndicator: {},
|
|
543
|
+
hasChangeBackground: { type: Boolean },
|
|
506
544
|
hasLineNumberClick: { type: Boolean },
|
|
507
545
|
digits: {}
|
|
508
546
|
},
|
|
@@ -510,9 +548,18 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
510
548
|
setup(__props, { emit: __emit }) {
|
|
511
549
|
const props = __props;
|
|
512
550
|
const emit = __emit;
|
|
551
|
+
const splitTable = useTemplateRef("splitTable");
|
|
552
|
+
function onPaneScroll(event) {
|
|
553
|
+
const left = event.currentTarget.scrollLeft;
|
|
554
|
+
const panes = splitTable.value?.querySelectorAll("[data-pane]") ?? [];
|
|
555
|
+
for (const pane of panes) if (pane.scrollLeft !== left) pane.scrollLeft = left;
|
|
556
|
+
}
|
|
513
557
|
const unifiedColumns = computed(() => (props.hasLineNumbers ? 2 : 0) + 2);
|
|
514
558
|
const splitSideColumns = computed(() => (props.hasLineNumbers ? 1 : 0) + 2);
|
|
515
|
-
const tableStyle = computed(() => ({
|
|
559
|
+
const tableStyle = computed(() => ({
|
|
560
|
+
"--astryx-diff-viewer-gutter-width": `${props.digits}ch`,
|
|
561
|
+
"--_diff-gutter-cell": `calc(${props.digits}ch + 2 * var(--astryx-spacing-2, 8px))`
|
|
562
|
+
}));
|
|
516
563
|
function lineNumber(cell, side) {
|
|
517
564
|
if (cell == null) return null;
|
|
518
565
|
return side === "old" ? cell.line.oldLineNumber : cell.line.newLineNumber;
|
|
@@ -551,6 +598,10 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
551
598
|
return __props.viewMode === "unified" ? (openBlock(), createElementBlock("table", {
|
|
552
599
|
key: 0,
|
|
553
600
|
class: normalizeClass(["astryx-diff-viewer__table", { "astryx-diff-viewer__table--wrapped": __props.isWrapped }]),
|
|
601
|
+
"data-view-mode": __props.viewMode,
|
|
602
|
+
"data-has-line-numbers": __props.hasLineNumbers || void 0,
|
|
603
|
+
"data-change-indicator": __props.changeIndicator,
|
|
604
|
+
"data-change-background": __props.hasChangeBackground ? void 0 : "false",
|
|
554
605
|
style: normalizeStyle(tableStyle.value)
|
|
555
606
|
}, [
|
|
556
607
|
createElementVNode("colgroup", null, [
|
|
@@ -559,28 +610,28 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
559
610
|
_cache[3] || (_cache[3] = createElementVNode("col", null, null, -1))
|
|
560
611
|
]),
|
|
561
612
|
createElementVNode("thead", null, [createElementVNode("tr", null, [
|
|
562
|
-
__props.hasLineNumbers ? (openBlock(), createElementBlock("th",
|
|
613
|
+
__props.hasLineNumbers ? (openBlock(), createElementBlock("th", _hoisted_2$11, [createVNode(unref(VisuallyHidden), null, {
|
|
563
614
|
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("Original line number", -1)])]),
|
|
564
615
|
_: 1
|
|
565
616
|
})])) : createCommentVNode("v-if", true),
|
|
566
|
-
__props.hasLineNumbers ? (openBlock(), createElementBlock("th",
|
|
617
|
+
__props.hasLineNumbers ? (openBlock(), createElementBlock("th", _hoisted_3$10, [createVNode(unref(VisuallyHidden), null, {
|
|
567
618
|
default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("Changed line number", -1)])]),
|
|
568
619
|
_: 1
|
|
569
620
|
})])) : createCommentVNode("v-if", true),
|
|
570
|
-
createElementVNode("th",
|
|
621
|
+
createElementVNode("th", _hoisted_4$9, [createVNode(unref(VisuallyHidden), null, {
|
|
571
622
|
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("Change", -1)])]),
|
|
572
623
|
_: 1
|
|
573
624
|
})]),
|
|
574
|
-
createElementVNode("th",
|
|
625
|
+
createElementVNode("th", _hoisted_5$8, [createVNode(unref(VisuallyHidden), null, {
|
|
575
626
|
default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("Code", -1)])]),
|
|
576
627
|
_: 1
|
|
577
628
|
})])
|
|
578
629
|
])]),
|
|
579
630
|
createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.unifiedRows, (row) => {
|
|
580
|
-
return openBlock(), createElementBlock(Fragment, { key: row.key }, [row.type === "hunk" ? (openBlock(), createElementBlock("tr",
|
|
631
|
+
return openBlock(), createElementBlock(Fragment, { key: row.key }, [row.type === "hunk" ? (openBlock(), createElementBlock("tr", _hoisted_6$7, [createElementVNode("td", {
|
|
581
632
|
colspan: unifiedColumns.value,
|
|
582
633
|
class: "astryx-diff-viewer__hunk"
|
|
583
|
-
}, [createElementVNode("span",
|
|
634
|
+
}, [createElementVNode("span", _hoisted_8$4, toDisplayString(row.header), 1)], 8, _hoisted_7$5)])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("tr", null, [
|
|
584
635
|
__props.hasLineNumbers ? (openBlock(), createElementBlock("td", {
|
|
585
636
|
key: 0,
|
|
586
637
|
class: normalizeClass(["astryx-diff-viewer__gutter", cellClass(row.cell)])
|
|
@@ -591,7 +642,7 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
591
642
|
"data-diff-line-button": "",
|
|
592
643
|
"aria-label": lineNumberButtonLabel("old", lineNumber(row.cell, "old")),
|
|
593
644
|
onClick: ($event) => emitLineNumberClick(row.cell, "old", $event)
|
|
594
|
-
}, toDisplayString(lineNumber(row.cell, "old")), 9,
|
|
645
|
+
}, toDisplayString(lineNumber(row.cell, "old")), 9, _hoisted_9$4)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(lineNumber(row.cell, "old")), 1)], 64))], 2)) : createCommentVNode("v-if", true),
|
|
595
646
|
__props.hasLineNumbers ? (openBlock(), createElementBlock("td", {
|
|
596
647
|
key: 1,
|
|
597
648
|
class: normalizeClass(["astryx-diff-viewer__gutter", cellClass(row.cell)])
|
|
@@ -602,18 +653,18 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
602
653
|
"data-diff-line-button": "",
|
|
603
654
|
"aria-label": lineNumberButtonLabel("new", lineNumber(row.cell, "new")),
|
|
604
655
|
onClick: ($event) => emitLineNumberClick(row.cell, "new", $event)
|
|
605
|
-
}, toDisplayString(lineNumber(row.cell, "new")), 9,
|
|
606
|
-
createElementVNode("td", { class: normalizeClass(["astryx-diff-viewer__marker", cellClass(row.cell)]) }, [row.cell.line.kind === "added" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
656
|
+
}, toDisplayString(lineNumber(row.cell, "new")), 9, _hoisted_10$4)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(lineNumber(row.cell, "new")), 1)], 64))], 2)) : createCommentVNode("v-if", true),
|
|
657
|
+
createElementVNode("td", { class: normalizeClass(["astryx-diff-viewer__marker", cellClass(row.cell)]) }, [row.cell.line.kind === "added" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.changeIndicator === "classic" ? (openBlock(), createElementBlock("span", _hoisted_11$2, "+")) : createCommentVNode("v-if", true), createVNode(unref(VisuallyHidden), null, {
|
|
607
658
|
default: withCtx(() => [..._cache[8] || (_cache[8] = [createTextVNode("Added", -1)])]),
|
|
608
659
|
_: 1
|
|
609
|
-
})], 64)) : row.cell.line.kind === "removed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
610
|
-
default: withCtx(() => [..._cache[
|
|
660
|
+
})], 64)) : row.cell.line.kind === "removed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.changeIndicator === "classic" ? (openBlock(), createElementBlock("span", _hoisted_12$1, "-")) : createCommentVNode("v-if", true), createVNode(unref(VisuallyHidden), null, {
|
|
661
|
+
default: withCtx(() => [..._cache[9] || (_cache[9] = [createTextVNode("Removed", -1)])]),
|
|
611
662
|
_: 1
|
|
612
663
|
})], 64)) : createCommentVNode("v-if", true)], 2),
|
|
613
664
|
createElementVNode("td", {
|
|
614
665
|
class: normalizeClass(["astryx-diff-viewer__code", [cellClass(row.cell), { "astryx-diff-viewer__code--wrapped": __props.isWrapped }]]),
|
|
615
666
|
"data-diff": diffKind(row.cell)
|
|
616
|
-
}, [createElementVNode("span",
|
|
667
|
+
}, [createElementVNode("span", _hoisted_14, [(openBlock(true), createElementBlock(Fragment, null, renderList(row.cell.groups, (group, groupIndex) => {
|
|
617
668
|
return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [group.changed ? (openBlock(), createElementBlock("span", {
|
|
618
669
|
key: 0,
|
|
619
670
|
class: "astryx-diff-viewer__change",
|
|
@@ -624,62 +675,68 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
624
675
|
key: 0,
|
|
625
676
|
class: normalizeClass(`astryx-token-${part.type}`)
|
|
626
677
|
}, toDisplayString(part.text), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
627
|
-
}), 128))], 8,
|
|
678
|
+
}), 128))], 8, _hoisted_15)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(group.parts, (part, partIndex) => {
|
|
628
679
|
return openBlock(), createElementBlock(Fragment, { key: partIndex }, [part.type != null ? (openBlock(), createElementBlock("span", {
|
|
629
680
|
key: 0,
|
|
630
681
|
class: normalizeClass(`astryx-token-${part.type}`)
|
|
631
682
|
}, toDisplayString(part.text), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
632
683
|
}), 128))], 64);
|
|
633
|
-
}), 128))])], 10,
|
|
634
|
-
]), row.cell.note != null ? (openBlock(), createElementBlock("tr",
|
|
684
|
+
}), 128))])], 10, _hoisted_13)
|
|
685
|
+
]), row.cell.note != null ? (openBlock(), createElementBlock("tr", _hoisted_16, [createElementVNode("td", {
|
|
635
686
|
colspan: unifiedColumns.value,
|
|
636
687
|
class: "astryx-diff-viewer__annotation"
|
|
637
|
-
}, [createElementVNode("div",
|
|
688
|
+
}, [createElementVNode("div", _hoisted_18, [createVNode(unref(RenderVNode_default), { content: row.cell.note }, null, 8, ["content"])])], 8, _hoisted_17)])) : createCommentVNode("v-if", true)], 64))], 64);
|
|
638
689
|
}), 128))])
|
|
639
|
-
],
|
|
690
|
+
], 14, _hoisted_1$12)) : (openBlock(), createElementBlock("table", {
|
|
640
691
|
key: 1,
|
|
692
|
+
ref_key: "splitTable",
|
|
693
|
+
ref: splitTable,
|
|
641
694
|
class: normalizeClass(["astryx-diff-viewer__table", { "astryx-diff-viewer__table--wrapped": __props.isWrapped }]),
|
|
695
|
+
"data-view-mode": __props.viewMode,
|
|
696
|
+
"data-has-line-numbers": __props.hasLineNumbers || void 0,
|
|
697
|
+
"data-change-indicator": __props.changeIndicator,
|
|
698
|
+
"data-change-background": __props.hasChangeBackground ? void 0 : "false",
|
|
642
699
|
style: normalizeStyle(tableStyle.value)
|
|
643
700
|
}, [
|
|
644
701
|
createElementVNode("colgroup", null, [
|
|
645
|
-
__props.hasLineNumbers ? (openBlock(), createElementBlock("col",
|
|
702
|
+
__props.hasLineNumbers ? (openBlock(), createElementBlock("col", _hoisted_20)) : createCommentVNode("v-if", true),
|
|
703
|
+
_cache[10] || (_cache[10] = createElementVNode("col", { class: "astryx-diff-viewer__marker-col" }, null, -1)),
|
|
704
|
+
_cache[11] || (_cache[11] = createElementVNode("col", null, null, -1)),
|
|
705
|
+
__props.hasLineNumbers ? (openBlock(), createElementBlock("col", _hoisted_21)) : createCommentVNode("v-if", true),
|
|
646
706
|
_cache[12] || (_cache[12] = createElementVNode("col", { class: "astryx-diff-viewer__marker-col" }, null, -1)),
|
|
647
|
-
_cache[13] || (_cache[13] = createElementVNode("col", null, null, -1))
|
|
648
|
-
__props.hasLineNumbers ? (openBlock(), createElementBlock("col", _hoisted_17)) : createCommentVNode("v-if", true),
|
|
649
|
-
_cache[14] || (_cache[14] = createElementVNode("col", { class: "astryx-diff-viewer__marker-col" }, null, -1)),
|
|
650
|
-
_cache[15] || (_cache[15] = createElementVNode("col", null, null, -1))
|
|
707
|
+
_cache[13] || (_cache[13] = createElementVNode("col", null, null, -1))
|
|
651
708
|
]),
|
|
652
709
|
createElementVNode("thead", null, [createElementVNode("tr", null, [
|
|
653
|
-
__props.hasLineNumbers ? (openBlock(), createElementBlock("th",
|
|
654
|
-
default: withCtx(() => [..._cache[
|
|
710
|
+
__props.hasLineNumbers ? (openBlock(), createElementBlock("th", _hoisted_22, [createVNode(unref(VisuallyHidden), null, {
|
|
711
|
+
default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode("Original line number", -1)])]),
|
|
655
712
|
_: 1
|
|
656
713
|
})])) : createCommentVNode("v-if", true),
|
|
657
|
-
createElementVNode("th",
|
|
658
|
-
default: withCtx(() => [..._cache[
|
|
714
|
+
createElementVNode("th", _hoisted_23, [createVNode(unref(VisuallyHidden), null, {
|
|
715
|
+
default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode("Change", -1)])]),
|
|
659
716
|
_: 1
|
|
660
717
|
})]),
|
|
661
|
-
createElementVNode("th",
|
|
662
|
-
default: withCtx(() => [..._cache[
|
|
718
|
+
createElementVNode("th", _hoisted_24, [createVNode(unref(VisuallyHidden), null, {
|
|
719
|
+
default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode("Original code", -1)])]),
|
|
663
720
|
_: 1
|
|
664
721
|
})]),
|
|
665
|
-
__props.hasLineNumbers ? (openBlock(), createElementBlock("th",
|
|
666
|
-
default: withCtx(() => [..._cache[
|
|
722
|
+
__props.hasLineNumbers ? (openBlock(), createElementBlock("th", _hoisted_25, [createVNode(unref(VisuallyHidden), null, {
|
|
723
|
+
default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode("Changed line number", -1)])]),
|
|
667
724
|
_: 1
|
|
668
725
|
})])) : createCommentVNode("v-if", true),
|
|
669
|
-
createElementVNode("th",
|
|
670
|
-
default: withCtx(() => [..._cache[
|
|
726
|
+
createElementVNode("th", _hoisted_26, [createVNode(unref(VisuallyHidden), null, {
|
|
727
|
+
default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode("Change", -1)])]),
|
|
671
728
|
_: 1
|
|
672
729
|
})]),
|
|
673
|
-
createElementVNode("th",
|
|
674
|
-
default: withCtx(() => [..._cache[
|
|
730
|
+
createElementVNode("th", _hoisted_27, [createVNode(unref(VisuallyHidden), null, {
|
|
731
|
+
default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode("Changed code", -1)])]),
|
|
675
732
|
_: 1
|
|
676
733
|
})])
|
|
677
734
|
])]),
|
|
678
735
|
createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.splitRows, (row) => {
|
|
679
|
-
return openBlock(), createElementBlock(Fragment, { key: row.key }, [row.type === "hunk" ? (openBlock(), createElementBlock("tr",
|
|
736
|
+
return openBlock(), createElementBlock(Fragment, { key: row.key }, [row.type === "hunk" ? (openBlock(), createElementBlock("tr", _hoisted_28, [createElementVNode("td", {
|
|
680
737
|
colspan: splitSideColumns.value * 2,
|
|
681
738
|
class: "astryx-diff-viewer__hunk"
|
|
682
|
-
}, [createElementVNode("span",
|
|
739
|
+
}, [createElementVNode("span", _hoisted_30, toDisplayString(row.header), 1)], 8, _hoisted_29)])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("tr", null, [
|
|
683
740
|
__props.hasLineNumbers ? (openBlock(), createElementBlock("td", {
|
|
684
741
|
key: 0,
|
|
685
742
|
class: normalizeClass(["astryx-diff-viewer__gutter", cellClass(row.old)])
|
|
@@ -690,18 +747,22 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
690
747
|
"data-diff-line-button": "",
|
|
691
748
|
"aria-label": lineNumberButtonLabel("old", lineNumber(row.old, "old")),
|
|
692
749
|
onClick: ($event) => emitLineNumberClick(row.old, "old", $event)
|
|
693
|
-
}, toDisplayString(lineNumber(row.old, "old")), 9,
|
|
694
|
-
createElementVNode("td", { class: normalizeClass(["astryx-diff-viewer__marker", cellClass(row.old)]) }, [row.old?.line.kind === "added" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
695
|
-
default: withCtx(() => [..._cache[
|
|
750
|
+
}, toDisplayString(lineNumber(row.old, "old")), 9, _hoisted_31)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(lineNumber(row.old, "old")), 1)], 64))], 2)) : createCommentVNode("v-if", true),
|
|
751
|
+
createElementVNode("td", { class: normalizeClass(["astryx-diff-viewer__marker", cellClass(row.old)]) }, [row.old?.line.kind === "added" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.changeIndicator === "classic" ? (openBlock(), createElementBlock("span", _hoisted_32, "+")) : createCommentVNode("v-if", true), createVNode(unref(VisuallyHidden), null, {
|
|
752
|
+
default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode("Added", -1)])]),
|
|
696
753
|
_: 1
|
|
697
|
-
})], 64)) : row.old?.line.kind === "removed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
698
|
-
default: withCtx(() => [..._cache[
|
|
754
|
+
})], 64)) : row.old?.line.kind === "removed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.changeIndicator === "classic" ? (openBlock(), createElementBlock("span", _hoisted_33, "-")) : createCommentVNode("v-if", true), createVNode(unref(VisuallyHidden), null, {
|
|
755
|
+
default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode("Removed", -1)])]),
|
|
699
756
|
_: 1
|
|
700
757
|
})], 64)) : createCommentVNode("v-if", true)], 2),
|
|
701
758
|
createElementVNode("td", {
|
|
702
759
|
class: normalizeClass(["astryx-diff-viewer__code astryx-diff-viewer__code--old", [cellClass(row.old), { "astryx-diff-viewer__code--wrapped": __props.isWrapped }]]),
|
|
703
760
|
"data-diff": diffKind(row.old)
|
|
704
|
-
}, [createElementVNode("
|
|
761
|
+
}, [createElementVNode("div", {
|
|
762
|
+
class: "astryx-diff-viewer__code-scroll",
|
|
763
|
+
"data-pane": "old",
|
|
764
|
+
onScroll: onPaneScroll
|
|
765
|
+
}, [createElementVNode("span", _hoisted_35, [(openBlock(true), createElementBlock(Fragment, null, renderList(row.old?.groups ?? [], (group, groupIndex) => {
|
|
705
766
|
return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [group.changed ? (openBlock(), createElementBlock("span", {
|
|
706
767
|
key: 0,
|
|
707
768
|
class: "astryx-diff-viewer__change",
|
|
@@ -712,13 +773,13 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
712
773
|
key: 0,
|
|
713
774
|
class: normalizeClass(`astryx-token-${part.type}`)
|
|
714
775
|
}, toDisplayString(part.text), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
715
|
-
}), 128))], 8,
|
|
776
|
+
}), 128))], 8, _hoisted_36)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(group.parts, (part, partIndex) => {
|
|
716
777
|
return openBlock(), createElementBlock(Fragment, { key: partIndex }, [part.type != null ? (openBlock(), createElementBlock("span", {
|
|
717
778
|
key: 0,
|
|
718
779
|
class: normalizeClass(`astryx-token-${part.type}`)
|
|
719
780
|
}, toDisplayString(part.text), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
720
781
|
}), 128))], 64);
|
|
721
|
-
}), 128))])], 10,
|
|
782
|
+
}), 128))])], 32)], 10, _hoisted_34),
|
|
722
783
|
__props.hasLineNumbers ? (openBlock(), createElementBlock("td", {
|
|
723
784
|
key: 1,
|
|
724
785
|
class: normalizeClass(["astryx-diff-viewer__gutter", cellClass(row.new)])
|
|
@@ -729,18 +790,22 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
729
790
|
"data-diff-line-button": "",
|
|
730
791
|
"aria-label": lineNumberButtonLabel("new", lineNumber(row.new, "new")),
|
|
731
792
|
onClick: ($event) => emitLineNumberClick(row.new, "new", $event)
|
|
732
|
-
}, toDisplayString(lineNumber(row.new, "new")), 9,
|
|
733
|
-
createElementVNode("td", { class: normalizeClass(["astryx-diff-viewer__marker", cellClass(row.new)]) }, [row.new?.line.kind === "added" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
734
|
-
default: withCtx(() => [..._cache[
|
|
793
|
+
}, toDisplayString(lineNumber(row.new, "new")), 9, _hoisted_37)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(lineNumber(row.new, "new")), 1)], 64))], 2)) : createCommentVNode("v-if", true),
|
|
794
|
+
createElementVNode("td", { class: normalizeClass(["astryx-diff-viewer__marker", cellClass(row.new)]) }, [row.new?.line.kind === "added" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.changeIndicator === "classic" ? (openBlock(), createElementBlock("span", _hoisted_38, "+")) : createCommentVNode("v-if", true), createVNode(unref(VisuallyHidden), null, {
|
|
795
|
+
default: withCtx(() => [..._cache[22] || (_cache[22] = [createTextVNode("Added", -1)])]),
|
|
735
796
|
_: 1
|
|
736
|
-
})], 64)) : row.new?.line.kind === "removed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
737
|
-
default: withCtx(() => [..._cache[
|
|
797
|
+
})], 64)) : row.new?.line.kind === "removed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.changeIndicator === "classic" ? (openBlock(), createElementBlock("span", _hoisted_39, "-")) : createCommentVNode("v-if", true), createVNode(unref(VisuallyHidden), null, {
|
|
798
|
+
default: withCtx(() => [..._cache[23] || (_cache[23] = [createTextVNode("Removed", -1)])]),
|
|
738
799
|
_: 1
|
|
739
800
|
})], 64)) : createCommentVNode("v-if", true)], 2),
|
|
740
801
|
createElementVNode("td", {
|
|
741
802
|
class: normalizeClass(["astryx-diff-viewer__code", [cellClass(row.new), { "astryx-diff-viewer__code--wrapped": __props.isWrapped }]]),
|
|
742
803
|
"data-diff": diffKind(row.new)
|
|
743
|
-
}, [createElementVNode("
|
|
804
|
+
}, [createElementVNode("div", {
|
|
805
|
+
class: "astryx-diff-viewer__code-scroll",
|
|
806
|
+
"data-pane": "new",
|
|
807
|
+
onScroll: onPaneScroll
|
|
808
|
+
}, [createElementVNode("span", _hoisted_41, [(openBlock(true), createElementBlock(Fragment, null, renderList(row.new?.groups ?? [], (group, groupIndex) => {
|
|
744
809
|
return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [group.changed ? (openBlock(), createElementBlock("span", {
|
|
745
810
|
key: 0,
|
|
746
811
|
class: "astryx-diff-viewer__change",
|
|
@@ -751,22 +816,22 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
751
816
|
key: 0,
|
|
752
817
|
class: normalizeClass(`astryx-token-${part.type}`)
|
|
753
818
|
}, toDisplayString(part.text), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
754
|
-
}), 128))], 8,
|
|
819
|
+
}), 128))], 8, _hoisted_42)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(group.parts, (part, partIndex) => {
|
|
755
820
|
return openBlock(), createElementBlock(Fragment, { key: partIndex }, [part.type != null ? (openBlock(), createElementBlock("span", {
|
|
756
821
|
key: 0,
|
|
757
822
|
class: normalizeClass(`astryx-token-${part.type}`)
|
|
758
823
|
}, toDisplayString(part.text), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
|
|
759
824
|
}), 128))], 64);
|
|
760
|
-
}), 128))])], 10,
|
|
761
|
-
]), oldNote(row) != null || newNote(row) != null ? (openBlock(), createElementBlock("tr",
|
|
825
|
+
}), 128))])], 32)], 10, _hoisted_40)
|
|
826
|
+
]), oldNote(row) != null || newNote(row) != null ? (openBlock(), createElementBlock("tr", _hoisted_43, [createElementVNode("td", {
|
|
762
827
|
colspan: splitSideColumns.value,
|
|
763
828
|
class: "astryx-diff-viewer__annotation astryx-diff-viewer__code--old"
|
|
764
|
-
}, [oldNote(row) != null ? (openBlock(), createElementBlock("div",
|
|
829
|
+
}, [oldNote(row) != null ? (openBlock(), createElementBlock("div", _hoisted_45, [createVNode(unref(RenderVNode_default), { content: oldNote(row) }, null, 8, ["content"])])) : createCommentVNode("v-if", true)], 8, _hoisted_44), createElementVNode("td", {
|
|
765
830
|
colspan: splitSideColumns.value,
|
|
766
831
|
class: "astryx-diff-viewer__annotation"
|
|
767
|
-
}, [newNote(row) != null ? (openBlock(), createElementBlock("div",
|
|
832
|
+
}, [newNote(row) != null ? (openBlock(), createElementBlock("div", _hoisted_47, [createVNode(unref(RenderVNode_default), { content: newNote(row) }, null, 8, ["content"])])) : createCommentVNode("v-if", true)], 8, _hoisted_46)])) : createCommentVNode("v-if", true)], 64))], 64);
|
|
768
833
|
}), 128))])
|
|
769
|
-
],
|
|
834
|
+
], 14, _hoisted_19));
|
|
770
835
|
};
|
|
771
836
|
}
|
|
772
837
|
});
|
|
@@ -1213,6 +1278,11 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
1213
1278
|
default: false
|
|
1214
1279
|
},
|
|
1215
1280
|
inlineHighlight: { default: "word" },
|
|
1281
|
+
changeIndicator: { default: "classic" },
|
|
1282
|
+
hasChangeBackground: {
|
|
1283
|
+
type: Boolean,
|
|
1284
|
+
default: true
|
|
1285
|
+
},
|
|
1216
1286
|
isCollapsible: {
|
|
1217
1287
|
type: Boolean,
|
|
1218
1288
|
default: true
|
|
@@ -1386,6 +1456,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
1386
1456
|
"split-rows": splitRows.value,
|
|
1387
1457
|
"has-line-numbers": __props.hasLineNumbers,
|
|
1388
1458
|
"is-wrapped": __props.isWrapped,
|
|
1459
|
+
"change-indicator": __props.changeIndicator,
|
|
1460
|
+
"has-change-background": __props.hasChangeBackground,
|
|
1389
1461
|
"has-line-number-click": hasLineNumberClick.value,
|
|
1390
1462
|
digits: stats.value.digits,
|
|
1391
1463
|
onLineNumberClick: relayLineNumberClick
|
|
@@ -1395,6 +1467,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
1395
1467
|
"split-rows",
|
|
1396
1468
|
"has-line-numbers",
|
|
1397
1469
|
"is-wrapped",
|
|
1470
|
+
"change-indicator",
|
|
1471
|
+
"has-change-background",
|
|
1398
1472
|
"has-line-number-click",
|
|
1399
1473
|
"digits"
|
|
1400
1474
|
])], 512)], 16, _hoisted_12))], 64)) : createCommentVNode("v-if", true)], 8, _hoisted_9$3)]),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryx-vue/lab",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"description": "Astryx lab components for Vue 3 — experimental components that may change. Ships only under the canary dist-tag.",
|
|
6
6
|
"author": "ShenQingchuan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
],
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"vue": "^3.5.0",
|
|
56
|
-
"@astryx-vue/core": "^0.
|
|
56
|
+
"@astryx-vue/core": "^0.7.9"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "26.6.4",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"unplugin-vue": "8.0.0",
|
|
65
65
|
"vue": "3.5.43",
|
|
66
66
|
"vue-tsc": "3.3.12",
|
|
67
|
-
"@astryx-vue/core": "^0.
|
|
67
|
+
"@astryx-vue/core": "^0.7.9"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsdown",
|
package/styles/diff-viewer.css
CHANGED
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
.astryx-diff-viewer__marker {
|
|
170
|
+
position: relative;
|
|
170
171
|
padding: 0 var(--astryx-spacing-2, 8px) 0 var(--astryx-spacing-1, 4px);
|
|
171
172
|
color: var(--astryx-color-text-secondary, light-dark(#474747, #9e9e9e));
|
|
172
173
|
vertical-align: top;
|
|
@@ -187,11 +188,77 @@
|
|
|
187
188
|
overflow-wrap: anywhere;
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
/* 分栏固定在左右各一半;只有代码滚动,行号和变化标记留在原地。 */
|
|
192
|
+
.astryx-diff-viewer__table[data-view-mode='split'] {
|
|
193
|
+
width: 100%;
|
|
194
|
+
min-width: 0;
|
|
195
|
+
table-layout: fixed;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.astryx-diff-viewer__code-scroll {
|
|
199
|
+
display: block;
|
|
200
|
+
max-width: 100%;
|
|
201
|
+
overflow-x: auto;
|
|
202
|
+
overflow-y: hidden;
|
|
203
|
+
overscroll-behavior-inline: contain;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.astryx-diff-viewer__code-scroll > .astryx-diff-viewer__ltr {
|
|
207
|
+
display: inline-block;
|
|
208
|
+
min-width: 100%;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.astryx-diff-viewer__code--wrapped .astryx-diff-viewer__code-scroll {
|
|
212
|
+
overflow-x: hidden;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 统一视图仍整表滚动,行号和标记通过 sticky 留在视口内。 */
|
|
216
|
+
.astryx-diff-viewer__table[data-view-mode='unified'] .astryx-diff-viewer__gutter,
|
|
217
|
+
.astryx-diff-viewer__table[data-view-mode='unified'] .astryx-diff-viewer__marker {
|
|
218
|
+
position: sticky;
|
|
219
|
+
z-index: 1;
|
|
220
|
+
background-color: var(--astryx-code-block-background, var(--astryx-color-background-surface, light-dark(#ffffff, #262626)));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.astryx-diff-viewer__table[data-view-mode='unified'][data-has-line-numbers] .astryx-diff-viewer__gutter:nth-child(1) {
|
|
224
|
+
inset-inline-start: 0;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.astryx-diff-viewer__table[data-view-mode='unified'][data-has-line-numbers] .astryx-diff-viewer__gutter:nth-child(2) {
|
|
228
|
+
inset-inline-start: var(--_diff-gutter-cell, 2ch);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.astryx-diff-viewer__table[data-view-mode='unified'][data-has-line-numbers] .astryx-diff-viewer__marker {
|
|
232
|
+
inset-inline-start: calc(2 * var(--_diff-gutter-cell, 2ch));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.astryx-diff-viewer__table[data-view-mode='unified']:not([data-has-line-numbers]) .astryx-diff-viewer__marker {
|
|
236
|
+
inset-inline-start: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
190
239
|
/* 分栏时旧文件一侧负责画中间的分隔线。 */
|
|
191
240
|
.astryx-diff-viewer__code--old {
|
|
192
241
|
border-inline-end: var(--astryx-border-width, 1px) solid var(--astryx-color-border, light-dark(#00000014, #ffffff1a));
|
|
193
242
|
}
|
|
194
243
|
|
|
244
|
+
.astryx-diff-viewer__table[data-change-background='false'] .is-added,
|
|
245
|
+
.astryx-diff-viewer__table[data-change-background='false'] .is-removed {
|
|
246
|
+
background-color: transparent;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.astryx-diff-viewer__table[data-change-indicator='bars'] .astryx-diff-viewer__marker.is-added::before,
|
|
250
|
+
.astryx-diff-viewer__table[data-change-indicator='bars'] .astryx-diff-viewer__marker.is-removed::before {
|
|
251
|
+
content: '';
|
|
252
|
+
position: absolute;
|
|
253
|
+
inset-block: 0;
|
|
254
|
+
inset-inline-start: 0;
|
|
255
|
+
border-inline-start: 2px solid currentColor;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.astryx-diff-viewer__table[data-change-indicator='bars'] .astryx-diff-viewer__marker.is-removed::before {
|
|
259
|
+
border-inline-start-style: dashed;
|
|
260
|
+
}
|
|
261
|
+
|
|
195
262
|
.astryx-diff-viewer__gutter.is-added,
|
|
196
263
|
.astryx-diff-viewer__marker.is-added,
|
|
197
264
|
.astryx-diff-viewer__code.is-added {
|