@eui/components 18.2.16-snapshot-1756456305763 → 18.2.16-snapshot-1756489547144
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/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/variables.html +499 -71
- package/docs/properties.html +1 -1
- package/esm2022/eui-file-upload/utils/eui-file-upload.validators.mjs +3 -2
- package/esm2022/eui-file-upload/utils/mime-types.mjs +292 -39
- package/eui-file-upload/utils/mime-types.d.ts.map +1 -1
- package/fesm2022/eui-components-eui-file-upload.mjs +293 -39
- package/fesm2022/eui-components-eui-file-upload.mjs.map +1 -1
- package/package.json +9 -9
- package/directives/package.json +0 -3
- package/eui-accordion/package.json +0 -3
- package/eui-alert/package.json +0 -3
- package/eui-autocomplete/package.json +0 -3
- package/eui-avatar/package.json +0 -3
- package/eui-badge/package.json +0 -3
- package/eui-block-content/package.json +0 -3
- package/eui-block-document/package.json +0 -3
- package/eui-breadcrumb/package.json +0 -3
- package/eui-button/package.json +0 -3
- package/eui-button-group/package.json +0 -3
- package/eui-button-v2/package.json +0 -3
- package/eui-card/package.json +0 -3
- package/eui-chip/package.json +0 -3
- package/eui-chip-list/package.json +0 -3
- package/eui-dashboard-button/package.json +0 -3
- package/eui-dashboard-card/package.json +0 -3
- package/eui-date-range-selector/package.json +0 -3
- package/eui-datepicker/package.json +0 -3
- package/eui-dialog/package.json +0 -3
- package/eui-dimmer/package.json +0 -3
- package/eui-disable-content/package.json +0 -3
- package/eui-discussion-thread/package.json +0 -3
- package/eui-dropdown/package.json +0 -3
- package/eui-feedback-message/package.json +0 -3
- package/eui-fieldset/package.json +0 -3
- package/eui-file-upload/package.json +0 -3
- package/eui-growl/package.json +0 -3
- package/eui-icon/package.json +0 -3
- package/eui-icon-button/package.json +0 -3
- package/eui-icon-button-expander/package.json +0 -3
- package/eui-icon-color/package.json +0 -3
- package/eui-icon-input/package.json +0 -3
- package/eui-icon-state/package.json +0 -3
- package/eui-icon-toggle/package.json +0 -3
- package/eui-input-checkbox/package.json +0 -3
- package/eui-input-group/package.json +0 -3
- package/eui-input-number/package.json +0 -3
- package/eui-input-radio/package.json +0 -3
- package/eui-input-text/package.json +0 -3
- package/eui-label/package.json +0 -3
- package/eui-language-selector/package.json +0 -3
- package/eui-list/package.json +0 -3
- package/eui-menu/package.json +0 -3
- package/eui-message-box/package.json +0 -3
- package/eui-navbar/package.json +0 -3
- package/eui-overlay/package.json +0 -3
- package/eui-page/package.json +0 -3
- package/eui-paginator/package.json +0 -3
- package/eui-popover/package.json +0 -3
- package/eui-progress-bar/package.json +0 -3
- package/eui-progress-circle/package.json +0 -3
- package/eui-select/package.json +0 -3
- package/eui-sidebar-menu/package.json +0 -3
- package/eui-skeleton/package.json +0 -3
- package/eui-slide-toggle/package.json +0 -3
- package/eui-split-button/package.json +0 -3
- package/eui-table/package.json +0 -3
- package/eui-table-v2/package.json +0 -3
- package/eui-tabs/package.json +0 -3
- package/eui-textarea/package.json +0 -3
- package/eui-timebar/package.json +0 -3
- package/eui-timeline/package.json +0 -3
- package/eui-timepicker/package.json +0 -3
- package/eui-tree/package.json +0 -3
- package/eui-tree-list/package.json +0 -3
- package/eui-user-profile/package.json +0 -3
- package/eui-wizard/package.json +0 -3
- package/externals/charts/package.json +0 -3
- package/externals/eui-editor/package.json +0 -3
- package/externals/helpers/package.json +0 -3
- package/externals/quill/package.json +0 -3
- package/externals/search/favourite-queries/package.json +0 -3
- package/layout/package.json +0 -3
- package/pipes/package.json +0 -3
- package/shared/package.json +0 -3
- package/validators/package.json +0 -3
@@ -194,6 +194,9 @@
|
|
194
194
|
<li>
|
195
195
|
<a href="#euiStartEndDateValidator" title="packages/components/eui-date-range-selector/eui-date-range-selector.validators.ts" ><b>euiStartEndDateValidator</b> (packages/.../eui-date-range-selector.validators.ts)</a>
|
196
196
|
</li>
|
197
|
+
<li>
|
198
|
+
<a href="#extractZipFileList" title="packages/components/eui-file-upload/utils/mime-types.ts" ><b>extractZipFileList</b> (packages/.../mime-types.ts)</a>
|
199
|
+
</li>
|
197
200
|
<li>
|
198
201
|
<a href="#getFormat" title="packages/components/externals/quill/quill-editor.component.ts" ><b>getFormat</b> (packages/.../quill-editor.component.ts)</a>
|
199
202
|
</li>
|
@@ -206,6 +209,18 @@
|
|
206
209
|
<li>
|
207
210
|
<a href="#getViewElement" title="packages/components/externals/helpers/get-view-element.helper.ts" ><b>getViewElement</b> (packages/.../get-view-element.helper.ts)</a>
|
208
211
|
</li>
|
212
|
+
<li>
|
213
|
+
<a href="#identifyAsfFormat" title="packages/components/eui-file-upload/utils/mime-types.ts" ><b>identifyAsfFormat</b> (packages/.../mime-types.ts)</a>
|
214
|
+
</li>
|
215
|
+
<li>
|
216
|
+
<a href="#identifyHeifFormat" title="packages/components/eui-file-upload/utils/mime-types.ts" ><b>identifyHeifFormat</b> (packages/.../mime-types.ts)</a>
|
217
|
+
</li>
|
218
|
+
<li>
|
219
|
+
<a href="#identifyOggFormat" title="packages/components/eui-file-upload/utils/mime-types.ts" ><b>identifyOggFormat</b> (packages/.../mime-types.ts)</a>
|
220
|
+
</li>
|
221
|
+
<li>
|
222
|
+
<a href="#identifyZipBasedFormat" title="packages/components/eui-file-upload/utils/mime-types.ts" ><b>identifyZipBasedFormat</b> (packages/.../mime-types.ts)</a>
|
223
|
+
</li>
|
209
224
|
<li>
|
210
225
|
<a href="#initialState" title="packages/components/eui-card/services/ui-state.service.ts" ><b>initialState</b> (packages/.../ui-state.service.ts)</a>
|
211
226
|
</li>
|
@@ -517,7 +532,8 @@
|
|
517
532
|
const reader = new FileReader();
|
518
533
|
reader.onloadend = (): void => {
|
519
534
|
const buffer = reader.result as ArrayBuffer;
|
520
|
-
|
535
|
+
// Read more bytes to support complex MIME type detection (e.g., ASF format analysis)
|
536
|
+
const headerBytes = new Uint8Array(buffer).slice(0, Math.min(1024, buffer.byteLength));
|
521
537
|
const mime = getMimeType(headerBytes);
|
522
538
|
if (mimeTypes.includes(mime)) {
|
523
539
|
subscriber.next(null);
|
@@ -1567,77 +1583,54 @@
|
|
1567
1583
|
</tbody>
|
1568
1584
|
</table>
|
1569
1585
|
</section>
|
1570
|
-
<h3>packages/components/
|
1586
|
+
<h3>packages/components/eui-file-upload/utils/mime-types.ts</h3>
|
1571
1587
|
<section data-compodoc="block-properties">
|
1572
1588
|
<h3></h3> <table class="table table-sm table-bordered">
|
1573
1589
|
<tbody>
|
1574
1590
|
<tr>
|
1575
1591
|
<td class="col-md-4">
|
1576
|
-
<a name="
|
1592
|
+
<a name="extractZipFileList"></a>
|
1577
1593
|
<span class="name">
|
1578
|
-
<span ><b>
|
1579
|
-
<a href="#
|
1594
|
+
<span ><b>extractZipFileList</b></span>
|
1595
|
+
<a href="#extractZipFileList"><span class="icon ion-ios-link"></span></a>
|
1580
1596
|
</span>
|
1581
1597
|
</td>
|
1582
1598
|
</tr>
|
1583
1599
|
<tr>
|
1584
1600
|
<td class="col-md-4">
|
1585
|
-
<i>Default value : </i><code>(
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
</td>
|
1590
|
-
</tr>
|
1601
|
+
<i>Default value : </i><code>(data: Uint8Array): string[] => {
|
1602
|
+
// Simplified ZIP parsing - looks for central directory entries
|
1603
|
+
const files: string[] = [];
|
1604
|
+
let offset = 0;
|
1591
1605
|
|
1606
|
+
while (offset < data.length - 4) {
|
1607
|
+
// Look for local file header signature (0x04034b50)
|
1608
|
+
if (data[offset] === 0x50 && data[offset + 1] === 0x4b &&
|
1609
|
+
data[offset + 2] === 0x03 && data[offset + 3] === 0x04) {
|
1592
1610
|
|
1593
|
-
|
1594
|
-
|
1595
|
-
<table class="table table-sm table-bordered">
|
1596
|
-
<tbody>
|
1597
|
-
<tr>
|
1598
|
-
<td class="col-md-4">
|
1599
|
-
<a name="Quill"></a>
|
1600
|
-
<span class="name">
|
1601
|
-
<span ><b>Quill</b></span>
|
1602
|
-
<a href="#Quill"><span class="icon ion-ios-link"></span></a>
|
1603
|
-
</span>
|
1604
|
-
</td>
|
1605
|
-
</tr>
|
1606
|
-
<tr>
|
1607
|
-
<td class="col-md-4">
|
1608
|
-
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
1609
|
-
|
1610
|
-
</td>
|
1611
|
-
</tr>
|
1611
|
+
const filenameLength = data[offset + 26] | (data[offset + 27] << 8);
|
1612
|
+
const extraFieldLength = data[offset + 28] | (data[offset + 29] << 8);
|
1612
1613
|
|
1614
|
+
if (filenameLength > 0 && offset + 30 + filenameLength <= data.length) {
|
1615
|
+
const filename = new TextDecoder().decode(data.slice(offset + 30, offset + 30 + filenameLength));
|
1616
|
+
files.push(filename);
|
1617
|
+
}
|
1613
1618
|
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
<td class="col-md-4">
|
1620
|
-
<a name="require"></a>
|
1621
|
-
<span class="name">
|
1622
|
-
<span ><b>require</b></span>
|
1623
|
-
<a href="#require"><span class="icon ion-ios-link"></span></a>
|
1624
|
-
</span>
|
1625
|
-
</td>
|
1626
|
-
</tr>
|
1627
|
-
<tr>
|
1628
|
-
<td class="col-md-4">
|
1629
|
-
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
1619
|
+
offset += 30 + filenameLength + extraFieldLength;
|
1620
|
+
} else {
|
1621
|
+
offset++;
|
1622
|
+
}
|
1623
|
+
}
|
1630
1624
|
|
1625
|
+
return files;
|
1626
|
+
}</code>
|
1631
1627
|
</td>
|
1632
1628
|
</tr>
|
1633
1629
|
|
1634
1630
|
|
1635
1631
|
</tbody>
|
1636
1632
|
</table>
|
1637
|
-
|
1638
|
-
<h3>packages/components/eui-file-upload/utils/mime-types.ts</h3>
|
1639
|
-
<section data-compodoc="block-properties">
|
1640
|
-
<h3></h3> <table class="table table-sm table-bordered">
|
1633
|
+
<table class="table table-sm table-bordered">
|
1641
1634
|
<tbody>
|
1642
1635
|
<tr>
|
1643
1636
|
<td class="col-md-4">
|
@@ -1655,7 +1648,7 @@
|
|
1655
1648
|
const hex = uint8ArrayToHexString(header);
|
1656
1649
|
|
1657
1650
|
// map hex string to mime type
|
1658
|
-
if (hex.startsWith('
|
1651
|
+
if (hex.startsWith('ffd8ff')) return 'image/jpeg';
|
1659
1652
|
if (hex.startsWith('89504e47')) return 'image/png';
|
1660
1653
|
if (hex.startsWith('464c4946')) return 'image/flif';
|
1661
1654
|
if (hex.startsWith('67696d7020786366')) return 'image/x-xcf';
|
@@ -1667,15 +1660,10 @@
|
|
1667
1660
|
if (hex.startsWith('49491a0000004845415050')) return 'image/vnd.ms-photo';
|
1668
1661
|
if (hex.startsWith('38425053')) return 'image/vnd.adobe.photoshop';
|
1669
1662
|
if (hex.startsWith('06054b50')) return 'application/x-indesign';
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
if (hex.startsWith('504b0304')) return 'application/vnd.oasis.opendocument.presentation';
|
1675
|
-
if (hex.startsWith('504b0304')) return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
1676
|
-
if (hex.startsWith('504b0304')) return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
|
1677
|
-
if (hex.startsWith('504b0304')) return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
1678
|
-
if (hex.startsWith('504b0304')) return 'application/zip';
|
1663
|
+
// Handle ZIP-based formats by examining content
|
1664
|
+
if (hex.startsWith('504b0304')) {
|
1665
|
+
return identifyZipBasedFormat(header);
|
1666
|
+
}
|
1679
1667
|
if (hex.startsWith('7b2274797065223a226a736f6e227d')) return 'application/json';
|
1680
1668
|
if (hex.startsWith('7573746172')) return 'application/x-tar';
|
1681
1669
|
if (hex.startsWith('526172211a0700')) return 'application/x-rar-compressed';
|
@@ -1691,17 +1679,13 @@
|
|
1691
1679
|
if (hex.startsWith('52494646')) return 'video/vnd.avi';
|
1692
1680
|
if (hex.startsWith('52494646')) return 'audio/vnd.wave';
|
1693
1681
|
if (hex.startsWith('0a010301')) return 'audio/qcelp';
|
1694
|
-
if (hex.startsWith('3026b2758e66cf11')) return
|
1695
|
-
if (hex.startsWith('3026b2758e66cf11')) return 'video/x-ms-asf';
|
1696
|
-
if (hex.startsWith('3026b2758e66cf11')) return 'application/vnd.ms-asf';
|
1682
|
+
if (hex.startsWith('3026b2758e66cf11')) return identifyAsfFormat(header);
|
1697
1683
|
if (hex.startsWith('000001ba')) return 'video/mpeg';
|
1698
1684
|
if (hex.startsWith('00000020667479703367')) return 'video/3gpp';
|
1699
1685
|
if (hex.startsWith('494433')) return 'audio/mpeg';
|
1700
1686
|
if (hex.startsWith('00000020667479704d344120')) return 'audio/mp4';
|
1701
1687
|
if (hex.startsWith('4f707573')) return 'audio/opus';
|
1702
|
-
if (hex.startsWith('4f676753')) return
|
1703
|
-
if (hex.startsWith('4f676753')) return 'audio/ogg';
|
1704
|
-
if (hex.startsWith('4f676753')) return 'application/ogg';
|
1688
|
+
if (hex.startsWith('4f676753')) return identifyOggFormat(header);
|
1705
1689
|
if (hex.startsWith('664c6143')) return 'audio/x-flac';
|
1706
1690
|
if (hex.startsWith('4d414320')) return 'audio/ape';
|
1707
1691
|
if (hex.startsWith('7776706b')) return 'audio/wavpack';
|
@@ -1724,7 +1708,6 @@
|
|
1724
1708
|
if (hex.startsWith('fd377a585a00')) return 'application/x-xz';
|
1725
1709
|
if (hex.startsWith('53514c69746520666f726d6174203300')) return 'application/x-sqlite3';
|
1726
1710
|
if (hex.startsWith('4e45531a00000001')) return 'application/x-nintendo-nes-rom';
|
1727
|
-
if (hex.startsWith('504b0304')) return 'application/x-google-chrome-extension';
|
1728
1711
|
if (hex.startsWith('4d534346')) return 'application/vnd.ms-cab-compressed';
|
1729
1712
|
if (hex.startsWith('213c617263683e0a')) return 'application/x-deb';
|
1730
1713
|
if (hex.startsWith('1f8b08')) return 'application/x-unix-archive';
|
@@ -1746,10 +1729,7 @@
|
|
1746
1729
|
if (hex.startsWith('464f524d')) return 'audio/aiff';
|
1747
1730
|
if (hex.startsWith('3c3f786d6c20')) return 'application/xml';
|
1748
1731
|
if (hex.startsWith('424f4f4b4d4f4249')) return 'application/x-mobipocket-ebook';
|
1749
|
-
if (hex.startsWith('667479706174')) return
|
1750
|
-
if (hex.startsWith('667479706174')) return 'image/heif-sequence';
|
1751
|
-
if (hex.startsWith('667479706174')) return 'image/heic';
|
1752
|
-
if (hex.startsWith('667479706174')) return 'image/heic-sequence';
|
1732
|
+
if (hex.startsWith('667479706174')) return identifyHeifFormat(header);
|
1753
1733
|
if (hex.startsWith('4b545820')) return 'image/ktx';
|
1754
1734
|
if (hex.startsWith('4449434d')) return 'application/dicom';
|
1755
1735
|
if (hex.startsWith('4d50434b')) return 'audio/x-musepack';
|
@@ -1766,6 +1746,386 @@
|
|
1766
1746
|
</tr>
|
1767
1747
|
|
1768
1748
|
|
1749
|
+
</tbody>
|
1750
|
+
</table>
|
1751
|
+
<table class="table table-sm table-bordered">
|
1752
|
+
<tbody>
|
1753
|
+
<tr>
|
1754
|
+
<td class="col-md-4">
|
1755
|
+
<a name="identifyAsfFormat"></a>
|
1756
|
+
<span class="name">
|
1757
|
+
<span ><b>identifyAsfFormat</b></span>
|
1758
|
+
<a href="#identifyAsfFormat"><span class="icon ion-ios-link"></span></a>
|
1759
|
+
</span>
|
1760
|
+
</td>
|
1761
|
+
</tr>
|
1762
|
+
<tr>
|
1763
|
+
<td class="col-md-4">
|
1764
|
+
<i>Default value : </i><code>(data: Uint8Array): MimeType => {
|
1765
|
+
// ASF files all start with the same GUID: 3026b2758e66cf11a6d900aa0062ce6c
|
1766
|
+
// To distinguish between audio, video, and application ASF, we need to examine
|
1767
|
+
// the stream properties in the ASF header
|
1768
|
+
|
1769
|
+
try {
|
1770
|
+
// Look for stream properties object GUID starting at offset 30
|
1771
|
+
// Audio stream properties: b7dc0791a9b711cf8ee600c00c205365
|
1772
|
+
// Video stream properties: bc19efc05b4d11cf9b1100aa00bbcb8b
|
1773
|
+
|
1774
|
+
if (data.length < 100) {
|
1775
|
+
// Not enough data to analyze, default to application
|
1776
|
+
return 'application/vnd.ms-asf';
|
1777
|
+
}
|
1778
|
+
|
1779
|
+
const hex = uint8ArrayToHexString(data);
|
1780
|
+
|
1781
|
+
// Look for video stream properties GUID (indicates video content)
|
1782
|
+
if (hex.includes('bc19efc05b4d11cf9b1100aa00bbcb8b')) {
|
1783
|
+
return 'video/x-ms-asf';
|
1784
|
+
}
|
1785
|
+
|
1786
|
+
// Look for audio stream properties GUID (indicates audio content)
|
1787
|
+
if (hex.includes('b7dc0791a9b711cf8ee600c00c205365')) {
|
1788
|
+
return 'audio/x-ms-asf';
|
1789
|
+
}
|
1790
|
+
|
1791
|
+
// Check for Windows Media Audio/Video codec identifiers
|
1792
|
+
// WMA codec: 161 (0xa1) or 162 (0xa2) or 163 (0xa3)
|
1793
|
+
// WMV codec: Common values include various Windows Media Video identifiers
|
1794
|
+
|
1795
|
+
// Scan through the header for codec information
|
1796
|
+
for (let i = 0; i < Math.min(data.length - 4, 1000); i++) {
|
1797
|
+
// Look for audio codec indicators
|
1798
|
+
if (data[i] === 0xa1 || data[i] === 0xa2 || data[i] === 0xa3) {
|
1799
|
+
// Found WMA codec indicator
|
1800
|
+
return 'audio/x-ms-asf';
|
1801
|
+
}
|
1802
|
+
}
|
1803
|
+
|
1804
|
+
// Look for common video indicators in the first 1KB
|
1805
|
+
const textContent = new TextDecoder('utf-8', { fatal: false }).decode(data.slice(0, Math.min(1000, data.length)));
|
1806
|
+
|
1807
|
+
// Check for video-related strings
|
1808
|
+
if (textContent.toLowerCase().includes('video') ||
|
1809
|
+
textContent.toLowerCase().includes('wmv') ||
|
1810
|
+
textContent.toLowerCase().includes('mpeg')) {
|
1811
|
+
return 'video/x-ms-asf';
|
1812
|
+
}
|
1813
|
+
|
1814
|
+
// Check for audio-related strings
|
1815
|
+
if (textContent.toLowerCase().includes('audio') ||
|
1816
|
+
textContent.toLowerCase().includes('wma') ||
|
1817
|
+
textContent.toLowerCase().includes('music')) {
|
1818
|
+
return 'audio/x-ms-asf';
|
1819
|
+
}
|
1820
|
+
|
1821
|
+
// Default to application/vnd.ms-asf if we can't determine the specific type
|
1822
|
+
return 'application/vnd.ms-asf';
|
1823
|
+
|
1824
|
+
} catch {
|
1825
|
+
// If any error occurs during analysis, default to application type
|
1826
|
+
return 'application/vnd.ms-asf';
|
1827
|
+
}
|
1828
|
+
}</code>
|
1829
|
+
</td>
|
1830
|
+
</tr>
|
1831
|
+
|
1832
|
+
|
1833
|
+
</tbody>
|
1834
|
+
</table>
|
1835
|
+
<table class="table table-sm table-bordered">
|
1836
|
+
<tbody>
|
1837
|
+
<tr>
|
1838
|
+
<td class="col-md-4">
|
1839
|
+
<a name="identifyHeifFormat"></a>
|
1840
|
+
<span class="name">
|
1841
|
+
<span ><b>identifyHeifFormat</b></span>
|
1842
|
+
<a href="#identifyHeifFormat"><span class="icon ion-ios-link"></span></a>
|
1843
|
+
</span>
|
1844
|
+
</td>
|
1845
|
+
</tr>
|
1846
|
+
<tr>
|
1847
|
+
<td class="col-md-4">
|
1848
|
+
<i>Default value : </i><code>(data: Uint8Array): MimeType => {
|
1849
|
+
// HEIF/HEIC files all start with the same ftyp box signature: 667479706174
|
1850
|
+
// To distinguish between formats, we need to examine the brand and compatible brands
|
1851
|
+
// in the ftyp (file type) box
|
1852
|
+
|
1853
|
+
try {
|
1854
|
+
if (data.length < 20) {
|
1855
|
+
// Not enough data to analyze, default to HEIF
|
1856
|
+
return 'image/heif';
|
1857
|
+
}
|
1858
|
+
|
1859
|
+
const hex = uint8ArrayToHexString(data);
|
1860
|
+
|
1861
|
+
// The ftyp box structure:
|
1862
|
+
// Bytes 0-3: Box size (4 bytes)
|
1863
|
+
// Bytes 4-7: Box type "ftyp" (4 bytes) - 667479706174
|
1864
|
+
// Bytes 8-11: Major brand (4 bytes)
|
1865
|
+
// Bytes 12-15: Minor version (4 bytes)
|
1866
|
+
// Bytes 16+: Compatible brands (4 bytes each)
|
1867
|
+
|
1868
|
+
// Extract major brand (4 bytes starting at offset 8)
|
1869
|
+
// Convert to ASCII string for easier comparison
|
1870
|
+
const majorBrand = String.fromCharCode(
|
1871
|
+
data[8], data[9], data[10], data[11],
|
1872
|
+
);
|
1873
|
+
|
1874
|
+
// Look for compatible brands in the first 100 bytes
|
1875
|
+
const compatibleBrandsHex = hex.substring(32, Math.min(200, hex.length)); // Start after major brand + minor version
|
1876
|
+
|
1877
|
+
// HEIC brands: 'heic', 'heix', 'hevc', 'hevx'
|
1878
|
+
if (majorBrand === 'heic' ||
|
1879
|
+
compatibleBrandsHex.includes('68656963') || // 'heic'
|
1880
|
+
compatibleBrandsHex.includes('68656978') || // 'heix'
|
1881
|
+
compatibleBrandsHex.includes('68657663') || // 'hevc'
|
1882
|
+
compatibleBrandsHex.includes('68657678')) { // 'hevx'
|
1883
|
+
|
1884
|
+
// Check for sequence/animation indicators
|
1885
|
+
if (compatibleBrandsHex.includes('68657673') || // 'hevs' - HEIC sequence
|
1886
|
+
compatibleBrandsHex.includes('6d736631') || // 'msf1' - sequence
|
1887
|
+
majorBrand === 'hevs') {
|
1888
|
+
return 'image/heic-sequence';
|
1889
|
+
}
|
1890
|
+
|
1891
|
+
return 'image/heic';
|
1892
|
+
}
|
1893
|
+
|
1894
|
+
// HEIF brands: 'mif1', 'msf1'
|
1895
|
+
if (majorBrand === 'mif1' || majorBrand === 'msf1' ||
|
1896
|
+
compatibleBrandsHex.includes('6d696631') || // 'mif1'
|
1897
|
+
compatibleBrandsHex.includes('6d736631')) { // 'msf1'
|
1898
|
+
|
1899
|
+
// Check for sequence/animation indicators
|
1900
|
+
if (majorBrand === 'msf1' ||
|
1901
|
+
compatibleBrandsHex.includes('6d736631')) { // 'msf1' - sequence
|
1902
|
+
return 'image/heif-sequence';
|
1903
|
+
}
|
1904
|
+
|
1905
|
+
return 'image/heif';
|
1906
|
+
}
|
1907
|
+
|
1908
|
+
// Check for specific sequence indicators in the data
|
1909
|
+
if (hex.includes('6d736631') || // 'msf1' - multi-image sequence
|
1910
|
+
hex.includes('68657673')) { // 'hevs' - HEIC sequence
|
1911
|
+
|
1912
|
+
// If we find HEIC-related brands, it's HEIC sequence
|
1913
|
+
if (hex.includes('68656963') || hex.includes('68657663')) {
|
1914
|
+
return 'image/heic-sequence';
|
1915
|
+
}
|
1916
|
+
|
1917
|
+
return 'image/heif-sequence';
|
1918
|
+
}
|
1919
|
+
|
1920
|
+
// If we find HEIC indicators but no sequence, it's single HEIC
|
1921
|
+
if (hex.includes('68656963') || // 'heic'
|
1922
|
+
hex.includes('68657663') || // 'hevc'
|
1923
|
+
hex.includes('68656978') || // 'heix'
|
1924
|
+
hex.includes('68657678')) { // 'hevx'
|
1925
|
+
return 'image/heic';
|
1926
|
+
}
|
1927
|
+
|
1928
|
+
// Default to HEIF for any other case
|
1929
|
+
return 'image/heif';
|
1930
|
+
|
1931
|
+
} catch {
|
1932
|
+
// If any error occurs during analysis, default to HEIF
|
1933
|
+
return 'image/heif';
|
1934
|
+
}
|
1935
|
+
}</code>
|
1936
|
+
</td>
|
1937
|
+
</tr>
|
1938
|
+
|
1939
|
+
|
1940
|
+
</tbody>
|
1941
|
+
</table>
|
1942
|
+
<table class="table table-sm table-bordered">
|
1943
|
+
<tbody>
|
1944
|
+
<tr>
|
1945
|
+
<td class="col-md-4">
|
1946
|
+
<a name="identifyOggFormat"></a>
|
1947
|
+
<span class="name">
|
1948
|
+
<span ><b>identifyOggFormat</b></span>
|
1949
|
+
<a href="#identifyOggFormat"><span class="icon ion-ios-link"></span></a>
|
1950
|
+
</span>
|
1951
|
+
</td>
|
1952
|
+
</tr>
|
1953
|
+
<tr>
|
1954
|
+
<td class="col-md-4">
|
1955
|
+
<i>Default value : </i><code>(data: Uint8Array): MimeType => {
|
1956
|
+
// OGG files all start with "OggS" (4f676753) but can contain different codecs
|
1957
|
+
// To distinguish between audio, video, and application OGG, we need to examine
|
1958
|
+
// the codec information in the OGG page headers
|
1959
|
+
|
1960
|
+
try {
|
1961
|
+
if (data.length < 64) {
|
1962
|
+
// Not enough data to analyze, default to audio
|
1963
|
+
return 'audio/ogg';
|
1964
|
+
}
|
1965
|
+
|
1966
|
+
const hex = uint8ArrayToHexString(data);
|
1967
|
+
|
1968
|
+
// Look for codec identification patterns in the first few hundred bytes
|
1969
|
+
// Common video codecs in OGG:
|
1970
|
+
// - Theora: "theora" or "\x80theora"
|
1971
|
+
// - VP8/VP9: various signatures
|
1972
|
+
// - Dirac: "BBCD"
|
1973
|
+
|
1974
|
+
// Common audio codecs in OGG:
|
1975
|
+
// - Vorbis: "vorbis" or "\x01vorbis"
|
1976
|
+
// - Opus: "OpusHead"
|
1977
|
+
// - FLAC: "fLaC"
|
1978
|
+
// - Speex: "Speex"
|
1979
|
+
|
1980
|
+
// Convert some bytes to text for string matching
|
1981
|
+
const textContent = new TextDecoder('utf-8', { fatal: false }).decode(data.slice(0, Math.min(512, data.length)));
|
1982
|
+
const lowerContent = textContent.toLowerCase();
|
1983
|
+
|
1984
|
+
// Check for video codec indicators first (as they're more specific)
|
1985
|
+
if (lowerContent.includes('theora') ||
|
1986
|
+
hex.includes('8074686f726120') || // "\x80theora "
|
1987
|
+
hex.includes('7468656f7261') || // "theora"
|
1988
|
+
lowerContent.includes('dirac') ||
|
1989
|
+
hex.includes('42424344') || // "BBCD" - Dirac
|
1990
|
+
lowerContent.includes('vp8') ||
|
1991
|
+
lowerContent.includes('vp9')) {
|
1992
|
+
return 'video/ogg';
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
// Check for audio codec indicators
|
1996
|
+
if (lowerContent.includes('vorbis') ||
|
1997
|
+
hex.includes('01766f72626973') || // "\x01vorbis"
|
1998
|
+
hex.includes('766f72626973') || // "vorbis"
|
1999
|
+
lowerContent.includes('opushead') ||
|
2000
|
+
hex.includes('4f7075734865616420') || // "OpusHead "
|
2001
|
+
lowerContent.includes('speex') ||
|
2002
|
+
hex.includes('53706565782020') || // "Speex "
|
2003
|
+
lowerContent.includes('flac') ||
|
2004
|
+
hex.includes('664c6143')) { // "fLaC"
|
2005
|
+
return 'audio/ogg';
|
2006
|
+
}
|
2007
|
+
|
2008
|
+
// Look for OGG stream structure patterns
|
2009
|
+
// OGG pages have a specific structure, look for multiple "OggS" signatures
|
2010
|
+
// which might indicate a complex multimedia container
|
2011
|
+
let oggSCount = 0;
|
2012
|
+
for (let i = 0; i < Math.min(data.length - 4, 1000); i += 4) {
|
2013
|
+
if (data[i] === 0x4f && data[i + 1] === 0x67 &&
|
2014
|
+
data[i + 2] === 0x67 && data[i + 3] === 0x53) {
|
2015
|
+
oggSCount++;
|
2016
|
+
}
|
2017
|
+
}
|
2018
|
+
|
2019
|
+
// Multiple OGG pages might indicate a more complex application format
|
2020
|
+
if (oggSCount > 3) {
|
2021
|
+
// Check if it's likely a multimedia container vs pure audio/video
|
2022
|
+
if (lowerContent.includes('application') ||
|
2023
|
+
lowerContent.includes('metadata') ||
|
2024
|
+
lowerContent.includes('index') ||
|
2025
|
+
(!lowerContent.includes('audio') && !lowerContent.includes('video') &&
|
2026
|
+
!lowerContent.includes('vorbis') && !lowerContent.includes('theora'))) {
|
2027
|
+
return 'application/ogg';
|
2028
|
+
}
|
2029
|
+
}
|
2030
|
+
|
2031
|
+
// Look for file extension hints in metadata (if present)
|
2032
|
+
if (lowerContent.includes('.ogv') || lowerContent.includes('video')) {
|
2033
|
+
return 'video/ogg';
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
if (lowerContent.includes('.oga') || lowerContent.includes('audio') || lowerContent.includes('music')) {
|
2037
|
+
return 'audio/ogg';
|
2038
|
+
}
|
2039
|
+
|
2040
|
+
// Check the OGG page header flags
|
2041
|
+
// Byte 5 in OGG page header contains flags
|
2042
|
+
// If we have enough data, check the stream type
|
2043
|
+
if (data.length > 26) {
|
2044
|
+
const pageHeaderType = data[5];
|
2045
|
+
// Fresh packet start (0x02) often indicates beginning of codec data
|
2046
|
+
if ((pageHeaderType & 0x02) === 0x02) {
|
2047
|
+
// Look at the packet data starting around byte 27
|
2048
|
+
const packetStart = data.slice(27, Math.min(data.length, 50));
|
2049
|
+
const packetHex = uint8ArrayToHexString(packetStart);
|
2050
|
+
|
2051
|
+
// Check for Vorbis identification header
|
2052
|
+
if (packetHex.startsWith('01766f72626973')) {
|
2053
|
+
return 'audio/ogg';
|
2054
|
+
}
|
2055
|
+
|
2056
|
+
// Check for Theora identification header
|
2057
|
+
if (packetHex.startsWith('8074686f726120')) {
|
2058
|
+
return 'video/ogg';
|
2059
|
+
}
|
2060
|
+
}
|
2061
|
+
}
|
2062
|
+
|
2063
|
+
// Default to audio/ogg as it's the most common OGG format
|
2064
|
+
return 'audio/ogg';
|
2065
|
+
|
2066
|
+
} catch {
|
2067
|
+
// If any error occurs during analysis, default to audio
|
2068
|
+
return 'audio/ogg';
|
2069
|
+
}
|
2070
|
+
}</code>
|
2071
|
+
</td>
|
2072
|
+
</tr>
|
2073
|
+
|
2074
|
+
|
2075
|
+
</tbody>
|
2076
|
+
</table>
|
2077
|
+
<table class="table table-sm table-bordered">
|
2078
|
+
<tbody>
|
2079
|
+
<tr>
|
2080
|
+
<td class="col-md-4">
|
2081
|
+
<a name="identifyZipBasedFormat"></a>
|
2082
|
+
<span class="name">
|
2083
|
+
<span ><b>identifyZipBasedFormat</b></span>
|
2084
|
+
<a href="#identifyZipBasedFormat"><span class="icon ion-ios-link"></span></a>
|
2085
|
+
</span>
|
2086
|
+
</td>
|
2087
|
+
</tr>
|
2088
|
+
<tr>
|
2089
|
+
<td class="col-md-4">
|
2090
|
+
<i>Default value : </i><code>(data: Uint8Array): MimeType => {
|
2091
|
+
try {
|
2092
|
+
const fileEntries = extractZipFileList(data);
|
2093
|
+
|
2094
|
+
// Chrome extension
|
2095
|
+
if (fileEntries.includes('manifest.json')) {
|
2096
|
+
return 'application/x-google-chrome-extension';
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
// EPUB
|
2100
|
+
if (fileEntries.includes('META-INF/container.xml') || fileEntries.includes('mimetype')) {
|
2101
|
+
return 'application/epub+zip';
|
2102
|
+
}
|
2103
|
+
|
2104
|
+
// OpenDocument formats
|
2105
|
+
if (fileEntries.includes('META-INF/manifest.xml')) {
|
2106
|
+
if (fileEntries.some(f => f.endsWith('.odp'))) return 'application/vnd.oasis.opendocument.presentation';
|
2107
|
+
if (fileEntries.some(f => f.endsWith('.ods'))) return 'application/vnd.oasis.opendocument.spreadsheet';
|
2108
|
+
if (fileEntries.some(f => f.endsWith('.odt'))) return 'application/vnd.oasis.opendocument.text';
|
2109
|
+
}
|
2110
|
+
|
2111
|
+
// Microsoft Office formats
|
2112
|
+
if (fileEntries.includes('[Content_Types].xml')) {
|
2113
|
+
if (fileEntries.includes('ppt/presentation.xml')) return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
|
2114
|
+
if (fileEntries.includes('xl/workbook.xml')) return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
2115
|
+
if (fileEntries.includes('word/document.xml')) return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
2116
|
+
}
|
2117
|
+
|
2118
|
+
// Default to generic ZIP
|
2119
|
+
return 'application/zip';
|
2120
|
+
|
2121
|
+
} catch {
|
2122
|
+
return 'application/zip';
|
2123
|
+
}
|
2124
|
+
}</code>
|
2125
|
+
</td>
|
2126
|
+
</tr>
|
2127
|
+
|
2128
|
+
|
1769
2129
|
</tbody>
|
1770
2130
|
</table>
|
1771
2131
|
<table class="table table-sm table-bordered">
|
@@ -1788,6 +2148,74 @@
|
|
1788
2148
|
</tr>
|
1789
2149
|
|
1790
2150
|
|
2151
|
+
</tbody>
|
2152
|
+
</table>
|
2153
|
+
</section>
|
2154
|
+
<h3>packages/components/externals/quill/quill-editor.component.ts</h3>
|
2155
|
+
<section data-compodoc="block-properties">
|
2156
|
+
<h3></h3> <table class="table table-sm table-bordered">
|
2157
|
+
<tbody>
|
2158
|
+
<tr>
|
2159
|
+
<td class="col-md-4">
|
2160
|
+
<a name="getFormat"></a>
|
2161
|
+
<span class="name">
|
2162
|
+
<span ><b>getFormat</b></span>
|
2163
|
+
<a href="#getFormat"><span class="icon ion-ios-link"></span></a>
|
2164
|
+
</span>
|
2165
|
+
</td>
|
2166
|
+
</tr>
|
2167
|
+
<tr>
|
2168
|
+
<td class="col-md-4">
|
2169
|
+
<i>Default value : </i><code>(format?: QuillFormat, configFormat?: QuillFormat): QuillFormat => {
|
2170
|
+
const passedFormat = format || configFormat;
|
2171
|
+
return passedFormat || 'html';
|
2172
|
+
}</code>
|
2173
|
+
</td>
|
2174
|
+
</tr>
|
2175
|
+
|
2176
|
+
|
2177
|
+
</tbody>
|
2178
|
+
</table>
|
2179
|
+
<table class="table table-sm table-bordered">
|
2180
|
+
<tbody>
|
2181
|
+
<tr>
|
2182
|
+
<td class="col-md-4">
|
2183
|
+
<a name="Quill"></a>
|
2184
|
+
<span class="name">
|
2185
|
+
<span ><b>Quill</b></span>
|
2186
|
+
<a href="#Quill"><span class="icon ion-ios-link"></span></a>
|
2187
|
+
</span>
|
2188
|
+
</td>
|
2189
|
+
</tr>
|
2190
|
+
<tr>
|
2191
|
+
<td class="col-md-4">
|
2192
|
+
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
2193
|
+
|
2194
|
+
</td>
|
2195
|
+
</tr>
|
2196
|
+
|
2197
|
+
|
2198
|
+
</tbody>
|
2199
|
+
</table>
|
2200
|
+
<table class="table table-sm table-bordered">
|
2201
|
+
<tbody>
|
2202
|
+
<tr>
|
2203
|
+
<td class="col-md-4">
|
2204
|
+
<a name="require"></a>
|
2205
|
+
<span class="name">
|
2206
|
+
<span ><b>require</b></span>
|
2207
|
+
<a href="#require"><span class="icon ion-ios-link"></span></a>
|
2208
|
+
</span>
|
2209
|
+
</td>
|
2210
|
+
</tr>
|
2211
|
+
<tr>
|
2212
|
+
<td class="col-md-4">
|
2213
|
+
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
2214
|
+
|
2215
|
+
</td>
|
2216
|
+
</tr>
|
2217
|
+
|
2218
|
+
|
1791
2219
|
</tbody>
|
1792
2220
|
</table>
|
1793
2221
|
</section>
|