@open-file-viewer/core 0.1.6 → 0.1.7
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 +45 -0
- package/dist/index.cjs +943 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -2
- package/dist/index.d.ts +41 -2
- package/dist/index.js +943 -54
- package/dist/index.js.map +1 -1
- package/dist/style.css +218 -33
- package/package.json +7 -1
package/dist/style.css
CHANGED
|
@@ -862,43 +862,65 @@
|
|
|
862
862
|
.ofv-table-scroll table {
|
|
863
863
|
border-collapse: collapse;
|
|
864
864
|
min-width: 100%;
|
|
865
|
+
table-layout: fixed;
|
|
865
866
|
}
|
|
866
867
|
|
|
867
868
|
.ofv-table-scroll td,
|
|
868
869
|
.ofv-table-scroll th {
|
|
869
|
-
|
|
870
|
+
position: relative;
|
|
870
871
|
border: 1px solid var(--ofv-border);
|
|
871
|
-
padding:
|
|
872
|
-
white-space:
|
|
873
|
-
overflow:
|
|
874
|
-
|
|
872
|
+
padding: 5px 24px 5px 8px;
|
|
873
|
+
white-space: normal;
|
|
874
|
+
overflow: visible;
|
|
875
|
+
overflow-wrap: anywhere;
|
|
876
|
+
word-break: break-word;
|
|
877
|
+
text-overflow: clip;
|
|
875
878
|
font-size: 13px;
|
|
879
|
+
line-height: 1.45;
|
|
880
|
+
vertical-align: middle;
|
|
876
881
|
}
|
|
877
882
|
|
|
878
|
-
.ofv-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
z-index: 2;
|
|
882
|
-
top: 0;
|
|
883
|
-
background: var(--ofv-surface-muted);
|
|
883
|
+
.ofv-cell-formula {
|
|
884
|
+
background-image: linear-gradient(135deg, #f59e0b 0 8px, transparent 8px);
|
|
885
|
+
background-repeat: no-repeat;
|
|
884
886
|
}
|
|
885
887
|
|
|
886
|
-
.ofv-
|
|
887
|
-
|
|
888
|
-
position: sticky;
|
|
889
|
-
z-index: 1;
|
|
890
|
-
left: 0;
|
|
891
|
-
background: var(--ofv-surface-muted);
|
|
888
|
+
.ofv-cell-merged {
|
|
889
|
+
white-space: normal;
|
|
892
890
|
}
|
|
893
891
|
|
|
894
|
-
.ofv-
|
|
895
|
-
|
|
896
|
-
|
|
892
|
+
.ofv-cell-multiline {
|
|
893
|
+
white-space: pre-wrap;
|
|
894
|
+
word-break: break-word;
|
|
895
|
+
overflow: visible;
|
|
896
|
+
text-overflow: clip;
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
.ofv-
|
|
900
|
-
|
|
901
|
-
|
|
899
|
+
.ofv-column-resize-handle {
|
|
900
|
+
position: absolute;
|
|
901
|
+
top: 0;
|
|
902
|
+
right: -3px;
|
|
903
|
+
z-index: 2;
|
|
904
|
+
width: 7px;
|
|
905
|
+
height: 100%;
|
|
906
|
+
cursor: col-resize;
|
|
907
|
+
touch-action: none;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
.ofv-column-resize-handle::after {
|
|
911
|
+
position: absolute;
|
|
912
|
+
top: 4px;
|
|
913
|
+
bottom: 4px;
|
|
914
|
+
left: 3px;
|
|
915
|
+
width: 1px;
|
|
916
|
+
border-radius: 999px;
|
|
917
|
+
background: transparent;
|
|
918
|
+
content: "";
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
.ofv-column-resize-handle:hover::after,
|
|
922
|
+
.ofv-column-resize-handle:active::after {
|
|
923
|
+
background: #2563eb;
|
|
902
924
|
}
|
|
903
925
|
|
|
904
926
|
.ofv-formula-list ul {
|
|
@@ -1322,18 +1344,40 @@
|
|
|
1322
1344
|
|
|
1323
1345
|
.ofv-psd-preview {
|
|
1324
1346
|
display: grid;
|
|
1325
|
-
|
|
1326
|
-
|
|
1347
|
+
min-width: 0;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.ofv-psd-error {
|
|
1351
|
+
color: #b91c1c;
|
|
1327
1352
|
}
|
|
1328
1353
|
|
|
1329
|
-
.ofv-psd-
|
|
1354
|
+
.ofv-psd-composite {
|
|
1330
1355
|
display: grid;
|
|
1331
|
-
|
|
1332
|
-
gap: 8px 16px;
|
|
1356
|
+
min-width: 0;
|
|
1333
1357
|
}
|
|
1334
1358
|
|
|
1335
|
-
.ofv-psd-
|
|
1336
|
-
|
|
1359
|
+
.ofv-psd-canvas {
|
|
1360
|
+
display: block;
|
|
1361
|
+
width: auto;
|
|
1362
|
+
max-width: 100%;
|
|
1363
|
+
height: auto;
|
|
1364
|
+
max-height: min(72vh, 920px);
|
|
1365
|
+
margin: 0 auto;
|
|
1366
|
+
border: 1px solid var(--ofv-border);
|
|
1367
|
+
border-radius: 10px;
|
|
1368
|
+
background:
|
|
1369
|
+
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
|
|
1370
|
+
linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
|
|
1371
|
+
linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
|
|
1372
|
+
linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
|
|
1373
|
+
background-color: #f8fafc;
|
|
1374
|
+
background-position:
|
|
1375
|
+
0 0,
|
|
1376
|
+
0 8px,
|
|
1377
|
+
8px -8px,
|
|
1378
|
+
-8px 0;
|
|
1379
|
+
background-size: 16px 16px;
|
|
1380
|
+
object-fit: contain;
|
|
1337
1381
|
}
|
|
1338
1382
|
|
|
1339
1383
|
.ofv-sqlite-preview {
|
|
@@ -1552,21 +1596,37 @@
|
|
|
1552
1596
|
}
|
|
1553
1597
|
|
|
1554
1598
|
.ofv-cad-conversion {
|
|
1599
|
+
display: grid;
|
|
1600
|
+
gap: 8px;
|
|
1555
1601
|
margin: 12px 0;
|
|
1556
|
-
padding:
|
|
1602
|
+
padding: 12px;
|
|
1557
1603
|
border: 1px solid var(--ofv-border);
|
|
1558
1604
|
border-radius: 8px;
|
|
1559
|
-
background:
|
|
1605
|
+
background:
|
|
1606
|
+
linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.08)),
|
|
1607
|
+
var(--ofv-surface-muted);
|
|
1560
1608
|
color: var(--ofv-text);
|
|
1561
1609
|
font-size: 13px;
|
|
1562
1610
|
line-height: 1.6;
|
|
1563
1611
|
}
|
|
1564
1612
|
|
|
1613
|
+
.ofv-cad-conversion h4 {
|
|
1614
|
+
margin: 0;
|
|
1615
|
+
font-size: 14px;
|
|
1616
|
+
line-height: 1.35;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
.ofv-cad-conversion ol {
|
|
1620
|
+
margin: 0;
|
|
1621
|
+
padding-left: 20px;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1565
1624
|
.ofv-cad-conversion li + li {
|
|
1566
1625
|
margin-top: 6px;
|
|
1567
1626
|
}
|
|
1568
1627
|
|
|
1569
|
-
.ofv-cad-binary-probe
|
|
1628
|
+
.ofv-cad-binary-probe,
|
|
1629
|
+
.ofv-cad-raw-preview {
|
|
1570
1630
|
margin-top: 12px;
|
|
1571
1631
|
}
|
|
1572
1632
|
|
|
@@ -1583,6 +1643,131 @@
|
|
|
1583
1643
|
margin-top: 12px;
|
|
1584
1644
|
}
|
|
1585
1645
|
|
|
1646
|
+
.ofv-dwg-preview {
|
|
1647
|
+
display: grid;
|
|
1648
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
1649
|
+
gap: 12px;
|
|
1650
|
+
min-height: 520px;
|
|
1651
|
+
padding: 14px;
|
|
1652
|
+
border: 1px solid var(--ofv-border);
|
|
1653
|
+
border-radius: 12px;
|
|
1654
|
+
background:
|
|
1655
|
+
linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
|
|
1656
|
+
linear-gradient(0deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
|
|
1657
|
+
#020617;
|
|
1658
|
+
background-size: 24px 24px;
|
|
1659
|
+
overflow: auto;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
.ofv-dwg-preview-status {
|
|
1663
|
+
position: sticky;
|
|
1664
|
+
top: 0;
|
|
1665
|
+
z-index: 1;
|
|
1666
|
+
width: max-content;
|
|
1667
|
+
max-width: 100%;
|
|
1668
|
+
padding: 8px 10px;
|
|
1669
|
+
border: 1px solid rgba(148, 163, 184, 0.24);
|
|
1670
|
+
border-radius: 8px;
|
|
1671
|
+
background: rgba(15, 23, 42, 0.9);
|
|
1672
|
+
color: #e5e7eb;
|
|
1673
|
+
font-size: 13px;
|
|
1674
|
+
box-shadow: 0 10px 24px rgba(2, 6, 23, 0.32);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.ofv-dwg-preview-status span {
|
|
1678
|
+
display: grid;
|
|
1679
|
+
gap: 4px;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
.ofv-dwg-preview-status small {
|
|
1683
|
+
color: #94a3b8;
|
|
1684
|
+
font-size: 12px;
|
|
1685
|
+
font-weight: 500;
|
|
1686
|
+
line-height: 1.45;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.ofv-dwg-thumbnail {
|
|
1690
|
+
display: grid;
|
|
1691
|
+
grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
|
|
1692
|
+
align-items: center;
|
|
1693
|
+
gap: 14px;
|
|
1694
|
+
width: min(100%, 640px);
|
|
1695
|
+
margin: 0;
|
|
1696
|
+
padding: 10px;
|
|
1697
|
+
border: 1px solid rgba(148, 163, 184, 0.22);
|
|
1698
|
+
border-radius: 10px;
|
|
1699
|
+
background: rgba(15, 23, 42, 0.78);
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
.ofv-dwg-thumbnail img,
|
|
1703
|
+
.ofv-dwg-thumbnail-preview img {
|
|
1704
|
+
display: block;
|
|
1705
|
+
height: auto;
|
|
1706
|
+
border: 1px solid rgba(148, 163, 184, 0.24);
|
|
1707
|
+
border-radius: 6px;
|
|
1708
|
+
background: #020617;
|
|
1709
|
+
image-rendering: auto;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
.ofv-dwg-thumbnail img {
|
|
1713
|
+
width: 100%;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
.ofv-dwg-thumbnail figcaption {
|
|
1717
|
+
color: #cbd5e1;
|
|
1718
|
+
font-size: 13px;
|
|
1719
|
+
line-height: 1.5;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
.ofv-dwg-thumbnail-preview {
|
|
1723
|
+
display: grid;
|
|
1724
|
+
gap: 10px;
|
|
1725
|
+
align-content: start;
|
|
1726
|
+
min-height: 420px;
|
|
1727
|
+
margin: 0;
|
|
1728
|
+
padding: 12px;
|
|
1729
|
+
border: 1px solid rgba(148, 163, 184, 0.22);
|
|
1730
|
+
border-radius: 10px;
|
|
1731
|
+
background: #020617;
|
|
1732
|
+
overflow: auto;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
.ofv-dwg-thumbnail-preview img {
|
|
1736
|
+
width: min(100%, 1120px);
|
|
1737
|
+
margin: 0 auto;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
.ofv-dwg-thumbnail-preview figcaption {
|
|
1741
|
+
max-width: 920px;
|
|
1742
|
+
margin: 0 auto;
|
|
1743
|
+
color: #94a3b8;
|
|
1744
|
+
font-size: 12px;
|
|
1745
|
+
line-height: 1.55;
|
|
1746
|
+
text-align: center;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
.ofv-dwg-preview-svg {
|
|
1750
|
+
display: block;
|
|
1751
|
+
max-width: none;
|
|
1752
|
+
height: auto;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
.ofv-dwg-preview-frame {
|
|
1756
|
+
min-height: 420px;
|
|
1757
|
+
overflow: auto;
|
|
1758
|
+
background: #020617;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
.ofv-dwg-preview-frame .ofv-dwg-preview-svg {
|
|
1762
|
+
min-height: 420px;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
@container (max-width: 720px) {
|
|
1766
|
+
.ofv-dwg-thumbnail {
|
|
1767
|
+
grid-template-columns: 1fr;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1586
1771
|
.ofv-ofd {
|
|
1587
1772
|
--ofv-ofd-zoom: 1;
|
|
1588
1773
|
--ofv-ofd-rotation: 0deg;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-file-viewer/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Framework-agnostic browser file preview core.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -38,14 +38,19 @@
|
|
|
38
38
|
"typecheck": "tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
|
+
"@mlightcad/libredwg-web": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
41
44
|
"pdfjs-dist": {
|
|
42
45
|
"optional": true
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
48
|
"peerDependencies": {
|
|
49
|
+
"@mlightcad/libredwg-web": ">=0.7.4",
|
|
46
50
|
"pdfjs-dist": ">=4"
|
|
47
51
|
},
|
|
48
52
|
"devDependencies": {
|
|
53
|
+
"@mlightcad/libredwg-web": "0.7.4",
|
|
49
54
|
"@types/leaflet": "^1.9.21",
|
|
50
55
|
"@types/marked": "^6.0.0",
|
|
51
56
|
"@types/pako": "^2.0.4",
|
|
@@ -58,6 +63,7 @@
|
|
|
58
63
|
"@aiden0z/pptx-renderer": "^1.0.3",
|
|
59
64
|
"@kenjiuno/msgreader": "^1.28.0",
|
|
60
65
|
"@mapbox/togeojson": "^0.16.2",
|
|
66
|
+
"ag-psd": "^30.2.0",
|
|
61
67
|
"docx-preview": "^0.3.7",
|
|
62
68
|
"dompurify": "^3.4.10",
|
|
63
69
|
"heic2any": "^0.0.4",
|